Revision: 65514
          http://sourceforge.net/p/brlcad/code/65514
Author:   starseeker
Date:     2015-07-01 19:30:04 +0000 (Wed, 01 Jul 2015)
Log Message:
-----------
Commit fixes identified by Doug to the SPR clean-up process.

Modified Paths:
--------------
    brlcad/trunk/src/other/PoissonRecon/Src/SPR.cpp

Modified: brlcad/trunk/src/other/PoissonRecon/Src/SPR.cpp
===================================================================
--- brlcad/trunk/src/other/PoissonRecon/Src/SPR.cpp     2015-07-01 19:28:43 UTC 
(rev 65513)
+++ brlcad/trunk/src/other/PoissonRecon/Src/SPR.cpp     2015-07-01 19:30:04 UTC 
(rev 65514)
@@ -55,6 +55,8 @@
                const struct cvertex **verts, int cnt, struct spr_options *opts)
 {
     if (!num_pnts || !num_faces || !points || !faces) return -1;
+    // Probably unnecessary but here to be consistent with original code
+    Reset< double >();
     XForm4x4< double > xForm;
     xForm = XForm4x4< double >::Identity();
     Octree< double > tree;
@@ -69,6 +71,7 @@
     int pointCount = tree.SetTree< float >(pointStream , opts->mindepth, 
opts->depth, opts->fulldepth, opts->kerneldepth,
            opts->samples_per_node, opts->scale, 0, 0, opts->pointweight, 
opts->adaptiveexponent, *pointInfo,
            *normalInfo , *kernelDensityWeights , *centerWeights , 
opts->boundarytype, xForm , 0);
+    kernelDensityWeights->clear();
     delete kernelDensityWeights;
     kernelDensityWeights = NULL;
     Pointer( double ) constraints = tree.SetLaplacianConstraints( *normalInfo 
);
@@ -78,6 +81,10 @@
     FreePointer(constraints);
     CoredFileMeshData< PlyVertex <float> > mesh;
     double isoValue = tree.GetIsoValue( solution , *centerWeights );
+    centerWeights->clear();
+    delete centerWeights;
+    centerWeights = NULL;
+    delete pointStream;
     tree.GetMCIsoSurface( NullPointer< double >() , solution , isoValue , mesh 
, true , 1 , 0 );
     /* mesh to triangles */
     (*num_pnts) = int(mesh.outOfCorePointCount()+mesh.inCorePoints.size());
@@ -110,6 +117,8 @@
         (*faces)[i*3+1] = (polygon[1].inCore) ? polygon[1].idx : 
polygon[1].idx + int(mesh.inCorePoints.size());
         (*faces)[i*3+2] = (polygon[2].inCore) ? polygon[2].idx : 
polygon[2].idx + int(mesh.inCorePoints.size());
     }
+    // Cleanup
+    Reset< double>();
     return 0;
 }
 

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


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to