Skip to content
Snippets Groups Projects
Commit 6c5cba92 authored by stefan's avatar stefan
Browse files

Inspector Gadget, fix for changing rendermode when multiple gfx::Objects are selected

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2562 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent f14dc863
Branches
Tags
No related merge requests found
......@@ -41,6 +41,7 @@ using namespace ost::gfx;
void export_ColorOps()
{
class_<ColorOp>("ColorOp", init<const String& >())
.def(init<const ColorOp&>())
.def(init<const mol::QueryViewWrapper&, int>())
.def("CanApplyTo",&ColorOp::CanApplyTo)
.def("SetSelection",&ColorOp::SetSelection)
......@@ -53,6 +54,7 @@ void export_ColorOps()
;
class_<BasicGradientColorOp, bases<ColorOp> >("BasicGradientColorOp", init<const String& , const gfx::Gradient& , mol::Prop::Level>())
.def(init<const BasicGradientColorOp&>())
.def("SetGradient",&BasicGradientColorOp::SetGradient)
.def("GetGradient",&BasicGradientColorOp::GetGradient)
.def("SetLevel",&BasicGradientColorOp::SetLevel)
......@@ -62,6 +64,7 @@ void export_ColorOps()
;
class_<ByElementColorOp, bases<ColorOp> >("ByElementColorOp", init<>())
.def(init<const ByElementColorOp&>())
.def(init<const String&>())
.def(init<const mol::QueryViewWrapper&>())
.def(init<const String&, int>())
......@@ -71,6 +74,7 @@ void export_ColorOps()
;
class_<ByChainColorOp, bases<ColorOp> >("ByChainColorOp", init<>())
.def(init<const ByChainColorOp&>())
.def(init<const String&>())
.def(init<const mol::QueryViewWrapper&>())
.def(init<const String&, int>())
......@@ -82,6 +86,7 @@ void export_ColorOps()
;
class_<UniformColorOp, bases<ColorOp> >("UniformColorOp", init<>())
.def(init<const UniformColorOp&>())
.def(init<const String&, const gfx::Color&>())
.def(init<const String&, int, const gfx::Color&>())
.def(init<const mol::QueryViewWrapper&, const gfx::Color&>())
......@@ -93,6 +98,7 @@ void export_ColorOps()
;
class_<GradientColorOp, bases<ColorOp> >("GradientColorOp", init<>())
.def(init<const GradientColorOp&>())
.def(init<const String&, const String&, const gfx::Gradient&, float, float>())
.def(init<const String&, int, const String&, const gfx::Gradient&, float, float>())
.def(init<const mol::QueryViewWrapper&, const String&, const gfx::Gradient&, float, float>())
......@@ -111,6 +117,7 @@ void export_ColorOps()
;
class_<GradientLevelColorOp, bases<GradientColorOp> >("GradientLevelColorOp", init<>())
.def(init<const GradientLevelColorOp&>())
.def(init<const String&, const String&, const gfx::Gradient&, float, float, mol::Prop::Level>())
.def(init<const String&, int, const String&, const gfx::Gradient&, float, float, mol::Prop::Level>())
.def(init<const String&, const String&, const gfx::Gradient&, mol::Prop::Level>())
......@@ -127,6 +134,7 @@ void export_ColorOps()
class_<EntityViewColorOp, bases<GradientColorOp> >("EntityViewColorOp", init<>())
.def(init<const EntityViewColorOp&>())
.def(init<const String&, const gfx::Gradient&, float, float, const mol::EntityView&>())
.def(init<int, const String&, const gfx::Gradient&, float, float, const mol::EntityView&>())
.def("SetEntityView",&EntityViewColorOp::SetEntityView)
......@@ -137,6 +145,7 @@ void export_ColorOps()
#if OST_IMG_ENABLED
class_<MapHandleColorOp, bases<GradientColorOp> >("MapHandleColorOp", init<>())
.def(init<const MapHandleColorOp&>())
.def(init<const String&, const String&, const gfx::Gradient&, float, float, const img::MapHandle&>())
.def(init<const String&, int, const String&, const gfx::Gradient&, float, float, const img::MapHandle&>())
.def(init<const mol::QueryViewWrapper&, const String&, const gfx::Gradient&, float, float, const img::MapHandle&>())
......
......@@ -36,6 +36,9 @@ void export_RenderOptions()
{
class_<RenderOptions, boost::shared_ptr<RenderOptions>, boost::noncopyable>("RenderOptions", no_init)
.def("GetRenderMode",&RenderOptions::GetRenderMode)
.def("NotifyStateChange",&RenderOptions::NotifyStateChange)
.def("AddObserver",&RenderOptions::AddObserver)
.def("RemoveObserver",&RenderOptions::RemoveObserver)
;
class_<LineRenderOptions, boost::shared_ptr<LineRenderOptions>, bases<RenderOptions>, boost::noncopyable>("LineRenderOptions", no_init)
......@@ -50,6 +53,7 @@ void export_RenderOptions()
;
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)
......@@ -61,14 +65,17 @@ void export_RenderOptions()
;
class_<LineTraceRenderOptions, boost::shared_ptr<LineTraceRenderOptions>, bases<LineRenderOptions>, boost::noncopyable>("LineTraceRenderOptions")
.def(init<const LineTraceRenderOptions&>())
;
class_<SlineRenderOptions, boost::shared_ptr<SlineRenderOptions>, bases<LineRenderOptions>, boost::noncopyable>("SlineRenderOptions")
.def(init<const SlineRenderOptions&>())
.def("SetSplineDetail", &SlineRenderOptions::SetSplineDetail)
.def("GetSplineDetail", &SlineRenderOptions::GetSplineDetail)
;
class_<CPKRenderOptions, boost::shared_ptr<CPKRenderOptions>, bases<RenderOptions>, boost::noncopyable>("CPKRenderOptions")
.def(init<const CPKRenderOptions&>())
.def("SetSphereDetail", &CPKRenderOptions::SetSphereDetail)
.def("GetSphereDetail", &CPKRenderOptions::GetSphereDetail)
.def("SetCPKMode", &CPKRenderOptions::SetCPKMode)
......@@ -80,6 +87,7 @@ void export_RenderOptions()
;
class_<CustomRenderOptions, boost::shared_ptr<CustomRenderOptions>, bases<RenderOptions>, boost::noncopyable>("CustomRenderOptions")
.def(init<const CustomRenderOptions&>())
.def("SetSphereDetail", &CustomRenderOptions::SetSphereDetail)
.def("GetSphereDetail", &CustomRenderOptions::GetSphereDetail)
.def("SetArcDetail", &CustomRenderOptions::SetArcDetail)
......@@ -96,6 +104,7 @@ void export_RenderOptions()
;
class_<CartoonRenderOptions, boost::shared_ptr<CartoonRenderOptions>, bases<RenderOptions>, boost::noncopyable>("CartoonRenderOptions")
.def(init<const CartoonRenderOptions&>())
.def(init<optional<bool> >())
.def("SetSplineDetail", &CartoonRenderOptions::SetSplineDetail)
.def("GetSplineDetail", &CartoonRenderOptions::GetSplineDetail)
......@@ -130,6 +139,7 @@ void export_RenderOptions()
;
class_<TraceRenderOptions, boost::shared_ptr<TraceRenderOptions>, bases<RenderOptions>, boost::noncopyable>("TraceRenderOptions")
.def(init<const TraceRenderOptions&>())
.def("SetArcDetail", &TraceRenderOptions::SetArcDetail)
.def("GetArcDetail", &TraceRenderOptions::GetArcDetail)
.def("SetNormalSmoothFactor", &TraceRenderOptions::SetNormalSmoothFactor)
......
......@@ -60,17 +60,17 @@ class RenderModeWidget(QtGui.QWidget):
entity = scene_selection.GetViewEntity()
self.entities_.add(entity)
for entity in self.entities_:
if len(self.entities_)>0:
entity = self.entities_.pop()
self.options_=entity.GetOptions(self.GetRenderMode())
self.entities_.remove(entity)
break
self.UpdateGui(self.options_)
QtGui.QWidget.setEnabled(self,True)
self.UpdateGui(self.options_)
QtGui.QWidget.setEnabled(self,True)
else:
QtGui.QWidget.setEnabled(self,False)
def ApplyOptions(self):
for entity in self.entities_:
entity.SetOptions(self.GetRenderMode(),self.options_)
entity.ApplyOptions(self.GetRenderMode(), self.GetOptions())
def GetOptions(self):
return self.options_
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment