Description

Class for referencing a set of 'glyphs', that are simple symbols such as arrows or points to be drawn for showing vector directions etc.

Remember that depending on the type of visualization system (POVray, Irrlicht,etc.) this asset might not be supported.

#include <ChGlyphs.h>

Inheritance diagram for chrono::ChGlyphs:
Collaboration diagram for chrono::ChGlyphs:

Public Types

enum  eCh_GlyphType { GLYPH_POINT = 0, GLYPH_VECTOR, GLYPH_COORDSYS }
 

Public Member Functions

 CH_ENUM_MAPPER_BEGIN (eCh_GlyphType)
 
 CH_ENUM_VAL (GLYPH_POINT)
 
 CH_ENUM_VAL (GLYPH_VECTOR)
 
 CH_ENUM_VAL (GLYPH_COORDSYS)
 
 CH_ENUM_MAPPER_END (eCh_GlyphType)
 
eCh_GlyphType GetDrawMode ()
 Get the way that glyphs must be rendered.
 
void SetDrawMode (eCh_GlyphType mmode)
 Set the way that glyphs must be rendered.
 
void Reserve (unsigned int n_glyphs)
 Resize the vectors of data so that memory management is faster than calling SetGlyphPoint() etc. More...
 
size_t GetNumberOfGlyphs ()
 Get the number of glyphs.
 
double GetGlyphsSize ()
 Get the 'size' (thickness of symbol, depending on the rendering system) of the glyph symbols.
 
void SetGlyphsSize (double msize)
 Set the 'size' (thickness of symbol, depending on the rendering system) of the glyph symbols.
 
void SetZbufferHide (bool mhide)
 
bool GetZbufferHide ()
 
void SetGlyphPoint (unsigned int id, ChVector<> mpoint, ChColor mcolor=ChColor(1, 0, 0))
 Fast method to set a glyph for GLYPH_POINT draw mode. More...
 
void SetGlyphVector (unsigned int id, ChVector<> mpoint, ChVector<> mvector, ChColor mcolor=ChColor(1, 0, 0))
 Fast method to set a glyph for GLYPH_VECTOR draw mode. More...
 
void SetGlyphCoordsys (unsigned int id, ChCoordsys<> mcoord)
 Fast method to set a glyph for GLYPH_COORDSYS draw mode. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChVisualization
bool IsVisible () const
 Get/Set visible status flag.
 
void SetVisible (bool mv)
 
const ChColorGetColor () const
 Get/Set the color of the surface. More...
 
void SetColor (const ChColor &mc)
 
float GetFading () const
 Get/Set the fading amount, 0 <= fading <= 1. More...
 
void SetFading (const float mc)
 
- Public Member Functions inherited from chrono::ChAsset
virtual void Update (ChPhysicsItem *updater, const ChCoordsys<> &coords)
 This is called by the owner, i.e. More...
 

Public Attributes

std::vector< ChVector< double > > points
 
std::vector< ChColorcolors
 
std::vector< ChVector< double > > vectors
 
std::vector< ChQuaternion< double > > rotations
 
- Public Attributes inherited from chrono::ChVisualization
ChVector Pos
 
ChMatrix33 Rot
 Position of Asset.
 

Protected Attributes

eCh_GlyphType draw_mode
 
double size
 
bool zbuffer_hide
 
- Protected Attributes inherited from chrono::ChVisualization
bool visible
 
ChColor color
 
float fading
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::ChVisualization
 ChVisualization ()
 Rotation of Asset. More...
 

Member Function Documentation

void chrono::ChGlyphs::Reserve ( unsigned int  n_glyphs)

Resize the vectors of data so that memory management is faster than calling SetGlyphPoint() etc.

by starting with zero size vectors that will be inflated when needed..

void chrono::ChGlyphs::SetGlyphCoordsys ( unsigned int  id,
ChCoordsys<>  mcoord 
)

Fast method to set a glyph for GLYPH_COORDSYS draw mode.

If the id is more than the reserved amount of glyphs (see Reserve() ) the csys are inflated.

void chrono::ChGlyphs::SetGlyphPoint ( unsigned int  id,
ChVector<>  mpoint,
ChColor  mcolor = ChColor(1, 0, 0) 
)

Fast method to set a glyph for GLYPH_POINT draw mode.

Fast method to set a glyph for GLYPH_POINT draw mode:

If the id is more than the reserved amount of glyphs (see Reserve() ) the vectors are inflated.

void chrono::ChGlyphs::SetGlyphVector ( unsigned int  id,
ChVector<>  mpoint,
ChVector<>  mvector,
ChColor  mcolor = ChColor(1, 0, 0) 
)

Fast method to set a glyph for GLYPH_VECTOR draw mode.

Fast method to set a glyph for GLYPH_VECTOR draw mode:

If the id is more than the reserved amount of glyphs (see Reserve() ) the vectors are inflated.