Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placement converter refactor #95

Merged
merged 17 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions Core/src/IfcGeometryConverter/CurveConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,24 +554,7 @@ namespace OpenInfraPlatform {
std::dynamic_pointer_cast<typename IfcEntityTypesT::IfcConic>(ifcCurve);
if (conic) {
// determine position
typename IfcEntityTypesT::IfcAxis2Placement conic_placement = conic->Position;
carve::math::Matrix conic_position_matrix(carve::math::Matrix::IDENT());

switch (conic_placement.which()) {
case 0: // class IfcAxis2Placement2D;
placementConverter->convertIfcAxis2Placement2D(
conic_placement.get<0>().lock(),
conic_position_matrix);
break;
case 1: // class IfcAxis2Placement3D;
placementConverter->convertIfcAxis2Placement3D(
conic_placement.get<1>().lock(),
conic_position_matrix);
break;
default:
BLUE_LOG(error) << conic->getErrorLog() << ": no position found.";
break;
} //end switch (conic_placement.which())
carve::math::Matrix conic_position_matrix = placementConverter->convertIfcAxis2Placement(conic->Position);

// (1/2) IfcCircle SUBTYPE OF IfcConic
std::shared_ptr<typename IfcEntityTypesT::IfcCircle> circle =
Expand Down
9 changes: 3 additions & 6 deletions Core/src/IfcGeometryConverter/FaceConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ namespace OpenInfraPlatform {
std::shared_ptr<typename IfcEntityTypesT::IfcAxis2Placement3D>& basis_surface_placement = basis_surface->Position.lock();

if(basis_surface_placement) {
placementConverter->convertIfcAxis2Placement3D(basis_surface_placement, curve_bounded_plane_matrix);
curve_bounded_plane_matrix = pos * curve_bounded_plane_matrix;
curve_bounded_plane_matrix = pos * placementConverter->convertIfcAxis2Placement3D(basis_surface_placement);;
}
}

Expand Down Expand Up @@ -270,8 +269,7 @@ namespace OpenInfraPlatform {

carve::math::Matrix elementary_surface_matrix(pos);
if(elementary_surface_placement) {
placementConverter->convertIfcAxis2Placement3D(elementary_surface_placement, elementary_surface_matrix);
elementary_surface_matrix = pos * elementary_surface_matrix;
elementary_surface_matrix = pos * placementConverter->convertIfcAxis2Placement3D(elementary_surface_placement);
}

// (1/4) IfcCylindricalSurface SUBTYPE of IfcElementarySurface
Expand Down Expand Up @@ -365,8 +363,7 @@ namespace OpenInfraPlatform {

carve::math::Matrix swept_surface_matrix(pos);
if(swept_surface_placement) {
placementConverter->convertIfcAxis2Placement3D(swept_surface_placement, swept_surface_matrix);
swept_surface_matrix = pos * swept_surface_matrix;
swept_surface_matrix = pos * placementConverter->convertIfcAxis2Placement3D(swept_surface_placement);
}

// (1/2) IfcSurfaceOfLinearExtrusion SUBTYPE of IfcSweptSurface
Expand Down
3 changes: 1 addition & 2 deletions Core/src/IfcGeometryConverter/IfcImporterImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ static void OpenInfraPlatform::Core::IfcGeometryConverter::IfcImporterUtil::conv
// OR auto& objectPlacement = optObjectPlacement.get();

std::vector<std::shared_ptr<typename IfcEntityTypesT::IfcObjectPlacement>> placementAlreadyApplied;
repConverter->getPlacementConverter()->convertIfcObjectPlacement(
matProduct = repConverter->getPlacementConverter()->convertIfcObjectPlacement(
objectPlacement_ptr,
matProduct,
placementAlreadyApplied);

#ifdef _DEBUG
Expand Down
Loading