Revision: 52933
          http://brlcad.svn.sourceforge.net/brlcad/?rev=52933&view=rev
Author:   brlcad
Date:     2012-10-10 06:59:03 +0000 (Wed, 10 Oct 2012)
Log Message:
-----------
propagate constness, don't need to edit the face pointers being stashed in the 
surface tree.

Modified Paths:
--------------
    brlcad/trunk/include/nurbs.h
    brlcad/trunk/src/libnurbs/opennurbs_ext.cpp

Modified: brlcad/trunk/include/nurbs.h
===================================================================
--- brlcad/trunk/include/nurbs.h        2012-10-10 06:44:35 UTC (rev 52932)
+++ brlcad/trunk/include/nurbs.h        2012-10-10 06:59:03 UTC (rev 52933)
@@ -771,7 +771,7 @@
 // CurveTree declaration
 class NURBS_EXPORT CurveTree {
 public:
-    CurveTree(ON_BrepFace* face);
+    CurveTree(const ON_BrepFace* face);
     ~CurveTree();
 
     BRNode* getRootNode() const;
@@ -803,7 +803,7 @@
     BRNode* curveBBox(const ON_Curve* curve, int adj_face_index, ON_Interval& 
t, bool leaf, bool innerTrim, const ON_BoundingBox& bb);
     BRNode* initialLoopBBox();
 
-    ON_BrepFace* m_face;
+    const ON_BrepFace* m_face;
     int m_adj_face_index;
     BRNode* m_root;
     std::list<BRNode*> m_sortedX;
@@ -1526,7 +1526,7 @@
     bool m_removeTrimmed;
 
 public:
-    SurfaceTree(ON_BrepFace* face, bool removeTrimmed=true, int depthLimit = 
BREP_MAX_FT_DEPTH);
+    SurfaceTree(const ON_BrepFace* face, bool removeTrimmed=true, int 
depthLimit = BREP_MAX_FT_DEPTH);
     ~SurfaceTree();
 
     CurveTree* ctree;
@@ -1562,7 +1562,7 @@
     BBNode* subdivideSurface(const ON_Surface *localsurf, const ON_Interval& 
u, const ON_Interval& v, ON_Plane frames[], ON_3dPoint corners[], ON_3dVector 
normals[], int depth, int depthLimit);
     BBNode* surfaceBBox(const ON_Surface *localsurf, bool leaf, ON_3dPoint 
corners[], ON_3dVector normals[], const ON_Interval& u, const ON_Interval& v);
 
-    ON_BrepFace* m_face;
+    const ON_BrepFace* m_face;
     BBNode* m_root;
 };
 

Modified: brlcad/trunk/src/libnurbs/opennurbs_ext.cpp
===================================================================
--- brlcad/trunk/src/libnurbs/opennurbs_ext.cpp 2012-10-10 06:44:35 UTC (rev 
52932)
+++ brlcad/trunk/src/libnurbs/opennurbs_ext.cpp 2012-10-10 06:59:03 UTC (rev 
52933)
@@ -157,7 +157,7 @@
 
 
//--------------------------------------------------------------------------------
 // CurveTree
-CurveTree::CurveTree(ON_BrepFace* face) :
+CurveTree::CurveTree(const ON_BrepFace* face) :
     m_face(face), m_adj_face_index(-99)
 {
     m_root = initialLoopBBox();
@@ -681,7 +681,7 @@
 
 
//--------------------------------------------------------------------------------
 // SurfaceTree
-SurfaceTree::SurfaceTree(ON_BrepFace* face, bool removeTrimmed, int depthLimit)
+SurfaceTree::SurfaceTree(const ON_BrepFace* face, bool removeTrimmed, int 
depthLimit)
     : m_removeTrimmed(removeTrimmed),
       m_face(face)
 {
@@ -693,6 +693,11 @@
 
     // build the surface bounding volume hierarchy
     const ON_Surface* surf = face->SurfaceOf();
+    if (!surf) {
+       TRACE("ERROR: NULL surface encountered in SurfaceTree()");
+       return;
+    }
+
     TRACE("Creating surface tree for: " << face->m_face_index);
     ON_Interval u = surf->Domain(0);
     ON_Interval v = surf->Domain(1);

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


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to