30#ifndef OGR_FEATURESTYLE_INCLUDE
31#define OGR_FEATURESTYLE_INCLUDE
60typedef struct ogr_style_param
68typedef struct ogr_style_value
87 char **m_papszStyleTable;
95 GBool AddStyle(
const char *pszName,
const char *pszStyleString);
96 GBool RemoveStyle(
const char *pszName);
97 GBool ModifyStyle(
const char *pszName,
const char *pszStyleString);
99 GBool SaveStyleTable(
const char *pszFilename);
100 GBool LoadStyleTable(
const char *pszFilename);
101 const char *Find(
const char *pszStyleString);
102 GBool IsExist(
const char *pszName);
103 const char *GetStyleName(
const char *pszName);
104 void Print(FILE *fpOut);
107 void ResetStyleStringReading();
108 const char *GetNextStyle();
109 const char *GetLastStyleName();
121 char *m_pszStyleString;
127 GBool SetFeatureStyleString(
OGRFeature *,
const char *pszStyleString=
nullptr,
128 GBool bNoMatching = FALSE);
134 GBool InitStyleString(
const char *pszStyleString =
nullptr);
136 const char *GetStyleName(
const char *pszStyleString=
nullptr);
137 const char *GetStyleByName(
const char *pszStyleName);
139 GBool AddStyle(
const char *pszStyleName,
const char *pszStyleString=
nullptr);
141 const char *GetStyleString(
OGRFeature * =
nullptr);
144 GBool AddPart(
const char *);
146 int GetPartCount(
const char *pszStyleString =
nullptr);
147 OGRStyleTool *GetPart(
int hPartId,
const char *pszStyleString =
nullptr);
152 OGRStyleTable *GetDataSetStyleTable(){
return m_poDataSetStyleTable;}
154 OGRStyleTool *CreateStyleToolFromStyleString(
const char *pszStyleString);
169 char *m_pszStyleString;
171 virtual GBool Parse() = 0;
175 GBool Parse(
const OGRStyleParamId* pasStyle,
176 OGRStyleValue* pasValue,
188 m_pszStyleString(
nullptr)
193 static GBool GetRGBFromString(
const char *pszColor,
int &nRed,
int &nGreen,
194 int &nBlue,
int &nTransparence);
195 static int GetSpecificId(
const char *pszId,
const char *pszWanted);
198 GBool IsStyleModified() {
return m_bModified;}
199 void StyleModified() {m_bModified = TRUE;}
201 GBool IsStyleParsed() {
return m_bParsed;}
202 void StyleParsed() {m_bParsed = TRUE;}
208 void SetInternalInputUnitFromParam(
char *pszString);
221 void SetStyleString(
const char *pszStyleString);
222 const char *GetStyleString(
const OGRStyleParamId *pasStyleParam ,
223 OGRStyleValue *pasStyleValue,
int nSize);
225 const char *GetParamStr(
const OGRStyleParamId &sStyleParam ,
226 OGRStyleValue &sStyleValue,
227 GBool &bValueIsNull);
229 int GetParamNum(
const OGRStyleParamId &sStyleParam ,
230 OGRStyleValue &sStyleValue,
231 GBool &bValueIsNull);
233 double GetParamDbl(
const OGRStyleParamId &sStyleParam ,
234 OGRStyleValue &sStyleValue,
235 GBool &bValueIsNull);
237 void SetParamStr(
const OGRStyleParamId &sStyleParam ,
238 OGRStyleValue &sStyleValue,
239 const char *pszParamString);
241 void SetParamNum(
const OGRStyleParamId &sStyleParam ,
242 OGRStyleValue &sStyleValue,
245 void SetParamDbl(
const OGRStyleParamId &sStyleParam ,
246 OGRStyleValue &sStyleValue,
263 OGRStyleValue *m_pasStyleValue;
265 GBool Parse()
override;
270 ~OGRStylePen()
override;
277 void SetColor(
const char *pszColor){SetParamStr(
OGRSTPenColor,pszColor);}
279 void SetWidth(
double dfWidth){SetParamDbl(
OGRSTPenWidth,dfWidth);}
281 void SetPattern(
const char *pszPattern){SetParamStr(
OGRSTPenPattern,pszPattern);}
282 const char *Id(
GBool &bDefault){
return GetParamStr(
OGRSTPenId,bDefault);}
283 void SetId(
const char *pszId){SetParamStr(
OGRSTPenId,pszId);}
285 void SetPerpendicularOffset(
double dfPerp){SetParamDbl(
OGRSTPenPerOffset,dfPerp);}
287 void SetCap(
const char *pszCap){SetParamStr(
OGRSTPenCap,pszCap);}
289 void SetJoin(
const char *pszJoin){SetParamStr(
OGRSTPenJoin,pszJoin);}
298 void SetParamStr(
OGRSTPenParam eParam,
const char *pszParamString);
301 const char *GetStyleString()
override;
311 OGRStyleValue *m_pasStyleValue;
313 GBool Parse()
override;
318 ~OGRStyleBrush()
override;
323 void SetForeColor(
const char *pszColor){SetParamStr(
OGRSTBrushFColor,pszColor);}
325 void SetBackColor(
const char *pszColor){SetParamStr(
OGRSTBrushBColor,pszColor);}
327 void SetId(
const char *pszId){SetParamStr(
OGRSTBrushId,pszId);}
333 void SetSpacingX(
double dfX){SetParamDbl(
OGRSTBrushDx,dfX );}
335 void SetSpacingY(
double dfY){SetParamDbl(
OGRSTBrushDy,dfY );}
347 const char *GetStyleString()
override;
357 OGRStyleValue *m_pasStyleValue;
359 GBool Parse()
override;
364 ~OGRStyleSymbol()
override;
371 void SetId(
const char *pszId){ SetParamStr(
OGRSTSymbolId,pszId);}
375 void SetColor(
const char *pszColor){SetParamStr(
OGRSTSymbolColor,pszColor);}
379 void SetSpacingX(
double dfX){SetParamDbl(
OGRSTSymbolDx,dfX );}
381 void SetSpacingY(
double dfY){SetParamDbl(
OGRSTSymbolDy,dfY );}
401 const char *GetStyleString()
override;
411 OGRStyleValue *m_pasStyleValue;
413 GBool Parse()
override;
418 ~OGRStyleLabel()
override;
425 void SetFontName(
const char *pszFontName){SetParamStr(
OGRSTLabelFontName,pszFontName);}
433 void SetForColor(
const char *pszForColor){SetParamStr(
OGRSTLabelFColor,pszForColor);}
435 void SetBackColor(
const char *pszBackColor){SetParamStr(
OGRSTLabelBColor,pszBackColor);}
437 void SetPlacement(
const char *pszPlacement){SetParamStr(
OGRSTLabelPlacement,pszPlacement);}
441 void SetSpacingX(
double dfX){SetParamDbl(
OGRSTLabelDx,dfX);}
443 void SetSpacingY(
double dfY){SetParamDbl(
OGRSTLabelDy,dfY);}
459 void SetShadowColor(
const char *pszShadowColor){SetParamStr(
OGRSTLabelHColor,pszShadowColor);}
461 void SetOutlineColor(
const char *pszOutlineColor){SetParamStr(
OGRSTLabelOColor,pszOutlineColor);}
471 const char *GetStyleString()
override;
Convenient string class based on std::string.
Definition: cpl_string.h:339
Definition: ogr_feature.h:354
Definition: ogr_featurestyle.h:118
Definition: ogr_featurestyle.h:85
int GBool
Definition: cpl_port.h:221
@ OGRSTSymbolDy
Definition: ogr_core.h:867
@ OGRSTSymbolId
Definition: ogr_core.h:862
@ OGRSTSymbolSize
Definition: ogr_core.h:865
@ OGRSTSymbolColor
Definition: ogr_core.h:864
@ OGRSTSymbolDx
Definition: ogr_core.h:866
@ OGRSTSymbolPerp
Definition: ogr_core.h:869
@ OGRSTSymbolAngle
Definition: ogr_core.h:863
@ OGRSTSymbolOColor
Definition: ogr_core.h:873
@ OGRSTSymbolPriority
Definition: ogr_core.h:871
@ OGRSTSymbolStep
Definition: ogr_core.h:868
@ OGRSTSymbolOffset
Definition: ogr_core.h:870
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
enum ogr_style_tool_param_pen_id OGRSTPenParam
@ OGRSTLabelUnderline
Definition: ogr_core.h:897
@ OGRSTLabelPriority
Definition: ogr_core.h:898
@ OGRSTLabelBold
Definition: ogr_core.h:895
@ OGRSTLabelStrikeout
Definition: ogr_core.h:899
@ OGRSTLabelBColor
Definition: ogr_core.h:889
@ OGRSTLabelPlacement
Definition: ogr_core.h:890
@ OGRSTLabelPerp
Definition: ogr_core.h:894
@ OGRSTLabelOColor
Definition: ogr_core.h:904
@ OGRSTLabelDx
Definition: ogr_core.h:892
@ OGRSTLabelHColor
Definition: ogr_core.h:903
@ OGRSTLabelItalic
Definition: ogr_core.h:896
@ OGRSTLabelTextString
Definition: ogr_core.h:886
@ OGRSTLabelSize
Definition: ogr_core.h:885
@ OGRSTLabelAngle
Definition: ogr_core.h:887
@ OGRSTLabelFColor
Definition: ogr_core.h:888
@ OGRSTLabelDy
Definition: ogr_core.h:893
@ OGRSTLabelFontName
Definition: ogr_core.h:884
@ OGRSTLabelStretch
Definition: ogr_core.h:900
@ OGRSTLabelAnchor
Definition: ogr_core.h:891
@ OGRSTUGround
Definition: ogr_core.h:812
enum ogr_style_tool_class_id OGRSTClassId
enum ogr_style_tool_units_id OGRSTUnitId
enum ogr_style_tool_param_brush_id OGRSTBrushParam
enum ogr_style_tool_param_label_id OGRSTLabelParam
@ OGRSTBrushAngle
Definition: ogr_core.h:846
@ OGRSTBrushId
Definition: ogr_core.h:845
@ OGRSTBrushPriority
Definition: ogr_core.h:850
@ OGRSTBrushBColor
Definition: ogr_core.h:844
@ OGRSTBrushSize
Definition: ogr_core.h:847
@ OGRSTBrushDy
Definition: ogr_core.h:849
@ OGRSTBrushFColor
Definition: ogr_core.h:843
@ OGRSTBrushDx
Definition: ogr_core.h:848
@ OGRSTCNone
Definition: ogr_core.h:799
@ OGRSTPenId
Definition: ogr_core.h:828
@ OGRSTPenCap
Definition: ogr_core.h:830
@ OGRSTPenPerOffset
Definition: ogr_core.h:829
@ OGRSTPenWidth
Definition: ogr_core.h:826
@ OGRSTPenColor
Definition: ogr_core.h:825
@ OGRSTPenJoin
Definition: ogr_core.h:831
@ OGRSTPenPriority
Definition: ogr_core.h:832
@ OGRSTPenPattern
Definition: ogr_core.h:827
ogr_style_type
Definition: ogr_featurestyle.h:51
enum ogr_style_type OGRSType