1 // File: BRepBuilderAPI_GTransform_21423.cxx
2 // Created: Mon Dec 30 17:12:14 1996
3 // Author: Stagiaire Mary FABIEN
4 // <fbi@zozox.paris1.matra-dtv.fr>
6 #include <BRepBuilderAPI_GTransform_21423.hxx>
8 #include <Standard_NoSuchObject.hxx>
9 #include <gp_GTrsf.hxx>
10 #include <TopoDS_Shape.hxx>
11 #include <TopTools_ListOfShape.hxx>
13 #include <TopTools_ListIteratorOfListOfShape.hxx>
14 #include <BRepTools_GTrsfModification.hxx>
15 #include <BRepTools_NurbsConvertModification_21423.hxx>
16 #include <BRepBuilderAPI_NurbsConvert_21423.hxx>
19 #include <BRep_Builder.hxx>
22 //=======================================================================
23 //function : BRepBuilderAPI_GTransform_21423
25 //=======================================================================
27 BRepBuilderAPI_GTransform_21423::BRepBuilderAPI_GTransform_21423 (const gp_GTrsf& T) :
30 myModification = new BRepTools_GTrsfModification(T);
34 //=======================================================================
35 //function : BRepBuilderAPI_GTransform_21423
37 //=======================================================================
39 BRepBuilderAPI_GTransform_21423::BRepBuilderAPI_GTransform_21423 (const TopoDS_Shape& S,
41 const Standard_Boolean Copy) :
44 myModification = new BRepTools_GTrsfModification(T);
50 //=======================================================================
53 //=======================================================================
55 void BRepBuilderAPI_GTransform_21423::Perform(const TopoDS_Shape& S,
56 const Standard_Boolean Copy)
58 BRepBuilderAPI_NurbsConvert_21423 nc;
61 TopoDS_Shape Slocal = nc.Shape();
62 Handle(BRepTools_GTrsfModification) theModif =
63 Handle(BRepTools_GTrsfModification)::DownCast(myModification);
64 theModif->GTrsf() = myGTrsf;
65 DoModif(Slocal,myModification);
66 // myHist.Filter (Shape());
70 //=======================================================================
73 //=======================================================================
75 const TopTools_ListOfShape& BRepBuilderAPI_GTransform_21423::Modified
76 (const TopoDS_Shape& F)
79 const TopTools_DataMapOfShapeListOfShape& M = myHist.Modification();
81 TopTools_ListOfShape Li;
82 TopTools_ListIteratorOfListOfShape itL(M(F));
83 for (;itL.More();itL.Next())
84 Li.Assign(BRepBuilderAPI_ModifyShape_21423::Modified(itL.Value()));
90 //=======================================================================
91 //function : ModifiedShape
93 //=======================================================================
95 const TopoDS_Shape& BRepBuilderAPI_GTransform_21423::ModifiedShape
96 (const TopoDS_Shape& S) const
98 const TopTools_DataMapOfShapeListOfShape &aMapModif = myHist.Modification();
99 TopoDS_Shape aShape = S;
101 if (aMapModif.IsBound(S)) {
102 const TopTools_ListOfShape &aListModShape = aMapModif(S);
103 Standard_Integer aNbShapes = aListModShape.Extent();
106 aShape = aListModShape.First();
109 return BRepBuilderAPI_ModifyShape_21423::ModifiedShape(aShape);