OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVpfAnnotationFeatureInfo.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 //*************************************************************************
10 // $Id: ossimVpfAnnotationFeatureInfo.h 19636 2011-05-24 16:48:45Z gpotts $
11 #ifndef ossimVpfAnnotationFeatureInfo_HEADER
12 #define ossimVpfAnnotationFeatureInfo_HEADER
13 #include <ossim/base/ossimRefPtr.h>
15 #include <ossim/base/ossimString.h>
20 
22 class ossimVpfCoverage;
24 class ossimPolyLine;
25 
27 {
28 public:
30  {
31  ossimVpfAnnotationFeatureType_UNKNOWN = 0,
32  ossimVpfAnnotationFeatureType_POINT = 1,
33  ossimVpfAnnotationFeatureType_LINE = 2,
34  ossimVpfAnnotationFeatureType_POLYGON = 3,
35  ossimVpfAnnotationFeatureType_TEXT = 4,
36  };
37 
38  ossimVpfAnnotationFeatureInfo(const ossimString& featureName = "",
39  const ossimRgbVector& penColor = ossimRgbVector(255,255,255),
40  const ossimRgbVector& brushColor = ossimRgbVector(255,255,255),
41  const ossimDpt& pointRadius=ossimDpt(1,1),
42  int thickness=0,
43  bool enabledFlag = true);
45 
46  void setCoverage(const ossimVpfCoverage& coverage)
47  {
48  theCoverage = coverage;
49  }
50 
52  {
53  return theCoverage;
54  }
56  {
57  return theCoverage;
58  }
59 
60  void setColor(const ossimRgbVector& color)
61  {
62  setPenColor(color);
63  setBrushColor(color);
64  }
65  void setPenColor(const ossimRgbVector& penColor)
66  {
67  thePenColor = penColor;
68  }
69 
71  {
72  return thePenColor;
73  }
74 
75  void setBrushColor(const ossimRgbVector& brushColor)
76  {
77  theBrushColor = brushColor;
78  }
79 
81  {
82  return theBrushColor;
83  }
84 
85  void setFillEnabledFlag(bool flag)
86  {
87  theFillEnabledFlag = flag;
88  }
89  bool getFillEnabledFlag()const
90  {
91  return theFillEnabledFlag;
92  }
93  void setEnabledFlag(bool flag);
94  bool getEnabledFlag()const
95  {
96  return theEnabledFlag;
97  }
98 
99  void setThickness(int thickness)
100  {
101  theThickness = thickness;
102  }
103 
104  int getThickness()const
105  {
106  return theThickness;
107  }
108 
109  void setName(const ossimString& name)
110  {
111  theName = name;
112  }
113  const ossimString& getName()const
114  {
115  return theName;
116  }
117 
118  bool isPoint()const
119  {
120  return (theFeatureType == ossimVpfAnnotationFeatureType_POINT);
121  }
122  bool isLine()const
123  {
124  return (theFeatureType == ossimVpfAnnotationFeatureType_LINE);
125  }
126  bool isPolygon()const
127  {
128  return (theFeatureType == ossimVpfAnnotationFeatureType_POLYGON);
129  }
130  bool isText()const
131  {
132  return (theFeatureType == ossimVpfAnnotationFeatureType_TEXT);
133  }
135  {
136  fontInfo = theFontInformation;
137  }
139  {
140  theFontInformation = fontInfo;
141  }
142 
143  void setPointRadius(const ossimDpt& radius)
144  {
145  thePointRadius = radius;
146  }
148  {
149  return thePointRadius;
150  }
151  void setDrawingFeaturesToAnnotation();
152  ossimIrect getBoundingProjectedRect()const;
153  void transform(ossimImageGeometry* proj);
154  void buildFeature();
155  void deleteAllObjects();
156  void drawAnnotations(ossimRgbImage* tile);
157 
158  bool saveState(ossimKeywordlist& kwl,
159  const char* prefix=0)const;
160  bool loadState(const ossimKeywordlist& kwl,
161  const char* prefix=0);
162  ossimString getFeatureTypeAsString()const;
163  ossimVpfAnnotationFeatureType getFeatureTypeFromString(const ossimString& featureType)const;
164 
165 private:
166  void readAttributes(ossimPolyLine& polyLine, ossimVpfTable& table, int row);
167  void readAttributes(ossimGeoPolygon& polygon, ossimVpfTable& table, int row);
168 
169 protected:
181 
182  std::vector<ossimRefPtr<ossimGeoAnnotationObject> > theAnnotationArray;
183 
184  void buildTxtFeature(const ossimFilename& table,
185  const ossimString& tableKey,
186  const ossimFilename& primitive,
187  const ossimString& primitiveKey);
188 
189  void buildEdgFeature(const ossimFilename& table,
190  const ossimString& tableKey,
191  const ossimFilename& primitive,
192  const ossimString& primitiveKey);
193 
194  void buildPointFeature(const ossimString& primitiveName,
195  const ossimFilename& table,
196  const ossimString& tableKey,
197  const ossimFilename& primitive,
198  const ossimString& primitiveKey);
199  void buildFaceFeature(const ossimFilename& table,
200  const ossimString& tableKey,
201  const ossimFilename& primitive,
202  const ossimString& primitiveKey);
203 
204 
205  void readEdge(ossimPolyLine& polyLine,
206  int rowNumber,
207  int colPosition,
208  ossimVpfTable& edgeTable);
209  int readTableCellAsInt (int rowNumber, // should replace calls to readRngId, readStartEdgeId with this
210  int colNumber,
211  ossimVpfTable& table);
212  int readRngId(int rowNumber,
213  int colNumber,
214  ossimVpfTable& faceTable);
215  int readStartEdgeId(int rowNumber,
216  int colNumber,
217  ossimVpfTable& rngTable);
218  void readGeoPolygon(ossimGeoPolygon& polygon,
219  int faceId,
220  int startEdgeId,
221  ossimVpfTable& edgTable);
222 
223  ossimDpt* getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32* count);
224  int getEdgeKeyId (vpf_table_type& table, row_type& row, int col);
225 
226 TYPE_DATA
227 };
228 
229 #endif
#define OSSIMDLLEXPORT
void setFontInformation(const ossimFontInformation &fontInfo)
void getFontInformation(ossimFontInformation &fontInfo) const
Represents serializable keyword/value map.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Definition: ossimObject.cpp:95
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
#define TYPE_DATA
Definition: ossimRtti.h:339
const ossimVpfCoverage & getCoverage() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
void setCoverage(const ossimVpfCoverage &coverage)
ossimVpfAnnotationFeatureType theFeatureType
void setPointRadius(const ossimDpt &radius)
void setBrushColor(const ossimRgbVector &brushColor)
std::vector< ossimRefPtr< ossimGeoAnnotationObject > > theAnnotationArray
void setName(const ossimString &name)
void setColor(const ossimRgbVector &color)
void setPenColor(const ossimRgbVector &penColor)
int ossim_int32