1 // Created on: 1999-03-09
2 // Created by: Roman LYGIN
3 // Copyright (c) 1999-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.
18 #include <BRep_TEdge.hxx>
19 #include <BRep_TFace.hxx>
20 #include <BRep_TVertex.hxx>
21 #include <Geom2d_Curve.hxx>
22 #include <Geom_Curve.hxx>
23 #include <Geom_Surface.hxx>
25 #include <gp_Trsf.hxx>
26 #include <ShapeCustom_TrsfModification.hxx>
27 #include <Standard_Type.hxx>
28 #include <TopLoc_Location.hxx>
29 #include <TopoDS_Edge.hxx>
30 #include <TopoDS_Face.hxx>
31 #include <TopoDS_Vertex.hxx>
33 IMPLEMENT_STANDARD_RTTIEXT(ShapeCustom_TrsfModification,BRepTools_TrsfModification)
35 //=======================================================================
36 //function : ShapeCustom_TrsfModification
38 //=======================================================================
39 ShapeCustom_TrsfModification::ShapeCustom_TrsfModification(const gp_Trsf& T):
40 BRepTools_TrsfModification(T)
44 //=======================================================================
45 //function : NewSurface
47 //=======================================================================
49 Standard_Boolean ShapeCustom_TrsfModification::NewSurface(const TopoDS_Face& F,
50 Handle(Geom_Surface)& S,
53 Standard_Boolean& RevWires,
54 Standard_Boolean& RevFace)
56 Standard_Boolean result = BRepTools_TrsfModification::NewSurface(F, S, L, Tol, RevWires, RevFace);
57 Tol = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
61 //=======================================================================
64 //=======================================================================
66 Standard_Boolean ShapeCustom_TrsfModification::NewCurve(const TopoDS_Edge& E,
67 Handle(Geom_Curve)& C,
71 Standard_Boolean result = BRepTools_TrsfModification::NewCurve (E, C, L, Tol);
72 Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
76 //=======================================================================
79 //=======================================================================
81 Standard_Boolean ShapeCustom_TrsfModification::NewPoint(const TopoDS_Vertex& V,
85 Standard_Boolean result = BRepTools_TrsfModification::NewPoint (V, P, Tol);
86 Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
90 //=======================================================================
91 //function : NewCurve2d
93 //=======================================================================
95 Standard_Boolean ShapeCustom_TrsfModification::NewCurve2d(const TopoDS_Edge& E,
97 const TopoDS_Edge& NewE,
98 const TopoDS_Face& NewF,
99 Handle(Geom2d_Curve)& C,
102 Standard_Boolean result = BRepTools_TrsfModification::NewCurve2d (E, F, NewE, NewF, C, Tol);
103 Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
107 //=======================================================================
108 //function : NewParameter
110 //=======================================================================
112 Standard_Boolean ShapeCustom_TrsfModification::NewParameter(const TopoDS_Vertex& V,
113 const TopoDS_Edge& E,
117 Standard_Boolean result = BRepTools_TrsfModification::NewParameter (V, E, P, Tol);
118 Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());