model_server/driver_aset/src/driver.cxx
//------------------------------------------
// cut
//
// Cut selected objects in a specified view.
// Cut all selected objects if specified view
// is null.
//------------------------------------------
cut
Cut selected objects in a specified view.
Cut all selected objects if specified view
is null.
cut Cut selected objects in a specified view . Cut all selected objects if specified view is null .
void driver::cut (viewPtr vvv, viewTreePtr node)
{
    Initialize(driver::cut);
    if( vvv && is_steView(vvv) )
    {
	steBufferPtr b = checked_cast(steBuffer,get_relation(view_buffer,vvv));
	if(b)
	{
	    genString kill;
	    kill.printf("(%s %d)", "di-kill-selections", b->get_buffer());
	    ste_epoch_evaluate(kill);
	}
	return;
    }
    cmd_transaction ct;
    if(ct.on){
      IF(node);
      cmd_record_view(vvv);
      cmd_dr_gen("dr_cut();");
    }
    objArr      nodes_to_cut;
    opened_node = NULL;
    start_transaction(){
	if (node == NULL) {
	    update_selection (vvv, 0);
	    fill_array_with_selected_appnodes (vvv, nodes_to_cut);
	    for (int i=0; i < nodes_to_cut.size();)
	    {
		if (! (is_steTextNode (RelationalPtr(nodes_to_cut[i])) ||
		       is_smtTree (RelationalPtr(nodes_to_cut[i]))) )
		    nodes_to_cut.remove ((Obj *) nodes_to_cut[i]);
		else
		    i++;
	    }
	} else {
	    ldrTreePtr ldr_tree = node->get_ldrTree();
	    appTreePtr app_tree = ldr_tree ? ldr_tree->get_appTree() : NULL;
	    if (!app_tree)
	    {
		ldr_tree = checked_cast(ldrTree,ldr_tree->get_parent());
		app_tree = ldr_tree ? ldr_tree->get_appTree() : NULL;
	    }
	    if (app_tree)
	    {
		if (is_ddElement(app_tree))
		    app_tree = checked_cast(appTree,get_relation(def_smt_of_dd, app_tree));
		if (is_smtTree(app_tree) || is_steTextNode(app_tree))
		    nodes_to_cut.insert_last (app_tree);
	    }
	}
	if (nodes_to_cut.size())
	    scrapbook_instance->cut (nodes_to_cut, 0);
	else
	    dis_message (C_DRIVER, MSG_ERROR, "M_NOSELECTIONCUT");
	if ( !node )
	    unselect (vvv);
    } end_transaction();
}
void driver :: cut ( viewPtr vvv , viewTreePtr node ) { Initialize ( driver :: cut ) ; if ( vvv && is_steView ( vvv ) ) { steBufferPtr b = checked_cast ( steBuffer , get_relation ( view_buffer , vvv ) ) ; if ( b ) { genString kill ; kill . printf ( " " , " " , b -> get_buffer ( ) ) ; ste_epoch_evaluate ( kill ) ; } return ; } cmd_transaction ct ; if ( ct . on ) { IF ( node ) ; cmd_record_view ( vvv ) ; cmd_dr_gen ( " " ) ; } objArr nodes_to_cut ; opened_node = NULL ; start_transaction ( ) { if ( node == NULL ) { update_selection ( vvv , 0 ) ; fill_array_with_selected_appnodes ( vvv , nodes_to_cut ) ; for ( int i = 0 ; i < nodes_to_cut . size ( ) ; ) { if ( ! ( is_steTextNode ( RelationalPtr ( nodes_to_cut [ i ] ) ) || is_smtTree ( RelationalPtr ( nodes_to_cut [ i ] ) ) ) ) nodes_to_cut . remove ( ( Obj * ) nodes_to_cut [ i ] ) ; else i ++ ; } } else { ldrTreePtr ldr_tree = node -> get_ldrTree ( ) ; appTreePtr app_tree = ldr_tree ? ldr_tree -> get_appTree ( ) : NULL ; if ( ! app_tree ) { ldr_tree = checked_cast ( ldrTree , ldr_tree -> get_parent ( ) ) ; app_tree = ldr_tree ? ldr_tree -> get_appTree ( ) : NULL ; } if ( app_tree ) { if ( is_ddElement ( app_tree ) ) app_tree = checked_cast ( appTree , get_relation ( def_smt_of_dd , app_tree ) ) ; if ( is_smtTree ( app_tree ) || is_steTextNode ( app_tree ) ) nodes_to_cut . insert_last ( app_tree ) ; } } if ( nodes_to_cut . size ( ) ) scrapbook_instance -> cut ( nodes_to_cut , 0 ) ; else dis_message ( C_DRIVER , MSG_ERROR , " " ) ; if ( ! node ) unselect ( vvv ) ; } end_transaction ( ) ; }
cut
Cut selected objects in a specified view.
cut Cut selected objects in a specified view .