0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / GeomPlate / GeomPlate_Surface.cxx
... / ...
CommitLineData
1// Created on: 1996-11-21
2// Created by: Joelle CHAUVET
3// Copyright (c) 1996-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17// Modified: Wed Mar 5 09:45:42 1997
18// by: Joelle CHAUVET
19// G1134 : new methods RealBounds and Constraints
20// Modified: Mon Jun 16 15:22:41 1997
21// by: Jerome LEMONIER
22// Correction de la methode D2 (faute de frappe dans le code)
23// Correction de la methode D1 (D0 inutile)
24
25#include <Geom_Curve.hxx>
26#include <Geom_Geometry.hxx>
27#include <Geom_Surface.hxx>
28#include <Geom_UndefinedDerivative.hxx>
29#include <Geom_UndefinedValue.hxx>
30#include <GeomPlate_Surface.hxx>
31#include <gp_GTrsf2d.hxx>
32#include <gp_Pnt.hxx>
33#include <gp_Trsf.hxx>
34#include <gp_Vec.hxx>
35#include <gp_XY.hxx>
36#include <Plate_Plate.hxx>
37#include <Standard_NoSuchObject.hxx>
38#include <Standard_RangeError.hxx>
39#include <Standard_Type.hxx>
40
41IMPLEMENT_STANDARD_RTTIEXT(GeomPlate_Surface,Geom_Surface)
42
43//=======================================================================
44//function : GeomPlate_Surface
45//purpose :
46//=======================================================================
47GeomPlate_Surface::GeomPlate_Surface(const Handle(Geom_Surface)& Surfinit,const Plate_Plate& Surfinter) : mySurfinter(Surfinter),mySurfinit(Surfinit)
48{
49}
50
51//=======================================================================
52//function : UReverse
53//purpose :
54//=======================================================================
55
56void GeomPlate_Surface::UReverse()
57{
58 //Standard_Failure::Raise("UReverse");
59}
60
61
62//=======================================================================
63//function : UReversedParameter
64//purpose :
65//=======================================================================
66
67Standard_Real GeomPlate_Surface::UReversedParameter(const Standard_Real U) const
68{ //Standard_Failure::Raise("UReversedParameter");
69 return (-U);
70}
71
72
73//=======================================================================
74//function : VReverse
75//purpose :
76//=======================================================================
77
78void GeomPlate_Surface::VReverse()
79{ //Standard_Failure::Raise("VReverse");
80}
81
82
83//=======================================================================
84//function : VReversedParameter
85//purpose :
86//=======================================================================
87
88Standard_Real GeomPlate_Surface::VReversedParameter(const Standard_Real V) const
89{ //Standard_Failure::Raise("VReversedParameter");
90 return (-V);
91}
92
93
94//=======================================================================
95//function : TransformParameters
96//purpose :
97//=======================================================================
98
99//void GeomPlate_Surface::TransformParameters(Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const
100void GeomPlate_Surface::TransformParameters(Standard_Real& , Standard_Real& , const gp_Trsf& ) const
101{//Standard_Failure::Raise("TransformParameters");
102}
103
104
105//=======================================================================
106//function : ParametricTransformation
107//purpose :
108//=======================================================================
109
110//gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& T) const
111gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& ) const
112{//Standard_Failure::Raise("ParametricTransformation");
113 return gp_GTrsf2d();
114}
115
116
117//=======================================================================
118//function : Bounds
119//purpose :
120//=======================================================================
121
122void GeomPlate_Surface::Bounds(Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const
123{
124 if (mySurfinit->DynamicType() == STANDARD_TYPE(GeomPlate_Surface))
125 mySurfinit->Bounds(U1,U2,V1,V2);
126 else
127 {U1=myUmin;U2=myUmax;V1=myVmin;V2=myVmax;}
128}
129
130
131//=======================================================================
132//function : IsUClosed
133//purpose :
134//=======================================================================
135
136Standard_Boolean GeomPlate_Surface::IsUClosed() const
137{ //Standard_Failure::Raise("IsUClosed(");
138 //return 1;
139 return 0;
140}
141
142
143//=======================================================================
144//function : IsVClosed
145//purpose :
146//=======================================================================
147
148Standard_Boolean GeomPlate_Surface::IsVClosed() const
149{ //Standard_Failure::Raise("IsVClosed(");
150 //return 1;
151 return 0;
152}
153
154
155//=======================================================================
156//function : IsUPeriodic
157//purpose :
158//=======================================================================
159
160Standard_Boolean GeomPlate_Surface::IsUPeriodic() const
161{
162 return Standard_False;
163}
164
165
166//=======================================================================
167//function : UPeriod
168//purpose :
169//=======================================================================
170
171Standard_Real GeomPlate_Surface::UPeriod() const
172{
173 return Standard_False;
174}
175
176
177//=======================================================================
178//function : IsVPeriodic
179//purpose :
180//=======================================================================
181
182Standard_Boolean GeomPlate_Surface::IsVPeriodic() const
183{
184 return Standard_False;
185}
186
187
188//=======================================================================
189//function : VPeriod
190//purpose :
191//=======================================================================
192
193Standard_Real GeomPlate_Surface::VPeriod() const
194{
195 return Standard_False;
196}
197
198
199//=======================================================================
200//function : UIso
201//purpose :
202//=======================================================================
203
204//Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real U) const
205Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real ) const
206{ //Standard_Failure::Raise("UIso");
207 return Handle(Geom_Curve)();
208}
209
210
211//=======================================================================
212//function : VIso
213//purpose :
214//=======================================================================
215
216//Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real V) const
217Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real ) const
218{ //Standard_Failure::Raise("VIso");
219 return Handle(Geom_Curve)();
220}
221
222
223//=======================================================================
224//function : Continuity
225//purpose :
226//=======================================================================
227
228GeomAbs_Shape GeomPlate_Surface::Continuity() const
229{ //Standard_Failure::Raise("Continuity()");
230 return GeomAbs_Shape();
231
232}
233
234
235//=======================================================================
236//function : IsCNu
237//purpose :
238//=======================================================================
239
240//Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer N) const
241Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer ) const
242{ Standard_Failure::Raise("IsCNu");
243 return 1;
244}
245
246
247//=======================================================================
248//function : IsCNv
249//purpose :
250//=======================================================================
251
252//Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer N) const
253Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer ) const
254{ Standard_Failure::Raise("IsCNv");
255 return 1;
256}
257
258
259//=======================================================================
260//function : D0
261//purpose :
262//=======================================================================
263
264void GeomPlate_Surface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const
265{
266 gp_XY P1(U,V);
267 gp_Pnt P2;
268 mySurfinit->D0(U,V,P2);
269 gp_XYZ P3;//=mySurfinter.Evaluate(P1);
270 P3=mySurfinter.Evaluate(P1);
271 for (Standard_Integer i=1; i<=3; i++)
272 {
273 P.SetCoord(i,P3.Coord(i)+P2.Coord(i));
274 }
275}
276
277
278//=======================================================================
279//function : D1
280//purpose :
281//=======================================================================
282
283void GeomPlate_Surface::D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const
284{
285 gp_XY P1(U,V);
286 gp_Pnt P2;
287 D0(U,V,P);
288 gp_Vec V1U,V1V;
289 mySurfinit->D1(U,V,P2,V1U,V1V);
290 gp_XYZ V2U=mySurfinter.EvaluateDerivative(P1,1,0);
291 gp_XYZ V2V=mySurfinter.EvaluateDerivative(P1,0,1);
292 for (Standard_Integer i=1; i<=3; i++)
293 {
294 D1U.SetCoord(i,V1U.Coord(i)+V2U.Coord(i));
295 D1V.SetCoord(i,V1V.Coord(i)+V2V.Coord(i));
296 }
297}
298
299
300//=======================================================================
301//function : D2
302//purpose :
303//=======================================================================
304
305void GeomPlate_Surface::D2(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const
306{
307 gp_XY P1(U,V);
308 gp_Pnt P2;
309
310 gp_Vec V1U,V1V,V1UV,vv,v;
311 D1(U,V,P,D1U,D1V);
312 mySurfinit->D2(U,V,P2,vv,v,V1U,V1V,V1UV);
313 gp_XYZ V2U=mySurfinter.EvaluateDerivative(P1,2,0);
314 gp_XYZ V2V=mySurfinter.EvaluateDerivative(P1,0,2);
315 gp_XYZ V2UV=mySurfinter.EvaluateDerivative(P1,1,1);
316 for (Standard_Integer i=1; i<=3; i++)
317 {
318 D2U.SetCoord(i,V1U.Coord(i)+V2U.Coord(i));
319 D2V.SetCoord(i,V1V.Coord(i)+V2V.Coord(i));
320 D2UV.SetCoord(i,V1UV.Coord(i)+V2UV.Coord(i));
321 }
322}
323
324
325//=======================================================================
326//function : D3
327//purpose :
328//=======================================================================
329
330//void GeomPlate_Surface::D3(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const
331void GeomPlate_Surface::D3(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& ) const
332{ Standard_Failure::Raise("D3");
333}
334
335
336//=======================================================================
337//function : DN
338//purpose :
339//=======================================================================
340
341//gp_Vec GeomPlate_Surface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const
342gp_Vec GeomPlate_Surface::DN(const Standard_Real , const Standard_Real , const Standard_Integer , const Standard_Integer ) const
343{ Standard_Failure::Raise("DN");
344 return gp_Vec();
345}
346
347
348//=======================================================================
349//function : Copy
350//purpose :
351//=======================================================================
352
353Handle(Geom_Geometry) GeomPlate_Surface::Copy() const
354{
355 Handle(GeomPlate_Surface) GPS
356 = new GeomPlate_Surface(mySurfinit,mySurfinter);
357 return GPS;
358}
359
360
361//=======================================================================
362//function : Transform
363//purpose :
364//=======================================================================
365
366//void GeomPlate_Surface::Transform(const gp_Trsf& T)
367void GeomPlate_Surface::Transform(const gp_Trsf& )
368{ //Standard_Failure::Raise("Transform");
369}
370
371//=======================================================================
372//function : CallSurfinit
373//purpose :
374//=======================================================================
375
376Handle(Geom_Surface) GeomPlate_Surface::CallSurfinit() const
377
378{
379 return mySurfinit;
380}
381
382
383//=======================================================================
384//function : SetBounds
385//purpose :
386//=======================================================================
387
388void GeomPlate_Surface::SetBounds(const Standard_Real Umin, const Standard_Real Umax, const Standard_Real Vmin, const Standard_Real Vmax)
389{
390 if ((Umin>Umax) || (Vmin>Vmax)) Standard_Failure::Raise("Bounds haven't the good sense");
391 if ((Umin==Umax) || (Vmin==Vmax)) Standard_Failure::Raise("Bounds are equal");
392 myUmin=Umin;myUmax=Umax;myVmin=Vmin;myVmax=Vmax;
393}
394
395
396//=======================================================================
397//function : RealBounds
398//purpose :
399//=======================================================================
400
401void GeomPlate_Surface::RealBounds(Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const
402{
403 mySurfinter.UVBox(U1,U2,V1,V2);
404}
405
406
407//=======================================================================
408//function : Constraints
409//purpose :
410//=======================================================================
411
412void GeomPlate_Surface::Constraints(TColgp_SequenceOfXY& Seq) const
413{
414 mySurfinter.UVConstraints(Seq);
415}