Back to index

salome-geom  6.5.0
GEOM_IAdvancedOperations_i.cc
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  File   : GEOM_IAdvancedOperations.cc
00021 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00022 //
00023 #include <Standard_Stream.hxx>
00024 
00025 #include "GEOM_IAdvancedOperations_i.hh"
00026 
00027 #include <utilities.h>
00028 #include <OpUtil.hxx>
00029 #include <Utils_ExceptHandlers.hxx>
00030 
00031 #include "GEOM_Engine.hxx"
00032 #include "GEOM_Object.hxx"
00033 
00034 //=============================================================================
00038 //=============================================================================
00039 GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_IAdvancedOperations* theImpl)
00040 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
00041 {
00042   MESSAGE("GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i");
00043 }
00044 
00045 //=============================================================================
00049 //=============================================================================
00050 GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i()
00051 {
00052   MESSAGE("GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i");
00053 }
00054 
00055 //=============================================================================
00070 //=============================================================================
00071 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShape (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1, 
00072                                                        CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2, CORBA::Boolean theHexMesh)
00073 {
00074   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
00075 
00076   //Set a not done flag
00077   GetOperations()->SetNotDone();
00078 
00079   //Create the TShape
00080   Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh);
00081   if (!GetOperations()->IsDone() || aHSeq.IsNull())
00082     return aSeq._retn();
00083   
00084   Standard_Integer aLength = aHSeq->Length();
00085   aSeq->length(aLength);
00086   for (Standard_Integer i = 1; i <= aLength; i++)
00087     aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
00088 
00089   return aSeq._retn();
00090 }
00091 
00092 //=============================================================================
00111 //=============================================================================
00112 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1, 
00113                                                                      CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2, CORBA::Boolean theHexMesh,
00114                                                                      GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
00115 {
00116   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
00117 
00118   //Set a not done flag
00119   GetOperations()->SetNotDone();
00120 
00121   //Get the reference vertices
00122   Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
00123   Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
00124   Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
00125   if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull())return aSeq._retn();
00126 
00127   //Create the TShape
00128   Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, aP1, aP2, aP3);
00129   if (!GetOperations()->IsDone() || aHSeq.IsNull())
00130     return aSeq._retn();
00131   
00132   Standard_Integer aLength = aHSeq->Length();
00133   aSeq->length(aLength);
00134   for (Standard_Integer i = 1; i <= aLength; i++)
00135     aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
00136 
00137   return aSeq._retn();
00138 }
00139 
00140 //=============================================================================
00158 //=============================================================================
00159 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeChamfer(CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1, 
00160                                                                CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2, 
00161                                                                CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
00162 {
00163   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
00164 
00165   //Set a not done flag
00166   GetOperations()->SetNotDone();
00167 
00168   //Create the TShape
00169   Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh);
00170   if (!GetOperations()->IsDone() || aHSeq.IsNull())
00171     return aSeq._retn();
00172   
00173   Standard_Integer aLength = aHSeq->Length();
00174   aSeq->length(aLength);
00175   for (Standard_Integer i = 1; i <= aLength; i++)
00176     aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
00177 
00178   return aSeq._retn();
00179 }
00180 
00181 //=============================================================================
00203 //=============================================================================
00204 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeChamferWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1, 
00205                                                                            CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2, 
00206                                                                            CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
00207                                                                            GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
00208 {
00209   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
00210 
00211   //Set a not done flag
00212   GetOperations()->SetNotDone();
00213 
00214   //Get the reference vertices
00215   Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
00216   Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
00217   Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
00218 
00219   //Create the TShape
00220   Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW,
00221                                                                           theHexMesh, aP1, aP2, aP3);
00222   if (!GetOperations()->IsDone() || aHSeq.IsNull())
00223     return aSeq._retn();
00224   
00225   Standard_Integer aLength = aHSeq->Length();
00226   aSeq->length(aLength);
00227   for (Standard_Integer i = 1; i <= aLength; i++)
00228     aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
00229 
00230   return aSeq._retn();
00231 }
00232 
00233 //=============================================================================
00250 //=============================================================================
00251 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeFillet (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
00252                                                                CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2, 
00253                                                                CORBA::Double theRF, CORBA::Boolean theHexMesh)
00254 {
00255   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
00256 
00257   //Set a not done flag
00258   GetOperations()->SetNotDone();
00259 
00260   //Create the TShape
00261   Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh);
00262   if (!GetOperations()->IsDone() || aHSeq.IsNull())
00263     return aSeq._retn();
00264   
00265   Standard_Integer aLength = aHSeq->Length();
00266   aSeq->length(aLength);
00267   for (Standard_Integer i = 1; i <= aLength; i++)
00268     aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
00269 
00270   return aSeq._retn();
00271 }
00272 
00273 //=============================================================================
00294 //=============================================================================
00295 GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeFilletWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
00296                                                                           CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2, 
00297                                                                           CORBA::Double theRF, CORBA::Boolean theHexMesh,
00298                                                                           GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
00299 {
00300   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
00301 
00302   //Set a not done flag
00303   GetOperations()->SetNotDone();
00304 
00305   //Get the reference vertices
00306   Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
00307   Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
00308   Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
00309 
00310   //Create the TShape
00311   Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, 
00312                                                                          theHexMesh, aP1, aP2, aP3);
00313   if (!GetOperations()->IsDone() || aHSeq.IsNull())
00314     return aSeq._retn();
00315   
00316   Standard_Integer aLength = aHSeq->Length();
00317   aSeq->length(aLength);
00318   for (Standard_Integer i = 1; i <= aLength; i++)
00319     aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
00320 
00321   return aSeq._retn();
00322 }
00323 
00324 /*@@ insert new functions before this line @@ do not remove this line @@*/