Revision: 68190
          http://sourceforge.net/p/brlcad/code/68190
Author:   ejno
Date:     2016-06-28 17:13:48 +0000 (Tue, 28 Jun 2016)
Log Message:
-----------
remove unused and unset member (vdot) and make some members 'const'

Modified Paths:
--------------
    brlcad/trunk/include/brep/bbnode.h
    brlcad/trunk/include/brep/brnode.h
    brlcad/trunk/include/brep/surfacetree.h
    brlcad/trunk/src/libbrep/opennurbs_ext.cpp

Modified: brlcad/trunk/include/brep/bbnode.h
===================================================================
--- brlcad/trunk/include/brep/bbnode.h  2016-06-28 15:39:37 UTC (rev 68189)
+++ brlcad/trunk/include/brep/bbnode.h  2016-06-28 17:13:48 UTC (rev 68190)
@@ -80,15 +80,6 @@
                        bool trimmed = false);
                ~BBNode();
 
-               /** List of all children of a given node */
-               std::vector<BBNode *> * const m_children;
-
-               /** Curve Tree associated with the parent Surface Tree */
-               CurveTree * const m_ctree;
-
-               /** Bounding Box */
-               ON_BoundingBox m_node;
-
                /** Test if this node is a leaf node in the hierarchy */
                bool isLeaf();
 
@@ -122,23 +113,6 @@
                void GetBBox(float *min, float *max);
                void GetBBox(double *min, double *max);
 
-               /** Surface Information */
-               const ON_BrepFace *m_face;
-               ON_Interval m_u;
-               ON_Interval m_v;
-
-               /** Trimming Flags */
-               bool m_checkTrim;
-               bool m_trimmed;
-
-               /** Point used for closeness testing - usually based on 
evaluation
-                * of the curve/surface at the center of the parametric domain
-                */
-               ON_3dPoint m_estimate;
-
-               /* Normal at the m_estimate point */
-               ON_3dVector m_normal;
-
                /** Test whether a ray intersects the 3D bounding volume of the
                 * node - if so, and node is not a leaf node, query children.  
If
                 * leaf node, and intersects, add to list.
@@ -161,18 +135,44 @@
                void BuildBBox();
                bool prepTrims();
 
+               /** List of all children of a given node */
+               std::vector<BBNode *> * const m_children;
+
+               /** Bounding Box */
+               ON_BoundingBox m_node;
+
+               /** Surface Information */
+               const ON_BrepFace *m_face;
+               ON_Interval m_u;
+               ON_Interval m_v;
+
+               /** Trimming Flags */
+               bool m_checkTrim;
+               bool m_trimmed;
+
+               /** Point used for closeness testing - usually based on 
evaluation
+                * of the curve/surface at the center of the parametric domain
+                */
+               ON_3dPoint m_estimate;
+
+               /* Normal at the m_estimate point */
+               ON_3dVector m_normal;
+
            private:
                BBNode(const BBNode &source);
                BBNode &operator=(const BBNode &source);
 
                BBNode *closer(const ON_3dPoint &pt, BBNode *left, BBNode 
*right);
+
+               /** Curve Tree associated with the parent Surface Tree */
+               CurveTree * const m_ctree;
+
                std::list<BRNode *> * const m_trims_above;
        };
 
        inline
            BBNode::BBNode() :
                m_children(new std::vector<BBNode *>),
-               m_ctree(NULL),
                m_node(),
                m_face(NULL),
                m_u(),
@@ -181,13 +181,13 @@
                m_trimmed(false),
                m_estimate(),
                m_normal(),
+               m_ctree(NULL),
                m_trims_above(new std::list<BRNode *>)
        {}
 
        inline
            BBNode::BBNode(const ON_BoundingBox &node) :
                m_children(new std::vector<BBNode *>),
-               m_ctree(NULL),
                m_node(node),
                m_face(NULL),
                m_u(),
@@ -196,6 +196,7 @@
                m_trimmed(false),
                m_estimate(),
                m_normal(),
+               m_ctree(NULL),
                m_trims_above(new std::list<BRNode *>)
        {
            for (int i = 0; i < 3; i++) {
@@ -210,7 +211,6 @@
        inline
            BBNode::BBNode(CurveTree *ct) :
                m_children(new std::vector<BBNode *>),
-               m_ctree(ct),
                m_node(),
                m_face(NULL),
                m_u(),
@@ -219,13 +219,13 @@
                m_trimmed(false),
                m_estimate(),
                m_normal(),
+               m_ctree(ct),
                m_trims_above(new std::list<BRNode *>)
        {}
 
        inline
            BBNode::BBNode(CurveTree *ct, const ON_BoundingBox &node) :
                m_children(new std::vector<BBNode *>),
-               m_ctree(ct),
                m_node(node),
                m_face(NULL),
                m_u(),
@@ -234,6 +234,7 @@
                m_trimmed(false),
                m_estimate(),
                m_normal(),
+               m_ctree(ct),
                m_trims_above(new std::list<BRNode *>)
        {
            for (int i = 0; i < 3; i++) {
@@ -256,7 +257,6 @@
                    bool checkTrim /* = false */,
                    bool trimmed /* = false */) :
                m_children(new std::vector<BBNode *>),
-               m_ctree(ct),
                m_node(node),
                m_face(face),
                m_u(u),
@@ -265,6 +265,7 @@
                m_trimmed(trimmed),
                m_estimate(),
                m_normal(),
+               m_ctree(ct),
                m_trims_above(new std::list<BRNode *>)
        {
            for (int i = 0; i < 3; i++) {

Modified: brlcad/trunk/include/brep/brnode.h
===================================================================
--- brlcad/trunk/include/brep/brnode.h  2016-06-28 15:39:37 UTC (rev 68189)
+++ brlcad/trunk/include/brep/brnode.h  2016-06-28 17:13:48 UTC (rev 68190)
@@ -65,12 +65,6 @@
                        bool trimmed = false);
                ~BRNode();
 
-               /** List of all children of a given node */
-               std::vector<BRNode *> * const m_children;
-
-               /** Bounding Box */
-               ON_BoundingBox m_node;
-
                /** Node management functions */
                void addChild(const ON_BoundingBox &child);
                void addChild(BRNode *child);
@@ -99,41 +93,51 @@
                 */
                void GetBBox(fastf_t *min, fastf_t *max) const;
 
+               bool isTrimmed(const ON_2dPoint &uv, double &trimdist) const;
+               bool doTrimming() const;
+
+               ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt);
+               ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt, 
ON_Interval &u, ON_Interval &v);
+               fastf_t getLinearEstimateOfV(fastf_t u);
+               fastf_t getCurveEstimateOfV(fastf_t u, fastf_t tol) const;
+               fastf_t getCurveEstimateOfU(fastf_t v, fastf_t tol) const;
+
+               /** Bounding Box */
+               ON_BoundingBox m_node;
+
                /** Surface Information */
-               const ON_BrepFace * const m_face;
-               ON_Interval m_u;
                ON_Interval m_v;
 
                /** Trim Curve Information */
-               const ON_Curve * const m_trim;
-               ON_Interval m_t;
                int m_adj_face_index;
 
                /** Trimming Flags */
-               bool m_checkTrim;
-               bool m_trimmed;
                bool m_XIncreasing;
                bool m_Horizontal;
                bool m_Vertical;
-               bool m_innerTrim;
+               const bool m_innerTrim;
 
-               ON_3dPoint m_estimate;
-               ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt);
-               ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt, 
ON_Interval &u, ON_Interval &v);
-               fastf_t getLinearEstimateOfV(fastf_t u);
-               fastf_t getCurveEstimateOfV(fastf_t u, fastf_t tol) const;
-               fastf_t getCurveEstimateOfU(fastf_t v, fastf_t tol) const;
-
-               bool isTrimmed(const ON_2dPoint &uv, double &trimdist) const;
-               bool doTrimming() const;
-
            private:
                BRNode(const BRNode &source);
                BRNode &operator=(const BRNode &source);
 
                BRNode *closer(const ON_3dPoint &pt, BRNode *left, BRNode 
*right);
+
+               /** List of all children of a given node */
+               std::vector<BRNode *> * const m_children;
+
+               const ON_BrepFace * const m_face;
+               ON_Interval m_u;
+
+               const ON_Curve * const m_trim;
+               ON_Interval m_t;
+
+               const bool m_checkTrim;
+               const bool m_trimmed;
+
+               const ON_3dPoint m_estimate;
+
                fastf_t m_slope;
-               fastf_t m_vdot;
                fastf_t m_bb_diag;
                ON_3dPoint m_start;
                ON_3dPoint m_end;
@@ -141,23 +145,22 @@
 
        inline
            BRNode::BRNode() :
+               m_node(),
+               m_v(),
+               m_adj_face_index(-99),
+               m_XIncreasing(false),
+               m_Horizontal(false),
+               m_Vertical(false),
+               m_innerTrim(false),
                m_children(new std::vector<BRNode *>),
-               m_node(),
                m_face(NULL),
                m_u(),
-               m_v(),
                m_trim(NULL),
                m_t(),
-               m_adj_face_index(-99),
                m_checkTrim(true),
                m_trimmed(false),
-               m_XIncreasing(false),
-               m_Horizontal(false),
-               m_Vertical(false),
-               m_innerTrim(false),
                m_estimate(),
                m_slope(0.0),
-               m_vdot(0.0),
                m_bb_diag(0.0),
                m_start(ON_3dPoint::UnsetPoint),
                m_end(ON_3dPoint::UnsetPoint)
@@ -174,23 +177,22 @@
                    bool innerTrim /* = false */,
                    bool checkTrim /* = true */,
                    bool trimmed /* = false */) :
+               m_node(node),
+               m_v(),
+               m_adj_face_index(adj_face_index),
+               m_XIncreasing(false),
+               m_Horizontal(false),
+               m_Vertical(false),
+               m_innerTrim(innerTrim),
                m_children(new std::vector<BRNode *>),
-               m_node(node),
                m_face(face),
                m_u(),
-               m_v(),
                m_trim(curve),
                m_t(t),
-               m_adj_face_index(adj_face_index),
                m_checkTrim(checkTrim),
                m_trimmed(trimmed),
-               m_XIncreasing(false),
-               m_Horizontal(false),
-               m_Vertical(false),
-               m_innerTrim(innerTrim),
                m_estimate(),
                m_slope(0.0),
-               m_vdot(0.0),
                m_bb_diag(0.0),
                m_start(curve->PointAt(m_t[0])),
                m_end(curve->PointAt(m_t[1]))
@@ -248,23 +250,22 @@
        inline
            _BU_ATTR_ALWAYS_INLINE
            BRNode::BRNode(const ON_BoundingBox &node) :
+               m_node(node),
+               m_v(),
+               m_adj_face_index(-99),
+               m_XIncreasing(false),
+               m_Horizontal(false),
+               m_Vertical(false),
+               m_innerTrim(false),
                m_children(new std::vector<BRNode *>),
-               m_node(node),
                m_face(NULL),
                m_u(),
-               m_v(),
                m_trim(NULL),
                m_t(),
-               m_adj_face_index(-99),
                m_checkTrim(true),
                m_trimmed(false),
-               m_XIncreasing(false),
-               m_Horizontal(false),
-               m_Vertical(false),
-               m_innerTrim(false),
                m_estimate(),
                m_slope(0.0),
-               m_vdot(0.0),
                m_bb_diag(0.0),
                m_start(ON_3dPoint::UnsetPoint),
                m_end(ON_3dPoint::UnsetPoint)

Modified: brlcad/trunk/include/brep/surfacetree.h
===================================================================
--- brlcad/trunk/include/brep/surfacetree.h     2016-06-28 15:39:37 UTC (rev 
68189)
+++ brlcad/trunk/include/brep/surfacetree.h     2016-06-28 17:13:48 UTC (rev 
68190)
@@ -54,16 +54,11 @@
         * SurfaceTree declaration
         */
        class BREP_EXPORT SurfaceTree {
-           private:
-               bool m_removeTrimmed;
-
            public:
                SurfaceTree();
                SurfaceTree(const ON_BrepFace *face, bool removeTrimmed = true, 
int depthLimit = BREP_MAX_FT_DEPTH, double within_distance_tol = 
BREP_EDGE_MISS_TOLERANCE);
                ~SurfaceTree();
 
-               CurveTree *ctree;
-
                BBNode *getRootNode() const;
 
                /**
@@ -86,6 +81,8 @@
                void getLeaves(std::list<BBNode *> &out_leaves);
                int depth();
 
+               CurveTree *ctree;
+
            private:
                bool isFlat(ON_Plane frames[]);
                bool isStraight(ON_Plane frames[]);
@@ -94,6 +91,7 @@
                BBNode *subdivideSurface(const ON_Surface *localsurf, const 
ON_Interval &u, const ON_Interval &v, ON_Plane frames[], int depth, int 
depthLimit, int prev_knot, double within_distance_tol);
                BBNode *surfaceBBox(const ON_Surface *localsurf, bool leaf, 
ON_Plane frames[], const ON_Interval &u, const ON_Interval &v, double 
within_distance_tol);
 
+               const bool m_removeTrimmed;
                const ON_BrepFace * const m_face;
                BBNode *m_root;
                std::queue<ON_Plane *> * const f_queue;

Modified: brlcad/trunk/src/libbrep/opennurbs_ext.cpp
===================================================================
--- brlcad/trunk/src/libbrep/opennurbs_ext.cpp  2016-06-28 15:39:37 UTC (rev 
68189)
+++ brlcad/trunk/src/libbrep/opennurbs_ext.cpp  2016-06-28 17:13:48 UTC (rev 
68190)
@@ -552,8 +552,8 @@
 
//--------------------------------------------------------------------------------
 // SurfaceTree
 SurfaceTree::SurfaceTree()
-    : m_removeTrimmed(false),
-      ctree(NULL),
+    : ctree(NULL),
+      m_removeTrimmed(false),
       m_face(NULL),
       m_root(NULL),
       f_queue(new std::queue<ON_Plane *>)
@@ -561,8 +561,8 @@
 
 
 SurfaceTree::SurfaceTree(const ON_BrepFace* face, bool removeTrimmed, int 
depthLimit, double within_distance_tol) :
+    ctree(NULL),
     m_removeTrimmed(removeTrimmed),
-    ctree(NULL),
     m_face(face),
     m_root(NULL),
     f_queue(new std::queue<ON_Plane *>)

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


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to