diff --git a/modules/gfx/pymod/export_color_ops.cc b/modules/gfx/pymod/export_color_ops.cc index efce2b6db91adb7a0141875fef8e10f12cff8345..e0863e3621f78952e288ac47ee085b60e4067290 100644 --- a/modules/gfx/pymod/export_color_ops.cc +++ b/modules/gfx/pymod/export_color_ops.cc @@ -44,6 +44,7 @@ void export_ColorOps() .def(init<const ColorOp&>()) .def(init<const mol::QueryViewWrapper&, int>()) .def("CanApplyTo",&ColorOp::CanApplyTo) + .def("GetName",&ColorOp::GetName,return_value_policy<copy_const_reference>()) .def("SetSelection",&ColorOp::SetSelection) .def("GetSelection",&ColorOp::GetSelection) .def("SetSelectionFlags",&ColorOp::SetSelectionFlags) diff --git a/modules/gfx/src/color_ops/basic_gradient_color_op.cc b/modules/gfx/src/color_ops/basic_gradient_color_op.cc index 8648a8304e2974f2c75ef956e7093fc0a58ce115..39733eb6b8c06332cc4b7ff86b13d9956ae57ef6 100644 --- a/modules/gfx/src/color_ops/basic_gradient_color_op.cc +++ b/modules/gfx/src/color_ops/basic_gradient_color_op.cc @@ -26,12 +26,17 @@ namespace ost { namespace gfx { BasicGradientColorOp::BasicGradientColorOp() : ColorOp(), gradient_(){ - + this->Init(); } BasicGradientColorOp::BasicGradientColorOp(const String& selection, const gfx::Gradient& gradient, mol::Prop::Level level) : ColorOp(selection), gradient_(gradient), level_(level){ + this->Init(); +} +void BasicGradientColorOp::Init() +{ + this->SetName("Basic gradient"); } bool BasicGradientColorOp::CanApplyTo(const GfxObjP& obj) const{ diff --git a/modules/gfx/src/color_ops/basic_gradient_color_op.hh b/modules/gfx/src/color_ops/basic_gradient_color_op.hh index b00a092e210675cb73d05159e0255c84f09c1317..d8a4d3c4436b79b61e6afc8c54f8b41546df333c 100644 --- a/modules/gfx/src/color_ops/basic_gradient_color_op.hh +++ b/modules/gfx/src/color_ops/basic_gradient_color_op.hh @@ -52,6 +52,7 @@ public: static gfx::BasicGradientColorOp FromInfo(info::InfoGroup& group); private: + void Init(); gfx::Gradient gradient_; mol::Prop::Level level_; }; diff --git a/modules/gfx/src/color_ops/by_chain_color_op.cc b/modules/gfx/src/color_ops/by_chain_color_op.cc index a0fd3b12da3212e3bea3f749692648e4f5d20297..e760d0e38aa7c2f677d81bd644b1a31eebea8763 100644 --- a/modules/gfx/src/color_ops/by_chain_color_op.cc +++ b/modules/gfx/src/color_ops/by_chain_color_op.cc @@ -26,11 +26,25 @@ namespace ost { namespace gfx { -ByChainColorOp::ByChainColorOp() : ColorOp(),chain_count_(0),color_grad_("RAINBOW"){} +ByChainColorOp::ByChainColorOp() : ColorOp(),chain_count_(0),color_grad_("RAINBOW") +{ + this->Init(); +} -ByChainColorOp::ByChainColorOp(const String& selection, int mask) : ColorOp(selection,mask),chain_count_(0),color_grad_("RAINBOW"){} +ByChainColorOp::ByChainColorOp(const String& selection, int mask) : ColorOp(selection,mask),chain_count_(0),color_grad_("RAINBOW") +{ + this->Init(); +} -ByChainColorOp::ByChainColorOp(const mol::QueryViewWrapper& query_view, int mask) : ColorOp(query_view,mask),chain_count_(0),color_grad_("RAINBOW"){} +ByChainColorOp::ByChainColorOp(const mol::QueryViewWrapper& query_view, int mask) : ColorOp(query_view,mask),chain_count_(0),color_grad_("RAINBOW") +{ + this->Init(); +} + +void ByChainColorOp::Init() +{ + this->SetName("By chain"); +} bool ByChainColorOp::CanApplyTo(const GfxObjP& obj) const{ if(dynamic_cast<Entity*>(obj.get())) diff --git a/modules/gfx/src/color_ops/by_chain_color_op.hh b/modules/gfx/src/color_ops/by_chain_color_op.hh index 30d3ec2e6e5e41b65e8194deb9d4a4c2a3a5c1b3..75193354b4337ad2b0ba97b031d2bfdcaed4d0ad 100644 --- a/modules/gfx/src/color_ops/by_chain_color_op.hh +++ b/modules/gfx/src/color_ops/by_chain_color_op.hh @@ -50,6 +50,7 @@ public: static gfx::ByChainColorOp FromInfo(info::InfoGroup& group); private: + void Init(); gfx::Color GenerateColor(String& ident) const; mutable int chain_count_; diff --git a/modules/gfx/src/color_ops/by_element_color_op.cc b/modules/gfx/src/color_ops/by_element_color_op.cc index b27669d797a5522d1752c3ea3aa648536fce42da..c09e542d4995e0e434cb25a6c31bb3e2db38b614 100644 --- a/modules/gfx/src/color_ops/by_element_color_op.cc +++ b/modules/gfx/src/color_ops/by_element_color_op.cc @@ -25,11 +25,25 @@ namespace ost { namespace gfx { -ByElementColorOp::ByElementColorOp() : ColorOp(){} +ByElementColorOp::ByElementColorOp() : ColorOp() +{ + this->Init(); +} -ByElementColorOp::ByElementColorOp(const String& selection, int mask) : ColorOp(selection,mask){} +ByElementColorOp::ByElementColorOp(const String& selection, int mask) : ColorOp(selection,mask) +{ + this->Init(); +} -ByElementColorOp::ByElementColorOp(const mol::QueryViewWrapper& query_view, int mask) : ColorOp(query_view,mask){} +ByElementColorOp::ByElementColorOp(const mol::QueryViewWrapper& query_view, int mask) : ColorOp(query_view,mask) +{ + this->Init(); +} + +void ByElementColorOp::Init() +{ + this->SetName("By element"); +} bool ByElementColorOp::CanApplyTo(const GfxObjP& obj) const{ if(dynamic_cast<Entity*>(obj.get())) diff --git a/modules/gfx/src/color_ops/by_element_color_op.hh b/modules/gfx/src/color_ops/by_element_color_op.hh index 2de442121cc12f0433a702a02a3e09bac79e5b10..defceee742d9990dae8e387719a0a13fb5421348 100644 --- a/modules/gfx/src/color_ops/by_element_color_op.hh +++ b/modules/gfx/src/color_ops/by_element_color_op.hh @@ -44,6 +44,8 @@ public: virtual void ApplyTo(GfxObjP& obj) const; static ost::gfx::ByElementColorOp FromInfo(info::InfoGroup& group); +private: + void Init(); }; }} diff --git a/modules/gfx/src/color_ops/color_op.cc b/modules/gfx/src/color_ops/color_op.cc index f9fa131dbd7feed87d2c493c75e4659bf6235d7f..5003f90988a10dcfdb3f7fc4ff06cb8e4186e181 100644 --- a/modules/gfx/src/color_ops/color_op.cc +++ b/modules/gfx/src/color_ops/color_op.cc @@ -21,16 +21,16 @@ namespace ost { namespace gfx { -ColorOp::ColorOp(): query_view_(), mask_(DETAIL_COLOR|MAIN_COLOR) +ColorOp::ColorOp(): name_("Abstract coloring"), query_view_(), mask_(DETAIL_COLOR|MAIN_COLOR) { } ColorOp::ColorOp(const String& selection, int mask): - query_view_(mol::Query(selection),mol::EntityView() ), mask_(mask) + name_("Abstract coloring"), query_view_(mol::Query(selection),mol::EntityView() ), mask_(mask) { } ColorOp::ColorOp(const mol::QueryViewWrapper& query_view, int mask): - query_view_(query_view), mask_(mask) + name_("Abstract coloring"), query_view_(query_view), mask_(mask) { } bool ColorOp::CanApplyTo(const GfxObjP& obj) const @@ -43,6 +43,16 @@ void ColorOp::ApplyTo(GfxObjP& obj) const //Do Nothing } +const String& ColorOp::GetName() const +{ + return name_; +} + +void ColorOp::SetName(const String& name) +{ + name_=name; +} + void ColorOp::SetSelection(const String& selection) { query_view_.SetQuery(selection); diff --git a/modules/gfx/src/color_ops/color_op.hh b/modules/gfx/src/color_ops/color_op.hh index 92950141193f6def5cf085574574393949010059..7d891039dd2574e54d07b59a8dd67d02a41440a2 100644 --- a/modules/gfx/src/color_ops/color_op.hh +++ b/modules/gfx/src/color_ops/color_op.hh @@ -51,6 +51,8 @@ public: virtual bool CanApplyTo(const GfxObjP& obj) const; virtual void ApplyTo(GfxObjP& obj) const; + virtual const String& GetName() const; + ColorMask GetMask() const; void SetMask(ColorMask mask); @@ -67,7 +69,12 @@ public: virtual void ToInfo(info::InfoGroup& group) const; static gfx::ColorOp FromInfo(info::InfoGroup& group); + +protected: + virtual void SetName(const String& name); + private: + String name_; mol::QueryViewWrapper query_view_; ColorMask mask_; }; diff --git a/modules/gfx/src/color_ops/entity_view_color_op.cc b/modules/gfx/src/color_ops/entity_view_color_op.cc index de21ceab38be7ffea3acaccc9eae052bd0d427d8..e52a25b71018fba8ea6425d4a31948f55aec247c 100644 --- a/modules/gfx/src/color_ops/entity_view_color_op.cc +++ b/modules/gfx/src/color_ops/entity_view_color_op.cc @@ -27,16 +27,21 @@ namespace ost { namespace gfx { EntityViewColorOp::EntityViewColorOp() : GradientColorOp(), ev_(){ - + this->Init(); } EntityViewColorOp::EntityViewColorOp(int mask, const String& property, const gfx::Gradient& gradient, float minv, float maxv, const mol::EntityView& ev) : GradientColorOp("", mask, property, gradient, minv, maxv), ev_(ev){ - + this->Init(); } EntityViewColorOp::EntityViewColorOp(const String& property, const gfx::Gradient& gradient, float minv, float maxv, const mol::EntityView& ev) : GradientColorOp("", property, gradient, minv, maxv), ev_(ev){ + this->Init(); +} +void EntityViewColorOp::Init() +{ + this->SetName("EntityView gradient"); } bool EntityViewColorOp::CanApplyTo(const GfxObjP& obj) const{ diff --git a/modules/gfx/src/color_ops/entity_view_color_op.hh b/modules/gfx/src/color_ops/entity_view_color_op.hh index 9f5098faa64169d065284a7fa0cc29afcbb8c743..a0afba972956fc7d0014481f39cc47198f9296ef 100644 --- a/modules/gfx/src/color_ops/entity_view_color_op.hh +++ b/modules/gfx/src/color_ops/entity_view_color_op.hh @@ -52,6 +52,7 @@ public: static gfx::EntityViewColorOp FromInfo(info::InfoGroup& group); private: + void Init(); mol::EntityView ev_; }; diff --git a/modules/gfx/src/color_ops/gradient_color_op.cc b/modules/gfx/src/color_ops/gradient_color_op.cc index 83205dc172041e4067b2563ffc4adba1d9c93704..8b2bc6595c734a564d8aa728c3c0ffdf7d6b28ed 100644 --- a/modules/gfx/src/color_ops/gradient_color_op.cc +++ b/modules/gfx/src/color_ops/gradient_color_op.cc @@ -25,7 +25,7 @@ namespace ost { namespace gfx { GradientColorOp::GradientColorOp() : ColorOp(), property_(), gradient_(){ - + this->Init(); } GradientColorOp::GradientColorOp(const String& selection, const String& property, @@ -33,48 +33,69 @@ GradientColorOp::GradientColorOp(const String& selection, const String& property float minv, float maxv): ColorOp(selection), property_(property), gradient_(gradient), calculate_(false), minv_(minv), maxv_(maxv) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const String& selection, int mask, const String& property, const gfx::Gradient& gradient, float minv, float maxv): ColorOp(selection,mask), property_(property), gradient_(gradient), calculate_(false), minv_(minv), maxv_(maxv) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const String& selection, const String& property, const gfx::Gradient& gradient): ColorOp(selection), property_(property), gradient_(gradient), calculate_(true) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const String& selection, int mask, const String& property, const gfx::Gradient& gradient): ColorOp(selection,mask), property_(property), gradient_(gradient), calculate_(true) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const mol::QueryViewWrapper& query_view, const String& property, const gfx::Gradient& gradient, float minv, float maxv): ColorOp(query_view), property_(property), gradient_(gradient), calculate_(false), minv_(minv), maxv_(maxv) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const mol::QueryViewWrapper& query_view, int mask, const String& property, const gfx::Gradient& gradient, float minv, float maxv): ColorOp(query_view,mask), property_(property), gradient_(gradient), calculate_(false), minv_(minv), maxv_(maxv) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const mol::QueryViewWrapper& query_view, const String& property, const gfx::Gradient& gradient): ColorOp(query_view), property_(property), gradient_(gradient), calculate_(true) -{ } +{ + this->Init(); +} GradientColorOp::GradientColorOp(const mol::QueryViewWrapper& query_view, int mask, const String& property, const gfx::Gradient& gradient): ColorOp(query_view,mask), property_(property), gradient_(gradient), calculate_(true) -{ } +{ + this->Init(); +} + +void GradientColorOp::Init() +{ + this->SetName("Gradient"); +} void GradientColorOp::SetProperty(const String& property) { diff --git a/modules/gfx/src/color_ops/gradient_color_op.hh b/modules/gfx/src/color_ops/gradient_color_op.hh index 98a6df76caae580e89936d89e05495198ab3cc52..6823981da5ddc563bf8ec19d5891512a27a0227a 100644 --- a/modules/gfx/src/color_ops/gradient_color_op.hh +++ b/modules/gfx/src/color_ops/gradient_color_op.hh @@ -65,6 +65,7 @@ public: static gfx::GradientColorOp FromInfo(info::InfoGroup& group); private: + void Init(); String property_; gfx::Gradient gradient_; bool calculate_; diff --git a/modules/gfx/src/color_ops/gradient_level_color_op.cc b/modules/gfx/src/color_ops/gradient_level_color_op.cc index bd9400a2351149c984ea5ed05ceeeb00b9dbac75..564fd763b8e2ed090ed66c88c751c9a775faf4a5 100644 --- a/modules/gfx/src/color_ops/gradient_level_color_op.cc +++ b/modules/gfx/src/color_ops/gradient_level_color_op.cc @@ -25,8 +25,9 @@ namespace ost { namespace gfx { -GradientLevelColorOp::GradientLevelColorOp() : GradientColorOp(), level_(){ - +GradientLevelColorOp::GradientLevelColorOp() : GradientColorOp(), level_() +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const String& selection, @@ -34,8 +35,9 @@ GradientLevelColorOp::GradientLevelColorOp(const String& selection, const gfx::Gradient& gradient, float minv, float maxv, mol::Prop::Level level): - GradientColorOp(selection, property, gradient, minv, maxv), level_(level){ - + GradientColorOp(selection, property, gradient, minv, maxv), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const String& selection, int mask, @@ -43,24 +45,27 @@ GradientLevelColorOp::GradientLevelColorOp(const String& selection, int mask, const gfx::Gradient& gradient, float minv, float maxv, mol::Prop::Level level): - GradientColorOp(selection, mask, property, gradient, minv, maxv), level_(level){ - + GradientColorOp(selection, mask, property, gradient, minv, maxv), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const String& selection, const String& property, const gfx::Gradient& gradient, mol::Prop::Level level): - GradientColorOp(selection, property, gradient), level_(level){ - + GradientColorOp(selection, property, gradient), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const String& selection, int mask, const String& property, const gfx::Gradient& gradient, mol::Prop::Level level): - GradientColorOp(selection, mask, property, gradient), level_(level){ - + GradientColorOp(selection, mask, property, gradient), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const mol::QueryViewWrapper& query_view, @@ -68,8 +73,9 @@ GradientLevelColorOp::GradientLevelColorOp(const mol::QueryViewWrapper& query_vi const gfx::Gradient& gradient, float minv, float maxv, mol::Prop::Level level): - GradientColorOp(query_view, property, gradient, minv, maxv), level_(level){ - + GradientColorOp(query_view, property, gradient, minv, maxv), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const mol::QueryViewWrapper& query_view, int mask, @@ -77,24 +83,32 @@ GradientLevelColorOp::GradientLevelColorOp(const mol::QueryViewWrapper& query_vi const gfx::Gradient& gradient, float minv, float maxv, mol::Prop::Level level): - GradientColorOp(query_view, mask, property, gradient, minv, maxv), level_(level){ - + GradientColorOp(query_view, mask, property, gradient, minv, maxv), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const mol::QueryViewWrapper& query_view, const String& property, const gfx::Gradient& gradient, mol::Prop::Level level): - GradientColorOp(query_view, property, gradient), level_(level){ - + GradientColorOp(query_view, property, gradient), level_(level) +{ + this->Init(); } GradientLevelColorOp::GradientLevelColorOp(const mol::QueryViewWrapper& query_view, int mask, const String& property, const gfx::Gradient& gradient, mol::Prop::Level level): - GradientColorOp(query_view, mask, property, gradient), level_(level){ + GradientColorOp(query_view, mask, property, gradient), level_(level) +{ + this->Init(); +} +void GradientLevelColorOp::Init() +{ + this->SetName("Gradient level"); } bool GradientLevelColorOp::CanApplyTo(const GfxObjP& obj) const{ diff --git a/modules/gfx/src/color_ops/gradient_level_color_op.hh b/modules/gfx/src/color_ops/gradient_level_color_op.hh index d0c1cac667f41b28f9b7b8b5e4cf11c656f6d686..5dd6a854b6d9b9c96d7327a65600f10b3f3e12eb 100644 --- a/modules/gfx/src/color_ops/gradient_level_color_op.hh +++ b/modules/gfx/src/color_ops/gradient_level_color_op.hh @@ -76,6 +76,7 @@ public: static gfx::GradientLevelColorOp FromInfo(info::InfoGroup& group); private: + void Init(); mol::Prop::Level level_; }; diff --git a/modules/gfx/src/color_ops/map_handle_color_op.cc b/modules/gfx/src/color_ops/map_handle_color_op.cc index 3c45f77fc4283b2dc021ee012c1e766cee816414..0bb2fc598d2607408f043ee9cf7f61ee26225dd8 100644 --- a/modules/gfx/src/color_ops/map_handle_color_op.cc +++ b/modules/gfx/src/color_ops/map_handle_color_op.cc @@ -26,20 +26,33 @@ namespace ost { namespace gfx { MapHandleColorOp::MapHandleColorOp() : GradientColorOp(), mh_(){ - + this->Init(); } MapHandleColorOp::MapHandleColorOp(const String& selection, const String& property, const gfx::Gradient& gradient, float minv, float maxv, const img::MapHandle& mh) : - GradientColorOp(selection, property, gradient, minv, maxv), mh_(mh){ } + GradientColorOp(selection, property, gradient, minv, maxv), mh_(mh){ + this->Init(); +} MapHandleColorOp::MapHandleColorOp(const String& selection, int mask, const String& property, const gfx::Gradient& gradient, float minv, float maxv, const img::MapHandle& mh) : - GradientColorOp(selection, mask, property, gradient, minv, maxv), mh_(mh){ } + GradientColorOp(selection, mask, property, gradient, minv, maxv), mh_(mh){ + this->Init(); +} MapHandleColorOp::MapHandleColorOp(const mol::QueryViewWrapper& query_view, const String& property, const gfx::Gradient& gradient, float minv, float maxv, const img::MapHandle& mh) : - GradientColorOp(query_view, property, gradient, minv, maxv), mh_(mh){ } + GradientColorOp(query_view, property, gradient, minv, maxv), mh_(mh){ + this->Init(); +} MapHandleColorOp::MapHandleColorOp(const mol::QueryViewWrapper& query_view, int mask, const String& property, const gfx::Gradient& gradient, float minv, float maxv, const img::MapHandle& mh) : - GradientColorOp(query_view, mask, property, gradient, minv, maxv), mh_(mh){ } + GradientColorOp(query_view, mask, property, gradient, minv, maxv), mh_(mh){ + this->Init(); +} + +void MapHandleColorOp::Init() +{ + this->SetName("MapHandle gradient"); +} bool MapHandleColorOp::CanApplyTo(const GfxObjP& obj) const{ if(dynamic_cast<Entity*>(obj.get())){ diff --git a/modules/gfx/src/color_ops/map_handle_color_op.hh b/modules/gfx/src/color_ops/map_handle_color_op.hh index 3dd6b302c36f16e6883f0f805ea01d3ff6ed89ac..2340e334318e3c0dca265d46702f75e3d521614d 100644 --- a/modules/gfx/src/color_ops/map_handle_color_op.hh +++ b/modules/gfx/src/color_ops/map_handle_color_op.hh @@ -52,6 +52,7 @@ public: static gfx::MapHandleColorOp FromInfo(info::InfoGroup& group); private: + void Init(); img::MapHandle mh_; }; diff --git a/modules/gfx/src/color_ops/uniform_color_op.cc b/modules/gfx/src/color_ops/uniform_color_op.cc index 3b7fa9e2c699bb3093d212a579ae2df51b88d239..91f0fb2fb118789a725cd1b9a85cbc9cd4081d95 100644 --- a/modules/gfx/src/color_ops/uniform_color_op.cc +++ b/modules/gfx/src/color_ops/uniform_color_op.cc @@ -27,29 +27,36 @@ namespace ost { namespace gfx { UniformColorOp::UniformColorOp() : ColorOp(), color_(){ - + this->Init(); } UniformColorOp::UniformColorOp(const String& selection, const gfx::Color& color): ColorOp(selection), color_(color){ - + this->Init(); } UniformColorOp::UniformColorOp(const String& selection, int mask, const gfx::Color& color): ColorOp(selection,mask), color_(color){ + this->Init(); } UniformColorOp::UniformColorOp(const mol::QueryViewWrapper& query_view, const gfx::Color& color): ColorOp(query_view), color_(color){ - + this->Init(); } UniformColorOp::UniformColorOp(const mol::QueryViewWrapper& query_view, int mask, const gfx::Color& color): ColorOp(query_view,mask), color_(color){ + this->Init(); +} + +void UniformColorOp::Init() +{ + this->SetName("Uniform color"); } bool UniformColorOp::CanApplyTo(const GfxObjP& obj) const diff --git a/modules/gfx/src/color_ops/uniform_color_op.hh b/modules/gfx/src/color_ops/uniform_color_op.hh index 03e7ccd7f5f4f878b5cef81e7b8beb48bb5adb04..4ebef48bf70f2b656165e29ac3e41a20718efaa7 100644 --- a/modules/gfx/src/color_ops/uniform_color_op.hh +++ b/modules/gfx/src/color_ops/uniform_color_op.hh @@ -50,6 +50,7 @@ public: virtual void ToInfo(info::InfoGroup& group) const; static gfx::UniformColorOp FromInfo(info::InfoGroup& group); private: + void Init(); gfx::Color color_; }; diff --git a/modules/gui/pymod/scene/preset_editor_list_model.py b/modules/gui/pymod/scene/preset_editor_list_model.py index d796e5352c009075e8c236673ebcad6c0dbcdea0..e85a67c05e53ebe8500f986e2d85ab312148bdd9 100644 --- a/modules/gui/pymod/scene/preset_editor_list_model.py +++ b/modules/gui/pymod/scene/preset_editor_list_model.py @@ -42,11 +42,12 @@ class PresetEditorListModel(QtCore.QAbstractListModel): if index.isValid() and index.row()< self.rowCount(): data = self.preset_.GetOp(index.row()) if role == QtCore.Qt.DisplayRole: + name=data.GetName() selection=str(data.GetSelection()) if(len(selection)>0): - return QtCore.QVariant(selection) + return QtCore.QVariant(str("%s (%s)"%(name,selection))) else: - return QtCore.QVariant("all") + return QtCore.QVariant(str("%s (all)"%name)) return QtCore.QVariant() def setData(self, index, value, role): diff --git a/modules/gui/pymod/scene/render_op.py b/modules/gui/pymod/scene/render_op.py index feab4451a256041a41205597c6f7a2538b128e7b..991e82427c0a232a6c8a9364ed78befe0d2437e8 100644 --- a/modules/gui/pymod/scene/render_op.py +++ b/modules/gui/pymod/scene/render_op.py @@ -32,7 +32,10 @@ class RenderOp(): self.selection_ = selection self.keep_ = keep self.flags_ = flags - + + def GetName(self): + return "Render mode: %s"%str(self.GetRenderMode()) + def SetRenderMode(self, render_mode): self.render_mode_ = render_mode diff --git a/modules/gui/pymod/scene/visibility_op.py b/modules/gui/pymod/scene/visibility_op.py index 5eeb3bffdebd5f88dfc86c5a9a5249dff9903adf..325553f8fe9675df172ad8d9db85426ce0dcdb49 100644 --- a/modules/gui/pymod/scene/visibility_op.py +++ b/modules/gui/pymod/scene/visibility_op.py @@ -31,6 +31,9 @@ class VisibilityOp(): self.visible_ = visible self.flags_ = flags + def GetName(self): + return "Visible: %s"%str(self.IsVisible()) + def SetSelection(self, selection): self.selection_ = selection