Conversion result for breps

This commit is contained in:
Ken Arroyo Ohori
2017-02-06 16:22:36 -06:00
parent 1525cf6bfc
commit 6aff3d0f3d
2 changed files with 34 additions and 34 deletions
+30 -30
View File
@@ -85,29 +85,29 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcManifoldSolidBrep* l, Conv
cgal_shape_t s;
const SurfaceStyle* collective_style = get_style(l);
if (convert_shape(l->Outer(),s) ) {
// const SurfaceStyle* indiv_style = get_style(l->Outer());
//
// IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list);
// if (l->is(IfcSchema::Type::IfcFacetedBrepWithVoids)) {
// voids = l->as<IfcSchema::IfcFacetedBrepWithVoids>()->Voids();
// }
//#ifdef USE_IFC4
// if (l->is(IfcSchema::Type::IfcAdvancedBrepWithVoids)) {
// voids = l->as<IfcSchema::IfcAdvancedBrepWithVoids>()->Voids();
// }
//#endif
//
// for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) {
const SurfaceStyle* indiv_style = get_style(l->Outer());
IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list);
if (l->is(IfcSchema::Type::IfcFacetedBrepWithVoids)) {
voids = l->as<IfcSchema::IfcFacetedBrepWithVoids>()->Voids();
}
#ifdef USE_IFC4
if (l->is(IfcSchema::Type::IfcAdvancedBrepWithVoids)) {
voids = l->as<IfcSchema::IfcAdvancedBrepWithVoids>()->Voids();
}
#endif
for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) {
// TopoDS_Shape s2;
// /// @todo No extensive shapefixing since shells should be disjoint.
// /// @todo Awaiting generalized boolean ops module with appropriate checking
// if (convert_shape(l->Outer(), s2)) {
// s = BRepAlgoAPI_Cut(s, s2).Shape();
// }
// }
//
// shape.push_back(ConversionResult(new OpenCascadeShape(s), indiv_style ? indiv_style : collective_style));
// return true;
}
shape.push_back(ConversionResult(new CgalShape(s), indiv_style ? indiv_style : collective_style));
return true;
}
return false;
}
@@ -132,19 +132,19 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcConnectedFaceSet* l, cgal_
face_list.push_back(face);
}
for (auto const &face : face_list) {
std::cout << "Face" << std::endl;
std::cout << "\touter: ";
for (auto const &point: *face->outer) {
std::cout << "(" << point << ") ";
} std::cout << std::endl;
for (auto const &inner: face->inner) {
std::cout << "\tinner: ";
for (auto const &point: *inner) {
std::cout << "(" << point << ") ";
} std::cout << std::endl;
}
}
// for (auto const &face : face_list) {
// std::cout << "Face" << std::endl;
// std::cout << "\touter: ";
// for (auto const &point: *face->outer) {
// std::cout << "(" << point << ") ";
// } std::cout << std::endl;
// for (auto const &inner: face->inner) {
// std::cout << "\tinner: ";
// for (auto const &point: *inner) {
// std::cout << "(" << point << ") ";
// } std::cout << std::endl;
// }
// }
cgal_shape_t polyhedron = new CGAL::Polyhedron_3<Kernel>();
PolyhedronBuilder builder(&face_list);
+4 -4
View File
@@ -85,18 +85,18 @@ public:
builder.begin_surface(points_map.size(), facet_vertices.size());
for (auto const &point: points_map) {
std::cout << "Adding point " << point.first << std::endl;
// std::cout << "Adding point " << point.first << std::endl;
builder.add_vertex(point.first);
}
for (auto const &facet: facet_vertices) {
builder.begin_facet();
std::cout << "Adding facet ";
// std::cout << "Adding facet ";
for (auto const &vertex: facet) {
std::cout << vertex << " ";
// std::cout << vertex << " ";
builder.add_vertex_to_facet(vertex);
}
std::cout << std::endl;
// std::cout << std::endl;
builder.end_facet();
}