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

#include <ossimAnnotationObject.h>

Inheritance diagram for ossimAnnotationObject:
ossimObject ossimReferenced ossimAnnotationEllipseObject ossimAnnotationFontObject ossimAnnotationGdBitmapFont ossimAnnotationLineObject ossimAnnotationMultiEllipseObject ossimAnnotationMultiLineObject ossimAnnotationMultiPolyLineObject ossimAnnotationMultiPolyObject ossimAnnotationPolyObject ossimGeoAnnotationObject ossimGeographicAnnotationGrid

Public Member Functions

virtual ~ossimAnnotationObject ()
 
 ossimAnnotationObject (ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)
 
virtual void applyScale (double x, double y)=0
 
virtual void applyScale (const ossimDpt &scale)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual void draw (ossimRgbImage &anImage) const =0
 
virtual bool intersects (const ossimDrect &rect) const =0
 
virtual ossimAnnotationObjectgetNewClippedObject (const ossimDrect &rect) const =0
 
virtual void getBoundingRect (ossimDrect &rect) const =0
 
virtual ossimDrect getBoundingRect () const
 
virtual void computeBoundingRect ()=0
 
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 isPointWithin (const ossimDpt &imagePoint) 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...
 
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 ossimObjectdup () const
 
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
 

Static Public Member Functions

static ossim_uint32 getNextId ()
 
static void restIdCounter ()
 

Protected Attributes

ossim_uint8 theRed
 
ossim_uint8 theGreen
 
ossim_uint8 theBlue
 
ossim_uint8 theThickness
 
ossimString theName
 
ossim_uint32 theId
 

Static Protected Attributes

static ossim_uint32 theIdCounter = 0
 

Additional Inherited Members

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

Detailed Description

Definition at line 21 of file ossimAnnotationObject.h.

Constructor & Destructor Documentation

◆ ~ossimAnnotationObject()

ossimAnnotationObject::~ossimAnnotationObject ( )
virtual

Definition at line 16 of file ossimAnnotationObject.cpp.

17 {}

◆ ossimAnnotationObject()

ossimAnnotationObject::ossimAnnotationObject ( ossim_uint8  r = 255,
ossim_uint8  g = 255,
ossim_uint8  b = 255,
ossim_uint8  thickness = 1 
)

Definition at line 31 of file ossimAnnotationObject.cpp.

References getNextId(), and theId.

35  :theRed(r),
36  theGreen(g),
37  theBlue(b),
38  theThickness(thickness)
39 {
40  theId = getNextId();
41 }
static ossim_uint32 getNextId()

Member Function Documentation

◆ applyScale() [1/2]

virtual void ossimAnnotationObject::applyScale ( double  x,
double  y 
)
pure virtual

◆ applyScale() [2/2]

void ossimAnnotationObject::applyScale ( const ossimDpt scale)
virtual

Definition at line 143 of file ossimAnnotationObject.cpp.

References applyScale(), ossimDpt::x, and ossimDpt::y.

144 {
145  applyScale(scale.x,
146  scale.y);
147 }
double y
Definition: ossimDpt.h:165
virtual void applyScale(double x, double y)=0
double x
Definition: ossimDpt.h:164

◆ computeBoundingRect()

virtual void ossimAnnotationObject::computeBoundingRect ( )
pure virtual

◆ draw()

virtual void ossimAnnotationObject::draw ( ossimRgbImage anImage) const
pure virtual

◆ getBoundingRect() [1/2]

virtual void ossimAnnotationObject::getBoundingRect ( ossimDrect rect) const
pure virtual

◆ getBoundingRect() [2/2]

ossimDrect ossimAnnotationObject::getBoundingRect ( ) const
virtual

Definition at line 136 of file ossimAnnotationObject.cpp.

137 {
138  ossimDrect rect;
139  getBoundingRect(rect);
140  return rect;
141 }
virtual ossimDrect getBoundingRect() const

◆ getColor()

void ossimAnnotationObject::getColor ( ossim_uint8 r,
ossim_uint8 g,
ossim_uint8 b 
) const

Definition at line 57 of file ossimAnnotationObject.cpp.

References theBlue, theGreen, and theRed.

60 {
61  r = theRed;
62  g = theGreen;
63  b = theBlue;
64 }

◆ getId()

ossim_uint32 ossimAnnotationObject::getId ( ) const

Definition at line 71 of file ossimAnnotationObject.cpp.

References theId.

Referenced by setId().

72 {
73  return theId;
74 }

◆ getName()

ossimString ossimAnnotationObject::getName ( ) const
virtual

Definition at line 126 of file ossimAnnotationObject.cpp.

References theName.

127 {
128  return theName;
129 }

◆ getNewClippedObject()

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

◆ getNextId()

ossim_uint32 ossimAnnotationObject::getNextId ( )
static

Definition at line 24 of file ossimAnnotationObject.cpp.

References theIdCounter.

Referenced by ossimAnnotationObject(), and setId().

25 {
27  ++theIdCounter;
28  return id;
29 }
static ossim_uint32 theIdCounter
unsigned int ossim_uint32

◆ getThickness()

ossim_uint8 ossimAnnotationObject::getThickness ( ) const

Definition at line 66 of file ossimAnnotationObject.cpp.

References theThickness.

67 {
68  return theThickness;
69 }

◆ intersects()

virtual bool ossimAnnotationObject::intersects ( const ossimDrect rect) const
pure virtual

◆ isPointWithin()

bool ossimAnnotationObject::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 in ossimAnnotationGdBitmapFont, ossimAnnotationMultiPolyObject, ossimAnnotationMultiLineObject, ossimAnnotationPolyObject, ossimAnnotationFontObject, ossimGeoAnnotationMultiPolyLineObject, ossimGeoAnnotationMultiPolyObject, ossimAnnotationLineObject, ossimAnnotationMultiEllipseObject, ossimAnnotationEllipseObject, and ossimAnnotationMultiPolyLineObject.

Definition at line 121 of file ossimAnnotationObject.cpp.

Referenced by ossimAnnotationSource::pickObjects().

122 {
123  return false;
124 }

◆ loadState()

bool ossimAnnotationObject::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 ossimObject.

Reimplemented in ossimGeoAnnotationFontObject, ossimAnnotationEllipseObject, ossimGeoAnnotationPolyObject, ossimGeoAnnotationMultiPolyLineObject, ossimGeoAnnotationEllipseObject, and ossimGeoAnnotationObject.

Definition at line 93 of file ossimAnnotationObject.cpp.

References ossimKeywordlist::find(), ossimObject::loadState(), theBlue, theGreen, theRed, theThickness, and ossimString::toLong().

Referenced by ossimChipperUtil::addCrossHairAnnotation(), ossimAnnotationObjectFactory::create(), ossimGeoAnnotationObject::loadState(), and ossimAnnotationEllipseObject::loadState().

95 {
96  const char* red = kwl.find(prefix, "red");
97  const char* green = kwl.find(prefix, "green");
98  const char* blue = kwl.find(prefix, "blue");
99  const char* thickness = kwl.find(prefix, "thickness");
100 
101  if(red)
102  {
104  }
105  if(green)
106  {
108  }
109  if(blue)
110  {
112  }
113  if(thickness)
114  {
115  theThickness = (ossim_uint8)ossimString(thickness).toLong();
116  }
117 
118  return ossimObject::loadState(kwl, prefix);
119 }
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
long toLong() const
toLong&#39;s deprecated, please use the toInts...
unsigned char ossim_uint8

◆ print()

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

Generic print method.

Derived classes should re-implement as they see fit.

Returns
std::ostream&

Reimplemented from ossimObject.

Reimplemented in ossimAnnotationMultiLineObject, ossimGeoAnnotationMultiEllipseObject, ossimAnnotationGdBitmapFont, ossimAnnotationFontObject, ossimGeoAnnotationPolyObject, ossimAnnotationPolyObject, ossimAnnotationLineObject, ossimAnnotationMultiPolyObject, ossimAnnotationMultiEllipseObject, ossimGeoAnnotationMultiPolyLineObject, ossimAnnotationEllipseObject, ossimGeoAnnotationMultiPolyObject, ossimAnnotationMultiPolyLineObject, ossimGeoAnnotationBitmap, ossimGeoAnnotationEllipseObject, ossimGeoAnnotationLineObject, ossimGeoAnnotationPolyLineObject, ossimGeoAnnotationGdBitmapFont, and ossimGeographicAnnotationGrid.

Definition at line 149 of file ossimAnnotationObject.cpp.

References theBlue, theGreen, theRed, and theThickness.

Referenced by ossimAnnotationMultiPolyLineObject::print(), ossimAnnotationEllipseObject::print(), ossimAnnotationMultiPolyObject::print(), and ossimAnnotationMultiLineObject::print().

150 {
151  out << setw(15)<<setiosflags(ios::left)<<"Red:" << (long)theRed
152  << setw(15)<<setiosflags(ios::left)<<"\nGreen:" << (long)theGreen
153  << setw(15)<<setiosflags(ios::left)<<"\nBlue:" << (long)theBlue
154  << setw(15)<<setiosflags(ios::left)<<"\nThickness:"<< (long)theThickness
155  << "\ncolor_red: " << (long)theRed
156  << "\ncolor_green: " << (long)theGreen
157  << "\ncolor_blue: " << (long)theBlue
158  << "\nthickness: " << (long)theThickness << std::endl;
159  return out;
160 }

◆ restIdCounter()

void ossimAnnotationObject::restIdCounter ( )
static

Definition at line 19 of file ossimAnnotationObject.cpp.

References theIdCounter.

20 {
21  theIdCounter = 0;
22 }
static ossim_uint32 theIdCounter

◆ saveState()

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

Saves the current state of this object.

Reimplemented from ossimObject.

Reimplemented in ossimAnnotationEllipseObject, ossimGeoAnnotationPolyObject, ossimGeoAnnotationFontObject, ossimGeoAnnotationMultiPolyLineObject, ossimGeoAnnotationEllipseObject, and ossimGeoAnnotationObject.

Definition at line 82 of file ossimAnnotationObject.cpp.

References ossimKeywordlist::add(), ossimObject::saveState(), theBlue, theGreen, theRed, and theThickness.

Referenced by ossimGeoAnnotationObject::saveState(), and ossimAnnotationEllipseObject::saveState().

84 {
85  kwl.add(prefix, "red", theRed);
86  kwl.add(prefix, "green", theGreen);
87  kwl.add(prefix, "blue", theBlue);
88  kwl.add(prefix, "thickness", theThickness);
89 
90  return ossimObject::saveState(kwl, prefix);
91 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Definition: ossimObject.cpp:95
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)

◆ setColor()

void ossimAnnotationObject::setColor ( ossim_uint8  r,
ossim_uint8  g,
ossim_uint8  b 
)
virtual

Reimplemented in ossimGeoAnnotationEllipseObject, ossimGeoAnnotationPolyObject, ossimGeoAnnotationMultiPolyLineObject, ossimGeoAnnotationFontObject, ossimGeoAnnotationMultiEllipseObject, ossimGeoAnnotationPolyLineObject, and ossimGeoAnnotationMultiPolyObject.

Definition at line 43 of file ossimAnnotationObject.cpp.

References theBlue, theGreen, and theRed.

Referenced by ossimMapCompositionSource::addGeographicBottomGridLabels(), ossimMapCompositionSource::addGeographicGridLines(), ossimMapCompositionSource::addGeographicGridReseaux(), ossimMapCompositionSource::addGeographicLeftGridLabels(), ossimMapCompositionSource::addGeographicRightGridLabels(), ossimMapCompositionSource::addMeterGridLabels(), ossimMapCompositionSource::addMeterGridLines(), ossimMapCompositionSource::addMeterGridReseaux(), ossimMapCompositionSource::addTitle(), ossimGeoAnnotationEllipseObject::loadState(), ossimGeoAnnotationPolyObject::loadState(), ossimGeoAnnotationFontObject::loadState(), ossimGeoAnnotationMultiPolyObject::setColor(), ossimGeoAnnotationPolyLineObject::setColor(), ossimGeoAnnotationMultiEllipseObject::setColor(), ossimGeoAnnotationFontObject::setColor(), ossimGeoAnnotationMultiPolyLineObject::setColor(), ossimGeoAnnotationPolyObject::setColor(), and ossimGeoAnnotationEllipseObject::setColor().

46 {
47  theRed = r;
48  theGreen = g;
49  theBlue = b;
50 }

◆ setId()

ossim_uint32 ossimAnnotationObject::setId ( )
virtual

Definition at line 76 of file ossimAnnotationObject.cpp.

References getId(), getNextId(), and theId.

77 {
78  theId = getNextId();
79  return getId();
80 }
ossim_uint32 getId() const
static ossim_uint32 getNextId()

◆ setName()

void ossimAnnotationObject::setName ( const ossimString name)
virtual

◆ setThickness()

void ossimAnnotationObject::setThickness ( ossim_uint8  thickness)
virtual

Member Data Documentation

◆ theBlue

ossim_uint8 ossimAnnotationObject::theBlue
protected

◆ theGreen

ossim_uint8 ossimAnnotationObject::theGreen
protected

◆ theId

ossim_uint32 ossimAnnotationObject::theId
protected

Definition at line 99 of file ossimAnnotationObject.h.

Referenced by getId(), ossimAnnotationObject(), and setId().

◆ theIdCounter

ossim_uint32 ossimAnnotationObject::theIdCounter = 0
staticprotected

Definition at line 101 of file ossimAnnotationObject.h.

Referenced by getNextId(), and restIdCounter().

◆ theName

ossimString ossimAnnotationObject::theName
protected

Definition at line 98 of file ossimAnnotationObject.h.

Referenced by getName(), and setName().

◆ theRed

ossim_uint8 ossimAnnotationObject::theRed
protected

◆ theThickness

ossim_uint8 ossimAnnotationObject::theThickness
protected

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