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

#include <ossimAnnotationEllipseObject.h>

Inheritance diagram for ossimAnnotationEllipseObject:
ossimAnnotationObject ossimObject ossimReferenced

Public Member Functions

 ossimAnnotationEllipseObject (const ossimDpt &center=ossimDpt(0, 0), const ossimDpt &widthHeight=ossimDpt(1, 1), ossim_float64 azimuthInDegrees=0.0, bool enableFill=false, ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)
 
 ossimAnnotationEllipseObject (const ossimAnnotationEllipseObject &rhs)
 
virtual ossimObjectdup () const
 
virtual void applyScale (double x, double y)
 
virtual void draw (ossimRgbImage &anImage) const
 
virtual bool intersects (const ossimDrect &rect) const
 
virtual ossimAnnotationObjectgetNewClippedObject (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
 
virtual void setCenterWidthHeight (const ossimDpt &center, const ossimDpt &widthHeight)
 
virtual void setAzimuth (ossim_float64 azimuth)
 Sets the azimuth. More...
 
virtual ossim_float64 getAzimuth () const
 Gets the azimuth. More...
 
virtual void setFillFlag (bool enabled)
 
virtual bool getFillFlag () const
 
virtual void setDrawAxesFlag (bool flag)
 Turns on and off drawing of axes on the ellipse. More...
 
virtual bool getDrawAxesFlag () const
 
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...
 
- 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 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 Member Functions

virtual ~ossimAnnotationEllipseObject ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossimDpt theCenter
 
ossimDpt theWidthHeight
 
ossim_float64 theAzimuthInDegrees
 
bool theFillEnabled
 
bool theDrawAxesFlag
 
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 ()
 
- Static Protected Attributes inherited from ossimAnnotationObject
static ossim_uint32 theIdCounter = 0
 

Detailed Description

Definition at line 14 of file ossimAnnotationEllipseObject.h.

Constructor & Destructor Documentation

◆ ossimAnnotationEllipseObject() [1/2]

ossimAnnotationEllipseObject::ossimAnnotationEllipseObject ( const ossimDpt center = ossimDpt(0, 0),
const ossimDpt widthHeight = ossimDpt(1, 1),
ossim_float64  azimuthInDegrees = 0.0,
bool  enableFill = false,
ossim_uint8  r = 255,
ossim_uint8  g = 255,
ossim_uint8  b = 255,
ossim_uint8  thickness = 1 
)

Referenced by dup().

◆ ossimAnnotationEllipseObject() [2/2]

ossimAnnotationEllipseObject::ossimAnnotationEllipseObject ( const ossimAnnotationEllipseObject rhs)

◆ ~ossimAnnotationEllipseObject()

ossimAnnotationEllipseObject::~ossimAnnotationEllipseObject ( )
protectedvirtual

Definition at line 54 of file ossimAnnotationEllipseObject.cpp.

55 {
56 }

Member Function Documentation

◆ applyScale()

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

◆ computeBoundingRect()

void ossimAnnotationEllipseObject::computeBoundingRect ( )
virtual

Implements ossimAnnotationObject.

Definition at line 130 of file ossimAnnotationEllipseObject.cpp.

References ossim::max(), theBoundingRect, theCenter, theWidthHeight, ossimDpt::x, and ossimDpt::y.

Referenced by applyScale(), ossimGeoAnnotationEllipseObject::computeBoundingRect(), and setCenterWidthHeight().

131 {
132  ossim_float64 maxDimension =
134  theBoundingRect = ossimDrect(theCenter.x - maxDimension,
135  theCenter.y - maxDimension,
136  theCenter.x + maxDimension,
137  theCenter.y + maxDimension);
138 }
T max(T a, T b)
Definition: ossimCommon.h:236
double y
Definition: ossimDpt.h:165
double ossim_float64
double x
Definition: ossimDpt.h:164

◆ draw()

void ossimAnnotationEllipseObject::draw ( ossimRgbImage anImage) const
virtual

Implements ossimAnnotationObject.

Definition at line 69 of file ossimAnnotationEllipseObject.cpp.

References ossimRgbImage::drawEllipse(), ossimRgbImage::drawFilledEllipse(), ossimRgbImage::getImageData(), ossimImageData::getImageRectangle(), ossimDrect::intersects(), RAD_PER_DEG, ossimRgbImage::setDrawColor(), ossimRgbImage::setThickness(), theAzimuthInDegrees, ossimAnnotationObject::theBlue, theBoundingRect, theCenter, theDrawAxesFlag, theFillEnabled, ossimAnnotationObject::theGreen, ossimAnnotationObject::theRed, ossimAnnotationObject::theThickness, theWidthHeight, ossimDpt::x, and ossimDpt::y.

Referenced by ossimGeoAnnotationEllipseObject::draw().

70 {
72  anImage.setThickness(theThickness);
73 
75  {
76  if(theFillEnabled)
77  {
78  anImage.drawFilledEllipse((int)(theCenter.x),
79  (int)(theCenter.y),
80  (int)(theWidthHeight.x),
81  (int)(theWidthHeight.y),
83  }
84  else
85  {
86  anImage.drawEllipse((int)(theCenter.x),
87  (int)(theCenter.y),
88  (int)(theWidthHeight.x),
89  (int)(theWidthHeight.y),
92  }
93  }
94 }
double y
Definition: ossimDpt.h:165
void setThickness(ossim_int32 thickness)
All the drawing algorithms have thickness.
void drawEllipse(int cx, int cy, int sminor, int smajor, double rot, bool drawAxes=false)
Draws an ellipse.
ossimRefPtr< ossimImageData > getImageData()
Will return the image data.
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 drawFilledEllipse(int cx, int cy, int sminor, int smajor, double rot)
Draws a filled ellipse.
#define RAD_PER_DEG

◆ dup()

ossimObject * ossimAnnotationEllipseObject::dup ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 49 of file ossimAnnotationEllipseObject.cpp.

References ossimAnnotationEllipseObject().

Referenced by getNewClippedObject().

50 {
51  return new ossimAnnotationEllipseObject(*this);
52 }
ossimAnnotationEllipseObject(const ossimDpt &center=ossimDpt(0, 0), const ossimDpt &widthHeight=ossimDpt(1, 1), ossim_float64 azimuthInDegrees=0.0, bool enableFill=false, ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)

◆ getAzimuth()

ossim_float64 ossimAnnotationEllipseObject::getAzimuth ( ) const
virtual

Gets the azimuth.

Returns
The azimuth in decimal degrees.

Definition at line 159 of file ossimAnnotationEllipseObject.cpp.

References theAzimuthInDegrees.

Referenced by ossimGeoAnnotationEllipseObject::getAzimuth().

160 {
161  return theAzimuthInDegrees;
162 }

◆ getBoundingRect()

void ossimAnnotationEllipseObject::getBoundingRect ( ossimDrect rect) const
virtual

◆ getDrawAxesFlag()

bool ossimAnnotationEllipseObject::getDrawAxesFlag ( ) const
virtual
Returns
The draw axes flag.

Definition at line 179 of file ossimAnnotationEllipseObject.cpp.

References theDrawAxesFlag.

Referenced by ossimGeoAnnotationEllipseObject::getDrawAxesFlag().

180 {
181  return theDrawAxesFlag;
182 }

◆ getFillFlag()

bool ossimAnnotationEllipseObject::getFillFlag ( ) const
virtual
Returns
theFillEnabled flag.

Definition at line 169 of file ossimAnnotationEllipseObject.cpp.

References theFillEnabled.

Referenced by ossimGeoAnnotationEllipseObject::getFillFlag().

170 {
171  return theFillEnabled;
172 }

◆ getNewClippedObject()

ossimAnnotationObject * ossimAnnotationEllipseObject::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 101 of file ossimAnnotationEllipseObject.cpp.

References dup(), and intersects().

Referenced by ossimGeoAnnotationEllipseObject::getNewClippedObject().

103 {
104  if(intersects(rect))
105  {
106  return (ossimAnnotationObject*)dup();
107  }
108 
109  return (ossimAnnotationEllipseObject*)NULL;
110 }
virtual bool intersects(const ossimDrect &rect) const

◆ intersects()

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

Implements ossimAnnotationObject.

Definition at line 96 of file ossimAnnotationEllipseObject.cpp.

References ossimDrect::intersects(), and theBoundingRect.

Referenced by getNewClippedObject(), and ossimGeoAnnotationEllipseObject::intersects().

97 {
98  return rect.intersects(theBoundingRect);
99 }
bool intersects(const ossimDrect &rect) const
Definition: ossimDrect.cpp:289

◆ isPointWithin()

bool ossimAnnotationEllipseObject::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 140 of file ossimAnnotationEllipseObject.cpp.

References ossimDrect::pointWithin(), and theBoundingRect.

141 {
142  return theBoundingRect.pointWithin(point);
143 }
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
Definition: ossimDrect.h:781

◆ loadState()

bool ossimAnnotationEllipseObject::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimAnnotationObject.

Definition at line 190 of file ossimAnnotationEllipseObject.cpp.

References ossimAnnotationObject::loadState().

192 {
193  return ossimAnnotationObject::loadState(kwl, prefix);
194 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.

◆ print()

std::ostream & ossimAnnotationEllipseObject::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 112 of file ossimAnnotationEllipseObject.cpp.

References ossimAnnotationObject::print(), theBoundingRect, theCenter, theDrawAxesFlag, theFillEnabled, theWidthHeight, ossimDpt::x, and ossimDpt::y.

113 {
115  out << endl;
116  out << "ellipse_center: " << theCenter
117  << "\nellipse_height: " << theWidthHeight.y
118  << "\nellipse_width: " << theWidthHeight.x
119  << "\nfill_enabled: " << theFillEnabled
120  << "\ndraw_axes: " << theDrawAxesFlag
121  << "\nellipse_bounding_rect: " << theBoundingRect;
122  return out;
123 }
double y
Definition: ossimDpt.h:165
virtual std::ostream & print(std::ostream &out) const
Generic print method.
double x
Definition: ossimDpt.h:164

◆ saveState()

bool ossimAnnotationEllipseObject::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Saves the current state of this object.

Reimplemented from ossimAnnotationObject.

Definition at line 184 of file ossimAnnotationEllipseObject.cpp.

References ossimAnnotationObject::saveState().

186 {
187  return ossimAnnotationObject::saveState(kwl, prefix);
188 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the current state of this object.

◆ setAzimuth()

void ossimAnnotationEllipseObject::setAzimuth ( ossim_float64  azimuth)
virtual

Sets the azimuth.

Parameters
azimuthin degrees.

Definition at line 154 of file ossimAnnotationEllipseObject.cpp.

References theAzimuthInDegrees.

Referenced by ossimGeoAnnotationEllipseObject::setAzimuth().

155 {
156  theAzimuthInDegrees = azimuth;
157 }

◆ setCenterWidthHeight()

void ossimAnnotationEllipseObject::setCenterWidthHeight ( const ossimDpt center,
const ossimDpt widthHeight 
)
virtual

◆ setDrawAxesFlag()

void ossimAnnotationEllipseObject::setDrawAxesFlag ( bool  flag)
virtual

Turns on and off drawing of axes on the ellipse.

This flag is only used if fill is turned off.

Parameters
flagtrue to enable, false to disable.

Definition at line 174 of file ossimAnnotationEllipseObject.cpp.

References theDrawAxesFlag.

Referenced by ossimGeoAnnotationEllipseObject::setDrawAxesFlag().

175 {
176  theDrawAxesFlag = flag;
177 }

◆ setFillFlag()

void ossimAnnotationEllipseObject::setFillFlag ( bool  enabled)
virtual

Member Data Documentation

◆ theAzimuthInDegrees

ossim_float64 ossimAnnotationEllipseObject::theAzimuthInDegrees
protected

Definition at line 93 of file ossimAnnotationEllipseObject.h.

Referenced by draw(), getAzimuth(), and setAzimuth().

◆ theBoundingRect

ossimDrect ossimAnnotationEllipseObject::theBoundingRect
protected

◆ theCenter

ossimDpt ossimAnnotationEllipseObject::theCenter
protected

◆ theDrawAxesFlag

bool ossimAnnotationEllipseObject::theDrawAxesFlag
protected

Definition at line 95 of file ossimAnnotationEllipseObject.h.

Referenced by draw(), getDrawAxesFlag(), print(), and setDrawAxesFlag().

◆ theFillEnabled

bool ossimAnnotationEllipseObject::theFillEnabled
protected

Definition at line 94 of file ossimAnnotationEllipseObject.h.

Referenced by draw(), getFillFlag(), print(), and setFillFlag().

◆ theWidthHeight

ossimDpt ossimAnnotationEllipseObject::theWidthHeight
protected

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