GDAL

ogr_featurestyle.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Project: OpenGIS Simple Features Reference Implementation
4 * Purpose: Define of Feature Representation
5 * Author: Stephane Villeneuve, stephane.v@videtron.ca
6 *
7 ******************************************************************************
8 * Copyright (c) 1999, Frank Warmerdam
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef OGR_FEATURESTYLE_INCLUDE
14#define OGR_FEATURESTYLE_INCLUDE
15
16#include "cpl_conv.h"
17#include "cpl_string.h"
18#include "ogr_core.h"
19
20 class OGRFeature;
21
28/*
29 * All OGRStyleTool param lists are defined in ogr_core.h.
30 */
31
33 typedef enum ogr_style_type
34{
35 OGRSTypeUnused = -1,
36 OGRSTypeString,
37 OGRSTypeDouble,
38 OGRSTypeInteger,
39 OGRSTypeBoolean
40} OGRSType;
41
43 typedef struct ogr_style_param
44{
45 int eParam;
46 const char *pszToken;
47 GBool bGeoref;
48 OGRSType eType;
49} OGRStyleParamId;
50
51 typedef struct ogr_style_value
52{
53 char *pszValue;
54 double dfValue;
55 int nValue; // Used for both integer and boolean types
56 GBool bValid;
57 OGRSTUnitId eUnit;
58} OGRStyleValue;
59
61
62// Every time a pszStyleString given in parameter is NULL,
63// the StyleString defined in the Mgr will be use.
64
68 class CPL_DLL OGRStyleTable
69{
70 private:
71 char **m_papszStyleTable = nullptr;
72
73 CPLString osLastRequestedStyleName{};
74 int iNextStyle = 0;
75
76 CPL_DISALLOW_COPY_ASSIGN(OGRStyleTable)
77
78 public:
79 OGRStyleTable();
80 ~OGRStyleTable();
81 GBool AddStyle(const char *pszName, const char *pszStyleString);
82 GBool RemoveStyle(const char *pszName);
83 GBool ModifyStyle(const char *pszName, const char *pszStyleString);
84
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);
91 void Clear();
92 OGRStyleTable *Clone();
93 void ResetStyleStringReading();
94 const char *GetNextStyle();
95 const char *GetLastStyleName();
96};
97
98 class OGRStyleTool;
99
103 class CPL_DLL OGRStyleMgr
104{
105 private:
106 OGRStyleTable *m_poDataSetStyleTable = nullptr;
107 char *m_pszStyleString = nullptr;
108
109 CPL_DISALLOW_COPY_ASSIGN(OGRStyleMgr)
110
111 public:
112 explicit OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = nullptr);
113 ~OGRStyleMgr();
114
115 GBool SetFeatureStyleString(OGRFeature *,
116 const char *pszStyleString = nullptr,
117 GBool bNoMatching = FALSE);
118 /* It will set in the given feature the pszStyleString with
119 the style or will set the style name found in
120 dataset StyleTable (if bNoMatching == FALSE). */
121
122 const char *InitFromFeature(OGRFeature *);
123 GBool InitStyleString(const char *pszStyleString = nullptr);
124
125 const char *GetStyleName(const char *pszStyleString = nullptr);
126 const char *GetStyleByName(const char *pszStyleName);
127
128 GBool AddStyle(const char *pszStyleName,
129 const char *pszStyleString = nullptr);
130
131 const char *GetStyleString(OGRFeature * = nullptr);
132
133 GBool AddPart(OGRStyleTool *);
134 GBool AddPart(const char *);
135
136 int GetPartCount(const char *pszStyleString = nullptr);
137 OGRStyleTool *GetPart(int hPartId, const char *pszStyleString = nullptr);
138
139 /* It could have a reference counting process us for the OGRStyleTable, if
140 needed. */
142 OGRStyleTable *GetDataSetStyleTable()
143 {
144 return m_poDataSetStyleTable;
145 }
146
147 static OGRStyleTool *
148 CreateStyleToolFromStyleString(const char *pszStyleString);
150};
151
155 class CPL_DLL OGRStyleTool
156{
157 private:
158 GBool m_bModified = false;
159 GBool m_bParsed = false;
160 double m_dfScale = 1.0;
161 OGRSTUnitId m_eUnit = OGRSTUMM;
162 OGRSTClassId m_eClassId = OGRSTCNone;
163 char *m_pszStyleString = nullptr;
164
165 virtual GBool Parse() = 0;
166
167 CPL_DISALLOW_COPY_ASSIGN(OGRStyleTool)
168
169 protected:
170#ifndef DOXYGEN_SKIP
171 GBool Parse(const OGRStyleParamId *pasStyle, OGRStyleValue *pasValue,
172 int nCount);
173#endif
174
175 public:
176 OGRStyleTool()
177 : m_bModified(FALSE), m_bParsed(FALSE), m_dfScale(0.0),
178 m_eUnit(OGRSTUGround), m_eClassId(OGRSTCNone),
179 m_pszStyleString(nullptr)
180 {
181 }
182
183 explicit OGRStyleTool(OGRSTClassId eClassId);
184 virtual ~OGRStyleTool();
185
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);
189
190#ifndef DOXYGEN_SKIP
191 GBool IsStyleModified()
192 {
193 return m_bModified;
194 }
195
196 void StyleModified()
197 {
198 m_bModified = TRUE;
199 }
200
201 GBool IsStyleParsed()
202 {
203 return m_bParsed;
204 }
205
206 void StyleParsed()
207 {
208 m_bParsed = TRUE;
209 }
210#endif
211
212 OGRSTClassId GetType();
213
214#ifndef DOXYGEN_SKIP
215 void SetInternalInputUnitFromParam(char *pszString);
216#endif
217
218 void SetUnit(OGRSTUnitId,
219 double dfScale = 1.0); // the dfScale will be
220 // used if we are working with Ground
221 // Unit ( ground = paper * scale);
222
223 OGRSTUnitId GetUnit()
224 {
225 return m_eUnit;
226 }
227
228 // There are two way to set the parameters in the Style, with generic
229 // methods (using a defined enumeration) or with the reel method specific
230 // for Each style tools.
231
232 virtual const char *GetStyleString() = 0;
233 void SetStyleString(const char *pszStyleString);
234 const char *GetStyleString(const OGRStyleParamId *pasStyleParam,
235 OGRStyleValue *pasStyleValue, int nSize);
236
237 const char *GetParamStr(const OGRStyleParamId &sStyleParam,
238 const OGRStyleValue &sStyleValue,
239 GBool &bValueIsNull);
240
241 int GetParamNum(const OGRStyleParamId &sStyleParam,
242 const OGRStyleValue &sStyleValue, GBool &bValueIsNull);
243
244 double GetParamDbl(const OGRStyleParamId &sStyleParam,
245 const OGRStyleValue &sStyleValue, GBool &bValueIsNull);
246
247 double GetRawParamDbl(const OGRStyleParamId &sStyleParam,
248 const OGRStyleValue &sStyleValue,
249 OGRSTUnitId &eRawUnit, GBool &bValueIsNull);
250
251 void SetParamStr(const OGRStyleParamId &sStyleParam,
252 OGRStyleValue &sStyleValue, const char *pszParamString);
253
254 void SetParamNum(const OGRStyleParamId &sStyleParam,
255 OGRStyleValue &sStyleValue, int nParam);
256
257 void SetParamDbl(const OGRStyleParamId &sStyleParam,
258 OGRStyleValue &sStyleValue, double dfParam);
259#ifndef DOXYGEN_SKIP
260 double ComputeWithUnit(double, OGRSTUnitId);
261 int ComputeWithUnit(int, OGRSTUnitId);
262#endif
263};
264
266
270 class CPL_DLL OGRStylePen : public OGRStyleTool
271{
272 private:
273 OGRStyleValue *m_pasStyleValue;
274
275 GBool Parse() override;
276
277 CPL_DISALLOW_COPY_ASSIGN(OGRStylePen)
278
279 public:
280 OGRStylePen();
281 ~OGRStylePen() override;
282
283 /**********************************************************************/
284 /* Explicit fct for all parameters defined in the Drawing tools Pen */
285 /**********************************************************************/
286
287 const char *Color(GBool &bDefault)
288 {
289 return GetParamStr(OGRSTPenColor, bDefault);
290 }
291
292 void SetColor(const char *pszColor)
293 {
294 SetParamStr(OGRSTPenColor, pszColor);
295 }
296
297 double Width(GBool &bDefault)
298 {
299 return GetParamDbl(OGRSTPenWidth, bDefault);
300 }
301
302 double RawWidth(OGRSTUnitId &eRawUnit, GBool &bDefault)
303 {
304 return GetRawParamDbl(OGRSTPenWidth, eRawUnit, bDefault);
305 }
306
307 void SetWidth(double dfWidth)
308 {
309 SetParamDbl(OGRSTPenWidth, dfWidth);
310 }
311
312 const char *Pattern(GBool &bDefault)
313 {
314 return GetParamStr(OGRSTPenPattern, bDefault);
315 }
316
317 void SetPattern(const char *pszPattern)
318 {
319 SetParamStr(OGRSTPenPattern, pszPattern);
320 }
321
322 const char *Id(GBool &bDefault)
323 {
324 return GetParamStr(OGRSTPenId, bDefault);
325 }
326
327 void SetId(const char *pszId)
328 {
329 SetParamStr(OGRSTPenId, pszId);
330 }
331
332 double PerpendicularOffset(GBool &bDefault)
333 {
334 return GetParamDbl(OGRSTPenPerOffset, bDefault);
335 }
336
337 void SetPerpendicularOffset(double dfPerp)
338 {
339 SetParamDbl(OGRSTPenPerOffset, dfPerp);
340 }
341
342 const char *Cap(GBool &bDefault)
343 {
344 return GetParamStr(OGRSTPenCap, bDefault);
345 }
346
347 void SetCap(const char *pszCap)
348 {
349 SetParamStr(OGRSTPenCap, pszCap);
350 }
351
352 const char *Join(GBool &bDefault)
353 {
354 return GetParamStr(OGRSTPenJoin, bDefault);
355 }
356
357 void SetJoin(const char *pszJoin)
358 {
359 SetParamStr(OGRSTPenJoin, pszJoin);
360 }
361
362 int Priority(GBool &bDefault)
363 {
364 return GetParamNum(OGRSTPenPriority, bDefault);
365 }
366
367 void SetPriority(int nPriority)
368 {
369 SetParamNum(OGRSTPenPriority, nPriority);
370 }
371
372 /*****************************************************************/
373
374 const char *GetParamStr(OGRSTPenParam eParam, GBool &bValueIsNull);
375 int GetParamNum(OGRSTPenParam eParam, GBool &bValueIsNull);
376 double GetParamDbl(OGRSTPenParam eParam, GBool &bValueIsNull);
377 double GetRawParamDbl(OGRSTPenParam eParam, OGRSTUnitId &eRawUnit,
378 GBool &bValueIsNull);
379 void SetParamStr(OGRSTPenParam eParam, const char *pszParamString);
380 void SetParamNum(OGRSTPenParam eParam, int nParam);
381 void SetParamDbl(OGRSTPenParam eParam, double dfParam);
382 const char *GetStyleString() override;
383};
384
388 class CPL_DLL OGRStyleBrush : public OGRStyleTool
389{
390 private:
391 OGRStyleValue *m_pasStyleValue;
392
393 GBool Parse() override;
394
395 CPL_DISALLOW_COPY_ASSIGN(OGRStyleBrush)
396
397 public:
398 OGRStyleBrush();
399 ~OGRStyleBrush() override;
400
401 /* Explicit fct for all parameters defined in the Drawing tools Brush */
402
403 const char *ForeColor(GBool &bDefault)
404 {
405 return GetParamStr(OGRSTBrushFColor, bDefault);
406 }
407
408 void SetForeColor(const char *pszColor)
409 {
410 SetParamStr(OGRSTBrushFColor, pszColor);
411 }
412
413 const char *BackColor(GBool &bDefault)
414 {
415 return GetParamStr(OGRSTBrushBColor, bDefault);
416 }
417
418 void SetBackColor(const char *pszColor)
419 {
420 SetParamStr(OGRSTBrushBColor, pszColor);
421 }
422
423 const char *Id(GBool &bDefault)
424 {
425 return GetParamStr(OGRSTBrushId, bDefault);
426 }
427
428 void SetId(const char *pszId)
429 {
430 SetParamStr(OGRSTBrushId, pszId);
431 }
432
433 double Angle(GBool &bDefault)
434 {
435 return GetParamDbl(OGRSTBrushAngle, bDefault);
436 }
437
438 void SetAngle(double dfAngle)
439 {
440 SetParamDbl(OGRSTBrushAngle, dfAngle);
441 }
442
443 double Size(GBool &bDefault)
444 {
445 return GetParamDbl(OGRSTBrushSize, bDefault);
446 }
447
448 void SetSize(double dfSize)
449 {
450 SetParamDbl(OGRSTBrushSize, dfSize);
451 }
452
453 double SpacingX(GBool &bDefault)
454 {
455 return GetParamDbl(OGRSTBrushDx, bDefault);
456 }
457
458 void SetSpacingX(double dfX)
459 {
460 SetParamDbl(OGRSTBrushDx, dfX);
461 }
462
463 double SpacingY(GBool &bDefault)
464 {
465 return GetParamDbl(OGRSTBrushDy, bDefault);
466 }
467
468 void SetSpacingY(double dfY)
469 {
470 SetParamDbl(OGRSTBrushDy, dfY);
471 }
472
473 int Priority(GBool &bDefault)
474 {
475 return GetParamNum(OGRSTBrushPriority, bDefault);
476 }
477
478 void SetPriority(int nPriority)
479 {
480 SetParamNum(OGRSTBrushPriority, nPriority);
481 }
482
483 /*****************************************************************/
484
485 const char *GetParamStr(OGRSTBrushParam eParam, GBool &bValueIsNull);
486 int GetParamNum(OGRSTBrushParam eParam, GBool &bValueIsNull);
487 double GetParamDbl(OGRSTBrushParam eParam, GBool &bValueIsNull);
488 void SetParamStr(OGRSTBrushParam eParam, const char *pszParamString);
489 void SetParamNum(OGRSTBrushParam eParam, int nParam);
490 void SetParamDbl(OGRSTBrushParam eParam, double dfParam);
491 const char *GetStyleString() override;
492};
493
497 class CPL_DLL OGRStyleSymbol : public OGRStyleTool
498{
499 private:
500 OGRStyleValue *m_pasStyleValue;
501
502 GBool Parse() override;
503
504 CPL_DISALLOW_COPY_ASSIGN(OGRStyleSymbol)
505
506 public:
507 OGRStyleSymbol();
508 ~OGRStyleSymbol() override;
509
510 /*****************************************************************/
511 /* Explicit fct for all parameters defined in the Drawing tools */
512 /*****************************************************************/
513
514 const char *Id(GBool &bDefault)
515 {
516 return GetParamStr(OGRSTSymbolId, bDefault);
517 }
518
519 void SetId(const char *pszId)
520 {
521 SetParamStr(OGRSTSymbolId, pszId);
522 }
523
524 double Angle(GBool &bDefault)
525 {
526 return GetParamDbl(OGRSTSymbolAngle, bDefault);
527 }
528
529 void SetAngle(double dfAngle)
530 {
531 SetParamDbl(OGRSTSymbolAngle, dfAngle);
532 }
533
534 const char *Color(GBool &bDefault)
535 {
536 return GetParamStr(OGRSTSymbolColor, bDefault);
537 }
538
539 void SetColor(const char *pszColor)
540 {
541 SetParamStr(OGRSTSymbolColor, pszColor);
542 }
543
544 double Size(GBool &bDefault)
545 {
546 return GetParamDbl(OGRSTSymbolSize, bDefault);
547 }
548
549 void SetSize(double dfSize)
550 {
551 SetParamDbl(OGRSTSymbolSize, dfSize);
552 }
553
554 double SpacingX(GBool &bDefault)
555 {
556 return GetParamDbl(OGRSTSymbolDx, bDefault);
557 }
558
559 void SetSpacingX(double dfX)
560 {
561 SetParamDbl(OGRSTSymbolDx, dfX);
562 }
563
564 double SpacingY(GBool &bDefault)
565 {
566 return GetParamDbl(OGRSTSymbolDy, bDefault);
567 }
568
569 void SetSpacingY(double dfY)
570 {
571 SetParamDbl(OGRSTSymbolDy, dfY);
572 }
573
574 double Step(GBool &bDefault)
575 {
576 return GetParamDbl(OGRSTSymbolStep, bDefault);
577 }
578
579 void SetStep(double dfStep)
580 {
581 SetParamDbl(OGRSTSymbolStep, dfStep);
582 }
583
584 double Offset(GBool &bDefault)
585 {
586 return GetParamDbl(OGRSTSymbolOffset, bDefault);
587 }
588
589 void SetOffset(double dfOffset)
590 {
591 SetParamDbl(OGRSTSymbolOffset, dfOffset);
592 }
593
594 double Perp(GBool &bDefault)
595 {
596 return GetParamDbl(OGRSTSymbolPerp, bDefault);
597 }
598
599 void SetPerp(double dfPerp)
600 {
601 SetParamDbl(OGRSTSymbolPerp, dfPerp);
602 }
603
604 int Priority(GBool &bDefault)
605 {
606 return GetParamNum(OGRSTSymbolPriority, bDefault);
607 }
608
609 void SetPriority(int nPriority)
610 {
611 SetParamNum(OGRSTSymbolPriority, nPriority);
612 }
613
614 const char *FontName(GBool &bDefault)
615 {
616 return GetParamStr(OGRSTSymbolFontName, bDefault);
617 }
618
619 void SetFontName(const char *pszFontName)
620 {
621 SetParamStr(OGRSTSymbolFontName, pszFontName);
622 }
623
624 const char *OColor(GBool &bDefault)
625 {
626 return GetParamStr(OGRSTSymbolOColor, bDefault);
627 }
628
629 void SetOColor(const char *pszColor)
630 {
631 SetParamStr(OGRSTSymbolOColor, pszColor);
632 }
633
634 /*****************************************************************/
635
636 const char *GetParamStr(OGRSTSymbolParam eParam, GBool &bValueIsNull);
637 int GetParamNum(OGRSTSymbolParam eParam, GBool &bValueIsNull);
638 double GetParamDbl(OGRSTSymbolParam eParam, GBool &bValueIsNull);
639 void SetParamStr(OGRSTSymbolParam eParam, const char *pszParamString);
640 void SetParamNum(OGRSTSymbolParam eParam, int nParam);
641 void SetParamDbl(OGRSTSymbolParam eParam, double dfParam);
642 const char *GetStyleString() override;
643};
644
648 class CPL_DLL OGRStyleLabel : public OGRStyleTool
649{
650 private:
651 OGRStyleValue *m_pasStyleValue;
652
653 GBool Parse() override;
654
655 CPL_DISALLOW_COPY_ASSIGN(OGRStyleLabel)
656
657 public:
658 OGRStyleLabel();
659 ~OGRStyleLabel() override;
660
661 /*****************************************************************/
662 /* Explicit fct for all parameters defined in the Drawing tools */
663 /*****************************************************************/
664
665 const char *FontName(GBool &bDefault)
666 {
667 return GetParamStr(OGRSTLabelFontName, bDefault);
668 }
669
670 void SetFontName(const char *pszFontName)
671 {
672 SetParamStr(OGRSTLabelFontName, pszFontName);
673 }
674
675 double Size(GBool &bDefault)
676 {
677 return GetParamDbl(OGRSTLabelSize, bDefault);
678 }
679
680 void SetSize(double dfSize)
681 {
682 SetParamDbl(OGRSTLabelSize, dfSize);
683 }
684
685 const char *TextString(GBool &bDefault)
686 {
687 return GetParamStr(OGRSTLabelTextString, bDefault);
688 }
689
690 void SetTextString(const char *pszTextString)
691 {
692 SetParamStr(OGRSTLabelTextString, pszTextString);
693 }
694
695 double Angle(GBool &bDefault)
696 {
697 return GetParamDbl(OGRSTLabelAngle, bDefault);
698 }
699
700 void SetAngle(double dfAngle)
701 {
702 SetParamDbl(OGRSTLabelAngle, dfAngle);
703 }
704
705 const char *ForeColor(GBool &bDefault)
706 {
707 return GetParamStr(OGRSTLabelFColor, bDefault);
708 }
709
710 void SetForColor(const char *pszForColor)
711 {
712 SetParamStr(OGRSTLabelFColor, pszForColor);
713 }
714
715 const char *BackColor(GBool &bDefault)
716 {
717 return GetParamStr(OGRSTLabelBColor, bDefault);
718 }
719
720 void SetBackColor(const char *pszBackColor)
721 {
722 SetParamStr(OGRSTLabelBColor, pszBackColor);
723 }
724
725 const char *Placement(GBool &bDefault)
726 {
727 return GetParamStr(OGRSTLabelPlacement, bDefault);
728 }
729
730 void SetPlacement(const char *pszPlacement)
731 {
732 SetParamStr(OGRSTLabelPlacement, pszPlacement);
733 }
734
735 int Anchor(GBool &bDefault)
736 {
737 return GetParamNum(OGRSTLabelAnchor, bDefault);
738 }
739
740 void SetAnchor(int nAnchor)
741 {
742 SetParamNum(OGRSTLabelAnchor, nAnchor);
743 }
744
745 double SpacingX(GBool &bDefault)
746 {
747 return GetParamDbl(OGRSTLabelDx, bDefault);
748 }
749
750 void SetSpacingX(double dfX)
751 {
752 SetParamDbl(OGRSTLabelDx, dfX);
753 }
754
755 double SpacingY(GBool &bDefault)
756 {
757 return GetParamDbl(OGRSTLabelDy, bDefault);
758 }
759
760 void SetSpacingY(double dfY)
761 {
762 SetParamDbl(OGRSTLabelDy, dfY);
763 }
764
765 double Perp(GBool &bDefault)
766 {
767 return GetParamDbl(OGRSTLabelPerp, bDefault);
768 }
769
770 void SetPerp(double dfPerp)
771 {
772 SetParamDbl(OGRSTLabelPerp, dfPerp);
773 }
774
775 GBool Bold(GBool &bDefault)
776 {
777 return GetParamNum(OGRSTLabelBold, bDefault);
778 }
779
780 void SetBold(GBool bBold)
781 {
782 SetParamNum(OGRSTLabelBold, bBold);
783 }
784
785 GBool Italic(GBool &bDefault)
786 {
787 return GetParamNum(OGRSTLabelItalic, bDefault);
788 }
789
790 void SetItalic(GBool bItalic)
791 {
792 SetParamNum(OGRSTLabelItalic, bItalic);
793 }
794
795 GBool Underline(GBool &bDefault)
796 {
797 return GetParamNum(OGRSTLabelUnderline, bDefault);
798 }
799
800 void SetUnderline(GBool bUnderline)
801 {
802 SetParamNum(OGRSTLabelUnderline, bUnderline);
803 }
804
805 int Priority(GBool &bDefault)
806 {
807 return GetParamNum(OGRSTLabelPriority, bDefault);
808 }
809
810 void SetPriority(int nPriority)
811 {
812 SetParamNum(OGRSTLabelPriority, nPriority);
813 }
814
815 GBool Strikeout(GBool &bDefault)
816 {
817 return GetParamNum(OGRSTLabelStrikeout, bDefault);
818 }
819
820 void SetStrikeout(GBool bStrikeout)
821 {
822 SetParamNum(OGRSTLabelStrikeout, bStrikeout);
823 }
824
825 double Stretch(GBool &bDefault)
826 {
827 return GetParamDbl(OGRSTLabelStretch, bDefault);
828 }
829
830 void SetStretch(double dfStretch)
831 {
832 SetParamDbl(OGRSTLabelStretch, dfStretch);
833 }
834
835 const char *ShadowColor(GBool &bDefault)
836 {
837 return GetParamStr(OGRSTLabelHColor, bDefault);
838 }
839
840 void SetShadowColor(const char *pszShadowColor)
841 {
842 SetParamStr(OGRSTLabelHColor, pszShadowColor);
843 }
844
845 const char *OutlineColor(GBool &bDefault)
846 {
847 return GetParamStr(OGRSTLabelOColor, bDefault);
848 }
849
850 void SetOutlineColor(const char *pszOutlineColor)
851 {
852 SetParamStr(OGRSTLabelOColor, pszOutlineColor);
853 }
854
855 /*****************************************************************/
856
857 const char *GetParamStr(OGRSTLabelParam eParam, GBool &bValueIsNull);
858 int GetParamNum(OGRSTLabelParam eParam, GBool &bValueIsNull);
859 double GetParamDbl(OGRSTLabelParam eParam, GBool &bValueIsNull);
860 void SetParamStr(OGRSTLabelParam eParam, const char *pszParamString);
861 void SetParamNum(OGRSTLabelParam eParam, int nParam);
862 void SetParamDbl(OGRSTLabelParam eParam, double dfParam);
863 const char *GetStyleString() override;
864};
865
867
868#endif /* OGR_FEATURESTYLE_INCLUDE */
CPLString
Convenient string class based on std::string.
Definition cpl_string.h:320
OGRFeature
A simple feature, including geometry and attributes.
Definition ogr_feature.h:934
OGRStyleMgr
This class represents a style manager.
Definition ogr_featurestyle.h:104
OGRStyleTable
This class represents a style table.
Definition ogr_featurestyle.h:69
OGRStyleTool
This class represents a style tool.
Definition ogr_featurestyle.h:156
OGRStyleTool::GetStyleString
virtual const char * GetStyleString()=0
Get the style string for this Style Tool.
OGRStyleTool::GetUnit
OGRSTUnitId GetUnit()
Get Style Tool units.
Definition ogr_featurestyle.h:223
cpl_conv.h
Various convenience functions for CPL.
GBool
int GBool
Type for boolean values (alias to int)
Definition cpl_port.h:186
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:936
cpl_string.h
Various convenience functions for working with strings and string lists.
ogr_core.h
Core portability services for cross-platform OGR code.
OGRSTSymbolDy
@ OGRSTSymbolDy
Dy.
Definition ogr_core.h:1151
OGRSTSymbolId
@ OGRSTSymbolId
Id.
Definition ogr_core.h:1146
OGRSTSymbolSize
@ OGRSTSymbolSize
Size.
Definition ogr_core.h:1149
OGRSTSymbolFontName
@ OGRSTSymbolFontName
Font name.
Definition ogr_core.h:1156
OGRSTSymbolColor
@ OGRSTSymbolColor
Color.
Definition ogr_core.h:1148
OGRSTSymbolDx
@ OGRSTSymbolDx
Dx.
Definition ogr_core.h:1150
OGRSTSymbolPerp
@ OGRSTSymbolPerp
Perpendicular.
Definition ogr_core.h:1153
OGRSTSymbolAngle
@ OGRSTSymbolAngle
Angle.
Definition ogr_core.h:1147
OGRSTSymbolOColor
@ OGRSTSymbolOColor
Outline color.
Definition ogr_core.h:1157
OGRSTSymbolPriority
@ OGRSTSymbolPriority
Priority.
Definition ogr_core.h:1155
OGRSTSymbolStep
@ OGRSTSymbolStep
Step.
Definition ogr_core.h:1152
OGRSTSymbolOffset
@ OGRSTSymbolOffset
Offset.
Definition ogr_core.h:1154
OGRSTSymbolParam
enum ogr_style_tool_param_symbol_id OGRSTSymbolParam
List of parameters for use with OGRStyleSymbol.
OGRSTPenParam
enum ogr_style_tool_param_pen_id OGRSTPenParam
List of parameters for use with OGRStylePen.
OGRSTLabelUnderline
@ OGRSTLabelUnderline
Underline.
Definition ogr_core.h:1181
OGRSTLabelPriority
@ OGRSTLabelPriority
Priority.
Definition ogr_core.h:1182
OGRSTLabelBold
@ OGRSTLabelBold
Bold.
Definition ogr_core.h:1179
OGRSTLabelStrikeout
@ OGRSTLabelStrikeout
Strike out.
Definition ogr_core.h:1183
OGRSTLabelBColor
@ OGRSTLabelBColor
Background color.
Definition ogr_core.h:1173
OGRSTLabelPlacement
@ OGRSTLabelPlacement
Placement.
Definition ogr_core.h:1174
OGRSTLabelPerp
@ OGRSTLabelPerp
Perpendicular.
Definition ogr_core.h:1178
OGRSTLabelOColor
@ OGRSTLabelOColor
Outline color.
Definition ogr_core.h:1188
OGRSTLabelDx
@ OGRSTLabelDx
Dx.
Definition ogr_core.h:1176
OGRSTLabelHColor
@ OGRSTLabelHColor
Highlight color.
Definition ogr_core.h:1187
OGRSTLabelItalic
@ OGRSTLabelItalic
Italic.
Definition ogr_core.h:1180
OGRSTLabelTextString
@ OGRSTLabelTextString
Text string.
Definition ogr_core.h:1170
OGRSTLabelSize
@ OGRSTLabelSize
Size.
Definition ogr_core.h:1169
OGRSTLabelAngle
@ OGRSTLabelAngle
Angle.
Definition ogr_core.h:1171
OGRSTLabelFColor
@ OGRSTLabelFColor
Foreground color.
Definition ogr_core.h:1172
OGRSTLabelDy
@ OGRSTLabelDy
Dy.
Definition ogr_core.h:1177
OGRSTLabelFontName
@ OGRSTLabelFontName
Font name.
Definition ogr_core.h:1168
OGRSTLabelStretch
@ OGRSTLabelStretch
Stretch.
Definition ogr_core.h:1184
OGRSTLabelAnchor
@ OGRSTLabelAnchor
Anchor.
Definition ogr_core.h:1175
OGRSTUGround
@ OGRSTUGround
Ground unit.
Definition ogr_core.h:1096
OGRSTUMM
@ OGRSTUMM
Millimeter.
Definition ogr_core.h:1099
OGRSTClassId
enum ogr_style_tool_class_id OGRSTClassId
OGRStyleTool derived class types (returned by GetType()).
OGRSTUnitId
enum ogr_style_tool_units_id OGRSTUnitId
List of units supported by OGRStyleTools.
OGRSTBrushParam
enum ogr_style_tool_param_brush_id OGRSTBrushParam
List of parameters for use with OGRStyleBrush.
OGRSTLabelParam
enum ogr_style_tool_param_label_id OGRSTLabelParam
List of parameters for use with OGRStyleLabel.
OGRSTBrushAngle
@ OGRSTBrushAngle
Angle.
Definition ogr_core.h:1130
OGRSTBrushId
@ OGRSTBrushId
Id.
Definition ogr_core.h:1129
OGRSTBrushPriority
@ OGRSTBrushPriority
Priority.
Definition ogr_core.h:1134
OGRSTBrushBColor
@ OGRSTBrushBColor
Background color.
Definition ogr_core.h:1128
OGRSTBrushSize
@ OGRSTBrushSize
Size.
Definition ogr_core.h:1131
OGRSTBrushDy
@ OGRSTBrushDy
Dy.
Definition ogr_core.h:1133
OGRSTBrushFColor
@ OGRSTBrushFColor
Foreground color.
Definition ogr_core.h:1127
OGRSTBrushDx
@ OGRSTBrushDx
Dx.
Definition ogr_core.h:1132
OGRSTCNone
@ OGRSTCNone
None.
Definition ogr_core.h:1083
OGRSTPenId
@ OGRSTPenId
Id.
Definition ogr_core.h:1112
OGRSTPenCap
@ OGRSTPenCap
Cap.
Definition ogr_core.h:1114
OGRSTPenPerOffset
@ OGRSTPenPerOffset
Perpendicular offset.
Definition ogr_core.h:1113
OGRSTPenWidth
@ OGRSTPenWidth
Width.
Definition ogr_core.h:1110
OGRSTPenColor
@ OGRSTPenColor
Color.
Definition ogr_core.h:1109
OGRSTPenJoin
@ OGRSTPenJoin
Join.
Definition ogr_core.h:1115
OGRSTPenPriority
@ OGRSTPenPriority
Priority.
Definition ogr_core.h:1116
OGRSTPenPattern
@ OGRSTPenPattern
Pattern.
Definition ogr_core.h:1111
ogr_style_type
ogr_style_type
OGR Style type.
Definition ogr_featurestyle.h:34
OGRSType
enum ogr_style_type OGRSType
OGR Style type.