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 Member Functions | Protected Attributes
makVrv::DtModelMergerCell Class Reference

2D Quad tree based on lat/lon, splits when a max model count is reached

Classes

struct  GroupedModelInfo
 
struct  ModelInfo
 

Public Member Functions

 DtModelMergerCell (double lat, double lon, double maxLat, double maxLon, double alt, int lod, DtCoordinateSystem &coordinateSystem, osg::ref_ptr< osgEarth::SpatialReference > wgs84)
 
virtual ~DtModelMergerCell ()
 
virtual bool addModel (ModelInfo &model)
 
virtual std::array
< DtModelMergerCell *, 4 > & 
subCells ()
 
virtual std::vector< ModelInfo > & models ()
 
virtual osg::ref_ptr< osg::Group > modelsGroupNode ()
 
virtual osg::ref_ptr
< osg::MatrixTransform > 
cellTransform ()
 
virtual void setCacheDirectory (std::string &cacheDir)
 
virtual void setMappingsCacheDirectory (std::string &mappingsDir)
 
virtual void setLatLonLodString (std::string &str)
 
virtual const std::string & cacheDirectory () const
 
virtual void runDiskWriteOps ()
 
virtual void setOverwrite (bool overwrite)
 
virtual void setIsRootCell (bool isRoot)
 
virtual void setMappingsMap (std::unordered_map< std::string, std::string > *map)
 
virtual void setInfosMap (std::unordered_map< std::string, GroupedModelInfo > *map)
 
virtual void setDbOptions (osg::ref_ptr< osgDB::Options > options)
 
virtual void printMinCellStats ()
 
virtual void setMaxModelCount (size_t count)
 
virtual size_t maxModelCount () const
 
virtual void setMinimumCellSize (double size)
 
virtual double mimimumCellSize () const
 
virtual double lat () const
 
virtual double lon () const
 
virtual double maxLat () const
 
virtual double maxLon () const
 
virtual double alt () const
 
virtual int lod () const
 

Protected Member Functions

virtual void initCellCoordinates ()
 
virtual void createSubCells ()
 
virtual bool isPointInCell (const osg::Vec2d &point)
 
virtual void buildTransformForCell ()
 
virtual void writeModelsGroupNodeToDisk ()
 
virtual void writeGroupedModelInfosToDisk ()
 
virtual void writeMappingsToDisk ()
 
virtual void runOptimisationsOnNode (osg::ref_ptr< osg::Group > group)
 

Protected Attributes

double myLat
 
double myLon
 
double myMaxLat
 
double myMaxLon
 
double myAlt
 
double myMinSize
 
int myLod
 
bool mySubCellsCreated
 
bool myBeenVisualised
 
bool myOverwrite
 
bool myIsRootCell
 
bool myIsMinSize
 
std::array< DtModelMergerCell *, 4 > mySubCells
 
osg::ref_ptr
< osgEarth::SpatialReference > 
myWgs84
 
DtCoordinateSystemmyCoordinateSystem
 
DtGeoReference myShapeFileGeoRef
 
std::vector< osg::Vec2 > myCellCoordinates
 
osg::Vec2 myCellSizeInMetres
 
std::vector< ModelInfomyModels
 
osg::ref_ptr< osg::Group > myModelsGroupNode
 
osg::ref_ptr
< osg::MatrixTransform > 
myCellTransform
 
size_t myMaxModelCount
 
std::string myCacheDirectory
 
std::string myMappingsCacheDirectory
 
std::string myLatLonLodString
 
std::unordered_map
< std::string, std::string > * 
myDatabaseFileToGroupNodeFileMap
 
std::unordered_map
< std::string,
GroupedModelInfo > * 
myGroupedModelToInfoMap
 
osg::ref_ptr< osgDB::Options > myDbOptions
 

Constructor & Destructor Documentation

makVrv::DtModelMergerCell::DtModelMergerCell ( double  lat,
double  lon,
double  maxLat,
double  maxLon,
double  alt,
int  lod,
DtCoordinateSystem coordinateSystem,
osg::ref_ptr< osgEarth::SpatialReference >  wgs84 
)

CTOR.

virtual makVrv::DtModelMergerCell::~DtModelMergerCell ( )
virtual

DTOR.

Member Function Documentation

virtual bool makVrv::DtModelMergerCell::addModel ( ModelInfo model)
virtual

Add a model to the cell, creates subcells and places current models in sub cells if sub cells are created.

virtual void makVrv::DtModelMergerCell::setMaxModelCount ( size_t  count)
virtual

Set / Get the max model count. Cell creates four sub cells when max count is hit. Default 50.

virtual size_t makVrv::DtModelMergerCell::maxModelCount ( ) const
virtual

Set / Get the max model count. Cell creates four sub cells when max count is hit. Default 50.

virtual void makVrv::DtModelMergerCell::setMinimumCellSize ( double  size)
virtual

Set / Get the minumim cell size, won't subdivide once reached Default 200m The minimum cell size is set in metres, it is the in param squared, size * size A minimum size is required to stop the quad tree subdividing infinitely based on the max model count. As the quad tree splits on lat lon degrees, the tree can get into a state where myLat == myMaxLat, and therefore has a size of zero, model locations will not pass DtModelMergerCell::isPointInCell for cell size of zero. The size of the cell is calculated in topo metres from the centre of the cell, and compared against myMinSize.

virtual double makVrv::DtModelMergerCell::mimimumCellSize ( ) const
virtual

Set / Get the minumim cell size, won't subdivide once reached Default 200m The minimum cell size is set in metres, it is the in param squared, size * size A minimum size is required to stop the quad tree subdividing infinitely based on the max model count. As the quad tree splits on lat lon degrees, the tree can get into a state where myLat == myMaxLat, and therefore has a size of zero, model locations will not pass DtModelMergerCell::isPointInCell for cell size of zero. The size of the cell is calculated in topo metres from the centre of the cell, and compared against myMinSize.

virtual double makVrv::DtModelMergerCell::lat ( ) const
virtual

Getters for cell coordinates.

virtual double makVrv::DtModelMergerCell::lon ( ) const
virtual

Getters for cell coordinates.

virtual double makVrv::DtModelMergerCell::maxLat ( ) const
virtual

Getters for cell coordinates.

virtual double makVrv::DtModelMergerCell::maxLon ( ) const
virtual

Getters for cell coordinates.

virtual double makVrv::DtModelMergerCell::alt ( ) const
virtual

Getters for cell coordinates.

virtual int makVrv::DtModelMergerCell::lod ( ) const
virtual

Getters for cell coordinates.

virtual std::array< DtModelMergerCell*, 4>& makVrv::DtModelMergerCell::subCells ( )
virtual
virtual std::vector<ModelInfo>& makVrv::DtModelMergerCell::models ( )
virtual
virtual osg::ref_ptr< osg::Group > makVrv::DtModelMergerCell::modelsGroupNode ( )
virtual
virtual osg::ref_ptr<osg::MatrixTransform> makVrv::DtModelMergerCell::cellTransform ( )
virtual
virtual void makVrv::DtModelMergerCell::setCacheDirectory ( std::string &  cacheDir)
virtual
virtual void makVrv::DtModelMergerCell::setMappingsCacheDirectory ( std::string &  mappingsDir)
virtual
virtual void makVrv::DtModelMergerCell::setLatLonLodString ( std::string &  str)
virtual
virtual const std::string& makVrv::DtModelMergerCell::cacheDirectory ( ) const
virtual
virtual void makVrv::DtModelMergerCell::runDiskWriteOps ( )
virtual

Write grouped models to disk, including mappings, and info files calls writeGroupedModelInfosToDisk.

virtual void makVrv::DtModelMergerCell::setOverwrite ( bool  overwrite)
virtual

Set whether new grouped medfs should overwrite those on disk.

virtual void makVrv::DtModelMergerCell::setIsRootCell ( bool  isRoot)
virtual

If this cell is the root cell create the mappings maps Sets myRootCell.

virtual void makVrv::DtModelMergerCell::setMappingsMap ( std::unordered_map< std::string, std::string > *  map)
virtual

Set by root cell.

virtual void makVrv::DtModelMergerCell::setInfosMap ( std::unordered_map< std::string, GroupedModelInfo > *  map)
virtual
virtual void makVrv::DtModelMergerCell::setDbOptions ( osg::ref_ptr< osgDB::Options >  options)
virtual
virtual void makVrv::DtModelMergerCell::printMinCellStats ( )
virtual

Info method, prints info about the cell if it is min size cell Size, number of models, etc.

virtual void makVrv::DtModelMergerCell::initCellCoordinates ( )
protectedvirtual

Create cell based on constructor supplied lat/lon.

virtual void makVrv::DtModelMergerCell::createSubCells ( )
protectedvirtual

Create four DtModelMergerCell subcells.

virtual bool makVrv::DtModelMergerCell::isPointInCell ( const osg::Vec2d &  point)
protectedvirtual

Check if point is inside cell.

virtual void makVrv::DtModelMergerCell::buildTransformForCell ( )
protectedvirtual

Creat the global myCellTransform based on the lat lon alt.

virtual void makVrv::DtModelMergerCell::writeModelsGroupNodeToDisk ( )
protectedvirtual
virtual void makVrv::DtModelMergerCell::writeGroupedModelInfosToDisk ( )
protectedvirtual

Write grouped model info to disk.

virtual void makVrv::DtModelMergerCell::writeMappingsToDisk ( )
protectedvirtual

Write myDatabaseFileToGroupNodeFileMap to disk Only root cell writes.

virtual void makVrv::DtModelMergerCell::runOptimisationsOnNode ( osg::ref_ptr< osg::Group >  group)
protectedvirtual

Attempt to optimise the in param group node.

Member Data Documentation

double makVrv::DtModelMergerCell::myLat
protected
double makVrv::DtModelMergerCell::myLon
protected
double makVrv::DtModelMergerCell::myMaxLat
protected
double makVrv::DtModelMergerCell::myMaxLon
protected
double makVrv::DtModelMergerCell::myAlt
protected
double makVrv::DtModelMergerCell::myMinSize
protected

Minimum size that the cell can be in metres, x and y Default 200.

int makVrv::DtModelMergerCell::myLod
protected
bool makVrv::DtModelMergerCell::mySubCellsCreated
protected
bool makVrv::DtModelMergerCell::myBeenVisualised
protected
bool makVrv::DtModelMergerCell::myOverwrite
protected
bool makVrv::DtModelMergerCell::myIsRootCell
protected
bool makVrv::DtModelMergerCell::myIsMinSize
protected
std::array< DtModelMergerCell*, 4> makVrv::DtModelMergerCell::mySubCells
protected
osg::ref_ptr< osgEarth::SpatialReference > makVrv::DtModelMergerCell::myWgs84
protected
DtCoordinateSystem& makVrv::DtModelMergerCell::myCoordinateSystem
protected
DtGeoReference makVrv::DtModelMergerCell::myShapeFileGeoRef
protected
std::vector<osg::Vec2> makVrv::DtModelMergerCell::myCellCoordinates
protected

Lat Lon degrees.

osg::Vec2 makVrv::DtModelMergerCell::myCellSizeInMetres
protected
std::vector<ModelInfo> makVrv::DtModelMergerCell::myModels
protected
osg::ref_ptr< osg::Group > makVrv::DtModelMergerCell::myModelsGroupNode
protected
osg::ref_ptr<osg::MatrixTransform> makVrv::DtModelMergerCell::myCellTransform
protected
size_t makVrv::DtModelMergerCell::myMaxModelCount
protected
std::string makVrv::DtModelMergerCell::myCacheDirectory
protected
std::string makVrv::DtModelMergerCell::myMappingsCacheDirectory
protected
std::string makVrv::DtModelMergerCell::myLatLonLodString
protected
std::unordered_map<std::string, std::string>* makVrv::DtModelMergerCell::myDatabaseFileToGroupNodeFileMap
protected
std::unordered_map<std::string, GroupedModelInfo>* makVrv::DtModelMergerCell::myGroupedModelToInfoMap
protected
osg::ref_ptr<osgDB::Options> makVrv::DtModelMergerCell::myDbOptions
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)