PrimList Class Reference

#include <prim_list.hh>

Inherits ost::gfx::GfxObj.

Data Structures

struct  LineEntry
struct  PointEntry

Public Member Functions

 PrimList (const String &name)
virtual geom::AlignedCuboid GetBoundingBox (bool use_tf=true) const
virtual void ProcessLimits (geom::Vec3 &minc, geom::Vec3 &maxc, const geom::Transform &tf) const
virtual geom::Vec3 GetCenter () const
virtual void CustomRenderPov (PovState &pov)
virtual void CustomRenderGL (RenderPass pass)
virtual void OnRenderModeChange ()
virtual void SetLineWidth (float w)
void Clear ()
void AddPoint (const geom::Vec3 &p, const Color &col)
void AddLine (const geom::Vec3 &p1, const geom::Vec3 &p2, const Color &col1, const Color &col2)
void AddSphere (const geom::Vec3 &cen, float rad, const Color &col)
void AddCyl (const geom::Vec3 &p0, const geom::Vec3 &p1, float r1, float r2, const Color &col1, const Color &col2)
void AddText (const std::string &text, const geom::Vec3 &pos, const Color &col, float point_size)
void SetDiameter (float d)
void SetRadius (float r)
void SetColor (const Color &c)
void SetSphereDetail (unsigned int d)
unsigned int GetSphereDetail () const
void SetArcDetail (unsigned int d)
unsigned int GetArcDetail () const
void AddMesh (float *v, float *n, float *c, size_t nv, unsigned int *i, size_t ni)

Protected Member Functions

virtual void CustomPreRenderGL (bool flag)

Detailed Description

See also:
gfx::Cuboid, Displaying Lines and Quads, gfx::Quad, Gradient Example, Random Lines

Definition at line 38 of file prim_list.hh.


Constructor & Destructor Documentation

PrimList ( const String name  ) 

create new prim list


Member Function Documentation

void AddCyl ( const geom::Vec3 p0,
const geom::Vec3 p1,
float  r1,
float  r2,
const Color col1,
const Color col2 
)

add cylinder

Python interface:

PrimList.AddCyl(pos1,pos2,radius=1.0,radius1=1.0,radius2=1.0,color=gfx.WHITE,color1=gfx.WHITE,color2=gfx.WHITE)

void AddLine ( const geom::Vec3 p1,
const geom::Vec3 p2,
const Color col1,
const Color col2 
)

add line

Python interface:

PrimList.AddLine(pos1,pos2,color=gfx.WHITE,color1=gfx.WHITE,color2=gfx.WHITE)

void AddMesh ( float *  v,
float *  n,
float *  c,
size_t  nv,
unsigned int *  i,
size_t  ni 
)

add triangle mesh

v : pointer to nv*3 floats for the positions (mandatory) n : pointer to nv*3 floats for the normals (may be NULL) c : pointer to nv*4 floats for the colors (may be NULL) nv: number of vertices, normals, and colors i : pointer to ni*3 vertex indices ni: number of index triplets

Python interface, using numpy arrays:

AddMesh(vertex_array, normal_array, color_array, index_array)

where normal_array and color_array may be None

void AddPoint ( const geom::Vec3 p,
const Color col 
)

add point

python interface:

PrimList.AddPoint(pos, color=gfx.Color())

void AddSphere ( const geom::Vec3 cen,
float  rad,
const Color col 
)

add sphere

Python interface:

PrimList.AddSphere(cen,radius=1.0,color=gfx.WHITE)

void AddText ( const std::string &  text,
const geom::Vec3 pos,
const Color col,
float  point_size 
)

add text

Python interface:

PrimList.AddText(text,pos,color=gfx.WHITE,point_size=1.0)

void Clear (  ) 

clear all prims

Reimplemented from GfxObj.

virtual void CustomPreRenderGL ( bool  flag  )  [protected, virtual]

Reimplemented from GfxObj.

virtual void CustomRenderGL ( RenderPass  pass  )  [virtual]

Reimplemented from GfxObj.

virtual void CustomRenderPov ( PovState pov  )  [virtual]

Reimplemented from GfxObj.

unsigned int GetArcDetail (  )  const [inline]

Definition at line 139 of file prim_list.hh.

virtual geom::AlignedCuboid GetBoundingBox ( bool  use_tf = true  )  const [virtual]

returns the bounding box of this object

The bounding box, i.e. the left-bottom-front and the right-top-back corner of the object, is obtained with this method. The single boolean parameter denotes whether to return local coordinates or global scene coordinates; global scene coordinates are local coordinates with the object's transformation (if present) applied. The default is false, i.e. return local coordinates.

Reimplemented from GfxObj.

virtual geom::Vec3 GetCenter (  )  const [virtual]

get center

Reimplemented from GfxObj.

unsigned int GetSphereDetail (  )  const [inline]

Definition at line 136 of file prim_list.hh.

virtual void OnRenderModeChange (  )  [virtual]

Reimplemented from GfxObj.

virtual void ProcessLimits ( geom::Vec3 minc,
geom::Vec3 maxc,
const geom::Transform tf 
) const [virtual]

adjust minimum and maximum extent based on graphical object

this routine will adjust the provided minimum and maximum points based on the vertices of the underlying graphical representation, combining the given Transform with the object transform.

If derived classes do not implement this method then the limits will be adjusted based on the Cuboid returned by GetBoundingBox(true)

Reimplemented from GfxObj.

void SetArcDetail ( unsigned int  d  ) 
void SetColor ( const Color c  ) 

set global prims color, overriding individual ones

void SetDiameter ( float  d  ) 

defunct

virtual void SetLineWidth ( float  w  )  [virtual]

set line width

Reimplemented from GfxObj.

void SetRadius ( float  r  ) 

defunct

void SetSphereDetail ( unsigned int  d  ) 

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 1 Mar 2018 for OpenStructure by  doxygen 1.6.1