0024750: Replace instantiations of TCollection generic classes by NCollection templat...
[occt.git] / src / ShapeCustom / ShapeCustom_TrsfModification.cxx
CommitLineData
b311480e 1// Created on: 1999-03-09
2// Created by: Roman LYGIN
3// Copyright (c) 1999-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <ShapeCustom_TrsfModification.ixx>
18#include <BRep_TVertex.hxx>
19#include <BRep_TEdge.hxx>
20#include <BRep_TFace.hxx>
21
22//=======================================================================
23//function : ShapeCustom_TrsfModification
24//purpose :
25//=======================================================================
26
27ShapeCustom_TrsfModification::ShapeCustom_TrsfModification(const gp_Trsf& T):
28 BRepTools_TrsfModification(T)
29{
30}
31
32//=======================================================================
33//function : NewSurface
34//purpose :
35//=======================================================================
36
37 Standard_Boolean ShapeCustom_TrsfModification::NewSurface(const TopoDS_Face& F,
38 Handle(Geom_Surface)& S,
39 TopLoc_Location& L,
40 Standard_Real& Tol,
41 Standard_Boolean& RevWires,
42 Standard_Boolean& RevFace)
43{
44 Standard_Boolean result = BRepTools_TrsfModification::NewSurface(F, S, L, Tol, RevWires, RevFace);
45 Tol = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
46 return result;
47}
48
49//=======================================================================
50//function : NewCurve
51//purpose :
52//=======================================================================
53
54 Standard_Boolean ShapeCustom_TrsfModification::NewCurve(const TopoDS_Edge& E,
55 Handle(Geom_Curve)& C,
56 TopLoc_Location& L,
57 Standard_Real& Tol)
58{
59 Standard_Boolean result = BRepTools_TrsfModification::NewCurve (E, C, L, Tol);
60 Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
61 return result;
62}
63
64//=======================================================================
65//function : NewPoint
66//purpose :
67//=======================================================================
68
69 Standard_Boolean ShapeCustom_TrsfModification::NewPoint(const TopoDS_Vertex& V,
70 gp_Pnt& P,
71 Standard_Real& Tol)
72{
73 Standard_Boolean result = BRepTools_TrsfModification::NewPoint (V, P, Tol);
74 Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
75 return result;
76}
77
78//=======================================================================
79//function : NewCurve2d
80//purpose :
81//=======================================================================
82
83 Standard_Boolean ShapeCustom_TrsfModification::NewCurve2d(const TopoDS_Edge& E,
84 const TopoDS_Face& F,
85 const TopoDS_Edge& NewE,
86 const TopoDS_Face& NewF,
87 Handle(Geom2d_Curve)& C,
88 Standard_Real& Tol)
89{
90 Standard_Boolean result = BRepTools_TrsfModification::NewCurve2d (E, F, NewE, NewF, C, Tol);
91 Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
92 return result;
93}
94
95//=======================================================================
96//function : NewParameter
97//purpose :
98//=======================================================================
99
100 Standard_Boolean ShapeCustom_TrsfModification::NewParameter(const TopoDS_Vertex& V,
101 const TopoDS_Edge& E,
102 Standard_Real& P,
103 Standard_Real& Tol)
104{
105 Standard_Boolean result = BRepTools_TrsfModification::NewParameter (V, E, P, Tol);
106 Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor());
107 return result;
108}
109