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 CreateOverlayTexture (const SOverlayDescriptor *overlayDescriptor)
 Creates the texture specified by the given overlay descriptor and assigns it to this overlay. More...
 
void PushCoords (const float x, const float z)
 
void PushCoords (const CVector2D &v)
 
void PushCoords (const std::vector< CVector2D > &points)
 
bool IsVisibleInFrustum (const CFrustum &frustum) const
 

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< CVector2Dm_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...
 
std::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

◆ LineCapType

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::SOverlayTexturedLine ( )
inline

Member Function Documentation

◆ CreateOverlayTexture()

void SOverlayTexturedLine::CreateOverlayTexture ( const SOverlayDescriptor overlayDescriptor)

Creates the texture specified by the given overlay descriptor and assigns it to this overlay.

◆ IsVisibleInFrustum()

bool SOverlayTexturedLine::IsVisibleInFrustum ( const CFrustum frustum) const

◆ PushCoords() [1/3]

void SOverlayTexturedLine::PushCoords ( const CVector2D v)
inline

◆ PushCoords() [2/3]

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

◆ PushCoords() [3/3]

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

◆ StrToLineCapType()

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

◆ m_AlwaysVisible

bool SOverlayTexturedLine::m_AlwaysVisible

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

◆ m_Closed

bool SOverlayTexturedLine::m_Closed

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

◆ m_Color

CColor SOverlayTexturedLine::m_Color

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

◆ m_Coords

std::vector<CVector2D> SOverlayTexturedLine::m_Coords

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

◆ m_EndCapType

LineCapType SOverlayTexturedLine::m_EndCapType

◆ m_RenderData

std::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).

◆ m_SimContext

const CSimContext* SOverlayTexturedLine::m_SimContext

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

◆ m_StartCapType

LineCapType SOverlayTexturedLine::m_StartCapType

◆ m_TextureBase

CTexturePtr SOverlayTexturedLine::m_TextureBase

◆ m_TextureMask

CTexturePtr SOverlayTexturedLine::m_TextureMask

◆ m_Thickness

float SOverlayTexturedLine::m_Thickness

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


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