VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | 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 Types

typedef std::vector< DtLocation3DLocationVector
typedef std::map< std::string,
std::string > 
AttributeMap

Public Member Functions

 DtLuaFeatureSet (DtSimManager *=0, const std::string &type="")
 CTOR.
 DtLuaFeatureSet (const DtLuaFeatureSet &)
DtLuaFeatureSetoperator= (const 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 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.
DtLuaFeatureSet filter (const DtLuaFeatureGeometry &geom, luabind::object const &attributes)
DtLuaFeatureSet filterGeometry (const DtLuaFeatureGeometry &geom)
DtLuaFeatureSet filterAttributes (luabind::object const &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 ()
virtual std::string objectTypeC () const
 Returns a std::string version of the objectType.
virtual void init (void *userData)
 This function is called right after the object is constructed during the deserialization process, but before deserialize() is called.

Static Public Member Functions

static DtAsciiSerializablecreator ()
 Inherited from DtAsciiSerializable. Returns a new object of this type with default values.
- Static Public Member Functions inherited from DtObjectDebugger< DtLuaFeatureSet >
static DtObjectCounter::CounterType ObjectCount ()
static const DtObjectContainer * ObjectContainer ()

Protected Types

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

Protected Member Functions

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.
void update (MAKVRinTerra::DtFeatureGeometry)
void update (const LocationVector &locations)
void update (const AttributeMap &attributes)
void updateRange (const DtLocation3D &center, double range)
void updatePoints (luabind::object const &points)
void updateAttributes (luabind::object const &attributes)
void filterFeatures ()
- Protected Member Functions inherited from DtObjectDebugger< DtLuaFeatureSet >
 DtObjectDebugger ()
 DtObjectDebugger (const DtObjectDebugger &)
 ~DtObjectDebugger ()

Protected Attributes

DtSimManagermySimManager
std::vector< DtLocation3DmyLocations
 Items used to be stored into or restored from saved state.
std::map< std::string,
std::string > 
myAttributes
boost::shared_ptr
< MAKVRinTerra::DtFeatureSet
myFeatureSet
bool myProcessed
Features myFeatures
std::string myType
boost::optional
< MAKVRinTerra::DtQuery
myQuery
boost::optional
< MAKVRinTerra::DtFeatureGeometry
myGeomFilter
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.
DtLuaFeatureGeometry geometry (int)
 Returns the feature geometry at the given index or throws an exception if index is out of range.
DtLuaFeatureSet load ()
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

typedef std::map<std::string, std::string> DtLuaFeatureSet::AttributeMap

Constructor & Destructor Documentation

DtLuaFeatureSet::DtLuaFeatureSet ( DtSimManager = 0,
const std::string &  type = "" 
)

CTOR.

DtLuaFeatureSet::DtLuaFeatureSet ( const DtLuaFeatureSet )

Member Function Documentation

DtLuaFeatureSet& DtLuaFeatureSet::operator= ( const DtLuaFeatureSet )
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

DtLuaFeatureSet DtLuaFeatureSet::filter ( const DtLuaFeatureGeometry geom,
luabind::object const &  attributes 
)
DtLuaFeatureSet DtLuaFeatureSet::filterGeometry ( const DtLuaFeatureGeometry geom)
DtLuaFeatureSet DtLuaFeatureSet::filterAttributes ( luabind::object const &  attributes)
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.

DtLuaFeatureGeometry DtLuaFeatureSet::geometry ( int  )

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

DtLuaFeatureSet DtLuaFeatureSet::load ( )
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

void DtLuaFeatureSet::update ( MAKVRinTerra::DtFeatureGeometry  )
protected
void DtLuaFeatureSet::update ( const LocationVector locations)
protected
void DtLuaFeatureSet::update ( const AttributeMap attributes)
protected
void DtLuaFeatureSet::updateRange ( const DtLocation3D center,
double  range 
)
protected
void DtLuaFeatureSet::updatePoints ( luabind::object const &  points)
protected
void DtLuaFeatureSet::updateAttributes ( luabind::object const &  attributes)
protected
void DtLuaFeatureSet::filterFeatures ( )
protected

Member Data Documentation

DtSimManager* DtLuaFeatureSet::mySimManager
protected
std::vector<DtLocation3D> DtLuaFeatureSet::myLocations
protected

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

std::map<std::string, std::string> DtLuaFeatureSet::myAttributes
protected
boost::shared_ptr<MAKVRinTerra::DtFeatureSet> DtLuaFeatureSet::myFeatureSet
protected
bool DtLuaFeatureSet::myProcessed
protected
Features DtLuaFeatureSet::myFeatures
protected
std::string DtLuaFeatureSet::myType
protected
boost::optional<MAKVRinTerra::DtQuery> DtLuaFeatureSet::myQuery
protected
boost::optional<MAKVRinTerra::DtFeatureGeometry> DtLuaFeatureSet::myGeomFilter
protected

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)