VR-Forces 4.1 Class Documentation
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
MAKVRinTerra::DtFeature Class Reference

Represents a GIS feature. More...

Inheritance diagram for MAKVRinTerra::DtFeature:
Inheritance graph
[legend]

Classes

struct  AttributeConverter
struct  Key
 Key used to lookup attributes. More...

Public Types

typedef boost::shared_ptr
< DtFeature
Ptr
typedef boost::shared_ptr
< const DtFeature
CPtr
typedef boost::variant
< std::string, int, double > 
Attribute
 boost::variant type for accessing attributes.
typedef boost::function< void(const
Key &, const Attribute &)> 
ForEachFunction
 Callback used to iterating through attributes with ForEachAttribute.

Public Member Functions

virtual ~DtFeature ()
 Virtual destructor.
virtual CPtr getPtr () const
 Return a pointer to an object which represents the current feature.
virtual DtFeatureGeometry geometry () const =0
 Get the geometry associated with this feature.
virtual void forEachAttribute (ForEachFunction f) const =0
 Calls the provided callback on each attribute.
virtual unsigned numberOfAttributes (const Key::String &) const =0
 Number of attributes with a given name.
virtual bool hasAttribute (const Key &k) const
 Check to see if this feature has an attribute of a specific type.
virtual boost::optional
< Attribute
attribute (const Key &) const =0
 Get attribute at a certain key.
template<typename T >
boost::optional< T > attributeAs (const Key &k) const

Static Public Member Functions

static std::string TypeOfAttribute (const Attribute &)
 String type description of an attribute's type.
static CPtr GetPtr (const DtFeature &)
 Static function for invoking getPtr-like functions in subclasses.
static Ptr CreateEmptyFeature ()
 Factory function for creating features with no data.
static Ptr CreateGeometryFeature (DtFeatureGeometry)
 Create a feature with the given geometry and no attributes.
static Ptr CreateCopy (const DtFeature &feature)
 Create a copy of a feature.
static bool Equal (const Attribute &, const Attribute &)
 Attribute compare attributes with intelligent conversions.
static bool NotEqual (const Attribute &, const Attribute &)
 Attribute compare attributes with intelligent conversions.
static bool Less (const Attribute &, const Attribute &)
 Attribute compare attributes with intelligent conversions.
static bool LessOrEqual (const Attribute &, const Attribute &)
 Attribute compare attributes with intelligent conversions.
static bool Greater (const Attribute &, const Attribute &)
 Attribute compare attributes with intelligent conversions.
static bool GreaterOrEqual (const Attribute &, const Attribute &)
 Attribute compare attributes with intelligent conversions.

Static Public Attributes

static const char * TypeName

Detailed Description

Represents a GIS feature.

GIS features are represented as dictionaries mapping keys to attribute values. A key consists of a case insensitive string and an unsigned integer index. The attribute values can be either an int, a double, a std::string, or a DtFeatureGeometry. Sets of attributes are accessed by using the index part of the key, and single value attributes are accessed as if they were one items sets, with the key index defaulting to zero to facilitate this.

Member Typedef Documentation

typedef boost::shared_ptr<DtFeature> MAKVRinTerra::DtFeature::Ptr
typedef boost::shared_ptr<const DtFeature> MAKVRinTerra::DtFeature::CPtr
typedef boost::variant< std::string, int, double > MAKVRinTerra::DtFeature::Attribute

boost::variant type for accessing attributes.

typedef boost::function<void (const Key&, const Attribute&)> MAKVRinTerra::DtFeature::ForEachFunction

Callback used to iterating through attributes with ForEachAttribute.

Constructor & Destructor Documentation

virtual MAKVRinTerra::DtFeature::~DtFeature ( )
virtual

Virtual destructor.

Member Function Documentation

static bool MAKVRinTerra::DtFeature::Equal ( const Attribute ,
const Attribute  
)
static

Attribute compare attributes with intelligent conversions.

static bool MAKVRinTerra::DtFeature::NotEqual ( const Attribute ,
const Attribute  
)
static

Attribute compare attributes with intelligent conversions.

static bool MAKVRinTerra::DtFeature::Less ( const Attribute ,
const Attribute  
)
static

Attribute compare attributes with intelligent conversions.

static bool MAKVRinTerra::DtFeature::LessOrEqual ( const Attribute ,
const Attribute  
)
static

Attribute compare attributes with intelligent conversions.

static bool MAKVRinTerra::DtFeature::Greater ( const Attribute ,
const Attribute  
)
static

Attribute compare attributes with intelligent conversions.

static bool MAKVRinTerra::DtFeature::GreaterOrEqual ( const Attribute ,
const Attribute  
)
static

Attribute compare attributes with intelligent conversions.

static std::string MAKVRinTerra::DtFeature::TypeOfAttribute ( const Attribute )
static

String type description of an attribute's type.

static CPtr MAKVRinTerra::DtFeature::GetPtr ( const DtFeature )
static

Static function for invoking getPtr-like functions in subclasses.

static Ptr MAKVRinTerra::DtFeature::CreateEmptyFeature ( )
static

Factory function for creating features with no data.

static Ptr MAKVRinTerra::DtFeature::CreateGeometryFeature ( DtFeatureGeometry  )
static

Create a feature with the given geometry and no attributes.

static Ptr MAKVRinTerra::DtFeature::CreateCopy ( const DtFeature feature)
static

Create a copy of a feature.

Parameters
featureFeature to copy.
virtual CPtr MAKVRinTerra::DtFeature::getPtr ( ) const
virtual

Return a pointer to an object which represents the current feature.

In order to enable paging and efficient representation of features, this method should return a pointer to feature which contains all the same data as the current feature but may be a different object. This allows DtFeature objects to be created on the stack and to not create the actual heap allocated and page tracked object until the point at which it is needed.

Reimplemented in MAKVRinTerra::DtTransformFeatureSet::FeatureWrapper, MAKVRinTerra::DtGdbVectorFeature, MAKVRinTerra::DtFeatureWrapper< DtObstacleFeature >, and MAKVRinTerra::DtObstacleFeature.

virtual DtFeatureGeometry MAKVRinTerra::DtFeature::geometry ( ) const
pure virtual

Get the geometry associated with this feature.

GIS features each typically each associated with one geometry. Other geometries can be stored as attributes in DtFeature objects, but all functionality that makes references to a specific geometry (like paging or spatial indexing) shall obtain that geometry from this function.

Implemented in MAKVRinTerra::DtTransformFeatureSet::FeatureWrapper, MAKVRinTerra::DtSimplePathFeature, MAKVRinTerra::DtFeatureWrapper< DtObstacleFeature >, MAKVRinTerra::DtGdbVectorFeature, MAKVRinTerra::DtOgrFeature, MAKVRinTerra::DtObstacleFeature, MAKVRinTerra::DtSimpleFeature, and MAKVRinTerra::DtOsgEarthFeature.

virtual void MAKVRinTerra::DtFeature::forEachAttribute ( ForEachFunction  f) const
pure virtual
virtual unsigned MAKVRinTerra::DtFeature::numberOfAttributes ( const Key::String ) const
pure virtual

Number of attributes with a given name.

virtual bool MAKVRinTerra::DtFeature::hasAttribute ( const Key k) const
virtual

Check to see if this feature has an attribute of a specific type.

virtual boost::optional<Attribute> MAKVRinTerra::DtFeature::attribute ( const Key ) const
pure virtual
template<typename T >
boost::optional<T> MAKVRinTerra::DtFeature::attributeAs ( const Key k) const
inline

Member Data Documentation

const char* MAKVRinTerra::DtFeature::TypeName
static

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)