OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
GfxObj Class Reference

#include <gfx_object.hh>

Inherits GfxObjBase.

Inherited by Entity, GfxTestObj, MapIso, MapSlab, PrimList, PyGfxObj, and Surface.

Public Member Functions

 GfxObj (const String &name)
virtual GfxNodeP Copy () const
virtual void DeepSwap (GfxObj &go)
virtual void RenderGL (RenderPass pass)
virtual void RenderPov (PovState &pov)
virtual void Export (Exporter *ex)
virtual void Apply (GfxNodeVisitor &v, GfxNodeVisitor::Stack st)
virtual int GetType () const
virtual void SetMatAmb (const Color &c)
virtual void SetMatDiff (const Color &c)
virtual void SetMatSpec (const Color &c)
virtual void SetMatShin (float s)
virtual void SetMatEmm (const Color &c)
virtual void ContextSwitch ()
virtual void SetRenderMode (RenderMode::Type m)
virtual RenderMode::Type GetRenderMode () const
virtual geom::Vec3 GetCenter () const
virtual void SetLineWidth (float w)
virtual void SetPolyMode (unsigned int m)
virtual void SetAALines (bool f)
virtual void SetLineHalo (float f)
virtual void SetOutline (bool f)
virtual bool GetOutline () const
virtual void SetOutlineMode (int m)
virtual int GetOutlineMode () const
virtual void SetOutlineWidth (float f)
virtual float GetOutlineWidth () const
virtual void SetOutlineExpandFactor (float f)
virtual float GetOutlineExpandFactor () const
virtual void SetOutlineExpandColor (const Color &c)
virtual Color GetOutlineExpandColor () const
virtual void SetOpacity (float f)
virtual float GetOpacity () const
virtual void ColorBy (const mol::EntityView &ev, const String &prop, const Gradient &g, float minv, float maxv)
virtual geom::AlignedCuboid GetBoundingBox () const
virtual void ProcessLimits (geom::Vec3 &minc, geom::Vec3 &maxc, const mol::Transform &tf) const
virtual void CustomRenderGL (RenderPass pass)
virtual void CustomPreRenderGL (bool rebuild)
virtual void InitGL ()
virtual void CustomRenderPov (PovState &pov)
virtual bool OnSelect (const geom::Line3 &l, geom::Vec3 &result, float zlim, bool pick_flag)
virtual void OnInput (const InputEvent &e)
virtual void OnRenderModeChange ()
virtual void OnGLCleanup ()
void Clear ()
const mol::TransformGetTF () const
void SetTF (const mol::Transform &tf)
void AddLabel (const String &s, const geom::Vec3 &pos, const Color &col, float psize)
void AddLabel (const String &s, const geom::Vec3 &pos, const Color &col)
void AddLabel (const String &s, const geom::Vec3 &pos, float psize)
void AddLabel (const String &s, const geom::Vec3 &pos)
void ClearLabels ()
void FlagRebuild ()
void FlagRefresh ()
bool GetAALines () const
float GetLineWidth () const
float GetLineHalo () const
void SetNormalSmoothFactor (float smoothf)
float GetNormalSmoothFactor () const
Material GetMaterial () const
void SetMaterial (const Material &m)
void SmoothVertices (float smoothf)
void GLCleanup ()
void Debug (unsigned int flags)
- Public Member Functions inherited from GfxObjBase
 GfxObjBase (const String &name)
- Public Member Functions inherited from GfxNode
 GfxNode (const String &name)
virtual ~GfxNode ()
virtual void DeepSwap (GfxNode &n)
String GetName () const
void RemoveAll ()
void Rename (const String &name)
void Add (GfxObjP obj)
bool IsNameAvailable (const String &name) const
void Remove (GfxObjP obj)
void Add (GfxNodeP node)
void Remove (GfxNodeP node)
void Remove (const String &name)
size_t GetChildCount () const
void Hide ()
void Show ()
bool IsVisible () const
bool IsAttachedToScene () const
gfx::GfxNodeP GetParent () const
const GfxNodeVectorGetChildren () const
GfxNodeVectorGetChildren ()

Static Public Member Functions

static Color Ele2Color (const String &ele)

Protected Member Functions

void PreRenderGL (bool flag)
void AppendColorOp (gfx::ColorOp *op)
void CleanColorOps ()
void ReapplyColorOps ()
void render_labels () const
void render_depth_only ()

Protected Attributes

IndexedVertexArray va_
RenderMode::Type render_mode_
unsigned int debug_flags_
mol::Transform transform_
bool rebuild_
bool refresh_
float line_width_
unsigned int poly_mode_
bool aalines_flag_
float line_halo_
Material mat_
unsigned int mat_dlist_
bool mat_update_
float opacity_
float smoothf_
bool outline_flag_
int outline_mode_
boost::ptr_vector< gfx::ColorOpc_ops_
TextPrimList labels_
bool use_occlusion_

Detailed Description

main class for all graphic objects

Definition at line 50 of file gfx_object.hh.


Constructor & Destructor Documentation

GfxObj ( const String name)

Member Function Documentation

void AddLabel ( const String s,
const geom::Vec3 pos,
const Color col,
float  psize 
)
void AddLabel ( const String s,
const geom::Vec3 pos,
const Color col 
)
void AddLabel ( const String s,
const geom::Vec3 pos,
float  psize 
)
void AddLabel ( const String s,
const geom::Vec3 pos 
)
void AppendColorOp ( gfx::ColorOp op)
protected
virtual void Apply ( GfxNodeVisitor v,
GfxNodeVisitor::Stack  st 
)
virtual

Reimplemented from GfxNode.

void CleanColorOps ( )
protected

Reimplemented in Entity, and Surface.

void Clear ( )

removes all graphical elements

Reimplemented in PrimList.

void ClearLabels ( )
virtual void ColorBy ( const mol::EntityView ev,
const String prop,
const Gradient g,
float  minv,
float  maxv 
)
virtual

color each component based on the gradient-mapped property of the given entity

Implements GfxObjBase.

Reimplemented in Entity, and Surface.

virtual void ContextSwitch ( )
virtual

rendering context switch, some things need to be regenerated

Implements GfxObjBase.

virtual GfxNodeP Copy ( ) const
virtual

Reimplemented from GfxNode.

virtual void CustomPreRenderGL ( bool  rebuild)
virtual

Reimplemented in Entity, PrimList, MapIso, Surface, and MapSlab.

virtual void CustomRenderGL ( RenderPass  pass)
virtual

Reimplemented in Entity, PrimList, MapSlab, MapIso, Surface, and GfxTestObj.

virtual void CustomRenderPov ( PovState pov)
virtual

Reimplemented in Entity, MapSlab, PrimList, MapIso, and Surface.

void Debug ( unsigned int  flags)
virtual void DeepSwap ( GfxObj go)
virtual
static Color Ele2Color ( const String ele)
static
virtual void Export ( Exporter ex)
virtual

Reimplemented from GfxNode.

Reimplemented in Entity.

void FlagRebuild ( )
void FlagRefresh ( )
bool GetAALines ( ) const
inline

Definition at line 177 of file gfx_object.hh.

virtual geom::AlignedCuboid GetBoundingBox ( ) const
virtual

returns the left-bottom-front and the right-top-back corner that encompasses all graphical elements in this object

the bounding box is in local coordinates. to obtain the coordinates in the scene, multiply the bounding box by the object's transformation matrix.

Reimplemented in Entity, MapSlab, PrimList, Surface, MapIso, and GfxTestObj.

virtual geom::Vec3 GetCenter ( ) const
virtual

get geometric center

Implements GfxObjBase.

Reimplemented in PrimList, MapSlab, MapIso, and GfxTestObj.

float GetLineHalo ( ) const
inline

Definition at line 179 of file gfx_object.hh.

float GetLineWidth ( ) const
inline

Definition at line 178 of file gfx_object.hh.

Material GetMaterial ( ) const
float GetNormalSmoothFactor ( ) const
virtual float GetOpacity ( ) const
inlinevirtual

returns a value smaller than 1.0 if transparency is used in this object

Implements GfxObjBase.

Reimplemented in Entity.

Definition at line 90 of file gfx_object.hh.

virtual bool GetOutline ( ) const
inlinevirtual

get state of outline rendering

Implements GfxObjBase.

Definition at line 80 of file gfx_object.hh.

virtual Color GetOutlineExpandColor ( ) const
virtual

get current outline color (mode 3)

Implements GfxObjBase.

virtual float GetOutlineExpandFactor ( ) const
virtual

get current outline expand factor (mode 3)

Implements GfxObjBase.

virtual int GetOutlineMode ( ) const
inlinevirtual

get current outline mode

Implements GfxObjBase.

Definition at line 82 of file gfx_object.hh.

virtual float GetOutlineWidth ( ) const
virtual

get current outline width

Implements GfxObjBase.

virtual RenderMode::Type GetRenderMode ( ) const
virtual

current render mode

Implements GfxObjBase.

const mol::Transform& GetTF ( ) const

get transform

virtual int GetType ( ) const
virtual

Reimplemented from GfxNode.

void GLCleanup ( )
virtual void InitGL ( )
virtual
virtual void OnGLCleanup ( )
virtual
virtual void OnInput ( const InputEvent e)
virtual

Reimplemented in MapIso.

virtual void OnRenderModeChange ( )
virtual

Reimplemented in Entity, PrimList, MapIso, and Surface.

virtual bool OnSelect ( const geom::Line3 l,
geom::Vec3 result,
float  zlim,
bool  pick_flag 
)
virtual

Reimplemented in Entity.

void PreRenderGL ( bool  flag)
protected
virtual void ProcessLimits ( geom::Vec3 minc,
geom::Vec3 maxc,
const mol::Transform tf 
) const
virtual

adjust the given limits according to the represented data

Reimplemented in Entity, and PrimList.

void ReapplyColorOps ( )
protected

Reimplemented in Entity, and Surface.

void render_depth_only ( )
protected
void render_labels ( ) const
protected
virtual void RenderGL ( RenderPass  pass)
virtual

Reimplemented from GfxNode.

virtual void RenderPov ( PovState pov)
virtual

Reimplemented from GfxNode.

virtual void SetAALines ( bool  f)
virtual

turn on sophisticated line anti-aliasing, requires shader

Implements GfxObjBase.

virtual void SetLineHalo ( float  f)
virtual

turn on line halo of given strength

Implements GfxObjBase.

virtual void SetLineWidth ( float  w)
virtual

set line width

Implements GfxObjBase.

virtual void SetMatAmb ( const Color c)
virtual

material ambient color

Implements GfxObjBase.

virtual void SetMatDiff ( const Color c)
virtual

material diffuse color

Implements GfxObjBase.

virtual void SetMatEmm ( const Color c)
virtual

material emmissive color

Implements GfxObjBase.

void SetMaterial ( const Material m)
virtual void SetMatShin ( float  s)
virtual

material shininess

Implements GfxObjBase.

virtual void SetMatSpec ( const Color c)
virtual

material specular color

Implements GfxObjBase.

void SetNormalSmoothFactor ( float  smoothf)
virtual void SetOpacity ( float  f)
virtual

set opacity (1 = no transparency)

Implements GfxObjBase.

Reimplemented in Entity.

virtual void SetOutline ( bool  f)
virtual

turn outline rendering on or off

Implements GfxObjBase.

virtual void SetOutlineExpandColor ( const Color c)
virtual

set outline color (mode 3)

Implements GfxObjBase.

Reimplemented in Entity.

virtual void SetOutlineExpandFactor ( float  f)
virtual

set outline expansion factor (mode 3) this scales with resolution

Implements GfxObjBase.

Reimplemented in Entity.

virtual void SetOutlineMode ( int  m)
virtual

set outline mode, 1, 2 or 3

Implements GfxObjBase.

virtual void SetOutlineWidth ( float  f)
virtual

set outline width in pixels (modes 1 + 2) this does not scale with resolution

Implements GfxObjBase.

Reimplemented in Entity.

virtual void SetPolyMode ( unsigned int  m)
virtual

set polygon mode

Implements GfxObjBase.

virtual void SetRenderMode ( RenderMode::Type  m)
virtual

change render mode

Implements GfxObjBase.

Reimplemented in Entity.

void SetTF ( const mol::Transform tf)

set transform

void SmoothVertices ( float  smoothf)

Field Documentation

bool aalines_flag_
protected

Definition at line 221 of file gfx_object.hh.

boost::ptr_vector<gfx::ColorOp> c_ops_
protected

Definition at line 233 of file gfx_object.hh.

unsigned int debug_flags_
protected

Definition at line 214 of file gfx_object.hh.

TextPrimList labels_
protected

Definition at line 235 of file gfx_object.hh.

float line_halo_
protected

Definition at line 222 of file gfx_object.hh.

float line_width_
protected

Definition at line 219 of file gfx_object.hh.

Material mat_
protected

Definition at line 224 of file gfx_object.hh.

unsigned int mat_dlist_
protected

Definition at line 225 of file gfx_object.hh.

bool mat_update_
protected

Definition at line 226 of file gfx_object.hh.

float opacity_
protected

Definition at line 228 of file gfx_object.hh.

bool outline_flag_
protected

Definition at line 230 of file gfx_object.hh.

int outline_mode_
protected

Definition at line 231 of file gfx_object.hh.

unsigned int poly_mode_
protected

Definition at line 220 of file gfx_object.hh.

bool rebuild_
protected

Definition at line 217 of file gfx_object.hh.

bool refresh_
protected

Definition at line 218 of file gfx_object.hh.

RenderMode::Type render_mode_
protected

Definition at line 213 of file gfx_object.hh.

float smoothf_
protected

Definition at line 229 of file gfx_object.hh.

mol::Transform transform_
protected

Definition at line 216 of file gfx_object.hh.

bool use_occlusion_
protected

Definition at line 237 of file gfx_object.hh.

IndexedVertexArray va_
protected

Definition at line 212 of file gfx_object.hh.


The documentation for this class was generated from the following file: