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

This class handles all the processing of CIGI Symbol Messages. CIGI Symbols require no responses so there is no responder class. CIGI Signals are caught here and processed in a thread safe manner. This handler has access to the render thread. Unlike other CIGI packets, symbols do not have enabled/in use flags for their packet fields, a user must fill all the fields in the packet. If the host does not set a scale in the symbol control, CCL will set that packet with a scale of 0.0, and it will not render here. From the CIGI standard: Once a Symbol Line Definition packet describing a circle symbol is sent to the IG, that symbol’s type may not be changed.If a Symbol Text Definition, Symbol Circle Definition, or Symbol Clone packet is received specifying the same Symbol ID but a different type, then the existing circle symbol will be destroyed along with any children and a new symbol will be created using the new definition packet. When the IG creates a new symbol, that symbol shall always be hidden by default.The symbol shall not be made visible until the Host sends a Symbol Control packet and sets the Symbol State parameter set to Visible( 1 ).

Classes

struct  Circle
 
struct  CircleDefinition
 
struct  PolygonDefinition
 
struct  SymbolControl
 
struct  SymbolSurfaceDefinition
 
struct  TextDefinition
 
struct  Vertex
 

Public Types

enum  SymbolState { Hidden = 0, Visible, Destroyed }
 
enum  SurfaceState { SurfaceActive = 0, SurfaceDestroyed }
 
enum  PrimitiveType {
  Point = 0, Line, LineStrip, LineLoop,
  Triangle, TriangleStrip, TriangleFan
}
 
typedef boost::bimap< unsigned
int, DtWindowObjectAgent * > 
DtSymbolMap
 
typedef boost::bimap< unsigned
int, DtWindowObjectAgent * > 
DtSurfaceMap
 
typedef std::map< unsigned int,
std::vector
< DtWindowObjectAgent * > > 
DtGroupedAgentMap
 

Public Member Functions

virtual ~DtCigiSymbolHandler ()
 

Protected Member Functions

 DtCigiSymbolHandler (DtDe &de, DtCigiConnection &connection)
 
virtual void slot_onEntityDeleted (int entityID)
 
virtual void slot_setChannelOnChildFromSurface ()
 
virtual void setChannelOnChildFromSurface ()
 
 DtCigiSymbolHandler (const DtCigiSymbolHandler &orig)
 
DtCigiSymbolHandleroperator= (const DtCigiSymbolHandler &orig)
 
virtual void slot_onSymbolControlReceived (CigiBaseSymbolCtrl &packet)
 
virtual void slot_onSymbolSurfaceDefinitionReceived (CigiBaseSymbolSurfaceDef &packet)
 
virtual void slot_onSymbolPolygonDefinitionReceived (CigiBaseSymbolLineDef &packet)
 
virtual void slot_onSymbolLineDefinitionReceived (CigiBaseSymbolLineDef &packet)
 
virtual void slot_onSymbolTextDefinitionReceived (CigiBaseSymbolTextDef &packet)
 
virtual void slot_onSymbolCircleDefinitionReceived (CigiBaseSymbolCircleDef &packet)
 
virtual void performSymbolControl (const SymbolControl &symbolControl)
 
virtual void performSymbolSurfaceDefinition (const SymbolSurfaceDefinition &surfaceDefinition)
 
virtual void performPolygonDefinition (const PolygonDefinition &polygonDefinition)
 
virtual void performTextDefinition (const TextDefinition &textDefinition)
 
virtual void performCircleDefinition (const CircleDefinition &circleDefinition)
 
virtual DtWindowObjectAgent * findWindowObjectAgent (unsigned int symbolId)
 
virtual DtWindowObjectAgent * findWindowObjectAgentFromUniqueId (DtUniqueID uniqueId)
 
virtual void createPolygon (const PolygonDefinition &polygonDefinition)
 
virtual void createTextObject (const TextDefinition &textDefinition)
 
virtual void deleteWindowObjectAndChildren (unsigned int symbolId)
 
virtual void deleteSurfaceAndChildren (unsigned int surfaceId)
 
virtual void deleteEntityAttachedSurfaceAndChildren (int entityID)
 

Protected Attributes

std::vector< std::pair
< unsigned int, unsigned int > > 
mySetSurfaceChannelOnSymbolVector
 
boost::signals2::connection myPostTickConnection
 
DtDemyDe
 
DtCigiConnectionmyConnection
 
DtSymbolMap mySymbolMap
 
DtSurfaceMap mySurfaceMap
 
DtSignalConnectionManager mySignalConnections
 
std::multimap< unsigned int,
unsigned int
myEntityIdToSurfaceIdMap
 
std::map< unsigned int,
unsigned int
mySurfaceIdToEntityIdMap
 

Private Member Functions

 DtCigiSymbolHandler ()
 

Friends

class DtCigiSymbolHandlerCreator
 

Member Typedef Documentation

typedef boost::bimap<unsigned int, DtWindowObjectAgent*> makVrv::DtCigiSymbolHandler::DtSymbolMap

Typedef map to store the symbols. Key is Symbol ID.

typedef boost::bimap<unsigned int, DtWindowObjectAgent*> makVrv::DtCigiSymbolHandler::DtSurfaceMap

Typedef map to store the surfaces. Key is surface ID.

typedef std::map<unsigned int, std::vector<DtWindowObjectAgent*> > makVrv::DtCigiSymbolHandler::DtGroupedAgentMap

Typedef to store grouped object agents An ellipse group can have X number of agents associated with it. Key is symbol ID.

Member Enumeration Documentation

If a user sets a symbol to HIDDEN, they MUST set a color when setting the visibility back to visible.

Enumerator
Hidden 
Visible 
Destroyed 

State of a surface.

Enumerator
SurfaceActive 
SurfaceDestroyed 

Enum for polygon & line primitive types.

Enumerator
Point 
Line 
LineStrip 
LineLoop 
Triangle 
TriangleStrip 
TriangleFan 

Constructor & Destructor Documentation

virtual makVrv::DtCigiSymbolHandler::~DtCigiSymbolHandler ( )
virtual

DTOR.

makVrv::DtCigiSymbolHandler::DtCigiSymbolHandler ( DtDe de,
DtCigiConnection connection 
)
protected

CTOR.

makVrv::DtCigiSymbolHandler::DtCigiSymbolHandler ( )
private
makVrv::DtCigiSymbolHandler::DtCigiSymbolHandler ( const DtCigiSymbolHandler orig)
protected

Member Function Documentation

virtual void makVrv::DtCigiSymbolHandler::slot_onSymbolControlReceived ( CigiBaseSymbolCtrl &  packet)
protectedvirtual

Connection thread only methods.

This slot gets called when signal_symbolControlReceived() is raised as CIGI Symbol COntrol packets arrive. Repackages CCL CigiBaseSymbolCtrl as a SymbolControl() struct, and calls performSymbolControl in a thread safe manner.

virtual void makVrv::DtCigiSymbolHandler::slot_onSymbolSurfaceDefinitionReceived ( CigiBaseSymbolSurfaceDef &  packet)
protectedvirtual

This slot gets called when slot_onSymbolSurfaceDefinitionReceived is raised as CIGI Surface Definition packets arrive. Repackages CCL CigiBaseSymbolSurfaceDef as a SymbolSurfaceDefinition() struct, and calls performSymbolSurfaceDefinition in a thread safe manner. When the surface is attached to an entity, the upper 4 bits of entity ID field are used for the view ID.

virtual void makVrv::DtCigiSymbolHandler::slot_onSymbolPolygonDefinitionReceived ( CigiBaseSymbolLineDef &  packet)
protectedvirtual

This slot gets called when a Symbol Polygon Definition packet is received. It is bound to signal_symbolPolygonDefinitionReceived. Polygons are CIGI V4 only, for version 3 line is used, though they both use the same base CigiBaseSymbolLineDef packet. All of the information required to process Polygon definitions are contained within the base packet, this method repackages the information into a PolygonDefinition. This is passed to performPolygonDefinition() in a thread safe manner.

virtual void makVrv::DtCigiSymbolHandler::slot_onSymbolLineDefinitionReceived ( CigiBaseSymbolLineDef &  packet)
protectedvirtual

This slot gets called when a Symbol Line Definition packet is received. It is bound to signal_symbolLineDefinitionReceived. Line definitions are CIGI V3 only, for version 4 polygon is used, though they both use the same base CigiBaseSymbolLineDef packet. All of the information required to process Polygon definitions are contained within the base packet, this method repackages the information into a PolygonDefinition. This is passed to performPolygonDefinition() in a thread safe manner.

virtual void makVrv::DtCigiSymbolHandler::slot_onSymbolTextDefinitionReceived ( CigiBaseSymbolTextDef &  packet)
protectedvirtual

This slot gets called when a Symbol Text Definition packet is received. It repackages the CCL packet into a TextDefinition, and passes it to performTextDefinition() in a thread safe manner. We do not support orientation.

virtual void makVrv::DtCigiSymbolHandler::slot_onSymbolCircleDefinitionReceived ( CigiBaseSymbolCircleDef &  packet)
protectedvirtual

This slot gets called when a Symbol Circle Definition packet is received. It repackages the CCL packet into a CircleDefinition, and passes it to performCircleDefinition() in a thread safe manner. We support this entire packet bar stipple pattern length.

virtual void makVrv::DtCigiSymbolHandler::performSymbolControl ( const SymbolControl symbolControl)
protectedvirtual

The following group of methods will execute in the render thread when the CIGI connection is running a separate thread.

Performs a symbol control in line with the CIGI standard. If a user sets a symbol to HIDDEN, they MUST set a color when setting the visibility back to visible.

virtual void makVrv::DtCigiSymbolHandler::performSymbolSurfaceDefinition ( const SymbolSurfaceDefinition surfaceDefinition)
protectedvirtual

Creates a DtWindowSurface in line with the CIGI standard. The surface can set on specific channels, a user can specify the ViewID associated with the cigiView# keyword. When the surface is attached to an entity, the upper 4 bits of entity ID field are used for the view ID. We only support attaching an entity in a billboard fashion, there are no 3D symbols.

virtual void makVrv::DtCigiSymbolHandler::performPolygonDefinition ( const PolygonDefinition polygonDefinition)
protectedvirtual

Performs the polygon definition in line with the CIGI stanard. If the symbol ID does not exist, createPolygon() is called. Otherwise, the line/polygon is updated if the symbol ID in the definition is assocaited with a line/polygon. If the ID is is a symbol of a different type, that symbol, it's children are deleted, and a new line/polygon is created.

virtual void makVrv::DtCigiSymbolHandler::performTextDefinition ( const TextDefinition textDefinition)
protectedvirtual

Performs the text definition in line with the CIGI standard. Modifies the symbol with the matching ID, or creates a new symbol if none exists or the type is different by calling createTextObject(). We do not support orientation.

virtual void makVrv::DtCigiSymbolHandler::performCircleDefinition ( const CircleDefinition circleDefinition)
protectedvirtual

Performs the circle definition in line with the CIGI standard. Modifies the symbol with the matching ID, or creates a new symbol if none exists or the type is different. Creates DtWindowEllipseAgents.

virtual DtWindowObjectAgent* makVrv::DtCigiSymbolHandler::findWindowObjectAgent ( unsigned int  symbolId)
protectedvirtual

Attempts to find the DtWindowObjectAgent associated with the passed in symbol ID. First it gets the unique ID from the DtSymbolMap(), if it exists, then finds the agent. Returns 0 otherwise.

virtual DtWindowObjectAgent* makVrv::DtCigiSymbolHandler::findWindowObjectAgentFromUniqueId ( DtUniqueID  uniqueId)
protectedvirtual

The following group of methods will execute in the render thread when the CIGI connection is running a separate thread.

Performs a symbol control in line with the CIGI standard. If a user sets a symbol to HIDDEN, they MUST set a color when setting the visibility back to visible.

virtual void makVrv::DtCigiSymbolHandler::createPolygon ( const PolygonDefinition polygonDefinition)
protectedvirtual

Creates a new DtWindowLineAgent or DtWindowPolygonAgent from the passed in polygon definition, the agent is stored in the DtSymbolMap()

virtual void makVrv::DtCigiSymbolHandler::createTextObject ( const TextDefinition textDefinition)
protectedvirtual

Creates a new DtWindowTextAgent from the pass in text definition, the agent is stored in the DtSymbolMap()

virtual void makVrv::DtCigiSymbolHandler::deleteWindowObjectAndChildren ( unsigned int  symbolId)
protectedvirtual

Delete the window object and all of it's children.

virtual void makVrv::DtCigiSymbolHandler::deleteSurfaceAndChildren ( unsigned int  surfaceId)
protectedvirtual

Delete surface and all of it's children Needed as surfaces are stored separately under their IDs.

virtual void makVrv::DtCigiSymbolHandler::deleteEntityAttachedSurfaceAndChildren ( int  entityID)
protectedvirtual

Delete surface and all of it's children Needed as surfaces attached to entitys are stored separately in a map with entity IDs.

virtual void makVrv::DtCigiSymbolHandler::slot_onEntityDeleted ( int  entityID)
protectedvirtual

When an entity is deleted this slot is called which calls deleteEntityAttachedSurfaceAndChildren in a thread safe manner. Connection thread only.

virtual void makVrv::DtCigiSymbolHandler::slot_setChannelOnChildFromSurface ( )
protectedvirtual

This slot is connected to the postTick signal, it calls setChannelOnChildFromSurface in a thread safe manner. Processes any pairs in mySetSurfaceChannelOnSymbolVector setting the surfaces channel on the symbols Connection thread only.

virtual void makVrv::DtCigiSymbolHandler::setChannelOnChildFromSurface ( )
protectedvirtual

Finds the symbol and the surface, sets the surfaces channel on the symbol if they are different. This method runs in the render thread when multithreading is on.

DtCigiSymbolHandler& makVrv::DtCigiSymbolHandler::operator= ( const DtCigiSymbolHandler orig)
protected

Friends And Related Function Documentation

friend class DtCigiSymbolHandlerCreator
friend

Member Data Documentation

std::vector<std::pair<unsigned int, unsigned int> > makVrv::DtCigiSymbolHandler::mySetSurfaceChannelOnSymbolVector
protected

Used in performSymbolControl if the surface and/or the symbol have not been created yet and they require a channel change, they are stored here until the next tick when they have been created and can be moved channels. Pair is <surfaceID,symbolId> This vector is accessed in the render thread. Do not access it in the CIGI thread if multithreading is on.

boost::signals2::connection makVrv::DtCigiSymbolHandler::myPostTickConnection
protected
DtDe& makVrv::DtCigiSymbolHandler::myDe
protected
DtCigiConnection& makVrv::DtCigiSymbolHandler::myConnection
protected
DtSymbolMap makVrv::DtCigiSymbolHandler::mySymbolMap
protected

This map is accessed in the render thread. Do not access it in the CIGI thread if multithreading is on.

DtSurfaceMap makVrv::DtCigiSymbolHandler::mySurfaceMap
protected

This map is accessed in the render thread. Do not access it in the CIGI thread if multithreading is on.

std::multimap<unsigned int, unsigned int> makVrv::DtCigiSymbolHandler::myEntityIdToSurfaceIdMap
protected

These are separate because when entities get deleted we need to remove the surface and all the symbols, a CIGI entity has no knowledge of a surface ID. This map is accessed in the render thread. Do not access it in the CIGI thread if multithreading is on.

std::map< unsigned int, unsigned int > makVrv::DtCigiSymbolHandler::mySurfaceIdToEntityIdMap
protected

These are separate because when entities get deleted we need to remove the surface and all the symbols, a CIGI entity has no knowledge of a surface ID. This map is accessed in the render thread. Do not access it in the CIGI thread if multithreading is on.

DtSignalConnectionManager makVrv::DtCigiSymbolHandler::mySignalConnections
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)