Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

ogr_featurestyle.h

00001 /******************************************************************************
00002  * $Id: ogr_featurestyle.h 10646 2007-01-18 02:38:10Z warmerdam $
00003  *
00004  * Project:  OpenGIS Simple Features Reference Implementation
00005  * Purpose:  Define of Feature Representation
00006  * Author:   Stephane Villeneuve, stephane.v@videtron.ca
00007  *
00008  ******************************************************************************
00009  * Copyright (c) 1999, Frank Warmerdam
00010  *
00011  * Permission is hereby granted, free of charge, to any person obtaining a
00012  * copy of this software and associated documentation files (the "Software"),
00013  * to deal in the Software without restriction, including without limitation
00014  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00015  * and/or sell copies of the Software, and to permit persons to whom the
00016  * Software is furnished to do so, subject to the following conditions:
00017  *
00018  * The above copyright notice and this permission notice shall be included
00019  * in all copies or substantial portions of the Software.
00020  *
00021  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00022  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00023  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00024  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00025  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00026  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00027  * DEALINGS IN THE SOFTWARE.
00028  ****************************************************************************/
00029 
00030 #ifndef OGR_FEATURESTYLE_INCLUDE
00031 #define OGR_FEATURESTYLE_INCLUDE
00032 
00033 #include "cpl_conv.h"
00034 
00035 class OGRFeature;
00036 
00037 typedef enum ogr_style_tool_class_id
00038 {
00039     OGRSTCNone,
00040     OGRSTCPen,
00041     OGRSTCBrush,
00042     OGRSTCSymbol,
00043     OGRSTCLabel,
00044     OGRSTCVector
00045 } OGRSTClassId;
00046 
00047 typedef enum ogr_style_tool_units_id
00048 {
00049     OGRSTUGround,
00050     OGRSTUPixel,
00051     OGRSTUPoints,
00052     OGRSTUMM,
00053     OGRSTUCM,
00054     OGRSTUInches
00055 } OGRSTUnitId;
00056 
00057 typedef enum ogr_style_tool_param_pen_id
00058 {  
00059     OGRSTPenColor = 0,                   
00060     OGRSTPenWidth,                   
00061     OGRSTPenPattern,
00062     OGRSTPenId,
00063     OGRSTPenPerOffset,
00064     OGRSTPenCap,
00065     OGRSTPenJoin,
00066     OGRSTPenPriority,
00067     OGRSTPenLast
00068               
00069 } OGRSTPenParam;
00070 
00071 typedef enum ogr_style_tool_param_brush_id
00072 {  
00073     OGRSTBrushFColor = 0,                   
00074     OGRSTBrushBColor,                   
00075     OGRSTBrushId,
00076     OGRSTBrushAngle,                   
00077     OGRSTBrushSize,
00078     OGRSTBrushDx,
00079     OGRSTBrushDy,
00080     OGRSTBrushPriority,
00081     OGRSTBrushLast
00082               
00083 } OGRSTBrushParam;
00084 
00085 
00086 
00087 typedef enum ogr_style_tool_param_symbol_id
00088 {  
00089     OGRSTSymbolId = 0,
00090     OGRSTSymbolAngle,
00091     OGRSTSymbolColor,
00092     OGRSTSymbolSize,
00093     OGRSTSymbolDx,
00094     OGRSTSymbolDy,
00095     OGRSTSymbolStep,
00096     OGRSTSymbolPerp,
00097     OGRSTSymbolOffset,
00098     OGRSTSymbolPriority,
00099     OGRSTSymbolFontName,
00100     OGRSTSymbolLast
00101               
00102 } OGRSTSymbolParam;
00103 
00104 typedef enum ogr_style_tool_param_label_id
00105 {  
00106     OGRSTLabelFontName = 0,
00107     OGRSTLabelSize,
00108     OGRSTLabelTextString,
00109     OGRSTLabelAngle,
00110     OGRSTLabelFColor,
00111     OGRSTLabelBColor,
00112     OGRSTLabelPlacement,
00113     OGRSTLabelAnchor,
00114     OGRSTLabelDx,
00115     OGRSTLabelDy,
00116     OGRSTLabelPerp,
00117     OGRSTLabelBold,
00118     OGRSTLabelItalic,
00119     OGRSTLabelUnderline,
00120     OGRSTLabelPriority,
00121     OGRSTLabelStrikeout,
00122     OGRSTLabelStretch,
00123     OGRSTLabelAdjHor,
00124     OGRSTLabelAdjVert,
00125     OGRSTLabelHColor,
00126     OGRSTLabelLast
00127               
00128 } OGRSTLabelParam;
00129 
00130 typedef enum ogr_style_tool_param_vector_id
00131 {  
00132     OGRSTVectorId = 0,
00133     OGRSTVectorNoCompress,
00134     OGRSTVectorSprain,
00135     OGRSTVectorNoSlope,
00136     OGRSTVectorMirroring,
00137     OGRSTVectorCentering,
00138     OGRSTVectorPriority,
00139     OGRSTVectorLast
00140               
00141 } OGRSTVectorParam;
00142 
00143 typedef enum ogr_style_type
00144 {
00145     OGRSTypeString,
00146     OGRSTypeDouble,
00147     OGRSTypeInteger,
00148     OGRSTypeBoolean
00149 }  OGRSType;
00150 
00151 typedef struct ogr_style_param
00152 {
00153     int              eParam;
00154     char            *pszToken;
00155     GBool            bGeoref;
00156     OGRSType         eType;
00157 }OGRStyleParamId;
00158 
00159 
00160 typedef struct ogr_style_value
00161 {
00162     char            *pszValue;
00163     double           dfValue;
00164     int              nValue; // Used for both integer and boolean types
00165     GBool            bValid;
00166     OGRSTUnitId      eUnit;
00167 }OGRStyleValue;
00168 
00169 
00170 //Everytime a pszStyleString gived in parameter is NULL, 
00171 //    the StyleString defined in the Mgr will be use.
00172 
00173 class CPL_DLL OGRStyleTable
00174 {
00175   private:
00176     char **m_papszStyleTable;
00177 
00178   public:
00179     OGRStyleTable();
00180     ~OGRStyleTable();
00181     GBool AddStyle(const char *pszName,const char *pszStyleString);
00182     GBool RemoveStyle(const char *pszName);
00183     GBool ModifyStyle(const char *pszName, const char *pszStyleString);
00184     
00185     GBool SaveStyleTable(const char *pszFilename);
00186     GBool LoadStyleTable(const char *pszFilename);
00187     const char *Find(const char *pszStyleString);
00188     GBool IsExist(const char *pszName);
00189     const char *GetStyleName(const char *pszName);
00190     void  Print(FILE *fpOut);
00191     void  Clear();
00192     OGRStyleTable   *Clone();
00193 };
00194 
00195 
00196 class OGRStyleTool;
00197 
00198 class CPL_DLL OGRStyleMgr
00199 {
00200   private:
00201     OGRStyleTable   *m_poDataSetStyleTable;
00202     char            *m_pszStyleString;
00203 
00204   public:
00205     OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = NULL);
00206     ~OGRStyleMgr();
00207 
00208     GBool SetFeatureStyleString(OGRFeature *,const char *pszStyleString=NULL,
00209                                 GBool bNoMatching = FALSE);
00210     /*it will set in the gived feature the pszStyleString with 
00211             the style or will set the style name found in 
00212             dataset StyleTable (if bNoMatching == FALSE)*/
00213               
00214     const char *InitFromFeature(OGRFeature *);
00215     GBool InitStyleString(const char *pszStyleString = NULL);
00216     
00217     const char *GetStyleName(const char *pszStyleString= NULL);
00218     const char *GetStyleByName(const char *pszStyleName);
00219     
00220     GBool AddStyle(const char *pszStyleName, const char *pszStyleString=NULL);
00221     
00222     const char *GetStyleString(OGRFeature * = NULL);
00223  
00224     GBool AddPart(OGRStyleTool *);
00225     GBool AddPart(const char *);
00226 
00227     int GetPartCount(const char *pszStyleString = NULL);
00228     OGRStyleTool *GetPart(int hPartId, const char *pszStyleString = NULL);
00229     
00230     /*It could have a reference counting processus for the OGRStyleTable, if
00231       needed */
00232       
00233     OGRStyleTable *GetDataSetStyleTable(){return m_poDataSetStyleTable;}
00234     
00235     OGRStyleTool *CreateStyleToolFromStyleString(const char *pszStyleString);
00236 
00237 };
00238 
00239 class CPL_DLL OGRStyleTool
00240 {
00241   private:
00242     GBool m_bModified;
00243     GBool m_bParsed;
00244     double m_dfScale;
00245     OGRSTUnitId m_eUnit;
00246     OGRSTClassId m_eClassId;
00247     char *m_pszStyleString;
00248 
00249     virtual GBool Parse() = 0;
00250 
00251   protected:
00252     GBool Parse(OGRStyleParamId* pasStyle,
00253                 OGRStyleValue* pasValue,
00254                 int nCount);
00255 
00256   public:
00257     
00258     OGRStyleTool(){}
00259     OGRStyleTool(OGRSTClassId eClassId);
00260     virtual ~OGRStyleTool();
00261 
00262     GBool GetRGBFromString(const char *pszColor, int &nRed, int &nGreen, 
00263                            int &nBlue, int &nTransparence);
00264     int   GetSpecificId(const char *pszId, const char *pszWanted);
00265 
00266     GBool IsStyleModified() {return m_bModified;}
00267     void  StyleModified() {m_bModified = TRUE;}
00268 
00269     GBool IsStyleParsed() {return m_bParsed;}
00270     void  StyleParsed() {m_bParsed = TRUE;}
00271     
00272     OGRSTClassId GetType();
00273 
00274     void SetInternalInputUnitFromParam(char *pszString);
00275     
00276     void SetUnit(OGRSTUnitId,double dfScale = 1.0); //the dfScale will be
00277          //used if we are working with Ground Unit ( ground = paper * scale);
00278 
00279     OGRSTUnitId GetUnit(){return m_eUnit;}
00280     
00281     /* It's existe two way to set the parameters in the Style, with generic
00282 methodes (using a defined enumeration) or with the reel method specific
00283 for Each style tools.*/
00284     
00285     virtual const char *GetStyleString() = 0;
00286     void SetStyleString(const char *pszStyleString);
00287     const char *GetStyleString(OGRStyleParamId *pasStyleParam ,
00288                             OGRStyleValue *pasStyleValue, int nSize);
00289 
00290     const char *GetParamStr(OGRStyleParamId &sStyleParam ,
00291                             OGRStyleValue &sStyleValue,
00292                             GBool &bValueIsNull);
00293 
00294     int GetParamNum(OGRStyleParamId &sStyleParam ,
00295                        OGRStyleValue &sStyleValue,
00296                        GBool &bValueIsNull);
00297 
00298     double GetParamDbl(OGRStyleParamId &sStyleParam ,
00299                        OGRStyleValue &sStyleValue,
00300                        GBool &bValueIsNull);
00301     
00302     void SetParamStr(OGRStyleParamId &sStyleParam ,
00303                      OGRStyleValue &sStyleValue,
00304                      const char *pszParamString);
00305     
00306     void SetParamNum(OGRStyleParamId &sStyleParam ,
00307                      OGRStyleValue &sStyleValue,
00308                      int nParam);
00309 
00310     void SetParamDbl(OGRStyleParamId &sStyleParam ,
00311                      OGRStyleValue &sStyleValue,
00312                      double dfParam);
00313 
00314     double ComputeWithUnit(double, OGRSTUnitId);
00315     int    ComputeWithUnit(int , OGRSTUnitId);
00316 
00317 };
00318 
00319 extern OGRStyleParamId CPL_DLL asStylePen[];
00320 
00321 class CPL_DLL OGRStylePen : public OGRStyleTool
00322 {
00323   private:
00324 
00325     OGRStyleValue    *m_pasStyleValue;
00326 
00327     GBool Parse();
00328 
00329   public:
00330 
00331     OGRStylePen();
00332     virtual ~OGRStylePen(); 
00333 
00334     /**********************************************************************/
00335     /* Explicit fct for all parameters defined in the Drawing tools  Pen  */
00336     /**********************************************************************/
00337      
00338     const char *Color(GBool &bDefault){return GetParamStr(OGRSTPenColor,bDefault);}
00339     void SetColor(const char *pszColor){SetParamStr(OGRSTPenColor,pszColor);}
00340     double Width(GBool &bDefault){return GetParamDbl(OGRSTPenWidth,bDefault);}
00341     void SetWidth(double dfWidth){SetParamDbl(OGRSTPenWidth,dfWidth);}
00342     const char *Pattern(GBool &bDefault){return (char *)GetParamStr(OGRSTPenPattern,bDefault);}
00343     void SetPattern(const char *pszPattern){SetParamStr(OGRSTPenPattern,pszPattern);}
00344     const char *Id(GBool &bDefault){return GetParamStr(OGRSTPenId,bDefault);}
00345     void SetId(const char *pszId){SetParamStr(OGRSTPenId,pszId);}
00346     double PerpendicularOffset(GBool &bDefault){return GetParamDbl(OGRSTPenPerOffset,bDefault);}
00347     void SetPerpendicularOffset(double dfPerp){SetParamDbl(OGRSTPenPerOffset,dfPerp);}
00348     const char *Cap(GBool &bDefault){return GetParamStr(OGRSTPenCap,bDefault);}
00349     void SetCap(const char *pszCap){SetParamStr(OGRSTPenCap,pszCap);}
00350     const char *Join(GBool &bDefault){return GetParamStr(OGRSTPenJoin,bDefault);}
00351     void SetJoin(const char *pszJoin){SetParamStr(OGRSTPenJoin,pszJoin);}
00352     int  Priority(GBool &bDefault){return GetParamNum(OGRSTPenPriority,bDefault);}
00353     void SetPriority(int nPriority){SetParamNum(OGRSTPenPriority,nPriority);}
00354     
00355     /*****************************************************************/
00356     
00357     const char *GetParamStr(OGRSTPenParam eParam, GBool &bValueIsNull);
00358     int GetParamNum(OGRSTPenParam eParam,GBool &bValueIsNull);
00359     double GetParamDbl(OGRSTPenParam eParam,GBool &bValueIsNull);
00360     void SetParamStr(OGRSTPenParam eParam, const char *pszParamString);
00361     void SetParamNum(OGRSTPenParam eParam, int nParam);
00362     void SetParamDbl(OGRSTPenParam eParam, double dfParam);
00363     const char *GetStyleString();
00364 };
00365 
00366 extern OGRStyleParamId CPL_DLL asStyleBrush[];
00367 
00368 class CPL_DLL OGRStyleBrush : public OGRStyleTool
00369 {
00370   private:
00371 
00372     OGRStyleValue    *m_pasStyleValue;
00373 
00374     GBool Parse();
00375 
00376   public:
00377 
00378     OGRStyleBrush();
00379     virtual ~OGRStyleBrush();
00380 
00381     /* Explicit fct for all parameters defined in the Drawing tools Brush */
00382 
00383     const char *ForeColor(GBool &bDefault){return GetParamStr(OGRSTBrushFColor,bDefault);}
00384     void SetForeColor(const char *pszColor){SetParamStr(OGRSTBrushFColor,pszColor);}
00385     const char *BackColor(GBool &bDefault){return GetParamStr(OGRSTBrushBColor,bDefault);}
00386     void SetBackColor(const char *pszColor){SetParamStr(OGRSTBrushBColor,pszColor);}
00387     const char *Id(GBool &bDefault){ return GetParamStr(OGRSTBrushId,bDefault);}
00388     void  SetId(const char *pszId){SetParamStr(OGRSTBrushId,pszId);}
00389     double Angle(GBool &bDefault){return GetParamDbl(OGRSTBrushAngle,bDefault);}
00390     void SetAngle(double dfAngle){SetParamDbl(OGRSTBrushAngle,dfAngle );}
00391     double Size(GBool &bDefault){return GetParamDbl(OGRSTBrushSize,bDefault);}
00392     void SetSize(double dfSize){SetParamDbl(OGRSTBrushSize,dfSize  );}
00393     double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTBrushDx,bDefault);}
00394     void SetSpacingX(double dfX){SetParamDbl(OGRSTBrushDx,dfX );}
00395     double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTBrushDy,bDefault);}
00396     void SetSpacingY(double dfY){SetParamDbl(OGRSTBrushDy,dfY  );}
00397     int  Priority(GBool &bDefault){ return GetParamNum(OGRSTBrushPriority,bDefault);}
00398     void SetPriority(int nPriority){ SetParamNum(OGRSTBrushPriority,nPriority);}
00399     
00400 
00401     /*****************************************************************/
00402     
00403      const char *GetParamStr(OGRSTBrushParam eParam, GBool &bValueIsNull);
00404      int GetParamNum(OGRSTBrushParam eParam,GBool &bValueIsNull);
00405      double GetParamDbl(OGRSTBrushParam eParam,GBool &bValueIsNull);
00406      void SetParamStr(OGRSTBrushParam eParam, const char *pszParamString);
00407      void SetParamNum(OGRSTBrushParam eParam, int nParam);
00408      void SetParamDbl(OGRSTBrushParam eParam, double dfParam);
00409      const char *GetStyleString();
00410 };
00411 
00412 extern OGRStyleParamId CPL_DLL asStyleSymbol[];
00413 
00414 class CPL_DLL OGRStyleSymbol : public OGRStyleTool
00415 {
00416   private:
00417 
00418     OGRStyleValue    *m_pasStyleValue;
00419 
00420     GBool Parse();
00421 
00422   public:
00423 
00424     OGRStyleSymbol();
00425     virtual ~OGRStyleSymbol();
00426 
00427     /*****************************************************************/
00428     /* Explicit fct for all parameters defined in the Drawing tools  */
00429     /*****************************************************************/
00430     
00431     const char *Id(GBool &bDefault){return GetParamStr(OGRSTSymbolId,bDefault);}
00432     void  SetId(const char *pszId){ SetParamStr(OGRSTSymbolId,pszId);}
00433     double Angle(GBool &bDefault){ return GetParamDbl(OGRSTSymbolAngle,bDefault);}
00434     void SetAngle(double dfAngle){SetParamDbl(OGRSTSymbolAngle,dfAngle );}
00435     const char *Color(GBool &bDefault){return GetParamStr(OGRSTSymbolColor,bDefault);}
00436     void SetColor(const char *pszColor){SetParamStr(OGRSTSymbolColor,pszColor);}
00437     double Size(GBool &bDefault){  return GetParamDbl(OGRSTSymbolSize,bDefault);}
00438     void SetSize(double dfSize){  SetParamDbl(OGRSTSymbolSize,dfSize  );}
00439     double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTSymbolDx,bDefault);}
00440     void SetSpacingX(double dfX){SetParamDbl(OGRSTSymbolDx,dfX  );}
00441     double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTSymbolDy,bDefault);}
00442     void SetSpacingY(double dfY){SetParamDbl(OGRSTSymbolDy,dfY  );}
00443     double Step(GBool &bDefault){return GetParamDbl(OGRSTSymbolStep,bDefault);}
00444     void SetStep(double dfStep){SetParamDbl(OGRSTSymbolStep,dfStep  );}
00445     double Offset(GBool &bDefault){return GetParamDbl(OGRSTSymbolOffset,bDefault);}
00446     void SetOffset(double dfOffset){SetParamDbl(OGRSTSymbolOffset,dfOffset  );}
00447     double Perp(GBool &bDefault){return GetParamDbl(OGRSTSymbolPerp,bDefault);}
00448     void SetPerp(double dfPerp){SetParamDbl(OGRSTSymbolPerp,dfPerp  );}  
00449     int  Priority(GBool &bDefault){return GetParamNum(OGRSTSymbolPriority,bDefault);}
00450     void SetPriority(int nPriority){SetParamNum(OGRSTSymbolPriority,nPriority);}
00451     const char *FontName(GBool &bDefault)
00452         {return GetParamStr(OGRSTSymbolFontName,bDefault);}
00453     void SetFontName(const char *pszFontName)
00454         {SetParamStr(OGRSTSymbolFontName,pszFontName);}
00455 
00456     /*****************************************************************/
00457     
00458      const char *GetParamStr(OGRSTSymbolParam eParam, GBool &bValueIsNull);
00459      int GetParamNum(OGRSTSymbolParam eParam,GBool &bValueIsNull);
00460      double GetParamDbl(OGRSTSymbolParam eParam,GBool &bValueIsNull);
00461      void SetParamStr(OGRSTSymbolParam eParam, const char *pszParamString);
00462      void SetParamNum(OGRSTSymbolParam eParam, int nParam);
00463      void SetParamDbl(OGRSTSymbolParam eParam, double dfParam);
00464      const char *GetStyleString();
00465 };
00466 
00467 extern OGRStyleParamId CPL_DLL asStyleLabel[];
00468 
00469 class CPL_DLL OGRStyleLabel : public OGRStyleTool
00470 {
00471   private:
00472 
00473     OGRStyleValue    *m_pasStyleValue;
00474 
00475     GBool Parse();
00476 
00477   public:
00478 
00479     OGRStyleLabel();
00480     virtual ~OGRStyleLabel();
00481 
00482     /*****************************************************************/
00483     /* Explicit fct for all parameters defined in the Drawing tools  */
00484     /*****************************************************************/
00485     
00486     const char *FontName(GBool &bDefault){return GetParamStr(OGRSTLabelFontName,bDefault);}
00487     void  SetFontName(const char *pszFontName){SetParamStr(OGRSTLabelFontName,pszFontName);}
00488     double Size(GBool &bDefault){return GetParamDbl(OGRSTLabelSize,bDefault);}
00489     void SetSize(double dfSize){SetParamDbl(OGRSTLabelSize,dfSize);}
00490     const char *TextString(GBool &bDefault){return GetParamStr(OGRSTLabelTextString,bDefault);}
00491     void SetTextString(const char *pszTextString){SetParamStr(OGRSTLabelTextString,pszTextString);}
00492     double Angle(GBool &bDefault){return GetParamDbl(OGRSTLabelAngle,bDefault);}
00493     void SetAngle(double dfAngle){SetParamDbl(OGRSTLabelAngle,dfAngle);}
00494     const char *ForeColor(GBool &bDefault){return GetParamStr(OGRSTLabelFColor,bDefault);}
00495     void SetForColor(const char *pszForColor){SetParamStr(OGRSTLabelFColor,pszForColor);}
00496     const char *BackColor(GBool &bDefault){return GetParamStr(OGRSTLabelBColor,bDefault);}
00497     void SetBackColor(const char *pszBackColor){SetParamStr(OGRSTLabelBColor,pszBackColor);}
00498     const char *Placement(GBool &bDefault){return GetParamStr(OGRSTLabelPlacement,bDefault);}
00499     void SetPlacement(const char *pszPlacement){SetParamStr(OGRSTLabelPlacement,pszPlacement);}
00500     int  Anchor(GBool &bDefault){return GetParamNum(OGRSTLabelAnchor,bDefault);}
00501     void SetAnchor(int nAnchor){SetParamNum(OGRSTLabelAnchor,nAnchor);}
00502     double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTLabelDx,bDefault);}
00503     void SetSpacingX(double dfX){SetParamDbl(OGRSTLabelDx,dfX);}
00504     double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTLabelDy,bDefault);}
00505     void SetSpacingY(double dfY){SetParamDbl(OGRSTLabelDy,dfY);}
00506     double Perp(GBool &bDefault){return GetParamDbl(OGRSTLabelPerp,bDefault);}
00507     void SetPerp(double dfPerp){SetParamDbl(OGRSTLabelPerp,dfPerp);}  
00508     GBool Bold(GBool &bDefault){return GetParamNum(OGRSTLabelBold,bDefault);}
00509     void SetBold(GBool bBold){SetParamNum(OGRSTLabelBold,bBold);}
00510     GBool Italic(GBool &bDefault){return GetParamNum(OGRSTLabelItalic,bDefault);}
00511     void SetItalic(GBool bItalic){SetParamNum(OGRSTLabelItalic,bItalic);}
00512     GBool Underline(GBool &bDefault){return GetParamNum(OGRSTLabelUnderline,bDefault);}
00513     void SetUnderline(GBool bUnderline){SetParamNum(OGRSTLabelUnderline,bUnderline);}
00514     int  Priority(GBool &bDefault){return GetParamNum(OGRSTLabelPriority,bDefault);}
00515     void SetPriority(int nPriority){SetParamNum(OGRSTLabelPriority,nPriority);}
00516     GBool Strikeout(GBool &bDefault){return GetParamNum(OGRSTLabelStrikeout,bDefault);}
00517     void SetStrikeout(GBool bStrikeout){SetParamNum(OGRSTLabelStrikeout,bStrikeout);}
00518     double Stretch(GBool &bDefault){return GetParamDbl(OGRSTLabelStretch,bDefault);}
00519     void SetStretch(double dfStretch){SetParamDbl(OGRSTLabelStretch,dfStretch);}
00520     const char *AdjustmentHor(GBool &bDefault){return GetParamStr(OGRSTLabelAdjHor,bDefault);}
00521     void SetAdjustmentHor(const char *pszAdjustmentHor){SetParamStr(OGRSTLabelAdjHor,pszAdjustmentHor);}
00522     const char *AdjustmentVert(GBool &bDefault){return GetParamStr(OGRSTLabelAdjVert,bDefault);}
00523     void SetAdjustmentVert(const char *pszAdjustmentVert){SetParamStr(OGRSTLabelAdjHor,pszAdjustmentVert);}
00524     const char *ShadowColor(GBool &bDefault){return GetParamStr(OGRSTLabelHColor,bDefault);}
00525     void SetShadowColor(const char *pszShadowColor){SetParamStr(OGRSTLabelHColor,pszShadowColor);}
00526     
00527     /*****************************************************************/
00528     
00529      const char *GetParamStr(OGRSTLabelParam eParam, GBool &bValueIsNull);
00530      int GetParamNum(OGRSTLabelParam eParam,GBool &bValueIsNull);
00531      double GetParamDbl(OGRSTLabelParam eParam,GBool &bValueIsNull);
00532      void SetParamStr(OGRSTLabelParam eParam, const char *pszParamString);
00533      void SetParamNum(OGRSTLabelParam eParam, int nParam);
00534      void SetParamDbl(OGRSTLabelParam eParam, double dfParam);
00535      const char *GetStyleString();
00536 };
00537 
00538 extern OGRStyleParamId CPL_DLL asStyleVector[];
00539 
00540 class CPL_DLL OGRStyleVector : public OGRStyleTool
00541 {
00542   private:
00543     
00544     OGRStyleValue    *m_pasStyleValue;
00545 
00546     GBool Parse();
00547 
00548   public:
00549 
00550     OGRStyleVector();
00551     virtual ~OGRStyleVector();
00552 
00553     /*****************************************************************/
00554     /* Explicit fct for all parameters defined in the Drawing tools  */
00555     /*****************************************************************/
00556     
00557     const char *Id(GBool &bDefault){return GetParamStr(OGRSTVectorId,bDefault);}
00558     void  SetId(const char *pszId){ SetParamStr(OGRSTVectorId,pszId);}
00559     int  Priority(GBool &bDefault){return GetParamNum(OGRSTVectorPriority,bDefault);}
00560     void SetPriority(int nPriority){SetParamNum(OGRSTVectorPriority,nPriority);}
00561     
00562 
00563     GBool NoCompress(GBool &bDefault){return GetParamNum(OGRSTVectorNoCompress,bDefault);}
00564     void SetNoCompress(GBool bNoCompress){SetParamNum(OGRSTVectorNoCompress,bNoCompress);}
00565     GBool Sprain(GBool &bDefault){return GetParamNum(OGRSTVectorSprain,bDefault);}
00566     void SetSprain(GBool bSprain){SetParamNum(OGRSTVectorSprain,bSprain);}
00567     GBool NoSlope(GBool &bDefault){return GetParamNum(OGRSTVectorNoSlope,bDefault);}
00568     void SetNoSlope(GBool bNoSlope){SetParamNum(OGRSTVectorNoSlope,bNoSlope);}
00569     GBool Mirroring(GBool &bDefault){return GetParamNum(OGRSTVectorMirroring,bDefault);}
00570     void SetMirroring(GBool bMirroring){SetParamNum(OGRSTVectorMirroring,bMirroring);}
00571     GBool Centering(GBool &bDefault){return GetParamNum(OGRSTVectorCentering,bDefault);}
00572     void SetCentering(GBool bCentering){SetParamNum(OGRSTVectorCentering,bCentering);}
00573 
00574     /*****************************************************************/
00575     
00576      const char *GetParamStr(OGRSTVectorParam eParam, GBool &bValueIsNull);
00577      int GetParamNum(OGRSTVectorParam eParam,GBool &bValueIsNull);
00578      double GetParamDbl(OGRSTVectorParam eParam,GBool &bValueIsNull);
00579      void SetParamStr(OGRSTVectorParam eParam, const char *pszParamString);
00580      void SetParamNum(OGRSTVectorParam eParam, int nParam);
00581      void SetParamDbl(OGRSTVectorParam eParam, double dfParam);
00582      const char *GetStyleString();
00583 };
00584 
00585 #endif /* OGR_FEATURESTYLE_INCLUDE */

Generated for GDAL by doxygen 1.4.4.