Entity Class Reference

graphical rendering of mol::EntityHandle entites More...

#include <entity.hh>

Inherits ost::gfx::GfxObj.


Public Member Functions

 Entity (const String &name, const mol::EntityHandle &eh, const mol::Query &q=mol::Query())
 Entity (const String &name, RenderMode::Type m, const mol::EntityHandle &eh, const mol::Query &q=mol::Query())
 Entity (const String &name, const mol::EntityView &ev)
 Entity (const String &name, RenderMode::Type m, const mol::EntityView &ev)
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 RefreshVA ()
virtual bool OnSelect (const geom::Line3 &l, geom::Vec3 &result, float zlim, bool pick_flag)
mol::AtomHandle PickAtom (const geom::Line3 &line, Real line_width=0.5)
mol::BondHandle PickBond (const geom::Line3 &line, Real line_width=0.5)
virtual void OnRenderModeChange ()
const String GetRenderModeName (RenderMode::Type mode)
void SetEnableRenderMode (RenderMode::Type mode, bool enable)
bool IsRenderModeEnabled (RenderMode::Type mode)
RenderModeTypes GetNotEmptyRenderModes ()
void SetRenderMode (RenderMode::Type mode, const mol::EntityView &view, bool keep=false)
virtual void SetRenderMode (RenderMode::Type mode)
mol::EntityView GetRenderView (RenderMode::Type mode)
virtual void SetVisible (const mol::EntityView &view, bool visible)
virtual void OptionsChanged (RenderMode::Type mode)
void Rebuild ()
void UpdatePositions ()
void SetColor (const Color &col, const String &selection=String(""))
void SetDetailColor (const Color &col, const String &selection=String(""))
void SetColorForAtom (const Color &col, const mol::AtomHandle &atom)
void ColorByElement ()
void ColorByChain ()
mol::EntityView GetView () const
void SetBlur (bool f)
void BlurSnapshot ()
void SetBlurFactors (float bf1, float bf2)
void SetSelection (const mol::EntityView &view)
mol::EntityView GetSelection () const
virtual void ColorBy (const mol::EntityView &ev, const String &prop, const Gradient &g, float minv, float maxv)
void ColorBy (const String &prop, const Gradient &gradient, float minv, float maxv, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void ColorBy (const String &prop, const Gradient &gradient, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void ColorBy (const String &prop, const Color &c1, const Color &c2, float min, float max, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void ColorBy (const String &prop, const Color &c1, const Color &c2, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void RadiusBy (const String &prop, float rmin, float rmax, float vmin, float vmax, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void RadiusBy (const String &prop, float rmin, float rmax, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void ResetRadiusBy ()
void Apply (const gfx::ByElementColorOp &op, bool store=true)
void Apply (const gfx::ByChainColorOp &op, bool store=true)
void Apply (const gfx::UniformColorOp &op, bool store=true)
void Apply (const gfx::GradientLevelColorOp &op, bool store=true)
void Apply (const gfx::EntityViewColorOp &op, bool store=true)
void CleanColorOps ()
void ReapplyColorOps ()
RenderOptionsPtr GetOptions (RenderMode::Type render_mode)
void SetOptions (RenderMode::Type render_mode, RenderOptionsPtr &render_options)
void ApplyOptions (RenderMode::Type render_mode, RenderOptionsPtr &render_options)
bool HasSelection () const

Protected Member Functions

virtual void CustomPreRenderGL (bool flag)
virtual void CustomRenderPov (PovState &pov)
void UpdateSelection ()
bool UpdateIfNeeded () const
void CacheBoundingBox () const
impl::EntityRendererGetOrCreateRenderer (RenderMode::Type)


Detailed Description

graphical rendering of mol::EntityHandle entites

Entity is responsible for rendering of molecular entities. A bunch of different RenderMode::Type render modes are supported. To switch the render mode of the full entity, Entity::SetRenderMode(RenderMode::Type) can be used. To only change one part to a different rendering style, use Entity::SetRenderMode(RenderMode::Type, mol::EntityView, bool)

Definition at line 63 of file entity.hh.


Constructor & Destructor Documentation

Entity ( const String name,
const mol::EntityHandle eh,
const mol::Query q = mol::Query() 
)

Initialize with an object name, an mol::Entity handle, and optionally with a mol::Query.

If the latter is ommitted, the full view is displayed. A later call to Rebuild() will re-apply the mol::Query to the given mol::EntityHandle

Entity ( const String name,
RenderMode::Type  m,
const mol::EntityHandle eh,
const mol::Query q = mol::Query() 
)

variant with explicit graphics mode instead of the default

Entity ( const String name,
const mol::EntityView ev 
)

Initialize with an object name and an explicit mol::Entity view; later calls to Rebuild always use this mol::Entity view.

Entity ( const String name,
RenderMode::Type  m,
const mol::EntityView ev 
)

ctor variant with explicit graphics mode instead of the default


Member Function Documentation

void Apply ( const gfx::EntityViewColorOp op,
bool  store = true 
)

void Apply ( const gfx::GradientLevelColorOp op,
bool  store = true 
)

void Apply ( const gfx::UniformColorOp op,
bool  store = true 
)

void Apply ( const gfx::ByChainColorOp op,
bool  store = true 
)

void Apply ( const gfx::ByElementColorOp op,
bool  store = true 
)

void ApplyOptions ( RenderMode::Type  render_mode,
RenderOptionsPtr render_options 
)

void BlurSnapshot (  ) 

void CacheBoundingBox (  )  const [protected]

void CleanColorOps (  ) 

Reimplemented from GfxObj.

void ColorBy ( const String prop,
const Color c1,
const Color c2,
mol::Prop::Level  hint = mol::Prop::UNSPECIFIED 
)

void ColorBy ( const String prop,
const Color c1,
const Color c2,
float  min,
float  max,
mol::Prop::Level  hint = mol::Prop::UNSPECIFIED 
)

void ColorBy ( const String prop,
const Gradient gradient,
mol::Prop::Level  hint = mol::Prop::UNSPECIFIED 
)

void ColorBy ( const String prop,
const Gradient gradient,
float  minv,
float  maxv,
mol::Prop::Level  hint = mol::Prop::UNSPECIFIED 
)

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

Reimplemented from GfxObj.

void ColorByChain (  ) 

color by chain

void ColorByElement (  ) 

color by element

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

Reimplemented from GfxObj.

virtual void CustomRenderGL ( RenderPass  pass  )  [virtual]

internal routine

Reimplemented from GfxObj.

virtual void CustomRenderPov ( PovState pov  )  [protected, virtual]

Reimplemented from GfxObj.

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 from GfxObj.

RenderModeTypes GetNotEmptyRenderModes (  ) 

RenderOptionsPtr GetOptions ( RenderMode::Type  render_mode  ) 

Get render options for given render mode.

In Python, also available as the properties:

  • sline_options
  • simple_options
  • tube_options
  • cartoon_options
  • cpk_options
  • trace_options
  • custom_options

impl::EntityRenderer* GetOrCreateRenderer ( RenderMode::Type   )  [protected]

const String GetRenderModeName ( RenderMode::Type  mode  ) 

mol::EntityView GetRenderView ( RenderMode::Type  mode  ) 

mol::EntityView GetSelection (  )  const

get selection

See also:
gfx_ent

mol::EntityView GetView (  )  const

get view

bool HasSelection (  )  const

bool IsRenderModeEnabled ( RenderMode::Type  mode  ) 

virtual void OnRenderModeChange (  )  [virtual]

Reimplemented from GfxObj.

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

Reimplemented from GfxObj.

virtual void OptionsChanged ( RenderMode::Type  mode  )  [virtual]

mol::AtomHandle PickAtom ( const geom::Line3 line,
Real  line_width = 0.5 
)

pick atom

In case the line intersects several atoms, the atom closest to the near clipping plane is returned. Returns an invalid handle in case no atom was close to the line

Todo:
honour object transformation

mol::BondHandle PickBond ( const geom::Line3 line,
Real  line_width = 0.5 
)

pick bond

In case the line intersects several bonds, the bond closest to the near clipping plane is returned. Returns an invalid handle if no bond was close to the line.

Todo:
honour object transformation

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 from GfxObj.

void RadiusBy ( const String prop,
float  rmin,
float  rmax,
mol::Prop::Level  hint = mol::Prop::UNSPECIFIED 
)

void RadiusBy ( const String prop,
float  rmin,
float  rmax,
float  vmin,
float  vmax,
mol::Prop::Level  hint = mol::Prop::UNSPECIFIED 
)

void ReapplyColorOps (  ) 

Reimplemented from GfxObj.

void Rebuild (  ) 

rebuild graphical object (see ctor comments)

virtual void RefreshVA (  )  [virtual]

Reimplemented from GfxObj.

void ResetRadiusBy (  ) 

void SetBlur ( bool  f  ) 

void SetBlurFactors ( float  bf1,
float  bf2 
)

void SetColor ( const Color col,
const String selection = String("") 
)

set color for selection

void SetColorForAtom ( const Color col,
const mol::AtomHandle atom 
)

set color for specific atom

void SetDetailColor ( const Color col,
const String selection = String("") 
)

void SetEnableRenderMode ( RenderMode::Type  mode,
bool  enable 
)

void SetOptions ( RenderMode::Type  render_mode,
RenderOptionsPtr render_options 
)

virtual void SetRenderMode ( RenderMode::Type  m  )  [virtual]

change render mode

Reimplemented from GfxObj.

void SetRenderMode ( RenderMode::Type  mode,
const mol::EntityView view,
bool  keep = false 
)

void SetSelection ( const mol::EntityView view  ) 

set selection

See also:
gfx_ent

virtual void SetVisible ( const mol::EntityView view,
bool  visible 
) [virtual]

bool UpdateIfNeeded (  )  const [protected]

void UpdatePositions (  ) 

only grab updated positions, dont rebuild the whole thing

void UpdateSelection (  )  [protected]


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

Generated on Fri Jul 2 14:23:06 2010 for OpenStructure by  doxygen 1.5.8