Unigine::Cigi::CigiClientInterface Class
Header: | #include <CigiClientInterface.h> |
This class represents the CIGI Client interface.
CIGI plugin must be loaded.
CigiClientInterface Class
Members
init(int version, const char * host, int send, int recv, int size = 1432)
Initializes the CIGI Client using the given parameters.Arguments
- int version - CIGI protocol version. One of the CIGI_VERSION_* values.
- const char * host - CIGI Host address.
- int send - TCP port number to be used for sending packets to the CIGI Host.
- int recv - TCP port number to be used for receiving packets from the CIGI Host.
- int size - Packet size. The default value is 1432.
int isInitialized()
Returns a value indicating if the CIGI Client was initialized successfully.Return value
1 if the CIGI Client was initialized successfully; otherwise, 0.IView * getView(int view_id)
Returns the interface of the specified view.The specified view will be created, if it doesn't exist yet.
Arguments
- int view_id - ID of the view.
Return value
Pointer to the view interface.IViewGroup * getViewGroup(int group_id)
Returns the interface of the specified view group.The specified view group will be created, if it doesn't exist yet.
Arguments
- int group_id - ID of the view group.
Return value
Pointer to the view group interface.IEntity * getEntity(int entity_id)
Returns the interface of the specified entity.The specified entity will be created, if it doesn't exist yet.
Arguments
- int entity_id - ID of the entity.
Return value
Pointer to the entity interface.void loadEntityTypes(const char * file_name)
Loads entity definitions from the specified .xml file.Arguments
- const char * file_name - Path to the .xml file with entity definitions. By default entity definitions will be loaded from the "entity_types.xml" file.
int findEntityType(const char * type_name)
Returns the entity type ID by its name.Entity type IDs are defined in the entity definition file.
Arguments
- const char * type_name - Entity type name.
Return value
Entity type ID.int findComponentID(int entity_type, const char * name)
Returns the ID of the component with the given name, which belongs to the specified entity type.Arguments
- int entity_type - Entity type ID.
- const char * name - Component name.
Return value
Component ID.void setIGMode(int mode)
Sets the current IG mode.Arguments
- int mode - IG mode. One of the CIGI_MODE_* values.
int getIGMode()
Returns the current IG mode.Return value
IG mode. One of the CIGI_MODE_* values.void setIGStatus(int status)
Sets the current IG status.Arguments
- int status - IG status. The following values are supported:
- 0 - normal
- 1-255 - an error has occurred
int getIGStatus()
Returns the current IG status.Return value
IG status. The following values are supported:- 0 - normal
- 1-255 - an error has occurred
void setDatabase(int db)
Sets the database to be used.Arguments
- int db - ID of the database to be used.
int getDatabase()
Returns the database currently used.Return value
ID of the database currently used.int getInterpolation()
Returns a value indicating if interpolation and extrapolation are enabled.Return value
1 if interpolation and extrapolation are enabled; otherwise, 0.int getIGFrame()
Returns the number of the current frame for the IG.Return value
Current IG frame number.int getHostFrame()
Returns the number of the current frame for the Host.Return value
Current Host frame number.double getHostTime()
Returns the current Host time (with latency corrections).Return value
Current Host time, in seconds.double getLastReceivedHostTime()
Returns the last received Host time.Return value
Last received Host time, in seconds.int isPacketsReceived()
Returns a value indicating if packets where received from the Host after the last update().Return value
1 if packets were received from the Host after the last update(); otherwise, 0.void setConnectCallback(Unigine::CallbackBase * func)
Sets a callback function to be fired when the Host has connected.Arguments
- Unigine::CallbackBase * func - Callback pointer.
Unigine::CallbackBase * getConnectCallback()
Returns a callback to be fired when the Host has connected.Return value
Callback pointer.void setReceivePacketCallback(int cigi_opcode, Unigine::CallbackBase * func)
Sets a callback function to be fired when a packet of the specified type has been received from the Host.Arguments
- int cigi_opcode - CIGI data packet opcode. One of the CIGI_OPCODE_* values.
- Unigine::CallbackBase * func - Callback pointer.
Unigine::CallbackBase * getReceivePacketCallback(int cigi_opcode)
Returns a callback to be fired when a packet of the specified type has been received from the Host.Arguments
- int cigi_opcode - CIGI data packet opcode. One of the CIGI_OPCODE_* values.
Return value
Callback pointer.void setCreateComponentCallback(int component_class, int entity_type, int component_id, Unigine::CallbackBase * func)
Sets a callback function to be fired on creation of the specified type of component with the specified ID and the specified entity type.Arguments
- int component_class - CIGI component class. One of the CIGI_COMPONENT_* values.
- int entity_type - Entity type ID.This value is used only when the component type is set to CIGI_COMPONENT_ENTITY.
- int component_id - Component ID.
- Unigine::CallbackBase * func - Callback pointer.
Unigine::CallbackBase * getCreateComponentCallback(int component_class, int entity_type, int component_id)
Returns a callback to be fired on creation of the specified type of component with the specified ID and the specified entity type.Arguments
- int component_class - CIGI component class. One of the CIGI_COMPONENT_* values.
- int entity_type - Entity type ID.This value is used only when the component type is set to CIGI_COMPONENT_ENTITY.
- int component_id - Component ID.
Return value
Callback pointer.void setDestroyComponentCallback(int component_class, int entity_type, int component_id, Unigine::CallbackBase * func)
Sets a callback function to be fired on deletion of the specified type of component with the specified ID and the specified entity type.Arguments
- int component_class - CIGI component class. One of the CIGI_COMPONENT_* values.
- int entity_type - Entity type ID.This value is used only when the component type is set to CIGI_COMPONENT_ENTITY.
- int component_id - Component ID.
- Unigine::CallbackBase * func - Callback pointer.
Unigine::CallbackBase * getDestroyComponentCallback(int component_class, int entity_type, int component_id)
Returns a callback to be fired on deletion of the specified type of component with the specified ID and the specified entity type.Arguments
- int component_class - CIGI component class. One of the CIGI_COMPONENT_* values.
- int entity_type - Entity type ID.This value is used only when the component type is set to CIGI_COMPONENT_ENTITY.
- int component_id - Component ID.
Return value
Callback pointer.int getNumHostPackets()
Returns the total number of packets received from the Host.Return value
Total number of packets received from the Host.ICigiHostPacket * getHostPacket(int num)
Returns the specified CIGI Host packet.Arguments
- int num - ID of the Host packet.
Return value
CIGI Host packet.void addIGPacket(ICigiIGPacket * packet)
Sends the specified IG packet to the Host.Arguments
- ICigiIGPacket * packet - IG Packet to be sent to the Host.
int showDebug()
Returns a value indicating if the debug information is to be displayed.Return value
1 if the debug information is to be displayed; otherwise, 0.int CIGI_VERSION_30
Description
CIGI protocol version 3.0.int CIGI_VERSION_32
Description
CIGI protocol version 3.2.int CIGI_VERSION_33
Description
CIGI protocol version 3.3.int CIGI_NO_SWAP
Description
Byte-swapping of incoming data is enabled.int CIGI_DO_SWAP
Description
Byte-swapping of incoming data is disabled.int CIGI_MODE_RESET
Description
Reset mode of the IG. This is the IG's initial state upon start-up. When set to this mode, the IG will initialize/reinitialize the simulation. All entities that were instantiated during a previous mission will be destroyed. All environmental properties, views, components, and sensors will revert to their default settings. Any Host-defined rates, trajectories, and collision detection segments and volumes will be removed. The IG will only send the Start of Frame data packet to the Host and will ignore Host inputs except for the IG Mode attribute of the IG Control data packet. The IG will remain in this mode until directed otherwise by the Host or the IG's user interface.int CIGI_MODE_OPERATE
Description
Operate mode of the IG. This is the normal real-time operating mode for the IG. All packets issued by the Host will be processed by the IG. The IG should not perform diagnostics in this mode.int CIGI_MODE_DEBUG
Description
Debug mode of the IG. This mode is similar to the Operate mode but provides data and/or error logging and other debugging features to aid integration or troubleshooting of the Host and IG interface. Because of the overhead of these debugging features, the IG may not always operate in a hard real-time fashion.int CIGI_MODE_OFFLINE
Description
Offline Maintenance mode of the IG. In this mode, the IG ignores all data from the Host and sends only Start of Frame packets. This mode can be activated only from the IG. Because the IG Control packets from the Host are ignored by the IG, the IG must be placed into Reset/Standby mode before the Host can initiate further mode changes.int CIGI_STATE_DISABLED
Description
Entity state - disabled.int CIGI_STATE_ENABLED
Description
Entity state - enabled.int CIGI_STATE_DESTROYED
Description
Entity state - destroyed.int CIGI_SYSTEM_GEODETIC
Description
Geodetic coordinate system.int CIGI_SYSTEM_ENTITY
Description
Local entity coordinate system.int CIGI_SYSTEM_MODEL
Description
Local submodel coordinate system.int CIGI_SCOPE_GLOBAL
Description
Packet data shall be applied to the global scope.int CIGI_SCOPE_REGIONAL
Description
Packet data shall be applied to the specified region.int CIGI_SCOPE_ENTITY
Description
Packet data shall be applied to the specified entity.int CIGI_OPCODE_IG_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ENTITY_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ENTITY_CLAMPED_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_COMPONENT_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_COMPONENT_SHORT_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ARTICULATED_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ARTICULATED_SHORT_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_RATE_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_CELESTIAL_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ATMOSPHERE_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ENVIRONMENT_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_WEATHER_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_MARITIME_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_WAVE_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_TERRESTRIAL_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_VIEW_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SENSOR_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_TRACKER_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_EARTH_MODEL_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_TRAJECTORY_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_VIEW_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SEGMENT_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_VOLUME_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_HAT_HOT_REQUEST
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_LOS_SEGMENT_REQUEST
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_LOS_VECTOR_REQUEST
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_POSITION_REQUEST
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_ENVIRONMENT_REQUEST
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_SURFACE_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_TEXT_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_CIRCLE_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_LINE_DEF
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_CLONE
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_OPCODE_SYMBOL_SHORT_CONTROL
Description
CIGI Host packet opcode (id of incoming packets).int CIGI_ENTITY_NO_CLAMP
Description
Altitude clamping for entity is disabled.int CIGI_ENTITY_NON_CONFORMAL
Description
Altitude parameter specifies an offset of the entity above the ground level.int CIGI_ENTITY_CONFORMAL
Description
Altitude parameter specifies an offset of the entity above the sea level.int CIGI_ANIMATION_STOP
Description
Stop entity animation playback.int CIGI_ANIMATION_PAUSE
Description
Pause entity animation playback.int CIGI_ANIMATION_PLAY
Description
Start entity animation playback.int CIGI_ANIMATION_CONTINUE
Description
Resume entity animation playback.int CIGI_LOS_REQUEST_BASIC
Description
Request with basic Line of Sight Request Packet.int CIGI_LOS_REQUEST_EXT
Description
Request with extended Line of Sight Request Packet.int CIGI_POSITION_REQUEST_ENTITY
Description
Object class Entity of position request.int CIGI_POSITION_REQUEST_PART
Description
Object class Articulated part of position request.int CIGI_POSITION_REQUEST_VIEW
Description
Object class View of position request.int CIGI_POSITION_REQUEST_GROUP
Description
Object class Group of position request.int CIGI_POSITION_REQUEST_TRACKER
Description
Object class Tracker of position request.int CIGI_ENVIRONMENT_REQUEST_MARITIME
Description
Maritime Surface Conditions Response of Environment Request.int CIGI_ENVIRONMENT_REQUEST_TERRESTRIAL
Description
Terrestrial Surface Conditions Response of Environment Request.int CIGI_ENVIRONMENT_REQUEST_WEATHER
Description
Weather Conditions Response of Environment Request.int CIGI_ENVIRONMENT_REQUEST_AEROSOL
Description
Aerosol Concentration Conditions Response of Environment Request.int CIGI_TEXT_TOP_LEFT
Description
Text alignment in the top left corner.int CIGI_TEXT_TOP_CENTER
Description
Text alignment in the top center position.int CIGI_TEXT_TOP_RIGHT
Description
Text alignment in the top right corner.int CIGI_TEXT_CENTER_LEFT
Description
Text alignment in the middle left position.int CIGI_TEXT_CENTER
Description
Text alignment in the center of field.int CIGI_TEXT_CENTER_RIGHT
Description
Text alignment in the middle right position.int CIGI_TEXT_BOTTOM_LEFT
Description
Text alignment in the bottom left corner.int CIGI_TEXT_BOTTOM_CENTER
Description
Text alignment in the bottom center position.int CIGI_TEXT_BOTTOM_RIGHT
Description
Text alignment in the bottom right corner.int CIGI_TEXT_LEFT_TO_RIGHT
Description
Left to Right orientation of text.int CIGI_TEXT_TOP_TO_BOTTOM
Description
Top to Bottom orientation of text.int CIGI_TEXT_RIGHT_TO_LEFT
Description
Right to Left orientation of text.int CIGI_TEXT_BOTTOM_TO_TOP
Description
Bottom to Top orientation of text.int CIGI_LINE_POINT
Description
Point primitive type.int CIGI_LINE_LINE
Description
Line primitive type.int CIGI_LINE_LINE_STRIP
Description
Line Strip primitive type.int CIGI_LINE_LINE_LOOP
Description
Line Loop primitive type.int CIGI_LINE_TRIANGLE
Description
Triangle primitive type.int CIGI_LINE_TRIANGLE_STRIP
Description
Triangle Strip primitive type.int CIGI_LINE_TRIANGLE_FAN
Description
Triangle fan primitive type.int CIGI_SYMBOL_NONE
Description
Attribute Select None in Short Symbol Control.int CIGI_SYMBOL_SURFACE_ID
Description
Attribute Select ID in Short Symbol Control.int CIGI_SYMBOL_PARENT_SYMBOL_ID
Description
Attribute Select Parent Symbol ID in Short Symbol Control.int CIGI_SYMBOL_LAYER
Description
Attribute Select Layer in Short Symbol Control.int CIGI_SYMBOL_FLASH_DUTY
Description
Attribute Select Flash Duty in Short Symbol Control.int CIGI_SYMBOL_FLASH_PERIOD
Description
Attribute Select Flash Period in Short Symbol Control.int CIGI_SYMBOL_POSITION_X
Description
Attribute Select Position X (U) in Short Symbol Control.int CIGI_SYMBOL_POSITION_Y
Description
Attribute Select Position Y (V) in Short Symbol Control.int CIGI_SYMBOL_ROTATION
Description
Attribute Select Rotation in Short Symbol Control.int CIGI_SYMBOL_COLOR
Description
Attribute Select Color in Short Symbol Control.int CIGI_SYMBOL_SCALE_X
Description
Attribute Select Scale X (U) in Short Symbol Control.int CIGI_SYMBOL_SCALE_Y
Description
Attribute Select Scale Y (V) in Short Symbol Control.Last update: 2017-12-21
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)