1
#include "SurfaceCollection.hpp"
7
SurfaceCollection::simplify(double tolerance)
10
for (Surfaces::const_iterator it_s = this->surfaces.begin(); it_s != this->surfaces.end(); ++it_s) {
12
it_s->expolygon.simplify(tolerance, expp);
13
for (ExPolygons::const_iterator it_e = expp.begin(); it_e != expp.end(); ++it_e) {
22
/* group surfaces by common properties */
24
SurfaceCollection::group(std::vector<SurfacesPtr> *retval)
26
for (Surfaces::iterator it = this->surfaces.begin(); it != this->surfaces.end(); ++it) {
27
// find a group with the same properties
28
SurfacesPtr* group = NULL;
29
for (std::vector<SurfacesPtr>::iterator git = retval->begin(); git != retval->end(); ++git) {
30
Surface* gkey = git->front();
31
if ( gkey->surface_type == it->surface_type
32
&& gkey->thickness == it->thickness
33
&& gkey->thickness_layers == it->thickness_layers
34
&& gkey->bridge_angle == it->bridge_angle) {
40
// if no group with these properties exists, add one
42
retval->resize(retval->size() + 1);
43
group = &retval->back();
46
// append surface to group
47
group->push_back(&*it);
52
REGISTER_CLASS(SurfaceCollection, "Surface::Collection");