OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimGeoAnnotationGdBitmapFont.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks)
6 // Description:
7 //
8 //*************************************************************************
9 // $Id: ossimGeoAnnotationGdBitmapFont.cpp 15766 2009-10-20 12:37:09Z gpotts $
15 
17  "ossimGeoAnnotationGdBitmapFont",
19 
21  const ossimString &text,
22  ossimGdFontPtr font,
23  unsigned char r,
24  unsigned char g,
25  unsigned char b,
26  long thickness)
27  : ossimGeoAnnotationObject(r, g, b, thickness),
28  thePosition(position)
29 {
30  theProjectedFont = new ossimAnnotationGdBitmapFont(ossimDpt(0,0),
31  text,
32  font,
33  r,
34  g,
35  b,
36  thickness);
37 }
38 
41  theProjectedFont(rhs.theProjectedFont.valid()?(ossimAnnotationGdBitmapFont*)theProjectedFont->dup():(ossimAnnotationGdBitmapFont*)0),
42  thePosition(rhs.thePosition)
43 {
44 }
45 
47 {
49 }
50 
52 {
53  return new ossimGeoAnnotationGdBitmapFont(*this);
54 }
55 
57 {
60 
62  {
64  }
65 }
66 
68 {
69  out << "position: " << thePosition;
70  theProjectedFont->print(out);
71  return out;
72 }
73 
75 {
76  theProjectedFont->draw(anImage);
77 }
78 
80 {
82 }
83 
85 {
87  {
88  return theProjectedFont->intersects(rect);
89  }
90 
91  return false;
92 }
93 
95 {
96  if(intersects(rect))
97  {
99  {
101  }
102  }
103 
104  return (ossimAnnotationObject*)0;
105 }
106 
108 {
110 }
111 
113 {
114  ossimDpt position;
115  projection->worldToLocal(thePosition, position);
117 }
118 
120 {
121  theProjectedFont->setText(text);
122 }
123 
125 {
126  theProjectedFont->setFont(font);
127 }
ossim_uint32 x
virtual void applyScale(double x, double y)
virtual bool intersects(const ossimDrect &rect) const
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
ossim_uint32 y
virtual std::ostream & print(std::ostream &out) const
Generic print method.
bool valid() const
Definition: ossimRefPtr.h:75
virtual void draw(ossimRgbImage &anImage) const
RTTI_DEF1(ossimGeoAnnotationGdBitmapFont, "ossimGeoAnnotationGdBitmapFont", ossimGeoAnnotationObject) ossimGeoAnnotationGdBitmapFont
virtual std::ostream & print(std::ostream &out) const
Generic print method.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
virtual ossimDrect getBoundingRect() const
ossimRefPtr< ossimAnnotationGdBitmapFont > theProjectedFont
virtual void setFont(ossimGdFontPtr font)
virtual void setText(const ossimString &text)
virtual void transform(ossimImageGeometry *projection)
virtual ossimAnnotationObject * getNewClippedObject(const ossimDrect &rect) const
virtual void setUpperLeftTextPosition(const ossimDpt &position)
virtual ossimAnnotationObject * getNewClippedObject(const ossimDrect &rect) const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual void getBoundingRect(ossimDrect &rect) const
virtual bool intersects(const ossimDrect &rect) const
virtual void draw(ossimRgbImage &anImage) const
virtual void applyScale(double x, double y)
virtual void setText(const ossimString &text)
ossimGeoAnnotationGdBitmapFont(const ossimGpt &position=ossimGpt(0, 0, 0), const ossimString &text=ossimString(""), ossimGdFontPtr font=ossimGdFontLarge, unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual void setFont(ossimGdFontPtr font)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23