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

This class maintains a rectangular bounding volume and an ordered list of vertices describing the physical extent of the object. Control objects may have one or more vertices representing the object. Individual simulation objects are represented by a single vertex and a rectangular bounding volume. The file kinTools.h contains utility functions for determining such things as the elevation angle to a given point, distance between points, and whether or not a given point lies inside the bounding volume.

Objects such as platform entities usually do not provide any model data, but are described by a rectangular bounding volume. For an area control object or a route, the vertices of the object are provided. The list of vertices may either be closed (as in an area), or open (as in a route). The vertices may also be projected (as in a phase line). If the vertices are projected, then in topocentric coordinates, any computations performed on the vertices ignore the Z component. If you know that your object has projected coordinates, then setting the object geometry projected flag using setProjection() enables some of the geometry functions to be optimized for 2-D.

Object geometry provides an interface for working in either local (database) coordinates or world coordinates. It is initialized for an object from its object parameter database entry. For example, to iterate over the vertices in an object, do the following:

Inheritance diagram for makVrf::DtVrfObjectGeometry:
Inheritance graph
[legend]

Public Member Functions

 DtVrfObjectGeometry (const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=nullptr)
 
 DtVrfObjectGeometry (const DtVrfObjectGeometry &orig, const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=nullptr)
 
DtVrfObjectGeometryoperator= (const DtVrfObjectGeometry &orig)
 
virtual ~DtVrfObjectGeometry () override
 
const DtSimBoundingGeometryboundingGeometry () const
 
void setBoundingGeometry (const DtSimBoundingGeometry &bounds)
 
void setBoundingVolume (const Dt3dBoundingVolume &)
 
void setBoundingGeometryType (DtSimBoundingGeometry::DtSimBoundingGeometryType type)
 
void setHalfLengthWidthHeight (double l, double w, double h)
 
const DtSimBoundingGeometrylocalBoundingGeometry () const
 
const DtSimBoundingGeometryworldBoundingGeometry () const
 
virtual bool closedFigure () const
 
virtual void setClosedFigure (bool closed)
 
virtual bool isEllipsoid () const
 
virtual void setIsEllipsoid (bool closed)
 
virtual bool projection () const
 
virtual void setProjection (bool projection)
 
virtual void removeAllObjectVertices ()
 
virtual bool worldPointInsideBoundingGeometry (const DtVector &worldPoint, const DtVector &objectWorldLocation, const DtTaitBryan &objectWorldOrientation) const
 
virtual bool calculateBoundingVolume (const DtVertexList &vertices, DtSimBoundingGeometry &boundingGeometry)
 
virtual void setEngineeringArea (const DtVector &)
 
const DtVector & engineeringArea () const
 
virtual void recalculateBoundingGeometry ()
 
virtual void setObjectVertices (const DtLocalVertexList &vertices)
 
virtual void setObjectVertices (const DtList &vertices)
 
virtual const DtLocalVertexListobjectVertices () const
 
virtual DtLocalVertexListobjectVertices ()
 
virtual const std::vector
< DtVector > & 
objectVerticesAsVector () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs) const
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual void reset ()
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charreaderWriterType () const
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual DtlObjPtr getData (DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Protected Member Functions

virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

DtLocalVertexList myObjectVertices
 
DtSimBoundingGeometry myBoundingGeometry
 
DtRwBoolean myClosedFigure
 
DtRwBoolean myProjection
 
DtRwBoolean myIsEllipsoid
 
DtVector myEngineeringArea
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

makVrf::DtVrfObjectGeometry::DtVrfObjectGeometry ( const DtString rwName = DtString::nullString(),
DtReaderWriterRegistry parentRegistry = nullptr 
)

Constructor for readable/writable object.

makVrf::DtVrfObjectGeometry::DtVrfObjectGeometry ( const DtVrfObjectGeometry orig,
const DtString rwName = DtString::nullString(),
DtReaderWriterRegistry parentRegistry = nullptr 
)

Copy Constructor.

virtual makVrf::DtVrfObjectGeometry::~DtVrfObjectGeometry ( )
overridevirtual

Destructor.

Member Function Documentation

DtVrfObjectGeometry& makVrf::DtVrfObjectGeometry::operator= ( const DtVrfObjectGeometry orig)

Assignment Operator.

const DtSimBoundingGeometry& makVrf::DtVrfObjectGeometry::boundingGeometry ( ) const

Set / Get Bounding Geometry.

void makVrf::DtVrfObjectGeometry::setBoundingGeometry ( const DtSimBoundingGeometry bounds)
void makVrf::DtVrfObjectGeometry::setBoundingVolume ( const Dt3dBoundingVolume &  )
void makVrf::DtVrfObjectGeometry::setBoundingGeometryType ( DtSimBoundingGeometry::DtSimBoundingGeometryType  type)
void makVrf::DtVrfObjectGeometry::setHalfLengthWidthHeight ( double  l,
double  w,
double  h 
)
const DtSimBoundingGeometry& makVrf::DtVrfObjectGeometry::localBoundingGeometry ( ) const
inline
const DtSimBoundingGeometry& makVrf::DtVrfObjectGeometry::worldBoundingGeometry ( ) const
inline
virtual bool makVrf::DtVrfObjectGeometry::closedFigure ( ) const
virtual

Set / Get closed figure flag. If true, then the last vertex connects back to the first, forming a closed figure.

virtual void makVrf::DtVrfObjectGeometry::setClosedFigure ( bool  closed)
virtual
virtual bool makVrf::DtVrfObjectGeometry::isEllipsoid ( ) const
virtual

Set / Get is ellipsoid flag. Ellipsoids are also considered closed objects by default.

virtual void makVrf::DtVrfObjectGeometry::setIsEllipsoid ( bool  closed)
virtual
virtual bool makVrf::DtVrfObjectGeometry::projection ( ) const
virtual

Set / Get projection flag. If true, then the Z values in the vertices should be ignored.

virtual void makVrf::DtVrfObjectGeometry::setProjection ( bool  projection)
virtual
virtual void makVrf::DtVrfObjectGeometry::removeAllObjectVertices ( )
virtual

Removes all vertices in the object's geometry.

virtual void makVrf::DtVrfObjectGeometry::setObjectVertices ( const DtLocalVertexList vertices)
virtual

Set / Get vertex list. Note that this represents the body coordinates stored in myObjectVertices, and not the vertices stored in the kinematic state which determine the network representation.

virtual void makVrf::DtVrfObjectGeometry::setObjectVertices ( const DtList &  vertices)
virtual

Set / Get vertex list. Note that this represents the body coordinates stored in myObjectVertices, and not the vertices stored in the kinematic state which determine the network representation.

virtual const DtLocalVertexList& makVrf::DtVrfObjectGeometry::objectVertices ( ) const
virtual

Set / Get vertex list. Note that this represents the body coordinates stored in myObjectVertices, and not the vertices stored in the kinematic state which determine the network representation.

virtual DtLocalVertexList& makVrf::DtVrfObjectGeometry::objectVertices ( )
virtual

Set / Get vertex list. Note that this represents the body coordinates stored in myObjectVertices, and not the vertices stored in the kinematic state which determine the network representation.

virtual const std::vector<DtVector>& makVrf::DtVrfObjectGeometry::objectVerticesAsVector ( ) const
virtual

Set / Get vertex list. Note that this represents the body coordinates stored in myObjectVertices, and not the vertices stored in the kinematic state which determine the network representation.

virtual bool makVrf::DtVrfObjectGeometry::worldPointInsideBoundingGeometry ( const DtVector &  worldPoint,
const DtVector &  objectWorldLocation,
const DtTaitBryan &  objectWorldOrientation 
) const
virtual

Returns true if the point, in world coordinates, is inside the object's bounding geometry.

virtual bool makVrf::DtVrfObjectGeometry::calculateBoundingVolume ( const DtVertexList vertices,
DtSimBoundingGeometry boundingGeometry 
)
virtual

Calculates the bounding volume of the object.

Parameters
verticesThe geocentric vertices of the object.
Note
The bounding volume is calculated in geocentric coordinates.
Parameters
boundingGeometryThe type of bounding geometry created. This parameter is set by this function, if it is able to calculate the bounding volume. If it is not, then this parameter is left unchanged.
Returns
A boolean indicating success or failure in calculating the bounding volume.
Note
The object must have more than one vertex to create a bounding volume.
virtual void makVrf::DtVrfObjectGeometry::setEngineeringArea ( const DtVector &  )
virtual

If this is an engineering area, give it a fixed bounding volume (length = x, width = y, z = height)

const DtVector& makVrf::DtVrfObjectGeometry::engineeringArea ( ) const
virtual void makVrf::DtVrfObjectGeometry::recalculateBoundingGeometry ( )
virtual
virtual void makVrf::DtVrfObjectGeometry::getSelf ( DtlObjPtr  args,
const DtReaderWriter::SearchPaths searchPaths,
const DtVariableBindingsList variableBindings 
)
overrideprotectedvirtual

Override to read old world and local vertices.

Reimplemented from DtReaderWriter.

Reimplemented in DtVrfSimulationObjectGroupGeometry.

Member Data Documentation

DtLocalVertexList makVrf::DtVrfObjectGeometry::myObjectVertices
protected
DtSimBoundingGeometry makVrf::DtVrfObjectGeometry::myBoundingGeometry
protected
DtRwBoolean makVrf::DtVrfObjectGeometry::myClosedFigure
protected
DtRwBoolean makVrf::DtVrfObjectGeometry::myProjection
protected
DtRwBoolean makVrf::DtVrfObjectGeometry::myIsEllipsoid
protected
DtVector makVrf::DtVrfObjectGeometry::myEngineeringArea
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)