85f96dcc4fa54a5804f9c15099b854c28ce421bf
[occt.git] / src / BRepBlend / BRepBlend_Extremity.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15
16 #include <Adaptor2d_HCurve2d.hxx>
17 #include <Adaptor3d_HVertex.hxx>
18 #include <BRepBlend_Extremity.hxx>
19 #include <BRepBlend_PointOnRst.hxx>
20 #include <gp_Pnt.hxx>
21 #include <gp_Vec.hxx>
22 #include <IntSurf_Transition.hxx>
23 #include <Standard_DomainError.hxx>
24 #include <Standard_OutOfRange.hxx>
25
26 BRepBlend_Extremity::BRepBlend_Extremity (): 
27        pt(gp_Pnt(0,0,0)),
28        tang(gp_Vec(0,0,0)),
29        param(0.0),  u(0.0), v(0.0), tol(0.0),
30        isvtx(Standard_False), hastang(Standard_False)
31 {
32 }
33
34 BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
35                                   const Standard_Real U,
36                                   const Standard_Real V,
37                                   const Standard_Real Param,
38                                   const Standard_Real Tol) :
39        pt(P),
40        tang(gp_Vec(0,0,0)),
41        param(Param),u(U),v(V),tol(Tol),isvtx(Standard_False),
42        hastang(Standard_False)
43 {
44 }
45
46
47 BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
48                                   const Standard_Real U,
49                                   const Standard_Real V,
50                                   const Standard_Real Param,
51                                   const Standard_Real Tol,
52                                   const Handle(Adaptor3d_HVertex)& Vtx) :
53        vtx(Vtx),pt(P),
54        tang(gp_Vec(0,0,0)),
55        param(Param),u(U),v(V),tol(Tol),isvtx(Standard_True),
56        hastang(Standard_False)
57 {}
58
59
60 BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
61                                   const Standard_Real W,
62                                   const Standard_Real Param,
63                                   const Standard_Real Tol) :
64        pt(P),
65        tang(gp_Vec(0,0,0)),
66        param(Param),u(W),tol(Tol),isvtx(Standard_False),
67        hastang(Standard_False)
68 {}
69
70
71 void BRepBlend_Extremity::SetValue (const gp_Pnt& P,
72                                 const Standard_Real U,
73                                 const Standard_Real V,
74                                 const Standard_Real Param,
75                                 const Standard_Real Tol)
76 {
77   pt    = P;
78   u     = U;
79   v     = V;
80   param = Param;
81   tol   = Tol;
82   isvtx = Standard_False;
83   seqpt.Clear();
84 }
85
86
87 void BRepBlend_Extremity::SetValue (const gp_Pnt& P,
88                                 const Standard_Real U,
89                                 const Standard_Real V,
90                                 const Standard_Real Param,
91                                 const Standard_Real Tol,
92                                 const Handle(Adaptor3d_HVertex)& Vtx)
93 {
94   pt    = P;
95   u     = U;
96   v     = V;
97   param = Param;
98   tol   = Tol;
99   isvtx = Standard_True;
100   vtx   = Vtx;
101   seqpt.Clear();
102 }
103
104 void BRepBlend_Extremity::SetValue (const gp_Pnt& P,
105                                 const Standard_Real W,
106                                 const Standard_Real Param,
107                                 const Standard_Real Tol)
108 {
109   pt    = P;
110   u     = W;
111   param = Param;
112   tol   = Tol;
113   isvtx = Standard_False;
114   seqpt.Clear();
115 }
116
117
118 void BRepBlend_Extremity::SetVertex (const Handle(Adaptor3d_HVertex)& V)
119 {
120   isvtx = Standard_True;
121   vtx   = V;
122 }
123
124 void BRepBlend_Extremity::AddArc (const Handle(Adaptor2d_HCurve2d)& A,
125                               const Standard_Real Param,
126                               const IntSurf_Transition& TLine,
127                               const IntSurf_Transition& TArc)
128 {
129   seqpt.Append(BRepBlend_PointOnRst(A,Param,TLine,TArc));
130 }
131