0024023: Revamp the OCCT Handle -- downcast (automatic)
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_InterferenceTool.cxx
CommitLineData
b311480e 1// Created on: 1993-06-24
2// Created by: Jean Yves LEBEY
3// Copyright (c) 1993-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 <TopOpeBRepDS_SolidSurfaceInterference.hxx>
18#include <TopOpeBRepDS_CurvePointInterference.hxx>
19#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
20#include <TopOpeBRepDS_EdgeVertexInterference.hxx>
21#include <TopOpeBRepDS_FaceEdgeInterference.hxx>
22#include <TopAbs.hxx>
23#include <IntSurf_TypeTrans.hxx>
24#include <IntSurf_Situation.hxx>
25#include <TopOpeBRepDS_define.hxx>
26#include <TopOpeBRepDS_InterferenceTool.ixx>
27
28//=======================================================================
29//function : MakeEdgeInterference
30//purpose :
31//=======================================================================
32Handle(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)
34{
35 return new TopOpeBRepDS_CurvePointInterference(T,SK,SI,GK,GI,P);
36}
37
38//=======================================================================
39//function : MakeCurveInterference
40//purpose :
41//=======================================================================
42Handle(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)
44{
45 return new TopOpeBRepDS_CurvePointInterference(T,SK,SI,GK,GI,P);
46}
47
48//=======================================================================
49//function : DuplicateCurvePointInterference
50//purpose :
51//=======================================================================
52Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::DuplicateCurvePointInterference(const Handle(TopOpeBRepDS_Interference)& I)
53{
54 return new TopOpeBRepDS_CurvePointInterference
55 (I->Transition().Complement(),
56 I->SupportType(),I->Support(),
57 I->GeometryType(),I->Geometry(),
58 TopOpeBRepDS_InterferenceTool::Parameter(I));
59}
60
61
62//=======================================================================
63//function : MakeFaceCurveInterference
64//purpose :
65//=======================================================================
66Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeFaceCurveInterference
67(const TopOpeBRepDS_Transition& Transition,const Standard_Integer FaceI,const Standard_Integer CurveI,const Handle(Geom2d_Curve)& PC)
68{
69 return new TopOpeBRepDS_SurfaceCurveInterference
70 (Transition,
71 TopOpeBRepDS_FACE,FaceI,
72 TopOpeBRepDS_CURVE,CurveI,
73 PC);
74}
75
76
77//=======================================================================
78//function : MakeSolidSurfaceInterference
79//purpose :
80//=======================================================================
81Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeSolidSurfaceInterference
82(const TopOpeBRepDS_Transition& Transition,const Standard_Integer SolidI,const Standard_Integer SurfaceI)
83{
84 return new TopOpeBRepDS_SolidSurfaceInterference
85 (Transition,
86 TopOpeBRepDS_SOLID,SolidI,
87 TopOpeBRepDS_SURFACE,SurfaceI);
88}
89
90
91//=======================================================================
92//function : MakeEdgeVertexInterference
93//purpose :
94//=======================================================================
95Handle(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)
102{
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
111}
112
113//=======================================================================
114//function : MakeFaceEdgeInterference
115//purpose :
116//=======================================================================
117Handle(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)
123{
124 return new TopOpeBRepDS_FaceEdgeInterference
125 (Transition,
126 FaceI,
127 EdgeI,
128 EdgeIsBound,
129 C);
130}
131
132//=======================================================================
133//function : Parameter
134//purpose : only on I = CurvePointInterference
135//=======================================================================
136Standard_Real TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I)
137{
c5f3a425 138 return Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter();
7fd59977 139}
140
141//=======================================================================
142//function : Parameter
143//purpose : only on I = CurvePointInterference
144//=======================================================================
145void TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I,const Standard_Real Par)
146{
c5f3a425 147 Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter(Par);
7fd59977 148}