summaryrefslogtreecommitdiff
path: root/src/GeomPlate/GeomPlate_Surface.cxx
blob: f40716a1f8422e1b73e6f12555f71bc04f2462eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
// File:	GeomPlate_Surface.cxx
// Created:	Thu Nov 21 13:47:59 1996
// Author:	Joelle CHAUVET
//		<jct@sgi38>
// Modified:	Wed Mar  5 09:45:42 1997
//    by:	Joelle CHAUVET
//              G1134 : new methods RealBounds and Constraints
// Modified:	Mon Jun 16 15:22:41 1997
//    by:	Jerome LEMONIER
//              Correction de la methode D2 (faute de frappe dans le code)
//              Correction de la methode D1 (D0 inutile)
 

#include <GeomPlate_Surface.ixx>
#include <gp_XY.hxx>


//=======================================================================
//function : GeomPlate_Surface
//purpose  : 
//=======================================================================

GeomPlate_Surface::GeomPlate_Surface(const Handle(Geom_Surface)& Surfinit,const Plate_Plate& Surfinter) : mySurfinter(Surfinter),mySurfinit(Surfinit)
{
}

//=======================================================================
//function : UReverse
//purpose  : 
//=======================================================================

void GeomPlate_Surface::UReverse()
{
 //Standard_Failure::Raise("UReverse"); 
}


//=======================================================================
//function : UReversedParameter
//purpose  : 
//=======================================================================

Standard_Real GeomPlate_Surface::UReversedParameter(const Standard_Real U) const 
{ //Standard_Failure::Raise("UReversedParameter"); 
  return (-U);
}


//=======================================================================
//function : VReverse
//purpose  : 
//=======================================================================

void GeomPlate_Surface::VReverse()
{ //Standard_Failure::Raise("VReverse");
}


//=======================================================================
//function : VReversedParameter
//purpose  : 
//=======================================================================

Standard_Real GeomPlate_Surface::VReversedParameter(const Standard_Real V) const 
{ //Standard_Failure::Raise("VReversedParameter");
  return (-V);
}


//=======================================================================
//function : TransformParameters
//purpose  : 
//=======================================================================

//void GeomPlate_Surface::TransformParameters(Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const 
void GeomPlate_Surface::TransformParameters(Standard_Real& , Standard_Real& , const gp_Trsf& ) const 
{//Standard_Failure::Raise("TransformParameters");
}


//=======================================================================
//function : ParametricTransformation
//purpose  : 
//=======================================================================

//gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& T) const 
gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& ) const 
{//Standard_Failure::Raise("ParametricTransformation");
  return gp_GTrsf2d();
}


//=======================================================================
//function : Bounds
//purpose  : 
//=======================================================================

void GeomPlate_Surface::Bounds(Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const 
{
  if (mySurfinit->DynamicType() == STANDARD_TYPE(GeomPlate_Surface))
    mySurfinit->Bounds(U1,U2,V1,V2);
  else
    {U1=myUmin;U2=myUmax;V1=myVmin;V2=myVmax;}
}


//=======================================================================
//function : IsUClosed
//purpose  : 
//=======================================================================

Standard_Boolean GeomPlate_Surface::IsUClosed() const 
{ //Standard_Failure::Raise("IsUClosed(");
  //return 1;
  return 0;
}


//=======================================================================
//function : IsVClosed
//purpose  : 
//=======================================================================

Standard_Boolean GeomPlate_Surface::IsVClosed() const 
{ //Standard_Failure::Raise("IsVClosed(");
  //return 1;
  return 0;
}


//=======================================================================
//function : IsUPeriodic
//purpose  : 
//=======================================================================

Standard_Boolean GeomPlate_Surface::IsUPeriodic() const 
{
  return Standard_False;
}


//=======================================================================
//function : UPeriod
//purpose  : 
//=======================================================================

Standard_Real GeomPlate_Surface::UPeriod() const 
{ 
 return Standard_False;
}


//=======================================================================
//function : IsVPeriodic
//purpose  : 
//=======================================================================

Standard_Boolean GeomPlate_Surface::IsVPeriodic() const 
{
  return  Standard_False;
}


//=======================================================================
//function : VPeriod
//purpose  : 
//=======================================================================

Standard_Real GeomPlate_Surface::VPeriod() const 
{ 
  return Standard_False;
}


//=======================================================================
//function : UIso
//purpose  : 
//=======================================================================

//Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real U) const 
Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real ) const 
{ //Standard_Failure::Raise("UIso");
  return Handle(Geom_Curve)();
}


//=======================================================================
//function : VIso
//purpose  : 
//=======================================================================

//Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real V) const 
Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real ) const 
{ //Standard_Failure::Raise("VIso");
  return Handle(Geom_Curve)();
}


//=======================================================================
//function : Continuity
//purpose  : 
//=======================================================================

GeomAbs_Shape GeomPlate_Surface::Continuity() const 
{ //Standard_Failure::Raise("Continuity()");
  return GeomAbs_Shape();

}


//=======================================================================
//function : IsCNu
//purpose  : 
//=======================================================================

//Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer N) const 
Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer ) const 
{ Standard_Failure::Raise("IsCNu");
  return 1;
}


//=======================================================================
//function : IsCNv
//purpose  : 
//=======================================================================

//Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer N) const 
Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer ) const 
{ Standard_Failure::Raise("IsCNv");
 return 1;
}


//=======================================================================
//function : D0
//purpose  : 
//=======================================================================

void GeomPlate_Surface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const 
{
  gp_XY P1(U,V);
  gp_Pnt P2;
  mySurfinit->D0(U,V,P2);
  gp_XYZ P3;//=mySurfinter.Evaluate(P1);
 P3=mySurfinter.Evaluate(P1);
 for (Standard_Integer i=1; i<=3; i++)
    {
      P.SetCoord(i,P3.Coord(i)+P2.Coord(i));
    }
}


//=======================================================================
//function : D1
//purpose  : 
//=======================================================================

void GeomPlate_Surface::D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const 
{
  gp_XY P1(U,V);
  gp_Pnt P2;
  D0(U,V,P);
  gp_Vec V1U,V1V;
  mySurfinit->D1(U,V,P2,V1U,V1V);
  gp_XYZ V2U=mySurfinter.EvaluateDerivative(P1,1,0);
  gp_XYZ V2V=mySurfinter.EvaluateDerivative(P1,0,1);
  for (Standard_Integer i=1; i<=3; i++)
    {
      D1U.SetCoord(i,V1U.Coord(i)+V2U.Coord(i));
      D1V.SetCoord(i,V1V.Coord(i)+V2V.Coord(i));
    }
}


//=======================================================================
//function : D2
//purpose  : 
//=======================================================================

void 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 
{
  gp_XY P1(U,V);
  gp_Pnt P2;
  
  gp_Vec V1U,V1V,V1UV,vv,v;
  D1(U,V,P,D1U,D1V);
  mySurfinit->D2(U,V,P2,vv,v,V1U,V1V,V1UV);
  gp_XYZ V2U=mySurfinter.EvaluateDerivative(P1,2,0);
  gp_XYZ V2V=mySurfinter.EvaluateDerivative(P1,0,2);
  gp_XYZ V2UV=mySurfinter.EvaluateDerivative(P1,1,1);
  for (Standard_Integer i=1; i<=3; i++)
    {
      D2U.SetCoord(i,V1U.Coord(i)+V2U.Coord(i));
      D2V.SetCoord(i,V1V.Coord(i)+V2V.Coord(i));
      D2UV.SetCoord(i,V1UV.Coord(i)+V2UV.Coord(i));
    }
}


//=======================================================================
//function : D3
//purpose  : 
//=======================================================================

//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 
void 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 
{ Standard_Failure::Raise("D3");
}


//=======================================================================
//function : DN
//purpose  : 
//=======================================================================

//gp_Vec GeomPlate_Surface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const 
gp_Vec GeomPlate_Surface::DN(const Standard_Real , const Standard_Real , const Standard_Integer , const Standard_Integer ) const 
{ Standard_Failure::Raise("DN");
  return gp_Vec();
}


//=======================================================================
//function : Copy
//purpose  : 
//=======================================================================

Handle(Geom_Geometry) GeomPlate_Surface::Copy() const 
{
  Handle(GeomPlate_Surface) GPS 
    = new  GeomPlate_Surface(mySurfinit,mySurfinter);
  return GPS;
}


//=======================================================================
//function : Transform
//purpose  : 
//=======================================================================

//void GeomPlate_Surface::Transform(const gp_Trsf& T)
void GeomPlate_Surface::Transform(const gp_Trsf& )
{ //Standard_Failure::Raise("Transform");
}

//=======================================================================
//function : CallSurfinit
//purpose  : 
//=======================================================================

Handle(Geom_Surface) GeomPlate_Surface::CallSurfinit() const

{
  return mySurfinit;
}


//=======================================================================
//function : SetBounds
//purpose  : 
//=======================================================================

void GeomPlate_Surface::SetBounds(const Standard_Real Umin, const Standard_Real Umax, const Standard_Real Vmin, const Standard_Real Vmax)
{
  if ((Umin>Umax) || (Vmin>Vmax)) Standard_Failure::Raise("Bounds haven't the good sense");
  else
    myUmin=Umin;myUmax=Umax;myVmin=Vmin;myVmax=Vmax;
  if ((Umin==Umax) || (Vmin==Vmax)) Standard_Failure::Raise("Bounds are equal");

}


//=======================================================================
//function : RealBounds
//purpose  : 
//=======================================================================

void GeomPlate_Surface::RealBounds(Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const 
{
  mySurfinter.UVBox(U1,U2,V1,V2);
}


//=======================================================================
//function : Constraints
//purpose  : 
//=======================================================================

void GeomPlate_Surface::Constraints(TColgp_SequenceOfXY& Seq) const 
{
  mySurfinter.UVConstraints(Seq);
}