|
WSF
|
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) | |
| WsfDraw & | operator= (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 DrawEvent & | GetEvent (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. | |
| WsfDrawManager * | GetDrawManager () |
Static Public Member Functions | |
| static WsfDrawManager * | GetDrawManager (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 |
Provides the capability to draw shapes into the WSF replay file.
| using WsfDraw::DrawEventList = std::vector<DrawEvent> |
| enum WsfDraw::BeginState |
| enum WsfDraw::DrawType |
| enum WsfDraw::EllipseMode |
| enum WsfDraw::LineStyle |
| enum WsfDraw::VertexType |
| WsfDraw::WsfDraw | ( | WsfDrawManager * | aManagerPtr | ) |
References cBEGIN_NONE, cELLIPSE_FILL, cFOREVER, cSOLID, and GetNewId().
Referenced by operator=(), and WsfDraw().
| WsfDraw::WsfDraw | ( | WsfSimulation & | aSimulation | ) |
References cBEGIN_NONE, cELLIPSE_FILL, cFOREVER, cSOLID, GetDrawManager(), and GetNewId().
| void WsfDraw::BeginEllipse | ( | double | aHeading, |
| double | aSemiMinor, | ||
| double | aSemiMajor ) |
References cBEGIN_ELLIPSE.
Referenced by operator=().
| 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=().
| 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=().
| void WsfDraw::BeginLines | ( | ) |
Begins line drawing mode. Draws a line segment between each pair of Vertexes given by following Vertex() commands.
References cBEGIN_LINES.
Referenced by WsfZoneSet::DebugDrawBounds(), WsfZoneSet::DebugDrawCentroid(), WsfZoneDefinition::Draw(), WsfZoneDefinition::DrawBounds(), WsfZoneDefinition::DrawCentroid(), WsfZoneDefinition::DrawRelative(), operator=(), WsfLaserDesignator::Update(), and WsfLaserTracker::Update().
| void WsfDraw::BeginPoints | ( | ) |
Begins point drawing mode. Draws a point at each vertex given by following Vertex() commands.
References cBEGIN_POINTS.
Referenced by operator=().
| 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().
| 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=().
| void WsfDraw::BeginText | ( | const std::string & | aText | ) |
References cBEGIN_TEXT.
Referenced by operator=().
| void WsfDraw::BeginTimer | ( | ) |
References cBEGIN_TIMER.
Referenced by operator=().
|
static |
Referenced by WsfScriptManager::RegisterTypes().
| void WsfDraw::End | ( | ) |
Completes a drawing mode initiated with a Begin method.
References cBEGIN_NONE.
Referenced by WsfBallisticMissileLaunchComputer::BallisticModel::BallisticModel(), WsfZoneSet::DebugDrawBounds(), WsfZoneSet::DebugDrawCentroid(), Fires::BallisticPath::Draw(), WsfZoneDefinition::Draw(), WsfZoneDefinition::DrawBounds(), WsfZoneDefinition::DrawCentroid(), WsfZoneDefinition::DrawRelative(), operator=(), WsfSpaceMoverBase::SpaceModel::SpaceModel(), WsfLaserDesignator::Update(), and WsfLaserTracker::Update().
| 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().
| 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().
|
inline |
|
inline |
|
inline |
Gets the color used to draw items.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| WsfDrawManager * WsfDraw::GetDrawManager | ( | ) |
Referenced by WsfDisDraw::WsfDisDraw(), WsfDisDraw::WsfDisDraw(), WsfDraw(), and WsfXIO_DrawService::WsfXIO_DrawService().
|
static |
References WsfSimulation::FindExtension().
Referenced by WsfZoneDefinition::Draw(), and operator=().
|
inline |
|
inline |
Gets the style of an ellipse or ellipsoid.
|
inline |
|
inline |
Sets the ID given to items drawn.
|
inline |
|
inline |
Gets the size (width) of lines drawn with DrawLine().
|
inline |
Gets the style of lines drawn with DrawLine().
| unsigned int WsfDraw::GetNewId | ( | ) |
|
inline |
Gets the size of points drawn with DrawPoint().
|
inline |
|
inline |
Gets the size of points drawn with DrawPoint().
|
inline |
|
inline |
Sets the color used to draw items.
Referenced by WsfZoneDefinition::DebugDrawBounds(), WsfZoneSet::DebugDrawBounds(), WsfZoneDefinition::DebugDrawCentroid(), WsfZoneSet::DebugDrawCentroid(), WsfZoneDefinition::DebugDrawZone(), WsfZoneDefinition::DebugDrawZoneRelative(), WsfLaserDesignator::Update(), and WsfLaserTracker::Update().
|
inline |
Sets the color used to draw items.
|
inline |
|
inline |
Sets the style of an ellipse or ellipsoid.
|
inline |
Changes the ID assigned to new draw items. The sole purpose of Id is the Erase() method.
|
inline |
Sets the ID given to items drawn.
References cSTRING_ID_MASK.
| 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.
|
inline |
Sets the size (width) of lines drawn with DrawLine().
Referenced by WsfZoneDefinition::DebugDrawBounds(), WsfZoneSet::DebugDrawBounds(), WsfZoneDefinition::DebugDrawCentroid(), WsfZoneSet::DebugDrawCentroid(), WsfZoneDefinition::DebugDrawZone(), WsfZoneDefinition::DebugDrawZoneRelative(), and WsfLaserDesignator::Update().
|
inline |
Sets the style of lines drawn with DrawLine().
|
inline |
Sets the size of points drawn with DrawPoint().
| void WsfDraw::SetTarget | ( | const std::string & | aTarget | ) |
Set the target of the draw commands. Used for extending WsfDraw to select one of multiple outputs.
|
inline |
Sets the size of text.
|
inline |
Sets the size of timers drawn with DrawPoint().
| 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.
| 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.
| void WsfDraw::VertexLLA | ( | double | aLat, |
| double | aLon, | ||
| double | aAlt ) |
Specifies a vertex using a LLA position.
References cABSOLUTE_WCS, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.
Referenced by WsfZoneSet::DebugDrawBounds(), WsfZoneSet::DebugDrawCentroid(), WsfZoneDefinition::Draw(), WsfZoneDefinition::DrawBounds(), WsfZoneDefinition::DrawCentroid(), WsfLaserDesignator::Update(), WsfLaserTracker::Update(), and VertexRoute().
| 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.
| void WsfDraw::VertexRoute | ( | WsfRoute & | aRoute | ) |
Specifies each point of a route as a vertex point.
References WsfWaypoint::cLATITUDE_AND_LONGITUDE, WsfRoute::GetSize(), and VertexLLA().
| void WsfDraw::VertexScreen | ( | const double | aLocation[3] | ) |
Specifies a vertex in screen coordinates.
References cABSOLUTE_SCREEN, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.
| 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.
| void WsfDraw::VertexWCS | ( | const double | aWCS[3] | ) |
Specifies a vertex using a WCS position.
References cABSOLUTE_WCS, WsfDraw::VertexObject::mPosition, and WsfDraw::VertexObject::mVertexType.
Referenced by WsfBallisticMissileLaunchComputer::BallisticModel::BallisticModel(), Fires::BallisticPath::Draw(), WsfZoneDefinition::DrawRelative(), and WsfSpaceMoverBase::SpaceModel::SpaceModel().
|
static |