OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Attributes | List of all members
ossimAnnotationMultiEllipseObject Class Reference

#include <ossimAnnotationMultiEllipseObject.h>

Inheritance diagram for ossimAnnotationMultiEllipseObject:
ossimAnnotationObject ossimObject ossimReferenced

Public Member Functions

 ossimAnnotationMultiEllipseObject (const std::vector< ossimDpt > &pointList, const ossimDpt &widthHeight=ossimDpt(1, 1), bool enableFill=false, unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
 
 ossimAnnotationMultiEllipseObject (const ossimDpt &widthHeight=ossimDpt(1, 1), bool enableFill=false, unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
 
 ossimAnnotationMultiEllipseObject (const ossimAnnotationMultiEllipseObject &rhs)
 
virtual ~ossimAnnotationMultiEllipseObject ()
 
ossimObjectdup () const
 
virtual ossimAnnotationObjectgetNewClippedObject (const ossimDrect &rect) const
 
virtual void applyScale (double x, double y)
 
virtual void draw (ossimRgbImage &anImage) const
 
virtual bool intersects (const ossimDrect &rect) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual void getBoundingRect (ossimDrect &rect) const
 
virtual void computeBoundingRect ()
 
virtual bool isPointWithin (const ossimDpt &imagePoint) const
 
void setFillFlag (bool flag)
 
void resize (ossim_uint32 size)
 
virtual void setWidthHeight (const ossimDpt &widthHeight)
 
ossimDptoperator[] (int i)
 
const ossimDptoperator[] (int i) const
 
- Public Member Functions inherited from ossimAnnotationObject
virtual ~ossimAnnotationObject ()
 
 ossimAnnotationObject (ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)
 
virtual void applyScale (const ossimDpt &scale)
 
virtual ossimDrect getBoundingRect () const
 
virtual void setColor (ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
 
void getColor (ossim_uint8 &r, ossim_uint8 &g, ossim_uint8 &b) const
 
ossim_uint8 getThickness () const
 
virtual void setThickness (ossim_uint8 thickness)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Saves the current state of this object. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual ossimString getName () const
 
virtual void setName (const ossimString &name)
 
ossim_uint32 getId () const
 
virtual ossim_uint32 setId ()
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Attributes

std::vector< ossimDptthePointList
 
ossimDpt theWidthHeight
 
bool theFillFlag
 
ossimDrect theBoundingRect
 
- Protected Attributes inherited from ossimAnnotationObject
ossim_uint8 theRed
 
ossim_uint8 theGreen
 
ossim_uint8 theBlue
 
ossim_uint8 theThickness
 
ossimString theName
 
ossim_uint32 theId
 

Additional Inherited Members

- Static Public Member Functions inherited from ossimAnnotationObject
static ossim_uint32 getNextId ()
 
static void restIdCounter ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Static Protected Attributes inherited from ossimAnnotationObject
static ossim_uint32 theIdCounter = 0
 

Detailed Description

Definition at line 14 of file ossimAnnotationMultiEllipseObject.h.

Constructor & Destructor Documentation

◆ ossimAnnotationMultiEllipseObject() [1/3]

ossimAnnotationMultiEllipseObject::ossimAnnotationMultiEllipseObject ( const std::vector< ossimDpt > &  pointList,
const ossimDpt widthHeight = ossimDpt(1,1),
bool  enableFill = false,
unsigned char  r = 255,
unsigned char  g = 255,
unsigned char  b = 255,
long  thickness = 1 
)

Definition at line 13 of file ossimAnnotationMultiEllipseObject.cpp.

Referenced by dup().

20  :
21  ossimAnnotationObject(r, g, b, thickness),
22  thePointList(pointList),
23  theWidthHeight(widthHeight),
24  theFillFlag(enableFill)
25 {
27 }
ossimAnnotationObject(ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)

◆ ossimAnnotationMultiEllipseObject() [2/3]

ossimAnnotationMultiEllipseObject::ossimAnnotationMultiEllipseObject ( const ossimDpt widthHeight = ossimDpt(1,1),
bool  enableFill = false,
unsigned char  r = 255,
unsigned char  g = 255,
unsigned char  b = 255,
long  thickness = 1 
)

Definition at line 30 of file ossimAnnotationMultiEllipseObject.cpp.

36  :
37  ossimAnnotationObject(r, g, b, thickness),
38  theWidthHeight(widthHeight),
39  theFillFlag(enableFill)
40 {
42 }
void makeNan()
Definition: ossimDrect.h:388
ossimAnnotationObject(ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)

◆ ossimAnnotationMultiEllipseObject() [3/3]

ossimAnnotationMultiEllipseObject::ossimAnnotationMultiEllipseObject ( const ossimAnnotationMultiEllipseObject rhs)

◆ ~ossimAnnotationMultiEllipseObject()

ossimAnnotationMultiEllipseObject::~ossimAnnotationMultiEllipseObject ( )
virtual

Definition at line 57 of file ossimAnnotationMultiEllipseObject.cpp.

58 {}

Member Function Documentation

◆ applyScale()

void ossimAnnotationMultiEllipseObject::applyScale ( double  x,
double  y 
)
virtual

Implements ossimAnnotationObject.

Definition at line 69 of file ossimAnnotationMultiEllipseObject.cpp.

References computeBoundingRect(), thePointList, theWidthHeight, ossimDpt::x, x, ossimDpt::y, and y.

70 {
71  int i;
72  int upper = (int)thePointList.size();
73  for(i = 0; i < upper; ++i)
74  {
75  thePointList[i].x *= x;
76  thePointList[i].y *= y;
77  }
78  theWidthHeight.x *= x;
79  theWidthHeight.y *= y;
80 
82 }
ossim_uint32 x
ossim_uint32 y
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164

◆ computeBoundingRect()

void ossimAnnotationMultiEllipseObject::computeBoundingRect ( )
virtual

Implements ossimAnnotationObject.

Definition at line 157 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimDrect::combine(), ossimDpt::hasNans(), ossimDrect::hasNans(), ossimDrect::makeNan(), theBoundingRect, thePointList, theWidthHeight, ossimDpt::x, and ossimDpt::y.

Referenced by applyScale(), ossimGeoAnnotationMultiEllipseObject::computeBoundingRect(), and setWidthHeight().

158 {
160 
161  int i;
162  int upper = (int)thePointList.size();
163  for(i = 0; i < upper; ++i)
164  {
165  ossimDpt tempPoint = thePointList[i];
166  if(!tempPoint.hasNans())
167  {
168  ossimDrect tempRect(ossimDpt(tempPoint.x - theWidthHeight.x,
169  tempPoint.y - theWidthHeight.y),
170  ossimDpt(tempPoint.x + theWidthHeight.x,
171  tempPoint.y + theWidthHeight.y));
172  if(!theBoundingRect.hasNans())
173  {
174  theBoundingRect.combine(tempRect);
175  }
176  else
177  {
178  theBoundingRect = tempRect;
179  }
180  }
181  }
182 }
void makeNan()
Definition: ossimDrect.h:388
double y
Definition: ossimDpt.h:165
ossimDrect combine(const ossimDrect &rect) const
Definition: ossimDrect.h:826
bool hasNans() const
Definition: ossimDrect.h:396
bool hasNans() const
Definition: ossimDpt.h:67
double x
Definition: ossimDpt.h:164

◆ draw()

void ossimAnnotationMultiEllipseObject::draw ( ossimRgbImage anImage) const
virtual

Implements ossimAnnotationObject.

Definition at line 84 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimRgbImage::drawArc(), ossimRgbImage::drawFilledArc(), ossimRgbImage::getImageData(), ossimImageData::getImageRectangle(), ossimDrect::intersects(), ossimRgbImage::setDrawColor(), ossimRgbImage::setThickness(), ossimAnnotationObject::theBlue, theBoundingRect, theFillFlag, ossimAnnotationObject::theGreen, thePointList, ossimAnnotationObject::theRed, ossimAnnotationObject::theThickness, theWidthHeight, ossimDpt::x, and ossimDpt::y.

Referenced by ossimGeoAnnotationMultiEllipseObject::draw().

85 {
87  anImage.setThickness(theThickness);
88  ossimDrect imageRect = anImage.getImageData()->getImageRectangle();
89 
90  if(theBoundingRect.intersects(imageRect))
91  {
92  int i;
93  int upper = (int)thePointList.size();
94  if(theFillFlag)
95  {
96  for(i = 0; i < upper; ++i)
97  {
98  ossimDpt tempPoint = thePointList[i];
99 
100  ossimDrect tempRect(ossimDpt(tempPoint.x - theWidthHeight.x,
101  tempPoint.y - theWidthHeight.y),
102  ossimDpt(tempPoint.x + theWidthHeight.x,
103  tempPoint.y + theWidthHeight.y));
104  if(tempRect.intersects(imageRect))
105  {
106  anImage.drawFilledArc(ossim::round<int>(tempPoint.x),
107  ossim::round<int>(tempPoint.y),
108  ossim::round<int>(theWidthHeight.x),
109  ossim::round<int>(theWidthHeight.y),
110  0,
111  360);
112  }
113  }
114  }
115  else
116  {
117  for(i = 0; i < upper; ++i)
118  {
119  ossimDpt tempPoint = thePointList[i];
120 
121  ossimDrect tempRect(ossimDpt(tempPoint.x - theWidthHeight.x,
122  tempPoint.y - theWidthHeight.y),
123  ossimDpt(tempPoint.x + theWidthHeight.x,
124  tempPoint.y + theWidthHeight.y));
125  if(tempRect.intersects(imageRect))
126  {
127  anImage.drawArc(ossim::round<int>(tempPoint.x),
128  ossim::round<int>(tempPoint.y),
129  ossim::round<int>(theWidthHeight.x),
130  ossim::round<int>(theWidthHeight.y),
131  0,
132  360);
133  }
134  }
135  }
136  }
137 }
double y
Definition: ossimDpt.h:165
void setThickness(ossim_int32 thickness)
All the drawing algorithms have thickness.
ossimRefPtr< ossimImageData > getImageData()
Will return the image data.
void drawArc(double cx, double cy, double w, double h, double s, double e)
will draw an arc.
virtual ossimIrect getImageRectangle() const
bool intersects(const ossimDrect &rect) const
Definition: ossimDrect.cpp:289
void setDrawColor(ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255)
double x
Definition: ossimDpt.h:164
void drawFilledArc(double cx, double cy, double w, double h, double s, double e)
This will draw a filled arc.

◆ dup()

ossimObject * ossimAnnotationMultiEllipseObject::dup ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 52 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimAnnotationMultiEllipseObject().

53 {
54  return new ossimAnnotationMultiEllipseObject(*this);
55 }
ossimAnnotationMultiEllipseObject(const std::vector< ossimDpt > &pointList, const ossimDpt &widthHeight=ossimDpt(1, 1), bool enableFill=false, unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)

◆ getBoundingRect()

void ossimAnnotationMultiEllipseObject::getBoundingRect ( ossimDrect rect) const
virtual

◆ getNewClippedObject()

ossimAnnotationObject * ossimAnnotationMultiEllipseObject::getNewClippedObject ( const ossimDrect rect) const
virtual

Will allocate a new object that is clipped to the passed. in rect. Look at derived classes to see if the object is actually clipped or not. A new object is returned if it clips to the rect else NULL should be returned it doesn't clip.

Implements ossimAnnotationObject.

Definition at line 60 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimNotify(), and ossimNotifyLevel_WARN.

62 {
64  << "ossimAnnotationMultiEllipseObject::getNewClippedObject WARNING: Not implemented"
65  << std::endl;
66  return NULL;
67 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ intersects()

bool ossimAnnotationMultiEllipseObject::intersects ( const ossimDrect rect) const
virtual

Implements ossimAnnotationObject.

Definition at line 139 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimDrect::intersects(), and theBoundingRect.

Referenced by ossimGeoAnnotationMultiEllipseObject::intersects().

140 {
141  return rect.intersects(theBoundingRect);
142 }
bool intersects(const ossimDrect &rect) const
Definition: ossimDrect.cpp:289

◆ isPointWithin()

bool ossimAnnotationMultiEllipseObject::isPointWithin ( const ossimDpt imagePoint) const
virtual

This method allows you to pick an object. It will return true or false if the point falls somewhere on an object. Look at derived classes for further information.

Reimplemented from ossimAnnotationObject.

Definition at line 184 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimDrect::hasNans(), ossimDrect::pointWithin(), and theBoundingRect.

185 {
186  if(!theBoundingRect.hasNans())
187  {
188  return theBoundingRect.pointWithin(imagePoint);
189  }
190  return false;
191 }
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
Definition: ossimDrect.h:781
bool hasNans() const
Definition: ossimDrect.h:396

◆ operator[]() [1/2]

ossimDpt & ossimAnnotationMultiEllipseObject::operator[] ( int  i)

Definition at line 216 of file ossimAnnotationMultiEllipseObject.cpp.

References thePointList.

217 {
218  return thePointList[i];
219 }

◆ operator[]() [2/2]

const ossimDpt & ossimAnnotationMultiEllipseObject::operator[] ( int  i) const

Definition at line 221 of file ossimAnnotationMultiEllipseObject.cpp.

References thePointList.

222 {
223  return thePointList[i];
224 }

◆ print()

std::ostream & ossimAnnotationMultiEllipseObject::print ( std::ostream &  out) const
virtual

Generic print method.

Derived classes should re-implement as they see fit.

Returns
std::ostream&

Reimplemented from ossimAnnotationObject.

Definition at line 144 of file ossimAnnotationMultiEllipseObject.cpp.

References ossimNotify(), and ossimNotifyLevel_NOTICE.

Referenced by ossimGeoAnnotationMultiEllipseObject::print().

145 {
147  << "ossimAnnotionMultiEllipseObject::print NOT IMPLEMENTED"
148  << endl;
149  return out;
150 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ resize()

void ossimAnnotationMultiEllipseObject::resize ( ossim_uint32  size)

Definition at line 198 of file ossimAnnotationMultiEllipseObject.cpp.

References size, and thePointList.

Referenced by ossimGeoAnnotationMultiEllipseObject::transform().

199 {
200  if(size)
201  {
202  thePointList.resize(size);
203  }
204  else
205  {
206  thePointList.clear();
207  }
208 }
yy_size_t size

◆ setFillFlag()

void ossimAnnotationMultiEllipseObject::setFillFlag ( bool  flag)

◆ setWidthHeight()

void ossimAnnotationMultiEllipseObject::setWidthHeight ( const ossimDpt widthHeight)
virtual

Member Data Documentation

◆ theBoundingRect

ossimDrect ossimAnnotationMultiEllipseObject::theBoundingRect
protected

◆ theFillFlag

bool ossimAnnotationMultiEllipseObject::theFillFlag
protected

Definition at line 62 of file ossimAnnotationMultiEllipseObject.h.

Referenced by draw(), and setFillFlag().

◆ thePointList

std::vector<ossimDpt> ossimAnnotationMultiEllipseObject::thePointList
protected

◆ theWidthHeight

ossimDpt ossimAnnotationMultiEllipseObject::theWidthHeight
protected

The documentation for this class was generated from the following files: