OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVertexExtractor.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Burken (dburken@imagelinks.com)
6 //
7 //*************************************************************************
8 // $Id: ossimVertexExtractor.h 17207 2010-04-25 23:21:14Z dburken $
9 
10 #ifndef ossimVertexExtractor_HEADER
11 #define ossimVertexExtractor_HEADER
12 
13 #include <fstream>
14 
18 #include <ossim/base/ossimIrect.h>
21 
22 class ossimImageSource;
23 
24 
26 
33 {
34 public:
35  ossimVertexExtractor(ossimImageSource* inputSource=NULL);
36 
37 
39  {
40  return this;
41  }
42  virtual const ossimObject* getObject()const
43  {
44  return this;
45  }
50  void setAreaOfInterest(const ossimIrect& rect);
51 
60  virtual void setOutputName(const ossimString& filename);
61 
65  virtual bool isOpen() const;
66 
75  virtual bool open();
76 
80  virtual void close();
81 
87  virtual bool execute();
88 
89  virtual ossimObject* getObjectInterface() { return this; }
90 
92  {
93  return this;
94  }
95 
96 
97  virtual void setPercentComplete(double percentComplete)
98  {
100  ossimProcessProgressEvent event(this,
101  percentComplete);
102  fireEvent(event);
103  }
104 
105  bool canConnectMyInputTo(ossim_int32 /* inputIndex */,
106  const ossimConnectableObject* object)const
107  {
108 
109  return (object&& PTR_CAST(ossimImageSource, object));
110  }
111 
112  const vector<ossimIpt>& getVertices() const { return theVertice; }
113 
114 protected:
115  virtual ~ossimVertexExtractor();
120  bool scanForEdges();
121 
127  bool extractVertices();
128 
129  template<class T1>
130  void getMinAndIndex(T1* start, T1* end,
131  T1& minValue, ossim_int32& offsetFromStart);
132  template<class T2>
133  void getMaxAndIndex(T2* start, T2* end,
134  T2& maxValue, ossim_int32& offsetFromStart);
135 
142  bool writeVertices();
143 
147  vector<ossimIpt> theVertice;
150 
152  ossimVertexExtractor(const ossimVertexExtractor&) : theLeftEdge(0), theRightEdge(0) {}
154  {return rhs;}
155 
156 TYPE_DATA
157 };
158 
159 #endif
virtual ossimObject * getObjectInterface()
virtual ossimObject * getObject()
Class ossimVertexExtractor.
virtual void close()=0
#define OSSIMDLLEXPORT
virtual void setPercentComplete(double percentComplete)
virtual const ossimObject * getObject() const
virtual void setPercentComplete(double percentComplete)
const vector< ossimIpt > & getVertices() const
virtual void fireEvent(ossimEvent &event)
virtual void setOutputName(const ossimString &outputName)
ossimVertexExtractor(const ossimVertexExtractor &)
Disallow copy constructor and operator=.
#define TYPE_DATA
Definition: ossimRtti.h:339
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual bool isOpen() const =0
virtual bool execute()=0
const ossimVertexExtractor & operator=(const ossimVertexExtractor &rhs)
vector< ossimIpt > theVertice
virtual ossimListenerManager * getListenerManagerInterface()
virtual bool open()=0
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
bool canConnectMyInputTo(ossim_int32, const ossimConnectableObject *object) const
required to be overriden by derived classes
int ossim_int32