OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimROIEvent.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Scott Bortman
6 //
7 // Description: Region Of Interest (ROI) Event
8 //
9 // $Id: ossimROIEvent.cpp 9094 2006-06-13 19:12:40Z dburken $
10 //----------------------------------------------------------------------------
14 #include <ossim/base/ossimIrect.h>
15 
16 RTTI_DEF1(ossimROIEvent, "ossimROIEvent", ossimEvent);
17 
19  long id)
20  : ossimEvent( object, id ),
21  theType(OSSIM_RECTANGLE_ROI),
22  theMovingFlag(false)
23 
24 {
25 }
26 
28  : ossimEvent ( rhs ),
29  theType ( rhs.theType ),
30  theMovingFlag ( rhs.theMovingFlag)
31 {
32 }
33 
35 {
36  return new ossimROIEvent( *this );
37 }
38 
39 const vector<ossimIpt>& ossimROIEvent::getPoints()const
40 {
41  return thePoints;
42 }
43 
44 void ossimROIEvent::getPoint(vector<ossimIpt>& points)const
45 {
46  points = thePoints;
47 }
48 
49 void ossimROIEvent::setPoints( const vector<ossimIpt>& points )
50 {
51  thePoints = points;
52 }
53 
55 {
56  thePoints.clear();
57  thePoints.push_back(rect.ul());
58  thePoints.push_back(rect.lr());
59 }
60 
62 {
63  theType = eventType;
64 }
65 
67 {
68  return theType;
69 }
70 
72 {
74 }
75 
77 {
79 }
80 
82 {
84 }
85 
87 {
88  return (theType == OSSIM_RECTANGLE_ROI);
89 }
90 
92 {
93  return (theType == OSSIM_POLYGON_ROI);
94 }
95 
97 {
98  return (theType == OSSIM_POLYLINE_ROI);
99 }
100 
102 {
103  rect = ossimIrect(thePoints);
104 }
105 
107 {
108  polygon = ossimPolygon(thePoints);
109 }
110 
112 {
113  polyline = ossimPolyLine(thePoints);
114 }
115 
117 {
118  theMovingFlag = flag;
119 }
120 
122 {
123  return theMovingFlag;
124 }
void setRect(const ossimIrect &rect)
bool isPolylineRegion() const
void getRect(ossimIrect &rect) const
bool getMovingFlag() const
bool isPolygonRegion() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
std::vector< ossimIpt > thePoints
Definition: ossimROIEvent.h:65
void getPoint(std::vector< ossimIpt > &points) const
void setMovingFlag(bool flag)
RTTI_DEF1(ossimROIEvent, "ossimROIEvent", ossimEvent)
void getPolyLine(ossimPolyLine &polyline) const
virtual ossimObject * dup() const
void setTypeToRectangle()
void getPolygon(ossimPolygon &polygon) const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
bool isRectangleRegion() const
void setPoints(const std::vector< ossimIpt > &points)
const std::vector< ossimIpt > & getPoints() const
void setTypeToPolygon()
ossimROIEvent(ossimObject *object=NULL, long id=OSSIM_EVENT_NULL_ID)
ossimRegionType getEventType() const
void setTypeToPolyline()
void setEventType(ossimRegionType eventType)
ossimRegionType theType
Definition: ossimROIEvent.h:66