1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Transform.cpp
4 // Created: 29 July 2015
5 // Author: Dmitry Bobylev
7 #include "GeomAlgoAPI_Transform.h"
9 #include <GeomAlgoAPI_ShapeTools.h>
11 #include <BRepBuilderAPI_Transform.hxx>
12 #include <BRepCheck_Analyzer.hxx>
13 #include <Precision.hxx>
14 #include <TopExp_Explorer.hxx>
16 //=================================================================================================
17 GeomAlgoAPI_Transform::GeomAlgoAPI_Transform(std::shared_ptr<GeomAPI_Shape> theSourceShape,
18 std::shared_ptr<GeomAPI_Trsf> theTrsf)
21 build(theSourceShape, theTrsf);
24 //=================================================================================================
25 void GeomAlgoAPI_Transform::build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
26 std::shared_ptr<GeomAPI_Trsf> theTrsf)
28 if(!theSourceShape || !theTrsf) {
32 const TopoDS_Shape& aSourceShape = theSourceShape->impl<TopoDS_Shape>();
33 const gp_Trsf& aTrsf = theTrsf->impl<gp_Trsf>();
35 if(aSourceShape.IsNull()) {
39 BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true);
43 this->setImpl(aBuilder);
44 this->setBuilderType(OCCT_BRepBuilderAPI_MakeShape);
46 if(aBuilder->IsDone() != Standard_True) {
49 TopoDS_Shape aResult = aBuilder->Shape();
51 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
52 aShape->setImpl(new TopoDS_Shape(aResult));
53 this->setShape(aShape);
57 //=================================================================================================
58 std::shared_ptr<GeomAPI_Trsf> GeomAlgoAPI_Transform::transformation() const