Skip to content
Snippets Groups Projects
Commit 0b2cccfb authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

removed in_sequence hack for backbone trace objects, added as option in gfx...

removed in_sequence hack for backbone trace objects, added as option in gfx entity interface; code cleanup in gfx render options and gfx py export
parent 39fc8a34
Branches
Tags
No related merge requests found
Showing
with 209 additions and 179 deletions
......@@ -318,6 +318,7 @@ void export_Entity()
.def("Apply",&ent_apply_61)
.def("Apply",&ent_apply_62)
#endif //OST_IMG_ENABLED
.add_property("seq_hack",&Entity::GetSeqHack,&Entity::SetSeqHack)
;
//register_ptr_to_python<EntityP>();
......
......@@ -44,22 +44,24 @@ void export_RenderOptions()
class_<LineRenderOptions, boost::shared_ptr<LineRenderOptions>, bases<RenderOptions>, boost::noncopyable>("LineRenderOptions", no_init)
.def("SetLineWidth",&LineRenderOptions::SetLineWidth)
.def("GetLineWidth",&LineRenderOptions::GetLineWidth)
.add_property("line_width", &LineRenderOptions::GetLineWidth,
&LineRenderOptions::SetLineWidth)
.def("SetAALines",&LineRenderOptions::SetAALines)
.def("GetAALines",&LineRenderOptions::GetAALines)
.add_property("aa_lines", &LineRenderOptions::GetAALines,
&LineRenderOptions::SetAALines)
.add_property("line_width", &LineRenderOptions::GetLineWidth,
&LineRenderOptions::SetLineWidth)
;
class_<SimpleRenderOptions, boost::shared_ptr<SimpleRenderOptions>, bases<LineRenderOptions>, boost::noncopyable>("SimpleRenderOptions")
.def(init<const SimpleRenderOptions&>())
.def("SetBondOrderFlag", &SimpleRenderOptions::SetBondOrderFlag)
.def("SetBondOrderDistance", &SimpleRenderOptions::SetBondOrderDistance)
.def("GetBondOrderFlag", &SimpleRenderOptions::GetBondOrderFlag)
.def("GetBondOrderDistance", &SimpleRenderOptions::GetBondOrderDistance)
.def("SetBondOrderFlag", &SimpleRenderOptions::SetBondOrderFlag)
.add_property("draw_bond_order", &SimpleRenderOptions::GetBondOrderFlag,
&SimpleRenderOptions::SetBondOrderFlag)
.add_property("bond_order_flag", &SimpleRenderOptions::GetBondOrderFlag,
&SimpleRenderOptions::SetBondOrderFlag)
.def("GetBondOrderDistance", &SimpleRenderOptions::GetBondOrderDistance)
.def("SetBondOrderDistance", &SimpleRenderOptions::SetBondOrderDistance)
.add_property("bond_order_distance", &SimpleRenderOptions::GetBondOrderDistance,
&SimpleRenderOptions::SetBondOrderDistance)
;
......@@ -72,39 +74,40 @@ void export_RenderOptions()
.def(init<const SlineRenderOptions&>())
.def("SetSplineDetail", &SlineRenderOptions::SetSplineDetail)
.def("GetSplineDetail", &SlineRenderOptions::GetSplineDetail)
.add_property("spline_detail",&SlineRenderOptions::GetSplineDetail,&SlineRenderOptions::SetSplineDetail)
;
class_<CPKRenderOptions, boost::shared_ptr<CPKRenderOptions>, bases<RenderOptions>, boost::noncopyable>("CPKRenderOptions")
.def(init<const CPKRenderOptions&>())
.def("SetSphereDetail", &CPKRenderOptions::SetSphereDetail)
.def("GetSphereDetail", &CPKRenderOptions::GetSphereDetail)
.add_property("sphere_detail", &CPKRenderOptions::GetSphereDetail,
&CPKRenderOptions::SetSphereDetail)
.def("SetSphereMode", &CPKRenderOptions::SetSphereMode)
.def("GetSphereMode", &CPKRenderOptions::GetSphereMode)
.add_property("sphere_mode", &CPKRenderOptions::GetSphereMode,
&CPKRenderOptions::SetSphereMode)
.def("SetCPKMode", &CPKRenderOptions::SetSphereMode)
.def("GetCPKMode", &CPKRenderOptions::GetSphereMode)
.add_property("cpk_mode", &CPKRenderOptions::GetSphereMode,
&CPKRenderOptions::SetSphereMode)
.add_property("sphere_mode", &CPKRenderOptions::GetSphereMode,
&CPKRenderOptions::SetSphereMode)
.add_property("sphere_detail", &CPKRenderOptions::GetSphereDetail,
&CPKRenderOptions::SetSphereDetail)
;
class_<CustomRenderOptions, boost::shared_ptr<CustomRenderOptions>, bases<RenderOptions>, boost::noncopyable>("CustomRenderOptions")
.def(init<const CustomRenderOptions&>())
.def("SetSphereDetail", &CustomRenderOptions::SetSphereDetail)
.def("GetSphereDetail", &CustomRenderOptions::GetSphereDetail)
.add_property("sphere_detail", &CustomRenderOptions::GetSphereDetail, &CustomRenderOptions::SetSphereDetail)
.def("SetArcDetail", &CustomRenderOptions::SetArcDetail)
.def("GetArcDetail", &CustomRenderOptions::GetArcDetail)
.add_property("arc_detail", &CustomRenderOptions::GetArcDetail,
&CustomRenderOptions::SetArcDetail)
.def("SetSphereRad", &CustomRenderOptions::SetSphereRad)
.def("GetSphereRad", &CustomRenderOptions::GetSphereRad)
.add_property("sphere_rad", &CustomRenderOptions::GetSphereRad, &CustomRenderOptions::SetSphereRad)
.def("SetBondRad", &CustomRenderOptions::SetBondRad)
.def("GetBondRad", &CustomRenderOptions::GetBondRad)
.add_property("sphere_detail", &CustomRenderOptions::GetSphereDetail, &CustomRenderOptions::SetSphereDetail)
.add_property("bond_rad", &CustomRenderOptions::GetBondRad, &CustomRenderOptions::SetBondRad)
.add_property("sphere_rad", &CustomRenderOptions::GetSphereRad, &CustomRenderOptions::SetSphereRad)
.add_property("arc_detail", &CustomRenderOptions::GetArcDetail,
&CustomRenderOptions::SetArcDetail)
;
class_<CartoonRenderOptions, boost::shared_ptr<CartoonRenderOptions>, bases<RenderOptions>, boost::noncopyable>("CartoonRenderOptions")
......@@ -112,57 +115,92 @@ void export_RenderOptions()
.def(init<optional<bool> >())
.def("SetSplineDetail", &CartoonRenderOptions::SetSplineDetail)
.def("GetSplineDetail", &CartoonRenderOptions::GetSplineDetail)
.add_property("spline_detail", &CartoonRenderOptions::GetSplineDetail,
&CartoonRenderOptions::SetSplineDetail)
.def("SetPolyMode", &CartoonRenderOptions::SetPolyMode)
.def("GetPolyMode", &CartoonRenderOptions::GetPolyMode)
.add_property("poly_mode", &CartoonRenderOptions::GetPolyMode,&CartoonRenderOptions::SetPolyMode)
.def("SetArcDetail", &CartoonRenderOptions::SetArcDetail)
.def("GetArcDetail", &CartoonRenderOptions::GetArcDetail)
.add_property("arc_detail", &CartoonRenderOptions::GetArcDetail,
&CartoonRenderOptions::SetArcDetail)
.def("SetNormalSmoothFactor", &CartoonRenderOptions::SetNormalSmoothFactor)
.def("GetNormalSmoothFactor", &CartoonRenderOptions::GetNormalSmoothFactor)
.add_property("normal_smooth_factor",&CartoonRenderOptions::GetNormalSmoothFactor,
&CartoonRenderOptions::SetNormalSmoothFactor)
.def("SetTubeRadius", &CartoonRenderOptions::SetTubeRadius)
.def("GetTubeRadius", &CartoonRenderOptions::GetTubeRadius)
.add_property("tube_radius",&CartoonRenderOptions::GetTubeRadius,
&CartoonRenderOptions::SetTubeRadius)
.def("SetTubeRatio", &CartoonRenderOptions::SetTubeRatio)
.def("GetTubeRatio", &CartoonRenderOptions::GetTubeRatio)
.add_property("tube_ratio",&CartoonRenderOptions::GetTubeRatio,
&CartoonRenderOptions::SetTubeRatio)
.def("SetTubeProfileType", &CartoonRenderOptions::SetTubeProfileType)
.def("GetTubeProfileType", &CartoonRenderOptions::GetTubeProfileType)
.add_property("tube_profile_type",&CartoonRenderOptions::GetTubeProfileType,
&CartoonRenderOptions::SetTubeProfileType)
.def("SetHelixWidth", &CartoonRenderOptions::SetHelixWidth)
.def("GetHelixWidth", &CartoonRenderOptions::GetHelixWidth)
.add_property("helix_width",&CartoonRenderOptions::GetHelixWidth,
&CartoonRenderOptions::SetHelixWidth)
.def("SetHelixThickness", &CartoonRenderOptions::SetHelixThickness)
.def("GetHelixThickness", &CartoonRenderOptions::GetHelixThickness)
.add_property("helix_thickness",&CartoonRenderOptions::GetHelixThickness,
&CartoonRenderOptions::SetHelixThickness)
.def("SetHelixEcc", &CartoonRenderOptions::SetHelixEcc)
.def("GetHelixEcc", &CartoonRenderOptions::GetHelixEcc)
.add_property("helix_ecc",&CartoonRenderOptions::GetHelixEcc,
&CartoonRenderOptions::SetHelixEcc)
.def("SetHelixProfileType", &CartoonRenderOptions::SetHelixProfileType)
.def("GetHelixProfileType", &CartoonRenderOptions::GetHelixProfileType)
.add_property("helix_profile_type",&CartoonRenderOptions::GetHelixProfileType,
&CartoonRenderOptions::SetHelixProfileType)
.def("SetHelixMode", &CartoonRenderOptions::SetHelixMode)
.def("GetHelixMode", &CartoonRenderOptions::GetHelixMode)
.add_property("helix_mode",&CartoonRenderOptions::GetHelixMode,
&CartoonRenderOptions::SetHelixMode)
.def("SetStrandWidth", &CartoonRenderOptions::SetStrandWidth)
.def("GetStrandWidth", &CartoonRenderOptions::GetStrandWidth)
.add_property("strand_width",&CartoonRenderOptions::GetStrandWidth,
&CartoonRenderOptions::SetStrandWidth)
.def("SetStrandThickness", &CartoonRenderOptions::SetStrandThickness)
.def("GetStrandThickness", &CartoonRenderOptions::GetStrandThickness)
.add_property("strand_thickness",&CartoonRenderOptions::GetStrandThickness,
&CartoonRenderOptions::SetStrandThickness)
.def("SetStrandEcc", &CartoonRenderOptions::SetStrandEcc)
.def("GetStrandEcc", &CartoonRenderOptions::GetStrandEcc)
.add_property("strand_ecc",&CartoonRenderOptions::GetStrandEcc,
&CartoonRenderOptions::SetStrandEcc)
.def("SetStrandProfileType", &CartoonRenderOptions::SetStrandProfileType)
.def("GetStrandProfileType", &CartoonRenderOptions::GetStrandProfileType)
.add_property("strand_profile_type",&CartoonRenderOptions::GetStrandProfileType,
&CartoonRenderOptions::SetStrandProfileType)
.def("SetStrandMode", &CartoonRenderOptions::SetStrandMode)
.def("GetStrandMode", &CartoonRenderOptions::GetStrandMode)
.add_property("strand_mode",&CartoonRenderOptions::GetStrandMode,
&CartoonRenderOptions::SetStrandMode)
.def("SetColorBlendMode", &CartoonRenderOptions::SetColorBlendMode)
.def("GetColorBlendMode", &CartoonRenderOptions::GetColorBlendMode)
.add_property("color_blend_mode",&CartoonRenderOptions::GetColorBlendMode,
&CartoonRenderOptions::SetColorBlendMode)
;
class_<TraceRenderOptions, boost::shared_ptr<TraceRenderOptions>, bases<RenderOptions>, boost::noncopyable>("TraceRenderOptions")
.def(init<const TraceRenderOptions&>())
.def("SetArcDetail", &TraceRenderOptions::SetArcDetail)
.def("GetArcDetail", &TraceRenderOptions::GetArcDetail)
.add_property("arc_detail", &TraceRenderOptions::GetArcDetail,
&TraceRenderOptions::SetArcDetail)
.def("SetNormalSmoothFactor", &TraceRenderOptions::SetNormalSmoothFactor)
.def("GetNormalSmoothFactor", &TraceRenderOptions::GetNormalSmoothFactor)
.add_property("normal_smooth_factor",
&TraceRenderOptions::GetNormalSmoothFactor,
&TraceRenderOptions::SetNormalSmoothFactor)
.def("SetTubeRadius", &TraceRenderOptions::SetTubeRadius)
.def("GetTubeRadius", &TraceRenderOptions::GetTubeRadius)
.add_property("tube_radius", &TraceRenderOptions::GetTubeRadius,
&TraceRenderOptions::SetTubeRadius)
.add_property("arc_detail", &TraceRenderOptions::GetArcDetail,
&TraceRenderOptions::SetArcDetail)
.add_property("normal_smooth_factor",
&TraceRenderOptions::GetNormalSmoothFactor,
&TraceRenderOptions::SetNormalSmoothFactor)
;
}
......
......@@ -1013,4 +1013,17 @@ void Entity::UpdateView()
UpdatePositions();
}
void Entity::SetSeqHack(bool b)
{
if(b!=trace_.GetSeqHack()) {
trace_.SetSeqHack(b);
FlagRebuild();
}
}
bool Entity::GetSeqHack() const
{
return trace_.GetSeqHack();
}
}} // ns
......@@ -277,6 +277,9 @@ public:
bool HasSelection() const;
void UpdateView();
void SetSeqHack(bool b);
bool GetSeqHack() const;
protected:
......
......@@ -29,7 +29,7 @@ namespace ost { namespace gfx { namespace impl {
namespace {
bool in_sequence(const mol::ResidueHandle& r1, const mol::ResidueHandle& r2)
bool in_sequence(const mol::ResidueHandle& r1, const mol::ResidueHandle& r2, bool seqhack)
{
if(!r1.IsValid() || !r2.IsValid()) return false;
if(r1.GetChain()!=r2.GetChain()) return false;
......@@ -39,8 +39,7 @@ bool in_sequence(const mol::ResidueHandle& r1, const mol::ResidueHandle& r2)
if(n1.NextInsertionCode()==n2) return true;
}
if(mol::InSequence(r1,r2)) return true;
// perhaps this fallback is not so good...
if(n1.GetNum()+1==n2.GetNum()) return true;
if(seqhack && n1.GetNum()+1==n2.GetNum()) return true;
return false;
}
......@@ -48,11 +47,12 @@ bool in_sequence(const mol::ResidueHandle& r1, const mol::ResidueHandle& r2)
class TraceBuilder: public mol::EntityVisitor {
public:
TraceBuilder(BackboneTrace* bb_trace):
TraceBuilder(BackboneTrace* bb_trace, bool sh):
backbone_trace_(bb_trace),
last_residue_(),
list_(),
id_counter_(0)
id_counter_(0),
seq_hack_(sh)
{}
virtual bool VisitChain(const mol::ChainHandle& chain)
......@@ -70,7 +70,7 @@ public:
virtual bool VisitResidue(const mol::ResidueHandle& res)
{
// check in-sequence
bool in_seq=in_sequence(last_residue_,res);
bool in_seq=in_sequence(last_residue_,res,seq_hack_);
if(!in_seq) {
if(!list_.empty()) {
backbone_trace_->AddNodeEntryList(list_);
......@@ -108,14 +108,20 @@ private:
mol::ChainHandle last_chain_;
NodeEntryList list_;
int id_counter_;
bool seq_hack_;
};
BackboneTrace::BackboneTrace()
BackboneTrace::BackboneTrace():
view_(),
node_list_list_(),
seq_hack_(false)
{}
BackboneTrace::BackboneTrace(const mol::EntityView& ent)
BackboneTrace::BackboneTrace(const mol::EntityView& ent):
view_(ent),
node_list_list_(),
seq_hack_(false)
{
view_=ent;
Rebuild();
}
......@@ -144,7 +150,7 @@ void BackboneTrace::Rebuild()
{
if (view_) {
node_list_list_.clear();
TraceBuilder trace(this);
TraceBuilder trace(this,seq_hack_);
view_.Apply(trace);
}
}
......@@ -240,5 +246,11 @@ BackboneTrace BackboneTrace::CreateSubset(const mol::EntityView& subview)
return nrvo;
}
void BackboneTrace::SetSeqHack(bool f)
{
seq_hack_=f;
Rebuild();
}
}}} // ns
......@@ -64,6 +64,10 @@ public:
static void PrepList(NodeEntryList& nelist);
// re-creates internal nodelist-list based on view
/*
seq_hack will apply an additional hackish N/N+1 rnum check
to determine if two consecutive residues are connected
*/
void Rebuild();
// entity has new positions
......@@ -73,9 +77,14 @@ public:
// this is faster then re-generating a trace
BackboneTrace CreateSubset(const mol::EntityView& subview);
void SetSeqHack(bool f);
bool GetSeqHack() const {return seq_hack_;}
private:
mol::EntityView view_;
NodeEntryListList node_list_list_;
bool seq_hack_;
};
}}}
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
......@@ -22,9 +23,7 @@
#include "cartoon_render_options.hh"
namespace ost {
namespace gfx {
namespace ost { namespace gfx {
CartoonRenderOptions::CartoonRenderOptions(bool force_tube):
force_tube_(force_tube),
......@@ -290,8 +289,5 @@ float CartoonRenderOptions::GetMaxRad() const{
return max_rad;
}
CartoonRenderOptions::~CartoonRenderOptions() {}
}} // ns
}
}
......@@ -27,67 +27,66 @@
#include <ost/gfx/module_config.hh>
#include <ost/gfx/render_options/render_options.hh>
#include "render_options.hh"
namespace ost { namespace gfx {
class DLLEXPORT_OST_GFX CartoonRenderOptions: public ost::gfx::RenderOptions {
class DLLEXPORT_OST_GFX CartoonRenderOptions: public RenderOptions {
public:
CartoonRenderOptions(bool force_tube=false);
// RenderOptions interface
virtual RenderMode::Type GetRenderMode();
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options);
virtual void ApplyRenderOptions(RenderOptionsPtr render_options);
virtual void SetSplineDetail(uint spline_detail);
virtual uint GetSplineDetail() const;
virtual void SetPolyMode(uint poly_mode);
virtual uint GetPolyMode() const;
virtual void SetArcDetail(uint arc_detail);
virtual uint GetArcDetail() const;
virtual void SetNormalSmoothFactor(float smooth_factor);
virtual float GetNormalSmoothFactor() const;
virtual void SetTubeRadius(float tube_radius);
virtual float GetTubeRadius() const;
virtual void SetTubeRatio(float tube_ratio);
virtual float GetTubeRatio() const;
virtual unsigned int GetTubeProfileType() const;
virtual void SetTubeProfileType(unsigned int);
virtual void SetHelixWidth(float helix_width);
virtual float GetHelixWidth() const;
virtual void SetHelixThickness(float helix_thickness);
virtual float GetHelixThickness() const;
virtual void SetHelixEcc(float helix_ecc);
virtual float GetHelixEcc() const;
virtual unsigned int GetHelixProfileType() const;
virtual void SetHelixProfileType(unsigned int);
virtual unsigned int GetHelixMode() const;
virtual void SetHelixMode(unsigned int);
virtual void SetStrandWidth(float strand_width);
virtual float GetStrandWidth() const;
virtual void SetStrandThickness(float strand_thickness);
virtual float GetStrandThickness() const;
virtual void SetStrandEcc(float strand_ecc);
virtual float GetStrandEcc() const;
virtual unsigned int GetStrandProfileType() const;
virtual void SetStrandProfileType(unsigned int);
virtual unsigned int GetStrandMode() const;
virtual void SetStrandMode(unsigned int);
virtual void SetColorBlendMode(unsigned int);
virtual unsigned int GetColorBlendMode() const;
// own interface
void SetSplineDetail(uint spline_detail);
uint GetSplineDetail() const;
void SetPolyMode(uint poly_mode);
uint GetPolyMode() const;
void SetArcDetail(uint arc_detail);
uint GetArcDetail() const;
void SetNormalSmoothFactor(float smooth_factor);
float GetNormalSmoothFactor() const;
void SetTubeRadius(float tube_radius);
float GetTubeRadius() const;
void SetTubeRatio(float tube_ratio);
float GetTubeRatio() const;
unsigned int GetTubeProfileType() const;
void SetTubeProfileType(unsigned int);
void SetHelixWidth(float helix_width);
float GetHelixWidth() const;
void SetHelixThickness(float helix_thickness);
float GetHelixThickness() const;
void SetHelixEcc(float helix_ecc);
float GetHelixEcc() const;
unsigned int GetHelixProfileType() const;
void SetHelixProfileType(unsigned int);
unsigned int GetHelixMode() const;
void SetHelixMode(unsigned int);
void SetStrandWidth(float strand_width);
float GetStrandWidth() const;
void SetStrandThickness(float strand_thickness);
float GetStrandThickness() const;
void SetStrandEcc(float strand_ecc);
float GetStrandEcc() const;
unsigned int GetStrandProfileType() const;
void SetStrandProfileType(unsigned int);
unsigned int GetStrandMode() const;
void SetStrandMode(unsigned int);
void SetColorBlendMode(unsigned int);
unsigned int GetColorBlendMode() const;
float GetMaxRad() const;
virtual ~CartoonRenderOptions();
private:
bool force_tube_;
uint spline_detail_;
......
......@@ -22,9 +22,7 @@
#include "cpk_render_options.hh"
namespace ost {
namespace gfx {
namespace ost { namespace gfx {
CPKRenderOptions::CPKRenderOptions(): sphere_detail_(4) {
#if OST_SHADER_SUPPORT_ENABLED
......@@ -72,8 +70,4 @@ uint CPKRenderOptions::GetSphereMode(){
return cpk_mode_;
}
CPKRenderOptions::~CPKRenderOptions() {}
}
}
}} // ns
......@@ -27,7 +27,8 @@
#include <ost/base.hh>
#include <ost/gfx/module_config.hh>
#include <ost/gfx/render_options/render_options.hh>
#include "render_options.hh"
namespace ost { namespace gfx {
......@@ -35,22 +36,20 @@ class DLLEXPORT_OST_GFX CPKRenderOptions: public RenderOptions {
public:
CPKRenderOptions();
// RenderOptions interface
virtual RenderMode::Type GetRenderMode();
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options);
virtual void ApplyRenderOptions(RenderOptionsPtr render_options);
virtual void SetSphereDetail(uint detail);
virtual uint GetSphereDetail();
virtual void SetSphereMode(uint mode);
virtual uint GetSphereMode();
virtual ~CPKRenderOptions();
// own interface
void SetSphereDetail(uint detail);
uint GetSphereDetail();
void SetSphereMode(uint mode);
uint GetSphereMode();
private:
uint sphere_detail_;
uint cpk_mode_;
};
typedef boost::shared_ptr<CPKRenderOptions> CPKRenderOptionsPtr;
......
......@@ -22,9 +22,7 @@
#include "custom_render_options.hh"
namespace ost {
namespace gfx {
namespace ost { namespace gfx {
CustomRenderOptions::CustomRenderOptions():
sphere_detail_(4),
......@@ -99,8 +97,4 @@ float CustomRenderOptions::GetBondRad() const
return bond_rad_;
}
CustomRenderOptions::~CustomRenderOptions() {}
}
}
}} // ns
......@@ -27,33 +27,30 @@
#include <ost/base.hh>
#include <ost/gfx/module_config.hh>
#include <ost/gfx/render_options/render_options.hh>
#include "render_options.hh"
namespace ost {namespace gfx {
class DLLEXPORT_OST_GFX CustomRenderOptions: public ost::gfx::RenderOptions {
class DLLEXPORT_OST_GFX CustomRenderOptions: public RenderOptions {
public:
CustomRenderOptions();
// RenderOptions interface
virtual RenderMode::Type GetRenderMode();
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options);
virtual void ApplyRenderOptions(RenderOptionsPtr render_options);
virtual void SetSphereDetail(uint sphere_detail);
virtual uint GetSphereDetail();
virtual void SetArcDetail(uint arc_detail);
virtual uint GetArcDetail();
// own interface
void SetSphereDetail(uint sphere_detail);
uint GetSphereDetail();
void SetArcDetail(uint arc_detail);
uint GetArcDetail();
void SetSphereRad(float r);
float GetSphereRad() const;
void SetBondRad(float r);
float GetBondRad() const;
virtual ~CustomRenderOptions();
private:
uint sphere_detail_;
uint arc_detail_;
......
......@@ -22,9 +22,7 @@
#include "line_render_options.hh"
namespace ost {
namespace gfx {
namespace ost { namespace gfx {
LineRenderOptions::LineRenderOptions(): line_width_(2.0), aa_lines_(false){}
......@@ -58,8 +56,4 @@ bool LineRenderOptions::GetAALines(){
return aa_lines_;
}
LineRenderOptions::~LineRenderOptions() {}
}
}
}} // ns
......@@ -29,35 +29,30 @@
#include "render_options.hh"
namespace ost {
namespace ost { namespace gfx {
namespace gfx {
class DLLEXPORT_OST_GFX LineRenderOptions: public ost::gfx::RenderOptions {
class DLLEXPORT_OST_GFX LineRenderOptions: public RenderOptions {
public:
LineRenderOptions();
// partial RenderOptions interface
//virtual RenderMode::Type GetRenderMode()=0;
//virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options)=0;
virtual void ApplyRenderOptions(RenderOptionsPtr render_options);
virtual void SetLineWidth(float line_width);
virtual float GetLineWidth();
virtual void SetAALines(bool aa_lines);
virtual bool GetAALines();
virtual ~LineRenderOptions();
void SetLineWidth(float line_width);
float GetLineWidth();
void SetAALines(bool aa_lines);
bool GetAALines();
private:
float line_width_;
bool aa_lines_;
};
typedef boost::shared_ptr<LineRenderOptions> LineRenderOptionsPtr;
}
}} // ns
}
#endif
#endif /* OST_GFX_SIMPLE_RENDER_OPTIONS_HH */
......@@ -22,11 +22,10 @@
#include "line_trace_render_options.hh"
namespace ost {
namespace ost { namespace gfx {
namespace gfx {
LineTraceRenderOptions::LineTraceRenderOptions(){}
LineTraceRenderOptions::LineTraceRenderOptions()
{}
RenderMode::Type LineTraceRenderOptions::GetRenderMode(){
return RenderMode::LINE_TRACE;
......@@ -36,8 +35,4 @@ bool LineTraceRenderOptions::CanApplyRenderOptions(RenderOptionsPtr render_optio
return render_options.get()->GetRenderMode()==RenderMode::LINE_TRACE;
}
LineTraceRenderOptions::~LineTraceRenderOptions() {}
}
}
}} // ns
......@@ -26,20 +26,18 @@
#include <boost/shared_ptr.hpp>
#include <ost/gfx/module_config.hh>
#include <ost/gfx/render_options/line_render_options.hh>
namespace ost {
#include "line_render_options.hh"
namespace gfx {
namespace ost { namespace gfx {
class DLLEXPORT_OST_GFX LineTraceRenderOptions: public ost::gfx::LineRenderOptions {
class DLLEXPORT_OST_GFX LineTraceRenderOptions: public LineRenderOptions {
public:
LineTraceRenderOptions();
// remaining RenderOptions interface not define in LineRenderOptions
virtual RenderMode::Type GetRenderMode();
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options);
virtual ~LineTraceRenderOptions();
};
typedef boost::shared_ptr<LineTraceRenderOptions> LineTraceRenderOptionsPtr;
......
......@@ -60,5 +60,4 @@ void RenderOptions::NotifyStateChange()
}
}
}}
}} // ns
......@@ -40,15 +40,15 @@ typedef boost::shared_ptr<RenderOptions> RenderOptionsPtr;
class DLLEXPORT_OST_GFX RenderOptions {
public:
RenderOptions();
virtual ~RenderOptions(){}
virtual RenderMode::Type GetRenderMode()=0;
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options)=0;
virtual void ApplyRenderOptions(RenderOptionsPtr render_options)=0;
virtual bool AddObserver( EntityP entity);
virtual bool RemoveObserver( EntityP entity);
virtual void NotifyStateChange();
virtual ~RenderOptions(){}
bool AddObserver( EntityP entity);
bool RemoveObserver( EntityP entity);
void NotifyStateChange();
private:
typedef std::vector< EntityP > EntityPObservers;
......
......@@ -22,9 +22,7 @@
#include "simple_render_options.hh"
namespace ost {
namespace gfx {
namespace ost { namespace gfx {
SimpleRenderOptions::SimpleRenderOptions():
blur_flag_(false), blur_factors_(1.0, 0.8),
......@@ -40,8 +38,6 @@ bool SimpleRenderOptions::CanApplyRenderOptions(RenderOptionsPtr render_options)
return render_options.get()->GetRenderMode()==RenderMode::SIMPLE;
}
SimpleRenderOptions::~SimpleRenderOptions() {}
bool SimpleRenderOptions::GetBlurFlag() const
{
return blur_flag_;
......@@ -86,6 +82,5 @@ void SimpleRenderOptions::SetBlurFactors(Real bf1, Real bf2)
this->NotifyStateChange();
}
}
}} // ns
}
......@@ -29,19 +29,17 @@
#include "line_render_options.hh"
namespace ost {
namespace ost { namespace gfx {
namespace gfx {
class DLLEXPORT_OST_GFX SimpleRenderOptions: public ost::gfx::LineRenderOptions {
class DLLEXPORT_OST_GFX SimpleRenderOptions: public LineRenderOptions {
public:
SimpleRenderOptions();
// remaining RenderOptions interface not define in LineRenderOptions
virtual RenderMode::Type GetRenderMode();
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options);
virtual ~SimpleRenderOptions();
// own interface
bool GetBlurFlag() const;
bool GetBondOrderFlag() const;
Real GetBondOrderDistance() const;
......@@ -50,6 +48,7 @@ public:
void SetBlurFactors(Real bf1, Real bf2);
void SetBondOrderFlag(bool flag);
void SetBondOrderDistance(Real bod);
private:
bool blur_flag_;
std::pair<Real, Real> blur_factors_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment