OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimEsriShapeFileFilter.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 //*************************************************************************
10 // $Id: ossimEsriShapeFileFilter.h 17934 2010-08-19 20:39:31Z dburken $
11 
12 #ifndef ossimEsriShapeFileFilter_HEADER
13 #define ossimEsriShapeFileFilter_HEADER
14 
15 #include <map>
16 #include <shapefil.h>
17 #include <ossimShapeFile.h>
19 #include <ossim/base/ossimRtti.h>
23 
26 class ossimProjection;
27 
85  public ossimAnnotationSource,
86  public ossimViewInterface
87 {
88 public:
89  ossimEsriShapeFileFilter(ossimImageSource* inputSource=NULL);
91 
92  virtual bool setView(ossimObject* baseObject);
93 
94  virtual ossimObject* getView();
95  virtual const ossimObject* getView()const;
96 
97  virtual bool addObject(ossimAnnotationObject* anObject);
98  virtual void transformObjects(ossimImageGeometry* geom=0);
99  virtual void setImageGeometry(ossimImageGeometry* projection);
100 
104 
105  virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
106  virtual void computeBoundingRect();
107 
108  virtual void drawAnnotations(ossimRefPtr<ossimImageData> tile);
113  virtual bool loadShapeFile(const ossimFilename& shapeFile);
114 
115  virtual ossimFilename getFilename()const
116  {
117  return theShapeFile.getFilename();
118  }
120  {
121  return theMaxQuadTreeLevels;
122  }
123 
124  virtual void setMaxQuadTreeLevels(ossim_int32 levels)
125  {
126  theMaxQuadTreeLevels = (levels>0?levels:10);
127  }
128 
129  virtual void setBrushColor(const ossimRgbVector& brushColor)
130  {
131  theBrushColor = brushColor;
132  }
133 
134  virtual void setPenColor(const ossimRgbVector& penColor)
135  {
136  thePenColor = penColor;
137  }
138 
140  {
141  return thePenColor;
142  }
143 
145  {
146  return theBrushColor;
147  }
148 
149  virtual bool getFillFlag()const
150  {
151  return theFillFlag;
152  }
153 
154  virtual void setFillFlag(bool flag)
155  {
156  theFillFlag=flag;
157  }
159  {
160  return theFeatureName;
161  }
162  virtual void setFeatureName(const ossimString& name)
163  {
164  theFeatureName = name;
165  }
166 
167  virtual void setThickness(ossim_int32 thickness)
168  {
169  theThickness = thickness >= 0? thickness:1;
170  }
171  virtual ossim_int32 getThickness()const
172  {
173  return theThickness;
174  }
175  virtual void setPointRadius(double r)
176  {
177  thePointWidthHeight = ossimDpt(fabs(r)*2, fabs(r)*2);
178  }
179  virtual double getPointRadius()const
180  {
181  return thePointWidthHeight.x/2.0;
182  }
183 
184  virtual ossimAnnotationObject* nextObject(bool restart=false)
185  {
186  if(restart)
187  {
188  theCurrentObject = theShapeCache.begin();
189  }
190  else
191  {
192  if(theCurrentObject != theShapeCache.end())
193  {
194  ++theCurrentObject;
195  }
196 
197  }
198 
199  if(theCurrentObject == theShapeCache.end())
200  {
201  return (ossimAnnotationObject*)NULL;
202  }
203  return (*theCurrentObject).second;
204  }
205 
206 
207  virtual bool saveState(ossimKeywordlist& kwl,
208  const char* prefix=NULL)const;
209 
210  virtual bool loadState(const ossimKeywordlist& kwl,
211  const char* prefix=NULL);
212 protected:
213 
219 
225 
230 
237 
239 
241 
242  double theMinArray[4];
243  double theMaxArray[4];
244 
254 
255  mutable std::multimap<int, ossimAnnotationObject*>::iterator theCurrentObject;
256 
257  std::multimap<int, ossimAnnotationObject*> theShapeCache;
259 
260  void removeViewProjection();
261  void deleteCache();
262  void checkAndSetDefaultView();
263 
264  virtual void loadPolygon(ossimShapeObject& obj);
265  virtual void loadPoint(ossimShapeObject& obj);
266  virtual void loadArc(ossimShapeObject& obj);
267 
268 TYPE_DATA
269 };
270 
271 #endif
virtual void setPenColor(const ossimRgbVector &penColor)
virtual ossimAnnotationObject * nextObject(bool restart=false)
ossimUnitType
Represents serializable keyword/value map.
virtual ossim_int32 getMaxQuadTreeLevels() const
virtual ossim_int32 getThickness() const
virtual void setFillFlag(bool flag)
virtual bool addObject(ossimAnnotationObject *anObject)
virtual void setThickness(ossim_int32 thickness)
virtual void setImageGeometry(const ossimImageGeometry *geom)
Default implementation sets geometry of the first input to the geometry specified.
virtual double getPointRadius() const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
virtual ossimRgbVector getBrushColor() const
virtual void drawAnnotations(ossimRefPtr< ossimImageData > tile)
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
std::multimap< int, ossimAnnotationObject * > theShapeCache
virtual ossimRgbVector getPenColor() const
ossimRefPtr< ossimImageGeometry > theImageGeometry
#define OSSIM_PLUGINS_DLL
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimFilename getFilename() const
std::multimap< int, ossimAnnotationObject * >::iterator theCurrentObject
virtual void setPointRadius(double r)
ossimCoordinateSystemType
virtual void setMaxQuadTreeLevels(ossim_int32 levels)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual bool setView(ossimObject *baseObject)=0
virtual ossimString getFeatureName() const
virtual void setFeatureName(const ossimString &name)
virtual void setBrushColor(const ossimRgbVector &brushColor)
virtual ossimObject * getView()=0
ossimRefPtr< ossimProjection > theShapeFileProjection
ossimCoordinateSystemType theCoordinateSystem
int ossim_int32