1 // Copyright (C) 2007-2013 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.
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 "GEOM_IAdvancedOperations_i.hh"
27 #include <utilities.h>
29 #include <Utils_ExceptHandlers.hxx>
31 #include "GEOM_Engine.hxx"
32 #include "GEOM_Object.hxx"
34 //=============================================================================
38 //=============================================================================
39 GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_IAdvancedOperations* theImpl)
40 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
42 MESSAGE("GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i");
45 //=============================================================================
49 //=============================================================================
50 GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i()
52 MESSAGE("GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i");
55 //=============================================================================
58 * Create a T-shape object with specified caracteristics for the main and
59 * the incident pipes (radius, width, half-length).
60 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
61 * \param theR1 Internal radius of main pipe
62 * \param theW1 Width of main pipe
63 * \param theL1 Half-length of main pipe
64 * \param theR2 Internal radius of incident pipe (R2 < R1)
65 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
66 * \param theL2 Half-length of incident pipe
67 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
68 * \return List of GEOM_Objects, containing the created shape and propagation groups.
70 //=============================================================================
71 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShape
72 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
73 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
74 CORBA::Boolean theHexMesh)
76 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
79 GetOperations()->SetNotDone();
82 Handle(TColStd_HSequenceOfTransient) aHSeq =
83 GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
84 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
86 if (!GetOperations()->IsDone() || aHSeq.IsNull())
89 Standard_Integer aLength = aHSeq->Length();
90 aSeq->length(aLength);
91 for (Standard_Integer i = 1; i <= aLength; i++)
92 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
97 //=============================================================================
99 * MakePipeTShapeWithPosition
100 * Create a T-shape object with specified caracteristics for the main and
101 * the incident pipes (radius, width, half-length).
102 * The extremities of the main pipe are located on junctions points P1 and P2.
103 * The extremity of the incident pipe is located on junction point P3.
104 * \param theR1 Internal radius of main pipe
105 * \param theW1 Width of main pipe
106 * \param theL1 Half-length of main pipe
107 * \param theR2 Internal radius of incident pipe (R2 < R1)
108 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
109 * \param theL2 Half-length of incident pipe
110 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
111 * \param theP1 1st junction point of main pipe
112 * \param theP2 2nd junction point of main pipe
113 * \param theP3 Junction point of incident pipe
114 * \return List of GEOM_Objects, containing the created shape and propagation groups.
116 //=============================================================================
117 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeWithPosition
118 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
119 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
120 CORBA::Boolean theHexMesh,
121 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
123 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
125 //Set a not done flag
126 GetOperations()->SetNotDone();
128 //Get the reference vertices
129 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
130 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
131 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
132 if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull())return aSeq._retn();
135 Handle(TColStd_HSequenceOfTransient) aHSeq =
136 GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
137 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
138 theHexMesh, aP1, aP2, aP3);
139 if (!GetOperations()->IsDone() || aHSeq.IsNull())
142 Standard_Integer aLength = aHSeq->Length();
143 aSeq->length(aLength);
144 for (Standard_Integer i = 1; i <= aLength; i++)
145 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
150 //=============================================================================
152 * MakePipeTShapeChamfer
153 * Create a T-shape object with specified caracteristics for the main and
154 * the incident pipes (radius, width, half-length). A chamfer is created
155 * on the junction of the pipes.
156 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
157 * \param theR1 Internal radius of main pipe
158 * \param theW1 Width of main pipe
159 * \param theL1 Half-length of main pipe
160 * \param theR2 Internal radius of incident pipe (R2 < R1)
161 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
162 * \param theL2 Half-length of incident pipe
163 * \param theH Height of chamfer.
164 * \param theW Width of chamfer.
165 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
166 * \return List of GEOM_Objects, containing the created shape and propagation groups.
168 //=============================================================================
169 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeChamfer
170 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
171 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
172 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
174 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
176 //Set a not done flag
177 GetOperations()->SetNotDone();
180 Handle(TColStd_HSequenceOfTransient) aHSeq =
181 GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
182 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
183 theH, theW, theHexMesh);
184 if (!GetOperations()->IsDone() || aHSeq.IsNull())
187 Standard_Integer aLength = aHSeq->Length();
188 aSeq->length(aLength);
189 for (Standard_Integer i = 1; i <= aLength; i++)
190 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
195 //=============================================================================
197 * MakePipeTShapeChamferWithPosition
198 * Create a T-shape object with specified caracteristics for the main and
199 * the incident pipes (radius, width, half-length). A chamfer is created
200 * on the junction of the pipes.
201 * The extremities of the main pipe are located on junctions points P1 and P2.
202 * The extremity of the incident pipe is located on junction point P3.
203 * \param theR1 Internal radius of main pipe
204 * \param theW1 Width of main pipe
205 * \param theL1 Half-length of main pipe
206 * \param theR2 Internal radius of incident pipe (R2 < R1)
207 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
208 * \param theL2 Half-length of incident pipe
209 * \param theH Height of the chamfer.
210 * \param theW Width of the chamfer.
211 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
212 * \param theP1 1st junction point of main pipe
213 * \param theP2 2nd junction point of main pipe
214 * \param theP3 Junction point of incident pipe
215 * \return List of GEOM_Objects, containing the created shape and propagation groups.
217 //=============================================================================
218 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeChamferWithPosition
219 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
220 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
221 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
222 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
224 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
226 //Set a not done flag
227 GetOperations()->SetNotDone();
229 //Get the reference vertices
230 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
231 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
232 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
235 Handle(TColStd_HSequenceOfTransient) aHSeq =
236 GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
237 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
238 theH, theW, theHexMesh, aP1, aP2, aP3);
239 if (!GetOperations()->IsDone() || aHSeq.IsNull())
242 Standard_Integer aLength = aHSeq->Length();
243 aSeq->length(aLength);
244 for (Standard_Integer i = 1; i <= aLength; i++)
245 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
250 //=============================================================================
252 * MakePipeTShapeFillet
253 * Create a T-shape object with specified caracteristics for the main and
254 * the incident pipes (radius, width, half-length). A fillet is created
255 * on the junction of the pipes.
256 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
257 * \param theR1 Internal radius of main pipe
258 * \param theW1 Width of main pipe
259 * \param theL1 Half-length of main pipe
260 * \param theR2 Internal radius of incident pipe (R2 < R1)
261 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
262 * \param theL2 Half-length of incident pipe
263 * \param theRF Radius of curvature of fillet.
264 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
265 * \return List of GEOM_Objects, containing the created shape and propagation groups.
267 //=============================================================================
268 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeFillet
269 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
270 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
271 CORBA::Double theRF, CORBA::Boolean theHexMesh)
273 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
275 //Set a not done flag
276 GetOperations()->SetNotDone();
279 Handle(TColStd_HSequenceOfTransient) aHSeq =
280 GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
281 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
283 if (!GetOperations()->IsDone() || aHSeq.IsNull())
286 Standard_Integer aLength = aHSeq->Length();
287 aSeq->length(aLength);
288 for (Standard_Integer i = 1; i <= aLength; i++)
289 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
294 //=============================================================================
296 * MakePipeTShapeFilletWithPosition
297 * Create a T-shape object with specified caracteristics for the main and
298 * the incident pipes (radius, width, half-length). A fillet is created
299 * on the junction of the pipes.
300 * The extremities of the main pipe are located on junctions points P1 and P2.
301 * The extremity of the incident pipe is located on junction point P3.
302 * \param theR1 Internal radius of main pipe
303 * \param theW1 Width of main pipe
304 * \param theL1 Half-length of main pipe
305 * \param theR2 Internal radius of incident pipe (R2 < R1)
306 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
307 * \param theL2 Half-length of incident pipe
308 * \param theRF Radius of curvature of fillet
309 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
310 * \param theP1 1st junction point of main pipe
311 * \param theP2 2nd junction point of main pipe
312 * \param theP3 Junction point of incident pipe
313 * \return List of GEOM_Objects, containing the created shape and propagation groups.
315 //=============================================================================
316 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeFilletWithPosition
317 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
318 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
319 CORBA::Double theRF, CORBA::Boolean theHexMesh,
320 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
322 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
324 //Set a not done flag
325 GetOperations()->SetNotDone();
327 //Get the reference vertices
328 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
329 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
330 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
333 Handle(TColStd_HSequenceOfTransient) aHSeq =
334 GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
335 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
336 theRF, theHexMesh, aP1, aP2, aP3);
337 if (!GetOperations()->IsDone() || aHSeq.IsNull())
340 Standard_Integer aLength = aHSeq->Length();
341 aSeq->length(aLength);
342 for (Standard_Integer i = 1; i <= aLength; i++)
343 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
348 //=============================================================================
351 * Create a T-shape object with specified caracteristics for the main and
352 * the incident pipes (radius, width, half-length).
353 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
354 * \param theR1 Internal radius of main pipe
355 * \param theW1 Width of main pipe
356 * \param theL1 Half-length of main pipe
357 * \param theR2 Internal radius of incident pipe (R2 < R1)
358 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
359 * \param theL2 Half-length of incident pipe
360 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
361 * \return List of GEOM_Objects, containing the created shape and propagation groups.
363 //=============================================================================
364 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTR
365 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
366 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
367 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
368 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
369 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
370 CORBA::Boolean theHexMesh)
372 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
374 //Set a not done flag
375 GetOperations()->SetNotDone();
378 Handle(TColStd_HSequenceOfTransient) aHSeq =
379 GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
380 theRL, theWL, theLtransL, theLthinL,
381 theRR, theWR, theLtransR, theLthinR,
382 theRI, theWI, theLtransI, theLthinI,
384 if (!GetOperations()->IsDone() || aHSeq.IsNull())
387 Standard_Integer aLength = aHSeq->Length();
388 aSeq->length(aLength);
389 for (Standard_Integer i = 1; i <= aLength; i++)
390 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
395 //=============================================================================
397 * MakePipeTShapeTRWithPosition
398 * Create a T-shape object with specified caracteristics for the main and
399 * the incident pipes (radius, width, half-length).
400 * The extremities of the main pipe are located on junctions points P1 and P2.
401 * The extremity of the incident pipe is located on junction point P3.
402 * \param theR1 Internal radius of main pipe
403 * \param theW1 Width of main pipe
404 * \param theL1 Half-length of main pipe
405 * \param theR2 Internal radius of incident pipe (R2 < R1)
406 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
407 * \param theL2 Half-length of incident pipe
408 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
409 * \param theP1 1st junction point of main pipe
410 * \param theP2 2nd junction point of main pipe
411 * \param theP3 Junction point of incident pipe
412 * \return List of GEOM_Objects, containing the created shape and propagation groups.
414 //=============================================================================
415 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRWithPosition
416 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
417 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
418 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
419 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
420 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
421 CORBA::Boolean theHexMesh,
422 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
424 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
426 //Set a not done flag
427 GetOperations()->SetNotDone();
429 //Get the reference vertices
430 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
431 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
432 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
433 if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull()) return aSeq._retn();
436 Handle(TColStd_HSequenceOfTransient) aHSeq =
437 GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
438 theRL, theWL, theLtransL, theLthinL,
439 theRR, theWR, theLtransR, theLthinR,
440 theRI, theWI, theLtransI, theLthinI,
441 theHexMesh, aP1, aP2, aP3);
442 if (!GetOperations()->IsDone() || aHSeq.IsNull())
445 Standard_Integer aLength = aHSeq->Length();
446 aSeq->length(aLength);
447 for (Standard_Integer i = 1; i <= aLength; i++)
448 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
453 //=============================================================================
455 * MakePipeTShapeTRChamfer
456 * Create a T-shape object with specified caracteristics for the main and
457 * the incident pipes (radius, width, half-length). A chamfer is created
458 * on the junction of the pipes.
459 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
460 * \param theR1 Internal radius of main pipe
461 * \param theW1 Width of main pipe
462 * \param theL1 Half-length of main pipe
463 * \param theR2 Internal radius of incident pipe (R2 < R1)
464 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
465 * \param theL2 Half-length of incident pipe
466 * \param theH Height of chamfer.
467 * \param theW Width of chamfer.
468 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
469 * \return List of GEOM_Objects, containing the created shape and propagation groups.
471 //=============================================================================
472 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRChamfer
473 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
474 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
475 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
476 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
477 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
478 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
480 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
482 //Set a not done flag
483 GetOperations()->SetNotDone();
486 Handle(TColStd_HSequenceOfTransient) aHSeq =
487 GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
488 theRL, theWL, theLtransL, theLthinL,
489 theRR, theWR, theLtransR, theLthinR,
490 theRI, theWI, theLtransI, theLthinI,
491 theH, theW, theHexMesh);
492 if (!GetOperations()->IsDone() || aHSeq.IsNull())
495 Standard_Integer aLength = aHSeq->Length();
496 aSeq->length(aLength);
497 for (Standard_Integer i = 1; i <= aLength; i++)
498 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
503 //=============================================================================
505 * MakePipeTShapeTRChamferWithPosition
506 * Create a T-shape object with specified caracteristics for the main and
507 * the incident pipes (radius, width, half-length). A chamfer is created
508 * on the junction of the pipes.
509 * The extremities of the main pipe are located on junctions points P1 and P2.
510 * The extremity of the incident pipe is located on junction point P3.
511 * \param theR1 Internal radius of main pipe
512 * \param theW1 Width of main pipe
513 * \param theL1 Half-length of main pipe
514 * \param theR2 Internal radius of incident pipe (R2 < R1)
515 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
516 * \param theL2 Half-length of incident pipe
517 * \param theH Height of the chamfer.
518 * \param theW Width of the chamfer.
519 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
520 * \param theP1 1st junction point of main pipe
521 * \param theP2 2nd junction point of main pipe
522 * \param theP3 Junction point of incident pipe
523 * \return List of GEOM_Objects, containing the created shape and propagation groups.
525 //=============================================================================
526 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRChamferWithPosition
527 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
528 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
529 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
530 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
531 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
532 CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
533 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
535 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
537 //Set a not done flag
538 GetOperations()->SetNotDone();
540 //Get the reference vertices
541 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
542 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
543 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
546 Handle(TColStd_HSequenceOfTransient) aHSeq =
547 GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
548 theRL, theWL, theLtransL, theLthinL,
549 theRR, theWR, theLtransR, theLthinR,
550 theRI, theWI, theLtransI, theLthinI,
551 theH, theW, theHexMesh, aP1, aP2, aP3);
552 if (!GetOperations()->IsDone() || aHSeq.IsNull())
555 Standard_Integer aLength = aHSeq->Length();
556 aSeq->length(aLength);
557 for (Standard_Integer i = 1; i <= aLength; i++)
558 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
563 //=============================================================================
565 * MakePipeTShapeTRFillet
566 * Create a T-shape object with specified caracteristics for the main and
567 * the incident pipes (radius, width, half-length). A fillet is created
568 * on the junction of the pipes.
569 * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
570 * \param theR1 Internal radius of main pipe
571 * \param theW1 Width of main pipe
572 * \param theL1 Half-length of main pipe
573 * \param theR2 Internal radius of incident pipe (R2 < R1)
574 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
575 * \param theL2 Half-length of incident pipe
576 * \param theRF Radius of curvature of fillet.
577 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
578 * \return List of GEOM_Objects, containing the created shape and propagation groups.
580 //=============================================================================
581 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRFillet
582 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
583 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
584 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
585 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
586 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
587 CORBA::Double theRF, CORBA::Boolean theHexMesh)
589 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
591 //Set a not done flag
592 GetOperations()->SetNotDone();
595 Handle(TColStd_HSequenceOfTransient) aHSeq =
596 GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
597 theRL, theWL, theLtransL, theLthinL,
598 theRR, theWR, theLtransR, theLthinR,
599 theRI, theWI, theLtransI, theLthinI,
601 if (!GetOperations()->IsDone() || aHSeq.IsNull())
604 Standard_Integer aLength = aHSeq->Length();
605 aSeq->length(aLength);
606 for (Standard_Integer i = 1; i <= aLength; i++)
607 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
612 //=============================================================================
614 * MakePipeTShapeTRFilletWithPosition
615 * Create a T-shape object with specified caracteristics for the main and
616 * the incident pipes (radius, width, half-length). A fillet is created
617 * on the junction of the pipes.
618 * The extremities of the main pipe are located on junctions points P1 and P2.
619 * The extremity of the incident pipe is located on junction point P3.
620 * \param theR1 Internal radius of main pipe
621 * \param theW1 Width of main pipe
622 * \param theL1 Half-length of main pipe
623 * \param theR2 Internal radius of incident pipe (R2 < R1)
624 * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
625 * \param theL2 Half-length of incident pipe
626 * \param theRF Radius of curvature of fillet
627 * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
628 * \param theP1 1st junction point of main pipe
629 * \param theP2 2nd junction point of main pipe
630 * \param theP3 Junction point of incident pipe
631 * \return List of GEOM_Objects, containing the created shape and propagation groups.
633 //=============================================================================
634 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRFilletWithPosition
635 (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
636 CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
637 CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
638 CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
639 CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
640 CORBA::Double theRF, CORBA::Boolean theHexMesh,
641 GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
643 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
645 //Set a not done flag
646 GetOperations()->SetNotDone();
648 //Get the reference vertices
649 Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
650 Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
651 Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
654 Handle(TColStd_HSequenceOfTransient) aHSeq =
655 GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
656 theRL, theWL, theLtransL, theLthinL,
657 theRR, theWR, theLtransR, theLthinR,
658 theRI, theWI, theLtransI, theLthinI,
659 theRF, theHexMesh, aP1, aP2, aP3);
660 if (!GetOperations()->IsDone() || aHSeq.IsNull())
663 Standard_Integer aLength = aHSeq->Length();
664 aSeq->length(aLength);
665 for (Standard_Integer i = 1; i <= aLength; i++)
666 aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
671 //=============================================================================
673 * This function allows to create a disk already divided into blocks. It can be
674 * use to create divided pipes for later meshing in hexaedra.
675 * \param theR Radius of the disk
676 * \param theRatio Relative size of the central square diagonal against the disk diameter
677 * \return New GEOM_Object, containing the created shape.
679 //=============================================================================
680 GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDisk (CORBA::Double theR,
681 CORBA::Double theRatio,
682 CORBA::Short theOrientation,
683 GEOM::pattern thePattern)
685 GEOM::GEOM_Object_var aGEOMObject;
687 //Set a not done flag
688 GetOperations()->SetNotDone();
690 //Create the DividedDisk
691 Handle(GEOM_Object) anObject = GetOperations()->MakeDividedDisk(theR, theRatio, theOrientation, thePattern);
692 if (!GetOperations()->IsDone() || anObject.IsNull())
693 return aGEOMObject._retn();
695 return GetObject(anObject);
698 //=============================================================================
700 * MakeDividedDiskPntVecR
702 //=============================================================================
703 GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDiskPntVecR (GEOM::GEOM_Object_ptr thePnt,
704 GEOM::GEOM_Object_ptr theVec,
706 CORBA::Double theRatio,
707 GEOM::pattern thePattern)
709 GEOM::GEOM_Object_var aGEOMObject;
711 //Set a not done flag
712 GetOperations()->SetNotDone();
714 //Get the reference points
715 Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
716 Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
718 if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
721 Handle(GEOM_Object) anObject =
722 GetOperations()->MakeDividedDiskPntVecR(aPnt, aVec, theR, theRatio, thePattern);
723 if (!GetOperations()->IsDone() || anObject.IsNull())
724 return aGEOMObject._retn();
726 return GetObject(anObject);
729 //=============================================================================
731 * Builds a cylinder prepared for hexa meshes
732 * \param theR Radius of the cylinder
733 * \param theH Height of the cylinder
734 * \return New GEOM_Object, containing the created shape.
736 //=============================================================================
737 GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Double theR,
739 GEOM::pattern thePattern)
741 GEOM::GEOM_Object_var aGEOMObject;
743 //Set a not done flag
744 GetOperations()->SetNotDone();
746 //Create the DividedCylinder
747 Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH, thePattern);
748 if (!GetOperations()->IsDone() || anObject.IsNull())
749 return aGEOMObject._retn();
751 return GetObject(anObject);
754 //=============================================================================
757 * \param thelPoints list of points
758 * \return New GEOM_Object, containing the created shape.
760 //=============================================================================
761 GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints)
763 GEOM::GEOM_Object_var aGEOMObject;
765 //Set a not done flag
766 GetOperations()->SetNotDone();
768 //Get the reference point
770 int aLen = thelPoints.length();
771 std::list<Handle(GEOM_Object)> aPoints;
772 for (; ind < aLen; ind++) {
773 Handle(GEOM_Object) aPnt = GetObjectImpl(thelPoints[ind]);
774 if (aPnt.IsNull()) return aGEOMObject._retn();
775 aPoints.push_back(aPnt);
777 //Create the SmoothingSurface
778 Handle(GEOM_Object) anObject = GetOperations()->MakeSmoothingSurface(aPoints);
779 if (!GetOperations()->IsDone() || anObject.IsNull())
780 return aGEOMObject._retn();
782 return GetObject(anObject);
785 /*@@ insert new functions before this line @@ do not remove this line @@*/