1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : GEOM_IAdvancedOperations.cc
21 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
23 #include <Standard_Stream.hxx>
25 #include "AdvancedEngine_IOperations_i.hh"
26 #include "AdvancedEngine_IOperations.hxx"
28 #include <utilities.h>
30 #include <Utils_ExceptHandlers.hxx>
32 #include "GEOM_Engine.hxx"
33 #include "GEOM_Object.hxx"
35 //=============================================================================
39 //=============================================================================
40 AdvancedEngine_IOperations_i::AdvancedEngine_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, AdvancedEngine_IOperations* theImpl)
41 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
43 MESSAGE("AdvancedEngine_IOperations_i::AdvancedEngine_IOperations_i");
46 //=============================================================================
50 //=============================================================================
51 AdvancedEngine_IOperations_i::~AdvancedEngine_IOperations_i()
53 MESSAGE("AdvancedEngine_IOperations_i::~AdvancedEngine_IOperations_i");
56 //=============================================================================
59 * Create a T-shape object with specified caracteristics for the main and
60 * the incident pipes (radius, width, half-length).
61 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
62 * \param theR1 Internal radius of main pipe
63 * \param theW1 Width of main pipe
64 * \param theL1 Half-length of main pipe
65 * \param theR2 Internal radius of incident pipe (R2 < R1)
66 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
67 * \param theL2 Half-length of incident pipe
68 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
69 * \return List of GEOM_Objects, containing the created shape and propagation groups.
71 //=============================================================================
72 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShape
73 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
74 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
75 CORBA::Boolean theHexMesh)
77 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
80 GetOperations()->SetNotDone();
83 Handle(TColStd_HSequenceOfTransient) aHSeq =
84 GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
85 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
87 if (!GetOperations()->IsDone() || aHSeq.IsNull())
90 Standard_Integer aLength = aHSeq->Length();
91 aSeq->length(aLength);
92 for (Standard_Integer i = 1; i <= aLength; i++)
93 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
98 //=============================================================================
100 * MakePipeTShapeWithPosition
101 * Create a T-shape object with specified caracteristics for the main and
102 * the incident pipes (radius, width, half-length).
103 * The extremities of the main pipe are located on junctions points P1 and P2.
104 * The extremity of the incident pipe is located on junction point P3.
105 * \param theR1 Internal radius of main pipe
106 * \param theW1 Width of main pipe
107 * \param theL1 Half-length of main pipe
108 * \param theR2 Internal radius of incident pipe (R2 < R1)
109 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
110 * \param theL2 Half-length of incident pipe
111 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
112 * \param theP1 1st junction point of main pipe
113 * \param theP2 2nd junction point of main pipe
114 * \param theP3 Junction point of incident pipe
115 * \return List of GEOM_Objects, containing the created shape and propagation groups.
117 //=============================================================================
118 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeWithPosition
119 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
120 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
121 CORBA::Boolean theHexMesh,
122 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
124 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
126 //Set a not done flag
127 GetOperations()->SetNotDone();
129 //Get the reference vertices
130 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
131 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
132 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
133 if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull())return aSeq._retn();
136 Handle(TColStd_HSequenceOfTransient) aHSeq =
137 GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
138 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
139 theHexMesh, aP1, aP2, aP3);
140 if (!GetOperations()->IsDone() || aHSeq.IsNull())
143 Standard_Integer aLength = aHSeq->Length();
144 aSeq->length(aLength);
145 for (Standard_Integer i = 1; i <= aLength; i++)
146 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
151 //=============================================================================
153 * MakePipeTShapeChamfer
154 * Create a T-shape object with specified caracteristics for the main and
155 * the incident pipes (radius, width, half-length). A chamfer is created
156 * on the junction of the pipes.
157 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
158 * \param theR1 Internal radius of main pipe
159 * \param theW1 Width of main pipe
160 * \param theL1 Half-length of main pipe
161 * \param theR2 Internal radius of incident pipe (R2 < R1)
162 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
163 * \param theL2 Half-length of incident pipe
164 * \param theH Height of chamfer.
165 * \param theW Width of chamfer.
166 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
167 * \return List of GEOM_Objects, containing the created shape and propagation groups.
169 //=============================================================================
170 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeChamfer
171 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
172 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
173 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
175 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
177 //Set a not done flag
178 GetOperations()->SetNotDone();
181 Handle(TColStd_HSequenceOfTransient) aHSeq =
182 GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
183 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
184 theH, theW, theHexMesh);
185 if (!GetOperations()->IsDone() || aHSeq.IsNull())
188 Standard_Integer aLength = aHSeq->Length();
189 aSeq->length(aLength);
190 for (Standard_Integer i = 1; i <= aLength; i++)
191 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
196 //=============================================================================
198 * MakePipeTShapeChamferWithPosition
199 * Create a T-shape object with specified caracteristics for the main and
200 * the incident pipes (radius, width, half-length). A chamfer is created
201 * on the junction of the pipes.
202 * The extremities of the main pipe are located on junctions points P1 and P2.
203 * The extremity of the incident pipe is located on junction point P3.
204 * \param theR1 Internal radius of main pipe
205 * \param theW1 Width of main pipe
206 * \param theL1 Half-length of main pipe
207 * \param theR2 Internal radius of incident pipe (R2 < R1)
208 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
209 * \param theL2 Half-length of incident pipe
210 * \param theH Height of the chamfer.
211 * \param theW Width of the chamfer.
212 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
213 * \param theP1 1st junction point of main pipe
214 * \param theP2 2nd junction point of main pipe
215 * \param theP3 Junction point of incident pipe
216 * \return List of GEOM_Objects, containing the created shape and propagation groups.
218 //=============================================================================
219 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeChamferWithPosition
220 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
221 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
222 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
223 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
225 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
227 //Set a not done flag
228 GetOperations()->SetNotDone();
230 //Get the reference vertices
231 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
232 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
233 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
236 Handle(TColStd_HSequenceOfTransient) aHSeq =
237 GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
238 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
239 theH, theW, theHexMesh, aP1, aP2, aP3);
240 if (!GetOperations()->IsDone() || aHSeq.IsNull())
243 Standard_Integer aLength = aHSeq->Length();
244 aSeq->length(aLength);
245 for (Standard_Integer i = 1; i <= aLength; i++)
246 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
251 //=============================================================================
253 * MakePipeTShapeFillet
254 * Create a T-shape object with specified caracteristics for the main and
255 * the incident pipes (radius, width, half-length). A fillet is created
256 * on the junction of the pipes.
257 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
258 * \param theR1 Internal radius of main pipe
259 * \param theW1 Width of main pipe
260 * \param theL1 Half-length of main pipe
261 * \param theR2 Internal radius of incident pipe (R2 < R1)
262 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
263 * \param theL2 Half-length of incident pipe
264 * \param theRF Radius of curvature of fillet.
265 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
266 * \return List of GEOM_Objects, containing the created shape and propagation groups.
268 //=============================================================================
269 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeFillet
270 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
271 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
272 CORBA::Double theRF, CORBA::Boolean theHexMesh)
274 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
276 //Set a not done flag
277 GetOperations()->SetNotDone();
280 Handle(TColStd_HSequenceOfTransient) aHSeq =
281 GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
282 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
284 if (!GetOperations()->IsDone() || aHSeq.IsNull())
287 Standard_Integer aLength = aHSeq->Length();
288 aSeq->length(aLength);
289 for (Standard_Integer i = 1; i <= aLength; i++)
290 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
295 //=============================================================================
297 * MakePipeTShapeFilletWithPosition
298 * Create a T-shape object with specified caracteristics for the main and
299 * the incident pipes (radius, width, half-length). A fillet is created
300 * on the junction of the pipes.
301 * The extremities of the main pipe are located on junctions points P1 and P2.
302 * The extremity of the incident pipe is located on junction point P3.
303 * \param theR1 Internal radius of main pipe
304 * \param theW1 Width of main pipe
305 * \param theL1 Half-length of main pipe
306 * \param theR2 Internal radius of incident pipe (R2 < R1)
307 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
308 * \param theL2 Half-length of incident pipe
309 * \param theRF Radius of curvature of fillet
310 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
311 * \param theP1 1st junction point of main pipe
312 * \param theP2 2nd junction point of main pipe
313 * \param theP3 Junction point of incident pipe
314 * \return List of GEOM_Objects, containing the created shape and propagation groups.
316 //=============================================================================
317 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeFilletWithPosition
318 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
319 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
320 CORBA::Double theRF, CORBA::Boolean theHexMesh,
321 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
323 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
325 //Set a not done flag
326 GetOperations()->SetNotDone();
328 //Get the reference vertices
329 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
330 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
331 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
334 Handle(TColStd_HSequenceOfTransient) aHSeq =
335 GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
336 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
337 theRF, theHexMesh, aP1, aP2, aP3);
338 if (!GetOperations()->IsDone() || aHSeq.IsNull())
341 Standard_Integer aLength = aHSeq->Length();
342 aSeq->length(aLength);
343 for (Standard_Integer i = 1; i <= aLength; i++)
344 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
349 //=============================================================================
352 * Create a T-shape object with specified caracteristics for the main and
353 * the incident pipes (radius, width, half-length).
354 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
355 * \param theR1 Internal radius of main pipe
356 * \param theW1 Width of main pipe
357 * \param theL1 Half-length of main pipe
358 * \param theR2 Internal radius of incident pipe (R2 < R1)
359 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
360 * \param theL2 Half-length of incident pipe
361 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
362 * \return List of GEOM_Objects, containing the created shape and propagation groups.
364 //=============================================================================
365 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTR
366 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
367 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
368 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
369 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
370 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
371 CORBA::Boolean theHexMesh)
373 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
375 //Set a not done flag
376 GetOperations()->SetNotDone();
379 Handle(TColStd_HSequenceOfTransient) aHSeq =
380 GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
381 theRL, theWL, theLtransL, theLthinL,
382 theRR, theWR, theLtransR, theLthinR,
383 theRI, theWI, theLtransI, theLthinI,
385 if (!GetOperations()->IsDone() || aHSeq.IsNull())
388 Standard_Integer aLength = aHSeq->Length();
389 aSeq->length(aLength);
390 for (Standard_Integer i = 1; i <= aLength; i++)
391 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
396 //=============================================================================
398 * MakePipeTShapeTRWithPosition
399 * Create a T-shape object with specified caracteristics for the main and
400 * the incident pipes (radius, width, half-length).
401 * The extremities of the main pipe are located on junctions points P1 and P2.
402 * The extremity of the incident pipe is located on junction point P3.
403 * \param theR1 Internal radius of main pipe
404 * \param theW1 Width of main pipe
405 * \param theL1 Half-length of main pipe
406 * \param theR2 Internal radius of incident pipe (R2 < R1)
407 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
408 * \param theL2 Half-length of incident pipe
409 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
410 * \param theP1 1st junction point of main pipe
411 * \param theP2 2nd junction point of main pipe
412 * \param theP3 Junction point of incident pipe
413 * \return List of GEOM_Objects, containing the created shape and propagation groups.
415 //=============================================================================
416 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRWithPosition
417 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
418 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
419 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
420 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
421 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
422 CORBA::Boolean theHexMesh,
423 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
425 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
427 //Set a not done flag
428 GetOperations()->SetNotDone();
430 //Get the reference vertices
431 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
432 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
433 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
434 if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull()) return aSeq._retn();
437 Handle(TColStd_HSequenceOfTransient) aHSeq =
438 GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
439 theRL, theWL, theLtransL, theLthinL,
440 theRR, theWR, theLtransR, theLthinR,
441 theRI, theWI, theLtransI, theLthinI,
442 theHexMesh, aP1, aP2, aP3);
443 if (!GetOperations()->IsDone() || aHSeq.IsNull())
446 Standard_Integer aLength = aHSeq->Length();
447 aSeq->length(aLength);
448 for (Standard_Integer i = 1; i <= aLength; i++)
449 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
454 //=============================================================================
456 * MakePipeTShapeTRChamfer
457 * Create a T-shape object with specified caracteristics for the main and
458 * the incident pipes (radius, width, half-length). A chamfer is created
459 * on the junction of the pipes.
460 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
461 * \param theR1 Internal radius of main pipe
462 * \param theW1 Width of main pipe
463 * \param theL1 Half-length of main pipe
464 * \param theR2 Internal radius of incident pipe (R2 < R1)
465 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
466 * \param theL2 Half-length of incident pipe
467 * \param theH Height of chamfer.
468 * \param theW Width of chamfer.
469 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
470 * \return List of GEOM_Objects, containing the created shape and propagation groups.
472 //=============================================================================
473 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRChamfer
474 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
475 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
476 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
477 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
478 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
479 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
481 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
483 //Set a not done flag
484 GetOperations()->SetNotDone();
487 Handle(TColStd_HSequenceOfTransient) aHSeq =
488 GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
489 theRL, theWL, theLtransL, theLthinL,
490 theRR, theWR, theLtransR, theLthinR,
491 theRI, theWI, theLtransI, theLthinI,
492 theH, theW, theHexMesh);
493 if (!GetOperations()->IsDone() || aHSeq.IsNull())
496 Standard_Integer aLength = aHSeq->Length();
497 aSeq->length(aLength);
498 for (Standard_Integer i = 1; i <= aLength; i++)
499 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
504 //=============================================================================
506 * MakePipeTShapeTRChamferWithPosition
507 * Create a T-shape object with specified caracteristics for the main and
508 * the incident pipes (radius, width, half-length). A chamfer is created
509 * on the junction of the pipes.
510 * The extremities of the main pipe are located on junctions points P1 and P2.
511 * The extremity of the incident pipe is located on junction point P3.
512 * \param theR1 Internal radius of main pipe
513 * \param theW1 Width of main pipe
514 * \param theL1 Half-length of main pipe
515 * \param theR2 Internal radius of incident pipe (R2 < R1)
516 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
517 * \param theL2 Half-length of incident pipe
518 * \param theH Height of the chamfer.
519 * \param theW Width of the chamfer.
520 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
521 * \param theP1 1st junction point of main pipe
522 * \param theP2 2nd junction point of main pipe
523 * \param theP3 Junction point of incident pipe
524 * \return List of GEOM_Objects, containing the created shape and propagation groups.
526 //=============================================================================
527 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRChamferWithPosition
528 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
529 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
530 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
531 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
532 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
533 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
534 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
536 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
538 //Set a not done flag
539 GetOperations()->SetNotDone();
541 //Get the reference vertices
542 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
543 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
544 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
547 Handle(TColStd_HSequenceOfTransient) aHSeq =
548 GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
549 theRL, theWL, theLtransL, theLthinL,
550 theRR, theWR, theLtransR, theLthinR,
551 theRI, theWI, theLtransI, theLthinI,
552 theH, theW, theHexMesh, aP1, aP2, aP3);
553 if (!GetOperations()->IsDone() || aHSeq.IsNull())
556 Standard_Integer aLength = aHSeq->Length();
557 aSeq->length(aLength);
558 for (Standard_Integer i = 1; i <= aLength; i++)
559 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
564 //=============================================================================
566 * MakePipeTShapeTRFillet
567 * Create a T-shape object with specified caracteristics for the main and
568 * the incident pipes (radius, width, half-length). A fillet is created
569 * on the junction of the pipes.
570 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
571 * \param theR1 Internal radius of main pipe
572 * \param theW1 Width of main pipe
573 * \param theL1 Half-length of main pipe
574 * \param theR2 Internal radius of incident pipe (R2 < R1)
575 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
576 * \param theL2 Half-length of incident pipe
577 * \param theRF Radius of curvature of fillet.
578 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
579 * \return List of GEOM_Objects, containing the created shape and propagation groups.
581 //=============================================================================
582 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRFillet
583 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
584 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
585 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
586 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
587 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
588 CORBA::Double theRF, CORBA::Boolean theHexMesh)
590 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
592 //Set a not done flag
593 GetOperations()->SetNotDone();
596 Handle(TColStd_HSequenceOfTransient) aHSeq =
597 GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
598 theRL, theWL, theLtransL, theLthinL,
599 theRR, theWR, theLtransR, theLthinR,
600 theRI, theWI, theLtransI, theLthinI,
602 if (!GetOperations()->IsDone() || aHSeq.IsNull())
605 Standard_Integer aLength = aHSeq->Length();
606 aSeq->length(aLength);
607 for (Standard_Integer i = 1; i <= aLength; i++)
608 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
613 //=============================================================================
615 * MakePipeTShapeTRFilletWithPosition
616 * Create a T-shape object with specified caracteristics for the main and
617 * the incident pipes (radius, width, half-length). A fillet is created
618 * on the junction of the pipes.
619 * The extremities of the main pipe are located on junctions points P1 and P2.
620 * The extremity of the incident pipe is located on junction point P3.
621 * \param theR1 Internal radius of main pipe
622 * \param theW1 Width of main pipe
623 * \param theL1 Half-length of main pipe
624 * \param theR2 Internal radius of incident pipe (R2 < R1)
625 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
626 * \param theL2 Half-length of incident pipe
627 * \param theRF Radius of curvature of fillet
628 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
629 * \param theP1 1st junction point of main pipe
630 * \param theP2 2nd junction point of main pipe
631 * \param theP3 Junction point of incident pipe
632 * \return List of GEOM_Objects, containing the created shape and propagation groups.
634 //=============================================================================
635 GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRFilletWithPosition
636 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
637 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
638 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
639 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
640 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
641 CORBA::Double theRF, CORBA::Boolean theHexMesh,
642 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
644 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
646 //Set a not done flag
647 GetOperations()->SetNotDone();
649 //Get the reference vertices
650 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
651 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
652 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
655 Handle(TColStd_HSequenceOfTransient) aHSeq =
656 GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
657 theRL, theWL, theLtransL, theLthinL,
658 theRR, theWR, theLtransR, theLthinR,
659 theRI, theWI, theLtransI, theLthinI,
660 theRF, theHexMesh, aP1, aP2, aP3);
661 if (!GetOperations()->IsDone() || aHSeq.IsNull())
664 Standard_Integer aLength = aHSeq->Length();
665 aSeq->length(aLength);
666 for (Standard_Integer i = 1; i <= aLength; i++)
667 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
672 //=============================================================================
674 * This function allows to create a disk already divided into blocks. It can be
675 * use to create divided pipes for later meshing in hexaedra.
676 * \param theR Radius of the disk
677 * \param theRatio Relative size of the central square diagonal against the disk diameter
678 * \return New GEOM_Object, containing the created shape.
680 //=============================================================================
681 GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeDividedDisk (CORBA::Double theR,
682 CORBA::Double theRatio,
683 CORBA::Short theOrientation,
684 GEOM::pattern thePattern)
686 GEOM::GEOM_Object_var aGEOMObject;
688 //Set a not done flag
689 GetOperations()->SetNotDone();
691 //Create the DividedDisk
692 Handle(GEOM_Object) anObject = GetOperations()->MakeDividedDisk(theR, theRatio, theOrientation, thePattern);
693 if (!GetOperations()->IsDone() || anObject.IsNull())
694 return aGEOMObject._retn();
696 return GetObject(anObject);
699 //=============================================================================
701 * MakeDividedDiskPntVecR
703 //=============================================================================
704 GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeDividedDiskPntVecR (GEOM::GEOM_Object_ptr thePnt,
705 GEOM::GEOM_Object_ptr theVec,
707 CORBA::Double theRatio,
708 GEOM::pattern thePattern)
710 GEOM::GEOM_Object_var aGEOMObject;
712 //Set a not done flag
713 GetOperations()->SetNotDone();
715 //Get the reference points
716 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
717 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
719 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
722 Handle(GEOM_Object) anObject =
723 GetOperations()->MakeDividedDiskPntVecR(aPnt, aVec, theR, theRatio, thePattern);
724 if (!GetOperations()->IsDone() || anObject.IsNull())
725 return aGEOMObject._retn();
727 return GetObject(anObject);
730 //=============================================================================
732 * Builds a cylinder prepared for hexa meshes
733 * \param theR Radius of the cylinder
734 * \param theH Height of the cylinder
735 * \return New GEOM_Object, containing the created shape.
737 //=============================================================================
738 GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeDividedCylinder (CORBA::Double theR,
740 GEOM::pattern thePattern)
742 GEOM::GEOM_Object_var aGEOMObject;
744 //Set a not done flag
745 GetOperations()->SetNotDone();
747 //Create the DividedCylinder
748 Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH, thePattern);
749 if (!GetOperations()->IsDone() || anObject.IsNull())
750 return aGEOMObject._retn();
752 return GetObject(anObject);
755 //=============================================================================
758 * \param thelPoints list of points
759 * \param theNbMax maximum number of Bezier pieces in the resulting surface.
760 * \param theDegMax maximum degree of the resulting BSpline surface
761 * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
762 * \return New GEOM_Object, containing the created shape.
764 //=============================================================================
765 GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints,
766 CORBA::Long theNbMax,
767 CORBA::Long theDegMax,
768 CORBA::Double theDMax)
770 GEOM::GEOM_Object_var aGEOMObject;
772 //Set a not done flag
773 GetOperations()->SetNotDone();
775 //Get the reference point
777 int aLen = thelPoints.length();
778 std::list<Handle(GEOM_Object)> aPoints;
779 for (; ind < aLen; ind++) {
780 Handle(GEOM_Object) aPnt = GetObjectImpl(thelPoints[ind]);
781 if (aPnt.IsNull()) return aGEOMObject._retn();
782 aPoints.push_back(aPnt);
784 //Create the SmoothingSurface
785 Handle(GEOM_Object) anObject = GetOperations()->MakeSmoothingSurface
786 (aPoints, theNbMax, theDegMax, theDMax);
787 if (!GetOperations()->IsDone() || anObject.IsNull())
788 return aGEOMObject._retn();
790 return GetObject(anObject);
793 AdvancedEngine_IOperations* AdvancedEngine_IOperations_i::GetOperations()
795 return (AdvancedEngine_IOperations*)GetImpl();