diff --git a/modules/gfx/pymod/export_entity.cc b/modules/gfx/pymod/export_entity.cc index 0767825bdb12415a5eca9477e5ea5f56e20b7015..6202bd1cc4d353d61b673c78d68b402ecbc7b137 100644 --- a/modules/gfx/pymod/export_entity.cc +++ b/modules/gfx/pymod/export_entity.cc @@ -338,12 +338,14 @@ void export_Entity() .def("BlurSnapshot", &Entity::BlurSnapshot) .def("SetBlurFactors",&Entity::SetBlurFactors) .def("SetBlur",&Entity::SetBlur) - .def("GetBoundingBox",&Entity::GetBoundingBox) + .def("GetBoundingBox",&Entity::GetBoundingBox) + .add_property("bounding_box",&Entity::GetBoundingBox) .def("SetSelection",&Entity::SetSelection) .def("GetSelection",&Entity::GetSelection) .add_property("selection", &Entity::GetSelection, &set_selection) .def("GetView", &Entity::GetView) + .add_property("view",&Entity::GetView) .def("UpdateView", &Entity::UpdateView) .def("SetQuery", set_query) .def("SetQueryView",&Entity::SetQueryView) @@ -356,7 +358,6 @@ void export_Entity() .def("SetRenderMode", set_rm3, (arg("mode"), arg("sel"), arg("keep")=false)) .def("SetEnableRenderMode", &Entity::SetEnableRenderMode) .def("IsRenderModeEnabled", &Entity::IsRenderModeEnabled) - .add_property("view", &Entity::GetView) .def("SetVisible", set_vis1, (arg("view"), arg("flag")=true)) .def("SetVisible", set_vis2, (arg("sel"), arg("flag")=true)) .def("ColorBy", color_by_01) diff --git a/modules/gfx/pymod/export_gfx_obj.cc b/modules/gfx/pymod/export_gfx_obj.cc index 70458055914d2e74f399c318eae2b398e98a2943..1d2ed62cd446fa5689230ff4eeda73cb5f7d787a 100644 --- a/modules/gfx/pymod/export_gfx_obj.cc +++ b/modules/gfx/pymod/export_gfx_obj.cc @@ -77,21 +77,29 @@ void export_GfxObj() .def("ContextSwitch", &GfxObjBase::ContextSwitch) .def("SetRenderMode", &GfxObjBase::SetRenderMode) .def("GetRenderMode", &GfxObjBase::GetRenderMode) - .def("GetCenter",&GfxObjBase::GetCenter) + .def("GetCenter",&GfxObjBase::GetCenter) + .add_property("center", &GfxObjBase::GetCenter) .def("SetLineWidth", &GfxObjBase::SetLineWidth) .def("SetPolyMode",&GfxObjBase::SetPolyMode) - .def("AALines",set_aalines) + .def("AALines",set_aalines) /* deprecated */ .def("SetAALines",&GfxObjBase::SetAALines) .def("SetLineHalo",&GfxObjBase::SetLineHalo) - .def("Outline",set_outline) + .def("Outline",set_outline) /* deprecated */ .def("SetOutline",&GfxObjBase::SetOutline) + .def("GetOutline",&GfxObjBase::GetOutline) + .add_property("outline",&GfxObjBase::GetOutline,&GfxObjBase::SetOutline) .def("SetOutlineMode",&GfxObjBase::SetOutlineMode) + .add_property("outline_mode",&GfxObjBase::GetOutlineMode,&GfxObjBase::SetOutlineMode) .def("SetOutlineWidth",&GfxObjBase::SetOutlineWidth) + .add_property("outline_width",&GfxObjBase::GetOutlineWidth,&GfxObjBase::SetOutlineWidth) .def("SetOutlineExpandFactor",&GfxObjBase::SetOutlineExpandFactor) + .add_property("outline_expand_factor",&GfxObjBase::GetOutlineExpandFactor,&GfxObjBase::SetOutlineExpandFactor) .def("SetOutlineExpandColor",&GfxObjBase::SetOutlineExpandColor) + .add_property("outline_expand_color",&GfxObjBase::GetOutlineExpandColor,&GfxObjBase::SetOutlineExpandColor) + .add_property("outline_color",&GfxObjBase::GetOutlineExpandColor,&GfxObjBase::SetOutlineExpandColor) .def("SetOpacity",&GfxObjBase::SetOpacity) .def("GetOpacity",&GfxObjBase::GetOpacity) - .add_property("center", &GfxObjBase::GetCenter) + .add_property("opacity",&GfxObjBase::GetOpacity,&GfxObjBase::SetOpacity) COLOR_BY_DEF() ; //register_ptr_to_python<GfxObjBaseP>(); diff --git a/modules/gfx/src/gfx_object.cc b/modules/gfx/src/gfx_object.cc index 8a45e784b52cb9f18ba77fe354d9262bc355bc9c..a7f061e402af59d1a442648a6d238bb4cfc31283 100644 --- a/modules/gfx/src/gfx_object.cc +++ b/modules/gfx/src/gfx_object.cc @@ -322,18 +322,33 @@ void GfxObj::SetOutlineWidth(float f) Scene::Instance().RequestRedraw(); } +float GfxObj::GetOutlineWidth() const +{ + return va_.GetOutlineWidth(); +} + void GfxObj::SetOutlineExpandFactor(float f) { va_.SetOutlineExpandFactor(f); Scene::Instance().RequestRedraw(); } +float GfxObj::GetOutlineExpandFactor() const +{ + return va_.GetOutlineExpandFactor(); +} + void GfxObj::SetOutlineExpandColor(const Color& c) { va_.SetOutlineExpandColor(c); Scene::Instance().RequestRedraw(); } +Color GfxObj::GetOutlineExpandColor() const +{ + return va_.GetOutlineExpandColor(); +} + void GfxObj::SetOpacity(float o) { opacity_=o; diff --git a/modules/gfx/src/gfx_object.hh b/modules/gfx/src/gfx_object.hh index b59009ba2a07700da07618bc95ac71a4c7496552..1865e7662607ae51624f2c0ec1e5898b41ecb21e 100644 --- a/modules/gfx/src/gfx_object.hh +++ b/modules/gfx/src/gfx_object.hh @@ -75,10 +75,15 @@ public: virtual void SetAALines(bool f); virtual void SetLineHalo(float f); virtual void SetOutline(bool f); + virtual bool GetOutline() const {return outline_flag_;}; virtual void SetOutlineMode(int m); + virtual int GetOutlineMode() const {return outline_mode_;} virtual void SetOutlineWidth(float f); + virtual float GetOutlineWidth() const; virtual void SetOutlineExpandFactor(float f); + virtual float GetOutlineExpandFactor() const; virtual void SetOutlineExpandColor(const Color& c); + virtual Color GetOutlineExpandColor() const; virtual void SetOpacity(float f); virtual float GetOpacity() const {return opacity_;} virtual void ColorBy(const mol::EntityView& ev, diff --git a/modules/gfx/src/gfx_object_base.hh b/modules/gfx/src/gfx_object_base.hh index 7884c7de4744c6a0598ec9b1c35578c72b9d0c1a..eb6c7c21743805e237377bc64e15ced0d61f3885 100644 --- a/modules/gfx/src/gfx_object_base.hh +++ b/modules/gfx/src/gfx_object_base.hh @@ -91,14 +91,26 @@ class DLLEXPORT_OST_GFX GfxObjBase: public GfxNode /// \brief turn outline rendering on or off virtual void SetOutline(bool f) = 0; - /// \brief set outline mode + /// \brief get state of outline rendering + virtual bool GetOutline() const = 0; + /// \brief set outline mode, 1, 2 or 3 virtual void SetOutlineMode(int m) = 0; - /// \brief set outline width (modes 1 + 2) + /// \brief get current outline mode + virtual int GetOutlineMode() const = 0; + /// \brief set outline width in pixels (modes 1 + 2) + /// this does not scale with resolution virtual void SetOutlineWidth(float f) = 0; - /// \brief set outline tweak factor (mode 3) + /// \brief get current outline width + virtual float GetOutlineWidth() const = 0; + /// \brief set outline expansion factor (mode 3) + /// this scales with resolution virtual void SetOutlineExpandFactor(float f) = 0; + /// \brief get current outline expand factor (mode 3) + virtual float GetOutlineExpandFactor() const = 0; /// \brief set outline color (mode 3) virtual void SetOutlineExpandColor(const Color& c) = 0; + /// \brief get current outline color (mode 3) + virtual Color GetOutlineExpandColor() const = 0; /// \brief set opacity (1 = no transparency) virtual void SetOpacity(float f) = 0; diff --git a/modules/gfx/src/vertex_array.hh b/modules/gfx/src/vertex_array.hh index 1a945f7cf6094738b0a539bfad19d72ee1767d39..3d24320e7900985df54c352135b35e173e488d5c 100644 --- a/modules/gfx/src/vertex_array.hh +++ b/modules/gfx/src/vertex_array.hh @@ -107,10 +107,14 @@ class DLLEXPORT_OST_GFX IndexedVertexArray { void SetLineHalo(float lh); void SetOutlineMode(int m); + int GetOutlineMode() const {return outline_mode_;} void SetOutlineWidth(float f); + float GetOutlineWidth() const {return outline_width_;} void SetOutlineMaterial(const Material& m); void SetOutlineExpandFactor(float f); + float GetOutlineExpandFactor() const {return outline_exp_factor_;} void SetOutlineExpandColor(const Color& c); + Color GetOutlineExpandColor() const {return outline_exp_color_;} // vertex, normal, color and texcoord (T2F_C4F_N3F_V3F) VertexID Add(const geom::Vec3& vert, const geom::Vec3& norm, const Color& col, const geom::Vec2& tex=geom::Vec2());