Revision: 78082
http://sourceforge.net/p/brlcad/code/78082
Author: starseeker
Date: 2021-01-14 23:46:41 +0000 (Thu, 14 Jan 2021)
Log Message:
-----------
checkpoint
Modified Paths:
--------------
brlcad/trunk/src/libged/npush/npush.cpp
Modified: brlcad/trunk/src/libged/npush/npush.cpp
===================================================================
--- brlcad/trunk/src/libged/npush/npush.cpp 2021-01-14 21:43:06 UTC (rev
78081)
+++ brlcad/trunk/src/libged/npush/npush.cpp 2021-01-14 23:46:41 UTC (rev
78082)
@@ -140,9 +140,8 @@
std::string problem_obj;
std::set<std::string> target_objs;
std::set<dp_i> s_i;
+ std::set<combtree_i> t_i;
std::map<struct directory *, int> s_c;
- std::set<combtree_i> t_i;
- std::map<struct directory *, int> t_c;
int verbosity = 0;
int max_depth = 0;
bool stop_at_regions = false;
@@ -357,8 +356,6 @@
if (s->ct[combtree_ind].t.find(dnew) ==
s->ct[combtree_ind].t.end())
s->ct[combtree_ind].t.insert(dnew);
- if (s->s_i.find(dnew) == s->s_i.end())
- s->s_i.insert(dnew);
return;
} else {
// If we're continuing, this is not the termination point of a
@@ -375,8 +372,6 @@
}
if (s->ct[combtree_ind].t.find(dnew) == s->ct[combtree_ind].t.end())
s->ct[combtree_ind].t.insert(dnew);
- if (s->s_i.find(dnew) == s->s_i.end())
- s->s_i.insert(dnew);
/* Process branch's tree */
tnew.dp = dp;
@@ -556,6 +551,22 @@
}
bu_free(all_paths, "free db_ls output");
+
+ /* Build a set of unique combtrees */
+ std::cout << "tree vect size: " << s.ct.size() << "\n";
+ for (size_t i = 0; i < s.ct.size(); i++) {
+ s.t_i.insert(s.ct[i]);
+ }
+ std::cout << "tree set size: " << s.t_i.size() << "\n";
+
+ /* Iterate over unique combtrees and build a set of unique instances */
+ std::set<combtree_i>::iterator tr_it;
+ for (tr_it = s.t_i.begin(); tr_it != s.t_i.end(); tr_it++) {
+ const combtree_i &t = *tr_it;
+ s.s_i.insert(t.t.begin(), t.t.end());
+ }
+ std::cout << "instance set size: " << s.s_i.size() << "\n";
+
// Once the survey walk is complete, iterate over s_i and count how many
// instances of each dp are present. Any dp with multiple instances can't
// be pushed without a copy being made, as the dp instances represent
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