VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DtLuaFeatureSet Class Reference

The DtLuaFeatureSet class is a wrapper around a DtFeatureSet that will provide feature information for lua scripts. More...

Inheritance diagram for DtLuaFeatureSet:
Inheritance graph
[legend]

Public Member Functions

 DtLuaFeatureSet ()
 CTOR.
 DtLuaFeatureSet (DtSimManager *)
 CTOR.
 DtLuaFeatureSet (const DtLuaFeatureSet &)
 Copy CTOR.
DtLuaFeatureSetoperator= (const DtLuaFeatureSet &orig)
virtual ~DtLuaFeatureSet ()
 DTOR.
DtLuaFeatureSet getFeaturesWithinArea (luabind::object const &points, luabind::object const &attributes)
 Returns a feature set which contains all features within the specified geometry containing the specified attributes.
DtLuaFeatureSet getFeaturesWithinRange (const DtLocation3D &, double range, luabind::object const &attributes)
 Returns a feature set which contains all features within the specified point and box size containing the specified attributes.
virtual void setSimManager (DtSimManager *simManager)
 Script API functions above. ////////////////////////////////////.
virtual DtString objectType () const
 Should return the string name of this object.
DtString serialize ()
 Inherited from DtAsciiSerializable. Returns a string serialized version of this class.
bool deserialize (const DtString &data)
 Inherited from DtAsciiSerializable.
- Public Member Functions inherited from DtAsciiSerializable
 DtAsciiSerializable ()
 The implementer of this interface should be sure to create a creator function to create an empty object that returns a pointer to this interface.
 DtAsciiSerializable (const DtAsciiSerializable &orig)
virtual ~DtAsciiSerializable ()

Static Public Member Functions

static DtAsciiSerializablecreator ()
 Inherited from DtAsciiSerializable. Returns a new object of this type with default values.

Protected Types

typedef std::vector
< MAKVRinTerra::DtFeature::CPtr
Features

Protected Member Functions

virtual MAKVRinTerra::DtQuery generateQuery (const MAKVRinTerra::DtFeatureGeometry &, luabind::object const &attributes)
 Generates a query given the attributes and some feature geometry.
virtual void gatherFeatures (const MAKVRinTerra::DtFeature &)
 Gathers all the found features into a local vector.
virtual void testLoaded ()
 Tests to see if the feature set is loaded.

Protected Attributes

boost::shared_ptr
< MAKVRinTerra::DtFeatureSet
myFeatureSet
DtSimManagermySimManager
std::vector< DtLocation3DmyLocations
 Items used to be stored into or restored from saved state.
double myRange
std::map< std::string,
std::string > 
myAttributes
bool myProcessed
Features myFeatures
bool getIsLoaded () const
 Return true if the feature set is loaded.
int getFeatureCount ()
 Return the number of features in the set.
bool getIsPointFeature (int)
 Returns true if the feature at the particular index is a point feature.
bool getIsLinearFeature (int)
 Returns true if the feature at the particular index is a linear feature.
bool getIsArealFeature (int)
 Returns true if the feature at the particular index is an areal feature.
std::string getFeatureType (int)
 Returns a string of the type of feature (point, line, area).
std::vector< std::string > getFeatureAttributeNames (int)
 Returns a lua bound table list of all attribute names for the particular feature index.
bool getHasAttributeNamed (int, const std::string)
 Returns true if there is an attribute named on the particular feature.
DtLocation3D getLocation3D (int)
 Returns the 3D location of the feature.
std::vector< DtLocation3DgetLocations3D (int)
 Returns a vector of points for the particular feature.
MAKVRinTerra::DtFeature::CPtr feature (int)
 Returns a feature at the given index or throws an exception if index is out of range.
static luabind::object getFeatureAttributeValue (DtLuaFeatureSet &, int, const std::string, lua_State *)
 Returns an attribute value for the specified index and attribute name.

Detailed Description

The DtLuaFeatureSet class is a wrapper around a DtFeatureSet that will provide feature information for lua scripts.

When archived the query that was used to create the feature set will be saved. Upon restore the feature set will again be created. Calling isLoaded() is essential to knowing when the query is complete

Member Typedef Documentation

Constructor & Destructor Documentation

DtLuaFeatureSet::DtLuaFeatureSet ( )

CTOR.

DtLuaFeatureSet::DtLuaFeatureSet ( DtSimManager )

CTOR.

DtLuaFeatureSet::DtLuaFeatureSet ( const DtLuaFeatureSet )

Copy CTOR.

virtual DtLuaFeatureSet::~DtLuaFeatureSet ( )
virtual

DTOR.

Member Function Documentation

DtLuaFeatureSet& DtLuaFeatureSet::operator= ( const DtLuaFeatureSet orig)
DtLuaFeatureSet DtLuaFeatureSet::getFeaturesWithinArea ( luabind::object const &  points,
luabind::object const &  attributes 
)

Returns a feature set which contains all features within the specified geometry containing the specified attributes.

DtLuaFeatureSet DtLuaFeatureSet::getFeaturesWithinRange ( const DtLocation3D ,
double  range,
luabind::object const &  attributes 
)

Returns a feature set which contains all features within the specified point and box size containing the specified attributes.

The range is in meters. The range will create a bounding box with the point supplied at the center

virtual void DtLuaFeatureSet::setSimManager ( DtSimManager simManager)
virtual

Script API functions above. ////////////////////////////////////.

Used by the object serializer so that an instance of this object can call checkSelf()

virtual DtString DtLuaFeatureSet::objectType ( ) const
virtual

Should return the string name of this object.

The object name should not be part of the serialization unless you want it to be, but you should take it into account when implementing both functions.

Implements DtAsciiSerializable.

DtString DtLuaFeatureSet::serialize ( )
virtual

Inherited from DtAsciiSerializable. Returns a string serialized version of this class.

Implements DtAsciiSerializable.

bool DtLuaFeatureSet::deserialize ( const DtString data)
virtual

Inherited from DtAsciiSerializable.

Returns true if it could fill its members with the data contained in the string. False otherwise.

Implements DtAsciiSerializable.

static DtAsciiSerializable* DtLuaFeatureSet::creator ( )
static

Inherited from DtAsciiSerializable. Returns a new object of this type with default values.

bool DtLuaFeatureSet::getIsLoaded ( ) const

Return true if the feature set is loaded.

Operations that can be performed on a feature set

int DtLuaFeatureSet::getFeatureCount ( )

Return the number of features in the set.

bool DtLuaFeatureSet::getIsPointFeature ( int  )

Returns true if the feature at the particular index is a point feature.

Will throw an exception if index is out of range or feature set is not loaded

bool DtLuaFeatureSet::getIsLinearFeature ( int  )

Returns true if the feature at the particular index is a linear feature.

Will throw an exception if index is out of range or feature set is not loaded

bool DtLuaFeatureSet::getIsArealFeature ( int  )

Returns true if the feature at the particular index is an areal feature.

Will throw an exception if index is out of range or feature set is not loaded

std::string DtLuaFeatureSet::getFeatureType ( int  )

Returns a string of the type of feature (point, line, area).

Will throw an exception if index is out of range or feature set is not loaded

std::vector<std::string> DtLuaFeatureSet::getFeatureAttributeNames ( int  )

Returns a lua bound table list of all attribute names for the particular feature index.

Will throw an exception if index is out of range or if feature set is not loaded

bool DtLuaFeatureSet::getHasAttributeNamed ( int  ,
const std::string   
)

Returns true if there is an attribute named on the particular feature.

DtLocation3D DtLuaFeatureSet::getLocation3D ( int  )

Returns the 3D location of the feature.

If a multi-point feature returns the first point. Will throw an exception if the index is out of range, the feature set is not loaded

std::vector<DtLocation3D> DtLuaFeatureSet::getLocations3D ( int  )

Returns a vector of points for the particular feature.

If a point feature returns a vector of 1 point. Will throw an exception if the index is out of range, the feature set is not loaded

static luabind::object DtLuaFeatureSet::getFeatureAttributeValue ( DtLuaFeatureSet ,
int  ,
const std::string  ,
lua_State *   
)
static

Returns an attribute value for the specified index and attribute name.

Will throw an exception if the index is out of range, the feature set is not loaded, or the attribute name is not valid for the particular feature

MAKVRinTerra::DtFeature::CPtr DtLuaFeatureSet::feature ( int  )

Returns a feature at the given index or throws an exception if index is out of range.

virtual MAKVRinTerra::DtQuery DtLuaFeatureSet::generateQuery ( const MAKVRinTerra::DtFeatureGeometry ,
luabind::object const &  attributes 
)
protectedvirtual

Generates a query given the attributes and some feature geometry.

virtual void DtLuaFeatureSet::gatherFeatures ( const MAKVRinTerra::DtFeature )
protectedvirtual

Gathers all the found features into a local vector.

virtual void DtLuaFeatureSet::testLoaded ( )
protectedvirtual

Tests to see if the feature set is loaded.

Throws an exception if not. If it is loaded and the features have not been gathered into the feature set collection will do that

Member Data Documentation

boost::shared_ptr<MAKVRinTerra::DtFeatureSet> DtLuaFeatureSet::myFeatureSet
protected
DtSimManager* DtLuaFeatureSet::mySimManager
protected
std::vector<DtLocation3D> DtLuaFeatureSet::myLocations
protected

Items used to be stored into or restored from saved state.

double DtLuaFeatureSet::myRange
protected
std::map<std::string, std::string> DtLuaFeatureSet::myAttributes
protected
bool DtLuaFeatureSet::myProcessed
protected
Features DtLuaFeatureSet::myFeatures
protected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)