Pyrogenesis  trunk
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>

Collaboration diagram for SOverlayTexturedLine:
Collaboration graph
[legend]

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.

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

Constructor & Destructor Documentation

SOverlayTexturedLine::SOverlayTexturedLine ( )
inline

Member Function Documentation

void SOverlayTexturedLine::PushCoords ( const float  x,
const float  z 
)
inline
void SOverlayTexturedLine::PushCoords ( const CVector2D v)
inline
void SOverlayTexturedLine::PushCoords ( const std::vector< CVector2D > &  points)
inline
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.

Member Data Documentation

bool SOverlayTexturedLine::m_AlwaysVisible

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

bool SOverlayTexturedLine::m_Closed

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

CColor SOverlayTexturedLine::m_Color

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

std::vector<float> SOverlayTexturedLine::m_Coords

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

LineCapType SOverlayTexturedLine::m_EndCapType
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).

const CSimContext* SOverlayTexturedLine::m_SimContext

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

LineCapType SOverlayTexturedLine::m_StartCapType
CTexturePtr SOverlayTexturedLine::m_TextureBase
CTexturePtr SOverlayTexturedLine::m_TextureMask
float SOverlayTexturedLine::m_Thickness

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


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