model_server/driver_aset/src/driver.cxx
// deassigns specified category on selected objects
// if category is null, deassign visible category on
// selected objects.
deassigns specified category on selected objects
if category is null, deassign visible category on
selected objects.
deassigns specified category on selected objects if category is null deassign visible category on selected objects .
void driver::deassign_category (viewPtr v, steSlotPtr slot)
{
    Initialize(driver::deassign_category);
    start_transaction () {
	update_selection( v, 0 );
	objArr selected_nodes;
	fill_array_with_selected_appnodes( v, selected_nodes );
        appTreePtr an;	
        char *nm = ( slot ) ? slot->get_name() : 0 ;
        appPtr h = NULL;
	ldrPtr lh = view_get_ldr(v);
	if ( lh )
	   h = ldr_get_app( lh );
	if (selected_nodes.size() > 0) {
	    unselect( v );
	    Obj *el1;
	    ForEach (el1, selected_nodes) {
		an = checked_cast(appTree,el1);
		style_manual_remove( an, nm, 1 );
	    }
	    if (h) h->set_modified();
	}else{
            OperPoint *pt = v->insertion_point();
            if (pt) {
               if (!pt->node.isnull()){
                  an = checked_cast(appTree,pt->node);
                  int res = style_manual_find_remove( an, nm, 1);
                  if ( res )
                     if (h) h->set_modified();
               }
               delete pt;
            }
        }
    } end_transaction();
}
void driver :: deassign_category ( viewPtr v , steSlotPtr slot ) { Initialize ( driver :: deassign_category ) ; start_transaction ( ) { update_selection ( v , 0 ) ; objArr selected_nodes ; fill_array_with_selected_appnodes ( v , selected_nodes ) ; appTreePtr an ; char * nm = ( slot ) ? slot -> get_name ( ) : 0 ; appPtr h = NULL ; ldrPtr lh = view_get_ldr ( v ) ; if ( lh ) h = ldr_get_app ( lh ) ; if ( selected_nodes . size ( ) > 0 ) { unselect ( v ) ; Obj * el1 ; ForEach ( el1 , selected_nodes ) { an = checked_cast ( appTree , el1 ) ; style_manual_remove ( an , nm , 1 ) ; } if ( h ) h -> set_modified ( ) ; } else { OperPoint * pt = v -> insertion_point ( ) ; if ( pt ) { if ( ! pt -> node . isnull ( ) ) { an = checked_cast ( appTree , pt -> node ) ; int res = style_manual_find_remove ( an , nm , 1 ) ; if ( res ) if ( h ) h -> set_modified ( ) ; } delete pt ; } } } end_transaction ( ) ; }
deassigns specified category on selected objects
if category is null, deassign visible category on
selected objects.
deassigns specified category on selected objects if category is null deassign visible category on selected objects .
// set app modified  --boris