OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimGeoAnnotationLineObject.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: ossimGeoAnnotationLineObject.cpp 15766 2009-10-20 12:37:09Z gpotts $
15 
16 
18  "ossimGeoAnnotationLineObject",
20 
22  const ossimGpt& end,
23  unsigned char r,
24  unsigned char g,
25  unsigned char b,
26  long thickness)
27  :ossimGeoAnnotationObject(r, g, b, thickness),
28  theProjectedLineObject(0),
29  theStart(start),
30  theEnd(end)
31 {
32  theProjectedLineObject = new ossimAnnotationLineObject(ossimDpt(0,0),
33  ossimDpt(0,0),
34  r,
35  g,
36  b,
37  thickness);
38 }
39 
42  theProjectedLineObject(rhs.theProjectedLineObject?(ossimAnnotationLineObject*)rhs.theProjectedLineObject->dup():(ossimAnnotationLineObject*)0),
43  theStart(rhs.theStart),
44  theEnd(rhs.theEnd)
45 {
46 
47 }
48 
49 
51 {
53  {
56  }
57 }
58 
60 {
61  return new ossimGeoAnnotationLineObject(*this);
62 }
63 
65 {
68  theEnd.lond(theEnd.lond()*x);
69  theEnd.latd(theEnd.latd()*y);
70 
72  {
74  }
75 }
76 
78 {
79  if(projection)
80  {
81  ossimDpt projectedStart;
82  ossimDpt projectedEnd;
83 
84  projection->worldToLocal(theStart, projectedStart);
85  projection->worldToLocal(theEnd, projectedEnd);
86 
87  theProjectedLineObject->setLine(projectedStart, projectedEnd);
88  }
89 }
90 
92 {
93  out << "start ground: " << theStart << endl;
94  out << "end ground: " << theEnd << endl;
95  return out;
96 }
97 
99 {
100  theProjectedLineObject->draw(anImage);
101 }
102 
104 {
106  {
107  return theProjectedLineObject->intersects(rect);
108  }
109 
110  return false;
111 }
112 
114 {
115  if(intersects(rect))
116  {
118  {
120  }
121  }
122 
123  return (ossimAnnotationObject*)0;
124 }
125 
127 {
129 }
130 
132 {
134 }
ossim_uint32 x
RTTI_DEF1(ossimGeoAnnotationLineObject, "ossimGeoAnnotationLineObject", ossimGeoAnnotationObject) ossimGeoAnnotationLineObject
virtual void applyScale(double x, double y)
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
ossim_uint32 y
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
virtual void transform(ossimImageGeometry *projection)
virtual void draw(ossimRgbImage &anImage) const
virtual ossimDrect getBoundingRect() const
virtual void draw(ossimRgbImage &anImage) const
void setLine(const ossimDpt &start, const ossimDpt &end)
virtual ossimAnnotationObject * getNewClippedObject(const ossimDrect &rect) const
ossimGeoAnnotationLineObject(const ossimGpt &start, const ossimGpt &end, unsigned char r=255, unsigned char g=255, unsigned char b=255, long thickness=1)
virtual bool intersects(const ossimDrect &rect) const
virtual void getBoundingRect(ossimDrect &rect) const
virtual void applyScale(double x, double y)
virtual bool intersects(const ossimDrect &rect) const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimAnnotationObject * getNewClippedObject(const ossimDrect &rect) const
virtual std::ostream & print(std::ostream &out) const
Generic print method.
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
ossimAnnotationLineObject * theProjectedLineObject
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23