GDAL
ogr_featurestyle.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id$
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Define of Feature Representation
6  * Author: Stephane Villeneuve, stephane.v@videtron.ca
7  *
8  ******************************************************************************
9  * Copyright (c) 1999, Frank Warmerdam
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 #ifndef OGR_FEATURESTYLE_INCLUDE
31 #define OGR_FEATURESTYLE_INCLUDE
32 
33 #include "cpl_conv.h"
34 #include "cpl_string.h"
35 #include "ogr_core.h"
36 
37 class OGRFeature;
38 
45 /*
46  * All OGRStyleTool param lists are defined in ogr_core.h.
47  */
48 
50 typedef enum ogr_style_type
51 {
52  OGRSTypeUnused = -1,
53  OGRSTypeString,
54  OGRSTypeDouble,
55  OGRSTypeInteger,
56  OGRSTypeBoolean
57 } OGRSType;
58 
60 typedef struct ogr_style_param
61 {
62  int eParam;
63  const char *pszToken;
64  GBool bGeoref;
65  OGRSType eType;
66 } OGRStyleParamId;
67 
68 typedef struct ogr_style_value
69 {
70  char *pszValue;
71  double dfValue;
72  int nValue; // Used for both integer and boolean types
73  GBool bValid;
74  OGRSTUnitId eUnit;
75 } OGRStyleValue;
77 
78 // Every time a pszStyleString given in parameter is NULL,
79 // the StyleString defined in the Mgr will be use.
80 
84 class CPL_DLL OGRStyleTable
85 {
86  private:
87  char **m_papszStyleTable = nullptr;
88 
89  CPLString osLastRequestedStyleName{};
90  int iNextStyle = 0;
91 
93 
94  public:
95  OGRStyleTable();
96  ~OGRStyleTable();
97  GBool AddStyle(const char *pszName, const char *pszStyleString);
98  GBool RemoveStyle(const char *pszName);
99  GBool ModifyStyle(const char *pszName, const char *pszStyleString);
100 
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);
107  void Clear();
108  OGRStyleTable *Clone();
109  void ResetStyleStringReading();
110  const char *GetNextStyle();
111  const char *GetLastStyleName();
112 };
113 
114 class OGRStyleTool;
115 
119 class CPL_DLL OGRStyleMgr
120 {
121  private:
122  OGRStyleTable *m_poDataSetStyleTable = nullptr;
123  char *m_pszStyleString = nullptr;
124 
126 
127  public:
128  explicit OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = nullptr);
129  ~OGRStyleMgr();
130 
131  GBool SetFeatureStyleString(OGRFeature *,
132  const char *pszStyleString = nullptr,
133  GBool bNoMatching = FALSE);
134  /* It will set in the given feature the pszStyleString with
135  the style or will set the style name found in
136  dataset StyleTable (if bNoMatching == FALSE). */
137 
138  const char *InitFromFeature(OGRFeature *);
139  GBool InitStyleString(const char *pszStyleString = nullptr);
140 
141  const char *GetStyleName(const char *pszStyleString = nullptr);
142  const char *GetStyleByName(const char *pszStyleName);
143 
144  GBool AddStyle(const char *pszStyleName,
145  const char *pszStyleString = nullptr);
146 
147  const char *GetStyleString(OGRFeature * = nullptr);
148 
149  GBool AddPart(OGRStyleTool *);
150  GBool AddPart(const char *);
151 
152  int GetPartCount(const char *pszStyleString = nullptr);
153  OGRStyleTool *GetPart(int hPartId, const char *pszStyleString = nullptr);
154 
155  /* It could have a reference counting process us for the OGRStyleTable, if
156  needed. */
158  OGRStyleTable *GetDataSetStyleTable()
159  {
160  return m_poDataSetStyleTable;
161  }
162 
163  static OGRStyleTool *
164  CreateStyleToolFromStyleString(const char *pszStyleString);
166 };
167 
171 class CPL_DLL OGRStyleTool
172 {
173  private:
174  GBool m_bModified = false;
175  GBool m_bParsed = false;
176  double m_dfScale = 1.0;
177  OGRSTUnitId m_eUnit = OGRSTUMM;
178  OGRSTClassId m_eClassId = OGRSTCNone;
179  char *m_pszStyleString = nullptr;
180 
181  virtual GBool Parse() = 0;
182 
184 
185  protected:
186 #ifndef DOXYGEN_SKIP
187  GBool Parse(const OGRStyleParamId *pasStyle, OGRStyleValue *pasValue,
188  int nCount);
189 #endif
190 
191  public:
192  OGRStyleTool()
193  : m_bModified(FALSE), m_bParsed(FALSE), m_dfScale(0.0),
194  m_eUnit(OGRSTUGround), m_eClassId(OGRSTCNone),
195  m_pszStyleString(nullptr)
196  {
197  }
198  explicit OGRStyleTool(OGRSTClassId eClassId);
199  virtual ~OGRStyleTool();
200 
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);
204 
205 #ifndef DOXYGEN_SKIP
206  GBool IsStyleModified()
207  {
208  return m_bModified;
209  }
210  void StyleModified()
211  {
212  m_bModified = TRUE;
213  }
214 
215  GBool IsStyleParsed()
216  {
217  return m_bParsed;
218  }
219  void StyleParsed()
220  {
221  m_bParsed = TRUE;
222  }
223 #endif
224 
225  OGRSTClassId GetType();
226 
227 #ifndef DOXYGEN_SKIP
228  void SetInternalInputUnitFromParam(char *pszString);
229 #endif
230 
231  void SetUnit(OGRSTUnitId,
232  double dfScale = 1.0); // the dfScale will be
233  // used if we are working with Ground
234  // Unit ( ground = paper * scale);
235 
237  {
238  return m_eUnit;
239  }
240 
241  // There are two way to set the parameters in the Style, with generic
242  // methods (using a defined enumeration) or with the reel method specific
243  // for Each style tools.
244 
245  virtual const char *GetStyleString() = 0;
246  void SetStyleString(const char *pszStyleString);
247  const char *GetStyleString(const OGRStyleParamId *pasStyleParam,
248  OGRStyleValue *pasStyleValue, int nSize);
249 
250  const char *GetParamStr(const OGRStyleParamId &sStyleParam,
251  OGRStyleValue &sStyleValue, GBool &bValueIsNull);
252 
253  int GetParamNum(const OGRStyleParamId &sStyleParam,
254  OGRStyleValue &sStyleValue, GBool &bValueIsNull);
255 
256  double GetParamDbl(const OGRStyleParamId &sStyleParam,
257  OGRStyleValue &sStyleValue, GBool &bValueIsNull);
258 
259  void SetParamStr(const OGRStyleParamId &sStyleParam,
260  OGRStyleValue &sStyleValue, const char *pszParamString);
261 
262  void SetParamNum(const OGRStyleParamId &sStyleParam,
263  OGRStyleValue &sStyleValue, int nParam);
264 
265  void SetParamDbl(const OGRStyleParamId &sStyleParam,
266  OGRStyleValue &sStyleValue, double dfParam);
267 #ifndef DOXYGEN_SKIP
268  double ComputeWithUnit(double, OGRSTUnitId);
269  int ComputeWithUnit(int, OGRSTUnitId);
270 #endif
271 };
272 
274 
278 class CPL_DLL OGRStylePen : public OGRStyleTool
279 {
280  private:
281  OGRStyleValue *m_pasStyleValue;
282 
283  GBool Parse() override;
284 
285  CPL_DISALLOW_COPY_ASSIGN(OGRStylePen)
286 
287  public:
288  OGRStylePen();
289  ~OGRStylePen() override;
290 
291  /**********************************************************************/
292  /* Explicit fct for all parameters defined in the Drawing tools Pen */
293  /**********************************************************************/
294 
295  const char *Color(GBool &bDefault)
296  {
297  return GetParamStr(OGRSTPenColor, bDefault);
298  }
299  void SetColor(const char *pszColor)
300  {
301  SetParamStr(OGRSTPenColor, pszColor);
302  }
303  double Width(GBool &bDefault)
304  {
305  return GetParamDbl(OGRSTPenWidth, bDefault);
306  }
307  void SetWidth(double dfWidth)
308  {
309  SetParamDbl(OGRSTPenWidth, dfWidth);
310  }
311  const char *Pattern(GBool &bDefault)
312  {
313  return GetParamStr(OGRSTPenPattern, bDefault);
314  }
315  void SetPattern(const char *pszPattern)
316  {
317  SetParamStr(OGRSTPenPattern, pszPattern);
318  }
319  const char *Id(GBool &bDefault)
320  {
321  return GetParamStr(OGRSTPenId, bDefault);
322  }
323  void SetId(const char *pszId)
324  {
325  SetParamStr(OGRSTPenId, pszId);
326  }
327  double PerpendicularOffset(GBool &bDefault)
328  {
329  return GetParamDbl(OGRSTPenPerOffset, bDefault);
330  }
331  void SetPerpendicularOffset(double dfPerp)
332  {
334  }
335  const char *Cap(GBool &bDefault)
336  {
337  return GetParamStr(OGRSTPenCap, bDefault);
338  }
339  void SetCap(const char *pszCap)
340  {
341  SetParamStr(OGRSTPenCap, pszCap);
342  }
343  const char *Join(GBool &bDefault)
344  {
345  return GetParamStr(OGRSTPenJoin, bDefault);
346  }
347  void SetJoin(const char *pszJoin)
348  {
349  SetParamStr(OGRSTPenJoin, pszJoin);
350  }
351  int Priority(GBool &bDefault)
352  {
353  return GetParamNum(OGRSTPenPriority, bDefault);
354  }
355  void SetPriority(int nPriority)
356  {
357  SetParamNum(OGRSTPenPriority, nPriority);
358  }
359 
360  /*****************************************************************/
361 
362  const char *GetParamStr(OGRSTPenParam eParam, GBool &bValueIsNull);
363  int GetParamNum(OGRSTPenParam eParam, GBool &bValueIsNull);
364  double GetParamDbl(OGRSTPenParam eParam, GBool &bValueIsNull);
365  void SetParamStr(OGRSTPenParam eParam, const char *pszParamString);
366  void SetParamNum(OGRSTPenParam eParam, int nParam);
367  void SetParamDbl(OGRSTPenParam eParam, double dfParam);
368  const char *GetStyleString() override;
369 };
370 
374 class CPL_DLL OGRStyleBrush : public OGRStyleTool
375 {
376  private:
377  OGRStyleValue *m_pasStyleValue;
378 
379  GBool Parse() override;
380 
381  CPL_DISALLOW_COPY_ASSIGN(OGRStyleBrush)
382 
383  public:
384  OGRStyleBrush();
385  ~OGRStyleBrush() override;
386 
387  /* Explicit fct for all parameters defined in the Drawing tools Brush */
388 
389  const char *ForeColor(GBool &bDefault)
390  {
391  return GetParamStr(OGRSTBrushFColor, bDefault);
392  }
393  void SetForeColor(const char *pszColor)
394  {
395  SetParamStr(OGRSTBrushFColor, pszColor);
396  }
397  const char *BackColor(GBool &bDefault)
398  {
399  return GetParamStr(OGRSTBrushBColor, bDefault);
400  }
401  void SetBackColor(const char *pszColor)
402  {
403  SetParamStr(OGRSTBrushBColor, pszColor);
404  }
405  const char *Id(GBool &bDefault)
406  {
407  return GetParamStr(OGRSTBrushId, bDefault);
408  }
409  void SetId(const char *pszId)
410  {
411  SetParamStr(OGRSTBrushId, pszId);
412  }
413  double Angle(GBool &bDefault)
414  {
415  return GetParamDbl(OGRSTBrushAngle, bDefault);
416  }
417  void SetAngle(double dfAngle)
418  {
419  SetParamDbl(OGRSTBrushAngle, dfAngle);
420  }
421  double Size(GBool &bDefault)
422  {
423  return GetParamDbl(OGRSTBrushSize, bDefault);
424  }
425  void SetSize(double dfSize)
426  {
427  SetParamDbl(OGRSTBrushSize, dfSize);
428  }
429  double SpacingX(GBool &bDefault)
430  {
431  return GetParamDbl(OGRSTBrushDx, bDefault);
432  }
433  void SetSpacingX(double dfX)
434  {
436  }
437  double SpacingY(GBool &bDefault)
438  {
439  return GetParamDbl(OGRSTBrushDy, bDefault);
440  }
441  void SetSpacingY(double dfY)
442  {
444  }
445  int Priority(GBool &bDefault)
446  {
447  return GetParamNum(OGRSTBrushPriority, bDefault);
448  }
449  void SetPriority(int nPriority)
450  {
451  SetParamNum(OGRSTBrushPriority, nPriority);
452  }
453 
454  /*****************************************************************/
455 
456  const char *GetParamStr(OGRSTBrushParam eParam, GBool &bValueIsNull);
457  int GetParamNum(OGRSTBrushParam eParam, GBool &bValueIsNull);
458  double GetParamDbl(OGRSTBrushParam eParam, GBool &bValueIsNull);
459  void SetParamStr(OGRSTBrushParam eParam, const char *pszParamString);
460  void SetParamNum(OGRSTBrushParam eParam, int nParam);
461  void SetParamDbl(OGRSTBrushParam eParam, double dfParam);
462  const char *GetStyleString() override;
463 };
464 
468 class CPL_DLL OGRStyleSymbol : public OGRStyleTool
469 {
470  private:
471  OGRStyleValue *m_pasStyleValue;
472 
473  GBool Parse() override;
474 
475  CPL_DISALLOW_COPY_ASSIGN(OGRStyleSymbol)
476 
477  public:
478  OGRStyleSymbol();
479  ~OGRStyleSymbol() override;
480 
481  /*****************************************************************/
482  /* Explicit fct for all parameters defined in the Drawing tools */
483  /*****************************************************************/
484 
485  const char *Id(GBool &bDefault)
486  {
487  return GetParamStr(OGRSTSymbolId, bDefault);
488  }
489  void SetId(const char *pszId)
490  {
491  SetParamStr(OGRSTSymbolId, pszId);
492  }
493  double Angle(GBool &bDefault)
494  {
495  return GetParamDbl(OGRSTSymbolAngle, bDefault);
496  }
497  void SetAngle(double dfAngle)
498  {
499  SetParamDbl(OGRSTSymbolAngle, dfAngle);
500  }
501  const char *Color(GBool &bDefault)
502  {
503  return GetParamStr(OGRSTSymbolColor, bDefault);
504  }
505  void SetColor(const char *pszColor)
506  {
507  SetParamStr(OGRSTSymbolColor, pszColor);
508  }
509  double Size(GBool &bDefault)
510  {
511  return GetParamDbl(OGRSTSymbolSize, bDefault);
512  }
513  void SetSize(double dfSize)
514  {
515  SetParamDbl(OGRSTSymbolSize, dfSize);
516  }
517  double SpacingX(GBool &bDefault)
518  {
519  return GetParamDbl(OGRSTSymbolDx, bDefault);
520  }
521  void SetSpacingX(double dfX)
522  {
524  }
525  double SpacingY(GBool &bDefault)
526  {
527  return GetParamDbl(OGRSTSymbolDy, bDefault);
528  }
529  void SetSpacingY(double dfY)
530  {
532  }
533  double Step(GBool &bDefault)
534  {
535  return GetParamDbl(OGRSTSymbolStep, bDefault);
536  }
537  void SetStep(double dfStep)
538  {
539  SetParamDbl(OGRSTSymbolStep, dfStep);
540  }
541  double Offset(GBool &bDefault)
542  {
543  return GetParamDbl(OGRSTSymbolOffset, bDefault);
544  }
545  void SetOffset(double dfOffset)
546  {
547  SetParamDbl(OGRSTSymbolOffset, dfOffset);
548  }
549  double Perp(GBool &bDefault)
550  {
551  return GetParamDbl(OGRSTSymbolPerp, bDefault);
552  }
553  void SetPerp(double dfPerp)
554  {
555  SetParamDbl(OGRSTSymbolPerp, dfPerp);
556  }
557  int Priority(GBool &bDefault)
558  {
559  return GetParamNum(OGRSTSymbolPriority, bDefault);
560  }
561  void SetPriority(int nPriority)
562  {
563  SetParamNum(OGRSTSymbolPriority, nPriority);
564  }
565  const char *FontName(GBool &bDefault)
566  {
567  return GetParamStr(OGRSTSymbolFontName, bDefault);
568  }
569  void SetFontName(const char *pszFontName)
570  {
571  SetParamStr(OGRSTSymbolFontName, pszFontName);
572  }
573  const char *OColor(GBool &bDefault)
574  {
575  return GetParamStr(OGRSTSymbolOColor, bDefault);
576  }
577  void SetOColor(const char *pszColor)
578  {
579  SetParamStr(OGRSTSymbolOColor, pszColor);
580  }
581 
582  /*****************************************************************/
583 
584  const char *GetParamStr(OGRSTSymbolParam eParam, GBool &bValueIsNull);
585  int GetParamNum(OGRSTSymbolParam eParam, GBool &bValueIsNull);
586  double GetParamDbl(OGRSTSymbolParam eParam, GBool &bValueIsNull);
587  void SetParamStr(OGRSTSymbolParam eParam, const char *pszParamString);
588  void SetParamNum(OGRSTSymbolParam eParam, int nParam);
589  void SetParamDbl(OGRSTSymbolParam eParam, double dfParam);
590  const char *GetStyleString() override;
591 };
592 
596 class CPL_DLL OGRStyleLabel : public OGRStyleTool
597 {
598  private:
599  OGRStyleValue *m_pasStyleValue;
600 
601  GBool Parse() override;
602 
603  CPL_DISALLOW_COPY_ASSIGN(OGRStyleLabel)
604 
605  public:
606  OGRStyleLabel();
607  ~OGRStyleLabel() override;
608 
609  /*****************************************************************/
610  /* Explicit fct for all parameters defined in the Drawing tools */
611  /*****************************************************************/
612 
613  const char *FontName(GBool &bDefault)
614  {
615  return GetParamStr(OGRSTLabelFontName, bDefault);
616  }
617  void SetFontName(const char *pszFontName)
618  {
619  SetParamStr(OGRSTLabelFontName, pszFontName);
620  }
621  double Size(GBool &bDefault)
622  {
623  return GetParamDbl(OGRSTLabelSize, bDefault);
624  }
625  void SetSize(double dfSize)
626  {
627  SetParamDbl(OGRSTLabelSize, dfSize);
628  }
629  const char *TextString(GBool &bDefault)
630  {
631  return GetParamStr(OGRSTLabelTextString, bDefault);
632  }
633  void SetTextString(const char *pszTextString)
634  {
635  SetParamStr(OGRSTLabelTextString, pszTextString);
636  }
637  double Angle(GBool &bDefault)
638  {
639  return GetParamDbl(OGRSTLabelAngle, bDefault);
640  }
641  void SetAngle(double dfAngle)
642  {
643  SetParamDbl(OGRSTLabelAngle, dfAngle);
644  }
645  const char *ForeColor(GBool &bDefault)
646  {
647  return GetParamStr(OGRSTLabelFColor, bDefault);
648  }
649  void SetForColor(const char *pszForColor)
650  {
651  SetParamStr(OGRSTLabelFColor, pszForColor);
652  }
653  const char *BackColor(GBool &bDefault)
654  {
655  return GetParamStr(OGRSTLabelBColor, bDefault);
656  }
657  void SetBackColor(const char *pszBackColor)
658  {
659  SetParamStr(OGRSTLabelBColor, pszBackColor);
660  }
661  const char *Placement(GBool &bDefault)
662  {
663  return GetParamStr(OGRSTLabelPlacement, bDefault);
664  }
665  void SetPlacement(const char *pszPlacement)
666  {
667  SetParamStr(OGRSTLabelPlacement, pszPlacement);
668  }
669  int Anchor(GBool &bDefault)
670  {
671  return GetParamNum(OGRSTLabelAnchor, bDefault);
672  }
673  void SetAnchor(int nAnchor)
674  {
675  SetParamNum(OGRSTLabelAnchor, nAnchor);
676  }
677  double SpacingX(GBool &bDefault)
678  {
679  return GetParamDbl(OGRSTLabelDx, bDefault);
680  }
681  void SetSpacingX(double dfX)
682  {
684  }
685  double SpacingY(GBool &bDefault)
686  {
687  return GetParamDbl(OGRSTLabelDy, bDefault);
688  }
689  void SetSpacingY(double dfY)
690  {
692  }
693  double Perp(GBool &bDefault)
694  {
695  return GetParamDbl(OGRSTLabelPerp, bDefault);
696  }
697  void SetPerp(double dfPerp)
698  {
699  SetParamDbl(OGRSTLabelPerp, dfPerp);
700  }
701  GBool Bold(GBool &bDefault)
702  {
703  return GetParamNum(OGRSTLabelBold, bDefault);
704  }
705  void SetBold(GBool bBold)
706  {
707  SetParamNum(OGRSTLabelBold, bBold);
708  }
709  GBool Italic(GBool &bDefault)
710  {
711  return GetParamNum(OGRSTLabelItalic, bDefault);
712  }
713  void SetItalic(GBool bItalic)
714  {
715  SetParamNum(OGRSTLabelItalic, bItalic);
716  }
717  GBool Underline(GBool &bDefault)
718  {
719  return GetParamNum(OGRSTLabelUnderline, bDefault);
720  }
721  void SetUnderline(GBool bUnderline)
722  {
723  SetParamNum(OGRSTLabelUnderline, bUnderline);
724  }
725  int Priority(GBool &bDefault)
726  {
727  return GetParamNum(OGRSTLabelPriority, bDefault);
728  }
729  void SetPriority(int nPriority)
730  {
731  SetParamNum(OGRSTLabelPriority, nPriority);
732  }
733  GBool Strikeout(GBool &bDefault)
734  {
735  return GetParamNum(OGRSTLabelStrikeout, bDefault);
736  }
737  void SetStrikeout(GBool bStrikeout)
738  {
739  SetParamNum(OGRSTLabelStrikeout, bStrikeout);
740  }
741  double Stretch(GBool &bDefault)
742  {
743  return GetParamDbl(OGRSTLabelStretch, bDefault);
744  }
745  void SetStretch(double dfStretch)
746  {
747  SetParamDbl(OGRSTLabelStretch, dfStretch);
748  }
749  const char *ShadowColor(GBool &bDefault)
750  {
751  return GetParamStr(OGRSTLabelHColor, bDefault);
752  }
753  void SetShadowColor(const char *pszShadowColor)
754  {
755  SetParamStr(OGRSTLabelHColor, pszShadowColor);
756  }
757  const char *OutlineColor(GBool &bDefault)
758  {
759  return GetParamStr(OGRSTLabelOColor, bDefault);
760  }
761  void SetOutlineColor(const char *pszOutlineColor)
762  {
763  SetParamStr(OGRSTLabelOColor, pszOutlineColor);
764  }
765 
766  /*****************************************************************/
767 
768  const char *GetParamStr(OGRSTLabelParam eParam, GBool &bValueIsNull);
769  int GetParamNum(OGRSTLabelParam eParam, GBool &bValueIsNull);
770  double GetParamDbl(OGRSTLabelParam eParam, GBool &bValueIsNull);
771  void SetParamStr(OGRSTLabelParam eParam, const char *pszParamString);
772  void SetParamNum(OGRSTLabelParam eParam, int nParam);
773  void SetParamDbl(OGRSTLabelParam eParam, double dfParam);
774  const char *GetStyleString() override;
775 };
776 
778 
779 #endif /* OGR_FEATURESTYLE_INCLUDE */
OGRSTSymbolStep
@ OGRSTSymbolStep
Step.
Definition: ogr_core.h:1174
OGRSTLabelStretch
@ OGRSTLabelStretch
Stretch.
Definition: ogr_core.h:1206
OGRSType
enum ogr_style_type OGRSType
OGR Style type.
OGRStyleTool::SetParamDbl
void SetParamDbl(const OGRStyleParamId &sStyleParam, OGRStyleValue &sStyleValue, double dfParam)
Undocumented.
Definition: ogrfeaturestyle.cpp:2224
OGRSTBrushSize
@ OGRSTBrushSize
Size.
Definition: ogr_core.h:1153
OGRStyleTool
This class represents a style tool.
Definition: ogr_featurestyle.h:171
OGRSTLabelStrikeout
@ OGRSTLabelStrikeout
Strike out.
Definition: ogr_core.h:1205
OGRStyleTool::GetParamStr
const char * GetParamStr(const OGRStyleParamId &sStyleParam, OGRStyleValue &sStyleValue, GBool &bValueIsNull)
Undocumented.
Definition: ogrfeaturestyle.cpp:2013
OGRSTLabelPerp
@ OGRSTLabelPerp
Perpendicular.
Definition: ogr_core.h:1200
OGRSTSymbolPriority
@ OGRSTSymbolPriority
Priority.
Definition: ogr_core.h:1177
OGRSTLabelBColor
@ OGRSTLabelBColor
Background color.
Definition: ogr_core.h:1195
OGRSTLabelFColor
@ OGRSTLabelFColor
Foreground color.
Definition: ogr_core.h:1194
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:84
OGRSTClassId
enum ogr_style_tool_class_id OGRSTClassId
OGRStyleTool derived class types (returned by GetType()).
OGRSTBrushParam
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
OGRSTLabelItalic
@ OGRSTLabelItalic
Italic.
Definition: ogr_core.h:1202
OGRStyleTool::SetParamStr
void SetParamStr(const OGRStyleParamId &sStyleParam, OGRStyleValue &sStyleValue, const char *pszParamString)
Undocumented.
Definition: ogrfeaturestyle.cpp:2142
OGRSTPenWidth
@ OGRSTPenWidth
Width.
Definition: ogr_core.h:1132
OGRSTLabelParam
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
OGRSTLabelTextString
@ OGRSTLabelTextString
Text string.
Definition: ogr_core.h:1192
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:311
OGRSTPenParam
enum ogr_style_tool_param_pen_id OGRSTPenParam
List of parameters for use with OGRStylePen.
OGRSTLabelPlacement
@ OGRSTLabelPlacement
Placement.
Definition: ogr_core.h:1196
OGRSTUnitId
enum ogr_style_tool_units_id OGRSTUnitId
List of units supported by OGRStyleTools.
OGRSTCNone
@ OGRSTCNone
None.
Definition: ogr_core.h:1105
OGRSTPenPriority
@ OGRSTPenPriority
Priority.
Definition: ogr_core.h:1138
OGRSTSymbolDx
@ OGRSTSymbolDx
Dx.
Definition: ogr_core.h:1172
OGRSTLabelOColor
@ OGRSTLabelOColor
Outline color.
Definition: ogr_core.h:1210
OGRSTSymbolAngle
@ OGRSTSymbolAngle
Angle.
Definition: ogr_core.h:1169
OGRSTSymbolFontName
@ OGRSTSymbolFontName
Font name.
Definition: ogr_core.h:1178
OGRSTPenColor
@ OGRSTPenColor
Color.
Definition: ogr_core.h:1131
OGRSTLabelDy
@ OGRSTLabelDy
Dy.
Definition: ogr_core.h:1199
OGRSTUMM
@ OGRSTUMM
Millimeter.
Definition: ogr_core.h:1121
ogr_style_type
ogr_style_type
OGR Style type.
Definition: ogr_featurestyle.h:50
OGRSTLabelFontName
@ OGRSTLabelFontName
Font name.
Definition: ogr_core.h:1190
OGRSTLabelPriority
@ OGRSTLabelPriority
Priority.
Definition: ogr_core.h:1204
OGRSTLabelUnderline
@ OGRSTLabelUnderline
Underline.
Definition: ogr_core.h:1203
OGRStyleTool::GetStyleString
virtual const char * GetStyleString()=0
Get the style string for this Style Tool.
OGRSTLabelAnchor
@ OGRSTLabelAnchor
Anchor.
Definition: ogr_core.h:1197
OGRSTLabelAngle
@ OGRSTLabelAngle
Angle.
Definition: ogr_core.h:1193
OGRSTSymbolDy
@ OGRSTSymbolDy
Dy.
Definition: ogr_core.h:1173
OGRSTBrushDx
@ OGRSTBrushDx
Dx.
Definition: ogr_core.h:1154
cpl_conv.h
cpl_string.h
OGRSTSymbolParam
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
OGRSTBrushFColor
@ OGRSTBrushFColor
Foreground color.
Definition: ogr_core.h:1149
OGRSTBrushDy
@ OGRSTBrushDy
Dy.
Definition: ogr_core.h:1155
OGRSTSymbolId
@ OGRSTSymbolId
Id.
Definition: ogr_core.h:1168
OGRSTBrushBColor
@ OGRSTBrushBColor
Background color.
Definition: ogr_core.h:1150
OGRStyleMgr
This class represents a style manager.
Definition: ogr_featurestyle.h:119
OGRSTUGround
@ OGRSTUGround
Ground unit.
Definition: ogr_core.h:1118
OGRSTSymbolSize
@ OGRSTSymbolSize
Size.
Definition: ogr_core.h:1171
OGRSTLabelHColor
@ OGRSTLabelHColor
Highlight color.
Definition: ogr_core.h:1209
OGRSTSymbolOffset
@ OGRSTSymbolOffset
Offset.
Definition: ogr_core.h:1176
OGRStyleTool::GetParamNum
int GetParamNum(const OGRStyleParamId &sStyleParam, OGRStyleValue &sStyleValue, GBool &bValueIsNull)
Undocumented.
Definition: ogrfeaturestyle.cpp:2067
OGRSTBrushId
@ OGRSTBrushId
Id.
Definition: ogr_core.h:1151
OGRSTPenCap
@ OGRSTPenCap
Cap.
Definition: ogr_core.h:1136
OGRStyleTool::GetParamDbl
double GetParamDbl(const OGRStyleParamId &sStyleParam, OGRStyleValue &sStyleValue, GBool &bValueIsNull)
Undocumented.
Definition: ogrfeaturestyle.cpp:2087
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:680
OGRSTPenPerOffset
@ OGRSTPenPerOffset
Perpendicular offset.
Definition: ogr_core.h:1135
OGRSTBrushPriority
@ OGRSTBrushPriority
Priority.
Definition: ogr_core.h:1156
OGRSTPenJoin
@ OGRSTPenJoin
Join.
Definition: ogr_core.h:1137
OGRStyleTool::GetUnit
OGRSTUnitId GetUnit()
Get Style Tool units.
Definition: ogr_featurestyle.h:236
GBool
int GBool
Type for boolean values (alias to int)
Definition: cpl_port.h:207
OGRSTSymbolColor
@ OGRSTSymbolColor
Color.
Definition: ogr_core.h:1170
OGRSTSymbolOColor
@ OGRSTSymbolOColor
Outline color.
Definition: ogr_core.h:1179
OGRSTLabelDx
@ OGRSTLabelDx
Dx.
Definition: ogr_core.h:1198
OGRStyleTool::SetParamNum
void SetParamNum(const OGRStyleParamId &sStyleParam, OGRStyleValue &sStyleValue, int nParam)
Undocumented.
Definition: ogrfeaturestyle.cpp:2183
OGRSTPenId
@ OGRSTPenId
Id.
Definition: ogr_core.h:1134
OGRSTSymbolPerp
@ OGRSTSymbolPerp
Perpendicular.
Definition: ogr_core.h:1175
ogr_core.h
OGRSTBrushAngle
@ OGRSTBrushAngle
Angle.
Definition: ogr_core.h:1152
OGRSTPenPattern
@ OGRSTPenPattern
Pattern.
Definition: ogr_core.h:1133
OGRSTLabelSize
@ OGRSTLabelSize
Size.
Definition: ogr_core.h:1191
OGRSTLabelBold
@ OGRSTLabelBold
Bold.
Definition: ogr_core.h:1201
CPL_DISALLOW_COPY_ASSIGN
#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