model_server/gra/src/graSymbol.h.cxx
//------------------------------------------
// find_insertion
//
// This function determines the semantically closest symbol node to the
// line segment selected on a connector.
//------------------------------------------
find_insertion
This function determines the semantically closest symbol node to the
line segment selected on a connector.
find_insertion This function determines the semantically closest symbol node to the line segment selected on a connector .
void graConnectionSymbol::find_insertion(
    graWindow*,
    Graphic** selected, int num_selected,
    viewSelection* selection)
{
    static graLayerNo attach[] =
    {
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationCR,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationUL,	
	graLayerNoDecorationLR,	
	graLayerNoDecorationLL,	
	graLayerNoDecorationUR,	
	graLayerNoDecorationCR,	
	graLayerNoDecorationCL,	
	graLayerNoDecorationUC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationCR,	
	graLayerNoDecorationCL,	
	graLayerNoDecorationCL,	
	graLayerNoDecorationCL,	
	graLayerNoDecorationCR,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationLC,	
	graLayerNoDecorationCL	
    };
    int i, j;
    Initialize (graConnectionSymbol::find_insertion);
    selection->view_node  = NULL;
    selection->connector  = this->get_viewnode ();
    selection->sub_type  = 0;
    if ( segments == NULL )
	return;
    for ( i = 1; i < num_segments; i += 2 )
    {
        for ( j = 0; j < num_selected; j++ )
	{
            if ( segments[i].line == (Line*)selected[j] )
	    {
	        selection->view_node = segments[i].viewnode;
		return;
	    }
        }
    }
    for ( i = 0; i < num_segments; i += 2 )
    {
        for ( j=0; j<num_selected; j++ )
	{
            if ( segments[i].line == (Line*)selected[j] )
	    {
		if ( i == 0 )	
		{
 		    selection->view_node = segments[i].viewnode;
                    selection->connector = NULL;
                    selection->sub_type = attach[
			checked_cast(viewConnectionNode,get_viewnode())->
			map_symbol()];
		    return;
		}
		else		
		{
		    selection->view_node = segments[i - 1].viewnode;
		    return;
	  	}
	    }
        }
    }
}
void graConnectionSymbol :: find_insertion ( graWindow * , Graphic * * selected , int num_selected , viewSelection * selection ) { static graLayerNo attach [ ] = { graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationCR , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationUL , graLayerNoDecorationLR , graLayerNoDecorationLL , graLayerNoDecorationUR , graLayerNoDecorationCR , graLayerNoDecorationCL , graLayerNoDecorationUC , graLayerNoDecorationLC , graLayerNoDecorationCR , graLayerNoDecorationCL , graLayerNoDecorationCL , graLayerNoDecorationCL , graLayerNoDecorationCR , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationLC , graLayerNoDecorationCL } ; int i , j ; Initialize ( graConnectionSymbol :: find_insertion ) ; selection -> view_node = NULL ; selection -> connector = this -> get_viewnode ( ) ; selection -> sub_type = 0 ; if ( segments == NULL ) return ; for ( i = 1 ; i < num_segments ; i += 2 ) { for ( j = 0 ; j < num_selected ; j ++ ) { if ( segments [ i ] . line == ( Line * ) selected [ j ] ) { selection -> view_node = segments [ i ] . viewnode ; return ; } } } for ( i = 0 ; i < num_segments ; i += 2 ) { for ( j = 0 ; j < num_selected ; j ++ ) { if ( segments [ i ] . line == ( Line * ) selected [ j ] ) { if ( i == 0 ) { selection -> view_node = segments [ i ] . viewnode ; selection -> connector = NULL ; selection -> sub_type = attach [ checked_cast ( viewConnectionNode , get_viewnode ( ) ) -> map_symbol ( ) ] ; return ; } else { selection -> view_node = segments [ i - 1 ] . viewnode ; return ; } } } } }
find_insertion
This function determines the semantically closest symbol node to the
line segment selected on a connector.
find_insertion This function determines the semantically closest symbol node to the line segment selected on a connector .
// ldrcHIERARCHY // ldrcTRUE_BRANCH // ldrcFALSE_BRANCH // ldrcENDIF // ldrcFOR_BODY // ldrcSEQUENCE // ldrcSUPERCLASS_LIST // ldrcSUBCLASS_LIST // ldrcMEMBER_LIST // ldrcCONTAINER // ldrcREL_LIST_OUT // ldrcREL_LIST_IN // ldrcINVARIANT // ldrcENDELSE // ldrcIF_ELSE // ldrcLOOP_DO // ldrcLEFT_HORIZONTAL // ldrcCASE_EXIT // ldrcTREE // ldrcREL_OUT_1_OPT, // ldrcREL_OUT_N_OPT, // ldrcREL_OUT_1_REQ, // ldrcREL_OUT_N_REQ, // ldrcREL_IN_1_OPT, // ldrcREL_IN_N_OPT, // ldrcREL_IN_1_REQ, // ldrcREL_IN_N_REQ, // ldrcERD_INHERITANCE, // ldrcERD_RELATION, // ldrcERD_IDENTITY, // ldrcUP_TREE // Handle picking on odd line segments // Handle picking of even line segments // First line segment picked // Last two line segments picked