Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SOverlayTexturedLine Struct Reference

Textured line overlay, with world-space coordinates, rendered in the world onto the terrain. More...

#include <Overlay.h>

Public Types

enum  LineCapType { LINECAP_FLAT, LINECAP_ROUND, LINECAP_SHARP, LINECAP_SQUARE }
 

Public Member Functions

 SOverlayTexturedLine ()
 
void PushCoords (const float x, const float z)
 
void PushCoords (const CVector2D &v)
 
void PushCoords (const std::vector< CVector2D > &points)
 

Static Public Member Functions

static LineCapType StrToLineCapType (const std::wstring &str)
 Converts a string line cap type into its corresponding LineCap enum value, and returns the resulting value. More...
 

Public Attributes

CTexturePtr m_TextureBase
 
CTexturePtr m_TextureMask
 
CColor m_Color
 Color to apply to the line texture, where indicated by the mask. More...
 
std::vector< float > m_Coords
 (x, z) vertex coordinate pairs; y is computed automatically. More...
 
float m_Thickness
 Half-width of the line, in world-space units. More...
 
bool m_Closed
 Should this line be treated as a closed loop? If set, any end cap settings are ignored. More...
 
bool m_AlwaysVisible
 Should this line be rendered fully visible at all times, even under the SoD? More...
 
LineCapType m_StartCapType
 
LineCapType m_EndCapType
 
const CSimContextm_SimContext
 Simulation context applicable for this overlay line; used to obtain terrain information during automatic computation of Y coordinates. More...
 
shared_ptr< CTexturedLineRDatam_RenderData
 Cached renderer data, because expensive to compute. More...
 

Detailed Description

Textured line overlay, with world-space coordinates, rendered in the world onto the terrain.

Designed for relatively static textured lines, i.e. territory borders, originally.

Once submitted for rendering, instances must not be copied afterwards. The reason is that they are assigned rendering data that is unique to the submitted instance, and non-transferable to any copies that would otherwise be made. Amongst others, this restraint includes that they must not be submitted by their address inside a std::vector storing them by value.

Definition at line 62 of file Overlay.h.

Member Enumeration Documentation

Enumerator
LINECAP_FLAT 

no line ending; abrupt stop of the line (aka. butt ending)

LINECAP_ROUND 

Semi-circular line ending.

The texture is mapped by curving the left vertical edge around the semi-circle's rim. That is, the center point has UV coordinates (0.5;0.5), and the rim vertices all have U coordinate 0 and a V coordinate that ranges from 0 to 1 as the rim is traversed.

LINECAP_SHARP 

sharp point ending

LINECAP_SQUARE 

square end that extends half the line width beyond the line end

Definition at line 64 of file Overlay.h.

Constructor & Destructor Documentation

SOverlayTexturedLine::SOverlayTexturedLine ( )
inline

Definition at line 79 of file Overlay.h.

Member Function Documentation

void SOverlayTexturedLine::PushCoords ( const float  x,
const float  z 
)
inline

Definition at line 124 of file Overlay.h.

void SOverlayTexturedLine::PushCoords ( const CVector2D v)
inline

Definition at line 125 of file Overlay.h.

void SOverlayTexturedLine::PushCoords ( const std::vector< CVector2D > &  points)
inline

Definition at line 126 of file Overlay.h.

SOverlayTexturedLine::LineCapType SOverlayTexturedLine::StrToLineCapType ( const std::wstring &  str)
static

Converts a string line cap type into its corresponding LineCap enum value, and returns the resulting value.

If the input string is unrecognized, a warning is issued and a default value is returned.

Definition at line 24 of file Overlay.cpp.

Member Data Documentation

bool SOverlayTexturedLine::m_AlwaysVisible

Should this line be rendered fully visible at all times, even under the SoD?

Definition at line 96 of file Overlay.h.

bool SOverlayTexturedLine::m_Closed

Should this line be treated as a closed loop? If set, any end cap settings are ignored.

Definition at line 94 of file Overlay.h.

CColor SOverlayTexturedLine::m_Color

Color to apply to the line texture, where indicated by the mask.

Definition at line 88 of file Overlay.h.

std::vector<float> SOverlayTexturedLine::m_Coords

(x, z) vertex coordinate pairs; y is computed automatically.

Definition at line 90 of file Overlay.h.

LineCapType SOverlayTexturedLine::m_EndCapType

Definition at line 99 of file Overlay.h.

shared_ptr<CTexturedLineRData> SOverlayTexturedLine::m_RenderData

Cached renderer data, because expensive to compute.

Allocated by the renderer when necessary for rendering purposes.

Note: the rendering data may be shared between copies of this object to prevent having to recompute it, while at the same time maintaining copyability of this object (see also docs on CTexturedLineRData).

Definition at line 115 of file Overlay.h.

const CSimContext* SOverlayTexturedLine::m_SimContext

Simulation context applicable for this overlay line; used to obtain terrain information during automatic computation of Y coordinates.

Definition at line 105 of file Overlay.h.

LineCapType SOverlayTexturedLine::m_StartCapType

Definition at line 98 of file Overlay.h.

CTexturePtr SOverlayTexturedLine::m_TextureBase

Definition at line 84 of file Overlay.h.

CTexturePtr SOverlayTexturedLine::m_TextureMask

Definition at line 85 of file Overlay.h.

float SOverlayTexturedLine::m_Thickness

Half-width of the line, in world-space units.

Definition at line 92 of file Overlay.h.


The documentation for this struct was generated from the following files: