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

#include <ossimGeoAnnotationFontObject.h>

Inheritance diagram for ossimGeoAnnotationFontObject:
ossimGeoAnnotationObject ossimAnnotationObject ossimObject ossimReferenced

Public Member Functions

 ossimGeoAnnotationFontObject ()
 
 ossimGeoAnnotationFontObject (const ossimGpt &location, const ossimString &s, const ossimIpt &pixelSize=ossimIpt(12, 12), double rotation=0.0, const ossimDpt &scale=ossimDpt(1.0, 1.0), const ossimDpt &shear=ossimDpt(0.0, 0.0), ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255)
 
 ossimGeoAnnotationFontObject (const ossimGeoAnnotationFontObject &rhs)
 
virtual ossimObjectdup () const
 
ossimAnnotationFontObjectgetFontObject ()
 
void setFont (ossimFont *font)
 
ossimFontgetFont ()
 
virtual void setPointSize (const ossimIpt &size)
 
virtual void setRotation (double rotation)
 
virtual void setScale (const ossimDpt &scale)
 
virtual void setShear (const ossimDpt &shear)
 
virtual void setColor (ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
 
virtual void transform (ossimImageGeometry *projection)
 
virtual void setCenterGround (const ossimGpt &gpt)
 
virtual void draw (ossimRgbImage &anImage) const
 
virtual void computeBoundingRect ()
 
virtual void getBoundingRect (ossimDrect &rect) const
 
virtual ossimAnnotationObjectgetNewClippedObject (const ossimDrect &rect) const
 
virtual bool intersects (const ossimDrect &rect) const
 
virtual void applyScale (double x, double y)
 
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 ossimGeoAnnotationObject
 ossimGeoAnnotationObject (unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
 
 ossimGeoAnnotationObject (const ossimGeoAnnotationObject &rhs)
 
- 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 std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual ossimDrect getBoundingRect () const
 
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 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 ~ossimGeoAnnotationFontObject ()
 
- Protected Member Functions inherited from ossimGeoAnnotationObject
virtual ~ossimGeoAnnotationObject ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossimGpt theCenterGround
 
ossimRefPtr< ossimFonttheFont
 
ossimFontInformation theFontInfo
 
ossimRefPtr< ossimAnnotationFontObjecttheAnnotationFontObject
 
- 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 15 of file ossimGeoAnnotationFontObject.h.

Constructor & Destructor Documentation

◆ ossimGeoAnnotationFontObject() [1/3]

ossimGeoAnnotationFontObject::ossimGeoAnnotationFontObject ( )

Definition at line 25 of file ossimGeoAnnotationFontObject.cpp.

References ossimRefPtr< T >::get(), ossimFontFactoryRegistry::instance(), ossimNotify(), ossimNotifyLevel_WARN, ossimAnnotationFontObject::setFont(), theAnnotationFontObject, and theFont.

Referenced by dup().

26  :
29  theFont(0),
30  theFontInfo(),
32 {
34  getDefaultFont()->dup();
35  if (!theFont)
36  {
38  << "ossimGeoAnnotationFontObject::ossimGeoAnnotationFontObject"
39  << " WARNING: No font support..."
40  << endl;
41  }
44  ossimString(""));
45 
47 
48 }
virtual void setFont(ossimFont *font)
Class to draw fonts onto an image.
static ossimFontFactoryRegistry * instance()
ossimGeoAnnotationObject(unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ ossimGeoAnnotationFontObject() [2/3]

ossimGeoAnnotationFontObject::ossimGeoAnnotationFontObject ( const ossimGpt location,
const ossimString s,
const ossimIpt pixelSize = ossimIpt(12, 12),
double  rotation = 0.0,
const ossimDpt scale = ossimDpt(1.0, 1.0),
const ossimDpt shear = ossimDpt(0.0,0.0),
ossim_uint8  r = 255,
ossim_uint8  g = 255,
ossim_uint8  b = 255 
)

Definition at line 50 of file ossimGeoAnnotationFontObject.cpp.

References ossimDpt::makeNan(), and theAnnotationFontObject.

60  :
61  ossimGeoAnnotationObject(r, g, b),
62  theCenterGround(location),
63  theFont(0),
64  theFontInfo(),
66 {
67  ossimDpt pt;
68  pt.makeNan();
69 
71  s,
72  pixelSize,
73  rotation,
74  scale,
75  shear,
76  r,
77  g,
78  b);
79 }
Class to draw fonts onto an image.
ossimGeoAnnotationObject(unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
void makeNan()
Definition: ossimDpt.h:65
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ ossimGeoAnnotationFontObject() [3/3]

ossimGeoAnnotationFontObject::ossimGeoAnnotationFontObject ( const ossimGeoAnnotationFontObject rhs)

Definition at line 81 of file ossimGeoAnnotationFontObject.cpp.

References ossimRefPtr< T >::get(), ossimAnnotationFontObject::setFont(), theAnnotationFontObject, and theFont.

83  :
86  theFont(rhs.theFont.valid()?(ossimFont*)rhs.theFont->dup():(ossimFont*)0),
87  theFontInfo(),
98  rhs.theRed,
99  rhs.theGreen,
100  rhs.theBlue))
101 {
103 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setFont(ossimFont *font)
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
Class to draw fonts onto an image.
virtual ossimObject * dup() const =0
ossimGeoAnnotationObject(unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ ~ossimGeoAnnotationFontObject()

ossimGeoAnnotationFontObject::~ossimGeoAnnotationFontObject ( )
protectedvirtual

Definition at line 105 of file ossimGeoAnnotationFontObject.cpp.

References theAnnotationFontObject, and theFont.

106 {
108  theFont = 0;
109 }
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

Member Function Documentation

◆ applyScale()

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

Implements ossimAnnotationObject.

Definition at line 219 of file ossimGeoAnnotationFontObject.cpp.

References ossimAnnotationFontObject::applyScale(), theAnnotationFontObject, x, and y.

220 {
222 }
ossim_uint32 x
ossim_uint32 y
virtual void applyScale(double x, double y)
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ computeBoundingRect()

void ossimGeoAnnotationFontObject::computeBoundingRect ( )
virtual

◆ draw()

void ossimGeoAnnotationFontObject::draw ( ossimRgbImage anImage) const
virtual

Implements ossimAnnotationObject.

Definition at line 193 of file ossimGeoAnnotationFontObject.cpp.

References ossimAnnotationFontObject::draw(), and theAnnotationFontObject.

194 {
195  theAnnotationFontObject->draw(anImage);
196 }
virtual void draw(ossimRgbImage &anImage) const
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ dup()

ossimObject * ossimGeoAnnotationFontObject::dup ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 111 of file ossimGeoAnnotationFontObject.cpp.

References ossimGeoAnnotationFontObject().

112 {
113  return new ossimGeoAnnotationFontObject(*this);
114 }

◆ getBoundingRect()

void ossimGeoAnnotationFontObject::getBoundingRect ( ossimDrect rect) const
virtual

Implements ossimAnnotationObject.

Definition at line 203 of file ossimGeoAnnotationFontObject.cpp.

References ossimAnnotationFontObject::getBoundingRect(), and theAnnotationFontObject.

204 {
206 }
virtual void getBoundingRect(ossimDrect &rect) const
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ getFont()

ossimFont * ossimGeoAnnotationFontObject::getFont ( )

Definition at line 124 of file ossimGeoAnnotationFontObject.cpp.

References ossimRefPtr< T >::get(), and theFont.

125 {
126  return theFont.get();
127 }

◆ getFontObject()

ossimAnnotationFontObject * ossimGeoAnnotationFontObject::getFontObject ( )

Definition at line 188 of file ossimGeoAnnotationFontObject.cpp.

References ossimRefPtr< T >::get(), and theAnnotationFontObject.

189 {
190  return theAnnotationFontObject.get();
191 }
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ getNewClippedObject()

ossimAnnotationObject * ossimGeoAnnotationFontObject::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 208 of file ossimGeoAnnotationFontObject.cpp.

210 {
211  return (ossimAnnotationObject*)0;
212 }

◆ intersects()

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

Implements ossimAnnotationObject.

Definition at line 214 of file ossimGeoAnnotationFontObject.cpp.

References ossimAnnotationFontObject::intersects(), and theAnnotationFontObject.

215 {
216  return theAnnotationFontObject->intersects(rect);
217 }
virtual bool intersects(const ossimDrect &rect) const
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ loadState()

bool ossimGeoAnnotationFontObject::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.

Keywords:

For center format is: ( latitude, longitude, height, datum_code ) center: ( 42.01, -90.71, 0.0, WGE )

For point_size format is: "( x, y )" point_size: ( 18, 18 )

For scale format is: "( x, y )" scale: ( 1.0, 1.0 )

For shear format is: "( x, y )" shear: ( 0.0, 0.0 )

text: Airport

USE ONE OF family_name: family_name: URW Palladio L family_name: gd sans family_name: URW Bookman L family_name: Nimbus Roman No9 L family_name: Nimbus Sans L family_name: URW Palladio L family_name: Century Schoolbook L family_name: Nimbus Mono L family_name: Nimbus Sans L Condensed

USE ONE OF style_name: style_name: normal style_name: bold style_name: italic style_name: bold italic

Reimplemented from ossimGeoAnnotationObject.

Definition at line 234 of file ossimGeoAnnotationFontObject.cpp.

References ossimKeywordlist::find(), ossimRefPtr< T >::get(), ossimFontFactoryRegistry::instance(), ossimGeoAnnotationObject::loadState(), ossimFontInformation::loadState(), ossimAnnotationObject::setColor(), ossimAnnotationFontObject::setFont(), ossimAnnotationFontObject::setGeometryInformation(), ossimAnnotationFontObject::setString(), ossimAnnotationObject::setThickness(), status, theAnnotationFontObject, ossimAnnotationObject::theBlue, theCenterGround, theFont, theFontInfo, ossimAnnotationObject::theGreen, ossimAnnotationObject::theRed, ossimAnnotationObject::theThickness, and ossimRefPtr< T >::valid().

236 {
237  //---
238  // Base class state must be called first to pick up colors...
239  //---
240  bool status = ossimGeoAnnotationObject::loadState(kwl, prefix);
241 
244 
245  const char* lookup;
246 
247  lookup = kwl.find(prefix, "text");
248  if (lookup)
249  {
251  }
252 
253  lookup = kwl.find(prefix, "center");
254  if (lookup)
255  {
256  std::istringstream is(lookup);
257  is >> theCenterGround;
258  }
259 
260  // Get the font information.
261  theFontInfo.loadState(kwl, prefix);
262 
263  // See if we can make a font.
265  createFont(theFontInfo);
266  if (f.valid())
267  {
268  theFont = f;
270  }
271 
273 
274  return status;
275 }
virtual void setThickness(ossim_uint8 thickness)
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setFont(ossimFont *font)
const char * find(const char *key) const
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual void setString(const ossimString &s)
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
virtual void setGeometryInformation(const ossimFontInformation &info)
return status
static ossimFontFactoryRegistry * instance()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ saveState()

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

Saves the current state of this object.

See also
loadState for keywords.

Reimplemented from ossimGeoAnnotationObject.

Definition at line 224 of file ossimGeoAnnotationFontObject.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimAnnotationFontObject::getString(), ossimGeoAnnotationObject::saveState(), ossimFontInformation::saveState(), theAnnotationFontObject, theCenterGround, theFontInfo, and ossimGpt::toString().

226 {
227  kwl.add(prefix, "center", theCenterGround.toString().c_str());
228  kwl.add(prefix, "text", theAnnotationFontObject->getString().c_str());
229  theFontInfo.saveState(kwl, prefix);
230 
231  return ossimGeoAnnotationObject::saveState(kwl, prefix);
232 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the current state of this object.
virtual ossimString getString() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the current state of this object.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ setCenterGround()

void ossimGeoAnnotationFontObject::setCenterGround ( const ossimGpt gpt)
virtual

Definition at line 183 of file ossimGeoAnnotationFontObject.cpp.

References theCenterGround.

184 {
185  theCenterGround = gpt;
186 }

◆ setColor()

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

Reimplemented from ossimAnnotationObject.

Definition at line 161 of file ossimGeoAnnotationFontObject.cpp.

References ossimAnnotationObject::setColor(), theAnnotationFontObject, and ossimRefPtr< T >::valid().

Referenced by ossimVpfAnnotationFeatureInfo::buildTxtFeature(), and ossimVpfAnnotationFeatureInfo::setDrawingFeaturesToAnnotation().

164 {
166  {
168  }
169 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setColor(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

◆ setFont()

void ossimGeoAnnotationFontObject::setFont ( ossimFont font)

◆ setPointSize()

void ossimGeoAnnotationFontObject::setPointSize ( const ossimIpt size)
virtual

◆ setRotation()

void ossimGeoAnnotationFontObject::setRotation ( double  rotation)
virtual

◆ setScale()

void ossimGeoAnnotationFontObject::setScale ( const ossimDpt scale)
virtual

◆ setShear()

void ossimGeoAnnotationFontObject::setShear ( const ossimDpt shear)
virtual

◆ transform()

void ossimGeoAnnotationFontObject::transform ( ossimImageGeometry projection)
virtual

Add the projection interface to all geographically defined objects.

Implements ossimGeoAnnotationObject.

Definition at line 171 of file ossimGeoAnnotationFontObject.cpp.

References ossimAnnotationFontObject::computeBoundingRect(), ossimAnnotationFontObject::setCenterPosition(), theAnnotationFontObject, theCenterGround, and ossimImageGeometry::worldToLocal().

172 {
173  if(projection)
174  {
175  ossimDpt ipt;
176 
177  projection->worldToLocal(theCenterGround, ipt);
180  }
181 }
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual void setCenterPosition(const ossimIpt &position)
ossimRefPtr< ossimAnnotationFontObject > theAnnotationFontObject

Member Data Documentation

◆ theAnnotationFontObject

ossimRefPtr<ossimAnnotationFontObject> ossimGeoAnnotationFontObject::theAnnotationFontObject
protected

◆ theCenterGround

ossimGpt ossimGeoAnnotationFontObject::theCenterGround
protected

Definition at line 120 of file ossimGeoAnnotationFontObject.h.

Referenced by loadState(), saveState(), setCenterGround(), and transform().

◆ theFont

ossimRefPtr<ossimFont> ossimGeoAnnotationFontObject::theFont
protected

◆ theFontInfo

ossimFontInformation ossimGeoAnnotationFontObject::theFontInfo
protected

Definition at line 122 of file ossimGeoAnnotationFontObject.h.

Referenced by loadState(), and saveState().


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