Revision: 73938
          http://sourceforge.net/p/brlcad/code/73938
Author:   starseeker
Date:     2019-09-17 00:39:08 +0000 (Tue, 17 Sep 2019)
Log Message:
-----------
Change the 2d triangles to use a vector - no uniqueness guarantees are needed 
at this point.

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/cdt_mesh.cpp
    brlcad/trunk/src/libbrep/cdt_mesh.h

Modified: brlcad/trunk/src/libbrep/cdt_mesh.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt_mesh.cpp       2019-09-16 21:24:53 UTC (rev 
73937)
+++ brlcad/trunk/src/libbrep/cdt_mesh.cpp       2019-09-17 00:39:08 UTC (rev 
73938)
@@ -2633,7 +2633,7 @@
            t.v[1] = faces[3*i+1];
            t.v[2] = faces[3*i+2];
 
-           tris_2d.insert(t);
+           tris_2d.push_back(t);
        }
 
        bu_free(faces, "faces array");
@@ -2656,7 +2656,7 @@
 
     // Use the 2D triangles to create the face 3D triangle mesh
     reset();
-    std::set<triangle_t>::iterator tr_it;
+    std::vector<triangle_t>::iterator tr_it;
     for (tr_it = tris_2d.begin(); tr_it != tris_2d.end(); tr_it++) {
        triangle_t tri2d = *tr_it;
        triangle_t tri3d;
@@ -2679,7 +2679,7 @@
        tri3d.v[0] = p2ind[pnts[p2d3d[tri2d.v[0]]]];
        tri3d.v[1] = p2ind[pnts[p2d3d[tri2d.v[1]]]];
        tri3d.v[2] = p2ind[pnts[p2d3d[tri2d.v[2]]]];
-       
+
        ON_3dVector tdir = tnorm(tri3d);
        ON_3dVector bdir = bnorm(tri3d);
        if (tdir.Length() > 0 && bdir.Length() > 0 && ON_DotProduct(tdir, bdir) 
< 0.1) {
@@ -3092,7 +3092,7 @@
     pl_color_buc(plot, buc);
 }
 
-void cdt_mesh_t::tris_set_plot_2d(std::set<triangle_t> &tset, const char 
*filename)
+void cdt_mesh_t::tris_vect_plot_2d(std::vector<triangle_t> &tset, const char 
*filename)
 {
     FILE* plot_file = fopen(filename, "w");
 
@@ -3100,7 +3100,7 @@
     bu_color_rand(&c, BU_COLOR_RANDOM_LIGHTENED);
     pl_color_buc(plot_file, &c);
 
-    std::set<triangle_t>::iterator s_it;
+    std::vector<triangle_t>::iterator s_it;
 
     for (s_it = tset.begin(); s_it != tset.end(); s_it++) {
        triangle_t tri = (*s_it);
@@ -3111,7 +3111,7 @@
 
 void cdt_mesh_t::tris_plot_2d(const char *filename)
 {
-    tris_set_plot_2d(tris_2d, filename);
+    tris_vect_plot_2d(tris_2d, filename);
 }
 
 

Modified: brlcad/trunk/src/libbrep/cdt_mesh.h
===================================================================
--- brlcad/trunk/src/libbrep/cdt_mesh.h 2019-09-16 21:24:53 UTC (rev 73937)
+++ brlcad/trunk/src/libbrep/cdt_mesh.h 2019-09-17 00:39:08 UTC (rev 73938)
@@ -461,7 +461,7 @@
 
     /* Triangulation related functions and data. */
     bool cdt();
-    std::set<triangle_t> tris_2d;
+    std::vector<triangle_t> tris_2d;
     std::vector<std::pair<double, double> > m_pnts_2d;
     std::map<long, long> p2d3d;
     cpolygon_t outer_loop;
@@ -497,7 +497,7 @@
     void tris_plot(const char *filename);
     void tri_plot(const triangle_t &tri, const char *filename);
 
-    void tris_set_plot_2d(std::set<triangle_t> &tset, const char *filename);
+    void tris_vect_plot_2d(std::vector<triangle_t> &tset, const char 
*filename);
     void tris_plot_2d(const char *filename);
 
     void polygon_plot_2d(cpolygon_t *polygon, const char *filename);

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to