WSF
WsfDraw Class Reference

Provides the capability to draw shapes into the WSF replay file. More...

#include <WsfDraw.hpp>

Classes

struct  VertexObject
 Represents a vertex for a drawn item. More...
struct  DrawEvent

Public Types

enum  BeginState {
  cBEGIN_NONE , cBEGIN_LINES , cBEGIN_POLYLINE , cBEGIN_POINTS ,
  cBEGIN_ICONS , cBEGIN_ELLIPSE , cBEGIN_ELLIPSOID , cBEGIN_QUADRILATERAL ,
  cBEGIN_TEXT , cBEGIN_TIMER
}
enum  LineStyle {
  cDASHED , cLONG_DASHED , cDOTTED , cDOTTED2 ,
  cDASH_DOT , cDASH_DOT2 , cSOLID
}
 Styles available for drawn lines. More...
enum  DrawType {
  cLINE , cPOINT , cICON , cELLIPSE ,
  cERASE , cELLIPSOID , cQUADRILATERAL , cTEXT ,
  cTIMER , cNONE
}
enum  VertexType {
  cUNSET_VERTEX , cABSOLUTE_WCS , cRELATIVE_ZERO , cRELATIVE_ECS ,
  cRELATIVE_NED , cABSOLUTE_SCREEN
}
enum  EllipseMode { cELLIPSE_FILL , cELLIPSE_LINE }
using DrawEventList = std::vector<DrawEvent>

Public Member Functions

 WsfDraw (WsfDrawManager *aManagerPtr)
 WsfDraw (WsfSimulation &aSimulation)
 WsfDraw (const WsfDraw &aSrc)
WsfDrawoperator= (const WsfDraw &)=delete
void BeginLines ()
 Begins line drawing mode. Draws a line segment between each pair of Vertexes given by following Vertex() commands.
void BeginPolyline ()
void BeginPoints ()
 Begins point drawing mode. Draws a point at each vertex given by following Vertex() commands.
void BeginIcons (double aHeading, const std::string &aIconName="Wedge")
 Begins icon drawing mode. Draws an icon each vertex given by following Vertex() commands.
void BeginEllipse (double aHeading, double aSemiMinor, double aSemiMajor)
void BeginEllipsoid (double aHeading, double aPitch, double aRoll, double aRadiusA, double aRadiusB, double aRadiusC)
 Begin ellipsoid drawing mode. Draws a 3D ellipsoid at each vertex given by the following Vertex() commands.
void BeginQuadrilateral ()
void BeginText (const std::string &aText)
void BeginTimer ()
void End ()
 Completes a drawing mode initiated with a Begin method.
BeginState GetBeginState () const
void SetId (unsigned int aId)
 Changes the ID assigned to new draw items. The sole purpose of Id is the Erase() method.
unsigned int GetNewId ()
 Returns a unique ID to be used with SetId().
void SetId (WsfStringId aId)
 Sets the ID given to items drawn.
int GetId () const
 Sets the ID given to items drawn.
void SetPointSize (int aSize)
 Sets the size of points drawn with DrawPoint().
int GetPointSize () const
 Gets the size of points drawn with DrawPoint().
void SetTextSize (int aSize)
 Sets the size of text.
void SetLineSize (int aSize)
 Sets the size (width) of lines drawn with DrawLine().
int GetLineSize () const
 Gets the size (width) of lines drawn with DrawLine().
void SetLineStyle (LineStyle aStyle)
 Sets the style of lines drawn with DrawLine().
int GetLineStyle () const
 Gets the style of lines drawn with DrawLine().
void SetTimerSize (int aSize)
 Sets the size of timers drawn with DrawPoint().
int GetTimerSize () const
 Gets the size of points drawn with DrawPoint().
void SetEllipseMode (EllipseMode aMode)
 Sets the style of an ellipse or ellipsoid.
int GetEllipseMode () const
 Gets the style of an ellipse or ellipsoid.
void SetColor (const UtColor &aColor)
 Sets the color used to draw items.
const UtColor & GetColor () const
 Gets the color used to draw items.
void SetColor (double aRed, double aGreen, double aBlue, double aAlpha=1.0)
 Sets the color used to draw items.
void SetTarget (const std::string &aTarget)
 Set the target of the draw commands. Used for extending WsfDraw to select one of multiple outputs.
void SetLayer (const std::string &aLayer)
 Set the layer of the draw commands. Can be used to put commands into different layers for filtering.
void Erase (unsigned int aId)
 Erases anything drawn with the specified ID. This, in effect, shortens the duration of items already drawn.
void Erase (WsfStringId aId)
 Erases anything drawn with the specified ID. This, in effect, shortens the duration of items already drawn.
void SetDuration (double aDuration)
double GetDuration () const
double GetCurrentHeading () const
double GetCurrentPitch () const
double GetCurrentRoll () const
double GetCurrentAxisA () const
double GetCurrentAxisB () const
double GetCurrentAxisC () const
std::string GetCurrentIconName () const
std::string GetTarget () const
std::string GetLayer () const
int GetUniqueId () const
unsigned int EventCount () const
const DrawEventGetEvent (unsigned int aIndex) const
void Reset ()
 Reset the drawing options to the default.
void VertexLLA (double aLat, double aLon, double aAlt)
 Specifies a vertex using a LLA position.
void VertexWCS (const double aWCS[3])
 Specifies a vertex using a WCS position.
void Vertex (WsfPlatform &aPlatform)
 Specifies a vertex that stays collocated with aPlatform.
void VertexECS (WsfPlatform &aPlatform, double aLocationECS[3])
 Specifies a vertex that stays at a ECS location relative to aPlatform.
void VertexNED (WsfPlatform &aPlatform, double aLocationNED[3])
 Specifies a vertex that stays at a NED location relative to aPlatform.
void VertexScreen (const double aLocation[3])
 Specifies a vertex in screen coordinates.
void VertexScreenPlat (WsfPlatform &aPlatform, double aLocation[3])
 Specifies a vertex that stays at a NED location relative to aPlatform.
void VertexRoute (WsfRoute &aRoute)
 Specifies each point of a route as a vertex point.
WsfDrawManagerGetDrawManager ()

Static Public Member Functions

static WsfDrawManagerGetDrawManager (WsfSimulation &aSimulation)
static std::unique_ptr< UtScriptClass > CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)

Static Public Attributes

static double cFOREVER = 1.0E20
static const unsigned int cSTRING_ID_MASK = 0x10000000

Detailed Description

Provides the capability to draw shapes into the WSF replay file.

Member Typedef Documentation

◆ DrawEventList

using WsfDraw::DrawEventList = std::vector<DrawEvent>

Member Enumeration Documentation

◆ BeginState

Enumerator
cBEGIN_NONE 
cBEGIN_LINES 
cBEGIN_POLYLINE 
cBEGIN_POINTS 
cBEGIN_ICONS 
cBEGIN_ELLIPSE 
cBEGIN_ELLIPSOID 
cBEGIN_QUADRILATERAL 
cBEGIN_TEXT 
cBEGIN_TIMER 

◆ DrawType

Enumerator
cLINE 
cPOINT 
cICON 
cELLIPSE 
cERASE 
cELLIPSOID 
cQUADRILATERAL 
cTEXT 
cTIMER 
cNONE 

◆ EllipseMode

Enumerator
cELLIPSE_FILL 
cELLIPSE_LINE 

◆ LineStyle

Styles available for drawn lines.

Enumerator
cDASHED 
cLONG_DASHED 
cDOTTED 
cDOTTED2 
cDASH_DOT 
cDASH_DOT2 
cSOLID 

◆ VertexType

Enumerator
cUNSET_VERTEX 
cABSOLUTE_WCS 
cRELATIVE_ZERO 
cRELATIVE_ECS 
cRELATIVE_NED 
cABSOLUTE_SCREEN 

Constructor & Destructor Documentation

◆ WsfDraw() [1/3]

WsfDraw::WsfDraw ( WsfDrawManager * aManagerPtr)

References cBEGIN_NONE, cELLIPSE_FILL, cFOREVER, cSOLID, and GetNewId().

Referenced by operator=(), and WsfDraw().

◆ WsfDraw() [2/3]

WsfDraw::WsfDraw ( WsfSimulation & aSimulation)

◆ WsfDraw() [3/3]

WsfDraw::WsfDraw ( const WsfDraw & aSrc)

References WsfDraw().

Member Function Documentation

◆ BeginEllipse()

void WsfDraw::BeginEllipse ( double aHeading,
double aSemiMinor,
double aSemiMajor )

References cBEGIN_ELLIPSE.

Referenced by operator=().

◆ BeginEllipsoid()

void WsfDraw::BeginEllipsoid ( double aHeading,
double aPitch,
double aRoll,
double aRadiusA,
double aRadiusB,
double aRadiusC )

Begin ellipsoid drawing mode. Draws a 3D ellipsoid at each vertex given by the following Vertex() commands.

References cBEGIN_ELLIPSOID.

Referenced by operator=().

◆ BeginIcons()

void WsfDraw::BeginIcons ( double aHeading,
const std::string & aIconName = "Wedge" )

Begins icon drawing mode. Draws an icon each vertex given by following Vertex() commands.

References cBEGIN_ICONS.

Referenced by operator=().

◆ BeginLines()

void WsfDraw::BeginLines ( )

◆ BeginPoints()

void WsfDraw::BeginPoints ( )

Begins point drawing mode. Draws a point at each vertex given by following Vertex() commands.

References cBEGIN_POINTS.

Referenced by operator=().

◆ BeginPolyline()

void WsfDraw::BeginPolyline ( )

Begins poly-line drawing mode. Draws a continuous line between each adjacent pair of Vertices given by following Vertex() commands.

References cBEGIN_POLYLINE.

Referenced by WsfBallisticMissileLaunchComputer::BallisticModel::BallisticModel(), Fires::BallisticPath::Draw(), operator=(), and WsfSpaceMoverBase::SpaceModel::SpaceModel().

◆ BeginQuadrilateral()

void WsfDraw::BeginQuadrilateral ( )

Begins quarilateral drawing mode. Draws a filled quarilateral defined by the four Vertices given by following Vertex() commands. The first vertex is the top left corner and rotates clockwise to subsequent vertices. The four vertices must define a convex quadrilateral (square, rectangle)

References cBEGIN_QUADRILATERAL.

Referenced by operator=().

◆ BeginText()

void WsfDraw::BeginText ( const std::string & aText)

References cBEGIN_TEXT.

Referenced by operator=().

◆ BeginTimer()

void WsfDraw::BeginTimer ( )

References cBEGIN_TIMER.

Referenced by operator=().

◆ CreateScriptClass()

std::unique_ptr< UtScriptClass > WsfDraw::CreateScriptClass ( const std::string & aClassName,
UtScriptTypes * aScriptTypesPtr )
static

◆ End()

◆ Erase() [1/2]

void WsfDraw::Erase ( unsigned int aId)

Erases anything drawn with the specified ID. This, in effect, shortens the duration of items already drawn.

References cERASE, WsfDraw::DrawEvent::mDrawType, and WsfDraw::DrawEvent::mID.

Referenced by Erase().

◆ Erase() [2/2]

void WsfDraw::Erase ( WsfStringId aId)

Erases anything drawn with the specified ID. This, in effect, shortens the duration of items already drawn.

References cSTRING_ID_MASK, and Erase().

◆ EventCount()

unsigned int WsfDraw::EventCount ( ) const
inline

◆ GetBeginState()

BeginState WsfDraw::GetBeginState ( ) const
inline

◆ GetColor()

const UtColor & WsfDraw::GetColor ( ) const
inline

Gets the color used to draw items.

◆ GetCurrentAxisA()

double WsfDraw::GetCurrentAxisA ( ) const
inline

◆ GetCurrentAxisB()

double WsfDraw::GetCurrentAxisB ( ) const
inline

◆ GetCurrentAxisC()

double WsfDraw::GetCurrentAxisC ( ) const
inline

◆ GetCurrentHeading()

double WsfDraw::GetCurrentHeading ( ) const
inline

◆ GetCurrentIconName()

std::string WsfDraw::GetCurrentIconName ( ) const
inline

◆ GetCurrentPitch()

double WsfDraw::GetCurrentPitch ( ) const
inline

◆ GetCurrentRoll()

double WsfDraw::GetCurrentRoll ( ) const
inline

◆ GetDrawManager() [1/2]

◆ GetDrawManager() [2/2]

WsfDrawManager * WsfDraw::GetDrawManager ( WsfSimulation & aSimulation)
static

◆ GetDuration()

double WsfDraw::GetDuration ( ) const
inline

◆ GetEllipseMode()

int WsfDraw::GetEllipseMode ( ) const
inline

Gets the style of an ellipse or ellipsoid.

◆ GetEvent()

const DrawEvent & WsfDraw::GetEvent ( unsigned int aIndex) const
inline

◆ GetId()

int WsfDraw::GetId ( ) const
inline

Sets the ID given to items drawn.

◆ GetLayer()

std::string WsfDraw::GetLayer ( ) const
inline

◆ GetLineSize()

int WsfDraw::GetLineSize ( ) const
inline

Gets the size (width) of lines drawn with DrawLine().

◆ GetLineStyle()

int WsfDraw::GetLineStyle ( ) const
inline

Gets the style of lines drawn with DrawLine().

◆ GetNewId()

unsigned int WsfDraw::GetNewId ( )

Returns a unique ID to be used with SetId().

Referenced by WsfDraw(), and WsfDraw().

◆ GetPointSize()

int WsfDraw::GetPointSize ( ) const
inline

Gets the size of points drawn with DrawPoint().

◆ GetTarget()

std::string WsfDraw::GetTarget ( ) const
inline

◆ GetTimerSize()

int WsfDraw::GetTimerSize ( ) const
inline

Gets the size of points drawn with DrawPoint().

◆ GetUniqueId()

int WsfDraw::GetUniqueId ( ) const
inline

◆ operator=()

◆ Reset()

void WsfDraw::Reset ( )

Reset the drawing options to the default.

References cFOREVER, and cSOLID.

◆ SetColor() [1/2]

◆ SetColor() [2/2]

void WsfDraw::SetColor ( double aRed,
double aGreen,
double aBlue,
double aAlpha = 1.0 )
inline

Sets the color used to draw items.

◆ SetDuration()

◆ SetEllipseMode()

void WsfDraw::SetEllipseMode ( EllipseMode aMode)
inline

Sets the style of an ellipse or ellipsoid.

◆ SetId() [1/2]

void WsfDraw::SetId ( unsigned int aId)
inline

Changes the ID assigned to new draw items. The sole purpose of Id is the Erase() method.

◆ SetId() [2/2]

void WsfDraw::SetId ( WsfStringId aId)
inline

Sets the ID given to items drawn.

References cSTRING_ID_MASK.

◆ SetLayer()

void WsfDraw::SetLayer ( const std::string & aLayer)

Set the layer of the draw commands. Can be used to put commands into different layers for filtering.

◆ SetLineSize()

◆ SetLineStyle()

void WsfDraw::SetLineStyle ( LineStyle aStyle)
inline

Sets the style of lines drawn with DrawLine().

◆ SetPointSize()

void WsfDraw::SetPointSize ( int aSize)
inline

Sets the size of points drawn with DrawPoint().

◆ SetTarget()

void WsfDraw::SetTarget ( const std::string & aTarget)

Set the target of the draw commands. Used for extending WsfDraw to select one of multiple outputs.

◆ SetTextSize()

void WsfDraw::SetTextSize ( int aSize)
inline

Sets the size of text.

◆ SetTimerSize()

void WsfDraw::SetTimerSize ( int aSize)
inline

Sets the size of timers drawn with DrawPoint().

◆ Vertex()

void WsfDraw::Vertex ( WsfPlatform & aPlatform)

Specifies a vertex that stays collocated with aPlatform.

References cRELATIVE_ZERO, WsfPlatform::GetIndex(), WsfDraw::VertexObject::mPlatformIndex, and WsfDraw::VertexObject::mVertexType.

◆ VertexECS()

void WsfDraw::VertexECS ( WsfPlatform & aPlatform,
double aLocationECS[3] )

Specifies a vertex that stays at a ECS location relative to aPlatform.

References cRELATIVE_ECS, WsfPlatform::GetIndex(), WsfDraw::VertexObject::mPlatformIndex, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.

◆ VertexLLA()

◆ VertexNED()

void WsfDraw::VertexNED ( WsfPlatform & aPlatform,
double aLocationNED[3] )

Specifies a vertex that stays at a NED location relative to aPlatform.

References cRELATIVE_NED, WsfPlatform::GetIndex(), WsfDraw::VertexObject::mPlatformIndex, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.

◆ VertexRoute()

void WsfDraw::VertexRoute ( WsfRoute & aRoute)

Specifies each point of a route as a vertex point.

References WsfWaypoint::cLATITUDE_AND_LONGITUDE, WsfRoute::GetSize(), and VertexLLA().

◆ VertexScreen()

void WsfDraw::VertexScreen ( const double aLocation[3])

Specifies a vertex in screen coordinates.

References cABSOLUTE_SCREEN, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.

◆ VertexScreenPlat()

void WsfDraw::VertexScreenPlat ( WsfPlatform & aPlatform,
double aLocation[3] )

Specifies a vertex that stays at a NED location relative to aPlatform.

References cABSOLUTE_SCREEN, WsfPlatform::GetIndex(), WsfDraw::VertexObject::mPlatformIndex, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.

◆ VertexWCS()

Member Data Documentation

◆ cFOREVER

◆ cSTRING_ID_MASK

const unsigned int WsfDraw::cSTRING_ID_MASK = 0x10000000
static

Referenced by Erase(), and SetId().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved