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

Class to draw fonts onto an image. More...

#include <ossimAnnotationFontObject.h>

Inheritance diagram for ossimAnnotationFontObject:
ossimAnnotationObject ossimObject ossimReferenced

Public Member Functions

 ossimAnnotationFontObject ()
 
 ossimAnnotationFontObject (const ossimIpt &upperLeft, 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), unsigned char r=255, unsigned char g=255, unsigned char b=255)
 
 ossimAnnotationFontObject (const ossimAnnotationFontObject &rhs)
 
virtual ossimObjectdup () const
 
virtual void draw (ossimRgbImage &anImage) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual void getBoundingRect (ossimDrect &rect) const
 
virtual void setString (const ossimString &s)
 
virtual ossimString getString () const
 
virtual void computeBoundingRect ()
 
virtual ossimAnnotationObjectgetNewClippedObject (const ossimDrect &rect) const
 
virtual bool intersects (const ossimDrect &rect) const
 
virtual bool isPointWithin (const ossimDpt &imagePoint) const
 
virtual void setFont (ossimFont *font)
 
virtual void setCenterPosition (const ossimIpt &position)
 
virtual void setUpperLeftPosition (const ossimIpt &position)
 
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 setGeometryInformation (const ossimFontInformation &info)
 
virtual void applyScale (double x, double y)
 
- 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 Member Functions

virtual ~ossimAnnotationFontObject ()
 
void setFontInfo () const
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossimRefPtr< ossimFonttheFont
 
ossimIpt thePosition
 
ossimString theString
 
ossimIpt thePixelSize
 
double theRotation
 
double theHorizontalScale
 
double theVerticalScale
 
double theHorizontalShear
 
double theVerticalShear
 
ossimIrect theBoundingRect
 
- Protected Attributes inherited from ossimAnnotationObject
ossim_uint8 theRed
 
ossim_uint8 theGreen
 
ossim_uint8 theBlue
 
ossim_uint8 theThickness
 
ossimString theName
 
ossim_uint32 theId
 

Friends

class ossimGeoAnnotationFontObject
 

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

Class to draw fonts onto an image.

Note
This class requires a font path to be set for the factory: "ossimFontFactoryRegistry". You should set at a minimum the keyword "font.dir1" in your ossim_prefernces file. Example from a RedHat 9.0 system: font.dir1: /usr/share/fonts/default/Type1
See also
file ossim/etc/templates/ossim_prefernces_template

Definition at line 27 of file ossimAnnotationFontObject.h.

Constructor & Destructor Documentation

◆ ossimAnnotationFontObject() [1/3]

ossimAnnotationFontObject::ossimAnnotationFontObject ( )

Definition at line 16 of file ossimAnnotationFontObject.cpp.

References ossimIrect::makeNan(), setFontInfo(), and theBoundingRect.

Referenced by dup().

18  theFont(ossimFontFactoryRegistry::instance()->getDefaultFont()),
19  thePosition(0,0),
20  theString(""),
21  theRotation(0.0),
22  theHorizontalScale(0.0),
23  theVerticalScale(0.0),
24  theHorizontalShear(0.0),
25  theVerticalShear(0.0)
26 {
27  setFontInfo();
29 }
ossimRefPtr< ossimFont > theFont
static ossimFontFactoryRegistry * instance()
void makeNan()
Definition: ossimIrect.h:329
ossimAnnotationObject(ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)

◆ ossimAnnotationFontObject() [2/3]

ossimAnnotationFontObject::ossimAnnotationFontObject ( const ossimIpt upperLeft,
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),
unsigned char  r = 255,
unsigned char  g = 255,
unsigned char  b = 255 
)

Definition at line 31 of file ossimAnnotationFontObject.cpp.

References computeBoundingRect(), ossimFont::getBoundingBox(), setFontInfo(), theBoundingRect, theFont, thePosition, and ossimIrect::ul().

40  :ossimAnnotationObject(r,g,b),
41  theFont(ossimFontFactoryRegistry::instance()->getDefaultFont()),
42  theString(s),
43  thePixelSize(pixelSize),
44  theRotation(rotation),
45  theHorizontalScale(scale.x),
46  theVerticalScale(scale.y),
47  theHorizontalShear(shear.x),
48  theVerticalShear(shear.y)
49 {
50  setFontInfo();
51  thePosition = upperLeft;
53 #if 0
54  if (theFont)
55  {
57  }
58  theBoundingRect += upperLeft;
60 #endif
61 }
double y
Definition: ossimDpt.h:165
ossimRefPtr< ossimFont > theFont
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual void getBoundingBox(ossimIrect &box)=0
static ossimFontFactoryRegistry * instance()
ossimAnnotationObject(ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)
double x
Definition: ossimDpt.h:164

◆ ossimAnnotationFontObject() [3/3]

ossimAnnotationFontObject::ossimAnnotationFontObject ( const ossimAnnotationFontObject rhs)

Definition at line 63 of file ossimAnnotationFontObject.cpp.

References setFontInfo(), and theFont.

66  theString(rhs.theString),
74 {
75  theFont = rhs.theFont;
76  setFontInfo();
77 }
ossimRefPtr< ossimFont > theFont
ossimAnnotationObject(ossim_uint8 r=255, ossim_uint8 g=255, ossim_uint8 b=255, ossim_uint8 thickness=1)

◆ ~ossimAnnotationFontObject()

ossimAnnotationFontObject::~ossimAnnotationFontObject ( )
protectedvirtual

Definition at line 80 of file ossimAnnotationFontObject.cpp.

References theFont.

81 {
82  theFont = 0;
83 }
ossimRefPtr< ossimFont > theFont

Member Function Documentation

◆ applyScale()

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

Implements ossimAnnotationObject.

Definition at line 363 of file ossimAnnotationFontObject.cpp.

References computeBoundingRect(), setFontInfo(), thePosition, ossimIpt::x, x, ossimIpt::y, and y.

Referenced by ossimGeoAnnotationFontObject::applyScale().

364 {
365  thePosition.x = ossim::round<int>(thePosition.x *x);
366  thePosition.y = ossim::round<int>(thePosition.y *y);
367 
368  setFontInfo();
370 
371 }
ossim_uint32 x
ossim_uint32 y
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ computeBoundingRect()

void ossimAnnotationFontObject::computeBoundingRect ( )
virtual

Implements ossimAnnotationObject.

Definition at line 208 of file ossimAnnotationFontObject.cpp.

References ossimFont::getBoundingBox(), ossimIrect::height(), setFontInfo(), theBoundingRect, theFont, thePosition, ossimRefPtr< T >::valid(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by ossimMapCompositionSource::addGeographicBottomGridLabels(), ossimMapCompositionSource::addGeographicLeftGridLabels(), ossimMapCompositionSource::addGeographicRightGridLabels(), ossimMapCompositionSource::addMeterGridLabels(), ossimMapCompositionSource::addTitle(), applyScale(), ossimGeoAnnotationFontObject::computeBoundingRect(), ossimAnnotationFontObject(), and ossimGeoAnnotationFontObject::transform().

209 {
210  setFontInfo();
211  if(theFont.valid())
212  {
213  ossimIrect textRect;
214  theFont->getBoundingBox(textRect);
215  ossim_int32 w = textRect.width();
216  ossim_int32 h = textRect.height();
217  ossim_int32 ulx = thePosition.x;
218  ossim_int32 uly = thePosition.y;
220  uly,
221  ulx + w - 1,
222  uly + h - 1);
223  }
224 }
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimRefPtr< ossimFont > theFont
virtual void getBoundingBox(ossimIrect &box)=0
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ draw()

void ossimAnnotationFontObject::draw ( ossimRgbImage anImage) const
virtual

Implements ossimAnnotationObject.

Definition at line 85 of file ossimAnnotationFontObject.cpp.

References ossimIrect::clipToRect(), ossimFont::getBoundingBox(), ossimImageData::getBuf(), ossimFont::getBufferRect(), ossimRgbImage::getImageData(), ossimImageData::getImageRectangle(), ossimImageData::getNumberOfBands(), ossimIrect::hasNans(), ossimIrect::height(), ossimIrect::intersects(), ossimFont::rasterize(), ossimFont::setClippingBox(), setFontInfo(), ossimAnnotationObject::theBlue, theBoundingRect, theFont, ossimAnnotationObject::theGreen, thePixelSize, ossimAnnotationObject::theRed, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by ossimGeoAnnotationFontObject::draw().

86 {
88  {
89  return;
90  }
91  if (!theFont)
92  {
93  return;
94  }
95 
96  if(!thePixelSize.x || !thePixelSize.y)
97  {
98  return; // (DAH) we have to have some demension to write!
99  }
100 
101  ossimRefPtr<ossimImageData> destination = anImage.getImageData();
102 
103  if(destination.valid())
104  {
105  ossimIrect destRect = anImage.getImageData()->getImageRectangle();
106 
107  ossimIpt shift(-theBoundingRect.ul().x,
108  -theBoundingRect.ul().y);
109 
110  destRect += shift;
111  ossimIrect boundingRect = theBoundingRect + shift;
112 
113  if(boundingRect.intersects(destRect))
114  {
115  setFontInfo();
116 
117  ossimIrect fontBufferRect;
118  ossimIrect boundingFontBox;
119 
120  theFont->setClippingBox(destRect);
121  theFont->getBoundingBox(boundingFontBox);
122 
123  const ossim_uint8* srcBuf = theFont->rasterize();
124  if (!srcBuf)
125  {
126  return;
127  }
128 
129  theFont->getBufferRect(fontBufferRect);
130  ossimIrect clipRect = boundingRect.clipToRect(fontBufferRect);
131 
132  long clipHeight = clipRect.height();
133  long clipWidth = clipRect.width();
134 
135  long destinationOffset = (long)(((clipRect.ul().y - destRect.ul().y)* destRect.width()) +
136  (clipRect.ul().x - destRect.ul().x));
137  long fontBufferOffset = (long)(((clipRect.ul().y - fontBufferRect.ul().y)*fontBufferRect.width()) +
138  (clipRect.ul().x - fontBufferRect.ul().x));
139 
140 
141  long destinationIndex = destinationOffset;
142  long srcIndex = fontBufferOffset;
143  long num_bands = destination->getNumberOfBands();
144  ossim_int32 s_width = (ossim_int32)fontBufferRect.width();
145  ossim_int32 d_width = (ossim_int32)destRect.width();
146 
147  num_bands = num_bands > 3? 3:num_bands;
148 
149  unsigned char colorArray[3];
150  long band = 0;
151  colorArray[0] = theRed;
152  colorArray[1] = theGreen;
153  colorArray[2] = theBlue;
154  ossim_uint8** destBuf = new ossim_uint8*[num_bands];
155  for(band = 0; band < num_bands;++band)
156  {
157  destBuf[band] = static_cast<ossim_uint8*>(destination->getBuf(band));
158  if (!destBuf[band])
159  {
160  delete [] destBuf;
161  return;
162  }
163  }
164 
165  for(long line = 0; line < clipHeight; ++line)
166  {
167  for(long col = 0; col < clipWidth; ++col)
168  {
169  if(srcBuf[srcIndex + col])
170  {
171  for (band=0; band<num_bands; ++band)
172  {
173  *(destBuf[band] + destinationIndex + col) = colorArray[band];
174  }
175  }
176  }
177  srcIndex += s_width;
178  destinationIndex += d_width;
179  }
180  delete [] destBuf;
181  }
182  }
183 }
virtual void getBufferRect(ossimIrect &bufRect)
Definition: ossimFont.h:252
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimRefPtr< ossimFont > theFont
const ossimIpt & ul() const
Definition: ossimIrect.h:274
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual const ossim_uint8 * rasterize()=0
ossimRefPtr< ossimImageData > getImageData()
Will return the image data.
virtual void getBoundingBox(ossimIrect &box)=0
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual void setClippingBox(const ossimIrect &clipBox=ossimIrect(0, 0, 0, 0))
Definition: ossimFont.h:266
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
unsigned char ossim_uint8
int ossim_int32

◆ dup()

ossimObject * ossimAnnotationFontObject::dup ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 373 of file ossimAnnotationFontObject.cpp.

References ossimAnnotationFontObject().

Referenced by getNewClippedObject().

374 {
375  return new ossimAnnotationFontObject(*this);
376 }

◆ getBoundingRect()

void ossimAnnotationFontObject::getBoundingRect ( ossimDrect rect) const
virtual

◆ getNewClippedObject()

ossimAnnotationObject * ossimAnnotationFontObject::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 280 of file ossimAnnotationFontObject.cpp.

References dup(), and intersects().

281 {
282  if(intersects(rect))
283  {
284  return (ossimAnnotationObject*)dup();
285  }
286 
287  return (ossimAnnotationObject*)NULL;
288 }
virtual bool intersects(const ossimDrect &rect) const
virtual ossimObject * dup() const

◆ getString()

ossimString ossimAnnotationFontObject::getString ( ) const
virtual

Definition at line 275 of file ossimAnnotationFontObject.cpp.

References theString.

Referenced by ossimGeoAnnotationFontObject::saveState().

276 {
277  return theString;
278 }

◆ intersects()

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

Implements ossimAnnotationObject.

Definition at line 290 of file ossimAnnotationFontObject.cpp.

References ossimDrect::intersects(), and theBoundingRect.

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

291 {
292  return rect.intersects(theBoundingRect);
293 }
bool intersects(const ossimDrect &rect) const
Definition: ossimDrect.cpp:289

◆ isPointWithin()

bool ossimAnnotationFontObject::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 226 of file ossimAnnotationFontObject.cpp.

References ossimIrect::pointWithin(), and theBoundingRect.

227 {
228  return theBoundingRect.pointWithin(imagePoint);
229 }
bool pointWithin(const ossimIpt &pt) const
Definition: ossimIrect.h:729

◆ print()

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

References ossimFont::getFamilyName(), ossimFont::getStyleName(), theBoundingRect, theFont, theHorizontalScale, theHorizontalShear, thePosition, theRotation, theString, theVerticalScale, theVerticalShear, and ossimRefPtr< T >::valid().

186 {
187  if(theFont.valid())
188  {
189  out << "Family: " << theFont->getFamilyName() << endl
190  << "Style: " << theFont->getStyleName() << endl;
191  }
192  out << "String: " << theString << endl
193  << "Upper Left Position: " << thePosition << endl
194  << "Rotation: " << theRotation << endl
195  << "Horizontal shear: " << theHorizontalShear << endl
196  << "Vertical shear: " << theVerticalShear << endl
197  << "Vertical scale: " << theVerticalScale << endl
198  << "Horizontal scale: " << theHorizontalScale << endl
199  << "Bounding rect: " << theBoundingRect << endl;
200  return out;
201 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimFont > theFont
virtual ossimString getFamilyName() const
Definition: ossimFont.h:133
virtual ossimString getStyleName() const
Definition: ossimFont.h:141

◆ setCenterPosition()

void ossimAnnotationFontObject::setCenterPosition ( const ossimIpt position)
virtual

◆ setFont()

void ossimAnnotationFontObject::setFont ( ossimFont font)
virtual

◆ setFontInfo()

void ossimAnnotationFontObject::setFontInfo ( ) const
protected

Definition at line 257 of file ossimAnnotationFontObject.cpp.

References ossimFont::setHorizontalVerticalShear(), ossimFont::setPixelSize(), ossimFont::setRotation(), ossimFont::setScale(), ossimFont::setString(), theFont, theHorizontalScale, theHorizontalShear, thePixelSize, theRotation, theString, theVerticalScale, theVerticalShear, ossimRefPtr< T >::valid(), ossimIpt::x, and ossimIpt::y.

Referenced by applyScale(), computeBoundingRect(), draw(), ossimAnnotationFontObject(), setGeometryInformation(), setPointSize(), setRotation(), setScale(), and setShear().

258 {
259  if(theFont.valid())
260  {
266  thePixelSize.y);
267  }
268 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimFont > theFont
virtual void setHorizontalVerticalShear(double horizontalShear, double verticalShear)
Definition: ossimFont.h:161
virtual void setString(const ossimString &s)
Definition: ossimFont.h:119
virtual void setScale(double horizontal, double vertical)
Definition: ossimFont.cpp:26
ossim_int32 y
Definition: ossimIpt.h:142
virtual void setPixelSize(int horizontalPixelSize, int verticalPixelSize)
Definition: ossimFont.h:205
ossim_int32 x
Definition: ossimIpt.h:141
virtual void setRotation(double rotationInDegrees)
Definition: ossimFont.cpp:19

◆ setGeometryInformation()

void ossimAnnotationFontObject::setGeometryInformation ( const ossimFontInformation info)
virtual

Definition at line 345 of file ossimAnnotationFontObject.cpp.

References ossimFont::getBoundingBox(), setFontInfo(), theBoundingRect, theFont, theHorizontalScale, theHorizontalShear, thePixelSize, ossimFontInformation::thePointSize, thePosition, theRotation, ossimFontInformation::theRotation, ossimFontInformation::theScale, ossimFontInformation::theShear, theVerticalScale, theVerticalShear, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimMapCompositionSource::addGeographicBottomGridLabels(), ossimMapCompositionSource::addGeographicLeftGridLabels(), ossimMapCompositionSource::addGeographicRightGridLabels(), ossimMapCompositionSource::addMeterGridLabels(), ossimMapCompositionSource::addTitle(), and ossimGeoAnnotationFontObject::loadState().

346 {
347  thePixelSize = info.thePointSize;
348  theRotation = info.theRotation;
350  theVerticalScale = info.theScale.y;
352  theVerticalShear = info.theShear.y;
353 
354  setFontInfo();
355  if (theFont.valid())
356  {
358  }
361 }
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
ossimRefPtr< ossimFont > theFont
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual void getBoundingBox(ossimIrect &box)=0
double x
Definition: ossimDpt.h:164

◆ setPointSize()

void ossimAnnotationFontObject::setPointSize ( const ossimIpt size)
virtual

◆ setRotation()

void ossimAnnotationFontObject::setRotation ( double  rotation)
virtual

◆ setScale()

void ossimAnnotationFontObject::setScale ( const ossimDpt scale)
virtual

Definition at line 319 of file ossimAnnotationFontObject.cpp.

References ossimFont::getBoundingBox(), setFontInfo(), theBoundingRect, theFont, theHorizontalScale, thePosition, theVerticalScale, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimChipperUtil::addCrossHairAnnotation(), and ossimGeoAnnotationFontObject::setScale().

320 {
321  theHorizontalScale = scale.x;
322  theVerticalScale = scale.y;
323  setFontInfo();
324  if (theFont.valid())
325  {
327  }
330 }
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
ossimRefPtr< ossimFont > theFont
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual void getBoundingBox(ossimIrect &box)=0
double x
Definition: ossimDpt.h:164

◆ setShear()

void ossimAnnotationFontObject::setShear ( const ossimDpt shear)
virtual

Definition at line 332 of file ossimAnnotationFontObject.cpp.

References ossimFont::getBoundingBox(), setFontInfo(), theBoundingRect, theFont, theHorizontalShear, thePosition, theVerticalShear, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimGeoAnnotationFontObject::setShear().

333 {
334  theHorizontalShear = shear.x;
335  theVerticalShear = shear.y;
336  setFontInfo();
337  if (theFont.valid())
338  {
340  }
343 }
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
ossimRefPtr< ossimFont > theFont
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual void getBoundingBox(ossimIrect &box)=0
double x
Definition: ossimDpt.h:164

◆ setString()

void ossimAnnotationFontObject::setString ( const ossimString s)
virtual

◆ setUpperLeftPosition()

void ossimAnnotationFontObject::setUpperLeftPosition ( const ossimIpt position)
virtual

Definition at line 249 of file ossimAnnotationFontObject.cpp.

References theBoundingRect, thePosition, and ossimIrect::ul().

Referenced by ossimChipperUtil::addCrossHairAnnotation().

250 {
251  ossimDpt pt = theBoundingRect.ul();
252  ossimIpt delta = position-pt;
253  theBoundingRect += delta;
255 }
const ossimIpt & ul() const
Definition: ossimIrect.h:274

Friends And Related Function Documentation

◆ ossimGeoAnnotationFontObject

friend class ossimGeoAnnotationFontObject
friend

Definition at line 31 of file ossimAnnotationFontObject.h.

Member Data Documentation

◆ theBoundingRect

ossimIrect ossimAnnotationFontObject::theBoundingRect
protected

◆ theFont

ossimRefPtr<ossimFont> ossimAnnotationFontObject::theFont
mutableprotected

◆ theHorizontalScale

double ossimAnnotationFontObject::theHorizontalScale
protected

Definition at line 74 of file ossimAnnotationFontObject.h.

Referenced by print(), setFontInfo(), setGeometryInformation(), and setScale().

◆ theHorizontalShear

double ossimAnnotationFontObject::theHorizontalShear
protected

Definition at line 76 of file ossimAnnotationFontObject.h.

Referenced by print(), setFontInfo(), setGeometryInformation(), and setShear().

◆ thePixelSize

ossimIpt ossimAnnotationFontObject::thePixelSize
protected

◆ thePosition

ossimIpt ossimAnnotationFontObject::thePosition
protected

◆ theRotation

double ossimAnnotationFontObject::theRotation
protected

◆ theString

ossimString ossimAnnotationFontObject::theString
protected

Definition at line 71 of file ossimAnnotationFontObject.h.

Referenced by getString(), print(), setFontInfo(), and setString().

◆ theVerticalScale

double ossimAnnotationFontObject::theVerticalScale
protected

Definition at line 75 of file ossimAnnotationFontObject.h.

Referenced by print(), setFontInfo(), setGeometryInformation(), and setScale().

◆ theVerticalShear

double ossimAnnotationFontObject::theVerticalShear
protected

Definition at line 77 of file ossimAnnotationFontObject.h.

Referenced by print(), setFontInfo(), setGeometryInformation(), and setShear().


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