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

ogr_featurestyle.h

00001 /******************************************************************************
00002  * $Id: ogr_featurestyle.h,v 1.14 2006/12/13 18:53:29 dron Exp $
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  * $Log: ogr_featurestyle.h,v $
00031  * Revision 1.14  2006/12/13 18:53:29  dron
00032  * Added OGRStyleTable::Clone() method.
00033  *
00034  * Revision 1.13  2006/12/12 17:14:29  dron
00035  * Fixed method names in OGRStyleVector interface.
00036  *
00037  * Revision 1.12  2006/11/16 18:57:24  dron
00038  * Make Parse() method private.
00039  *
00040  * Revision 1.11  2006/11/16 11:58:40  dron
00041  * In all classes: move data properties in private section.
00042  *
00043  * Revision 1.10  2006/10/09 13:01:23  dron
00044  * Added OGRSTypeBoolean type to the list of OGRSType types.
00045  *
00046  * Revision 1.9  2006/09/23 15:27:52  dron
00047  * Added new label styles:  'w', 'st', 'h', 'm:h', 'm:a', 'p:{10,11,12}'.
00048  *
00049  * Revision 1.8  2004/12/02 18:24:12  fwarmerdam
00050  * added support for fontname on symbol, per bug 684
00051  *
00052  * Revision 1.7  2004/05/11 00:39:43  warmerda
00053  * make asStyle*[] using methods non-inline
00054  *
00055  * Revision 1.6  2002/06/25 14:47:31  warmerda
00056  * CPL_DLL export style api
00057  *
00058  * Revision 1.5  2001/03/17 01:43:53  warmerda
00059  * Don't leave in trailing comma in enum (as submitted by Dale).
00060  *
00061  * Revision 1.4  2001/01/19 21:10:47  warmerda
00062  * replaced tabs
00063  *
00064  * Revision 1.3  2000/12/07 03:42:37  danmo
00065  * REmoved stray comma in OGRSType enum defn
00066  *
00067  * Revision 1.2  2000/08/28 20:26:18  svillene
00068  * Add missing virtual ~()
00069  *
00070  * Revision 1.1  2000/08/18 21:26:01  svillene
00071  * OGR Representation
00072  *
00073  *
00074  */
00075 
00076 #ifndef OGR_FEATURESTYLE_INCLUDE
00077 #define OGR_FEATURESTYLE_INCLUDE
00078 
00079 #include "cpl_conv.h"
00080 
00081 class OGRFeature;
00082 
00083 typedef enum ogr_style_tool_class_id
00084 {
00085     OGRSTCNone,
00086     OGRSTCPen,
00087     OGRSTCBrush,
00088     OGRSTCSymbol,
00089     OGRSTCLabel,
00090     OGRSTCVector
00091 } OGRSTClassId;
00092 
00093 typedef enum ogr_style_tool_units_id
00094 {
00095     OGRSTUGround,
00096     OGRSTUPixel,
00097     OGRSTUPoints,
00098     OGRSTUMM,
00099     OGRSTUCM,
00100     OGRSTUInches
00101 } OGRSTUnitId;
00102 
00103 typedef enum ogr_style_tool_param_pen_id
00104 {  
00105     OGRSTPenColor = 0,                   
00106     OGRSTPenWidth,                   
00107     OGRSTPenPattern,
00108     OGRSTPenId,
00109     OGRSTPenPerOffset,
00110     OGRSTPenCap,
00111     OGRSTPenJoin,
00112     OGRSTPenPriority,
00113     OGRSTPenLast
00114               
00115 } OGRSTPenParam;
00116 
00117 typedef enum ogr_style_tool_param_brush_id
00118 {  
00119     OGRSTBrushFColor = 0,                   
00120     OGRSTBrushBColor,                   
00121     OGRSTBrushId,
00122     OGRSTBrushAngle,                   
00123     OGRSTBrushSize,
00124     OGRSTBrushDx,
00125     OGRSTBrushDy,
00126     OGRSTBrushPriority,
00127     OGRSTBrushLast
00128               
00129 } OGRSTBrushParam;
00130 
00131 
00132 
00133 typedef enum ogr_style_tool_param_symbol_id
00134 {  
00135     OGRSTSymbolId = 0,
00136     OGRSTSymbolAngle,
00137     OGRSTSymbolColor,
00138     OGRSTSymbolSize,
00139     OGRSTSymbolDx,
00140     OGRSTSymbolDy,
00141     OGRSTSymbolStep,
00142     OGRSTSymbolPerp,
00143     OGRSTSymbolOffset,
00144     OGRSTSymbolPriority,
00145     OGRSTSymbolFontName,
00146     OGRSTSymbolLast
00147               
00148 } OGRSTSymbolParam;
00149 
00150 typedef enum ogr_style_tool_param_label_id
00151 {  
00152     OGRSTLabelFontName = 0,
00153     OGRSTLabelSize,
00154     OGRSTLabelTextString,
00155     OGRSTLabelAngle,
00156     OGRSTLabelFColor,
00157     OGRSTLabelBColor,
00158     OGRSTLabelPlacement,
00159     OGRSTLabelAnchor,
00160     OGRSTLabelDx,
00161     OGRSTLabelDy,
00162     OGRSTLabelPerp,
00163     OGRSTLabelBold,
00164     OGRSTLabelItalic,
00165     OGRSTLabelUnderline,
00166     OGRSTLabelPriority,
00167     OGRSTLabelStrikeout,
00168     OGRSTLabelStretch,
00169     OGRSTLabelAdjHor,
00170     OGRSTLabelAdjVert,
00171     OGRSTLabelHColor,
00172     OGRSTLabelLast
00173               
00174 } OGRSTLabelParam;
00175 
00176 typedef enum ogr_style_tool_param_vector_id
00177 {  
00178     OGRSTVectorId = 0,
00179     OGRSTVectorNoCompress,
00180     OGRSTVectorSprain,
00181     OGRSTVectorNoSlope,
00182     OGRSTVectorMirroring,
00183     OGRSTVectorCentering,
00184     OGRSTVectorPriority,
00185     OGRSTVectorLast
00186               
00187 } OGRSTVectorParam;
00188 
00189 typedef enum ogr_style_type
00190 {
00191     OGRSTypeString,
00192     OGRSTypeDouble,
00193     OGRSTypeInteger,
00194     OGRSTypeBoolean
00195 }  OGRSType;
00196 
00197 typedef struct ogr_style_param
00198 {
00199     int              eParam;
00200     char            *pszToken;
00201     GBool            bGeoref;
00202     OGRSType         eType;
00203 }OGRStyleParamId;
00204 
00205 
00206 typedef struct ogr_style_value
00207 {
00208     char            *pszValue;
00209     double           dfValue;
00210     int              nValue; // Used for both integer and boolean types
00211     GBool            bValid;
00212     OGRSTUnitId      eUnit;
00213 }OGRStyleValue;
00214 
00215 
00216 //Everytime a pszStyleString gived in parameter is NULL, 
00217 //    the StyleString defined in the Mgr will be use.
00218 
00219 class CPL_DLL OGRStyleTable
00220 {
00221   private:
00222     char **m_papszStyleTable;
00223 
00224   public:
00225     OGRStyleTable();
00226     ~OGRStyleTable();
00227     GBool AddStyle(const char *pszName,const char *pszStyleString);
00228     GBool RemoveStyle(const char *pszName);
00229     GBool ModifyStyle(const char *pszName, const char *pszStyleString);
00230     
00231     GBool SaveStyleTable(const char *pszFilename);
00232     GBool LoadStyleTable(const char *pszFilename);
00233     const char *Find(const char *pszStyleString);
00234     GBool IsExist(const char *pszName);
00235     const char *GetStyleName(const char *pszName);
00236     void  Print(FILE *fpOut);
00237     void  Clear();
00238     OGRStyleTable   *Clone();
00239 };
00240 
00241 
00242 class OGRStyleTool;
00243 
00244 class CPL_DLL OGRStyleMgr
00245 {
00246   private:
00247     OGRStyleTable   *m_poDataSetStyleTable;
00248     char            *m_pszStyleString;
00249 
00250   public:
00251     OGRStyleMgr(OGRStyleTable *poDataSetStyleTable = NULL);
00252     ~OGRStyleMgr();
00253 
00254     GBool SetFeatureStyleString(OGRFeature *,const char *pszStyleString=NULL,
00255                                 GBool bNoMatching = FALSE);
00256     /*it will set in the gived feature the pszStyleString with 
00257             the style or will set the style name found in 
00258             dataset StyleTable (if bNoMatching == FALSE)*/
00259               
00260     const char *InitFromFeature(OGRFeature *);
00261     GBool InitStyleString(const char *pszStyleString = NULL);
00262     
00263     const char *GetStyleName(const char *pszStyleString= NULL);
00264     const char *GetStyleByName(const char *pszStyleName);
00265     
00266     GBool AddStyle(const char *pszStyleName, const char *pszStyleString=NULL);
00267     
00268     const char *GetStyleString(OGRFeature * = NULL);
00269  
00270     GBool AddPart(OGRStyleTool *);
00271     GBool AddPart(const char *);
00272 
00273     int GetPartCount(const char *pszStyleString = NULL);
00274     OGRStyleTool *GetPart(int hPartId, const char *pszStyleString = NULL);
00275     
00276     /*It could have a reference counting processus for the OGRStyleTable, if
00277       needed */
00278       
00279     OGRStyleTable *GetDataSetStyleTable(){return m_poDataSetStyleTable;}
00280     
00281     OGRStyleTool *CreateStyleToolFromStyleString(const char *pszStyleString);
00282 
00283 };
00284 
00285 class CPL_DLL OGRStyleTool
00286 {
00287   private:
00288     GBool m_bModified;
00289     GBool m_bParsed;
00290     double m_dfScale;
00291     OGRSTUnitId m_eUnit;
00292     OGRSTClassId m_eClassId;
00293     char *m_pszStyleString;
00294 
00295     virtual GBool Parse() = 0;
00296 
00297   protected:
00298     GBool Parse(OGRStyleParamId* pasStyle,
00299                 OGRStyleValue* pasValue,
00300                 int nCount);
00301 
00302   public:
00303     
00304     OGRStyleTool(){}
00305     OGRStyleTool(OGRSTClassId eClassId);
00306     virtual ~OGRStyleTool();
00307 
00308     GBool GetRGBFromString(const char *pszColor, int &nRed, int &nGreen, 
00309                            int &nBlue, int &nTransparence);
00310     int   GetSpecificId(const char *pszId, const char *pszWanted);
00311 
00312     GBool IsStyleModified() {return m_bModified;}
00313     void  StyleModified() {m_bModified = TRUE;}
00314 
00315     GBool IsStyleParsed() {return m_bParsed;}
00316     void  StyleParsed() {m_bParsed = TRUE;}
00317     
00318     OGRSTClassId GetType();
00319 
00320     void SetInternalInputUnitFromParam(char *pszString);
00321     
00322     void SetUnit(OGRSTUnitId,double dfScale = 1.0); //the dfScale will be
00323          //used if we are working with Ground Unit ( ground = paper * scale);
00324 
00325     OGRSTUnitId GetUnit(){return m_eUnit;}
00326     
00327     /* It's existe two way to set the parameters in the Style, with generic
00328 methodes (using a defined enumeration) or with the reel method specific
00329 for Each style tools.*/
00330     
00331     virtual const char *GetStyleString() = 0;
00332     void SetStyleString(const char *pszStyleString);
00333     const char *GetStyleString(OGRStyleParamId *pasStyleParam ,
00334                             OGRStyleValue *pasStyleValue, int nSize);
00335 
00336     const char *GetParamStr(OGRStyleParamId &sStyleParam ,
00337                             OGRStyleValue &sStyleValue,
00338                             GBool &bValueIsNull);
00339 
00340     int GetParamNum(OGRStyleParamId &sStyleParam ,
00341                        OGRStyleValue &sStyleValue,
00342                        GBool &bValueIsNull);
00343 
00344     double GetParamDbl(OGRStyleParamId &sStyleParam ,
00345                        OGRStyleValue &sStyleValue,
00346                        GBool &bValueIsNull);
00347     
00348     void SetParamStr(OGRStyleParamId &sStyleParam ,
00349                      OGRStyleValue &sStyleValue,
00350                      const char *pszParamString);
00351     
00352     void SetParamNum(OGRStyleParamId &sStyleParam ,
00353                      OGRStyleValue &sStyleValue,
00354                      int nParam);
00355 
00356     void SetParamDbl(OGRStyleParamId &sStyleParam ,
00357                      OGRStyleValue &sStyleValue,
00358                      double dfParam);
00359 
00360     double ComputeWithUnit(double, OGRSTUnitId);
00361     int    ComputeWithUnit(int , OGRSTUnitId);
00362 
00363 };
00364 
00365 extern OGRStyleParamId CPL_DLL asStylePen[];
00366 
00367 class CPL_DLL OGRStylePen : public OGRStyleTool
00368 {
00369   private:
00370 
00371     OGRStyleValue    *m_pasStyleValue;
00372 
00373     GBool Parse();
00374 
00375   public:
00376 
00377     OGRStylePen();
00378     virtual ~OGRStylePen(); 
00379 
00380     /**********************************************************************/
00381     /* Explicit fct for all parameters defined in the Drawing tools  Pen  */
00382     /**********************************************************************/
00383      
00384     const char *Color(GBool &bDefault){return GetParamStr(OGRSTPenColor,bDefault);}
00385     void SetColor(const char *pszColor){SetParamStr(OGRSTPenColor,pszColor);}
00386     double Width(GBool &bDefault){return GetParamDbl(OGRSTPenWidth,bDefault);}
00387     void SetWidth(double dfWidth){SetParamDbl(OGRSTPenWidth,dfWidth);}
00388     const char *Pattern(GBool &bDefault){return (char *)GetParamStr(OGRSTPenPattern,bDefault);}
00389     void SetPattern(const char *pszPattern){SetParamStr(OGRSTPenPattern,pszPattern);}
00390     const char *Id(GBool &bDefault){return GetParamStr(OGRSTPenId,bDefault);}
00391     void SetId(const char *pszId){SetParamStr(OGRSTPenId,pszId);}
00392     double PerpendicularOffset(GBool &bDefault){return GetParamDbl(OGRSTPenPerOffset,bDefault);}
00393     void SetPerpendicularOffset(double dfPerp){SetParamDbl(OGRSTPenPerOffset,dfPerp);}
00394     const char *Cap(GBool &bDefault){return GetParamStr(OGRSTPenCap,bDefault);}
00395     void SetCap(const char *pszCap){SetParamStr(OGRSTPenCap,pszCap);}
00396     const char *Join(GBool &bDefault){return GetParamStr(OGRSTPenJoin,bDefault);}
00397     void SetJoin(const char *pszJoin){SetParamStr(OGRSTPenJoin,pszJoin);}
00398     int  Priority(GBool &bDefault){return GetParamNum(OGRSTPenPriority,bDefault);}
00399     void SetPriority(int nPriority){SetParamNum(OGRSTPenPriority,nPriority);}
00400     
00401     /*****************************************************************/
00402     
00403     const char *GetParamStr(OGRSTPenParam eParam, GBool &bValueIsNull);
00404     int GetParamNum(OGRSTPenParam eParam,GBool &bValueIsNull);
00405     double GetParamDbl(OGRSTPenParam eParam,GBool &bValueIsNull);
00406     void SetParamStr(OGRSTPenParam eParam, const char *pszParamString);
00407     void SetParamNum(OGRSTPenParam eParam, int nParam);
00408     void SetParamDbl(OGRSTPenParam eParam, double dfParam);
00409     const char *GetStyleString();
00410 };
00411 
00412 extern OGRStyleParamId CPL_DLL asStyleBrush[];
00413 
00414 class CPL_DLL OGRStyleBrush : public OGRStyleTool
00415 {
00416   private:
00417 
00418     OGRStyleValue    *m_pasStyleValue;
00419 
00420     GBool Parse();
00421 
00422   public:
00423 
00424     OGRStyleBrush();
00425     virtual ~OGRStyleBrush();
00426 
00427     /* Explicit fct for all parameters defined in the Drawing tools Brush */
00428 
00429     const char *ForeColor(GBool &bDefault){return GetParamStr(OGRSTBrushFColor,bDefault);}
00430     void SetForeColor(const char *pszColor){SetParamStr(OGRSTBrushFColor,pszColor);}
00431     const char *BackColor(GBool &bDefault){return GetParamStr(OGRSTBrushBColor,bDefault);}
00432     void SetBackColor(const char *pszColor){SetParamStr(OGRSTBrushBColor,pszColor);}
00433     const char *Id(GBool &bDefault){ return GetParamStr(OGRSTBrushId,bDefault);}
00434     void  SetId(const char *pszId){SetParamStr(OGRSTBrushId,pszId);}
00435     double Angle(GBool &bDefault){return GetParamDbl(OGRSTBrushAngle,bDefault);}
00436     void SetAngle(double dfAngle){SetParamDbl(OGRSTBrushAngle,dfAngle );}
00437     double Size(GBool &bDefault){return GetParamDbl(OGRSTBrushSize,bDefault);}
00438     void SetSize(double dfSize){SetParamDbl(OGRSTBrushSize,dfSize  );}
00439     double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTBrushDx,bDefault);}
00440     void SetSpacingX(double dfX){SetParamDbl(OGRSTBrushDx,dfX );}
00441     double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTBrushDy,bDefault);}
00442     void SetSpacingY(double dfY){SetParamDbl(OGRSTBrushDy,dfY  );}
00443     int  Priority(GBool &bDefault){ return GetParamNum(OGRSTBrushPriority,bDefault);}
00444     void SetPriority(int nPriority){ SetParamNum(OGRSTBrushPriority,nPriority);}
00445     
00446 
00447     /*****************************************************************/
00448     
00449      const char *GetParamStr(OGRSTBrushParam eParam, GBool &bValueIsNull);
00450      int GetParamNum(OGRSTBrushParam eParam,GBool &bValueIsNull);
00451      double GetParamDbl(OGRSTBrushParam eParam,GBool &bValueIsNull);
00452      void SetParamStr(OGRSTBrushParam eParam, const char *pszParamString);
00453      void SetParamNum(OGRSTBrushParam eParam, int nParam);
00454      void SetParamDbl(OGRSTBrushParam eParam, double dfParam);
00455      const char *GetStyleString();
00456 };
00457 
00458 extern OGRStyleParamId CPL_DLL asStyleSymbol[];
00459 
00460 class CPL_DLL OGRStyleSymbol : public OGRStyleTool
00461 {
00462   private:
00463 
00464     OGRStyleValue    *m_pasStyleValue;
00465 
00466     GBool Parse();
00467 
00468   public:
00469 
00470     OGRStyleSymbol();
00471     virtual ~OGRStyleSymbol();
00472 
00473     /*****************************************************************/
00474     /* Explicit fct for all parameters defined in the Drawing tools  */
00475     /*****************************************************************/
00476     
00477     const char *Id(GBool &bDefault){return GetParamStr(OGRSTSymbolId,bDefault);}
00478     void  SetId(const char *pszId){ SetParamStr(OGRSTSymbolId,pszId);}
00479     double Angle(GBool &bDefault){ return GetParamDbl(OGRSTSymbolAngle,bDefault);}
00480     void SetAngle(double dfAngle){SetParamDbl(OGRSTSymbolAngle,dfAngle );}
00481     const char *Color(GBool &bDefault){return GetParamStr(OGRSTSymbolColor,bDefault);}
00482     void SetColor(const char *pszColor){SetParamStr(OGRSTSymbolColor,pszColor);}
00483     double Size(GBool &bDefault){  return GetParamDbl(OGRSTSymbolSize,bDefault);}
00484     void SetSize(double dfSize){  SetParamDbl(OGRSTSymbolSize,dfSize  );}
00485     double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTSymbolDx,bDefault);}
00486     void SetSpacingX(double dfX){SetParamDbl(OGRSTSymbolDx,dfX  );}
00487     double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTSymbolDy,bDefault);}
00488     void SetSpacingY(double dfY){SetParamDbl(OGRSTSymbolDy,dfY  );}
00489     double Step(GBool &bDefault){return GetParamDbl(OGRSTSymbolStep,bDefault);}
00490     void SetStep(double dfStep){SetParamDbl(OGRSTSymbolStep,dfStep  );}
00491     double Offset(GBool &bDefault){return GetParamDbl(OGRSTSymbolOffset,bDefault);}
00492     void SetOffset(double dfOffset){SetParamDbl(OGRSTSymbolOffset,dfOffset  );}
00493     double Perp(GBool &bDefault){return GetParamDbl(OGRSTSymbolPerp,bDefault);}
00494     void SetPerp(double dfPerp){SetParamDbl(OGRSTSymbolPerp,dfPerp  );}  
00495     int  Priority(GBool &bDefault){return GetParamNum(OGRSTSymbolPriority,bDefault);}
00496     void SetPriority(int nPriority){SetParamNum(OGRSTSymbolPriority,nPriority);}
00497     const char *FontName(GBool &bDefault)
00498         {return GetParamStr(OGRSTSymbolFontName,bDefault);}
00499     void SetFontName(const char *pszFontName)
00500         {SetParamStr(OGRSTSymbolFontName,pszFontName);}
00501 
00502     /*****************************************************************/
00503     
00504      const char *GetParamStr(OGRSTSymbolParam eParam, GBool &bValueIsNull);
00505      int GetParamNum(OGRSTSymbolParam eParam,GBool &bValueIsNull);
00506      double GetParamDbl(OGRSTSymbolParam eParam,GBool &bValueIsNull);
00507      void SetParamStr(OGRSTSymbolParam eParam, const char *pszParamString);
00508      void SetParamNum(OGRSTSymbolParam eParam, int nParam);
00509      void SetParamDbl(OGRSTSymbolParam eParam, double dfParam);
00510      const char *GetStyleString();
00511 };
00512 
00513 extern OGRStyleParamId CPL_DLL asStyleLabel[];
00514 
00515 class CPL_DLL OGRStyleLabel : public OGRStyleTool
00516 {
00517   private:
00518 
00519     OGRStyleValue    *m_pasStyleValue;
00520 
00521     GBool Parse();
00522 
00523   public:
00524 
00525     OGRStyleLabel();
00526     virtual ~OGRStyleLabel();
00527 
00528     /*****************************************************************/
00529     /* Explicit fct for all parameters defined in the Drawing tools  */
00530     /*****************************************************************/
00531     
00532     const char *FontName(GBool &bDefault){return GetParamStr(OGRSTLabelFontName,bDefault);}
00533     void  SetFontName(const char *pszFontName){SetParamStr(OGRSTLabelFontName,pszFontName);}
00534     double Size(GBool &bDefault){return GetParamDbl(OGRSTLabelSize,bDefault);}
00535     void SetSize(double dfSize){SetParamDbl(OGRSTLabelSize,dfSize);}
00536     const char *TextString(GBool &bDefault){return GetParamStr(OGRSTLabelTextString,bDefault);}
00537     void SetTextString(const char *pszTextString){SetParamStr(OGRSTLabelTextString,pszTextString);}
00538     double Angle(GBool &bDefault){return GetParamDbl(OGRSTLabelAngle,bDefault);}
00539     void SetAngle(double dfAngle){SetParamDbl(OGRSTLabelAngle,dfAngle);}
00540     const char *ForeColor(GBool &bDefault){return GetParamStr(OGRSTLabelFColor,bDefault);}
00541     void SetForColor(const char *pszForColor){SetParamStr(OGRSTLabelFColor,pszForColor);}
00542     const char *BackColor(GBool &bDefault){return GetParamStr(OGRSTLabelBColor,bDefault);}
00543     void SetBackColor(const char *pszBackColor){SetParamStr(OGRSTLabelBColor,pszBackColor);}
00544     const char *Placement(GBool &bDefault){return GetParamStr(OGRSTLabelPlacement,bDefault);}
00545     void SetPlacement(const char *pszPlacement){SetParamStr(OGRSTLabelPlacement,pszPlacement);}
00546     int  Anchor(GBool &bDefault){return GetParamNum(OGRSTLabelAnchor,bDefault);}
00547     void SetAnchor(int nAnchor){SetParamNum(OGRSTLabelAnchor,nAnchor);}
00548     double SpacingX(GBool &bDefault){return GetParamDbl(OGRSTLabelDx,bDefault);}
00549     void SetSpacingX(double dfX){SetParamDbl(OGRSTLabelDx,dfX);}
00550     double SpacingY(GBool &bDefault){return GetParamDbl(OGRSTLabelDy,bDefault);}
00551     void SetSpacingY(double dfY){SetParamDbl(OGRSTLabelDy,dfY);}
00552     double Perp(GBool &bDefault){return GetParamDbl(OGRSTLabelPerp,bDefault);}
00553     void SetPerp(double dfPerp){SetParamDbl(OGRSTLabelPerp,dfPerp);}  
00554     GBool Bold(GBool &bDefault){return GetParamNum(OGRSTLabelBold,bDefault);}
00555     void SetBold(GBool bBold){SetParamNum(OGRSTLabelBold,bBold);}
00556     GBool Italic(GBool &bDefault){return GetParamNum(OGRSTLabelItalic,bDefault);}
00557     void SetItalic(GBool bItalic){SetParamNum(OGRSTLabelItalic,bItalic);}
00558     GBool Underline(GBool &bDefault){return GetParamNum(OGRSTLabelUnderline,bDefault);}
00559     void SetUnderline(GBool bUnderline){SetParamNum(OGRSTLabelUnderline,bUnderline);}
00560     int  Priority(GBool &bDefault){return GetParamNum(OGRSTLabelPriority,bDefault);}
00561     void SetPriority(int nPriority){SetParamNum(OGRSTLabelPriority,nPriority);}
00562     GBool Strikeout(GBool &bDefault){return GetParamNum(OGRSTLabelStrikeout,bDefault);}
00563     void SetStrikeout(GBool bStrikeout){SetParamNum(OGRSTLabelStrikeout,bStrikeout);}
00564     double Stretch(GBool &bDefault){return GetParamDbl(OGRSTLabelStretch,bDefault);}
00565     void SetStretch(double dfStretch){SetParamDbl(OGRSTLabelStretch,dfStretch);}
00566     const char *AdjustmentHor(GBool &bDefault){return GetParamStr(OGRSTLabelAdjHor,bDefault);}
00567     void SetAdjustmentHor(const char *pszAdjustmentHor){SetParamStr(OGRSTLabelAdjHor,pszAdjustmentHor);}
00568     const char *AdjustmentVert(GBool &bDefault){return GetParamStr(OGRSTLabelAdjVert,bDefault);}
00569     void SetAdjustmentVert(const char *pszAdjustmentVert){SetParamStr(OGRSTLabelAdjHor,pszAdjustmentVert);}
00570     const char *ShadowColor(GBool &bDefault){return GetParamStr(OGRSTLabelHColor,bDefault);}
00571     void SetShadowColor(const char *pszShadowColor){SetParamStr(OGRSTLabelHColor,pszShadowColor);}
00572     
00573     /*****************************************************************/
00574     
00575      const char *GetParamStr(OGRSTLabelParam eParam, GBool &bValueIsNull);
00576      int GetParamNum(OGRSTLabelParam eParam,GBool &bValueIsNull);
00577      double GetParamDbl(OGRSTLabelParam eParam,GBool &bValueIsNull);
00578      void SetParamStr(OGRSTLabelParam eParam, const char *pszParamString);
00579      void SetParamNum(OGRSTLabelParam eParam, int nParam);
00580      void SetParamDbl(OGRSTLabelParam eParam, double dfParam);
00581      const char *GetStyleString();
00582 };
00583 
00584 extern OGRStyleParamId CPL_DLL asStyleVector[];
00585 
00586 class CPL_DLL OGRStyleVector : public OGRStyleTool
00587 {
00588   private:
00589     
00590     OGRStyleValue    *m_pasStyleValue;
00591 
00592     GBool Parse();
00593 
00594   public:
00595 
00596     OGRStyleVector();
00597     virtual ~OGRStyleVector();
00598 
00599     /*****************************************************************/
00600     /* Explicit fct for all parameters defined in the Drawing tools  */
00601     /*****************************************************************/
00602     
00603     const char *Id(GBool &bDefault){return GetParamStr(OGRSTVectorId,bDefault);}
00604     void  SetId(const char *pszId){ SetParamStr(OGRSTVectorId,pszId);}
00605     int  Priority(GBool &bDefault){return GetParamNum(OGRSTVectorPriority,bDefault);}
00606     void SetPriority(int nPriority){SetParamNum(OGRSTVectorPriority,nPriority);}
00607     
00608 
00609     GBool NoCompress(GBool &bDefault){return GetParamNum(OGRSTVectorNoCompress,bDefault);}
00610     void SetNoCompress(GBool bNoCompress){SetParamNum(OGRSTVectorNoCompress,bNoCompress);}
00611     GBool Sprain(GBool &bDefault){return GetParamNum(OGRSTVectorSprain,bDefault);}
00612     void SetSprain(GBool bSprain){SetParamNum(OGRSTVectorSprain,bSprain);}
00613     GBool NoSlope(GBool &bDefault){return GetParamNum(OGRSTVectorNoSlope,bDefault);}
00614     void SetNoSlope(GBool bNoSlope){SetParamNum(OGRSTVectorNoSlope,bNoSlope);}
00615     GBool Mirroring(GBool &bDefault){return GetParamNum(OGRSTVectorMirroring,bDefault);}
00616     void SetMirroring(GBool bMirroring){SetParamNum(OGRSTVectorMirroring,bMirroring);}
00617     GBool Centering(GBool &bDefault){return GetParamNum(OGRSTVectorCentering,bDefault);}
00618     void SetCentering(GBool bCentering){SetParamNum(OGRSTVectorCentering,bCentering);}
00619 
00620     /*****************************************************************/
00621     
00622      const char *GetParamStr(OGRSTVectorParam eParam, GBool &bValueIsNull);
00623      int GetParamNum(OGRSTVectorParam eParam,GBool &bValueIsNull);
00624      double GetParamDbl(OGRSTVectorParam eParam,GBool &bValueIsNull);
00625      void SetParamStr(OGRSTVectorParam eParam, const char *pszParamString);
00626      void SetParamNum(OGRSTVectorParam eParam, int nParam);
00627      void SetParamDbl(OGRSTVectorParam eParam, double dfParam);
00628      const char *GetStyleString();
00629 };
00630 
00631 #endif /* OGR_FEATURESTYLE_INCLUDE */

Generated for GDAL by doxygen 1.4.4.