0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[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
42cf5bc1 17
18#include <Geom2d_Curve.hxx>
19#include <IntSurf_Situation.hxx>
20#include <IntSurf_TypeTrans.hxx>
21#include <TopAbs.hxx>
7fd59977 22#include <TopOpeBRepDS_CurvePointInterference.hxx>
42cf5bc1 23#include <TopOpeBRepDS_define.hxx>
7fd59977 24#include <TopOpeBRepDS_EdgeVertexInterference.hxx>
25#include <TopOpeBRepDS_FaceEdgeInterference.hxx>
42cf5bc1 26#include <TopOpeBRepDS_Interference.hxx>
27#include <TopOpeBRepDS_InterferenceTool.hxx>
28#include <TopOpeBRepDS_SolidSurfaceInterference.hxx>
29#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
30#include <TopOpeBRepDS_Transition.hxx>
7fd59977 31
32//=======================================================================
33//function : MakeEdgeInterference
34//purpose :
35//=======================================================================
36Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeEdgeInterference
37(const TopOpeBRepDS_Transition& T,const TopOpeBRepDS_Kind SK,const Standard_Integer SI,const TopOpeBRepDS_Kind GK,const Standard_Integer GI,const Standard_Real P)
38{
39 return new TopOpeBRepDS_CurvePointInterference(T,SK,SI,GK,GI,P);
40}
41
42//=======================================================================
43//function : MakeCurveInterference
44//purpose :
45//=======================================================================
46Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeCurveInterference
47(const TopOpeBRepDS_Transition& T,const TopOpeBRepDS_Kind SK,const Standard_Integer SI,const TopOpeBRepDS_Kind GK,const Standard_Integer GI,const Standard_Real P)
48{
49 return new TopOpeBRepDS_CurvePointInterference(T,SK,SI,GK,GI,P);
50}
51
52//=======================================================================
53//function : DuplicateCurvePointInterference
54//purpose :
55//=======================================================================
56Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::DuplicateCurvePointInterference(const Handle(TopOpeBRepDS_Interference)& I)
57{
58 return new TopOpeBRepDS_CurvePointInterference
59 (I->Transition().Complement(),
60 I->SupportType(),I->Support(),
61 I->GeometryType(),I->Geometry(),
62 TopOpeBRepDS_InterferenceTool::Parameter(I));
63}
64
65
66//=======================================================================
67//function : MakeFaceCurveInterference
68//purpose :
69//=======================================================================
70Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeFaceCurveInterference
71(const TopOpeBRepDS_Transition& Transition,const Standard_Integer FaceI,const Standard_Integer CurveI,const Handle(Geom2d_Curve)& PC)
72{
73 return new TopOpeBRepDS_SurfaceCurveInterference
74 (Transition,
75 TopOpeBRepDS_FACE,FaceI,
76 TopOpeBRepDS_CURVE,CurveI,
77 PC);
78}
79
80
81//=======================================================================
82//function : MakeSolidSurfaceInterference
83//purpose :
84//=======================================================================
85Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeSolidSurfaceInterference
86(const TopOpeBRepDS_Transition& Transition,const Standard_Integer SolidI,const Standard_Integer SurfaceI)
87{
88 return new TopOpeBRepDS_SolidSurfaceInterference
89 (Transition,
90 TopOpeBRepDS_SOLID,SolidI,
91 TopOpeBRepDS_SURFACE,SurfaceI);
92}
93
94
95//=======================================================================
96//function : MakeEdgeVertexInterference
97//purpose :
98//=======================================================================
99Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeEdgeVertexInterference
100(const TopOpeBRepDS_Transition& Transition,
101 const Standard_Integer EdgeI,
102 const Standard_Integer VertexI,
103 const Standard_Boolean VertexIsBound,
104 const TopOpeBRepDS_Config C,
105 const Standard_Real param)
106{
107 // soit I l'EVI creee :
108 return new TopOpeBRepDS_EdgeVertexInterference
109 (Transition, // transition en cheminant sur l'arete accedante a I
110 EdgeI, // arete croisee par l'arete accedante, en V
111 VertexI, // vertex geometrie de I
112 VertexIsBound, // vertex est il un sommet de l'arete accedante de I
113 C, // orient. relative des aretes accedante et croisee.
114 param); // parametre de V sur arete accedante de I
115}
116
117//=======================================================================
118//function : MakeFaceEdgeInterference
119//purpose :
120//=======================================================================
121Handle(TopOpeBRepDS_Interference) TopOpeBRepDS_InterferenceTool::MakeFaceEdgeInterference
122(const TopOpeBRepDS_Transition& Transition,
123 const Standard_Integer FaceI,
124 const Standard_Integer EdgeI,
125 const Standard_Boolean EdgeIsBound,
126 const TopOpeBRepDS_Config C)
127{
128 return new TopOpeBRepDS_FaceEdgeInterference
129 (Transition,
130 FaceI,
131 EdgeI,
132 EdgeIsBound,
133 C);
134}
135
136//=======================================================================
137//function : Parameter
138//purpose : only on I = CurvePointInterference
139//=======================================================================
140Standard_Real TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I)
141{
c5f3a425 142 return Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter();
7fd59977 143}
144
145//=======================================================================
146//function : Parameter
147//purpose : only on I = CurvePointInterference
148//=======================================================================
149void TopOpeBRepDS_InterferenceTool::Parameter(const Handle(TopOpeBRepDS_Interference)& I,const Standard_Real Par)
150{
c5f3a425 151 Handle(TopOpeBRepDS_CurvePointInterference)::DownCast (I)->Parameter(Par);
7fd59977 152}