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

This class will allow for the addition of features and their geometry for inclusion into the collision world. Basic assumptions as to soil type will be made in that if it is below 0 it will be considered a water surface and above ground a hard packed surface. Each area will be transformed into it's own collision object. Point objects will be gatherd up and once the convertToGeometry routine is called, they will be triangulated and transformed into polygons.

Classes

struct  AreaInformation
 
struct  LandArea
 
struct  LastIntersection
 

Public Types

enum  QueryType { QUERY_DEFAULT = 0, POINT_SELECT = 1, AREA_SELECT = 2, SURFACE_SELECT = 3 }
 
typedef std::pair< std::string,
QueryType
Query
 
typedef std::map< std::string,
Query
Queries
 

Public Member Functions

 DtFeatureToGeometryConverter ()
 
virtual ~DtFeatureToGeometryConverter ()
 
virtual void convertToGeometry (const DtPoint &pnt, const DtTerrainImplementation *, DtCollisionWorld *)
 
virtual void reset ()
 
virtual void addQuery (const std::string &key, const std::string &value, QueryType=QUERY_DEFAULT)
 
virtual std::string addQuery (const std::string &value, QueryType=QUERY_DEFAULT)
 
std::string addQueryByAreaSelect (const std::string &value)
 
std::string addQueryByPointSelect (const std::string &value)
 
virtual void removeQuery (const std::string &key)
 
virtual const Queriesqueries () const
 
virtual bool determineSurfaceType (const DtPoint &, const DtTerrainImplementation *fc, const std::string &query, DtSurface &surface)
 
virtual bool hasSurface (const MAKVRinTerra::DtFeatureGeometry &, DtSurface &)
 
virtual void setSeaLevel (double)
 
virtual double seaLevel () const
 
virtual DtCollisionWorldcollisionWorld ()
 

Protected Types

typedef std::pair
< MAKVRinTerra::DtFeatureGeometry,
DtSurface
SurfaceDefinition
 
typedef std::vector
< SurfaceDefinition
Surfaces
 
typedef std::vector
< AreaInformation
AreasCovered
 
typedef std::vector< LandAreaLandAreas
 
typedef boost::ptr_map
< std::string,
MAKVRinTerra::DtFeatureSet
SavedQueries
 

Protected Member Functions

virtual void addForConversion (const MAKVRinTerra::DtFeature &, const DtTerrainImplementation *fc, DtCollisionWorld *c)
 
virtual bool generateIntersection (const DtPoint &, const DtTerrainImplementation *fc, QueryType, MAKVRinTerra::DtFeatureGeometry &coverageArea, MAKVRinTerra::DtFeatureGeometry &returnGeometry)
 
virtual bool shouldIntersectWith (const DtPoint &, const DtTerrainImplementation *, MAKVRinTerra::DtFeatureGeometry &, QueryType, const std::string &query, bool &firstTime, AreasCovered::iterator &)
 
virtual void createGeometryFromPoints (const DtTerrainImplementation *, DtCollisionWorld *, const std::vector< MAKVRinTerra::DtFeatureGeometry > &) const
 
virtual void createGeometryFromAreas (const DtTerrainImplementation *, DtCollisionWorld *, const MAKVRinTerra::DtFeatureGeometry &) const
 
virtual void createGeometry (const std::vector< MAKVRinTerra::DtFeatureGeometry > &, const DtSurface &, const DtTerrainImplementation *, DtCollisionWorld *, bool triangulate) const
 
virtual bool shouldAddAsSurface (const MAKVRinTerra::DtFeature &, DtSurface &surface) const
 
virtual void addNewSurfaceGeometries (const Surfaces &, const DtTerrainImplementation *fc, const std::string &query)
 
virtual bool noIntersectionFound (const MAKVRinTerra::DtFeatureGeometry &, DtSurface &) const
 
virtual std::auto_ptr
< MAKVRinTerra::DtFeatureSet
createOrReturnSavedQuery (const DtTerrainImplementation *fc, std::string query, bool readDirectly=false)
 
virtual void coverageArea (const MAKVRinTerra::DtFeature &feature)
 
virtual void addAreaCovered (const MAKVRinTerra::DtFeatureGeometry &geom, const std::string &query, int retries=0)
 
virtual AreaInformation createAreaInfo (const MAKVRinTerra::DtFeatureGeometry &geom, const std::string &query, int retries=0) const
 
virtual void updateLastIntersection (const DtPoint &, bool valid, const DtSurface &surface)
 

Protected Attributes

std::vector
< MAKVRinTerra::DtFeatureGeometry
myPointFeatures
 
Queries myQueries
 
std::vector< std::string > myQueryStringList
 
Surfaces myNewSurfaces
 
LandAreas myLandAreas
 
LastIntersection myLastIntersection
 
double mySeaLevel
 
SavedQueries mySavedQueries
 
AreasCovered myAreasCovered
 
AreasCovered myCoverageAreas
 
MAKVRinTerra::DtFeatureGeometry myIntersectArea
 
DtCollisionWorldmyCollisionWorld
 
bool myCoverageAreasInitialized
 
DtThreadedTriangulatormyThreadedGeometryTriangulator
 
DtThreadedTriangulatormyThreadedSurfaceTriangulator
 
tbb::spin_rw_mutex myMutex
 
tbb::spin_rw_mutex myLastLocationMutex
 
bool myUseGeosGeometryForLandAreas
 

Member Typedef Documentation

typedef std::pair<std::string, QueryType> DtFeatureToGeometryConverter::Query
typedef std::map<std::string, Query> DtFeatureToGeometryConverter::Queries
typedef std::vector<LandArea> DtFeatureToGeometryConverter::LandAreas
protected
typedef boost::ptr_map<std::string, MAKVRinTerra::DtFeatureSet> DtFeatureToGeometryConverter::SavedQueries
protected

Saved queries.

Member Enumeration Documentation

Enumerator
QUERY_DEFAULT 
POINT_SELECT 
AREA_SELECT 
SURFACE_SELECT 

Constructor & Destructor Documentation

DtFeatureToGeometryConverter::DtFeatureToGeometryConverter ( )

CTOR.

virtual DtFeatureToGeometryConverter::~DtFeatureToGeometryConverter ( )
virtual

DTOR.

Member Function Documentation

virtual void DtFeatureToGeometryConverter::convertToGeometry ( const DtPoint pnt,
const DtTerrainImplementation ,
DtCollisionWorld  
)
virtual

Converts all current geometries into the collision world object.

virtual void DtFeatureToGeometryConverter::reset ( )
virtual

Resets all information in the context creator and the queries.

virtual void DtFeatureToGeometryConverter::addQuery ( const std::string &  key,
const std::string &  value,
QueryType  = QUERY_DEFAULT 
)
virtual

Adds a new query.

virtual std::string DtFeatureToGeometryConverter::addQuery ( const std::string &  value,
QueryType  = QUERY_DEFAULT 
)
virtual

Adds a query "query<N>" and returns the query key. This query will be used when selecting features for geometry.

std::string DtFeatureToGeometryConverter::addQueryByAreaSelect ( const std::string &  value)
inline
std::string DtFeatureToGeometryConverter::addQueryByPointSelect ( const std::string &  value)
inline
virtual void DtFeatureToGeometryConverter::removeQuery ( const std::string &  key)
virtual

Removes a query.

virtual const Queries& DtFeatureToGeometryConverter::queries ( ) const
virtual

Returns the queries.

virtual bool DtFeatureToGeometryConverter::determineSurfaceType ( const DtPoint ,
const DtTerrainImplementation fc,
const std::string &  query,
DtSurface surface 
)
virtual

Returns true if there is a surface type specified by a feature at the given point.

virtual bool DtFeatureToGeometryConverter::hasSurface ( const MAKVRinTerra::DtFeatureGeometry ,
DtSurface  
)
virtual

Returns true if there is a cached surface at the given point and the surface.

virtual void DtFeatureToGeometryConverter::setSeaLevel ( double  )
virtual

Accessor for current sea level.

virtual double DtFeatureToGeometryConverter::seaLevel ( ) const
virtual
virtual DtCollisionWorld* DtFeatureToGeometryConverter::collisionWorld ( )
virtual

Returns collision world. If not created creates and initializes.

virtual void DtFeatureToGeometryConverter::addForConversion ( const MAKVRinTerra::DtFeature ,
const DtTerrainImplementation fc,
DtCollisionWorld c 
)
protectedvirtual

Adds a feature for conversion. If the geometry for this feature has already been converted it will not be added for conversion.

virtual bool DtFeatureToGeometryConverter::generateIntersection ( const DtPoint ,
const DtTerrainImplementation fc,
QueryType  ,
MAKVRinTerra::DtFeatureGeometry coverageArea,
MAKVRinTerra::DtFeatureGeometry returnGeometry 
)
protectedvirtual

Generates a geometry to use for an intersection.

virtual bool DtFeatureToGeometryConverter::shouldIntersectWith ( const DtPoint ,
const DtTerrainImplementation ,
MAKVRinTerra::DtFeatureGeometry ,
QueryType  ,
const std::string &  query,
bool firstTime,
AreasCovered::iterator &   
)
protectedvirtual

Returns true if there should be a test made to see what features are at this point. If the result is should intersect, the intersectWith supplied should be filled with the geometry to intersect with.

virtual void DtFeatureToGeometryConverter::createGeometryFromPoints ( const DtTerrainImplementation ,
DtCollisionWorld ,
const std::vector< MAKVRinTerra::DtFeatureGeometry > &   
) const
protectedvirtual

Triangulates points and creates bullet geometry from the points read in.

virtual void DtFeatureToGeometryConverter::createGeometryFromAreas ( const DtTerrainImplementation ,
DtCollisionWorld ,
const MAKVRinTerra::DtFeatureGeometry  
) const
protectedvirtual

Creates polygonal representation in osg from areas and converts them to bullet geometry.

virtual void DtFeatureToGeometryConverter::createGeometry ( const std::vector< MAKVRinTerra::DtFeatureGeometry > &  ,
const DtSurface ,
const DtTerrainImplementation ,
DtCollisionWorld ,
bool  triangulate 
) const
protectedvirtual

Creates geometry from a list of points, triangulated, and assigns surface to them.

virtual bool DtFeatureToGeometryConverter::shouldAddAsSurface ( const MAKVRinTerra::DtFeature ,
DtSurface surface 
) const
protectedvirtual

Returns true if this feature should be added as an intersected surface and the surface type.

virtual void DtFeatureToGeometryConverter::addNewSurfaceGeometries ( const Surfaces ,
const DtTerrainImplementation fc,
const std::string &  query 
)
protectedvirtual

Adds new surfaces into the current surface map.

virtual bool DtFeatureToGeometryConverter::noIntersectionFound ( const MAKVRinTerra::DtFeatureGeometry ,
DtSurface  
) const
protectedvirtual

What to do if a cell is intersected but no geometry in that cell is found.

virtual std::auto_ptr<MAKVRinTerra::DtFeatureSet> DtFeatureToGeometryConverter::createOrReturnSavedQuery ( const DtTerrainImplementation fc,
std::string  query,
bool  readDirectly = false 
)
protectedvirtual

Creates or returns a saved query for faster lookup.

virtual void DtFeatureToGeometryConverter::coverageArea ( const MAKVRinTerra::DtFeature feature)
protectedvirtual

Returns the intersection for a coverage area.

virtual void DtFeatureToGeometryConverter::addAreaCovered ( const MAKVRinTerra::DtFeatureGeometry geom,
const std::string &  query,
int  retries = 0 
)
protectedvirtual

If covered area is not currently in myAreasCovered list then add it.

virtual AreaInformation DtFeatureToGeometryConverter::createAreaInfo ( const MAKVRinTerra::DtFeatureGeometry geom,
const std::string &  query,
int  retries = 0 
) const
protectedvirtual

Returns a new area information object based on the information given. The extent will be in geodetic with 0 altitude.

virtual void DtFeatureToGeometryConverter::updateLastIntersection ( const DtPoint ,
bool  valid,
const DtSurface surface 
)
protectedvirtual

Updates the last intersection by getting a mutex lock (myLastLocationMutex) and updating.

Member Data Documentation

std::vector<MAKVRinTerra::DtFeatureGeometry> DtFeatureToGeometryConverter::myPointFeatures
protected
Queries DtFeatureToGeometryConverter::myQueries
protected

Queries that can be used to perform specified functions. These queries will be used by particluar subclasses in order to refine searches. Keywords are specific to the particular subclass. For example, the S57 loader will use an "COVERAGE_AREA" search to refine the area to include when looking for feature objects. For queries that can be applied as refinement for what to create geometries from, they should be called "QUERY<N>" where N is a number of a query. Those queries will be performed in order.

std::vector< std::string > DtFeatureToGeometryConverter::myQueryStringList
protected

Predefine a list of Query string (QUERY1, QUERY2, etc) to speed up convertToGeometry() and addQuery()

Surfaces DtFeatureToGeometryConverter::myNewSurfaces
protected
LandAreas DtFeatureToGeometryConverter::myLandAreas
protected
LastIntersection DtFeatureToGeometryConverter::myLastIntersection
protected
double DtFeatureToGeometryConverter::mySeaLevel
protected
SavedQueries DtFeatureToGeometryConverter::mySavedQueries
protected
AreasCovered DtFeatureToGeometryConverter::myAreasCovered
protected
AreasCovered DtFeatureToGeometryConverter::myCoverageAreas
protected
MAKVRinTerra::DtFeatureGeometry DtFeatureToGeometryConverter::myIntersectArea
protected
DtCollisionWorld* DtFeatureToGeometryConverter::myCollisionWorld
protected
bool DtFeatureToGeometryConverter::myCoverageAreasInitialized
protected
DtThreadedTriangulator* DtFeatureToGeometryConverter::myThreadedGeometryTriangulator
mutableprotected
DtThreadedTriangulator* DtFeatureToGeometryConverter::myThreadedSurfaceTriangulator
mutableprotected
tbb::spin_rw_mutex DtFeatureToGeometryConverter::myMutex
mutableprotected
tbb::spin_rw_mutex DtFeatureToGeometryConverter::myLastLocationMutex
mutableprotected
bool DtFeatureToGeometryConverter::myUseGeosGeometryForLandAreas
protected

Default is false – use tessellator.


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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)