OpenStructure
Public Member Functions | Protected Member Functions | Protected Attributes
EntityRenderer Class Referenceabstract

#include <entity_renderer.hh>

Inherited by ConnectRendererBase, and TraceRendererBase.

Public Member Functions

 EntityRenderer ()
 
virtual ~EntityRenderer ()
 
void AddView (const mol::EntityView &view)
 
void SubstractView (const mol::EntityView &view)
 
void ClearViews ()
 
virtual bool HasDataToRender () const
 
virtual const StringGetName () const
 
void SetEnabled (bool enabled=true)
 
bool IsEnabled () const
 
bool HasSelection () const
 
void SetSelection (const mol::EntityView &sel)
 
void SetVisible (const mol::EntityView &view, bool visible)
 
const ColorGetSelectionColor () const
 
const ColorGetSelectionColorOutline () const
 
mol::EntityView GetFullView ()
 
mol::EntityView GetEffectiveView ()
 
virtual void UpdateViews ()=0
 
virtual void PrepareRendering ()=0
 
virtual void Render (RenderPass pass)
 
virtual void RenderPov (PovState &pov, const std::string &name)
 
virtual void Export (Exporter *ex)
 
virtual bool CanSetOptions (RenderOptionsPtr &render_options)=0
 
virtual void SetOptions (RenderOptionsPtr &render_options)=0
 
virtual RenderOptionsPtr GetOptions ()=0
 
virtual geom::AlignedCuboid GetBoundingBox () const =0
 
virtual void PickAtom (const geom::Line3 &line, Real line_width, mol::AtomHandle &picked_atom)=0
 
virtual void PickBond (const geom::Line3 &line, Real line_width, mol::BondHandle &picked_bond)=0
 
virtual void RenderOptionsChanged ()
 
virtual void Apply (const gfx::ByElementColorOp &op)=0
 
virtual void Apply (const gfx::ByChainColorOp &op)=0
 
virtual void Apply (const gfx::UniformColorOp &op)=0
 
virtual void Apply (const gfx::GradientLevelColorOp &op)=0
 
virtual void Apply (const gfx::EntityViewColorOp &op)=0
 
virtual void Apply (const gfx::MapHandleColorOp &op)=0
 
bool IsDirty () const
 
void FlagPositionsDirty ()
 
void Debug (unsigned int flags)
 
IndexedVertexArrayVA ()
 

Protected Member Functions

virtual void SetName (const String &name)
 

Protected Attributes

String name_
 
bool enabled_
 
mol::EntityView full_view_
 
mol::EntityView effective_view_
 
mol::EntityView hidden_view_
 
IndexedVertexArray va_
 
mol::EntityView sel_
 
mol::EntityView full_sel_
 
IndexedVertexArray sel_va_
 
DirtyFlags sel_state_
 
DirtyFlags state_
 
unsigned int debug_flags_
 
float opacity_
 

Detailed Description

Definition at line 67 of file entity_renderer.hh.

Constructor & Destructor Documentation

◆ EntityRenderer()

◆ ~EntityRenderer()

virtual ~EntityRenderer ( )
inlinevirtual

Definition at line 70 of file entity_renderer.hh.

Member Function Documentation

◆ AddView()

void AddView ( const mol::EntityView view)

add view

◆ Apply() [1/6]

virtual void Apply ( const gfx::ByChainColorOp op)
pure virtual

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ Apply() [2/6]

virtual void Apply ( const gfx::ByElementColorOp op)
pure virtual

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ Apply() [3/6]

virtual void Apply ( const gfx::EntityViewColorOp op)
pure virtual

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ Apply() [4/6]

virtual void Apply ( const gfx::GradientLevelColorOp op)
pure virtual

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ Apply() [5/6]

virtual void Apply ( const gfx::MapHandleColorOp op)
pure virtual

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ Apply() [6/6]

virtual void Apply ( const gfx::UniformColorOp op)
pure virtual

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ CanSetOptions()

virtual bool CanSetOptions ( RenderOptionsPtr render_options)
pure virtual

◆ ClearViews()

void ClearViews ( )

reset rendering views to zero

◆ Debug()

void Debug ( unsigned int  flags)

◆ Export()

virtual void Export ( Exporter ex)
virtual

scene exporter interface

◆ FlagPositionsDirty()

void FlagPositionsDirty ( )

◆ GetBoundingBox()

virtual geom::AlignedCuboid GetBoundingBox ( ) const
pure virtual

◆ GetEffectiveView()

mol::EntityView GetEffectiveView ( )

◆ GetFullView()

mol::EntityView GetFullView ( )

get view to be rendered by this renderer.

Upon calling this method, the union of all views added to the renderer with AddView() is calculated by first reevaluating all queries and then merging them into one view.

◆ GetName()

virtual const String& GetName ( ) const
virtual

◆ GetOptions()

virtual RenderOptionsPtr GetOptions ( )
pure virtual

◆ GetSelectionColor()

const Color& GetSelectionColor ( ) const

◆ GetSelectionColorOutline()

const Color& GetSelectionColorOutline ( ) const

◆ HasDataToRender()

virtual bool HasDataToRender ( ) const
virtual

Reimplemented in TraceRendererBase.

◆ HasSelection()

bool HasSelection ( ) const

whether the renderer has a non-empty selection

◆ IsDirty()

bool IsDirty ( ) const

◆ IsEnabled()

bool IsEnabled ( ) const

◆ PickAtom()

virtual void PickAtom ( const geom::Line3 line,
Real  line_width,
mol::AtomHandle picked_atom 
)
pure virtual

pick atom

If picked_atom is a valid handle, picked_atom is only replaced if the candidate picked atom is closer to the near clipping plane.

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ PickBond()

virtual void PickBond ( const geom::Line3 line,
Real  line_width,
mol::BondHandle picked_bond 
)
pure virtual

pick bond

Note
calling PickBond on a trace-based renderer is a no-op as the notion of bonds is not meaningful for these renders

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ PrepareRendering()

virtual void PrepareRendering ( )
pure virtual

◆ Render()

virtual void Render ( RenderPass  pass)
virtual

render the entity

This is the place where the actual rendering should happen, i.e sending of the geometric primitives to the graphics card.

The rendering buffers and vertex arrays should be prepared in PrepareRendering()

Reimplemented in CPKRenderer.

◆ RenderOptionsChanged()

virtual void RenderOptionsChanged ( )
virtual

◆ RenderPov()

virtual void RenderPov ( PovState pov,
const std::string &  name 
)
virtual

povray rendering call

Reimplemented in TraceRenderer, SimpleRenderer, CustomRenderer, and CPKRenderer.

◆ SetEnabled()

void SetEnabled ( bool  enabled = true)

◆ SetName()

virtual void SetName ( const String name)
protectedvirtual

◆ SetOptions()

virtual void SetOptions ( RenderOptionsPtr render_options)
pure virtual

◆ SetSelection()

void SetSelection ( const mol::EntityView sel)

◆ SetVisible()

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

hide / show part of the rendered data

◆ SubstractView()

void SubstractView ( const mol::EntityView view)

◆ UpdateViews()

virtual void UpdateViews ( )
pure virtual

update views

Implemented in TraceRendererBase, and ConnectRendererBase.

◆ VA()

IndexedVertexArray& VA ( )
inline

Definition at line 166 of file entity_renderer.hh.

Field Documentation

◆ debug_flags_

unsigned int debug_flags_
protected

Definition at line 184 of file entity_renderer.hh.

◆ effective_view_

mol::EntityView effective_view_
protected

Definition at line 174 of file entity_renderer.hh.

◆ enabled_

bool enabled_
protected

Definition at line 171 of file entity_renderer.hh.

◆ full_sel_

mol::EntityView full_sel_
protected

Definition at line 179 of file entity_renderer.hh.

◆ full_view_

mol::EntityView full_view_
protected

Definition at line 173 of file entity_renderer.hh.

◆ hidden_view_

mol::EntityView hidden_view_
protected

Definition at line 175 of file entity_renderer.hh.

◆ name_

String name_
protected

Definition at line 170 of file entity_renderer.hh.

◆ opacity_

float opacity_
protected

Definition at line 185 of file entity_renderer.hh.

◆ sel_

mol::EntityView sel_
protected

Definition at line 178 of file entity_renderer.hh.

◆ sel_state_

DirtyFlags sel_state_
protected

Definition at line 182 of file entity_renderer.hh.

◆ sel_va_

IndexedVertexArray sel_va_
protected

Definition at line 180 of file entity_renderer.hh.

◆ state_

DirtyFlags state_
protected

Definition at line 183 of file entity_renderer.hh.

◆ va_

IndexedVertexArray va_
protected

Definition at line 176 of file entity_renderer.hh.


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