19 #ifndef OST_GFX_ENTITY_HH
20 #define OST_GFX_ENTITY_HH
27 #include <boost/ptr_container/ptr_map.hpp>
48 namespace ost {
namespace gfx {
231 const Gradient& g,
float minv,
float maxv);
236 const Gradient& g,
float minv,
float maxv);
241 float minv,
float maxv,
247 float minv,
float maxv,
253 float minv,
float maxv,
269 float min,
float max,
279 float rmin,
float rmax,
280 float vmin,
float vmax,
284 float rmin,
float rmax,
333 mutable bool update_view_;
342 void set_static_max_rad();
343 void do_update_view()
const;
345 typedef boost::ptr_map<RenderMode::Type, impl::EntityRenderer> RendererMap;
346 mutable RendererMap renderer_;
352 mutable bool needs_update_;
Three dimensional vector class, using Real precision.
graphical rendering of mol::EntityHandle entites
void SetColor(const Color &col, const String &selection=String(""))
set color for selection
void ApplyOptions(RenderMode::Type render_mode, RenderOptionsPtr &render_options)
virtual void SetClipOffset(float f)
virtual void SetVisible(const mol::EntityView &view, bool visible)
virtual void CustomRenderPov(PovState &pov)
virtual void OptionsChanged(RenderMode::Type mode)
void SetQuery(const mol::Query &q)
set a new query to use (deprecated) this will re-create the object based on the given selection
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 th...
void ColorByElement(const String &selection)
color by element for a specific selection
mol::EntityView GetSelection() const
get selection
void SetOptions(RenderMode::Type render_mode, RenderOptionsPtr &render_options)
void UpdateView()
forces all views to be regenerated from stored queries
bool IsRenderModeEnabled(RenderMode::Type mode)
void Apply(const gfx::GradientLevelColorOp &op, bool store=true)
virtual void OnRenderModeChange()
void SetSelection(const mol::EntityView &view)
set selection
virtual void ColorBy(const mol::EntityView &ev, const String &prop, const Gradient &g, float minv, float maxv)
color each component based on the gradient-mapped property of the given entity
void Apply(const gfx::ByElementColorOp &op, bool store=true)
RenderModeTypes GetNotEmptyRenderModes()
Entity(const String &name, RenderMode::Type m, const mol::EntityView &ev)
ctor variant with explicit graphics mode instead of the default
void RadiusBy(const String &prop, float rmin, float rmax, float vmin, float vmax, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void Apply(const gfx::MapHandleColorOp &op, bool store=true)
void Reset(const mol::EntityView &ev)
resets entity view this as the same effect as the ctor call with the same parameters
virtual void SetOutlineExpandFactor(float f)
set outline expansion factor (mode 3) this scales with resolution
mol::EntityHandle GetEntity() const
return underlying entity
void Apply(const gfx::EntityViewColorOp &op, bool store=true)
void SetEnableRenderMode(RenderMode::Type mode, bool enable)
void UpdatePositions()
only grab updated positions, dont rebuild the whole thing views won't be regenerated from stored quer...
const String GetRenderModeName(RenderMode::Type mode)
mol::EntityView GetView() const
get view
virtual float GetOpacity() const
returns a value smaller than 1.0 if transparency is used in this object
void Reset(const mol::EntityHandle &eh, const mol::Query &q)
resets used entity handle and query replaces underlying entity and query, keeps flags intact
void ColorBy(const String &prop, const Gradient &gradient, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
bool HasSelection() const
void CacheBoundingBox() const
void SetBlurFactors(float bf1, float bf2)
virtual void SetOpacity(float f)
set opacity (1 = no transparency)
void SetDetailColor(const Color &col, const String &selection=String(""))
void SetRenderMode(RenderMode::Type mode, const mol::EntityView &view, bool keep=false)
impl::EntityRenderer * GetOrCreateRenderer(RenderMode::Type)
void SetRenderMode(RenderMode::Type mode, const String &selection, bool keep=false)
virtual void ColorBy(const img::MapHandle &mh, const String &prop, const Gradient &g, float minv, float maxv)
color based on image
virtual geom::AlignedCuboid GetBoundingBox(bool use_tf=false) const
returns the bounding box of this object
void ColorBy(const String &prop, const Color &c1, const Color &c2, float min, float max, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void Apply(const gfx::UniformColorOp &op, bool store=true)
Entity(const String &name, RenderMode::Type m, const mol::EntityHandle &eh, const mol::Query &q=mol::Query(), mol::QueryFlags f=0)
variant with explicit graphics mode instead of the default
void SetColorForAtom(const Color &col, const mol::AtomHandle &atom)
set color for specific atom
virtual void CustomRenderGL(RenderPass pass)
internal routine
mol::QueryViewWrapper GetQueryView() const
return internally used query view
void ColorBy(const String &prop, const Gradient &gradient, const String &selection)
mol::EntityView GetRenderView(RenderMode::Type mode)
void Reset(const mol::EntityHandle &eh, const mol::Query &q, mol::QueryFlags flags)
resets used entity handle, query and flags this has the same effect as the ctor call with the same pa...
void SetQueryView(const mol::QueryViewWrapper &qv)
set new query view, rebuilding object
mol::AtomHandle PickAtom(const geom::Line3 &line, Real line_width=0.5)
pick atom
virtual bool OnSelect(const geom::Line3 &l, geom::Vec3 &result, float zlim, bool pick_flag)
Entity(const String &name, const mol::EntityHandle &eh, const mol::Query &q=mol::Query(), mol::QueryFlags f=0)
Initialize with an object name, an mol::Entity handle, and optionally with a mol::Query.
void DetailColorBy(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, float minv, float maxv, bool clamp)
void ColorBy(const String &prop, const Gradient &gradient, float minv, float maxv, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
RenderOptionsPtr GetOptions(RenderMode::Type render_mode)
Get render options for given render mode.
void RadiusBy(const String &prop, float rmin, float rmax, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
virtual void SetOutlineExpandColor(const Color &c)
set outline color (mode 3)
void ColorBy(const String &prop, const Color &c1, const Color &c2, mol::Prop::Level hint=mol::Prop::UNSPECIFIED)
void Reset(const mol::EntityHandle &eh)
resets used entity handle replaces underlying entity, keeps query and flags intact
void Apply(const gfx::ByChainColorOp &op, bool store=true)
virtual void SetVisible(const String &sel, bool visible)
bool UpdateIfNeeded() const
virtual void Export(Exporter *ex)
void ColorByChain(const String &selection)
color by chain for a specific selection
void ColorByElement()
color by element
virtual void SetOutlineWidth(float f)
set outline width in pixels (modes 1 + 2) this does not scale with resolution
virtual void CustomPreRenderGL(bool flag)
void ColorByChain()
color by chain
mol::BondHandle PickBond(const geom::Line3 &line, Real line_width=0.5)
pick bond
void Rebuild()
rebuild graphical object (see ctor comments)
virtual void SetRenderMode(RenderMode::Type mode)
change render mode
main class for all graphic objects
Manage shared instances of images.
#define DLLEXPORT_OST_GFX
std::vector< RenderMode::Type > RenderModeTypes
boost::shared_ptr< RenderOptions > RenderOptionsPtr