VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtGeocentricGridLinesDrawer Class Reference

Draw 2D Grid Lines on geocentric databases. This class supported two types of grids - basic geodetic (latitude/longitude lines) which can be labels with decimal degrees or degrees/minutes/seconds. And MGRS (added 11/2019).

Inheritance diagram for makVrv::DtGeocentricGridLinesDrawer:
Inheritance graph
[legend]

Classes

struct  MgrsSegStart
 

Public Member Functions

 DtGeocentricGridLinesDrawer (DtDe &de)
 
virtual ~DtGeocentricGridLinesDrawer ()
 
virtual void drawGridLines ()
 
virtual void drawPolarGridLines ()
 
virtual void drawMidLatitudeGridLines ()
 
virtual void setScale (double scale)
 
virtual void setObserverPosition (const DtVector &position)
 
virtual void setChannelDimensions (int startChannelX, int startChannelY, int endChannelX, int endChannelY)
 
virtual void setLatLonLabelsCenteringCutoff (double alt)
 
virtual void setMgrsMapSheetCutoff (double altitude)
 
virtual void setGarsPolarLatitudeCutoff (double lat)
 
- Public Member Functions inherited from makVrv::DtGridLinesDrawer
 DtGridLinesDrawer (DtDe &de)
 
 DtGridLinesDrawer (const DtGridLinesDrawer &orig)=delete
 
DtGridLinesDraweroperator= (const DtGridLinesDrawer &rhs)=delete
 
virtual ~DtGridLinesDrawer ()
 
virtual void setChannel (DtOsgChannel *channel)
 
virtual void setupOverlay ()
 
virtual void setupFont ()
 
virtual double lookupClosestLatLonSpacing (double minimumSpacingRadians)
 
virtual double lookupClosestCartesianSpacing (double minimumSpacing)
 
virtual double lookupClosestGarsSpacing (double minimumSpacing) const
 
void setPixelRatio (float pixelRatio)
 
- Public Member Functions inherited from makVrv::DtGridLinesParameters
 DtGridLinesParameters ()
 
virtual ~DtGridLinesParameters ()
 
 DtGridLinesParameters (const DtGridLinesParameters &orig)
 
DtGridLinesParametersoperator= (const DtGridLinesParameters &orig)
 
virtual void setGridType (makArchives::DtDisplayUnitsSettingsRecord::CoordSys gridType)
 
virtual void setUnitType (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits unitType)
 
virtual void setUnitType (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits unitType)
 
virtual void setMinimalGridlineLabelsEnabled (bool enabled)
 
virtual void setAutoSpacing (bool autoSpacing)
 
virtual void setMinSpacing (int pixels)
 
virtual void setFixedSpacingAmount (double amount)
 
virtual void setGarsFixedSpacing (double degs)
 
virtual void setMgrsMapSheetFixedSpacing (double meters)
 
virtual void setXOffset (double offset)
 
virtual void setYOffset (double offset)
 
virtual void setDecimalPlaces (unsigned decimalPlaces)
 
virtual void setMaxGridLines (int maxGridLines)
 
virtual void setMaxGridLineSegments (int maxGridLineSegments)
 
virtual void setEastWestGridLineColor (float r, float g, float b, float a)
 
virtual void setEastWestLabelColor (float r, float g, float b, float a)
 
virtual void setNorthSouthGridLineColor (float r, float g, float b, float a)
 
virtual void setNorthSouthLabelColor (float r, float g, float b, float a)
 
virtual void setLabelFont (const std::string &fontName)
 
virtual void setLabelPointSize (int pointSize)
 
virtual void setLabelXOffset (int pixels)
 
virtual void setLabelYOffset (int pixels)
 
virtual void setLabelTextWidth (int width)
 
virtual void setLabelTextHeight (int height)
 
virtual void setGridLineWidth (float width)
 
virtual void setLatLonLabelsCenteringCutoff (int altitude)
 

Protected Types

typedef std::vector
< DtLineSegment * > 
GridLine
 
typedef std::vector< GridLineGridLineVector
 
typedef std::vector
< DtTextProxy * > 
LabelArray
 
typedef boost::unordered_set
< DtUnicode
UsedGridLabels
 

Protected Member Functions

virtual void reloadTextFonts ()
 
virtual void reloadLabelFonts (std::vector< DtTextProxy * > &labels)
 
virtual void setupReferenceEllipsoid ()
 
virtual void setupTopoGeocTransforms ()
 
virtual bool pointVisible (const DtVector &point) const
 
virtual void findPolarSpacing ()
 
virtual void drawPolarLongitudeLines ()
 
virtual void drawPolarLatitudeLines ()
 
virtual void findLatLonWindowDimensions ()
 
virtual void findSpacing ()
 
virtual void anchorAndOffsetLines ()
 
virtual void drawLongitudeLines ()
 
virtual void drawLatitudeLines ()
 
virtual void createLabel (DtTextProxy *&label, double radians, bool isLongitude, double *endpoints)
 
virtual void destroyGridLines ()
 
virtual bool clip3D (const DtVector &pointA, const DtVector &pointB, DtVector &clippedA, DtVector &clippedB) const
 
virtual void clearUnusedLinesAndLabels (int index, GridLineVector &lines, LabelArray &labels)
 
virtual void clearUnusedSegments (int index, GridLine &line)
 
virtual void destroyLinesAndLabels (GridLineVector &lines, LabelArray &labels)
 
virtual void resizeLinesAndLabels (GridLineVector &lines, LabelArray &labels, int numLines)
 
virtual bool drawLineSegment (DtLineSegment *&segment, const DtVector &start, const DtVector &end, float *colorArray, double *endpoints=0, bool *pass3D=0)
 
virtual GridLinegetSegmentedLine (GridLineVector &lines, int index, int numSegments)
 
virtual SegmentStartsgetSegmentedLocator (SegmentLocator &lines, int index, int numSegments)
 
virtual void resizeLocators (SegmentLocator &locator, int numLines)
 
virtual void clearUnusedLocators (int index, SegmentLocator &locator)
 
virtual bool drawUtmLineSegment (GridLine &line, SegmentStarts &lineLocator, int segIndex, int zone, char hemisphere, double startEasting, double startNorthing, double endEasting, double endNorthing, bool constrainEasting=false)
 
virtual void findEastingLimits (double lat, double &minEasting, double &maxEasting)
 
virtual void drawEastWestMapSheetLines ()
 
virtual int drawEastWestMapSheetLineForUtmZone (GridLine &eastWestLine, SegmentStarts &lineLocator, int startSeg, int zone, char hemisphere, double northingLine, int zoneMapSheets, int numSegs, int numPartialSegs, double partialExtra)
 
virtual int drawEastWestZoneInterior (GridLine &eastWestLine, SegmentStarts &lineLocator, int startSeg, int utmZone, char hemisphere, double northingLine, int numSegs, int startEasting, int endEasting)
 
virtual void drawNorthSouthMapSheetLines ()
 
virtual int drawNorthSouthMapSheetLinesForUtmZone (int zone, double maxZoneWidth, int iLine)
 
virtual bool drawNorthSouthMapSheetLine (int utmZone, double eastingLine, int iLine)
 
virtual bool getGzdAndMapSheet (const DtVector &geocLoc, DtUnicode &gzd, DtUnicode &gzdAndMapSheet)
 
virtual void labelGridZones ()
 
virtual bool labelGarsGrid (double lonValue, double latValue, DtGarsPrecision precision, int labelIndex)
 
virtual void labelGarsGrids ()
 
virtual bool labelGridZoneDesignator (double lonValue, double latValue, int labelIndex)
 
virtual bool includeMgrsDesignator (double lonValue, double latValue, osg::Vec3 &screenPos, DtVector &geocResult)
 
virtual bool includeMgrsDesignator (double lonValue, double latValue, float screenPosX, float screenPosY, DtVector &geocResult)
 
virtual void createGridLineLabel (DtTextProxy *&label, double lat, double lon, float screenPosX, float screenPosY, bool isEasting)
 
virtual void labelMapSheetLines ()
 
virtual bool createMapSheetLabel (DtTextProxy *&label, double lat, double lon, float screenPosX, float screenPosY)
 
virtual DtFont::TextAlignment offsetGridBoxLabel (double xSrc, double ySrc, double &xOffset, double &yOffset, DtBoundingBox &bbox) const
 
- Protected Member Functions inherited from makVrv::DtGridLinesDrawer
virtual bool limitLines (int current, int limit)
 

Protected Attributes

GridLineVector myLongitudeLines
 
GridLineVector myLatitudeLines
 
LabelArray myLongitudeLabels
 
LabelArray myLatitudeLabels
 
double myLatSpacing
 
double myLonSpacing
 
double myScale
 
unsigned int myMinChannelDimension
 
unsigned int myChannelSize
 
DtVector myObserverPosition
 
double myObserverLatitude
 
double myObserverLongitude
 
double myObserverAltitude
 
int myChannelExpansionX
 
int myChannelExpansionY
 
DtVector myClipNormal
 
double myStartLat
 
double myEndLat
 
double myStartLon
 
double myEndLon
 
DtCoordTransform myGeocToTopoTransform
 
DtCoordTransform myTopoToGeocTransform
 
DtReferenceEllipsoid myReferenceEllipsoid
 
double myAnchoredStartLat
 
double myAnchoredEndLat
 
double myAnchoredStartLon
 
double myAnchoredEndLon
 
bool myLatCrossesPole
 
UsedGridLabels myUsedGzdLabels
 
UsedGridLabels myUsedMapSheetLabels
 
LabelArray myGzdLabels
 
LabelArray myMapSheetLabels
 
LabelArray myGarsGridLabels
 
GridLineVector myNorthSouthLines
 
SegmentLocator myNorthSouthSegmentLocator
 
GridLineVector myEastWestLines
 
SegmentLocator myEastWestSegmentLocator
 
LabelArray myNorthSouthLabels
 
LabelArray myEastWestLabels
 
int myMapSheetSpacing
 
double myAnchoredStartEasting
 
double myAnchoredStartNorthing
 
double myAnchoredEndEasting
 
double myAnchoredEndNorthing
 
double myAnchoredStartUtmZone
 
double myAnchoredEndUtmZone
 
char myAnchoredStartNorthingHemisphere
 
char myAnchoredEndNorthingHemisphere
 
bool myGarsCanDraw
 
- Protected Attributes inherited from makVrv::DtGridLinesDrawer
DtDemyDe
 
DtOsgChannelmyChannel
 
osg::Matrix myWorldToWindowMatrix
 
int myStartChannelX
 
int myStartChannelY
 
int myEndChannelX
 
int myEndChannelY
 
DtOverlayRenderermyOverlayRenderer
 
DtFontInterfacemyFont
 
float myPixelRatio
 
std::vector< doublemyLatLonAllowableSpacings
 
std::vector< doublemyCartesianAllowableSpacings
 
std::vector< doublemyGarsAllowableSpacings
 
bool myLineLimitNeedsWarning
 
- Protected Attributes inherited from makVrv::DtGridLinesParameters
makArchives::DtDisplayUnitsSettingsRecord::CoordSys myGridType
 
bool myUnitTypeIsAngular
 
makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits myUnitType
 
makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits myAngularUnitType
 
bool myMinimalGridlineLabelsEnabled
 
bool myAutoSpacing
 
int myMinSpacing
 
double mySpacing
 
double myXOffset
 
double myYOffset
 
unsigned myDecimalPlaces
 
int myMaxGridLines
 
int myMaxGridLineSegments
 
float myEastWestGridLineColor [4]
 
float myEastWestLabelColor [4]
 
float myNorthSouthGridLineColor [4]
 
float myNorthSouthLabelColor [4]
 
std::string myLabelFont
 
int myLabelPointSize
 
int myLabelXOffset
 
int myLabelYOffset
 
int myLabelTextWidth
 
int myLabelTextHeight
 
float myGridLineWidth
 
int myLatLonLabelsCenteringCutoff
 
double myMgrsMapSheetCutoff
 
double myGarsFixedSpacing
 
double myMgrsMapSheetFixedSpacing
 
double myGarsPolarLatitudeCutoff
 

Private Member Functions

 DtGeocentricGridLinesDrawer (const DtGeocentricGridLinesDrawer &orig)
 
DtGeocentricGridLinesDraweroperator= (const DtGeocentricGridLinesDrawer &rhs)
 
typedef std::vector< MgrsSegStartSegmentStarts
 
typedef std::vector
< SegmentStarts
SegmentLocator
 
virtual bool drawStandardLongitudeLine (GridLine &lonLine, double resolution, int numSegs, double curLon, int &curSeg, double *endpoints)
 
virtual bool drawNorwayMgrsLongitudeLine (GridLine &lonLine, double resolution, int numSegs, int &curSeg)
 
virtual bool drawSvalbardMgrsLongitudeLines (GridLine &lonLine, double resolution, int numSegs, double curLon, int &curSeg)
 
virtual void drawMapSheetLines ()
 
virtual void findMapSheetSpacing ()
 
virtual bool anchorMapSheetLines ()
 
virtual void clearUnusedLines (int index, GridLineVector &lines)
 
virtual void clearUnusedLabels (int index, LabelArray &labels)
 

Additional Inherited Members

- Static Protected Member Functions inherited from makVrv::DtGridLinesDrawer
static bool clip (double xMin, double xMax, double yMin, double yMax, double x0src, double y0src, double x1src, double y1src, double &x0clip, double &y0clip, double &x1clip, double &y1clip)
 

Member Typedef Documentation

The starting location of each mapsheet line segment drawn for one line.

A vector of SegmentStarts, one for each line drawn.

typedef boost::unordered_set<DtUnicode> makVrv::DtGeocentricGridLinesDrawer::UsedGridLabels
protected

Constructor & Destructor Documentation

makVrv::DtGeocentricGridLinesDrawer::DtGeocentricGridLinesDrawer ( DtDe de)

CTOR.

virtual makVrv::DtGeocentricGridLinesDrawer::~DtGeocentricGridLinesDrawer ( )
virtual

DTOR.

makVrv::DtGeocentricGridLinesDrawer::DtGeocentricGridLinesDrawer ( const DtGeocentricGridLinesDrawer orig)
private

Unimplemented Copy Constructor.

Member Function Documentation

virtual void makVrv::DtGeocentricGridLinesDrawer::drawGridLines ( )
virtual

Main entry point - draw the geocentric grid lines.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawPolarGridLines ( )
virtual

Called by drawGridLines if a pole is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawMidLatitudeGridLines ( )
virtual

Called by drawGridLines if a pole is not visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::setScale ( double  scale)
virtual

Set the current observer 2D scale.

virtual void makVrv::DtGeocentricGridLinesDrawer::setObserverPosition ( const DtVector &  position)
virtual

Set the observer position.

virtual void makVrv::DtGeocentricGridLinesDrawer::setChannelDimensions ( int  startChannelX,
int  startChannelY,
int  endChannelX,
int  endChannelY 
)
virtual

Override to set up expansion values.

Reimplemented from makVrv::DtGridLinesDrawer.

virtual void makVrv::DtGeocentricGridLinesDrawer::setLatLonLabelsCenteringCutoff ( double  alt)
virtual

Set the altitude at which we stop moving latidue and longitude labels to the center of the screen.

virtual void makVrv::DtGeocentricGridLinesDrawer::setMgrsMapSheetCutoff ( double  altitude)
virtual

Set the altitude at which we stop drawing MGRS map sheet lines/labels when using fixed spacing.

Reimplemented from makVrv::DtGridLinesParameters.

virtual void makVrv::DtGeocentricGridLinesDrawer::setGarsPolarLatitudeCutoff ( double  lat)
virtual

Set the latitude above which GARS grid lines are not drawn.

Reimplemented from makVrv::DtGridLinesParameters.

virtual void makVrv::DtGeocentricGridLinesDrawer::reloadTextFonts ( )
protectedvirtual

Reloads all text label fonts on runtime font size change.

Implements makVrv::DtGridLinesDrawer.

virtual void makVrv::DtGeocentricGridLinesDrawer::reloadLabelFonts ( std::vector< DtTextProxy * > &  labels)
protectedvirtual

Convenience function to reload text label fonts on one vector of labels.

virtual void makVrv::DtGeocentricGridLinesDrawer::setupReferenceEllipsoid ( )
protectedvirtual

Set up a reference ellipsoid for the current coordinate system that can be reused for all geodetic coordinate objects.

virtual void makVrv::DtGeocentricGridLinesDrawer::setupTopoGeocTransforms ( )
protectedvirtual

Set up transforms between Geocentric and geodetic coordinates.

virtual bool makVrv::DtGeocentricGridLinesDrawer::pointVisible ( const DtVector &  point) const
protectedvirtual

Determine if the geocentric point specified could be visible (ignoring the current observer orientation)

virtual void makVrv::DtGeocentricGridLinesDrawer::findPolarSpacing ( )
protectedvirtual

Determine the spacings to use when one of the poles is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawPolarLongitudeLines ( )
protectedvirtual

Draw the longitude lines when one of the poles is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawPolarLatitudeLines ( )
protectedvirtual

Draw the latitude lines when one of the poles is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::findLatLonWindowDimensions ( )
protectedvirtual

Find the range of longitude and latitude to draw lines over based on the window dimensions (and scale and observer position)

virtual void makVrv::DtGeocentricGridLinesDrawer::findSpacing ( )
protectedvirtual

Determine the spacings to use when neither pole is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::anchorAndOffsetLines ( )
protectedvirtual

find the correct starting point for longitude and latitude lines given the current spacing and offsets specified

virtual void makVrv::DtGeocentricGridLinesDrawer::drawLongitudeLines ( )
protectedvirtual

Draw the longitude lines when neither pole is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawLatitudeLines ( )
protectedvirtual

Draw the latitude lines when neither pole is visible.

virtual void makVrv::DtGeocentricGridLinesDrawer::createLabel ( DtTextProxy *&  label,
double  radians,
bool  isLongitude,
double endpoints 
)
protectedvirtual

Create a label. For MGRS mapsheets, isLongitude denotes north/south mapsheet line.

virtual void makVrv::DtGeocentricGridLinesDrawer::destroyGridLines ( )
protectedvirtual

Destroy all grid lines.

virtual bool makVrv::DtGeocentricGridLinesDrawer::clip3D ( const DtVector &  pointA,
const DtVector &  pointB,
DtVector &  clippedA,
DtVector &  clippedB 
) const
protectedvirtual

Returns false if A and B are beyond the clip plane. True if either/both are not, and returns correctly clipped values.

virtual void makVrv::DtGeocentricGridLinesDrawer::clearUnusedLinesAndLabels ( int  index,
GridLineVector lines,
LabelArray labels 
)
protectedvirtual

Deallocates all segments and labels for indices at and above the provided index in the provided GridLineVector.

virtual void makVrv::DtGeocentricGridLinesDrawer::clearUnusedSegments ( int  index,
GridLine line 
)
protectedvirtual

Deallocates all line segments at and above the provided index in the provided GridLine.

virtual void makVrv::DtGeocentricGridLinesDrawer::destroyLinesAndLabels ( GridLineVector lines,
LabelArray labels 
)
protectedvirtual

Deallocates all line segments and all labels in the GridLineVector and label arrays provided.

virtual void makVrv::DtGeocentricGridLinesDrawer::resizeLinesAndLabels ( GridLineVector lines,
LabelArray labels,
int  numLines 
)
protectedvirtual

Set the number of lines to draw in a frame Will resize /cleanup current memory allocations for lines and labels.

virtual bool makVrv::DtGeocentricGridLinesDrawer::drawLineSegment ( DtLineSegment *&  segment,
const DtVector &  start,
const DtVector &  end,
float *  colorArray,
double endpoints = 0,
bool pass3D = 0 
)
protectedvirtual

Draw a geocentric line segment, if its visible. Will create if necessary. If the caller wants to know if its 3D-clipped, provide pass3D. If endpoints is passed in, the screen position of the min start and max end of the line sgement drawn Effectively, when initialized before drawing the first segment of the line, once the full line is drawn it will hold the line endpoints (which are used for labeling).

virtual GridLine& makVrv::DtGeocentricGridLinesDrawer::getSegmentedLine ( GridLineVector lines,
int  index,
int  numSegments 
)
protectedvirtual

Returns the line from the line vector at the specified index with enough segment pointers allocated.

virtual bool makVrv::DtGeocentricGridLinesDrawer::drawStandardLongitudeLine ( GridLine lonLine,
double  resolution,
int  numSegs,
double  curLon,
int curSeg,
double endpoints 
)
protectedvirtual

These routines are for the MGRS in geocentric implementation. We use the existing latitude/logitude-drawing infrastructure (with a few small changes) to draw the Grid Zone lines (which are 6 degrees longitude X 8 degrees latitude, except for northern-most grid zone, which is 12 degrees in latitude). The standard latitude/longitude labels are disabled, and instead a separate pass is made to label all the grid zones with a grid zone designator. The map sheets are then drawn using UTM to determine the lines (and converting the UTM coordinates to geocentric to actually drawn the line segments. A lot of the code is about deciding how many lines (and how many line segments) should be allocate and attempted. The idea here is to attempt to draw all the lines we will need, assuming some with be off-screen and ignored, but not try to draw too many lines for efficiency sakes. So we try to determine 'worst case' lines/segments, and allocate and (attempt to) draw just that. N.B. The UTM-geodetic conversion routines all use False Easting for eastings, and False Northing in the southern hemisphere.

Draw longitudinal lines (including for MGRS grid zones) that don't require special cases This method has been extracted from the original drawLongitudeLines() so that we can more easily separate out the special cases in MGRS (around Norway and Svalbard).

virtual bool makVrv::DtGeocentricGridLinesDrawer::drawNorwayMgrsLongitudeLine ( GridLine lonLine,
double  resolution,
int  numSegs,
int curSeg 
)
protectedvirtual

Draw the longitudinal line for the special case in southern Norway for MGRS This method is used when drawing the 6 degree east line in MGRS. It moves the line from 6 degrees to 3 degrees between 56 and 64 degrees north. It also stops drawing the line north of 72 degrees (for the modified Svalbard-related grid zones.

virtual bool makVrv::DtGeocentricGridLinesDrawer::drawSvalbardMgrsLongitudeLines ( GridLine lonLine,
double  resolution,
int  numSegs,
double  curLon,
int curSeg 
)
protectedvirtual

Draw the longitudinal lines for the special cases around Svalbard (north of 72 degrees latitude) This method is used with MGRS to draw the longitude lines that need to be modified for the Svalbard area (except 6 degrees east, which is already taken care of by drawNorwayMgrsLongitudeLine()). It stops drawing longitude lines north of 72 degrees for longitudes 18, and 30; and moves 12, 24, and 36 west to 9, 21, and 33 at that latitude.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawMapSheetLines ( )
protectedvirtual

Draw the UTM-based mapsheet lines. This just calls drawEastWestLines() and drawNorthSouthLines()

virtual void makVrv::DtGeocentricGridLinesDrawer::findMapSheetSpacing ( )
protectedvirtual

Determine the spacing between map sheet grid lines. In MGRS, grid lines are multiples of 10, and can go from 1 meter up to 100,000 meters. findMapSheetSpacing() uses the current reslution and grid spacing specified to choose the smallest spacing that won't draw grid lines closer than the specified minimum spacing. An exception is made if the result means there might not be at least one line in either dimension on the screen. In that case we drop to the next smallest spacing.

virtual bool makVrv::DtGeocentricGridLinesDrawer::anchorMapSheetLines ( )
protectedvirtual

Determine the start and end northing and easting lines and UTM zones. We start with the min and max latitude and latitude for the current view calculated by findLatLonWindowDimensions(). We convert these to northing and easting (and find the start/end utm zones for the longitudes. Note that UTM Zone anchors are always increasing (to make iteration easier) and therefore may be larger than actually possible. Code that actually needs to convert to geodetic using the UTM zone will check for zones > 60 and subtract.

virtual void makVrv::DtGeocentricGridLinesDrawer::clearUnusedLines ( int  index,
GridLineVector lines 
)
protectedvirtual

Same as clearUnusedLinesAndLabels(), but just for lines.

virtual void makVrv::DtGeocentricGridLinesDrawer::clearUnusedLabels ( int  index,
LabelArray labels 
)
protectedvirtual

Same as clearUnusedLinesAndLabels(), but just the labels.

virtual SegmentStarts& makVrv::DtGeocentricGridLinesDrawer::getSegmentedLocator ( SegmentLocator lines,
int  index,
int  numSegments 
)
protectedvirtual

The mirror equivalent of getSegmentedLine() for locators.

virtual void makVrv::DtGeocentricGridLinesDrawer::resizeLocators ( SegmentLocator locator,
int  numLines 
)
protectedvirtual

The mirror equivalent of resizeLinesAndLabels() for locators (without the labels)

virtual void makVrv::DtGeocentricGridLinesDrawer::clearUnusedLocators ( int  index,
SegmentLocator locator 
)
protectedvirtual

The mirror equivalent of clearUnusedLines() for locators.

virtual bool makVrv::DtGeocentricGridLinesDrawer::drawUtmLineSegment ( GridLine line,
SegmentStarts lineLocator,
int  segIndex,
int  zone,
char  hemisphere,
double  startEasting,
double  startNorthing,
double  endEasting,
double  endNorthing,
bool  constrainEasting = false 
)
protectedvirtual

Draw a single line segment given a UTM zone, hemisphere and start/end northing and easting values In addition to drawing the segment it also fills in the locator for the segment's start. It uses the underlying drawLineSegment() method, which may clip the segment or determine that the segment isn't on the screen. If constrainEasting is true, than the width of the UTM zone at the specified latitude is calculated using findEastingLimits(), and if the either easting value is outside of the zone, no segment is drawn. returns true if it draws the segment, false otherwise.

virtual void makVrv::DtGeocentricGridLinesDrawer::findEastingLimits ( double  lat,
double minEasting,
double maxEasting 
)
protectedvirtual

find the minimum and maximum easting that falls within any utm zone at the latitude specified

virtual void makVrv::DtGeocentricGridLinesDrawer::drawEastWestMapSheetLines ( )
protectedvirtual

Methods for drawing MGRS northing (east-west) lines.

Draw all the horizontal east-west lines drawEastWestMapSheetLines calculates the maximum number of lines that will be needed using the anchored start and end eastings. It then iterates through those lines, calculating the worst case number of segments needed for that line based its latitude and the map spacing chosen, and allocates those lines / segments. It then iterates through each utm zone, drawing the part of that northing line that appears in that zone, by calling drawEastWestMapSheetLineForUtmZone(). If a line is drawn, it calls createGridLineLabel() to label the line. Finally, it clears any unused lines, segments, and grid line labels.

virtual int makVrv::DtGeocentricGridLinesDrawer::drawEastWestMapSheetLineForUtmZone ( GridLine eastWestLine,
SegmentStarts lineLocator,
int  startSeg,
int  zone,
char  hemisphere,
double  northingLine,
int  zoneMapSheets,
int  numSegs,
int  numPartialSegs,
double  partialExtra 
)
protectedvirtual

Because a utm zone will usually contain some number of map sheeting spacing sized segments plus some extra (partial segment) on either side, this method has to account for four different cases. First is if the entirety of the lines to be drawn is in this one utm zone. Then just drawEastWestZoneInterior() can be called. Second is if the zone is the first of multiple zones; third is if it is the last of multiple zones; and fourth if it is a full zone between starting and ending zones. In the 2nd through 4th cases, partial segments need to be drawn on side or the other (or both) of the call to drawEastWestZoneInterior. Returns the number of segments actually drawn.

virtual int makVrv::DtGeocentricGridLinesDrawer::drawEastWestZoneInterior ( GridLine eastWestLine,
SegmentStarts lineLocator,
int  startSeg,
int  utmZone,
char  hemisphere,
double  northingLine,
int  numSegs,
int  startEasting,
int  endEasting 
)
protectedvirtual

By interior, we mean the segments of the line that are a full mapSheet spacing long. This simply iterates from startEasting to endEasting at the northing latitude drawing segments (and tagging segment locators). Returns number of segments drawn.

virtual void makVrv::DtGeocentricGridLinesDrawer::drawNorthSouthMapSheetLines ( )
protectedvirtual

Methods for drawing easting (north-south) lines.

Draw all the easting (north-south) lines This method calculates the maximum number of easting lines that could be drawn given our map sheet spacing, the number of utm zones spanned, and the width of a zone at our worst case latitude; and then allocates enough lines, labels and segment start locator vectors. It then iterates from myAnchoredStartUtmZone to myAnchoredEndUtmZone, calling drawNorthSouthMapSheetLinesForUtmZone(). Unused lines, labels, and locators are cleared.

virtual int makVrv::DtGeocentricGridLinesDrawer::drawNorthSouthMapSheetLinesForUtmZone ( int  zone,
double  maxZoneWidth,
int  iLine 
)
protectedvirtual

Draw all the easting lines for one UTM zone. This method calculates the worst case number of lines that could be in the zone based on myAnchoredStartEasting, myAnchoredEndEasting, the max zone width and the type of zone (see the four cases described in drawEastWestMapSheetLineForUtmZone). It then iterates through the easting lines calling drawNorthSouthMapSheetLine(). Returns the number of lines drawn.

virtual bool makVrv::DtGeocentricGridLinesDrawer::drawNorthSouthMapSheetLine ( int  utmZone,
double  eastingLine,
int  iLine 
)
protectedvirtual

Draw a single easting (north-south) line. If the start and end northings are all in the same hemisphere, this method just iterates from myAnchoredStartNorthing to myAnchoredEndNorthing calculating the max number segments needed for each line and calling drawUtmLineSegment(); and then labels the line if drawn. However if the anchors are in different hemispheres then the segments for each hemisphere get drawn separately, first iterating from myAnchoredStartNorthing to the equator and then from the equator to myAnchoredEndNorthing. All unused segments are cleared. Returns true if a line was drawn.

virtual bool makVrv::DtGeocentricGridLinesDrawer::getGzdAndMapSheet ( const DtVector &  geocLoc,
DtUnicode gzd,
DtUnicode gzdAndMapSheet 
)
protectedvirtual

Methods for labeling MGRS lines, mapsheets, and grid zone designators.

All the label text is retrieved from the DtMgrsCoordinateDisplay instance, which will be retrieved when we request a display instance based on our gridtype of DtDisplayUnitsSettingsRecord::CoordSysMgrs. There are three primary display methods called - northSouthGridLabel(), eastWestGridLabel(), and gridBoxLabel(). The first two are for the numeric grid line labels; the third retrieves the grid zone designator (gzd) and the mapsheet. They come as a single string, xxA:AA (for example, 04N:BC) This utility grabs the grid box string, grabs the gzd as a separate string (and strips off the trailing 0, if any) and returns that and the original string (through the parameter list). The method returns true if strings are returned, false otherwise

virtual void makVrv::DtGeocentricGridLinesDrawer::labelGridZones ( )
protectedvirtual

Label the grid zones When using the MGRS grid type, the standard degree labels are not applied to the 6 degree by 8 degree grid created by drawLatitudeLines() and drawLongitudeLines(). Instead, we lable the grid zones as boxes with the label in the southwest corner. This method iterates from from start to end anchored lon, and for each longitude from start to end anchored latitude, calling labelGridZoneDesignator() for each lat/lon.

virtual bool makVrv::DtGeocentricGridLinesDrawer::labelGarsGrid ( double  lonValue,
double  latValue,
DtGarsPrecision  precision,
int  labelIndex 
)
protectedvirtual

Create a GARS grid box label and add to the array of GARS labels.

virtual void makVrv::DtGeocentricGridLinesDrawer::labelGarsGrids ( )
protectedvirtual

Iterate through all the lon/lat box corners, calling labelGarsGrid.

virtual bool makVrv::DtGeocentricGridLinesDrawer::labelGridZoneDesignator ( double  lonValue,
double  latValue,
int  labelIndex 
)
protectedvirtual

label a grid zone box with its designator This method gets the GZD for the supplied lat/lon and creates a label if the GZD is not already on the screen. Returns true if the label is drawn.

virtual bool makVrv::DtGeocentricGridLinesDrawer::includeMgrsDesignator ( double  lonValue,
double  latValue,
osg::Vec3 &  screenPos,
DtVector &  geocResult 
)
protectedvirtual

Check to see if an MGRS label should be drawn This method checks to make sure that the label would be on the screen and not on the other side of the world from where we are looking. Returns true if the label should be shown; and returns the point in geocentric and screen coordinates.

virtual bool makVrv::DtGeocentricGridLinesDrawer::includeMgrsDesignator ( double  lonValue,
double  latValue,
float  screenPosX,
float  screenPosY,
DtVector &  geocResult 
)
protectedvirtual

Check to see if an MGRS label should be drawn Same as above, but takes the screen pos in instead of calculating and returning it.

virtual void makVrv::DtGeocentricGridLinesDrawer::createGridLineLabel ( DtTextProxy *&  label,
double  lat,
double  lon,
float  screenPosX,
float  screenPosY,
bool  isEasting 
)
protectedvirtual

Draw a label for a grid line For north-south lines, this will simply be the numeric 1-5 digit MGRS grid value (or "" if spacing is 100,000m). For east-west lines, it will prepend the grid zone (if not already on the screen) and the map sheet (if not already on the screen). Note that map sheets CAN be duplicated, but not within the same grid zone.

virtual void makVrv::DtGeocentricGridLinesDrawer::labelMapSheetLines ( )
protectedvirtual

Label all (unlabeled) map sheets Map sheets may be labeled as part of a grid line label (e.g., ES500). This method will label any other map sheets on the screen that aren't already labeled through an existing grid line. It does so by walking through the segment start locators for each segment of each east-west line and calling createMapSheetLabel() (which will check to see if the map sheet is already labeled.

virtual bool makVrv::DtGeocentricGridLinesDrawer::createMapSheetLabel ( DtTextProxy *&  label,
double  lat,
double  lon,
float  screenPosX,
float  screenPosY 
)
protectedvirtual

Draw a label for a map sheet When called, this method will get the gzd and map sheet for the lat/lon specified. If the GZD for this map sheet is already on the screen but the map sheet is not, just the map sheet will be drawn. If neither are on the screen, both will be drawn. If a label is drawn, the method returns true.

virtual DtFont::TextAlignment makVrv::DtGeocentricGridLinesDrawer::offsetGridBoxLabel ( double  xSrc,
double  ySrc,
double xOffset,
double yOffset,
DtBoundingBox bbox 
) const
protectedvirtual

Find the offset and alignment for a grid box label This method sets up an appropriate bound box and offsets screen positions for drawing grid zone labels.

DtGeocentricGridLinesDrawer& makVrv::DtGeocentricGridLinesDrawer::operator= ( const DtGeocentricGridLinesDrawer rhs)
private

Unimplemented assignment operator.

Member Data Documentation

GridLineVector makVrv::DtGeocentricGridLinesDrawer::myLongitudeLines
protected
GridLineVector makVrv::DtGeocentricGridLinesDrawer::myLatitudeLines
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myLongitudeLabels
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myLatitudeLabels
protected
double makVrv::DtGeocentricGridLinesDrawer::myLatSpacing
protected
double makVrv::DtGeocentricGridLinesDrawer::myLonSpacing
protected
double makVrv::DtGeocentricGridLinesDrawer::myScale
protected
unsigned int makVrv::DtGeocentricGridLinesDrawer::myMinChannelDimension
protected
unsigned int makVrv::DtGeocentricGridLinesDrawer::myChannelSize
protected
DtVector makVrv::DtGeocentricGridLinesDrawer::myObserverPosition
protected
double makVrv::DtGeocentricGridLinesDrawer::myObserverLatitude
protected
double makVrv::DtGeocentricGridLinesDrawer::myObserverLongitude
protected
double makVrv::DtGeocentricGridLinesDrawer::myObserverAltitude
protected
int makVrv::DtGeocentricGridLinesDrawer::myChannelExpansionX
protected
int makVrv::DtGeocentricGridLinesDrawer::myChannelExpansionY
protected
DtVector makVrv::DtGeocentricGridLinesDrawer::myClipNormal
protected
double makVrv::DtGeocentricGridLinesDrawer::myStartLat
protected
double makVrv::DtGeocentricGridLinesDrawer::myEndLat
protected
double makVrv::DtGeocentricGridLinesDrawer::myStartLon
protected
double makVrv::DtGeocentricGridLinesDrawer::myEndLon
protected
DtCoordTransform makVrv::DtGeocentricGridLinesDrawer::myGeocToTopoTransform
protected
DtCoordTransform makVrv::DtGeocentricGridLinesDrawer::myTopoToGeocTransform
protected
DtReferenceEllipsoid makVrv::DtGeocentricGridLinesDrawer::myReferenceEllipsoid
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredStartLat
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredEndLat
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredStartLon
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredEndLon
protected
bool makVrv::DtGeocentricGridLinesDrawer::myLatCrossesPole
protected
UsedGridLabels makVrv::DtGeocentricGridLinesDrawer::myUsedGzdLabels
protected
UsedGridLabels makVrv::DtGeocentricGridLinesDrawer::myUsedMapSheetLabels
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myGzdLabels
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myMapSheetLabels
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myGarsGridLabels
protected
GridLineVector makVrv::DtGeocentricGridLinesDrawer::myNorthSouthLines
protected
SegmentLocator makVrv::DtGeocentricGridLinesDrawer::myNorthSouthSegmentLocator
protected
GridLineVector makVrv::DtGeocentricGridLinesDrawer::myEastWestLines
protected
SegmentLocator makVrv::DtGeocentricGridLinesDrawer::myEastWestSegmentLocator
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myNorthSouthLabels
protected
LabelArray makVrv::DtGeocentricGridLinesDrawer::myEastWestLabels
protected
int makVrv::DtGeocentricGridLinesDrawer::myMapSheetSpacing
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredStartEasting
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredStartNorthing
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredEndEasting
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredEndNorthing
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredStartUtmZone
protected
double makVrv::DtGeocentricGridLinesDrawer::myAnchoredEndUtmZone
protected
char makVrv::DtGeocentricGridLinesDrawer::myAnchoredStartNorthingHemisphere
protected
char makVrv::DtGeocentricGridLinesDrawer::myAnchoredEndNorthingHemisphere
protected
bool makVrv::DtGeocentricGridLinesDrawer::myGarsCanDraw
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)