VR-Forces 4.2 Class Documentation
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Types
makVrf::DtCopyObject Class Reference
Inheritance diagram for makVrf::DtCopyObject:
Inheritance graph
[legend]

Public Types

enum  DtPasteFlags {
  DtPasteNewName = 0x00000001, DtPasteAppearance = 0x00000002, DtPasteHeading = 0x00000004, DtPasteEngagement = 0x00000008,
  DtPastePlan = 0x00000010, DtPasteAboveSeaLevel = 0x00000020, DtPasteAboveTerrain = 0x00000040, DtPasteFormation = 0x00000080,
  DtAllPasteFlags = DtPasteNewName | DtPasteAppearance | DtPasteHeading | DtPasteEngagement | DtPastePlan | DtPasteAboveTerrain
}

Public Member Functions

 DtCopyObject (makVrv::DtDe &)
virtual ~DtCopyObject ()
virtual void copy (makVrv::DtSimEntry *)
 Starts copy process. Subclasses need to implement specific copy procedures.
virtual void read (const std::string &buf)
 Reads data from the buffer.
virtual void cancel ()
 Cancels copy. Emits signal when cancel is complete.
const std::string & name () const
virtual std::string copyPendingMessage () const
 Message that is describing what this object is waiting for as far as copying goes.
virtual std::string pastePendingMessage () const
 Message that is describing what this object is waiting for as far as pasting goes.
virtual void setAltitudeClampType (DtAltitudeClampType)
 Sets the clamp type to used when calculating localLocation. Default is above terrain.
DtAltitudeClampType altitudeClampType () const
void setType (int t)
int type () const
void setBuffer (const std::string &b)
const std::string & buffer () const
virtual
DtVrfObjectFacadeInterface
facade () const
 Returns the facade.
virtual bool preserveOffsets () const
 Returns true if offsets from origin should be preserved on paste. Default is false.
virtual void paste (const DtVector &, int flags=DtAllPasteFlags)
 Pastes object given the current information.
virtual DtGeodeticCoord center () const
 Returns the center of the object in geocentric coordinates.
virtual DtVector localCenter () const
virtual DtGeodeticCoord calculateCenter () const
virtual DtVector origin () const
 If facade is available, returns the origin of the facade, else returns center().
virtual DtVector pasteOrigin () const
 Origin at which to paste the object. Will take into account offsets (if they exist)
virtual void setGeometricCenter (const DtGeodeticCoord &)
 Sets the center of all objects being painted (in geocentric as per center() call).
const DtGeodeticCoord & geometricCenter () const
virtual void createFacade ()
 Creates the facade that will be used to display a temp item during paste operation. Base does nothing.
virtual void setOrigin (const DtGeodeticCoord &)
 Sets new location of object. Base member is no-op. Location is in local database coordinates.
const
makVrv::DtVrlinkSimulatedBaseState * 
readableStateData () const
virtual bool updateDataBeforeCopy () const
 Returns true as to whether or not to force a data update before copy. Default is false.
virtual void setUpdateDataBeforeCopy (bool)

Public Attributes

boost::signal< void(DtCopyObject *)> signal_copyCancelled
boost::signal< void(DtCopyObject
*, const std::string &)> 
signal_copied
boost::signal< void(DtCopyObject
*, const std::string &)> 
signal_copyOperationPending
boost::signal< void(DtCopyObject *)> signal_pasted
boost::signal< void(DtCopyObject
*, const std::string &)> 
signal_pasteOperationPending
boost::signal< void(DtCopyObject *)> signal_pasteCancelled

Protected Types

typedef std::vector< double > HeightOffsets

Protected Member Functions

virtual void write (std::ostringstream &str, const makVrv::DtVrlinkSimulatedBaseState *data, makVrv::DtUniqueID id)
 Writes data to stream.
virtual void write (std::ostringstream &str, const DtVrfObjectDataState *data)
 Writes vrf object data state.
virtual DtVrfObjectDataStatecreateReadableObjectStateData () const
 Creates state data that will be used to read into a readable buffer.
virtual
makVrv::DtVrlinkSimulatedBaseState * 
createReadableStateData () const
virtual void read (std::istringstream &str, makVrv::DtVrlinkSimulatedBaseState *data)
 Reads data from stream.
virtual void read (std::istringstream &str, DtVrfObjectDataState *data)
 Reads vrf object data state.
virtual void checkCopyComplete ()
 Checks whether or not the copy is complete, and, if it is, calls copyComplet()
virtual bool copyOperationsPending () const
 Return true if copy operations are complete, else false will signal that there are other operations yet to be done.
virtual void copyComplete ()
 Sends copied message with resultant copied string.
virtual bool cancelComplete () const
 Returns true if cancel is complete.
virtual void readComplete (std::istringstream &str)
 Called when reading of buffer for object is complete.
virtual void checkPasteComplete ()
 Checks to see if paste operation is complete.
virtual bool pasteComplete () const
 Returns true if paste operation is complete. Default is true.
virtual void createObject (const DtVector &)
 Creates the object locally or on the network.
virtual int generateRequestId ()
 Generates a request id to match our request.
virtual double groundHeight (const DtVector &currentLocal) const
 Returns the height at the given local position.
virtual void setupOffsets (const DtGeodeticCoord &)
 Sets up offsets from geometric center.
virtual void slot_onStateViewUpdated (DtVrlinkSimulatedBaseStateView *state, makVrv::DtSimEntry *simEntry)
virtual DtVector offsetLocation (int, const DtVector &loc) const
 Returns the geocentric location of the point at offset location index offset by geocentric loc.
virtual DtGeodeticCoord calculateOffsetPoint (const DtGeodeticCoord &start, const DtGeodeticCoord &end, double &altAboveTerrain, double &altAboveSeaLevel) const
 Calculates an offset point based on the start and end positions.
virtual DtVector localLocation (const DtGeodeticCoord &, int) const
 Given an origin and an index, return local location as an offset from that origin.

Protected Attributes

makVrv::DtDe & myDe
std::ostringstream myOutput
std::string myName
int myPasteFlags
DtVrfObjectDataStatemyReadableObjectStateData
makVrv::DtVrlinkSimulatedBaseState * myReadableStateData
DtGeodeticCoord myCenter
CopyOffsets myOffsets
HeightOffsets myAltitudeAboveTerrain
HeightOffsets myAltitudeAboveSeaLevel
DtAltitudeClampType myAltitudeClampType
DtReferenceEllipsoid myReferenceEllipsoid
int myType
std::string myBuffer
DtGeodeticCoord myGeometricCenter
bool myIsLocal
bool myUpdateDataBeforeCopy

Private Types

typedef std::vector
< DtGeodeticCoord > 
CopyOffsets

Member Typedef Documentation

typedef std::vector<DtGeodeticCoord> makVrf::DtCopyObject::CopyOffsets
private
typedef std::vector<double> makVrf::DtCopyObject::HeightOffsets
protected

Member Enumeration Documentation

Enumerator:
DtPasteNewName 
DtPasteAppearance 

Paste under a new name vs. name as it was copied.

DtPasteHeading 

Paste appearance bits or use 0.

DtPasteEngagement 

Paste heading or use 0 heading.

DtPastePlan 
DtPasteAboveSeaLevel 
DtPasteAboveTerrain 
DtPasteFormation 
DtAllPasteFlags 

Constructor & Destructor Documentation

makVrf::DtCopyObject::DtCopyObject ( makVrv::DtDe &  )
virtual makVrf::DtCopyObject::~DtCopyObject ( )
virtual

Member Function Documentation

virtual void makVrf::DtCopyObject::copy ( makVrv::DtSimEntry *  )
virtual

Starts copy process. Subclasses need to implement specific copy procedures.

Reimplemented in makVrf::DtAggregateCopyObject.

virtual void makVrf::DtCopyObject::read ( const std::string &  buf)
virtual

Reads data from the buffer.

Creates the state data to read into from a call to createReadableStateData()

virtual void makVrf::DtCopyObject::cancel ( )
virtual

Cancels copy. Emits signal when cancel is complete.

Reimplemented in makVrf::DtAggregateCopyObject, and makVrf::DtEntityCopyObject.

const std::string& makVrf::DtCopyObject::name ( ) const
inline
virtual std::string makVrf::DtCopyObject::copyPendingMessage ( ) const
virtual

Message that is describing what this object is waiting for as far as copying goes.

Reimplemented in makVrf::DtAggregateCopyObject, and makVrf::DtEntityCopyObject.

virtual std::string makVrf::DtCopyObject::pastePendingMessage ( ) const
virtual

Message that is describing what this object is waiting for as far as pasting goes.

Reimplemented in makVrf::DtEntityCopyObject, and makVrf::DtAggregateCopyObject.

virtual void makVrf::DtCopyObject::setAltitudeClampType ( DtAltitudeClampType  )
virtual

Sets the clamp type to used when calculating localLocation. Default is above terrain.

DtAltitudeClampType makVrf::DtCopyObject::altitudeClampType ( ) const
void makVrf::DtCopyObject::setType ( int  t)
inline
int makVrf::DtCopyObject::type ( ) const
inline
void makVrf::DtCopyObject::setBuffer ( const std::string &  b)
inline
const std::string& makVrf::DtCopyObject::buffer ( ) const
inline
virtual DtVrfObjectFacadeInterface* makVrf::DtCopyObject::facade ( ) const
inlinevirtual

Returns the facade.

Reimplemented in makVrf::DtEntityCopyObject, and makVrf::DtEnvironmentalCopyObject.

virtual bool makVrf::DtCopyObject::preserveOffsets ( ) const
virtual

Returns true if offsets from origin should be preserved on paste. Default is false.

Reimplemented in makVrf::DtEnvironmentalShapeCopyObject.

virtual void makVrf::DtCopyObject::write ( std::ostringstream &  str,
const makVrv::DtVrlinkSimulatedBaseState *  data,
makVrv::DtUniqueID  id 
)
protectedvirtual

Writes data to stream.

Override to write own data, but, make sure to call parent method

Reimplemented in makVrf::DtEntityCopyObject, and makVrf::DtEnvironmentalCopyObject.

virtual void makVrf::DtCopyObject::write ( std::ostringstream &  str,
const DtVrfObjectDataState data 
)
protectedvirtual

Writes vrf object data state.

Reimplemented in makVrf::DtEntityCopyObject.

virtual DtVrfObjectDataState* makVrf::DtCopyObject::createReadableObjectStateData ( ) const
protectedvirtual

Creates state data that will be used to read into a readable buffer.

Will persist until object is deleted

virtual makVrv::DtVrlinkSimulatedBaseState* makVrf::DtCopyObject::createReadableStateData ( ) const
protectedvirtual
virtual void makVrf::DtCopyObject::read ( std::istringstream &  str,
makVrv::DtVrlinkSimulatedBaseState *  data 
)
protectedvirtual

Reads data from stream.

Override to read own data, but, make sure to call parent method

Reimplemented in makVrf::DtEntityCopyObject, and makVrf::DtEnvironmentalCopyObject.

virtual void makVrf::DtCopyObject::read ( std::istringstream &  str,
DtVrfObjectDataState data 
)
protectedvirtual

Reads vrf object data state.

Reimplemented in makVrf::DtEntityCopyObject.

virtual void makVrf::DtCopyObject::checkCopyComplete ( )
protectedvirtual

Checks whether or not the copy is complete, and, if it is, calls copyComplet()

virtual bool makVrf::DtCopyObject::copyOperationsPending ( ) const
protectedvirtual

Return true if copy operations are complete, else false will signal that there are other operations yet to be done.

Reimplemented in makVrf::DtAggregateCopyObject, and makVrf::DtEntityCopyObject.

virtual void makVrf::DtCopyObject::copyComplete ( )
protectedvirtual

Sends copied message with resultant copied string.

Reimplemented in makVrf::DtAggregateCopyObject.

virtual bool makVrf::DtCopyObject::cancelComplete ( ) const
protectedvirtual

Returns true if cancel is complete.

Reimplemented in makVrf::DtAggregateCopyObject.

virtual void makVrf::DtCopyObject::paste ( const DtVector ,
int  flags = DtAllPasteFlags 
)
virtual

Pastes object given the current information.

If paste is not complete, will send out pasteOperationPending signal. The geocentric coordinate given the the center around which this item should be placed. This object will figure out the correct placement based on that center (in geocentric coordinates)

virtual DtGeodeticCoord makVrf::DtCopyObject::center ( ) const
virtual

Returns the center of the object in geocentric coordinates.

virtual DtVector makVrf::DtCopyObject::localCenter ( ) const
virtual
virtual DtGeodeticCoord makVrf::DtCopyObject::calculateCenter ( ) const
virtual
virtual DtVector makVrf::DtCopyObject::origin ( ) const
virtual

If facade is available, returns the origin of the facade, else returns center().

Returns origin in local coordinates

Reimplemented in makVrf::DtEnvironmentalShapeCopyObject, makVrf::DtEnvironmentalPointCopyObject, and makVrf::DtEntityCopyObject.

virtual DtVector makVrf::DtCopyObject::pasteOrigin ( ) const
virtual

Origin at which to paste the object. Will take into account offsets (if they exist)

Reimplemented in makVrf::DtEntityCopyObject.

virtual void makVrf::DtCopyObject::setGeometricCenter ( const DtGeodeticCoord &  )
virtual

Sets the center of all objects being painted (in geocentric as per center() call).

Will store both the center in a member variable

const DtGeodeticCoord& makVrf::DtCopyObject::geometricCenter ( ) const
virtual void makVrf::DtCopyObject::createFacade ( )
virtual

Creates the facade that will be used to display a temp item during paste operation. Base does nothing.

Reimplemented in makVrf::DtEnvironmentalShapeCopyObject, makVrf::DtEnvironmentalPointCopyObject, and makVrf::DtEntityCopyObject.

virtual void makVrf::DtCopyObject::setOrigin ( const DtGeodeticCoord &  )
virtual

Sets new location of object. Base member is no-op. Location is in local database coordinates.

Reimplemented in makVrf::DtEnvironmentalShapeCopyObject, makVrf::DtEnvironmentalPointCopyObject, and makVrf::DtEntityCopyObject.

const makVrv::DtVrlinkSimulatedBaseState* makVrf::DtCopyObject::readableStateData ( ) const
inline
virtual bool makVrf::DtCopyObject::updateDataBeforeCopy ( ) const
virtual

Returns true as to whether or not to force a data update before copy. Default is false.

virtual void makVrf::DtCopyObject::setUpdateDataBeforeCopy ( bool  )
virtual
virtual void makVrf::DtCopyObject::readComplete ( std::istringstream &  str)
protectedvirtual

Called when reading of buffer for object is complete.

Reimplemented in makVrf::DtAggregateCopyObject.

virtual void makVrf::DtCopyObject::checkPasteComplete ( )
protectedvirtual

Checks to see if paste operation is complete.

If it is, then, will signal pasted, else signals the pasteOperationPending message with the message of what it is doing

virtual bool makVrf::DtCopyObject::pasteComplete ( ) const
protectedvirtual

Returns true if paste operation is complete. Default is true.

Reimplemented in makVrf::DtEntityCopyObject, and makVrf::DtAggregateCopyObject.

virtual void makVrf::DtCopyObject::createObject ( const DtVector )
protectedvirtual

Creates the object locally or on the network.

Default implementation does nothing. Vector is supplied in geocentric coordinates

Reimplemented in BHAVE::BHAVE3DGui::DtBHaveEnvironmentalPointCopyObject, makVrf::DtEntityCopyObject, makVrf::DtEnvironmentalShapeCopyObject, makVrf::DtEnvironmentalPointCopyObject, and makVrf::DtAggregateCopyObject.

virtual int makVrf::DtCopyObject::generateRequestId ( )
protectedvirtual

Generates a request id to match our request.

virtual double makVrf::DtCopyObject::groundHeight ( const DtVector currentLocal) const
protectedvirtual

Returns the height at the given local position.

virtual void makVrf::DtCopyObject::setupOffsets ( const DtGeodeticCoord &  )
protectedvirtual

Sets up offsets from geometric center.

Default adds one offset from center() of object

Reimplemented in makVrf::DtEnvironmentalShapeCopyObject.

virtual void makVrf::DtCopyObject::slot_onStateViewUpdated ( DtVrlinkSimulatedBaseStateView state,
makVrv::DtSimEntry *  simEntry 
)
protectedvirtual
virtual DtVector makVrf::DtCopyObject::offsetLocation ( int  ,
const DtVector loc 
) const
protectedvirtual

Returns the geocentric location of the point at offset location index offset by geocentric loc.

virtual DtGeodeticCoord makVrf::DtCopyObject::calculateOffsetPoint ( const DtGeodeticCoord &  start,
const DtGeodeticCoord &  end,
double &  altAboveTerrain,
double &  altAboveSeaLevel 
) const
protectedvirtual

Calculates an offset point based on the start and end positions.

Return vector is geodetic. The altAboveTerrain and altAboveSeaLevel relate to the start point. Given the clamp type, the local location will return a different value if the offsets are there for above terrain and above sea level. If not, no offset will be applied

virtual DtVector makVrf::DtCopyObject::localLocation ( const DtGeodeticCoord &  ,
int   
) const
protectedvirtual

Given an origin and an index, return local location as an offset from that origin.

Member Data Documentation

boost::signal<void (DtCopyObject*)> makVrf::DtCopyObject::signal_copyCancelled
boost::signal<void (DtCopyObject*, const std::string&)> makVrf::DtCopyObject::signal_copied
boost::signal<void (DtCopyObject*, const std::string&)> makVrf::DtCopyObject::signal_copyOperationPending
boost::signal<void (DtCopyObject*)> makVrf::DtCopyObject::signal_pasted
boost::signal<void (DtCopyObject*, const std::string&)> makVrf::DtCopyObject::signal_pasteOperationPending
boost::signal<void (DtCopyObject*)> makVrf::DtCopyObject::signal_pasteCancelled
makVrv::DtDe& makVrf::DtCopyObject::myDe
protected
std::ostringstream makVrf::DtCopyObject::myOutput
protected
std::string makVrf::DtCopyObject::myName
protected
int makVrf::DtCopyObject::myPasteFlags
protected
DtVrfObjectDataState* makVrf::DtCopyObject::myReadableObjectStateData
protected
makVrv::DtVrlinkSimulatedBaseState* makVrf::DtCopyObject::myReadableStateData
protected
DtGeodeticCoord makVrf::DtCopyObject::myCenter
mutableprotected
CopyOffsets makVrf::DtCopyObject::myOffsets
protected
HeightOffsets makVrf::DtCopyObject::myAltitudeAboveTerrain
protected
HeightOffsets makVrf::DtCopyObject::myAltitudeAboveSeaLevel
protected
DtAltitudeClampType makVrf::DtCopyObject::myAltitudeClampType
protected
DtReferenceEllipsoid makVrf::DtCopyObject::myReferenceEllipsoid
protected
int makVrf::DtCopyObject::myType
protected
std::string makVrf::DtCopyObject::myBuffer
protected
DtGeodeticCoord makVrf::DtCopyObject::myGeometricCenter
protected
bool makVrf::DtCopyObject::myIsLocal
protected
bool makVrf::DtCopyObject::myUpdateDataBeforeCopy
protected

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)