Revision: 56634
          http://sourceforge.net/p/brlcad/code/56634
Author:   phoenixyjll
Date:     2013-08-06 18:02:10 +0000 (Tue, 06 Aug 2013)
Log Message:
-----------
Use an enum to improve readablity of m_in_out. And append the faces to out.

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/boolean.cpp

Modified: brlcad/trunk/src/libbrep/boolean.cpp
===================================================================
--- brlcad/trunk/src/libbrep/boolean.cpp        2013-08-06 17:49:54 UTC (rev 
56633)
+++ brlcad/trunk/src/libbrep/boolean.cpp        2013-08-06 18:02:10 UTC (rev 
56634)
@@ -60,7 +60,10 @@
     int m_type;                // which intersection curve
     int m_rank;                // rank on the chain
     double m_t_for_rank;// param on the SSI curve
-    bool m_in_out;     // dir is going inside(0)/outside(1)
+    enum {
+       IN,
+       OUT
+    } m_in_out;                // dir is going inside/outside
     int m_pos;         // between curve[m_pos] and curve[m_pos+1]
                        // after the outerloop is splitted
 };
@@ -172,9 +175,9 @@
     for (int i = 0; i < intersect.Count(); i++) {
        // We assume that the starting point is outside.
        if (intersect[i].m_rank % 2 == 0) {
-           intersect[i].m_in_out = false; // in
+           intersect[i].m_in_out = IntersectPoint::IN;
        } else {
-           intersect[i].m_in_out = true; // out
+           intersect[i].m_in_out = IntersectPoint::OUT;
        }
     }
 
@@ -204,6 +207,7 @@
 
     std::stack<int> s;
     s.push(0);
+
     for (int i = 1; i < sorted_pointers.Count(); i++) {
        if (s.empty()) {
            s.push(i);
@@ -218,9 +222,9 @@
        if (q->m_type != p->m_type) {
            s.push(i);
            continue;
-       } else if (q->m_rank - p->m_rank == 1 && q->m_in_out == false && 
p->m_in_out == true) {
+       } else if (q->m_rank - p->m_rank == 1 && q->m_in_out == 
IntersectPoint::OUT && p->m_in_out == IntersectPoint::IN) {
            s.pop();
-       } else if (p->m_rank - q->m_rank == 1 && p->m_in_out == false && 
q->m_in_out == true) {
+       } else if (p->m_rank - q->m_rank == 1 && p->m_in_out == 
IntersectPoint::OUT && q->m_in_out == IntersectPoint::IN) {
            s.pop();
        } else {
            s.push(i);
@@ -262,6 +266,8 @@
        TrimmedFace *newface = new TrimmedFace();
        newface->face = in->face;
        newface->outerloop.Append(newloop.Count(), newloop.Array());
+
+       out.Append(newface);
     }
 
     if (out.Count() == 0) {

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


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to