VR-Forces 4.2 Class Documentation
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. More...

Classes

struct  AreaInformation
 Area coverage. More...
struct  LandArea
struct  LastIntersection
 Convenience member to return the last intersection if geometries match. More...

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 ()
 CTOR.
virtual ~DtFeatureToGeometryConverter ()
 DTOR.
virtual void convertToGeometry (const DtPoint &pnt, MAKVRinTerra::DtFeatureContext *, DtCollisionWorld *)
 Converts all current geometries into the collision world object.
virtual void reset ()
 Resets all information in the context creator and the queries.
virtual void addQuery (const std::string &key, const std::string &value, QueryType=QUERY_DEFAULT)
 Adds a new query.
virtual std::string addQuery (const std::string &value, QueryType=QUERY_DEFAULT)
 Adds a query "query<N>" and returns the query key.
std::string addQueryByAreaSelect (const std::string &value)
std::string addQueryByPointSelect (const std::string &value)
virtual void removeQuery (const std::string &key)
 Removes a query.
virtual const Queriesqueries () const
 Returns the queries.
virtual bool determineSurfaceType (const DtPoint &, MAKVRinTerra::DtFeatureContext *fc, const std::string &query, DtSurface &surface)
 Returns true if there is a surface type specified by a feature at the given point.
virtual bool hasSurface (const MAKVRinTerra::DtFeatureGeometry &, DtSurface &) const
 Returns true if there is a cached surface at the given point and the surface.
virtual void setSeaLevel (double)
 Accessor for current sea level.
virtual double seaLevel () const

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
 Saved queries.

Protected Member Functions

virtual void addForConversion (const MAKVRinTerra::DtFeature &, MAKVRinTerra::DtFeatureContext *fc, DtCollisionWorld *c)
 Adds a feature for conversion.
virtual
MAKVRinTerra::DtFeatureGeometry 
generateIntersection (const DtPoint &, MAKVRinTerra::DtFeatureContext *fc, QueryType, MAKVRinTerra::DtFeatureGeometry &coverageArea)
 Generates a geometry to use for an intersection.
virtual bool shouldIntersectWith (const DtPoint &, MAKVRinTerra::DtFeatureContext *, MAKVRinTerra::DtFeatureGeometry &, QueryType, const std::string &query, bool &firstTime, AreasCovered::iterator &)
 Returns true if there should be a test made to see what features are at this point.
virtual void createGeometryFromPoints (MAKVRinTerra::DtFeatureContext *, DtCollisionWorld *, const std::vector< MAKVRinTerra::DtFeatureGeometry > &) const
 Triangulates points and creates bullet geometry from the points read in.
virtual void createGeometryFromAreas (MAKVRinTerra::DtFeatureContext *, DtCollisionWorld *, const MAKVRinTerra::DtFeatureGeometry &) const
 Creates polygonal representation in osg from areas and converts them to bullet geometry.
virtual void createGeometry (const std::vector< MAKVRinTerra::DtFeatureGeometry > &, const DtSurface &, MAKVRinTerra::DtFeatureContext *, DtCollisionWorld *, bool triangulate) const
 Creates geometry from a list of points, triangulated, and assigns surface to them.
virtual bool shouldAddAsSurface (const MAKVRinTerra::DtFeature &, DtSurface &surface) const
 Returns true if this feature should be added as an intersected surface and the surface type.
virtual void addNewSurfaceGeometries (const Surfaces &, MAKVRinTerra::DtFeatureContext *fc, const std::string &query)
 Adds new surfaces into the current surface map.
virtual bool noIntersectionFound (const MAKVRinTerra::DtFeatureGeometry &, DtSurface &) const
 What to do if a cell is intersected but no geometry in that cell is found.
virtual std::auto_ptr
< MAKVRinTerra::DtFeatureSet
createOrReturnSavedQuery (MAKVRinTerra::DtFeatureContext *fc, std::string query, bool readDirectly=false)
 Creates or returns a saved query for faster lookup.
virtual void coverageArea (const MAKVRinTerra::DtFeature &feature)
 Returns the intersection for a coverage area.
virtual void addAreaCovered (const MAKVRinTerra::DtFeatureGeometry geom, const std::string &query, int retries=0)
 If covered area is not currently in myAreasCovered list then add it.
virtual AreaInformation createAreaInfo (const MAKVRinTerra::DtFeatureGeometry &geom, const std::string &query, int retries=0) const
 Returns a new area information object based on the information given. The extent will be in geodetic with 0 altitude.

Protected Attributes

std::vector
< MAKVRinTerra::DtFeatureGeometry
myPointFeatures
Queries myQueries
 Queries that can be used to perform specified functions.
Surfaces myNewSurfaces
LandAreas myLandAreas
LastIntersection myLastIntersection
double mySeaLevel
SavedQueries mySavedQueries
AreasCovered myAreasCovered
AreasCovered myCoverageAreas
MAKVRinTerra::DtFeatureGeometry myIntersectArea
DtCollisionWorldmyCollisionWorld
bool myCoverageAreasInitialized
DtThreadedTriangulatormyThreadedGeometryTriangulator
DtThreadedTriangulatormyThreadedSurfaceTriangulator
bool myUseGeosGeometryForLandAreas
 Default is false – use tessellator.

Detailed Description

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

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,
MAKVRinTerra::DtFeatureContext ,
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 &  ,
MAKVRinTerra::DtFeatureContext 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 &   
) const
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 void DtFeatureToGeometryConverter::addForConversion ( const MAKVRinTerra::DtFeature ,
MAKVRinTerra::DtFeatureContext 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 MAKVRinTerra::DtFeatureGeometry DtFeatureToGeometryConverter::generateIntersection ( const DtPoint &  ,
MAKVRinTerra::DtFeatureContext fc,
QueryType  ,
MAKVRinTerra::DtFeatureGeometry coverageArea 
)
protectedvirtual

Generates a geometry to use for an intersection.

virtual bool DtFeatureToGeometryConverter::shouldIntersectWith ( const DtPoint &  ,
MAKVRinTerra::DtFeatureContext ,
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 ( MAKVRinTerra::DtFeatureContext ,
DtCollisionWorld ,
const std::vector< MAKVRinTerra::DtFeatureGeometry > &   
) const
protectedvirtual

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

virtual void DtFeatureToGeometryConverter::createGeometryFromAreas ( MAKVRinTerra::DtFeatureContext ,
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 &  ,
MAKVRinTerra::DtFeatureContext ,
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 ,
MAKVRinTerra::DtFeatureContext 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 ( MAKVRinTerra::DtFeatureContext 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.

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

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
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 Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)