13#ifndef OGR_FEATURESTYLE_INCLUDE
14#define OGR_FEATURESTYLE_INCLUDE
43typedef struct ogr_style_param
51typedef struct ogr_style_value
71 char **m_papszStyleTable =
nullptr;
81 GBool AddStyle(
const char *pszName,
const char *pszStyleString);
82 GBool RemoveStyle(
const char *pszName);
83 GBool ModifyStyle(
const char *pszName,
const char *pszStyleString);
85 GBool SaveStyleTable(
const char *pszFilename);
86 GBool LoadStyleTable(
const char *pszFilename);
87 const char *Find(
const char *pszStyleString);
88 GBool IsExist(
const char *pszName);
89 const char *GetStyleName(
const char *pszName);
90 void Print(FILE *fpOut);
93 void ResetStyleStringReading();
94 const char *GetNextStyle();
95 const char *GetLastStyleName();
107 char *m_pszStyleString =
nullptr;
116 const char *pszStyleString =
nullptr,
117 GBool bNoMatching = FALSE);
123 GBool InitStyleString(
const char *pszStyleString =
nullptr);
125 const char *GetStyleName(
const char *pszStyleString =
nullptr);
126 const char *GetStyleByName(
const char *pszStyleName);
128 GBool AddStyle(
const char *pszStyleName,
129 const char *pszStyleString =
nullptr);
131 const char *GetStyleString(
OGRFeature * =
nullptr);
134 GBool AddPart(
const char *);
136 int GetPartCount(
const char *pszStyleString =
nullptr);
137 OGRStyleTool *GetPart(
int hPartId,
const char *pszStyleString =
nullptr);
144 return m_poDataSetStyleTable;
148 CreateStyleToolFromStyleString(
const char *pszStyleString);
158 GBool m_bModified =
false;
159 GBool m_bParsed =
false;
160 double m_dfScale = 1.0;
163 char *m_pszStyleString =
nullptr;
165 virtual GBool Parse() = 0;
171 GBool Parse(
const OGRStyleParamId *pasStyle, OGRStyleValue *pasValue,
177 : m_bModified(FALSE), m_bParsed(FALSE), m_dfScale(0.0),
179 m_pszStyleString(
nullptr)
186 static GBool GetRGBFromString(
const char *pszColor,
int &nRed,
int &nGreen,
187 int &nBlue,
int &nTransparence);
188 static int GetSpecificId(
const char *pszId,
const char *pszWanted);
191 GBool IsStyleModified()
201 GBool IsStyleParsed()
215 void SetInternalInputUnitFromParam(
char *pszString);
219 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 double GetRawParamDbl(
const OGRStyleParamId &sStyleParam,
249 const OGRStyleValue &sStyleValue,
252 void SetParamStr(
const OGRStyleParamId &sStyleParam,
253 OGRStyleValue &sStyleValue,
const char *pszParamString);
255 void SetParamNum(
const OGRStyleParamId &sStyleParam,
256 OGRStyleValue &sStyleValue,
int nParam);
258 void SetParamDbl(
const OGRStyleParamId &sStyleParam,
259 OGRStyleValue &sStyleValue,
double dfParam);
274 OGRStyleValue *m_pasStyleValue;
276 GBool Parse()
override;
282 ~OGRStylePen()
override;
288 const char *Color(
GBool &bDefault)
293 void SetColor(
const char *pszColor)
298 double Width(
GBool &bDefault)
308 void SetWidth(
double dfWidth)
313 const char *Pattern(
GBool &bDefault)
318 void SetPattern(
const char *pszPattern)
323 const char *Id(
GBool &bDefault)
328 void SetId(
const char *pszId)
333 double PerpendicularOffset(
GBool &bDefault)
338 void SetPerpendicularOffset(
double dfPerp)
343 const char *Cap(
GBool &bDefault)
348 void SetCap(
const char *pszCap)
353 const char *Join(
GBool &bDefault)
358 void SetJoin(
const char *pszJoin)
363 int Priority(
GBool &bDefault)
368 void SetPriority(
int nPriority)
379 GBool &bValueIsNull);
380 void SetParamStr(
OGRSTPenParam eParam,
const char *pszParamString);
383 const char *GetStyleString()
override;
392 OGRStyleValue *m_pasStyleValue;
394 GBool Parse()
override;
400 ~OGRStyleBrush()
override;
404 const char *ForeColor(
GBool &bDefault)
409 void SetForeColor(
const char *pszColor)
414 const char *BackColor(
GBool &bDefault)
419 void SetBackColor(
const char *pszColor)
424 const char *Id(
GBool &bDefault)
429 void SetId(
const char *pszId)
434 double Angle(
GBool &bDefault)
439 void SetAngle(
double dfAngle)
444 double Size(
GBool &bDefault)
449 void SetSize(
double dfSize)
454 double SpacingX(
GBool &bDefault)
459 void SetSpacingX(
double dfX)
464 double SpacingY(
GBool &bDefault)
469 void SetSpacingY(
double dfY)
474 int Priority(
GBool &bDefault)
479 void SetPriority(
int nPriority)
492 const char *GetStyleString()
override;
501 OGRStyleValue *m_pasStyleValue;
503 GBool Parse()
override;
509 ~OGRStyleSymbol()
override;
515 const char *Id(
GBool &bDefault)
520 void SetId(
const char *pszId)
525 double Angle(
GBool &bDefault)
530 void SetAngle(
double dfAngle)
535 const char *Color(
GBool &bDefault)
540 void SetColor(
const char *pszColor)
545 double Size(
GBool &bDefault)
550 void SetSize(
double dfSize)
555 double SpacingX(
GBool &bDefault)
560 void SetSpacingX(
double dfX)
565 double SpacingY(
GBool &bDefault)
570 void SetSpacingY(
double dfY)
575 double Step(
GBool &bDefault)
580 void SetStep(
double dfStep)
585 double Offset(
GBool &bDefault)
590 void SetOffset(
double dfOffset)
595 double Perp(
GBool &bDefault)
600 void SetPerp(
double dfPerp)
605 int Priority(
GBool &bDefault)
610 void SetPriority(
int nPriority)
615 const char *FontName(
GBool &bDefault)
620 void SetFontName(
const char *pszFontName)
625 const char *OColor(
GBool &bDefault)
630 void SetOColor(
const char *pszColor)
643 const char *GetStyleString()
override;
652 OGRStyleValue *m_pasStyleValue;
654 GBool Parse()
override;
660 ~OGRStyleLabel()
override;
666 const char *FontName(
GBool &bDefault)
671 void SetFontName(
const char *pszFontName)
676 double Size(
GBool &bDefault)
681 void SetSize(
double dfSize)
686 const char *TextString(
GBool &bDefault)
691 void SetTextString(
const char *pszTextString)
696 double Angle(
GBool &bDefault)
701 void SetAngle(
double dfAngle)
706 const char *ForeColor(
GBool &bDefault)
711 void SetForColor(
const char *pszForColor)
716 const char *BackColor(
GBool &bDefault)
721 void SetBackColor(
const char *pszBackColor)
726 const char *Placement(
GBool &bDefault)
731 void SetPlacement(
const char *pszPlacement)
736 int Anchor(
GBool &bDefault)
741 void SetAnchor(
int nAnchor)
746 double SpacingX(
GBool &bDefault)
751 void SetSpacingX(
double dfX)
756 double SpacingY(
GBool &bDefault)
761 void SetSpacingY(
double dfY)
766 double Perp(
GBool &bDefault)
771 void SetPerp(
double dfPerp)
781 void SetBold(
GBool bBold)
791 void SetItalic(
GBool bItalic)
801 void SetUnderline(
GBool bUnderline)
806 int Priority(
GBool &bDefault)
811 void SetPriority(
int nPriority)
821 void SetStrikeout(
GBool bStrikeout)
826 double Stretch(
GBool &bDefault)
831 void SetStretch(
double dfStretch)
836 const char *ShadowColor(
GBool &bDefault)
841 void SetShadowColor(
const char *pszShadowColor)
846 const char *OutlineColor(
GBool &bDefault)
851 void SetOutlineColor(
const char *pszOutlineColor)
864 const char *GetStyleString()
override;
Convenient string class based on std::string.
Definition cpl_string.h:338
A simple feature, including geometry and attributes.
Definition ogr_feature.h:1041
This class represents a style manager.
Definition ogr_featurestyle.h:104
This class represents a style table.
Definition ogr_featurestyle.h:69
Various convenience functions for CPL.
int GBool
Type for boolean values (alias to int)
Definition cpl_port.h:176
#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:1101
Various convenience functions for working with strings and string lists.
Core portability services for cross-platform OGR code.
@ OGRSTSymbolDy
Dy.
Definition ogr_core.h:1169
@ OGRSTSymbolId
Id.
Definition ogr_core.h:1164
@ OGRSTSymbolSize
Size.
Definition ogr_core.h:1167
@ OGRSTSymbolFontName
Font name.
Definition ogr_core.h:1174
@ OGRSTSymbolColor
Color.
Definition ogr_core.h:1166
@ OGRSTSymbolDx
Dx.
Definition ogr_core.h:1168
@ OGRSTSymbolPerp
Perpendicular.
Definition ogr_core.h:1171
@ OGRSTSymbolAngle
Angle.
Definition ogr_core.h:1165
@ OGRSTSymbolOColor
Outline color.
Definition ogr_core.h:1175
@ OGRSTSymbolPriority
Priority.
Definition ogr_core.h:1173
@ OGRSTSymbolStep
Step.
Definition ogr_core.h:1170
@ OGRSTSymbolOffset
Offset.
Definition ogr_core.h:1172
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:1199
@ OGRSTLabelPriority
Priority.
Definition ogr_core.h:1200
@ OGRSTLabelBold
Bold.
Definition ogr_core.h:1197
@ OGRSTLabelStrikeout
Strike out.
Definition ogr_core.h:1201
@ OGRSTLabelBColor
Background color.
Definition ogr_core.h:1191
@ OGRSTLabelPlacement
Placement.
Definition ogr_core.h:1192
@ OGRSTLabelPerp
Perpendicular.
Definition ogr_core.h:1196
@ OGRSTLabelOColor
Outline color.
Definition ogr_core.h:1206
@ OGRSTLabelDx
Dx.
Definition ogr_core.h:1194
@ OGRSTLabelHColor
Highlight color.
Definition ogr_core.h:1205
@ OGRSTLabelItalic
Italic.
Definition ogr_core.h:1198
@ OGRSTLabelTextString
Text string.
Definition ogr_core.h:1188
@ OGRSTLabelSize
Size.
Definition ogr_core.h:1187
@ OGRSTLabelAngle
Angle.
Definition ogr_core.h:1189
@ OGRSTLabelFColor
Foreground color.
Definition ogr_core.h:1190
@ OGRSTLabelDy
Dy.
Definition ogr_core.h:1195
@ OGRSTLabelFontName
Font name.
Definition ogr_core.h:1186
@ OGRSTLabelStretch
Stretch.
Definition ogr_core.h:1202
@ OGRSTLabelAnchor
Anchor.
Definition ogr_core.h:1193
@ OGRSTUGround
Ground unit.
Definition ogr_core.h:1114
@ OGRSTUMM
Millimeter.
Definition ogr_core.h:1117
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:1148
@ OGRSTBrushId
Id.
Definition ogr_core.h:1147
@ OGRSTBrushPriority
Priority.
Definition ogr_core.h:1152
@ OGRSTBrushBColor
Background color.
Definition ogr_core.h:1146
@ OGRSTBrushSize
Size.
Definition ogr_core.h:1149
@ OGRSTBrushDy
Dy.
Definition ogr_core.h:1151
@ OGRSTBrushFColor
Foreground color.
Definition ogr_core.h:1145
@ OGRSTBrushDx
Dx.
Definition ogr_core.h:1150
@ OGRSTCNone
None.
Definition ogr_core.h:1101
@ OGRSTPenId
Id.
Definition ogr_core.h:1130
@ OGRSTPenCap
Cap.
Definition ogr_core.h:1132
@ OGRSTPenPerOffset
Perpendicular offset.
Definition ogr_core.h:1131
@ OGRSTPenWidth
Width.
Definition ogr_core.h:1128
@ OGRSTPenColor
Color.
Definition ogr_core.h:1127
@ OGRSTPenJoin
Join.
Definition ogr_core.h:1133
@ OGRSTPenPriority
Priority.
Definition ogr_core.h:1134
@ OGRSTPenPattern
Pattern.
Definition ogr_core.h:1129
ogr_style_type
OGR Style type.
Definition ogr_featurestyle.h:34
enum ogr_style_type OGRSType
OGR Style type.