[Gdal-dev] Quick Question Regarding Style String Management

Frank Warmerdam warmerdam at pobox.com
Sat May 15 12:58:03 EDT 2004


L Pool wrote:
> Hi Frank,
> 
> I've got a quick question for you - regarding the code below: which of these
> objects should I delete when I'm finished with it - the Style Manager and
> the Style Tool or just the Style Manager?
> 
>       OGRStyleTable oStyleTable;
>       OGRStyleTool* poStyleTool;
>       OGRStyleMgr*  poStyleMgr = new OGRStyleMgr(&oStyleTable);
> 
>       poStyleMgr->GetStyleString(poFeature);
>       for (int k=0; k < poStyleMgr->GetPartCount(); k++)
>       {
>          poStyleTool = poStyleMgr->GetPart(k);
>          switch(poStyleTool->GetType())
>          {
>            case OGRSTCNone: cout << "Tool Type: None" << endl;
>             break;
>            case OGRSTCPen: cout << "Tool Type: Pen" << endl;
>             break;
>            case OGRSTCBrush: cout << "Tool Type: Brush" << endl;
>             break;
>            case OGRSTCSymbol: cout << "Tool Type: Symbol" << endl;
>             break;
>            case OGRSTCLabel: cout << "Tool Type: Label" << endl;
>             break;
>          }
>       }
> 
> Thanks in advance,

Louis,

You need to delete the style tool and the style manager.  I see the
style API has no reference documentation.  That sucks.

> BTW: Everything seems to be working super now with the new OpenEV_FW
> binaries.

Sweet.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list