Go to the documentation of this file.
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 =
nullptr;
97 GBool AddStyle(
const char *pszName,
const char *pszStyleString);
98 GBool RemoveStyle(
const char *pszName);
99 GBool ModifyStyle(
const char *pszName,
const char *pszStyleString);
101 GBool SaveStyleTable(
const char *pszFilename);
102 GBool LoadStyleTable(
const char *pszFilename);
103 const char *Find(
const char *pszStyleString);
104 GBool IsExist(
const char *pszName);
105 const char *GetStyleName(
const char *pszName);
106 void Print(FILE *fpOut);
109 void ResetStyleStringReading();
110 const char *GetNextStyle();
111 const char *GetLastStyleName();
123 char *m_pszStyleString =
nullptr;
132 const char *pszStyleString =
nullptr,
133 GBool bNoMatching = FALSE);
139 GBool InitStyleString(
const char *pszStyleString =
nullptr);
141 const char *GetStyleName(
const char *pszStyleString =
nullptr);
142 const char *GetStyleByName(
const char *pszStyleName);
144 GBool AddStyle(
const char *pszStyleName,
145 const char *pszStyleString =
nullptr);
147 const char *GetStyleString(
OGRFeature * =
nullptr);
150 GBool AddPart(
const char *);
152 int GetPartCount(
const char *pszStyleString =
nullptr);
153 OGRStyleTool *GetPart(
int hPartId,
const char *pszStyleString =
nullptr);
160 return m_poDataSetStyleTable;
164 CreateStyleToolFromStyleString(
const char *pszStyleString);
174 GBool m_bModified =
false;
175 GBool m_bParsed =
false;
176 double m_dfScale = 1.0;
179 char *m_pszStyleString =
nullptr;
181 virtual GBool Parse() = 0;
187 GBool Parse(
const OGRStyleParamId *pasStyle, OGRStyleValue *pasValue,
193 : m_bModified(FALSE), m_bParsed(FALSE), m_dfScale(0.0),
195 m_pszStyleString(
nullptr)
201 static GBool GetRGBFromString(
const char *pszColor,
int &nRed,
int &nGreen,
202 int &nBlue,
int &nTransparence);
203 static int GetSpecificId(
const char *pszId,
const char *pszWanted);
206 GBool IsStyleModified()
215 GBool IsStyleParsed()
228 void SetInternalInputUnitFromParam(
char *pszString);
232 double dfScale = 1.0);
245 virtual const char *GetStyleString() = 0;
246 void SetStyleString(
const char *pszStyleString);
247 const char *GetStyleString(
const OGRStyleParamId *pasStyleParam,
248 OGRStyleValue *pasStyleValue,
int nSize);
250 const char *GetParamStr(
const OGRStyleParamId &sStyleParam,
251 OGRStyleValue &sStyleValue,
GBool &bValueIsNull);
253 int GetParamNum(
const OGRStyleParamId &sStyleParam,
254 OGRStyleValue &sStyleValue,
GBool &bValueIsNull);
256 double GetParamDbl(
const OGRStyleParamId &sStyleParam,
257 OGRStyleValue &sStyleValue,
GBool &bValueIsNull);
259 void SetParamStr(
const OGRStyleParamId &sStyleParam,
260 OGRStyleValue &sStyleValue,
const char *pszParamString);
262 void SetParamNum(
const OGRStyleParamId &sStyleParam,
263 OGRStyleValue &sStyleValue,
int nParam);
265 void SetParamDbl(
const OGRStyleParamId &sStyleParam,
266 OGRStyleValue &sStyleValue,
double dfParam);
281 OGRStyleValue *m_pasStyleValue;
283 GBool Parse()
override;
289 ~OGRStylePen()
override;
295 const char *Color(
GBool &bDefault)
299 void SetColor(
const char *pszColor)
303 double Width(
GBool &bDefault)
307 void SetWidth(
double dfWidth)
311 const char *Pattern(
GBool &bDefault)
315 void SetPattern(
const char *pszPattern)
319 const char *Id(
GBool &bDefault)
323 void SetId(
const char *pszId)
327 double PerpendicularOffset(
GBool &bDefault)
331 void SetPerpendicularOffset(
double dfPerp)
335 const char *Cap(
GBool &bDefault)
339 void SetCap(
const char *pszCap)
343 const char *Join(
GBool &bDefault)
347 void SetJoin(
const char *pszJoin)
351 int Priority(
GBool &bDefault)
355 void SetPriority(
int nPriority)
377 OGRStyleValue *m_pasStyleValue;
379 GBool Parse()
override;
385 ~OGRStyleBrush()
override;
389 const char *ForeColor(
GBool &bDefault)
393 void SetForeColor(
const char *pszColor)
397 const char *BackColor(
GBool &bDefault)
401 void SetBackColor(
const char *pszColor)
405 const char *Id(
GBool &bDefault)
409 void SetId(
const char *pszId)
413 double Angle(
GBool &bDefault)
417 void SetAngle(
double dfAngle)
421 double Size(
GBool &bDefault)
425 void SetSize(
double dfSize)
429 double SpacingX(
GBool &bDefault)
433 void SetSpacingX(
double dfX)
437 double SpacingY(
GBool &bDefault)
441 void SetSpacingY(
double dfY)
445 int Priority(
GBool &bDefault)
449 void SetPriority(
int nPriority)
471 OGRStyleValue *m_pasStyleValue;
473 GBool Parse()
override;
479 ~OGRStyleSymbol()
override;
485 const char *Id(
GBool &bDefault)
489 void SetId(
const char *pszId)
493 double Angle(
GBool &bDefault)
497 void SetAngle(
double dfAngle)
501 const char *Color(
GBool &bDefault)
505 void SetColor(
const char *pszColor)
509 double Size(
GBool &bDefault)
513 void SetSize(
double dfSize)
517 double SpacingX(
GBool &bDefault)
521 void SetSpacingX(
double dfX)
525 double SpacingY(
GBool &bDefault)
529 void SetSpacingY(
double dfY)
533 double Step(
GBool &bDefault)
537 void SetStep(
double dfStep)
541 double Offset(
GBool &bDefault)
545 void SetOffset(
double dfOffset)
549 double Perp(
GBool &bDefault)
553 void SetPerp(
double dfPerp)
557 int Priority(
GBool &bDefault)
561 void SetPriority(
int nPriority)
565 const char *FontName(
GBool &bDefault)
569 void SetFontName(
const char *pszFontName)
573 const char *OColor(
GBool &bDefault)
577 void SetOColor(
const char *pszColor)
599 OGRStyleValue *m_pasStyleValue;
601 GBool Parse()
override;
607 ~OGRStyleLabel()
override;
613 const char *FontName(
GBool &bDefault)
617 void SetFontName(
const char *pszFontName)
621 double Size(
GBool &bDefault)
625 void SetSize(
double dfSize)
629 const char *TextString(
GBool &bDefault)
633 void SetTextString(
const char *pszTextString)
637 double Angle(
GBool &bDefault)
641 void SetAngle(
double dfAngle)
645 const char *ForeColor(
GBool &bDefault)
649 void SetForColor(
const char *pszForColor)
653 const char *BackColor(
GBool &bDefault)
657 void SetBackColor(
const char *pszBackColor)
661 const char *Placement(
GBool &bDefault)
665 void SetPlacement(
const char *pszPlacement)
669 int Anchor(
GBool &bDefault)
673 void SetAnchor(
int nAnchor)
677 double SpacingX(
GBool &bDefault)
681 void SetSpacingX(
double dfX)
685 double SpacingY(
GBool &bDefault)
689 void SetSpacingY(
double dfY)
693 double Perp(
GBool &bDefault)
697 void SetPerp(
double dfPerp)
705 void SetBold(
GBool bBold)
713 void SetItalic(
GBool bItalic)
721 void SetUnderline(
GBool bUnderline)
725 int Priority(
GBool &bDefault)
729 void SetPriority(
int nPriority)
737 void SetStrikeout(
GBool bStrikeout)
741 double Stretch(
GBool &bDefault)
745 void SetStretch(
double dfStretch)
749 const char *ShadowColor(
GBool &bDefault)
753 void SetShadowColor(
const char *pszShadowColor)
757 const char *OutlineColor(
GBool &bDefault)
761 void SetOutlineColor(
const char *pszOutlineColor)
@ OGRSTSymbolStep
Step.
Definition: ogr_core.h:1174
@ OGRSTLabelStretch
Stretch.
Definition: ogr_core.h:1206
enum ogr_style_type OGRSType
OGR Style type.
@ OGRSTBrushSize
Size.
Definition: ogr_core.h:1153
@ OGRSTLabelStrikeout
Strike out.
Definition: ogr_core.h:1205
@ OGRSTLabelPerp
Perpendicular.
Definition: ogr_core.h:1200
@ OGRSTSymbolPriority
Priority.
Definition: ogr_core.h:1177
@ OGRSTLabelBColor
Background color.
Definition: ogr_core.h:1195
@ OGRSTLabelFColor
Foreground color.
Definition: ogr_core.h:1194
This class represents a style table.
Definition: ogr_featurestyle.h:84
enum ogr_style_tool_class_id OGRSTClassId
OGRStyleTool derived class types (returned by GetType()).
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
@ OGRSTLabelItalic
Italic.
Definition: ogr_core.h:1202
@ OGRSTPenWidth
Width.
Definition: ogr_core.h:1132
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
@ OGRSTLabelTextString
Text string.
Definition: ogr_core.h:1192
Convenient string class based on std::string.
Definition: cpl_string.h:311
enum ogr_style_tool_param_pen_id OGRSTPenParam
List of parameters for use with OGRStylePen.
@ OGRSTLabelPlacement
Placement.
Definition: ogr_core.h:1196
enum ogr_style_tool_units_id OGRSTUnitId
List of units supported by OGRStyleTools.
@ OGRSTCNone
None.
Definition: ogr_core.h:1105
@ OGRSTPenPriority
Priority.
Definition: ogr_core.h:1138
@ OGRSTSymbolDx
Dx.
Definition: ogr_core.h:1172
@ OGRSTLabelOColor
Outline color.
Definition: ogr_core.h:1210
@ OGRSTSymbolAngle
Angle.
Definition: ogr_core.h:1169
@ OGRSTSymbolFontName
Font name.
Definition: ogr_core.h:1178
@ OGRSTPenColor
Color.
Definition: ogr_core.h:1131
@ OGRSTLabelDy
Dy.
Definition: ogr_core.h:1199
@ OGRSTUMM
Millimeter.
Definition: ogr_core.h:1121
ogr_style_type
OGR Style type.
Definition: ogr_featurestyle.h:50
@ OGRSTLabelFontName
Font name.
Definition: ogr_core.h:1190
@ OGRSTLabelPriority
Priority.
Definition: ogr_core.h:1204
@ OGRSTLabelUnderline
Underline.
Definition: ogr_core.h:1203
@ OGRSTLabelAnchor
Anchor.
Definition: ogr_core.h:1197
@ OGRSTLabelAngle
Angle.
Definition: ogr_core.h:1193
@ OGRSTSymbolDy
Dy.
Definition: ogr_core.h:1173
@ OGRSTBrushDx
Dx.
Definition: ogr_core.h:1154
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
@ OGRSTBrushFColor
Foreground color.
Definition: ogr_core.h:1149
@ OGRSTBrushDy
Dy.
Definition: ogr_core.h:1155
@ OGRSTSymbolId
Id.
Definition: ogr_core.h:1168
@ OGRSTBrushBColor
Background color.
Definition: ogr_core.h:1150
This class represents a style manager.
Definition: ogr_featurestyle.h:119
@ OGRSTUGround
Ground unit.
Definition: ogr_core.h:1118
@ OGRSTSymbolSize
Size.
Definition: ogr_core.h:1171
@ OGRSTLabelHColor
Highlight color.
Definition: ogr_core.h:1209
@ OGRSTSymbolOffset
Offset.
Definition: ogr_core.h:1176
@ OGRSTBrushId
Id.
Definition: ogr_core.h:1151
@ OGRSTPenCap
Cap.
Definition: ogr_core.h:1136
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:680
@ OGRSTPenPerOffset
Perpendicular offset.
Definition: ogr_core.h:1135
@ OGRSTBrushPriority
Priority.
Definition: ogr_core.h:1156
@ OGRSTPenJoin
Join.
Definition: ogr_core.h:1137
int GBool
Type for boolean values (alias to int)
Definition: cpl_port.h:207
@ OGRSTSymbolColor
Color.
Definition: ogr_core.h:1170
@ OGRSTSymbolOColor
Outline color.
Definition: ogr_core.h:1179
@ OGRSTLabelDx
Dx.
Definition: ogr_core.h:1198
@ OGRSTPenId
Id.
Definition: ogr_core.h:1134
@ OGRSTSymbolPerp
Perpendicular.
Definition: ogr_core.h:1175
@ OGRSTBrushAngle
Angle.
Definition: ogr_core.h:1152
@ OGRSTPenPattern
Pattern.
Definition: ogr_core.h:1133
@ OGRSTLabelSize
Size.
Definition: ogr_core.h:1191
@ OGRSTLabelBold
Bold.
Definition: ogr_core.h:1201
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1042