19 #ifndef OST_GFX_ENTITY_RENDERER_HH
20 #define OST_GFX_ENTITY_RENDERER_HH
27 #if defined(GetAtomProps)
57 namespace ost {
namespace gfx {
namespace impl {
206 return std::make_pair(
true,
col_);
231 return std::make_pair(
false,
Color());
234 }
catch(std::exception&){
236 return std::make_pair(
false,
Color());
238 return std::make_pair(
false,
Color());
249 ev_(op.GetEntityView()),
252 maxv_(op.GetMaxV()){}
264 mh_(op.GetMapHandle()),
267 maxv_(op.GetMaxV()){}
Color GetColor(const String &ident) const
static Color Ele2Color(const String &ele)
Color GetColorAt(float t) const
get color
virtual ~EntityRenderer()
void ClearViews()
reset rendering views to zero
virtual void UpdateViews()=0
update views
mol::EntityView hidden_view_
virtual void PickBond(const geom::Line3 &line, Real line_width, mol::BondHandle &picked_bond)=0
pick bond
mol::EntityView effective_view_
void FlagPositionsDirty()
void AddView(const mol::EntityView &view)
add view
mol::EntityView GetFullView()
get view to be rendered by this renderer.
mol::EntityView full_view_
virtual void RenderPov(PovState &pov, const std::string &name)
povray rendering call
virtual const String & GetName() const
virtual void SetName(const String &name)
bool HasSelection() const
whether the renderer has a non-empty selection
unsigned int debug_flags_
mol::EntityView full_sel_
void SetEnabled(bool enabled=true)
virtual void Apply(const gfx::UniformColorOp &op)=0
void SubstractView(const mol::EntityView &view)
virtual bool HasDataToRender() const
virtual void Apply(const gfx::ByElementColorOp &op)=0
IndexedVertexArray sel_va_
const Color & GetSelectionColorOutline() const
virtual void RenderOptionsChanged()
virtual RenderOptionsPtr GetOptions()=0
IndexedVertexArray & VA()
virtual void Apply(const gfx::ByChainColorOp &op)=0
virtual void Apply(const gfx::EntityViewColorOp &op)=0
virtual void SetOptions(RenderOptionsPtr &render_options)=0
void Debug(unsigned int flags)
virtual void Render(RenderPass pass)
render the entity
void SetVisible(const mol::EntityView &view, bool visible)
hide / show part of the rendered data
virtual void Apply(const gfx::GradientLevelColorOp &op)=0
mol::EntityView GetEffectiveView()
virtual void Apply(const gfx::MapHandleColorOp &op)=0
virtual geom::AlignedCuboid GetBoundingBox() const =0
virtual void Export(Exporter *ex)
scene exporter interface
virtual void PrepareRendering()=0
virtual void PickAtom(const geom::Line3 &line, Real line_width, mol::AtomHandle &picked_atom)=0
pick atom
const Color & GetSelectionColor() const
void SetSelection(const mol::EntityView &sel)
virtual bool CanSetOptions(RenderOptionsPtr &render_options)=0
Manage shared instances of images.
const geom::Vec3 & GetPos() const
Get global position in cartesian coordinates with entity transformations applied.
const String & GetElement() const
returns the element name of the atom
ResidueHandle GetResidue() const
Real Get(const AtomHandle &atom) const
get float property throwing an exception when the value does not exist
ChainHandle GetChain() const
The chain this residue is attached to.
#define DLLEXPORT_OST_GFX
float Normalize(float v, float min_v, float max_v)
float DLLEXPORT_OST_GFX MappedProperty(const mol::EntityView &ev, const String &prop, const geom::Vec3 &pos)
boost::shared_ptr< RenderOptions > RenderOptionsPtr
std::pair< bool, Color > ColorOfAtom(mol::AtomHandle &atom) const
ByChainGetCol(const ByChainColorOp &op)
const ByChainColorOp & op_
std::pair< bool, Color > ColorOfAtom(mol::AtomHandle &atom) const
std::pair< bool, Color > ColorOfAtom(mol::AtomHandle &atom) const
EntityViewGetCol(const EntityViewColorOp &op)
std::pair< bool, Color > ColorOfAtom(mol::AtomHandle &atom) const
mol::EntityPropertyMapper epm_
GradientLevelGetCol(const GradientLevelColorOp &op)
std::pair< bool, Color > ColorOfAtom(mol::AtomHandle &atom) const
MapHandleGetCol(const MapHandleColorOp &op)