14#ifndef OGR_FEATURESTYLE_INCLUDE
15#define OGR_FEATURESTYLE_INCLUDE
44typedef struct ogr_style_param
52typedef struct ogr_style_value
72 char **m_papszStyleTable =
nullptr;
82 GBool AddStyle(
const char *pszName,
const char *pszStyleString);
83 GBool RemoveStyle(
const char *pszName);
84 GBool ModifyStyle(
const char *pszName,
const char *pszStyleString);
86 GBool SaveStyleTable(
const char *pszFilename);
87 GBool LoadStyleTable(
const char *pszFilename);
88 const char *Find(
const char *pszStyleString);
89 GBool IsExist(
const char *pszName);
90 const char *GetStyleName(
const char *pszName);
91 void Print(FILE *fpOut);
94 void ResetStyleStringReading();
95 const char *GetNextStyle();
96 const char *GetLastStyleName();
108 char *m_pszStyleString =
nullptr;
117 const char *pszStyleString =
nullptr,
118 GBool bNoMatching = FALSE);
124 GBool InitStyleString(
const char *pszStyleString =
nullptr);
126 const char *GetStyleName(
const char *pszStyleString =
nullptr);
127 const char *GetStyleByName(
const char *pszStyleName);
129 GBool AddStyle(
const char *pszStyleName,
130 const char *pszStyleString =
nullptr);
132 const char *GetStyleString(
OGRFeature * =
nullptr);
135 GBool AddPart(
const char *);
137 int GetPartCount(
const char *pszStyleString =
nullptr);
138 OGRStyleTool *GetPart(
int hPartId,
const char *pszStyleString =
nullptr);
145 return m_poDataSetStyleTable;
149 CreateStyleToolFromStyleString(
const char *pszStyleString);
159 GBool m_bModified =
false;
160 GBool m_bParsed =
false;
161 double m_dfScale = 1.0;
164 char *m_pszStyleString =
nullptr;
166 virtual GBool Parse() = 0;
172 GBool Parse(
const OGRStyleParamId *pasStyle, OGRStyleValue *pasValue,
178 : m_bModified(FALSE), m_bParsed(FALSE), m_dfScale(0.0),
180 m_pszStyleString(
nullptr)
187 static GBool GetRGBFromString(
const char *pszColor,
int &nRed,
int &nGreen,
188 int &nBlue,
int &nTransparence);
189 static int GetSpecificId(
const char *pszId,
const char *pszWanted);
192 GBool IsStyleModified()
202 GBool IsStyleParsed()
216 void SetInternalInputUnitFromParam(
char *pszString);
220 double dfScale = 1.0);
234 void SetStyleString(
const char *pszStyleString);
235 const char *GetStyleString(
const OGRStyleParamId *pasStyleParam,
236 OGRStyleValue *pasStyleValue,
int nSize);
238 const char *GetParamStr(
const OGRStyleParamId &sStyleParam,
239 const OGRStyleValue &sStyleValue,
240 GBool &bValueIsNull);
242 int GetParamNum(
const OGRStyleParamId &sStyleParam,
243 const OGRStyleValue &sStyleValue,
GBool &bValueIsNull);
245 double GetParamDbl(
const OGRStyleParamId &sStyleParam,
246 const OGRStyleValue &sStyleValue,
GBool &bValueIsNull);
248 void SetParamStr(
const OGRStyleParamId &sStyleParam,
249 OGRStyleValue &sStyleValue,
const char *pszParamString);
251 void SetParamNum(
const OGRStyleParamId &sStyleParam,
252 OGRStyleValue &sStyleValue,
int nParam);
254 void SetParamDbl(
const OGRStyleParamId &sStyleParam,
255 OGRStyleValue &sStyleValue,
double dfParam);
270 OGRStyleValue *m_pasStyleValue;
272 GBool Parse()
override;
278 ~OGRStylePen()
override;
284 const char *Color(
GBool &bDefault)
289 void SetColor(
const char *pszColor)
294 double Width(
GBool &bDefault)
299 void SetWidth(
double dfWidth)
304 const char *Pattern(
GBool &bDefault)
309 void SetPattern(
const char *pszPattern)
314 const char *Id(
GBool &bDefault)
319 void SetId(
const char *pszId)
324 double PerpendicularOffset(
GBool &bDefault)
329 void SetPerpendicularOffset(
double dfPerp)
334 const char *Cap(
GBool &bDefault)
339 void SetCap(
const char *pszCap)
344 const char *Join(
GBool &bDefault)
349 void SetJoin(
const char *pszJoin)
354 int Priority(
GBool &bDefault)
359 void SetPriority(
int nPriority)
369 void SetParamStr(
OGRSTPenParam eParam,
const char *pszParamString);
372 const char *GetStyleString()
override;
381 OGRStyleValue *m_pasStyleValue;
383 GBool Parse()
override;
389 ~OGRStyleBrush()
override;
393 const char *ForeColor(
GBool &bDefault)
398 void SetForeColor(
const char *pszColor)
403 const char *BackColor(
GBool &bDefault)
408 void SetBackColor(
const char *pszColor)
413 const char *Id(
GBool &bDefault)
418 void SetId(
const char *pszId)
423 double Angle(
GBool &bDefault)
428 void SetAngle(
double dfAngle)
433 double Size(
GBool &bDefault)
438 void SetSize(
double dfSize)
443 double SpacingX(
GBool &bDefault)
448 void SetSpacingX(
double dfX)
453 double SpacingY(
GBool &bDefault)
458 void SetSpacingY(
double dfY)
463 int Priority(
GBool &bDefault)
468 void SetPriority(
int nPriority)
481 const char *GetStyleString()
override;
490 OGRStyleValue *m_pasStyleValue;
492 GBool Parse()
override;
498 ~OGRStyleSymbol()
override;
504 const char *Id(
GBool &bDefault)
509 void SetId(
const char *pszId)
514 double Angle(
GBool &bDefault)
519 void SetAngle(
double dfAngle)
524 const char *Color(
GBool &bDefault)
529 void SetColor(
const char *pszColor)
534 double Size(
GBool &bDefault)
539 void SetSize(
double dfSize)
544 double SpacingX(
GBool &bDefault)
549 void SetSpacingX(
double dfX)
554 double SpacingY(
GBool &bDefault)
559 void SetSpacingY(
double dfY)
564 double Step(
GBool &bDefault)
569 void SetStep(
double dfStep)
574 double Offset(
GBool &bDefault)
579 void SetOffset(
double dfOffset)
584 double Perp(
GBool &bDefault)
589 void SetPerp(
double dfPerp)
594 int Priority(
GBool &bDefault)
599 void SetPriority(
int nPriority)
604 const char *FontName(
GBool &bDefault)
609 void SetFontName(
const char *pszFontName)
614 const char *OColor(
GBool &bDefault)
619 void SetOColor(
const char *pszColor)
632 const char *GetStyleString()
override;
641 OGRStyleValue *m_pasStyleValue;
643 GBool Parse()
override;
649 ~OGRStyleLabel()
override;
655 const char *FontName(
GBool &bDefault)
660 void SetFontName(
const char *pszFontName)
665 double Size(
GBool &bDefault)
670 void SetSize(
double dfSize)
675 const char *TextString(
GBool &bDefault)
680 void SetTextString(
const char *pszTextString)
685 double Angle(
GBool &bDefault)
690 void SetAngle(
double dfAngle)
695 const char *ForeColor(
GBool &bDefault)
700 void SetForColor(
const char *pszForColor)
705 const char *BackColor(
GBool &bDefault)
710 void SetBackColor(
const char *pszBackColor)
715 const char *Placement(
GBool &bDefault)
720 void SetPlacement(
const char *pszPlacement)
725 int Anchor(
GBool &bDefault)
730 void SetAnchor(
int nAnchor)
735 double SpacingX(
GBool &bDefault)
740 void SetSpacingX(
double dfX)
745 double SpacingY(
GBool &bDefault)
750 void SetSpacingY(
double dfY)
755 double Perp(
GBool &bDefault)
760 void SetPerp(
double dfPerp)
770 void SetBold(
GBool bBold)
780 void SetItalic(
GBool bItalic)
790 void SetUnderline(
GBool bUnderline)
795 int Priority(
GBool &bDefault)
800 void SetPriority(
int nPriority)
810 void SetStrikeout(
GBool bStrikeout)
815 double Stretch(
GBool &bDefault)
820 void SetStretch(
double dfStretch)
825 const char *ShadowColor(
GBool &bDefault)
830 void SetShadowColor(
const char *pszShadowColor)
835 const char *OutlineColor(
GBool &bDefault)
840 void SetOutlineColor(
const char *pszOutlineColor)
853 const char *GetStyleString()
override;
Convenient string class based on std::string.
Definition cpl_string.h:307
A simple feature, including geometry and attributes.
Definition ogr_feature.h:877
This class represents a style manager.
Definition ogr_featurestyle.h:105
This class represents a style table.
Definition ogr_featurestyle.h:70
Various convenience functions for CPL.
int GBool
Type for boolean values (alias to int)
Definition cpl_port.h:180
#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:1030
Various convenience functions for working with strings and string lists.
Core portability services for cross-platform OGR code.
@ OGRSTSymbolDy
Dy.
Definition ogr_core.h:1171
@ OGRSTSymbolId
Id.
Definition ogr_core.h:1166
@ OGRSTSymbolSize
Size.
Definition ogr_core.h:1169
@ OGRSTSymbolFontName
Font name.
Definition ogr_core.h:1176
@ OGRSTSymbolColor
Color.
Definition ogr_core.h:1168
@ OGRSTSymbolDx
Dx.
Definition ogr_core.h:1170
@ OGRSTSymbolPerp
Perpendicular.
Definition ogr_core.h:1173
@ OGRSTSymbolAngle
Angle.
Definition ogr_core.h:1167
@ OGRSTSymbolOColor
Outline color.
Definition ogr_core.h:1177
@ OGRSTSymbolPriority
Priority.
Definition ogr_core.h:1175
@ OGRSTSymbolStep
Step.
Definition ogr_core.h:1172
@ OGRSTSymbolOffset
Offset.
Definition ogr_core.h:1174
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
enum ogr_style_tool_param_pen_id OGRSTPenParam
List of parameters for use with OGRStylePen.
@ OGRSTLabelUnderline
Underline.
Definition ogr_core.h:1201
@ OGRSTLabelPriority
Priority.
Definition ogr_core.h:1202
@ OGRSTLabelBold
Bold.
Definition ogr_core.h:1199
@ OGRSTLabelStrikeout
Strike out.
Definition ogr_core.h:1203
@ OGRSTLabelBColor
Background color.
Definition ogr_core.h:1193
@ OGRSTLabelPlacement
Placement.
Definition ogr_core.h:1194
@ OGRSTLabelPerp
Perpendicular.
Definition ogr_core.h:1198
@ OGRSTLabelOColor
Outline color.
Definition ogr_core.h:1208
@ OGRSTLabelDx
Dx.
Definition ogr_core.h:1196
@ OGRSTLabelHColor
Highlight color.
Definition ogr_core.h:1207
@ OGRSTLabelItalic
Italic.
Definition ogr_core.h:1200
@ OGRSTLabelTextString
Text string.
Definition ogr_core.h:1190
@ OGRSTLabelSize
Size.
Definition ogr_core.h:1189
@ OGRSTLabelAngle
Angle.
Definition ogr_core.h:1191
@ OGRSTLabelFColor
Foreground color.
Definition ogr_core.h:1192
@ OGRSTLabelDy
Dy.
Definition ogr_core.h:1197
@ OGRSTLabelFontName
Font name.
Definition ogr_core.h:1188
@ OGRSTLabelStretch
Stretch.
Definition ogr_core.h:1204
@ OGRSTLabelAnchor
Anchor.
Definition ogr_core.h:1195
@ OGRSTUGround
Ground unit.
Definition ogr_core.h:1116
@ OGRSTUMM
Millimeter.
Definition ogr_core.h:1119
enum ogr_style_tool_class_id OGRSTClassId
OGRStyleTool derived class types (returned by GetType()).
enum ogr_style_tool_units_id OGRSTUnitId
List of units supported by OGRStyleTools.
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
@ OGRSTBrushAngle
Angle.
Definition ogr_core.h:1150
@ OGRSTBrushId
Id.
Definition ogr_core.h:1149
@ OGRSTBrushPriority
Priority.
Definition ogr_core.h:1154
@ OGRSTBrushBColor
Background color.
Definition ogr_core.h:1148
@ OGRSTBrushSize
Size.
Definition ogr_core.h:1151
@ OGRSTBrushDy
Dy.
Definition ogr_core.h:1153
@ OGRSTBrushFColor
Foreground color.
Definition ogr_core.h:1147
@ OGRSTBrushDx
Dx.
Definition ogr_core.h:1152
@ OGRSTCNone
None.
Definition ogr_core.h:1103
@ OGRSTPenId
Id.
Definition ogr_core.h:1132
@ OGRSTPenCap
Cap.
Definition ogr_core.h:1134
@ OGRSTPenPerOffset
Perpendicular offset.
Definition ogr_core.h:1133
@ OGRSTPenWidth
Width.
Definition ogr_core.h:1130
@ OGRSTPenColor
Color.
Definition ogr_core.h:1129
@ OGRSTPenJoin
Join.
Definition ogr_core.h:1135
@ OGRSTPenPriority
Priority.
Definition ogr_core.h:1136
@ OGRSTPenPattern
Pattern.
Definition ogr_core.h:1131
ogr_style_type
OGR Style type.
Definition ogr_featurestyle.h:35
enum ogr_style_type OGRSType
OGR Style type.