Browse Source

Remove completely redundant code

tamasmeszaros 5 years ago
parent
commit
3ab246df6b
3 changed files with 0 additions and 43 deletions
  1. 0 13
      sandboxes/opencsg/Engine.cpp
  2. 0 17
      sandboxes/opencsg/Engine.hpp
  3. 0 13
      sandboxes/opencsg/ShaderCSGDisplay.cpp

+ 0 - 13
sandboxes/opencsg/Engine.cpp

@@ -420,19 +420,6 @@ void CSGDisplay::on_scene_updated(const Scene &scene)
             mshinst.require_shared_vertices();
             m_scene_cache.add_mesh(mshinst, OpenCSG::Intersection,
                                    m_csgsettings.get_convexity());
-
-            auto tr = Transform3f::Identity();
-            tr.translate(-center);
-            
-            transform_pts(holedata.begin(), holedata.end(), tr,
-                          [](const sla::DrainHole &dh) {
-                              return dh.pos;
-                          });
-            
-            transform_pts(holedata.begin(), holedata.end(), tr,
-                          [](const sla::DrainHole &dh) {
-                              return dh.normal;
-                          });
         }
         
         for (const sla::DrainHole &holept : holedata) {

+ 0 - 17
sandboxes/opencsg/Engine.hpp

@@ -171,23 +171,6 @@ public:
 // Try to enable or disable multisampling.
 bool enable_multisampling(bool e = true);
 
-template<class It,
-         class Trafo,
-         class GetPt,
-         class V = typename std::iterator_traits<It>::value_type>
-inline std::vector<V> transform_pts(
-    It from, It to, Trafo &&tr, GetPt &&point)
-{
-    vector<V> ret;
-    ret.reserve(to - from);
-    for(auto it = from; it != to; ++it) {
-        V v = *it;
-        v.pos = tr * point(*it);
-        ret.emplace_back(std::move(v));
-    }
-    return ret;
-}
-
 class Volume {
     IndexedVertexArray m_geom;
     Geometry::Transformation m_trafo;

+ 0 - 13
sandboxes/opencsg/ShaderCSGDisplay.cpp

@@ -53,19 +53,6 @@ void ShaderCSGDisplay::on_scene_updated(const Scene &scene)
             
             mshinst.require_shared_vertices();
             add_mesh(mshinst);
-            
-            auto tr = Transform3f::Identity();
-            tr.translate(-center);
-            
-            transform_pts(holedata.begin(), holedata.end(), tr,
-                          [](const sla::DrainHole &dh) {
-                              return dh.pos;
-                          });
-            
-            transform_pts(holedata.begin(), holedata.end(), tr,
-                          [](const sla::DrainHole &dh) {
-                              return dh.normal;
-                          });
         }
         
         for (const sla::DrainHole &holept : holedata) {