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