30 #ifndef OGR_FEATURESTYLE_INCLUDE 31 #define OGR_FEATURESTYLE_INCLUDE 60 typedef struct ogr_style_param
68 typedef 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);
220 virtual const char *GetStyleString() = 0;
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;
Dy.
Definition: ogr_core.h:867
Outline color.
Definition: ogr_core.h:904
Id.
Definition: ogr_core.h:862
Dx.
Definition: ogr_core.h:848
Font name.
Definition: ogr_core.h:884
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
Highlight color.
Definition: ogr_core.h:903
Foreground color.
Definition: ogr_core.h:843
Color.
Definition: ogr_core.h:825
Background color.
Definition: ogr_core.h:844
int GBool
Type for boolean values (alias to int)
Definition: cpl_port.h:221
Anchor.
Definition: ogr_core.h:891
Size.
Definition: ogr_core.h:865
Priority.
Definition: ogr_core.h:850
Offset.
Definition: ogr_core.h:870
Angle.
Definition: ogr_core.h:887
Join.
Definition: ogr_core.h:831
Color.
Definition: ogr_core.h:864
Underline.
Definition: ogr_core.h:897
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
Dy.
Definition: ogr_core.h:849
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
Bold.
Definition: ogr_core.h:895
Ground unit.
Definition: ogr_core.h:812
Id.
Definition: ogr_core.h:845
Cap.
Definition: ogr_core.h:830
Perpendicular.
Definition: ogr_core.h:869
Convenient string class based on std::string.
Definition: cpl_string.h:336
Perpendicular offset.
Definition: ogr_core.h:829
Dx.
Definition: ogr_core.h:892
This class represents a style manager.
Definition: ogr_featurestyle.h:117
Angle.
Definition: ogr_core.h:846
Size.
Definition: ogr_core.h:885
Various convenience functions for working with strings and string lists.
enum ogr_style_tool_class_id OGRSTClassId
OGRStyleTool derived class types (returned by GetType()).
Outline color.
Definition: ogr_core.h:873
Id.
Definition: ogr_core.h:828
enum ogr_style_tool_param_pen_id OGRSTPenParam
List of parameters for use with OGRStylePen.
enum ogr_style_tool_units_id OGRSTUnitId
List of units supported by OGRStyleTools.
Step.
Definition: ogr_core.h:868
Priority.
Definition: ogr_core.h:871
Size.
Definition: ogr_core.h:847
Pattern.
Definition: ogr_core.h:827
Priority.
Definition: ogr_core.h:832
Core portability services for cross-platform OGR code.
Strike out.
Definition: ogr_core.h:899
Stretch.
Definition: ogr_core.h:900
Placement.
Definition: ogr_core.h:890
Various convenience functions for CPL.
Text string.
Definition: ogr_core.h:886
Foreground color.
Definition: ogr_core.h:888
Dx.
Definition: ogr_core.h:866
Perpendicular.
Definition: ogr_core.h:894
Italic.
Definition: ogr_core.h:896
Width.
Definition: ogr_core.h:826
Angle.
Definition: ogr_core.h:863
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:353
This class represents a style table.
Definition: ogr_featurestyle.h:84
Background color.
Definition: ogr_core.h:889
None.
Definition: ogr_core.h:799
Dy.
Definition: ogr_core.h:893
ogr_style_type
OGR Style type.
Definition: ogr_featurestyle.h:50
enum ogr_style_type OGRSType
OGR Style type.
Priority.
Definition: ogr_core.h:898