From 9fc7454d2dcbe0e6134d6310e81aca6645e264af Mon Sep 17 00:00:00 2001
From: Ansgar Philippsen <ansgar.philippsen@gmail.com>
Date: Thu, 26 Jul 2012 11:56:46 +0200
Subject: [PATCH] corrected in-code occurences of mol/transform.hh,
 mol::Transform, and mol.Transform to geom equivalents

The mol/transform.hh header still exists and typedefs geom.Transform to mol.Transform; however, including it
will give you a deprecation warning; please observe these warning in your code and change your Transforms to
geom::
---
 modules/gfx/pymod/export_scene.cc          |  2 +-
 modules/gfx/src/entity.cc                  |  2 +-
 modules/gfx/src/gfx_object.cc              |  6 +++---
 modules/gfx/src/gfx_object.hh              | 10 +++++-----
 modules/gfx/src/impl/entity_detail.cc      |  2 +-
 modules/gfx/src/impl/scene_fx.cc           |  2 +-
 modules/gfx/src/map_iso.cc                 |  2 +-
 modules/gfx/src/povray.hh                  |  4 ++--
 modules/gfx/src/prim_list.cc               |  4 ++--
 modules/gfx/src/prim_list.hh               |  2 +-
 modules/gfx/src/scene.cc                   | 18 +++++++++---------
 modules/gfx/src/scene.hh                   | 12 ++++++------
 modules/gui/src/dock_widget.cc             |  2 +-
 modules/gui/src/tools/map_tool.cc          |  2 +-
 modules/mol/base/src/coord_group.cc        |  9 +++++----
 modules/mol/base/src/coord_group.hh        |  2 +-
 modules/mol/base/src/coord_source.cc       |  4 ++--
 modules/mol/base/src/coord_source.hh       |  2 +-
 modules/mol/base/src/entity_handle.hh      |  1 -
 modules/mol/base/src/impl/entity_impl.hh   |  1 -
 modules/mol/base/src/transform.hh          |  6 ++++++
 modules/mol/base/tests/test_coord_group.cc |  2 +-
 modules/mol/base/tests/test_entity.cc      |  4 ++--
 23 files changed, 53 insertions(+), 48 deletions(-)
 create mode 100644 modules/mol/base/src/transform.hh

diff --git a/modules/gfx/pymod/export_scene.cc b/modules/gfx/pymod/export_scene.cc
index 18728c2cf..39d1fde6b 100644
--- a/modules/gfx/pymod/export_scene.cc
+++ b/modules/gfx/pymod/export_scene.cc
@@ -60,7 +60,7 @@ geom::AlignedCuboid scene_get_bb2(Scene* scene, bool use_tf)
   return scene->GetBoundingBox(use_tf);
 }
 
-geom::AlignedCuboid scene_get_bb3(Scene* scene, const mol::Transform& tf)
+geom::AlignedCuboid scene_get_bb3(Scene* scene, const geom::Transform& tf)
 {
   return scene->GetBoundingBox(tf);
 }
diff --git a/modules/gfx/src/entity.cc b/modules/gfx/src/entity.cc
index 3aec22fe5..df1ad6bfc 100644
--- a/modules/gfx/src/entity.cc
+++ b/modules/gfx/src/entity.cc
@@ -231,7 +231,7 @@ void Entity::Rebuild()
 
   // update center in transformation
   geom::Vec3 center=this->GetCenter();
-  Transform tf=this->GetTF();
+  geom::Transform tf=this->GetTF();
   tf.SetCenter(center);
   tf.SetTrans(center+GetTF().GetTrans()-GetTF().GetCenter());
   this->SetTF(tf);  
diff --git a/modules/gfx/src/gfx_object.cc b/modules/gfx/src/gfx_object.cc
index d527ceffa..f7e3b06a5 100644
--- a/modules/gfx/src/gfx_object.cc
+++ b/modules/gfx/src/gfx_object.cc
@@ -400,7 +400,7 @@ geom::AlignedCuboid GfxObj::GetBoundingBox(bool use_tf) const
 }
 
 void GfxObj::ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc, 
-                           const mol::Transform& tf) const
+                           const geom::Transform& tf) const
 {
   try {
     geom::AlignedCuboid coord_limits=tf.Apply(this->GetBoundingBox(true));
@@ -476,13 +476,13 @@ void GfxObj::OnInput(const InputEvent& e)
   }
 }
 
-const mol::Transform& GfxObj::GetTF() const
+const geom::Transform& GfxObj::GetTF() const
 {
   return transform_;
 }
 
 
-void GfxObj::SetTF(const mol::Transform& tf)
+void GfxObj::SetTF(const geom::Transform& tf)
 {
   transform_=tf;
 }
diff --git a/modules/gfx/src/gfx_object.hh b/modules/gfx/src/gfx_object.hh
index 8809e1046..fc906c35c 100644
--- a/modules/gfx/src/gfx_object.hh
+++ b/modules/gfx/src/gfx_object.hh
@@ -33,7 +33,7 @@
 #include <ost/config.hh>
 #include <ost/gfx/module_config.hh>
 
-#include <ost/mol/transform.hh>
+#include <ost/geom/transform.hh>
 
 #include "gfx_object_fw.hh"
 #include "gfx_object_base.hh"
@@ -123,7 +123,7 @@ public:
     will be adjusted based on the Cuboid returned by GetBoundingBox(true)
   */
   virtual void ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc, 
-                             const mol::Transform& tf) const;
+                             const geom::Transform& tf) const;
 
   // implemented in derived classes for the actual GL rendering
   /*
@@ -168,9 +168,9 @@ public:
   void Clear();
   
   /// \brief get transform
-  const mol::Transform& GetTF() const;
+  const geom::Transform& GetTF() const;
   /// \brief set transform
-  void SetTF(const mol::Transform& tf);
+  void SetTF(const geom::Transform& tf);
   
   // add a label at the given position
   void AddLabel(const String& s, const geom::Vec3& pos, const Color& col, float psize);
@@ -225,7 +225,7 @@ public:
   RenderMode::Type render_mode_;
   unsigned int debug_flags_;
  
-  mol::Transform transform_;
+  geom::Transform transform_;
   bool rebuild_;
   bool refresh_;
   float line_width_;
diff --git a/modules/gfx/src/impl/entity_detail.cc b/modules/gfx/src/impl/entity_detail.cc
index 02e40b213..407654cfc 100644
--- a/modules/gfx/src/impl/entity_detail.cc
+++ b/modules/gfx/src/impl/entity_detail.cc
@@ -57,7 +57,7 @@ void DoRenderBlur(BondEntryList& bl, float bf1, float bf2)
 {
   // add blur for this particular orientation!
   // don't use vertex array, but on-the-fly oriented and z-sorted quads
-  mol::Transform tf = Scene::Instance().GetTransform();
+  geom::Transform tf = Scene::Instance().GetTransform();
 
   std::vector<BlurQuadEntry> bql;
   for (BondEntryList::iterator it=bl.begin(); it!=bl.end();++it) {
diff --git a/modules/gfx/src/impl/scene_fx.cc b/modules/gfx/src/impl/scene_fx.cc
index 8979d9644..de0000484 100644
--- a/modules/gfx/src/impl/scene_fx.cc
+++ b/modules/gfx/src/impl/scene_fx.cc
@@ -406,7 +406,7 @@ void SceneFX::prep_shadow_map()
 #endif
 
   // modelview transform for the lightsource pov
-  mol::Transform ltrans(Scene::Instance().GetTransform());
+  geom::Transform ltrans(Scene::Instance().GetTransform());
   ltrans.SetRot(Scene::Instance().GetLightRot()*ltrans.GetRot());
 
   // calculate encompassing box for ortho projection
diff --git a/modules/gfx/src/map_iso.cc b/modules/gfx/src/map_iso.cc
index 5dbd4d390..7a2c5160c 100644
--- a/modules/gfx/src/map_iso.cc
+++ b/modules/gfx/src/map_iso.cc
@@ -86,7 +86,7 @@ MapIso::MapIso(const String& name, const img::MapHandle& mh,
   SetMatDiff(Color(1,1,1));
   SetMatSpec(Color(0.1,0.1,0.1));
   SetMatShin(32);
-  mol::Transform tf=this->GetTF();
+  geom::Transform tf=this->GetTF();
   tf.SetCenter(this->GetCenter());
   tf.SetTrans(this->GetCenter());  
   this->SetTF(tf);
diff --git a/modules/gfx/src/povray.hh b/modules/gfx/src/povray.hh
index b647420a1..c8ef79461 100644
--- a/modules/gfx/src/povray.hh
+++ b/modules/gfx/src/povray.hh
@@ -26,7 +26,7 @@
 #include <string>
 #include <fstream>
 
-#include <ost/mol/transform.hh>
+#include <ost/geom/transform.hh>
 
 #include "color.hh"
 
@@ -63,7 +63,7 @@ public:
 
 public:
   bool use_tf;
-  mol::Transform tf;
+  geom::Transform tf;
 
 private:
   std::string pov_file_;
diff --git a/modules/gfx/src/prim_list.cc b/modules/gfx/src/prim_list.cc
index b531ba279..e07820e6b 100644
--- a/modules/gfx/src/prim_list.cc
+++ b/modules/gfx/src/prim_list.cc
@@ -65,12 +65,12 @@ geom::AlignedCuboid PrimList::GetBoundingBox() const
   geom::Vec3 maxc(-std::numeric_limits<float>::max(),
                   -std::numeric_limits<float>::max(),
                   -std::numeric_limits<float>::max());
-  ProcessLimits(minc,maxc,mol::Transform());
+  ProcessLimits(minc,maxc,geom::Transform());
   return geom::AlignedCuboid(minc,maxc);
 }
 
 void PrimList::ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc, 
-                             const mol::Transform& tf) const
+                             const geom::Transform& tf) const
 {
   for(SpherePrimList::const_iterator it=points_.begin();it!=points_.end();++it) {
     geom::Vec3 tpos = tf.Apply(it->position);
diff --git a/modules/gfx/src/prim_list.hh b/modules/gfx/src/prim_list.hh
index 395e53e2a..afc999a7f 100644
--- a/modules/gfx/src/prim_list.hh
+++ b/modules/gfx/src/prim_list.hh
@@ -64,7 +64,7 @@ class DLLEXPORT_OST_GFX PrimList: public GfxObj
   virtual geom::AlignedCuboid GetBoundingBox() const;
 
   virtual void ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc, 
-                             const mol::Transform& tf) const;
+                             const geom::Transform& tf) const;
   /// \brief get center      
   virtual geom::Vec3 GetCenter() const;
 
diff --git a/modules/gfx/src/scene.cc b/modules/gfx/src/scene.cc
index fde6ad665..2650eea5b 100644
--- a/modules/gfx/src/scene.cc
+++ b/modules/gfx/src/scene.cc
@@ -699,13 +699,13 @@ float Scene::GetDefaultTextSize()
 
 namespace {
 
-void draw_lightdir(const Vec3& ldir, const mol::Transform& tf)
+void draw_lightdir(const Vec3& ldir, const geom::Transform& tf)
 {
   glPushAttrib(GL_ENABLE_BIT);
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
   glLoadIdentity();
-  mol::Transform tmpt(tf);
+  geom::Transform tmpt(tf);
   tmpt.SetRot(Mat3::Identity());
   glMultMatrix(tmpt.GetTransposedMatrix().Data());
   glDisable(GL_NORMALIZE);
@@ -1216,7 +1216,7 @@ namespace {
 class BBCalc: public GfxNodeVisitor
 {
 public:
-  BBCalc(const geom::Vec3& mmin, const geom::Vec3& mmax, const mol::Transform& tf): 
+  BBCalc(const geom::Vec3& mmin, const geom::Vec3& mmax, const geom::Transform& tf): 
     minc(mmin),maxc(mmax),tf(tf),valid(false) {}
 
   bool VisitNode(GfxNode* node, const Stack& st) {
@@ -1235,7 +1235,7 @@ public:
   }
 
   Vec3 minc,maxc;
-  mol::Transform tf;
+  geom::Transform tf;
   bool valid;
 };
 
@@ -1243,10 +1243,10 @@ public:
 
 geom::AlignedCuboid Scene::GetBoundingBox(bool use_tf) const
 {
-  return GetBoundingBox(use_tf ? transform_ : mol::Transform());
+  return GetBoundingBox(use_tf ? transform_ : geom::Transform());
 }
 
-geom::AlignedCuboid Scene::GetBoundingBox(const mol::Transform& tf) const
+geom::AlignedCuboid Scene::GetBoundingBox(const geom::Transform& tf) const
 {
   BBCalc bbcalc(Vec3(std::numeric_limits<float>::max(),
                      std::numeric_limits<float>::max(),
@@ -1264,12 +1264,12 @@ geom::AlignedCuboid Scene::GetBoundingBox(const mol::Transform& tf) const
   return geom::AlignedCuboid(geom::Vec3(),geom::Vec3());
 }
 
-mol::Transform Scene::GetTransform() const
+geom::Transform Scene::GetTransform() const
 {
   return transform_;
 }
 
-void Scene::SetTransform(const mol::Transform& t)
+void Scene::SetTransform(const geom::Transform& t)
 {
   transform_=t;
   this->RequestRedraw();
@@ -1721,7 +1721,7 @@ public:
     }
   }
   Vec3 minc,maxc;
-  mol::Transform transform;
+  geom::Transform transform;
   bool valid;
 };
 
diff --git a/modules/gfx/src/scene.hh b/modules/gfx/src/scene.hh
index 62630ced6..4edc66637 100644
--- a/modules/gfx/src/scene.hh
+++ b/modules/gfx/src/scene.hh
@@ -30,7 +30,7 @@
 #include <boost/shared_array.hpp>
 
 #include <ost/gfx/module_config.hh>
-#include <ost/mol/transform.hh>
+#include <ost/geom/transform.hh>
 #include <ost/mol/atom_handle.hh>
 
 #include "gl_include.hh"
@@ -84,7 +84,7 @@ class DLLEXPORT_OST_GFX Scene {
   // refactoring of the scene it into a management
   // and a view part
   struct SceneViewStackEntry {
-    mol::Transform transform;
+    geom::Transform transform;
     float fov;
     float znear,zfar;
   };
@@ -363,13 +363,13 @@ class DLLEXPORT_OST_GFX Scene {
   geom::AlignedCuboid GetBoundingBox(bool use_tf=true) const;
 
   /// \brief return bounding box of with a given transform
-  geom::AlignedCuboid GetBoundingBox(const mol::Transform& tf) const;
+  geom::AlignedCuboid GetBoundingBox(const geom::Transform& tf) const;
 
   /// \brief get full underlying transformation
-  mol::Transform GetTransform() const;
+  geom::Transform GetTransform() const;
 
   /// \brief set transform
-  void SetTransform(const mol::Transform& t);
+  void SetTransform(const geom::Transform& t);
 
   /// \brief returns a compact, internal representation of the scene orientation
   geom::Mat4 GetRTC() const;
@@ -513,7 +513,7 @@ private:
   mutable GfxNodeP     root_node_; // mutable is slightly hackish
   SceneObserverList    observers_;
 
-  mol::Transform transform_; // overall modelview transformation
+  geom::Transform transform_; // overall modelview transformation
 
   bool gl_init_;
 
diff --git a/modules/gui/src/dock_widget.cc b/modules/gui/src/dock_widget.cc
index 9ba553ca5..53b7d7ea7 100644
--- a/modules/gui/src/dock_widget.cc
+++ b/modules/gui/src/dock_widget.cc
@@ -35,4 +35,4 @@ void DockWidget::closeEvent(QCloseEvent* e)
   emit OnClose(this);
 }
 
-}} // ns
\ No newline at end of file
+}} // ns
diff --git a/modules/gui/src/tools/map_tool.cc b/modules/gui/src/tools/map_tool.cc
index e16895621..96e622a3d 100644
--- a/modules/gui/src/tools/map_tool.cc
+++ b/modules/gui/src/tools/map_tool.cc
@@ -56,7 +56,7 @@ void MapTool::MouseMove(const MouseEvent& event)
             gfx::Scene::Instance().StatusMessage(s.str());
           }
         } else if(gfx::MapSlab* ms = dynamic_cast<gfx::MapSlab*>(np.get())) {
-          mol::Transform tf = gfx::Scene::Instance().GetTransform();
+          geom::Transform tf = gfx::Scene::Instance().GetTransform();
           geom::Plane plane = ms->GetPlane();
           if(event.GetButtons()==MouseEvent::LeftButton) {
             if (event.IsShiftPressed()) {
diff --git a/modules/mol/base/src/coord_group.cc b/modules/mol/base/src/coord_group.cc
index 4fe6677ee..5af231a55 100644
--- a/modules/mol/base/src/coord_group.cc
+++ b/modules/mol/base/src/coord_group.cc
@@ -19,9 +19,10 @@
 #include <ost/invalid_handle.hh>
 #include <ost/integrity_error.hh>
 #include <ost/log.hh>
-#include <ost/mol/in_mem_coord_source.hh>
-#include <ost/mol/view_op.hh>
-#include <ost/mol/mol.hh>
+#include <ost/geom/transform.hh>
+#include "in_mem_coord_source.hh"
+#include "view_op.hh"
+#include "mol.hh"
 #include "coord_group.hh"
 
 
@@ -255,7 +256,7 @@ CoordGroupHandle CoordGroupHandle::Filter(const EntityView& selected, int first,
   return filtered_cg;
 }
 
-void CoordGroupHandle::ApplyTransform(const mol::Transform& tf)
+void CoordGroupHandle::ApplyTransform(const geom::Transform& tf)
 {
   this->CheckValidity();
   if (source_->IsMutable()) {
diff --git a/modules/mol/base/src/coord_group.hh b/modules/mol/base/src/coord_group.hh
index 573ab8ffb..623f745ef 100644
--- a/modules/mol/base/src/coord_group.hh
+++ b/modules/mol/base/src/coord_group.hh
@@ -112,7 +112,7 @@ public:
   CoordGroupHandle Filter(const EntityView& selected,int first=0,int last=-1) const;
 
   /// \brief apply in-place transform to each coordinate in each frame
-  void ApplyTransform(const Transform& tf);
+  void ApplyTransform(const geom::Transform& tf);
 
 
 private:
diff --git a/modules/mol/base/src/coord_source.cc b/modules/mol/base/src/coord_source.cc
index 06b7864b7..fa58ce041 100644
--- a/modules/mol/base/src/coord_source.cc
+++ b/modules/mol/base/src/coord_source.cc
@@ -21,10 +21,10 @@
   Author: Marco Biasini
  */
 #include <ost/log.hh>
+#include <ost/geom/transform.hh>
 #include "atom_handle.hh"
 #include "xcs_editor.hh"
 #include "in_mem_coord_source.hh"
-#include "transform.hh"
 #include "coord_source.hh"
 
 namespace ost { namespace mol {
@@ -165,7 +165,7 @@ geom::Vec3 CoordSource::GetAtomPos(uint frame, AtomHandle atom) const
   return geom::Vec3();
 }
 
-void CoordSource::ApplyTransform(const Transform& tf)
+void CoordSource::ApplyTransform(const geom::Transform& tf)
 {
   if(!mutable_) return;
   size_t frame_count=GetFrameCount();
diff --git a/modules/mol/base/src/coord_source.hh b/modules/mol/base/src/coord_source.hh
index 51cfe0717..3f83e5a3e 100644
--- a/modules/mol/base/src/coord_source.hh
+++ b/modules/mol/base/src/coord_source.hh
@@ -85,7 +85,7 @@ public:
   virtual void AddFrame(const std::vector<geom::Vec3>& coords,const geom::Vec3& cell_size,const geom::Vec3& cell_angles) = 0;
   virtual void InsertFrame(int pos, const std::vector<geom::Vec3>& coords) = 0;
 
-  void ApplyTransform(const Transform& tf);
+  void ApplyTransform(const geom::Transform& tf);
 
 protected:
   void SetMutable(bool flag);
diff --git a/modules/mol/base/src/entity_handle.hh b/modules/mol/base/src/entity_handle.hh
index 67b2a847e..2783b404b 100644
--- a/modules/mol/base/src/entity_handle.hh
+++ b/modules/mol/base/src/entity_handle.hh
@@ -20,7 +20,6 @@
 #define OST_ENTITY_HANDLE_HH
 
 #include <ost/mol/module_config.hh>
-#include <ost/mol/transform.hh>
 
 #include "impl/entity_impl_fw.hh"
 #include "entity_visitor_fw.hh"
diff --git a/modules/mol/base/src/impl/entity_impl.hh b/modules/mol/base/src/impl/entity_impl.hh
index d1d1ca050..ccbf85b44 100644
--- a/modules/mol/base/src/impl/entity_impl.hh
+++ b/modules/mol/base/src/impl/entity_impl.hh
@@ -31,7 +31,6 @@
 
 #include <ost/mol/entity_view.hh>
 
-#include <ost/mol/transform.hh>
 #include <ost/mol/residue_prop.hh>
 #include <ost/mol/impl/atom_impl_fw.hh>
 #include <ost/mol/impl/residue_impl_fw.hh>
diff --git a/modules/mol/base/src/transform.hh b/modules/mol/base/src/transform.hh
new file mode 100644
index 000000000..a3cad4c8b
--- /dev/null
+++ b/modules/mol/base/src/transform.hh
@@ -0,0 +1,6 @@
+#include <ost/geom/transform.hh>
+
+namespace ost { namespace mol {
+#warning mol::Transform is deprecated, use geom::Transform instead
+    typedef geom::Transform Transform;
+}}
diff --git a/modules/mol/base/tests/test_coord_group.cc b/modules/mol/base/tests/test_coord_group.cc
index 3c0cdc18f..a26f2e2bd 100644
--- a/modules/mol/base/tests/test_coord_group.cc
+++ b/modules/mol/base/tests/test_coord_group.cc
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(coord_group)
   BOOST_CHECK(ac.GetPos()==geom::Vec3(-17,-18,-19));
   BOOST_CHECK(ad.GetPos()==geom::Vec3(9,10,11));
 
-  Transform tf;
+  geom::Transform tf;
   tf.ApplyXAxisRotation(17.0);
   tf.ApplyYAxisRotation(-135.0);
   tf.ApplyZAxisRotation(234.0);
diff --git a/modules/mol/base/tests/test_entity.cc b/modules/mol/base/tests/test_entity.cc
index 46a4de626..d8ecd8f3b 100644
--- a/modules/mol/base/tests/test_entity.cc
+++ b/modules/mol/base/tests/test_entity.cc
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE(transformation)
 
   BOOST_CHECK(eh.IsTransformationIdentity()==true);
 
-  Transform trans;
+  geom::Transform trans;
   trans.ApplyZAxisRotation(90.0);
   geom::Mat4 mat = trans.GetMatrix();
 
@@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE(transformation)
   CHECK_TRANSFORMED_ATOM_POSITION(atom3,tr_atom3);
   CHECK_ORIGINAL_ATOM_POSITION(atom3,orig_atom3);
 
-  Transform trans2;
+  geom::Transform trans2;
   trans2.ApplyXAxisTranslation(3.5);
   geom::Mat4 mat2 = trans2.GetMatrix();
 
-- 
GitLab