|
OGR
|
#include <ogr_featurestyle.h>
Public Member Functions | |
| OGRStyleMgr (OGRStyleTable *poDataSetStyleTable=nullptr) | |
| Constructor. More... | |
| ~OGRStyleMgr () | |
| Destructor. More... | |
| GBool | SetFeatureStyleString (OGRFeature *, const char *pszStyleString=nullptr, GBool bNoMatching=FALSE) |
| Set a style in a feature. More... | |
| const char * | InitFromFeature (OGRFeature *) |
| Initialize style manager from the style string of a feature. More... | |
| GBool | InitStyleString (const char *pszStyleString=nullptr) |
| Initialize style manager from the style string. More... | |
| const char * | GetStyleName (const char *pszStyleString=nullptr) |
| Get the name of a style from the style table. More... | |
| const char * | GetStyleByName (const char *pszStyleName) |
| find a style in the current style table. More... | |
| GBool | AddStyle (const char *pszStyleName, const char *pszStyleString=nullptr) |
| Add a style to the current style table. More... | |
| const char * | GetStyleString (OGRFeature *=nullptr) |
| Get the style string from the style manager. More... | |
| GBool | AddPart (OGRStyleTool *) |
| Add a part (style tool) to the current style. More... | |
| GBool | AddPart (const char *) |
| Add a part (style string) to the current style. More... | |
| int | GetPartCount (const char *pszStyleString=nullptr) |
| Get the number of parts in a style. More... | |
| OGRStyleTool * | GetPart (int hPartId, const char *pszStyleString=nullptr) |
| Fetch a part (style tool) from the current style. More... | |
This class represents a style manager
|
explicit |
Constructor.
This method is the same as the C function OGR_SM_Create()
| poDataSetStyleTable | (currently unused, reserved for future use), pointer to OGRStyleTable. Pass NULL for now. |
| OGRStyleMgr::~OGRStyleMgr | ( | ) |
| GBool OGRStyleMgr::AddPart | ( | OGRStyleTool * | poStyleTool | ) |
Add a part (style tool) to the current style.
This method is the same as the C function OGR_SM_AddPart().
| poStyleTool | the style tool defining the part to add. |
References CPLFree, CPLStrdup(), and OGRStyleTool::GetStyleString().
| GBool OGRStyleMgr::AddPart | ( | const char * | pszPart | ) |
Add a part (style string) to the current style.
| pszPart | the style string defining the part to add. |
References CPLFree, and CPLStrdup().
| GBool OGRStyleMgr::AddStyle | ( | const char * | pszStyleName, |
| const char * | pszStyleString = nullptr |
||
| ) |
Add a style to the current style table.
This method is the same as the C function OGR_SM_AddStyle().
| pszStyleName | the name of the style to add. |
| pszStyleString | the style string to use, or NULL to use the style stored in the manager. |
References OGRStyleTable::AddStyle().
| OGRStyleTool * OGRStyleMgr::GetPart | ( | int | nPartId, |
| const char * | pszStyleString = nullptr |
||
| ) |
Fetch a part (style tool) from the current style.
This method is the same as the C function OGR_SM_GetPart().
This method instantiates a new object that should be freed with OGR_ST_Destroy().
| nPartId | the part number (0-based index). |
| pszStyleString | (optional) the style string on which to operate. If NULL then the current style string stored in the style manager is used. |
References CSLDestroy(), CSLGetField(), CSLT_HONOURSTRINGS, CSLT_PRESERVEESCAPES, CSLT_PRESERVEQUOTES, CSLTokenizeString2(), and OGRStyleTool::SetStyleString().
| int OGRStyleMgr::GetPartCount | ( | const char * | pszStyleString = nullptr | ) |
Get the number of parts in a style.
This method is the same as the C function OGR_SM_GetPartCount().
| pszStyleString | (optional) the style string on which to operate. If NULL then the current style string stored in the style manager is used. |
| const char * OGRStyleMgr::GetStyleByName | ( | const char * | pszStyleName | ) |
find a style in the current style table.
| pszStyleName | the name of the style to add. |
References OGRStyleTable::Find().
Referenced by InitStyleString().
| const char * OGRStyleMgr::GetStyleName | ( | const char * | pszStyleString = nullptr | ) |
Get the name of a style from the style table.
| pszStyleString | the style to search for, or NULL to use the style currently stored in the manager. |
References OGRStyleTable::GetStyleName().
Referenced by SetFeatureStyleString().
| const char * OGRStyleMgr::GetStyleString | ( | OGRFeature * | poFeature = nullptr | ) |
Get the style string from the style manager.
| poFeature | feature object from which to read the style or NULL to get the style string stored in the manager. |
NOTE: this method will call OGRStyleMgr::InitFromFeature() if poFeature is not NULL and replace the style string stored in the style manager
References InitFromFeature().
| const char * OGRStyleMgr::InitFromFeature | ( | OGRFeature * | poFeature | ) |
Initialize style manager from the style string of a feature.
This method is the same as the C function OGR_SM_InitFromFeature().
| poFeature | feature object from which to read the style. |
References CPLFree, OGRFeature::GetStyleString(), and InitStyleString().
Referenced by GetStyleString().
| GBool OGRStyleMgr::InitStyleString | ( | const char * | pszStyleString = nullptr | ) |
Initialize style manager from the style string.
This method is the same as the C function OGR_SM_InitStyleString().
| pszStyleString | the style string to use (can be NULL). |
References CPLFree, CPLStrdup(), and GetStyleByName().
Referenced by InitFromFeature().
| GBool OGRStyleMgr::SetFeatureStyleString | ( | OGRFeature * | poFeature, |
| const char * | pszStyleString = nullptr, |
||
| GBool | bNoMatching = FALSE |
||
| ) |
Set a style in a feature.
| poFeature | the feature object to store the style in |
| pszStyleString | the style to store |
| bNoMatching | TRUE to lookup the style in the style table and add the name to the feature |
References GetStyleName(), and OGRFeature::SetStyleString().
1.8.14.