|
|
@@ -1098,9 +1098,9 @@ get_bounds(Thread *current_thread) const {
|
|
|
int Geom::
|
|
|
get_nested_vertices(Thread *current_thread) const {
|
|
|
CDLockedReader cdata(_cycler, current_thread);
|
|
|
- if (cdata->_internal_bounds_stale) {
|
|
|
+ if (cdata->_nested_vertices_stale) {
|
|
|
CDWriter cdataw(((Geom *)this)->_cycler, cdata, false);
|
|
|
- compute_internal_bounds(cdataw, current_thread);
|
|
|
+ compute_nested_vertices(cdataw, current_thread);
|
|
|
return cdataw->_nested_vertices;
|
|
|
}
|
|
|
return cdata->_nested_vertices;
|
|
|
@@ -1468,9 +1468,26 @@ compute_internal_bounds(Geom::CData *cdata, Thread *current_thread) const {
|
|
|
cdata->_internal_bounds = new BoundingBox;
|
|
|
}
|
|
|
}
|
|
|
+ cdata->_internal_bounds_stale = false;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Recomputes the number of nested vertices in this Geom.
|
|
|
+ */
|
|
|
+void Geom::
|
|
|
+compute_nested_vertices(Geom::CData *cdata, Thread *current_thread) const {
|
|
|
+ int num_vertices = 0;
|
|
|
+
|
|
|
+ Primitives::const_iterator pi;
|
|
|
+ for (pi = cdata->_primitives.begin();
|
|
|
+ pi != cdata->_primitives.end();
|
|
|
+ ++pi) {
|
|
|
+ GeomPrimitivePipelineReader reader((*pi).get_read_pointer(current_thread), current_thread);
|
|
|
+ num_vertices += reader.get_num_vertices();
|
|
|
+ }
|
|
|
|
|
|
cdata->_nested_vertices = num_vertices;
|
|
|
- cdata->_internal_bounds_stale = false;
|
|
|
+ cdata->_nested_vertices_stale = false;
|
|
|
}
|
|
|
|
|
|
/**
|