VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtGeocentricGridLinesDrawer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2014 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
16 
17 #include <matrix/vlVector.h>
18 #include <matrix/coordTransform.h>
19 #include <matrix/referenceEllipsoid.h>
20 
21 #include <boost/shared_ptr.hpp>
22 
23 namespace makVrv
24 {
25 
26  class DtDe;
27  class DtOsgChannel;
28  class DtLineSegment;
29  class DtTextProxy;
30  class DtBoundingBox;
31 
32 
37  : public DtGridLinesDrawer
38  {
39  public:
40 
43 
45  virtual ~DtGeocentricGridLinesDrawer();
46 
48  virtual void drawGridLines();
49 
51  virtual void setScale( double scale );
52 
54  virtual void setObserverPosition( const DtVector& position );
55 
57  virtual void setChannelDimensions( int startChannelX, int startChannelY,
58  int endChannelX, int endChannelY );
59 
60  protected:
61 
64  virtual void setupReferenceEllipsoid();
65 
67  virtual void setupTopoGeocTransforms();
68 
71  virtual bool pointVisible( const DtVector& point ) const;
72 
74  virtual void findPolarSpacing();
75 
77  virtual void drawPolarLongitudeLines();
78 
80  virtual void drawPolarLatitudeLines();
81 
84  virtual void findLatLonWindowDimensions();
85 
87  virtual void findSpacing();
88 
91  virtual void anchorAndOffsetLines();
92 
94  virtual void drawLongitudeLines();
95 
97  virtual void drawLatitudeLines();
98 
100  virtual void createLabel( DtTextProxy*& label, double radians,
101  bool isLongitude );
102 
104  virtual void destroyGridLines();
105 
108  virtual bool clip3D( const DtVector& pointA, const DtVector& pointB,
109  DtVector& clippedA, DtVector& clippedB ) const;
110 
111  // A Grid line is a vector of line segments that form the (notionally)
112  // curved line
113 
114  // A Grid Line is an array of line segments
115  typedef std::vector<DtLineSegment*> GridLine;
116 
117  // A Grid Line Vector is an array or Grid Lines
118  typedef std::vector<GridLine> GridLineVector;
119  typedef std::vector<DtTextProxy*> LabelArray;
120 
123  virtual void clearUnusedLinesAndLabels( int index, GridLineVector& lines,
124  LabelArray& labels );
125 
128  virtual void clearUnusedSegments( int index, GridLine& line );
129 
132  virtual void destroyLinesAndLabels( GridLineVector& lines,
133  LabelArray& labels );
134 
138  virtual void resizeLinesAndLabels( GridLineVector& lines, LabelArray& labels,
139  int numLines );
140 
143  virtual bool drawLineSegment( DtLineSegment*& segment, DtVector start,
144  DtVector end, float* colorArray, bool* pass3D=0 );
145 
148  virtual GridLine& getSegmentedLine( GridLineVector& lines, int index, int numSegments );
149 
150  private:
151 
154  const DtGeocentricGridLinesDrawer& orig );
155 
157  DtGeocentricGridLinesDrawer& operator=(
158  const DtGeocentricGridLinesDrawer& rhs );
159 
160  protected:
161 
164 
167 
168  double myLatSpacing; // In Radians
169  double myLonSpacing;
170  double myScale;
171  unsigned int myChannelSize;
177 
178  // This is the normal of the plane facing the observer through the
179  // center of the earth. Used for all 3D clipping.
181 
182  double myStartLat;
183  double myEndLat;
184  double myStartLon;
185  double myEndLon;
186  DtCoordTransform myGeocToTopoTransform;
187  DtCoordTransform myTopoToGeocTransform;
188  DtReferenceEllipsoid myReferenceEllipsoid;
194  };
195 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)