VR-Forces 4.1.1 Class Documentation
DtGeocentricGridLinesDrawer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 /*****************************************************************************
6  * $RCSfile: DtGeocentricGridLinesDrawer.h,v $ $Revision: 1.17 $ $State: Exp $
7  *****************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvOsg/vrvOsg.h>
16 
19 
20 #include <matrix/vlVector.h>
21 #include <matrix/coordTransform.h>
22 #include <matrix/refEllipsoid.h>
23 
24 #include <boost/shared_ptr.hpp>
25 
26 namespace makVrv
27 {
28 
29  class DtDe;
30  class DtOsgChannel;
31  class DtLineSegment;
32  class DtTextProxy;
33  class DtBoundingBox;
34 
35 
40  : public DtGridLinesDrawer
41  {
42  public:
43 
46 
48  virtual ~DtGeocentricGridLinesDrawer();
49 
51  virtual void drawGridLines();
52 
54  virtual void setScale( double scale );
55 
57  virtual void setObserverPosition( const DtVector& position );
58 
60  virtual void setChannelDimensions( int startChannelX, int startChannelY,
61  int endChannelX, int endChannelY );
62 
63  protected:
64 
67  virtual void setupReferenceEllipsoid();
68 
70  virtual void setupTopoGeocTransforms();
71 
74  virtual bool pointVisible( const DtVector& point ) const;
75 
77  virtual void findPolarSpacing();
78 
80  virtual void drawPolarLongitudeLines();
81 
83  virtual void drawPolarLatitudeLines();
84 
87  virtual void findLatLonWindowDimensions();
88 
90  virtual void findSpacing();
91 
94  virtual void anchorAndOffsetLines();
95 
97  virtual void drawLongitudeLines();
98 
100  virtual void drawLatitudeLines();
101 
103  virtual void createLabel( DtTextProxy*& label, double radians,
104  bool isLongitude ) const;
105 
107  virtual void destroyGridLines();
108 
111  virtual bool clip3D( const DtVector& pointA, const DtVector& pointB,
112  DtVector& clippedA, DtVector& clippedB ) const;
113 
114  // A Grid line is a vector of line segments that form the (notionally)
115  // curved line
116 
117  // A Grid Line is an array of line segments
118  typedef std::vector<DtLineSegment*> GridLine;
119 
120  // A Grid Line Vector is an array or Grid Lines
121  typedef std::vector<GridLine> GridLineVector;
122  typedef std::vector<DtTextProxy*> LabelArray;
123 
126  virtual void clearUnusedLinesAndLabels( int index, GridLineVector& lines,
127  LabelArray& labels );
128 
131  virtual void clearUnusedSegments( int index, GridLine& line );
132 
135  virtual void destroyLinesAndLabels( GridLineVector& lines,
136  LabelArray& labels );
137 
141  virtual void resizeLinesAndLabels( GridLineVector& lines, LabelArray& labels,
142  int numLines );
143 
146  virtual bool drawLineSegment( DtLineSegment*& segment, DtVector start,
147  DtVector end, float* colorArray, bool* pass3D=0 );
148 
151  virtual GridLine& getSegmentedLine( GridLineVector& lines, int index, int numSegments );
152 
153  private:
154 
157  const DtGeocentricGridLinesDrawer& orig );
158 
160  DtGeocentricGridLinesDrawer& operator=(
161  const DtGeocentricGridLinesDrawer& rhs );
162 
163  protected:
164 
167 
170 
171  double myLatSpacing; // In Radians
172  double myLonSpacing;
173  double myScale;
174  unsigned int myChannelSize;
180 
181  // This is the normal of the plane facing the observer through the
182  // center of the earth. Used for all 3D clipping.
184 
185  double myStartLat;
186  double myEndLat;
187  double myStartLon;
188  double myEndLon;
189  DtCoordTransform myGeocToTopoTransform;
190  DtCoordTransform myTopoToGeocTransform;
191  DtReferenceEllipsoid myReferenceEllipsoid;
197  };
198 }

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)