model_server/gra/src/graSymbol.h.cxx
//------------------------------------------
// get_symbol_size
//
// This function gets the center of the symbol and its width and height
//------------------------------------------
get_symbol_size
This function gets the center of the symbol and its width and height
get_symbol_size This function gets the center of the symbol and its width and height
void graParametricSymbol::get_symbol_size(
    float &centerx, float &centery, float &width, float &height,
    bool include_text)
{
    Initialize (graParametricSymbol::get_symbol_size);
    float llx, lly, urx, ury;
    if (this->symbol != -1)
    {
	get_pictel(0)->GetBounds (llx, lly, urx, ury);
	width = urx - llx;
	height = ury - lly;
	get_pictel(0)->GetCenter (centerx, centery);
	if (text_mode == graTextModeInside ||
	    text_mode == graTextModeInsideNoBox ||
	    include_text)
	{
	    width += text_width;
	    centerx += text_width / 2;
	}
	if (text_height != 0) {
	   float scale = text_height / 13.0;
	   height *= scale;
	   centery *= scale;
	}
    }
    else
    {
	Graphic* label = NULL;
	centerx = centery = width = height = 0.0;
	for (int i = 0; i < GRA_MAX_MODES; i++)
	    if (param_overlay[i])
	    {
		label = param_overlay[i]->First();
		break;
	    }
	if (label)
	{
	    label->GetBounds (llx, lly, urx, ury);
	    height = ury - lly;
	}
    }
}
void graParametricSymbol :: get_symbol_size ( float & centerx , float & centery , float & width , float & height , bool include_text ) { Initialize ( graParametricSymbol :: get_symbol_size ) ; float llx , lly , urx , ury ; if ( this -> symbol != -1 ) { get_pictel ( 0 ) -> GetBounds ( llx , lly , urx , ury ) ; width = urx - llx ; height = ury - lly ; get_pictel ( 0 ) -> GetCenter ( centerx , centery ) ; if ( text_mode == graTextModeInside || text_mode == graTextModeInsideNoBox || include_text ) { width += text_width ; centerx += text_width / 2 ; } if ( text_height != 0 ) { float scale = text_height / 13.0 ; height *= scale ; centery *= scale ; } } else { Graphic * label = NULL ; centerx = centery = width = height = 0.0 ; for ( int i = 0 ; i < GRA_MAX_MODES ; i ++ ) if ( param_overlay [ i ] ) { label = param_overlay [ i ] -> First ( ) ; break ; } if ( label ) { label -> GetBounds ( llx , lly , urx , ury ) ; height = ury - lly ; } } }
get_symbol_size
This function gets the center of the symbol and its width and height
get_symbol_size This function gets the center of the symbol and its width and height
// ignore text width for Positioned mode // Account for fonts larger or smaller than 12 pixels // get the height of the label