Namespaces | Classes | Typedefs | Functions | Variables

CxUtils Namespace Reference

Namespaces

namespace  JPEG
namespace  PNG

Classes

class  CircularArray
 Template for creating circular arrays. More...
class  FileFinder
 Class used for standardizing the retrieval of resource files. More...
class  FileIO
 Contains functions for creating and deleting files/directories and scanning for files. More...
class  Image
 Simple image data structure for storing RAW image data and for easy conversion to/from a few compression formats. More...
class  MappedMemory
 The MappedMemory data structure implements shared/mapped memory that can be accessed between threads/processes. It can be used in a similar manner to the Packet class. More...
class  MappedMessageBox
 Message storage class for sharing packet or string data between threads/processes using shared memory. This MappedMessageBox class is only compatible with other programs using the same from CxUtils. More...
class  MessageClient
 Client interface to subscribe to/get messages from the MessageServer class. All messages are received through shared memory and can work between processes. More...
class  MessageServer
 Class to create a server that can detect clients processes and distribute messages to them using mapped/shared memory. More...
class  Joystick
 Simple Joystick class for interfacing to a joystick. More...
class  Keyboard
 Static methods for determining if a key is currently being pressed and to generate keyboard/key events. More...
class  Wgs
 Simple World Geodetic System (WGS) latitude and longitude coordinate system data structure. More...
class  Utm
 Simple Universal Transverse Mercator (UTM) coordinate system data structure. More...
class  Gcc
 Simple Geo-Centric Coordinate (GCC) system data structure. More...
class  Orientation
 Simple class for doing angle difference or other needed orientation methods. More...
class  Matrix
 Simple matrix data structure. More...
class  PIDController
 A generic PID controller. This can be used for any application that needs to handle oscillations using a PID controller. Specific examples using a PID controller are maintain velocity, heading, or position. More...
class  Point3D
 Simple 3D point structure. More...
class  Quaternion
 Simple quaternion representation. More...
class  RunningStats
 A simple class for dynamically calculating certain statistics such as Mean, Variance, Standard Deviation, and Average. More...
class  Segment3D
 Simple 3D Line Segment structure. Class contains methods for basic geometric relationships between segments and points in 3D space. More...
class  Mouse
 Static methods for determining the current position of the mouse cursor on the screen and to emulate mouse movements and button clicks. More...
class  Mutex
 Cross platform mutex structure for thread safe operations. This structure has been defined to work in both Windows and Linux operating systems. More...
class  IP4Address
 Simple IPv4 Network Address structure. More...
class  IP6Address
 Simple IPv6 Network Address structure. More...
class  IPAddress
 Simple IP Network Address structure. More...
class  Socket
 Basic socket structure for creating network connections. All specific sockets inherit from this class (UDP, TCP). More...
class  TcpClient
 Socket which connects over TCP to a server. More...
class  TcpListenSocket
 Socket which listens for incomming TCP client connections, and creates TcpServerSockets. More...
class  TcpServer
 Socket created by TcpListenSocket which maintains a connection to a TCP client. Capable of sending/receiving packet data from/to client. More...
class  UdpClient
 Socket structure sending UDP messages. More...
class  UdpServer
 Socket structure for receiving and UDP/IP messages. More...
class  UdpSharedServer
 UDP Server software that can be used to run multiple applications that can receive unicast UDP messages simultaneously. More...
class  Packet
 Data structure for storing message data into a buffer. More...
class  Serial
 Serial (RS232) communication interface. More...
class  Thread
 Cross-platform class for creating threads for functions or adding thread capabilities to a class using inheritence. More...
class  Time
 A simple time structure. All time values are UTC. More...
class  Timer
 Simple cross-platform Timer interface. Timer can be used for more accurate delay/sleep statement (1 ms accuracy), and for creating a periodic timed event with high accuracy. More...
class  JoystickInterface
 Internal wrapper interface for the Joystick class implementation to encapsulate Windowns and Linux code. More...

Typedefs

typedef Joystick::Callback JoystickCallback
typedef Point3D Vector3D
 This type definition replaces a previously used Vector3D class which had duplicate functionality to that of Point3D.
typedef UdpClient UdpSender
 Type defintiion.
typedef UdpServer UdpReceiver
 Type defintiion.
typedef Timer::Callback TimerCallback
 Typedef for backwards compatibility.

Functions

int CX_UTILS_DLL GetChar ()
CX_UTILS_DLL void GccXyzToWgsHpr (const Gcc &gcc, const Point3D &xyz, Wgs &wgs, Point3D &hpr)
 Converts from a GCC position and DIS/XYZ orientation to a WGS and Heading-Pitch-Roll orientation.
CX_UTILS_DLL void WgsHprToGccXyz (const Wgs &wgs, const Point3D &hpr, Gcc &gcc, Point3D &xyz)
 Converts from a WGS position and Heading-Pitch-Roll orientation to a GCC position and DIS/XYZ orientation.
CX_UTILS_DLL void WgsHprToGccXyz (const Wgs &wgs, const Point3D &hpr, Point3D &xyz)
 Converts Heading-Pitch-Roll orientation to a GCC position XYZ orientation at a geodetic location.
void WgsToUtm (const Wgs &wgs, Utm &utm)
 Convert WGS position to UTM position.
void WgsToGcc (const Wgs &wgs, Gcc &gcc)
 Convert WGS position to GCC position.
void UtmToWgs (const Utm &utm, Wgs &wgs)
 Convert UTM position to WGS position.
void UtmToGcc (const Utm &utm, Gcc &gcc)
 Convert UTM position to GCC position.
void GccToWgs (const Gcc &gcc, Wgs &wgs)
 Convert GCC position to WGS position.
void GccToUtm (const Gcc &gcc, Utm &utm)
 Convert GCC position to UTM position.
double CxToRadians (const double deg)
 Converts from degrees to radians.
double CxToDegrees (const double rad)
 Converts from radians to degrees.
CX_UTILS_DLL Quaternion operator~ (const Quaternion &q)
CX_UTILS_DLL void SleepMs (const unsigned int ms)
 Method for performing a sleep statement.
CX_UTILS_DLL unsigned long long int GetTimeMs ()
CX_UTILS_DLL double GetTimeSeconds ()
CX_UTILS_DLL void GetSystemTime (unsigned int &day, unsigned int &hour, unsigned int &minute, unsigned int &second, unsigned int &msecond)
 Gets the current system time (UTC).
CX_UTILS_DLL void GetSystemTime (unsigned short &day, unsigned short &hour, unsigned short &minute, unsigned short &second, unsigned short &msecond)
 Gets the current system time (UTC).
CX_UTILS_DLL bool SetSystemTime (unsigned int year, unsigned int month, unsigned int day, unsigned int hour, unsigned int minute, unsigned int second, unsigned int msecond)
 Sets the current system time (UTC). You will need system privalages to make this function call. Advise not to use.

Variables

const double CX_PI = 3.14159265358979323846
 Value of PI.
const double CX_HALF_PI = 1.57079632679489661923
 PI divided by 2.0.
const double CX_FOURTH_PI = 0.785398163397448309615
 PI diviced by 4.0.
const double CX_PI_OVER_180 = 0.0174532925199432957692222
 PI divided by 180.0.
const double CX_180_OVER_PI = 57.295779513082320876846364
 180 dividied by PI.
const double CX_TWO_PI = 6.28318530717958647692
 PI * 2.
const double CX_EPSILON = .00000000000000000000001
 Small number to prevent divide by 0.
const double PI = 3.14159265358979323846
 Value of PI.
const double Epsilon = .00000000000000000000001
 Small number to prevent divide by 0.
const unsigned int CX_PACKET_OK = 1
 Success value on return.
const unsigned int CX_PACKET_FAILURE = 0
 Failure value on return.
const unsigned int CX_PACKET_BLOCK_SIZE = 32
 Allocate memory in this size byte blocks.
const unsigned int CX_PACKET_LITTLE_ENDIAN = 0
 Little endian byte order.
const unsigned int CX_PACKET_BIG_ENDIAN = 1
 Big endian byte order.
const int CX_SERIAL_NO_PARITY = 0
 No parity on serial data.
const int CX_SERIAL_EVEN_PARITY = 1
 Even parity serial data.
const int CX_SERIAL_ODD_PARITY = 2
 Odd parity on serial data.

Typedef Documentation

Definition at line 188 of file joystick.h.

Typedef for backwards compatibility.

Definition at line 140 of file timer.h.

Type defintiion.

Definition at line 84 of file udpserver.h.

Type defintiion.

Definition at line 97 of file udpclient.h.

This type definition replaces a previously used Vector3D class which had duplicate functionality to that of Point3D.

Since a Point can be treated as a Vector, and the functionality was identical the Vector3D class was deprecated to avoid duplicating code. Use the Vector3D typedef to make your code clearer when dealing with Vectors or to support previous code written that uses Vector3D.

Definition at line 60 of file vector3d.h.


Function Documentation

double CxUtils::CxToDegrees ( const double  rad ) [inline]

Converts from radians to degrees.

Parameters:
radAngle in radians.
Returns:
Radians angle value converted to degrees.

Definition at line 93 of file cxmath.h.

double CxUtils::CxToRadians ( const double  deg ) [inline]

Converts from degrees to radians.

Parameters:
degAngle in degrees.
Returns:
Degrees value converted to radians.

Definition at line 80 of file cxmath.h.

void CxUtils::GccToUtm ( const Gcc &  gcc,
Utm &  utm 
) [inline]

Convert GCC position to UTM position.

Definition at line 383 of file coordinates.h.

void CxUtils::GccToWgs ( const Gcc &  gcc,
Wgs &  wgs 
) [inline]

Convert GCC position to WGS position.

Definition at line 382 of file coordinates.h.

void CxUtils::GccXyzToWgsHpr ( const Gcc gcc,
const Point3D xyz,
CxUtils::Wgs wgs,
CxUtils::Point3D hpr 
)

Converts from a GCC position and DIS/XYZ orientation to a WGS and Heading-Pitch-Roll orientation.

Use this function to convert Distributed Interactive Simulation (DIS) coordinates to Geodetic coordinates (lat, long, elevation, heading, pitch, roll).

Parameters:
gccGeocentric Coordinates (x, y, z).
xyzThe three Euler rotations about the x, then y, then z axis. This is in the Distributed Interactive Simulation (DIS) format. All are [-pi, pi]. Where z is the angle psi which is a rotation around the z-axis, theta/y is rotation around y, and sigma/x is the rotation around the x-axis.
wgsWGS coordinates (latitude, longitude, elevation).
hprHeading, pitch, and roll, where 0 heading is facing north 0 (rotation around z-axis), pitch is level with the surface of the earth (rotation around y-axis, with y-axis positive to the right of the object), and roll is also level with the ground (rotation around x-axis with x-axis positive in front of the object). The z-axis is positive below the object. In the Point3D object the values are x=heading, y=pitch, z=roll in radians [-pi,pi].

First create these initial

Definition at line 71 of file coordinates.cpp.

int CxUtils::GetChar (  )
Returns:
The current key being pressed (for active console), 0 if none.

Definition at line 67 of file keyboard.cpp.

void CxUtils::GetSystemTime ( unsigned int &  day,
unsigned int &  hour,
unsigned int &  minute,
unsigned int &  second,
unsigned int &  msecond 
)

Gets the current system time (UTC).

Parameters:
dayDay of the month. 1-31.
hourHour of the day (24 hour clock) [0-23].
minuteMinutes [0-59].
secondSeconds [0-61].
msecondMilliseconds [0-999].

Definition at line 126 of file time.cpp.

void CxUtils::GetSystemTime ( unsigned short &  day,
unsigned short &  hour,
unsigned short &  minute,
unsigned short &  second,
unsigned short &  msecond 
)

Gets the current system time (UTC).

Parameters:
dayDay of the month. 1-31.
hourHour of the day (24 hour clock) [0-23].
minuteMinutes [0-59].
secondSeconds [0-61].
msecondMilliseconds [0-999].

Definition at line 177 of file time.cpp.

unsigned long long int CxUtils::GetTimeMs (  )
Returns:
The current UTC time in milliseconds.
The current UTC time (for this day of year) in milliseconds.

Definition at line 87 of file time.cpp.

double CxUtils::GetTimeSeconds (  )
Returns:
The current UTC time in milliseconds.
The current UTC time (for this day of year) in seconds.

Definition at line 103 of file time.cpp.

CxUtils::Quaternion CxUtils::operator~ ( const Quaternion q )
Returns:
Conjugate of the quaternion.

Definition at line 52 of file quaternion.cpp.

bool CxUtils::SetSystemTime ( unsigned int  year,
unsigned int  month,
unsigned int  day,
unsigned int  hour,
unsigned int  minute,
unsigned int  second,
unsigned int  msecond 
)

Sets the current system time (UTC). You will need system privalages to make this function call. Advise not to use.

Gets the current system time (UTC).

Parameters:
yearYear 1601 - 30827.
monthMonth [1-12].
dayDay of the month. 1-31.
hourHour of the day (24 hour clock) [0-23].
minuteMinutes [0-59].
secondSeconds [0-61].
msecondMilliseconds [0-999].
yearYear 1900- 30827.
monthMonth [1-12].
dayDay of the month. 1-31.
hourHour of the day (24 hour clock) [0-23].
minuteMinutes [0-59].
secondSeconds [0-61].
msecondMilliseconds [0-999].

Definition at line 219 of file time.cpp.

void CxUtils::SleepMs ( const unsigned int  ms )

Method for performing a sleep statement.

This function is very useful during endless loops in code to prevent maxing out of the computers CPU by putting a 1ms sleep statement.

Parameters:
msHow long to sleep in milliseconds.

Definition at line 73 of file time.cpp.

void CxUtils::UtmToGcc ( const Utm &  utm,
Gcc &  gcc 
) [inline]

Convert UTM position to GCC position.

Definition at line 381 of file coordinates.h.

void CxUtils::UtmToWgs ( const Utm &  utm,
Wgs &  wgs 
) [inline]

Convert UTM position to WGS position.

Definition at line 380 of file coordinates.h.

void CxUtils::WgsHprToGccXyz ( const Wgs wgs,
const Point3D hpr,
CxUtils::Point3D xyz 
)

Converts Heading-Pitch-Roll orientation to a GCC position XYZ orientation at a geodetic location.

Use this function to convert Geodetic head/pitch/roll data to Distributed Interactive Simulation (DIS) orientation (x/psi, y/theta, z/phi).

Parameters:
wgsWGS coordinates (latitude, longitude, elevation).
hprHeading, pitch, and roll, where 0 heading is facing north 0 (rotation around z-axis), pitch is level with the surface of the earth (rotation around y-axis, with y-axis positive to the right of the object), and roll is also level with the ground (rotation around x-axis with x-axis positive in front of the object). The z-axis is positive below the object. In the Point3D object the values are x=heading, y=pitch, z=roll in radians [-pi,pi].
xyzThe three Euler rotations about the x, then y, then z axes. This is in the Distributed Interactive Simulation (DIS) format. All are [-pi, pi]. Where z is the angle psi which is a rotation around the z-axis, theta/y is rotation around y, and sigma/x is the rotation around the x-axis.

Definition at line 259 of file coordinates.cpp.

void CxUtils::WgsHprToGccXyz ( const Wgs wgs,
const Point3D hpr,
CxUtils::Gcc gcc,
CxUtils::Point3D xyz 
)

Converts from a WGS position and Heading-Pitch-Roll orientation to a GCC position and DIS/XYZ orientation.

Use this function to convert Geodetic position and head/pitch/roll data to Distributed Interactive Simulation (DIS) coordinates (X,Y,Z, psi, theta, phi).

Parameters:
wgsWGS coordinates (latitude, longitude, elevation).
hprHeading, pitch, and roll, where 0 heading is facing north 0 (rotation around z-axis), pitch is level with the surface of the earth (rotation around y-axis, with y-axis positive to the right of the object), and roll is also level with the ground (rotation around x-axis with x-axis positive in front of the object). The z-axis is positive below the object. In the Point3D object the values are x=heading, y=pitch, z=roll in radians [-pi,pi].
gccGeocentric Coordinates (x, y, z).
xyzThe three Euler rotations about the x, then y, then z axis. This is in the Distributed Interactive Simulation (DIS) format. All are [-pi, pi]. Where z is the angle psi which is a rotation around the z-axis, theta/y is rotation around y, and sigma/x is the rotation around the x-axis.

Definition at line 168 of file coordinates.cpp.

void CxUtils::WgsToGcc ( const Wgs &  wgs,
Gcc &  gcc 
) [inline]

Convert WGS position to GCC position.

Definition at line 379 of file coordinates.h.

void CxUtils::WgsToUtm ( const Wgs &  wgs,
Utm &  utm 
) [inline]

Convert WGS position to UTM position.

Definition at line 378 of file coordinates.h.


Variable Documentation

const double CxUtils::CX_180_OVER_PI = 57.295779513082320876846364

180 dividied by PI.

Definition at line 64 of file cxmath.h.

const double CxUtils::CX_EPSILON = .00000000000000000000001

Small number to prevent divide by 0.

Definition at line 66 of file cxmath.h.

const double CxUtils::CX_FOURTH_PI = 0.785398163397448309615

PI diviced by 4.0.

Definition at line 62 of file cxmath.h.

const double CxUtils::CX_HALF_PI = 1.57079632679489661923

PI divided by 2.0.

Definition at line 61 of file cxmath.h.

const unsigned int CxUtils::CX_PACKET_BIG_ENDIAN = 1

Big endian byte order.

Definition at line 82 of file packet.h.

const unsigned int CxUtils::CX_PACKET_BLOCK_SIZE = 32

Allocate memory in this size byte blocks.

Definition at line 80 of file packet.h.

const unsigned int CxUtils::CX_PACKET_FAILURE = 0

Failure value on return.

Definition at line 79 of file packet.h.

const unsigned int CxUtils::CX_PACKET_LITTLE_ENDIAN = 0

Little endian byte order.

Definition at line 81 of file packet.h.

const unsigned int CxUtils::CX_PACKET_OK = 1

Success value on return.

Definition at line 78 of file packet.h.

const double CxUtils::CX_PI = 3.14159265358979323846

Value of PI.

Definition at line 60 of file cxmath.h.

const double CxUtils::CX_PI_OVER_180 = 0.0174532925199432957692222

PI divided by 180.0.

Definition at line 63 of file cxmath.h.

Even parity serial data.

Definition at line 50 of file serial.h.

No parity on serial data.

Definition at line 49 of file serial.h.

Odd parity on serial data.

Definition at line 51 of file serial.h.

const double CxUtils::CX_TWO_PI = 6.28318530717958647692

PI * 2.

Definition at line 65 of file cxmath.h.

const double CxUtils::Epsilon = .00000000000000000000001

Small number to prevent divide by 0.

Definition at line 69 of file cxmath.h.

const double CxUtils::PI = 3.14159265358979323846

Value of PI.

Definition at line 68 of file cxmath.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines