DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyNetInterface Class Referenceabstract

This class provides accessors to the interface parameters, as well as functions for going online and offline. More...

#include <diguy_module_net.h>

Public Member Functions

virtual int go_online (diguyScenario *scenario, void *exconn=NULL)=0
 This function tells DI-Guy that it should start talking over VR-Link. More...
 
virtual int go_offline ()=0
 This function tells DI-Guy that it should stop talking over VR-Link. More...
 
virtual int get_online ()=0
 This function asks if DI-Guy is connected to the network. More...
 
virtual int set_cfg_file (const char *cfg_filename)=0
 This function sets the filename of the VR-Link configuration file that will be read by the DI-Guy software. More...
 
virtual int update ()=0
 This function tells DI-Guy that it should read PDUs from the network and process them. More...
 
virtual int set_exercise (int exercise)=0
 Sets the exercise id to be used by DI-Guy networking. More...
 
virtual int get_exercise ()=0
 Gets the exercise id being used by DI-Guy networking. More...
 
virtual int set_host (int host)=0
 Sets the host id to be used by DI-Guy networking. More...
 
virtual int get_host ()=0
 Gets the host id being used by DI-Guy networking. More...
 
virtual int set_site (int site)=0
 Sets the site id to be used by DI-Guy networking. More...
 
virtual int get_site ()=0
 Gets the site id being used by DI-Guy networking. More...
 
virtual int set_port (int port)=0
 Sets the network port number to be used by DI-Guy networking. More...
 
virtual int get_port ()=0
 Gets the port number of the port being used for DI-Guy networking. More...
 
virtual int set_ipaddr (const char *ipaddr)=0
 Sets the IP address to be used by DI-Guy networking. More...
 
virtual int get_ipaddr (char **ipaddr)=0
 Gets the IP address currently being used by DI-Guy networking. More...
 
virtual int set_display_remote_chars (int display)=0
 Sets whether DI-Guy networking will display remote characters. More...
 
virtual int get_display_remote_chars ()=0
 Returns whether DI-Guy networking will display remote characters when online. More...
 
virtual void set_send_custom_pdus (int)=0
 This function sets whether DI-Guy is sending custom pdus. More...
 
virtual int get_send_custom_pdus ()=0
 This function returns whether DI-Guy is sending custom pdus. More...
 
virtual int get_send_diguy_125_appearance_packets ()=0
 This function returns whether DI-Guy sends custom pdus that concatenate hand item with the body appearance name. More...
 
virtual void set_send_diguy_125_appearance_packets (int)=0
 This function set whether whether DI-Guy sends custom pdus that concatenate hand item with the body appearance name. More...
 
virtual void enter_vpnet_mode ()=0
 Turns the 'never create character' bit on. More...
 
virtual diguyCharacterget_character_from_id (char const *id)=0
 returns the diguyCharacter associated with the entity id specified. More...
 
virtual char * get_name_from_entity (void *reflected_entity)=0
 Returns the name corresponding to the entity. More...
 
virtual int set_publish_local_chars (int publish)=0
 Sets whether DI-Guy networking will publish local characters to the network. More...
 
virtual int get_publish_local_chars ()=0
 Returns whether DI-Guy networking will publish local characters when online. More...
 
virtual int set_position_offset (float z, float yaw, float roll, float pitch)=0
 This function sets the position offset which is currently added to each character when it is published, and subtracted from each character when it is reflected. More...
 
virtual int get_position_offset (float *z, float *yaw, float *roll, float *pitch)=0
 This function gets the position offset which is currently added to each character when it is published, and subtracted from each character when it is reflected. More...
 
virtual void * get_next_participant_name (char *buf, void *handle)=0
 This function allows iteration through the list of names remote VR-Link hosts that DI-Guy knows about. More...
 
virtual int get_model_from_septet (const char **chartype, const char **appearance, const char **hand_item, const int septet[7])=0
 Fetches what character type and what appearance should be used for a given DIS entity type septet. More...
 
virtual int get_septet_from_model (int septet[7], const char *chartype, const char *appearance, const char *hand_item)=0
 Fetches what DIS entity type septet should be used for a given character type and appearance. More...
 
virtual void set_timeout_interval (float interval)=0
 This functions sets the amount of time that can elapse since the last update before an entity is timed out. More...
 
virtual float get_timeout_interval ()=0
 Returns: timeout value in seconds; see set_timeout_interval() More...
 
virtual void set_time_to_live (int time_to_live)=0
 This function sets the number of hops a packet can take before being killed. More...
 
virtual int get_time_to_live ()=0
 Returns: number of hops until packed is killed; see set_time_to_live() More...
 
Coordinate System Functions
virtual int set_lat_lon (double lat, double lon)=0
 Sets the latitude and longitude to be used by DI-Guy networking. More...
 
virtual int get_lat_lon (double *lat, double *lon)=0
 Gets the latitude and longitude currently being used by DI-Guy networking for the placement of the database origin. More...
 
virtual void format_lat_or_lon (char *outbuf, double value, bool is_lat, bool is_decimal, bool value_is_degrees)=0
 returns a string of the form More...
 
virtual int set_utm_zone (int zone, int southzone)=0
 Sets the UTM zone of the location currently being used by DI-Guy networking for the placement of the database origin. More...
 
virtual int set_utm (int zone, int southzone, double easting, double northing)=0
 Sets, in UTM coordinates, the location currently being used by DI-Guy networking for the placement of the database origin. More...
 
virtual int get_utm (int *zone, int *southzone, double *easting, double *northing)=0
 Gets, in UTM coordinates, the location currently being used by DI-Guy networking for the placement of the database origin. More...
 
virtual int set_use_user_defined_coords (int use_user_defined)=0
 This function sets whether user-defined latitude/longitude coordinates should be used for the origin of the database, or the coordinates that come from graphics files for scenario scene objects. More...
 
virtual int get_use_user_defined_coords ()=0
 Returns: 0 if graphics file coordinates are used, 1 if user-defined coordinates are used. More...
 
virtual int get_earth_coord (char *outbuf, const float x, const float y, const float z)=0
 Converts a 3d database-origin-relative location into a string describing it in earth coordinates. More...
 
virtual void toggle_earth_coord_format ()=0
 Changes the format of the output of get_earth_coord. More...
 
virtual int set_use_database_coords (int use_dbc)=0
 Sets whether networking should use database coordinates or not. More...
 
virtual int get_num_coordinate_systems ()
 This function returns the number of potential coordinate converters that the networking module supports. More...
 
virtual const char * get_coordinate_system_name (int index)
 This function returns the name of the coordinate system at the specified index. More...
 
virtual int set_coordinate_system_type (const char *name)
 Sets the coordinate system based on the name given. More...
 
virtual const char * get_coordinate_system_type_name ()
 returns the coordinate system name. More...
 
virtual int set_coordinate_system_type (diguyCoordinateSystemType system_type)
 Sets the coordinate system based on the system type. More...
 
virtual diguyCoordinateSystemType get_coordinate_system_type ()
 Gets the current coordinate system in use. More...
 
virtual void set_use_UTM_standard_offsets (int standard_offsets)
 Documentation Pending. More...
 
virtual int get_use_UTM_standard_offsets ()
 Documentation Pending. More...
 
virtual double parse_dms_to_radians (const char *dms_string)=0
 Parses a string of the form. More...
 
virtual int convert_mgrs_to_local (const char *MGRS_str, float *x, float *y, float *z)=0
 Documentation Pending. More...
 
virtual const char * convert_local_to_mgrs (float x, float y, float z)=0
 Documentation Pending. More...
 
virtual float convert_local_to_lat (float x, float y, float z)=0
 Documentation Pending. More...
 
virtual float convert_local_to_long (float x, float y, float z)=0
 Documentation Pending. More...
 
virtual const char * convert_local_to_lat_long_string (float x, float y, float z)=0
 Documentation Pending. More...
 
virtual int convert_lat_long_to_local (float lat, float lon, float *x, float *y, float *z)=0
 Documentation Pending. More...
 
Ground Clamp Functions
virtual int set_ground_clamp_reflected_land_entities_enabled (int enabled)
 Sets whether land-based network entities will be ground clamped, changing their altitude to better correlate with the local terrain. More...
 
virtual int get_ground_clamp_reflected_land_entities_enabled ()
 Returns: 1 if land-based network entities will be ground clamped, 0 if not. More...
 
virtual int set_ground_clamp_reflected_land_entities_from_host (int from_host)
 Similar to set_ground_clamp_reflected_land_entities_enabled(), but will clamp only entities from the specified host. More...
 
virtual int get_ground_clamp_reflected_land_entities_from_host ()
 Returns: host whose land entities will be clamped; see set_ground_clamp_reflected_land_entities_from_host() More...
 
virtual int set_ground_clamp_max_climb (float max_climb)
 Sets the maximum upward change in altitude that ground clamping will have. More...
 
virtual float get_ground_clamp_max_climb ()
 Returns: maximum upward change in altitude from ground clamping, in meters. More...
 
virtual int set_ground_clamp_max_drop (float max_drop)
 Similar to set_ground_clamp_max_climb(), but for downward change. More...
 
virtual float get_ground_clamp_max_drop ()
 Returns: maximum downward change in altitude from ground clamping, in meters. More...
 
Network Time Functions
virtual void set_network_datetime_mode (diguyDatetimeNetworkMode network_datetime_mode)
 Sets whether network datetime data will be broadcast, received, or ignored. More...
 
virtual diguyDatetimeNetworkMode get_network_datetime_mode ()
 Returns: how handle network datetime data will be handled; see set_network_datetime_mode(). More...
 
virtual void set_network_datetime_broadcast_interval (float broadcast_interval)
 Sets how often datetime data will be broadcast if this host is in mode DIGUY_DATETIME_NETWORK_MODE_BROADCAST. More...
 
virtual float get_network_datetime_broadcast_interval ()
 Returns: how often datetime data will broadcast, in seconds. More...
 
Sync Mode Functions

These functions enable DI-Guy to do pseudo frame syncing across multiple machines.

virtual int set_sync_mode_enabled (int enabled)=0
 Sets whether sync mode will be enabled when online. More...
 
virtual int get_sync_mode_enabled ()=0
 Gets whether sync mode is enabled when online. More...
 
virtual int set_sync_mode_master (int master)=0
 Sets whether this machine will serve as sync master when online and in sync mode. More...
 
virtual int get_sync_mode_master ()=0
 Gets whether this machine will serve as sync master when online and in sync mode. More...
 
virtual int set_sync_mode_slave_cam (int sl_cam)=0
 Sets whether this machine's camera will be slaved to a remote master when online and in sync mode and not sync master. More...
 
virtual int get_sync_mode_slave_cam ()=0
 Gets whether this machine's camera will be slaved to a remote master when online, in sync mode, and not sync master. More...
 
virtual int set_sync_mode_camera_offset (float offset_r, float offset_y, float offset_p)=0
 This function sets the camera orientation offset to be used in sync_mode (when VR-Link is online). More...
 
virtual int get_sync_mode_camera_offset (float *offset_r, float *offset_y, float *offset_p)=0
 This function gets the camera orientation offset to be used in sync_mode (when VR-Link is online). More...
 
virtual int set_sync_mode_camera_slaved (int slaved)=0
 This function sets whether the camera will be slaved when VR-Link is online, in sync mode, and not sync master. More...
 
virtual int get_sync_mode_camera_slaved ()=0
 This function gets whether the camera is currently slaved. More...
 
virtual int set_camera_details_out_of_date ()=0
 Lets VR-Link know that the user has moved the camera, so that if it is in sync mode, and is the sync master, it can let other hosts know the new camera position so they can move their cameras. More...
 
virtual int set_use_adaptive_guide (int use_adaptive_guide)=0
 Lets DI-Guy know that it should use an adaptive guide that attempts to fix reckoning errors by stepping. More...
 
virtual int get_use_adaptive_guide ()=0
 Returns: 0 if adaptive guide is disabled 1 otherwise. More...
 
Experimental Functions

The following functions are experimental and may change or disappear with no warning.

virtual int set_federation_name (const char *federation_name)
 
virtual const char * get_federation_name ()
 
virtual int set_fom_file_name (const char *file_name)
 
virtual const char * get_fom_file_name ()
 
virtual int set_base_module_name (const char *file_name)
 
virtual const char * get_base_module_name ()
 
virtual int set_culling_enabled (int culling)
 
virtual int get_culling_enabled ()
 
virtual void set_network_datetime_enable_diguy_custom_pdus (int enable_diguy_custom_pdus)
 Sets whether network datetime data will be broadcast via custom PDUs. More...
 
virtual int get_network_datetime_enable_diguy_custom_pdus ()
 Returns: 1 if network datetime data will be broadcast via custom PDUs, 0 if not. More...
 
virtual void set_network_datetime_enable_dis_start_resume_pdus (int enable_dis_start_resume_pdus)
 Sets whether this host will send DIS standard start/resume PDUs. More...
 
virtual int get_network_datetime_enable_dis_start_resume_pdus ()
 Returns: 1 if DIS start/resume should be send, 0 if not. More...
 

Private Functions

The functions and variables past this point are for internal use only.

No external access to them is expected or necessary.

diguyNetInterfaceData * d
 
virtual int server_mode ()=0
 internal functions More...
 
virtual int client_mode ()=0
 
virtual void establish_new_offsets ()=0
 
virtual void draw ()=0
 
virtual bdiDataTracker * get_network_datetime_data_tracker ()=0
 
virtual int update_coordinate_sytem ()=0
 
 diguyNetInterface ()
 A private constructor. More...
 
virtual ~diguyNetInterface ()
 A private destructor. More...
 
int diguy_module_net_initialize ()
 This function allows VR-Link to install some callbacks so that DSS file load and save will include VR-Link-specific info. More...
 

Detailed Description

This class provides accessors to the interface parameters, as well as functions for going online and offline.

Constructor & Destructor Documentation

diguyNetInterface::diguyNetInterface ( )
protected

A private constructor.

Use the DI-Guy function diguy_module_net_initialize() to create a diguyNetInterface. Use get_net_interface() to obtain a pointer to it.

virtual diguyNetInterface::~diguyNetInterface ( )
protectedvirtual

A private destructor.

Use the DI-Guy function diguy_module_net_deinitialize() to destroy the diguyNetInterface.

Member Function Documentation

virtual int diguyNetInterface::go_online ( diguyScenario scenario,
void *  exconn = NULL 
)
pure virtual

This function tells DI-Guy that it should start talking over VR-Link.

It should be called when DI-Guy should join an exercise.

Parameters
scenariopointer to the diguyScenario which will be connected to the network
exconnoptional pointer to a VR-Link exercise connection to use

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::go_offline ( )
pure virtual

This function tells DI-Guy that it should stop talking over VR-Link.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_online ( )
pure virtual

This function asks if DI-Guy is connected to the network.

Returns:

1 if yes, 0 if no

virtual int diguyNetInterface::set_cfg_file ( const char *  cfg_filename)
pure virtual

This function sets the filename of the VR-Link configuration file that will be read by the DI-Guy software.

The default is "network.cfg". This function must be called before the network module is initialized.

C++ only

Parameters
cfg_filefilename of desired configuration file

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::update ( )
pure virtual

This function tells DI-Guy that it should read PDUs from the network and process them.

Call this function periodically.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::set_exercise ( int  exercise)
pure virtual

Sets the exercise id to be used by DI-Guy networking.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
exercisethe exercise id to use

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_exercise ( )
pure virtual

Gets the exercise id being used by DI-Guy networking.

Returns:

the exercise id

virtual int diguyNetInterface::set_host ( int  host)
pure virtual

Sets the host id to be used by DI-Guy networking.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
hostthe host id to use; the host id identifies the local machine

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_host ( )
pure virtual

Gets the host id being used by DI-Guy networking.

Returns:

the host id

virtual int diguyNetInterface::set_site ( int  site)
pure virtual

Sets the site id to be used by DI-Guy networking.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
sitethe site id to use; the site id identifies where the local machine is located

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_site ( )
pure virtual

Gets the site id being used by DI-Guy networking.

Returns:

the site id

virtual int diguyNetInterface::set_port ( int  port)
pure virtual

Sets the network port number to be used by DI-Guy networking.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
portthe port number to use

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_port ( )
pure virtual

Gets the port number of the port being used for DI-Guy networking.

Returns:

the port address

virtual int diguyNetInterface::set_ipaddr ( const char *  ipaddr)
pure virtual

Sets the IP address to be used by DI-Guy networking.

This address is the address to which messages are sent. Normally, it is a broadcast or multicast address.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
ipaddrthe IP address

ipaddr is a string containing 4 integers separated by periods, or the null string, which means "let DI-Guy choose the address". An address of "0" or "0.0.0.0" means broadcast.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_ipaddr ( char **  ipaddr)
pure virtual

Gets the IP address currently being used by DI-Guy networking.

This address is the address to which messages are sent. Normally this is a broadcast or multicast address.

Parameters
ipaddrIP address, returned; see below

Returns:

0 on success, -1 on failure

ipaddr is a char**, into which a char* will be placed. This char* points to static data owned by DI-Guy. Do not store this pointer, and do not modify what it points to. Copy the strings you need out of the static buffer. (Assignment of a char* to a Microsoft CString will work very nicely, for example.)

ipaddr is a string containing 4 integers separated by periods.

virtual int diguyNetInterface::set_display_remote_chars ( int  display)
pure virtual

Sets whether DI-Guy networking will display remote characters.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
displaypass 1 if DI-Guy networking should display remote characters, 0 if not

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_display_remote_chars ( )
pure virtual

Returns whether DI-Guy networking will display remote characters when online.

Returns:

1 if enabled, 0 if not

virtual void diguyNetInterface::set_send_custom_pdus ( int  )
pure virtual

This function sets whether DI-Guy is sending custom pdus.

0 if custom pdus should not be sent, 1 if custom pdus should be sent

virtual int diguyNetInterface::get_send_custom_pdus ( )
pure virtual

This function returns whether DI-Guy is sending custom pdus.

Returns:

0 if custom pdus are not being sent, 1 if custom pdus are being sent

virtual int diguyNetInterface::get_send_diguy_125_appearance_packets ( )
pure virtual

This function returns whether DI-Guy sends custom pdus that concatenate hand item with the body appearance name.

DI-Guy 13.0 and up separate these.

virtual void diguyNetInterface::set_send_diguy_125_appearance_packets ( int  )
pure virtual

This function set whether whether DI-Guy sends custom pdus that concatenate hand item with the body appearance name.

DI-Guy 13.0 and up separate these.

virtual void diguyNetInterface::enter_vpnet_mode ( )
pure virtual

Turns the 'never create character' bit on.

virtual diguyCharacter* diguyNetInterface::get_character_from_id ( char const *  id)
pure virtual

returns the diguyCharacter associated with the entity id specified.

Parameters
idUnder HLA, two formats are permitted: the H L A object name, or the DIS entity identifier ("site:application:entity", where each is an integer)

Under DIS, only the DIS Entity Identifier is permitted.

virtual char* diguyNetInterface::get_name_from_entity ( void *  reflected_entity)
pure virtual

Returns the name corresponding to the entity.

The caller must delete the returned string.

Parameters
reflected_entityentity to be named

Returns:

name of reflected entity

virtual int diguyNetInterface::set_publish_local_chars ( int  publish)
pure virtual

Sets whether DI-Guy networking will publish local characters to the network.

This function WILL succeed even if DI-Guy is on-line (is participating in an exercise).

Parameters
publishpass 1 if DI-Guy networking should publish local characters to the network, 0 if not

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_publish_local_chars ( )
pure virtual

Returns whether DI-Guy networking will publish local characters when online.

Returns:

1 if enabled, 0 if not

virtual int diguyNetInterface::set_position_offset ( float  z,
float  yaw,
float  roll,
float  pitch 
)
pure virtual

This function sets the position offset which is currently added to each character when it is published, and subtracted from each character when it is reflected.

This is useful to compensate for inter-application location error.

Parameters
zz offset in meters
yaworientation offset in degrees
rollorientation offset in degrees
pitchorientation offset in degrees

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_position_offset ( float *  z,
float *  yaw,
float *  roll,
float *  pitch 
)
pure virtual

This function gets the position offset which is currently added to each character when it is published, and subtracted from each character when it is reflected.

The offset is useful to compensate for inter-application database location and orientation error.

Parameters
zz offset in meters
yaworientation offset in degrees
rollorientation offset in degrees
pitchorientation offset in degrees

Returns:

0 on success, -1 on failure

virtual void* diguyNetInterface::get_next_participant_name ( char *  buf,
void *  handle 
)
pure virtual

This function allows iteration through the list of names remote VR-Link hosts that DI-Guy knows about.

Parameters
bufdestination buffer for host name (64 bytes is plenty)
handlereturn value from last call to the function; pass NULL to get the first host name; pass previous return value to get the next host name

Returns:

void* to be passed as handle argument on the next call; NULL when end of list is reached

virtual int diguyNetInterface::get_model_from_septet ( const char **  chartype,
const char **  appearance,
const char **  hand_item,
const int  septet[7] 
)
pure virtual

Fetches what character type and what appearance should be used for a given DIS entity type septet.

Parameters
chartypeaddress of char*, for returning a string which
namesthe DI Guy character type
appearanceaddress of char*, for returning a string which
namesthe DI Guy character appearance
septetarray of seven integers specifying the kind, domain, country, category, subCategory, specific, and extra of the entity in question

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_septet_from_model ( int  septet[7],
const char *  chartype,
const char *  appearance,
const char *  hand_item 
)
pure virtual

Fetches what DIS entity type septet should be used for a given character type and appearance.

Parameters
chartypea string which names the DI-Guy character type
appearancea string which names the DI-Guy character appearance
septetarray of seven integers, returned, indicating the kind, domain, country, category, subCategory, specific, and extra of the entity in question

Returns:

0 on success, -1 on failure

virtual void diguyNetInterface::set_timeout_interval ( float  interval)
pure virtual

This functions sets the amount of time that can elapse since the last update before an entity is timed out.

The default is 12 seconds.

Parameters
intervalnumber of seconds until timeout
virtual float diguyNetInterface::get_timeout_interval ( )
pure virtual

Returns: timeout value in seconds; see set_timeout_interval()

virtual void diguyNetInterface::set_time_to_live ( int  time_to_live)
pure virtual

This function sets the number of hops a packet can take before being killed.

Setting this value to -1 means that the system default will be used.

This value must be set before the connection goes online.

Parameters
time_to_livenumber of hops until packed is killed
virtual int diguyNetInterface::get_time_to_live ( )
pure virtual

Returns: number of hops until packed is killed; see set_time_to_live()

virtual int diguyNetInterface::set_lat_lon ( double  lat,
double  lon 
)
pure virtual

Sets the latitude and longitude to be used by DI-Guy networking.

The latitude and longitude are taken as the location, on Earth, of the origin of the database.

The function will fail if DI-Guy is on-line (is participating in an exercise).

Parameters
latthe latitude in radians, positive north
lonthe longitude in radians, positive east

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_lat_lon ( double *  lat,
double *  lon 
)
pure virtual

Gets the latitude and longitude currently being used by DI-Guy networking for the placement of the database origin.

Parameters
latlatitude of origin, returned; see below
lonlongitude of origin, returned; see below

Returns:

0 on success, -1 on failure

lat and lon are char**'s, into which char*'s will be placed. These char*'s point to static data owned by DI-Guy. Do not store these pointers, and do not modify what they point to. Copy the strings needed out of the static buffers. (Assignment of a char* to a Microsoft CString will work very nicely, for example.)

lat and lon are expressed as strings of the form:

  • [-]d [N|W|S|E] or
  • [-]d m [N|W|S|E] or
  • [-]d m s [N|W|S|E]

N and E are taken as positive. S and W will negate the value otherwise computed. d, m, and s are positive, floating point values, taken as degrees, minutes, and seconds, respectively. A leading minus sign will negate the entire value otherwise computed (so, e.g., a '-' and a 'S' will result in a double- negation).

virtual void diguyNetInterface::format_lat_or_lon ( char *  outbuf,
double  value,
bool  is_lat,
bool  is_decimal,
bool  value_is_degrees 
)
pure virtual

returns a string of the form

 - d [N|W|S|E]     or
 - d m s [N|W|S|E]

N and E are used for positive angles. S and W are used for negative angles. In the d m s format, d and m are integers (degrees and minutes) and s (seconds) is a floating point value. In the d format, d (degrees) is a floating point value.

Parameters
outbufa buffer into which to copy the resulting string
valuethe lat or lon value to be converted into a string
is_latboolean indicating latitude (North/South) rather than longitude(East/West)
is_decimalboolean indicating that decimal degrees are desired, rather than degrees, minutes, and seconds
value_is_degreesboolean indicating whether the input value is in degrees (as opposed to radians)
virtual int diguyNetInterface::set_utm_zone ( int  zone,
int  southzone 
)
pure virtual

Sets the UTM zone of the location currently being used by DI-Guy networking for the placement of the database origin.

The easting and northing are assumed not to change.

Parameters
zonethe utm zone
southzonepass 1 if the origin is in the southern hemisphere

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::set_utm ( int  zone,
int  southzone,
double  easting,
double  northing 
)
pure virtual

Sets, in UTM coordinates, the location currently being used by DI-Guy networking for the placement of the database origin.

Parameters
zonethe utm zone
southzonepass 1 if the origin is in the southern hemisphere
eastingthe normalized (positive only) easting of the database origin within the zone
northingthe normalized (positive only) northing of the database origin within the zone

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_utm ( int *  zone,
int *  southzone,
double *  easting,
double *  northing 
)
pure virtual

Gets, in UTM coordinates, the location currently being used by DI-Guy networking for the placement of the database origin.

Parameters
zonethe utm zone, returned
southzone1 if the origin is in the southern hemisphere, returned
eastingthe normalized (positive only) easting of the database origin within the zone, returned
northingthe normalized (positive only) northing of the database origin within the zone, returned

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::set_use_user_defined_coords ( int  use_user_defined)
pure virtual

This function sets whether user-defined latitude/longitude coordinates should be used for the origin of the database, or the coordinates that come from graphics files for scenario scene objects.

Parameters
use_user_definedpass 1 if user-defined coordinates should be used, 0 if coordinates from graphics file should be used

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_use_user_defined_coords ( )
pure virtual

Returns: 0 if graphics file coordinates are used, 1 if user-defined coordinates are used.

virtual int diguyNetInterface::get_earth_coord ( char *  outbuf,
const float  x,
const float  y,
const float  z 
)
pure virtual

Converts a 3d database-origin-relative location into a string describing it in earth coordinates.

This string could be in a number of different formats including decimal lat/lon, dms lat/lon, and UTM.

Parameters
outbufbuffer into which to put the output string
x,y,z3 floats specifying location

Returns:

0 on success, -1 on failure. Fails if DI-Guy Scenario is not currently on the network, meaning that a database-to-earth coordinate conversion cannot be performed.

virtual void diguyNetInterface::toggle_earth_coord_format ( )
pure virtual

Changes the format of the output of get_earth_coord.

Toggles between UTM, dms lat/lon, decimal lat/lon, and "punting", meaning that the caller of get_earth_coord() should fend for itself. This generally means that the caller will use database-origin-relative coordinates.

virtual int diguyNetInterface::set_use_database_coords ( int  use_dbc)
pure virtual

Sets whether networking should use database coordinates or not.

If database coordinates are used, the database origin is placed at the center of the earth. This makes coordinate conversion to and from UTM unnecessary. Using database coordinates renders ineffective any UTM-related settings which would position the database.

Parameters
use_database_coords1 if database coordinates should be used, 0 otherwise

Returns:

0 if successful, -1 on failure.

virtual int diguyNetInterface::get_num_coordinate_systems ( )
virtual

This function returns the number of potential coordinate converters that the networking module supports.

Returns:

number of converters

virtual const char* diguyNetInterface::get_coordinate_system_name ( int  index)
virtual

This function returns the name of the coordinate system at the specified index.

This is a string representation of a diguyCoordinateSystemType enumeration.

Returns:

name of converter

virtual int diguyNetInterface::set_coordinate_system_type ( const char *  name)
virtual

Sets the coordinate system based on the name given.

Currently supports: "No Conversion", "UTM", "Flat Earth", "Geocentric".

Returns:

0 on success, -1 on failure.

virtual const char* diguyNetInterface::get_coordinate_system_type_name ( )
virtual

returns the coordinate system name.

Current possible values are "No Conversion", "UTM", "Flat Earth", "Geocentric".

Returns:

name of coordinate system type

virtual int diguyNetInterface::set_coordinate_system_type ( diguyCoordinateSystemType  system_type)
virtual

Sets the coordinate system based on the system type.

Returns:

0 on success, -1 on failure.

virtual diguyCoordinateSystemType diguyNetInterface::get_coordinate_system_type ( )
virtual

Gets the current coordinate system in use.

Returns:

diguyCoordinateSystemType enumeration

virtual void diguyNetInterface::set_use_UTM_standard_offsets ( int  standard_offsets)
virtual

Documentation Pending.

virtual int diguyNetInterface::get_use_UTM_standard_offsets ( )
virtual

Documentation Pending.

virtual double diguyNetInterface::parse_dms_to_radians ( const char *  dms_string)
pure virtual

Parses a string of the form.

 - [-]d [N|W|S|E]     or
 - [-]d m [N|W|S|E]   or
 - [-]d m s [N|W|S|E]

N and E are taken as positive. S and W will negate the value otherwise computed. d m and s are positive, floating point values, taken as degrees, minutes, and seconds, respectively. A leading minus sign will negate the entire value otherwise computed (so, e.g., a '-' and a 'S' will result in a double-negation).

Parameters
dms_stringa string of the format described above

Returns:

a double precision floating point value in radians.

virtual int diguyNetInterface::convert_mgrs_to_local ( const char *  MGRS_str,
float *  x,
float *  y,
float *  z 
)
pure virtual

Documentation Pending.

virtual const char* diguyNetInterface::convert_local_to_mgrs ( float  x,
float  y,
float  z 
)
pure virtual

Documentation Pending.

virtual float diguyNetInterface::convert_local_to_lat ( float  x,
float  y,
float  z 
)
pure virtual

Documentation Pending.

virtual float diguyNetInterface::convert_local_to_long ( float  x,
float  y,
float  z 
)
pure virtual

Documentation Pending.

virtual const char* diguyNetInterface::convert_local_to_lat_long_string ( float  x,
float  y,
float  z 
)
pure virtual

Documentation Pending.

virtual int diguyNetInterface::convert_lat_long_to_local ( float  lat,
float  lon,
float *  x,
float *  y,
float *  z 
)
pure virtual

Documentation Pending.

virtual int diguyNetInterface::set_ground_clamp_reflected_land_entities_enabled ( int  enabled)
virtual

Sets whether land-based network entities will be ground clamped, changing their altitude to better correlate with the local terrain.

Parameters
enabledpass 1 to enable automatic ground clamping; 0 to disable

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_ground_clamp_reflected_land_entities_enabled ( )
virtual

Returns: 1 if land-based network entities will be ground clamped, 0 if not.

virtual int diguyNetInterface::set_ground_clamp_reflected_land_entities_from_host ( int  from_host)
virtual

Similar to set_ground_clamp_reflected_land_entities_enabled(), but will clamp only entities from the specified host.

If there is one host on the network that has particular trouble sending correlated altitudes this function can be used to clamp its entities without clamping all entities from all hosts.

This has been useful in some simulation exercises where participants from multiple vendors are in use. Entities from JCATS in particular have required this.

Parameters
from_hosthost whose land entities will be clamped

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_ground_clamp_reflected_land_entities_from_host ( )
virtual

Returns: host whose land entities will be clamped; see set_ground_clamp_reflected_land_entities_from_host()

virtual int diguyNetInterface::set_ground_clamp_max_climb ( float  max_climb)
virtual

Sets the maximum upward change in altitude that ground clamping will have.

Parameters
max_climbmaximum upward change in altitude, in meters

Returns:

0 on success, -1 on failure

virtual float diguyNetInterface::get_ground_clamp_max_climb ( )
virtual

Returns: maximum upward change in altitude from ground clamping, in meters.

virtual int diguyNetInterface::set_ground_clamp_max_drop ( float  max_drop)
virtual

Similar to set_ground_clamp_max_climb(), but for downward change.

virtual float diguyNetInterface::get_ground_clamp_max_drop ( )
virtual

Returns: maximum downward change in altitude from ground clamping, in meters.

virtual void diguyNetInterface::set_network_datetime_mode ( diguyDatetimeNetworkMode  network_datetime_mode)
virtual

Sets whether network datetime data will be broadcast, received, or ignored.

See documentation for diguyDatetimeNetworkMode for more information.

Parameters
network_datetime_modehow to handle network datetime data
virtual diguyDatetimeNetworkMode diguyNetInterface::get_network_datetime_mode ( )
virtual

Returns: how handle network datetime data will be handled; see set_network_datetime_mode().

virtual void diguyNetInterface::set_network_datetime_broadcast_interval ( float  broadcast_interval)
virtual

Sets how often datetime data will be broadcast if this host is in mode DIGUY_DATETIME_NETWORK_MODE_BROADCAST.

Default is broadcast every 5 seconds.

Parameters
broadcast_intervalhow often to broadcast datetime data, in seconds
virtual float diguyNetInterface::get_network_datetime_broadcast_interval ( )
virtual

Returns: how often datetime data will broadcast, in seconds.

virtual int diguyNetInterface::set_sync_mode_enabled ( int  enabled)
pure virtual

Sets whether sync mode will be enabled when online.

The function will fail if DI-Guy is already online, participating in an exercise.

Parameters
enabledpass 1 if sync mode should be enabled when online, 0 if not

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_sync_mode_enabled ( )
pure virtual

Gets whether sync mode is enabled when online.

Returns:

1 if sync mode is enabled when online, 0 if not

virtual int diguyNetInterface::set_sync_mode_master ( int  master)
pure virtual

Sets whether this machine will serve as sync master when online and in sync mode.

Parameters
masterpass 1 if this machine will serve as sync master when online and in sync mode, 0 if not

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_sync_mode_master ( )
pure virtual

Gets whether this machine will serve as sync master when online and in sync mode.

Returns:

1 if this machine will serve as sync master when online and in sync mode, 0 if not

virtual int diguyNetInterface::set_sync_mode_slave_cam ( int  sl_cam)
pure virtual

Sets whether this machine's camera will be slaved to a remote master when online and in sync mode and not sync master.

The function will fail if DI-Guy is already online, participating in an exercise.

sl_cam - pass 1 if this machine's camera will be slaved to a remote master when online and in sync mode and not sync master, 0 if not

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_sync_mode_slave_cam ( )
pure virtual

Gets whether this machine's camera will be slaved to a remote master when online, in sync mode, and not sync master.

Returns:

1 if this machine's camera will be slaved, 0 if not

virtual int diguyNetInterface::set_sync_mode_camera_offset ( float  offset_r,
float  offset_y,
float  offset_p 
)
pure virtual

This function sets the camera orientation offset to be used in sync_mode (when VR-Link is online).

Parameters
offset_rorientation offset
offset_yorientation offset
offset_porientation offset

yaw and pitch represent PERCENTAGES of the camera's horizontal and vertical field of view, respectively. The ROLL (which is in degrees) is applied first, then the yaw, then the pitch.

A typical two screen arrangement would use yaws of 50 and -50 for the left screen, and right screen, respectively. For three screens, the yaws would be -100, 0, and 100.

Using percentages this way makes the screens contiguous even if the camera's field of view changes.

THIS FUNCTION DOES NOTHING (and returns -1) if called while VR-Link is online

Returns:

0 on success, -1 on failure (VR-Link is online).

virtual int diguyNetInterface::get_sync_mode_camera_offset ( float *  offset_r,
float *  offset_y,
float *  offset_p 
)
pure virtual

This function gets the camera orientation offset to be used in sync_mode (when VR-Link is online).

Parameters
offset_rorientation offset
offset_yorientation offset
offset_porientation offset

yaw and pitch represent PERCENTAGES of the camera's horizontal and vertical field of view, respectively. The ROLL (which is in degrees) is applied first, then the yaw, then the pitch.

In the orientation offset the yaw and pitch represent PERCENTAGES of the camera's horizontal and vertical field of view, respectively. The ROLL (which is in degrees) is applied first, then the yaw, then the pitch.

A typical two screen arrangement would use yaws of 50 and -50 for the left screen, and right screen, respectively. For three screens, the yaws would be 100, 0, and -100 going from left to right.

Using percentages this way makes the screens contiguous even if the camera's field of view changes.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::set_sync_mode_camera_slaved ( int  slaved)
pure virtual

This function sets whether the camera will be slaved when VR-Link is online, in sync mode, and not sync master.

It can be set even when VR-Link is online.

Parameters
slavedwhether the camera will be slaved when VR-Link is online, in sync mode, and not sync master.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_sync_mode_camera_slaved ( )
pure virtual

This function gets whether the camera is currently slaved.

It does NOT simply return what was passed to set_sync_mode_camera_slaved().

Returns:

Whether the camera is currently slaved. This will be 1 only if VR-link is online, is in sync mode, and is not the sync master, and if sync_mode_camera_slaved has been set to 1.

virtual int diguyNetInterface::set_camera_details_out_of_date ( )
pure virtual

Lets VR-Link know that the user has moved the camera, so that if it is in sync mode, and is the sync master, it can let other hosts know the new camera position so they can move their cameras.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::set_use_adaptive_guide ( int  use_adaptive_guide)
pure virtual

Lets DI-Guy know that it should use an adaptive guide that attempts to fix reckoning errors by stepping.

Defaults to on.

Returns:

0 on success, -1 on failure

virtual int diguyNetInterface::get_use_adaptive_guide ( )
pure virtual

Returns: 0 if adaptive guide is disabled 1 otherwise.

virtual int diguyNetInterface::set_federation_name ( const char *  federation_name)
virtual
virtual const char* diguyNetInterface::get_federation_name ( )
virtual
virtual int diguyNetInterface::set_fom_file_name ( const char *  file_name)
virtual
virtual const char* diguyNetInterface::get_fom_file_name ( )
virtual
virtual int diguyNetInterface::set_base_module_name ( const char *  file_name)
virtual
virtual const char* diguyNetInterface::get_base_module_name ( )
virtual
virtual int diguyNetInterface::set_culling_enabled ( int  culling)
virtual
virtual int diguyNetInterface::get_culling_enabled ( )
virtual
virtual void diguyNetInterface::set_network_datetime_enable_diguy_custom_pdus ( int  enable_diguy_custom_pdus)
virtual

Sets whether network datetime data will be broadcast via custom PDUs.

NOTE: This is functionality that is under development and should currently not be used by non DI-Guy programmers.

Parameters
enable_diguy_custom_pduspass 1 to broadcast network datetime data via custom PDUs, 0 to not
virtual int diguyNetInterface::get_network_datetime_enable_diguy_custom_pdus ( )
virtual

Returns: 1 if network datetime data will be broadcast via custom PDUs, 0 if not.

virtual void diguyNetInterface::set_network_datetime_enable_dis_start_resume_pdus ( int  enable_dis_start_resume_pdus)
virtual

Sets whether this host will send DIS standard start/resume PDUs.

NOTE: This is functionality that is under development and should currently not be used by non DI-Guy programmers.

Parameters
enable_dis_start_resume_pduspass 1 to send DIS start/resume PDUs, 0 to not
virtual int diguyNetInterface::get_network_datetime_enable_dis_start_resume_pdus ( )
virtual

Returns: 1 if DIS start/resume should be send, 0 if not.

virtual int diguyNetInterface::server_mode ( )
pure virtual

internal functions

virtual int diguyNetInterface::client_mode ( )
pure virtual
virtual void diguyNetInterface::establish_new_offsets ( )
pure virtual
virtual void diguyNetInterface::draw ( )
pure virtual
virtual bdiDataTracker* diguyNetInterface::get_network_datetime_data_tracker ( )
pure virtual
virtual int diguyNetInterface::update_coordinate_sytem ( )
protectedpure virtual

Friends And Related Function Documentation

int diguy_module_net_initialize ( )
friend

This function allows VR-Link to install some callbacks so that DSS file load and save will include VR-Link-specific info.

It should be called BEFORE the scenario object is constructed.

Returns:

0 on success, -1 on failure

Example:

Member Data Documentation

diguyNetInterfaceData* diguyNetInterface::d

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