Revision: 71955
          http://sourceforge.net/p/brlcad/code/71955
Author:   starseeker
Date:     2018-10-10 23:50:25 +0000 (Wed, 10 Oct 2018)
Log Message:
-----------
remove WafeformOBJ and Diagnostics code

Modified Paths:
--------------
    brlcad/trunk/src/libbg/QuickHull.cxx
    brlcad/trunk/src/libbg/QuickHull.hpp

Modified: brlcad/trunk/src/libbg/QuickHull.cxx
===================================================================
--- brlcad/trunk/src/libbg/QuickHull.cxx        2018-10-10 23:29:46 UTC (rev 
71954)
+++ brlcad/trunk/src/libbg/QuickHull.cxx        2018-10-10 23:50:25 UTC (rev 
71955)
@@ -75,9 +75,6 @@
            m_epsilon = epsilon*m_scale;
            m_epsilonSquared = m_epsilon*m_epsilon;
 
-           // Reset diagnostics
-           m_diagnostics = DiagnosticsData();
-
            m_planar = false; // The planar case happens when all the points 
appear to lie on a two dimensional subspace of R^3.
            createConvexHalfEdgeMesh();
            if (m_planar) {
@@ -195,7 +192,6 @@
 
                // Order horizon edges so that they form a loop. This may fail 
due to numerical instability in which case we give up trying to solve horizon 
edge for this point and accept a minor degeneration in the convex hull.
                if (!reorderHorizonEdges(horizonEdges)) {
-                   m_diagnostics.m_failedHorizonEdges++;
                    std::cerr << "Failed to solve horizon edge." << std::endl;
                    auto it = 
std::find(tf.m_pointsOnPositiveSide->begin(),tf.m_pointsOnPositiveSide->end(),activePointIndex);
                    tf.m_pointsOnPositiveSide->erase(it);

Modified: brlcad/trunk/src/libbg/QuickHull.hpp
===================================================================
--- brlcad/trunk/src/libbg/QuickHull.hpp        2018-10-10 23:29:46 UTC (rev 
71954)
+++ brlcad/trunk/src/libbg/QuickHull.hpp        2018-10-10 23:50:25 UTC (rev 
71955)
@@ -790,33 +790,9 @@
                return m_vertices;
            }
 
-           // Export the mesh to a Waveform OBJ file
-           void writeWaveformOBJ(const std::string& filename, const 
std::string& objectName = "quickhull")
-           {
-               std::ofstream objFile;
-               objFile.open (filename);
-               objFile << "o " << objectName << "\n";
-               for (const auto& v : getVertexBuffer()) {
-                   objFile << "v " << v.x << " " << v.y << " " << v.z << "\n";
-               }
-               const auto& indBuf = getIndexBuffer();
-               size_t triangleCount = indBuf.size()/3;
-               for (size_t i=0;i<triangleCount;i++) {
-                   objFile << "f " << indBuf[i*3]+1 << " " << indBuf[i*3+1]+1 
<< " " << indBuf[i*3+2]+1 << "\n";
-               }
-               objFile.close();
-           }
-
        };
 
 
-
-    struct DiagnosticsData {
-       size_t m_failedHorizonEdges; // How many times QuickHull failed to 
solve the horizon edge. Failures lead to degenerated convex hulls.
-
-       DiagnosticsData() : m_failedHorizonEdges(0) { }
-    };
-
     template<typename FloatType>
        class QuickHull {
            using vec3 = Vector3<FloatType>;
@@ -829,7 +805,6 @@
            VertexDataSource<FloatType> m_vertexData;
            MeshBuilder<FloatType> m_mesh;
            std::array<IndexType,6> m_extremeValues;
-           DiagnosticsData m_diagnostics;
 
            // Temporary variables used during iteration process
            std::vector<IndexType> m_newFaceIndices;
@@ -955,11 +930,6 @@
            // Returns:
            //   Convex hull of the point cloud as a mesh object with half edge 
structure.
            HalfEdgeMesh<FloatType, IndexType> getConvexHullAsMesh(const 
FloatType* vertexData, size_t vertexCount, bool CCW, FloatType eps = Epsilon);
-
-           // Get diagnostics about last generated convex hull
-           const DiagnosticsData& getDiagnostics() {
-               return m_diagnostics;
-           }
        };
 
     /*

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to