1 // Created on: 1993-06-24
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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 <Geom2d_Curve.hxx>
19 #include <TopOpeBRepDS_define.hxx>
20 #include <TopOpeBRepDS_EdgeVertexInterference.hxx>
21 #include <TopOpeBRepDS_FaceEdgeInterference.hxx>
22 #include <TopOpeBRepDS_Interference.hxx>
23 #include <TopOpeBRepDS_InterferenceTool.hxx>
24 #include <TopOpeBRepDS_SolidSurfaceInterference.hxx>
25 #include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
26 #include <TopOpeBRepDS_Transition.hxx>
28 //=======================================================================
29 //function : MakeEdgeInterference
31 //=======================================================================
32 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeEdgeInterference
33 (const TopOpeBRepDS_Transition& T,const TopOpeBRepDS_Kind SK,const Standard_Integer SI,const TopOpeBRepDS_Kind GK,const Standard_Integer GI,const Standard_Real P)
35 return new TopOpeBRepDS_CurvePointInterference(T,SK,SI,GK,GI,P);
38 //=======================================================================
39 //function : MakeCurveInterference
41 //=======================================================================
42 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeCurveInterference
43 (const TopOpeBRepDS_Transition& T,const TopOpeBRepDS_Kind SK,const Standard_Integer SI,const TopOpeBRepDS_Kind GK,const Standard_Integer GI,const Standard_Real P)
45 return new TopOpeBRepDS_CurvePointInterference(T,SK,SI,GK,GI,P);
48 //=======================================================================
49 //function : DuplicateCurvePointInterference
51 //=======================================================================
52 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::DuplicateCurvePointInterference(const Handle(TopOpeBRepDS_Interference)& I)
54 return new TopOpeBRepDS_CurvePointInterference
55 (I->Transition().Complement(),
56 I->SupportType(),I->Support(),
57 I->GeometryType(),I->Geometry(),
58 TopOpeBRepDS_InterferenceTool::Parameter(I));
62 //=======================================================================
63 //function : MakeFaceCurveInterference
65 //=======================================================================
66 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeFaceCurveInterference
67 (const TopOpeBRepDS_Transition& Transition,const Standard_Integer FaceI,const Standard_Integer CurveI,const Handle(Geom2d_Curve)& PC)
69 return new TopOpeBRepDS_SurfaceCurveInterference
71 TopOpeBRepDS_FACE,FaceI,
72 TopOpeBRepDS_CURVE,CurveI,
77 //=======================================================================
78 //function : MakeSolidSurfaceInterference
80 //=======================================================================
81 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeSolidSurfaceInterference
82 (const TopOpeBRepDS_Transition& Transition,const Standard_Integer SolidI,const Standard_Integer SurfaceI)
84 return new TopOpeBRepDS_SolidSurfaceInterference
86 TopOpeBRepDS_SOLID,SolidI,
87 TopOpeBRepDS_SURFACE,SurfaceI);
91 //=======================================================================
92 //function : MakeEdgeVertexInterference
94 //=======================================================================
95 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeEdgeVertexInterference
96 (const TopOpeBRepDS_Transition& Transition,
97 const Standard_Integer EdgeI,
98 const Standard_Integer VertexI,
99 const Standard_Boolean VertexIsBound,
100 const TopOpeBRepDS_Config C,
101 const Standard_Real param)
103 // soit I l'EVI creee :
104 return new TopOpeBRepDS_EdgeVertexInterference
105 (Transition, // transition en cheminant sur l'arete accedante a I
106 EdgeI, // arete croisee par l'arete accedante, en V
107 VertexI, // vertex geometrie de I
108 VertexIsBound, // vertex est il un sommet de l'arete accedante de I
109 C, // orient. relative des aretes accedante et croisee.
110 param); // parametre de V sur arete accedante de I
113 //=======================================================================
114 //function : MakeFaceEdgeInterference
116 //=======================================================================
117 Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference
118 (const TopOpeBRepDS_Transition& Transition,
119 const Standard_Integer FaceI,
120 const Standard_Integer EdgeI,
121 const Standard_Boolean EdgeIsBound,
122 const TopOpeBRepDS_Config C)
124 return new TopOpeBRepDS_FaceEdgeInterference
132 //=======================================================================
133 //function : Parameter
134 //purpose : only on I = CurvePointInterference
135 //=======================================================================
136 Standard_Real TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I)
138 return Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter();
141 //=======================================================================
142 //function : Parameter
143 //purpose : only on I = CurvePointInterference
144 //=======================================================================
145 void TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I,const Standard_Real Par)
147 Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter(Par);