1 // Created on: 1992-05-06
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-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 <Adaptor2d_HCurve2d.hxx>
19 #include <Adaptor3d_HVertex.hxx>
21 #include <IntPatch_Point.hxx>
22 #include <IntSurf_PntOn2S.hxx>
23 #include <IntSurf_Transition.hxx>
24 #include <Standard_DomainError.hxx>
27 void IntPatch_Point::SetValue (const gp_Pnt& Pt,
28 const Standard_Real Tol,
29 const Standard_Boolean Tangent)
31 onS1 = Standard_False;
32 onS2 = Standard_False;
33 vtxonS1 = Standard_False;
34 vtxonS2 = Standard_False;
35 mult = Standard_False;
41 void IntPatch_Point::SetVertex(const Standard_Boolean OnFirst, const Handle(Adaptor3d_HVertex)& V)
45 vtxonS1 = Standard_True;
50 vtxonS2 = Standard_True;
55 void IntPatch_Point::SetArc (const Standard_Boolean OnFirst,
56 const Handle(Adaptor2d_HCurve2d)& A,
57 const Standard_Real Param,
58 const IntSurf_Transition& TLine,
59 const IntSurf_Transition& TArc)
77 void IntPatch_Point::ReverseTransition()
81 IntSurf_Transition TLine;
82 switch (traline1.TransitionType())
84 case IntSurf_In: TLine.SetValue(Standard_False,IntSurf_Out); break;
85 case IntSurf_Out: TLine.SetValue(Standard_False,IntSurf_In); break;
90 IntSurf_Transition TArc;
91 switch (tra1.TransitionType())
93 case IntSurf_In: TArc.SetValue(Standard_False,IntSurf_Out); break;
94 case IntSurf_Out: TArc.SetValue(Standard_False,IntSurf_In); break;
102 IntSurf_Transition TLine;
103 switch (traline2.TransitionType())
105 case IntSurf_In: TLine.SetValue(Standard_False,IntSurf_Out); break;
106 case IntSurf_Out: TLine.SetValue(Standard_False,IntSurf_In); break;
111 IntSurf_Transition TArc;
112 switch (tra2.TransitionType())
114 case IntSurf_In: TArc.SetValue(Standard_False,IntSurf_Out); break;
115 case IntSurf_Out: TArc.SetValue(Standard_False,IntSurf_In); break;
124 #include <IntSurf_Situation.hxx>
125 #include <IntSurf_Transition.hxx>
126 #include <IntSurf_TypeTrans.hxx>
128 static void DumpTransition(const IntSurf_Transition& T)
130 IntSurf_TypeTrans typetrans = T.TransitionType();
131 if(typetrans == IntSurf_In) cout<<" In ";
132 else if(typetrans == IntSurf_Out) cout<<" Out ";
133 else if(typetrans == IntSurf_Undecided) cout<<" Und.";
134 else if(typetrans == IntSurf_Touch) {
136 if(T.Situation() == IntSurf_Inside) cout<<" Inside ";
137 else if(T.Situation() == IntSurf_Outside) cout<<" Outside";
138 else cout<<" Unknown";
139 if(T.IsOpposite()) cout<<" Opposite ";
140 else cout<<" Non_Opposite ";
143 if(typetrans != IntSurf_Undecided) {
144 if(T.IsTangent()) cout<<" Tangent ";
145 else cout<<" Non_Tangent";
149 #include <Standard_Transient.hxx>
151 void IntPatch_Point::Dump() const {
152 cout<<"----------- IntPatch_Point : "<<endl;
153 Standard_Real u1,v1,u2,v2;
154 pt.Parameters(u1,v1,u2,v2);
156 printf("P(%+10.20f,%+10.20f,%+10.20f) UV1(%+10.20f,%+10.20f) UV2(%+10.20f,%+10.20f) (Para:%+10.20f)\n",
157 (double)(pt.Value().X()),
158 (double)(pt.Value().Y()),
159 (double)(pt.Value().Z()),
160 (double)u1,(double)v1,(double)u2,(double)v2,(double)para);
162 printf("*OnS1* par=%+10.20f arc1=%10p", (double)prm1, (void*)arcS1.operator->());
164 printf(" *Vtx1* vtx1=%10p", (void*)vS1.operator->());
165 if(onS1 || vtxonS1) printf("\n");
167 printf("*OnS2* par=%+10.20f arc2=%10p", (double)prm2, (void*)arcS2.operator->());
169 printf(" *Vtx2* vtx2=%10p", (void*)vS2.operator->());
176 cout<<" tgt:"<<((tgt)? 1 : 0) <<" mult:"<<((mult)? 1 :0);
178 cout<<"\n-traline1 : "; DumpTransition(traline1);
179 cout<<" -tra1 : "; DumpTransition(tra1);
182 cout<<"\n-traline2 : "; DumpTransition(traline2);
183 cout<<" -tra2 : "; DumpTransition(tra2);
187 cout << "\nToler = " << Tolerance();