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

#include <ossimGeoAnnotationPolyLineObject.h>

Inheritance diagram for ossimGeoAnnotationPolyLineObject:
ossimGeoAnnotationObject ossimAnnotationObject ossimObject ossimReferenced

Public Member Functions

 ossimGeoAnnotationPolyLineObject (const vector< ossimGpt > &groundPts, ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)
 
 ossimGeoAnnotationPolyLineObject (const ossimGeoAnnotationPolyLineObject &rhs)
 
virtual ossimObjectdup () const
 
virtual void applyScale (double x, double y)
 
virtual void transform (ossimImageGeometry *projection)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual void draw (ossimRgbImage &anImage) const
 
virtual ossimAnnotationObjectgetNewClippedObject (const ossimDrect &rect) const
 
virtual bool intersects (const ossimDrect &rect) const
 
virtual void getBoundingRect (ossimDrect &rect) const
 
virtual void computeBoundingRect ()
 
virtual void setColor (ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
 Sets the color of thePolygon. More...
 
virtual void setThickness (ossim_uint8 thickness)
 Sets the pen thickness of thePolygon. More...
 
- Public Member Functions inherited from ossimGeoAnnotationObject
 ossimGeoAnnotationObject (unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
 
 ossimGeoAnnotationObject (const ossimGeoAnnotationObject &rhs)
 
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
 
void getColor (ossim_uint8 &r, ossim_uint8 &g, ossim_uint8 &b) const
 
ossim_uint8 getThickness () const
 
virtual bool isPointWithin (const ossimDpt &imagePoint) const
 
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 ~ossimGeoAnnotationPolyLineObject ()
 
- Protected Member Functions inherited from ossimGeoAnnotationObject
virtual ~ossimGeoAnnotationObject ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

std::vector< ossimGptthePolygon
 
ossimAnnotationMultiLineObjecttheProjectedMultiLineObject
 
- 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 17 of file ossimGeoAnnotationPolyLineObject.h.

Constructor & Destructor Documentation

◆ ossimGeoAnnotationPolyLineObject() [1/2]

ossimGeoAnnotationPolyLineObject::ossimGeoAnnotationPolyLineObject ( const vector< ossimGpt > &  groundPts,
ossim_uint8  r = 255,
ossim_uint8  g = 255,
ossim_uint8  b = 255,
ossim_uint8  thickness = 1 
)

Referenced by dup().

◆ ossimGeoAnnotationPolyLineObject() [2/2]

ossimGeoAnnotationPolyLineObject::ossimGeoAnnotationPolyLineObject ( const ossimGeoAnnotationPolyLineObject rhs)

◆ ~ossimGeoAnnotationPolyLineObject()

ossimGeoAnnotationPolyLineObject::~ossimGeoAnnotationPolyLineObject ( )
protectedvirtual

Definition at line 53 of file ossimGeoAnnotationPolyLineObject.cpp.

References theProjectedMultiLineObject.

54 {
56  {
59  }
60 }
ossimAnnotationMultiLineObject * theProjectedMultiLineObject

Member Function Documentation

◆ applyScale()

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

Implements ossimAnnotationObject.

Definition at line 67 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationMultiLineObject::applyScale(), thePolygon, theProjectedMultiLineObject, x, and y.

69 {
70  for(int i = 0; i < (int)thePolygon.size(); ++i)
71  {
72  thePolygon[i].lond(thePolygon[i].lond()*x);
73  thePolygon[i].latd(thePolygon[i].latd()*y);
74  }
76  {
78  }
79 
80 }
ossim_uint32 x
ossim_uint32 y
ossimAnnotationMultiLineObject * theProjectedMultiLineObject
virtual void applyScale(double x, double y)

◆ computeBoundingRect()

void ossimGeoAnnotationPolyLineObject::computeBoundingRect ( )
virtual

◆ draw()

void ossimGeoAnnotationPolyLineObject::draw ( ossimRgbImage anImage) const
virtual

Implements ossimAnnotationObject.

Definition at line 124 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationMultiLineObject::draw(), and theProjectedMultiLineObject.

125 {
127 }
virtual void draw(ossimRgbImage &anImage) const
ossimAnnotationMultiLineObject * theProjectedMultiLineObject

◆ dup()

ossimObject * ossimGeoAnnotationPolyLineObject::dup ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 62 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimGeoAnnotationPolyLineObject().

63 {
64  return new ossimGeoAnnotationPolyLineObject(*this);
65 }
ossimGeoAnnotationPolyLineObject(const vector< ossimGpt > &groundPts, ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)

◆ getBoundingRect()

void ossimGeoAnnotationPolyLineObject::getBoundingRect ( ossimDrect rect) const
virtual

◆ getNewClippedObject()

ossimAnnotationObject * ossimGeoAnnotationPolyLineObject::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 139 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationMultiLineObject::getNewClippedObject(), and theProjectedMultiLineObject.

140 {
142  {
144  }
145 
146  return (ossimAnnotationObject*)NULL;;
147 }
virtual ossimAnnotationObject * getNewClippedObject(const ossimDrect &rect) const
ossimAnnotationMultiLineObject * theProjectedMultiLineObject

◆ intersects()

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

Implements ossimAnnotationObject.

Definition at line 129 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationMultiLineObject::intersects(), and theProjectedMultiLineObject.

130 {
132  {
134  }
135 
136  return false;
137 }
ossimAnnotationMultiLineObject * theProjectedMultiLineObject
virtual bool intersects(const ossimDrect &rect) const

◆ print()

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

References ossimAnnotationMultiLineObject::print(), thePolygon, and theProjectedMultiLineObject.

109 {
110  out << "number_of_points: " << thePolygon.size() << endl;
111  if(thePolygon.size() > 0)
112  {
113  for(long index =0; index < (long)(thePolygon.size()-1); ++index)
114  {
115  out << thePolygon[index] << endl;
116  }
117  out << thePolygon[thePolygon.size()-1] << endl;
118  }
119  out << "Projected Polygon" << endl;
121  return out;
122 }
virtual std::ostream & print(std::ostream &out) const
Generic print method.
ossimAnnotationMultiLineObject * theProjectedMultiLineObject

◆ setColor()

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

Sets the color of thePolygon.

RGB range 0 to 255

Parameters
rDN value for red.
gDN value for green.
bDN value for blue.

Reimplemented from ossimAnnotationObject.

Definition at line 159 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationObject::setColor(), and theProjectedMultiLineObject.

162 {
164  {
166  }
167 }
ossimAnnotationMultiLineObject * theProjectedMultiLineObject
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)

◆ setThickness()

void ossimGeoAnnotationPolyLineObject::setThickness ( ossim_uint8  thickness)
virtual

Sets the pen thickness of thePolygon.

range 0 to 255

Parameters
thicknessPen thickness.

Reimplemented from ossimAnnotationObject.

Definition at line 169 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationObject::setThickness(), and theProjectedMultiLineObject.

170 {
172  {
174  }
175 }
virtual void setThickness(ossim_uint8 thickness)
ossimAnnotationMultiLineObject * theProjectedMultiLineObject

◆ transform()

void ossimGeoAnnotationPolyLineObject::transform ( ossimImageGeometry projection)
virtual

Add the projection interface to all geographically defined objects.

Implements ossimGeoAnnotationObject.

Definition at line 82 of file ossimGeoAnnotationPolyLineObject.cpp.

References ossimAnnotationMultiLineObject::computeBoundingRect(), ossimAnnotationMultiLineObject::getPolyLineList(), thePolygon, theProjectedMultiLineObject, and ossimImageGeometry::worldToLocal().

Referenced by ossimGdalOgrVectorAnnotation::loadLineString(), and ossimGdalOgrVectorAnnotation::loadMultiLineString().

83 {
84  // make sure it's not null
85  if(!projection)
86  {
87  return;
88  }
89  vector<ossimPolyLine>& polyList =
91 
92  if(polyList.size())
93  {
94  vector<ossimDpt>& poly = polyList[0].getVertexList();
95 
96  const std::vector<ossimGpt>::size_type BOUNDS = thePolygon.size();
97 
98  for(std::vector<ossimGpt>::size_type index=0; index < BOUNDS; ++index)
99  {
100  projection->worldToLocal(thePolygon[index], poly[index]);
101  }
102 
103  // update the bounding rect
105  }
106 }
virtual const vector< ossimPolyLine > & getPolyLineList() const
ossimAnnotationMultiLineObject * theProjectedMultiLineObject
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.

Member Data Documentation

◆ thePolygon

std::vector<ossimGpt> ossimGeoAnnotationPolyLineObject::thePolygon
protected

Definition at line 60 of file ossimGeoAnnotationPolyLineObject.h.

Referenced by applyScale(), print(), and transform().

◆ theProjectedMultiLineObject

ossimAnnotationMultiLineObject* ossimGeoAnnotationPolyLineObject::theProjectedMultiLineObject
protected

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