1 // Created on: 1996-12-30
2 // Created by: Stagiaire Mary FABIEN
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <BRepBuilderAPI_GTransform.ixx>
19 #include <TopTools_ListIteratorOfListOfShape.hxx>
20 #include <BRepTools_GTrsfModification.hxx>
21 #include <BRepTools_NurbsConvertModification.hxx>
22 #include <BRepBuilderAPI_NurbsConvert.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <BRep_Builder.hxx>
28 //=======================================================================
29 //function : BRepBuilderAPI_GTransform
31 //=======================================================================
33 BRepBuilderAPI_GTransform::BRepBuilderAPI_GTransform (const gp_GTrsf& T) :
36 myModification = new BRepTools_GTrsfModification(T);
40 //=======================================================================
41 //function : BRepBuilderAPI_GTransform
43 //=======================================================================
45 BRepBuilderAPI_GTransform::BRepBuilderAPI_GTransform (const TopoDS_Shape& S,
47 const Standard_Boolean Copy) :
50 myModification = new BRepTools_GTrsfModification(T);
56 //=======================================================================
59 //=======================================================================
61 void BRepBuilderAPI_GTransform::Perform(const TopoDS_Shape& S,
62 const Standard_Boolean Copy)
64 BRepBuilderAPI_NurbsConvert nc;
67 TopoDS_Shape Slocal = nc.Shape();
68 Handle(BRepTools_GTrsfModification) theModif =
69 Handle(BRepTools_GTrsfModification)::DownCast(myModification);
70 theModif->GTrsf() = myGTrsf;
71 DoModif(Slocal,myModification);
72 // myHist.Filter (Shape());
76 //=======================================================================
79 //=======================================================================
81 const TopTools_ListOfShape& BRepBuilderAPI_GTransform::Modified
82 (const TopoDS_Shape& F)
85 const TopTools_DataMapOfShapeListOfShape& M = myHist.Modification();
87 TopTools_ListOfShape Li;
88 TopTools_ListIteratorOfListOfShape itL(M(F));
89 for (;itL.More();itL.Next())
90 Li.Assign(BRepBuilderAPI_ModifyShape::Modified(itL.Value()));
96 //=======================================================================
97 //function : ModifiedShape
99 //=======================================================================
101 const TopoDS_Shape& BRepBuilderAPI_GTransform::ModifiedShape
102 (const TopoDS_Shape& S) const
104 const TopTools_DataMapOfShapeListOfShape &aMapModif = myHist.Modification();
105 TopoDS_Shape aShape = S;
107 if (aMapModif.IsBound(S)) {
108 const TopTools_ListOfShape &aListModShape = aMapModif(S);
109 Standard_Integer aNbShapes = aListModShape.Extent();
112 aShape = aListModShape.First();
115 return BRepBuilderAPI_ModifyShape::ModifiedShape(aShape);