-using namespace std;
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <Standard_Stream.hxx>
#include "GEOM_IBlocksOperations_i.hh"
*/
//=============================================================================
GEOM_IBlocksOperations_i::GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_IBlocksOperations* theImpl)
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_IBlocksOperations* theImpl)
:GEOM_IOperations_i(thePOA, theEngine, theImpl)
{
MESSAGE("GEOM_IBlocksOperations_i::GEOM_IBlocksOperations_i");
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad
(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
- GEOM::GEOM_Object_ptr theEdge3, GEOM::GEOM_Object_ptr theEdge4)
+ GEOM::GEOM_Object_ptr theEdge3, GEOM::GEOM_Object_ptr theEdge4)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theEdge1 == NULL || theEdge2 == NULL ||
- theEdge3 == NULL || theEdge4 == NULL) return aGEOMObject._retn();
-
//Get the reference edges
- Handle(GEOM_Object) anEdge1 = GetOperations()->GetEngine()->GetObject
- (theEdge1->GetStudyID(), theEdge1->GetEntry());
- Handle(GEOM_Object) anEdge2 = GetOperations()->GetEngine()->GetObject
- (theEdge2->GetStudyID(), theEdge2->GetEntry());
- Handle(GEOM_Object) anEdge3 = GetOperations()->GetEngine()->GetObject
- (theEdge3->GetStudyID(), theEdge3->GetEntry());
- Handle(GEOM_Object) anEdge4 = GetOperations()->GetEngine()->GetObject
- (theEdge4->GetStudyID(), theEdge4->GetEntry());
+ Handle(GEOM_Object) anEdge1 = GetObjectImpl(theEdge1);
+ Handle(GEOM_Object) anEdge2 = GetObjectImpl(theEdge2);
+ Handle(GEOM_Object) anEdge3 = GetObjectImpl(theEdge3);
+ Handle(GEOM_Object) anEdge4 = GetObjectImpl(theEdge4);
if (anEdge1.IsNull() || anEdge2.IsNull() ||
anEdge3.IsNull() || anEdge4.IsNull()) return aGEOMObject._retn();
//Set a not done flag
GetOperations()->SetNotDone();
- if (theEdge1 == NULL || theEdge2 == NULL) return aGEOMObject._retn();
-
//Get the reference edges
- Handle(GEOM_Object) anEdge1 = GetOperations()->GetEngine()->GetObject
- (theEdge1->GetStudyID(), theEdge1->GetEntry());
- Handle(GEOM_Object) anEdge2 = GetOperations()->GetEngine()->GetObject
- (theEdge2->GetStudyID(), theEdge2->GetEntry());
+ Handle(GEOM_Object) anEdge1 = GetObjectImpl(theEdge1);
+ Handle(GEOM_Object) anEdge2 = GetObjectImpl(theEdge2);
if (anEdge1.IsNull() || anEdge2.IsNull()) return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeQuad4Vertices
(GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
- GEOM::GEOM_Object_ptr thePnt3, GEOM::GEOM_Object_ptr thePnt4)
+ GEOM::GEOM_Object_ptr thePnt3, GEOM::GEOM_Object_ptr thePnt4)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (thePnt1 == NULL || thePnt2 == NULL ||
- thePnt3 == NULL || thePnt4 == NULL) return aGEOMObject._retn();
-
//Get the reference points
- Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
- (thePnt1->GetStudyID(), thePnt1->GetEntry());
- Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
- (thePnt2->GetStudyID(), thePnt2->GetEntry());
- Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
- (thePnt3->GetStudyID(), thePnt3->GetEntry());
- Handle(GEOM_Object) aPnt4 = GetOperations()->GetEngine()->GetObject
- (thePnt4->GetStudyID(), thePnt4->GetEntry());
+ Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
+ Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
+ Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
+ Handle(GEOM_Object) aPnt4 = GetObjectImpl(thePnt4);
if (aPnt1.IsNull() || aPnt2.IsNull() ||
aPnt3.IsNull() || aPnt4.IsNull()) return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeHexa
(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
- GEOM::GEOM_Object_ptr theFace3, GEOM::GEOM_Object_ptr theFace4,
- GEOM::GEOM_Object_ptr theFace5, GEOM::GEOM_Object_ptr theFace6)
+ GEOM::GEOM_Object_ptr theFace3, GEOM::GEOM_Object_ptr theFace4,
+ GEOM::GEOM_Object_ptr theFace5, GEOM::GEOM_Object_ptr theFace6)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theFace1 == NULL || theFace2 == NULL ||
- theFace3 == NULL || theFace4 == NULL ||
- theFace5 == NULL || theFace6 == NULL) return aGEOMObject._retn();
-
//Get the reference Faces
- Handle(GEOM_Object) anFace1 = GetOperations()->GetEngine()->GetObject
- (theFace1->GetStudyID(), theFace1->GetEntry());
- Handle(GEOM_Object) anFace2 = GetOperations()->GetEngine()->GetObject
- (theFace2->GetStudyID(), theFace2->GetEntry());
- Handle(GEOM_Object) anFace3 = GetOperations()->GetEngine()->GetObject
- (theFace3->GetStudyID(), theFace3->GetEntry());
- Handle(GEOM_Object) anFace4 = GetOperations()->GetEngine()->GetObject
- (theFace4->GetStudyID(), theFace4->GetEntry());
- Handle(GEOM_Object) anFace5 = GetOperations()->GetEngine()->GetObject
- (theFace5->GetStudyID(), theFace5->GetEntry());
- Handle(GEOM_Object) anFace6 = GetOperations()->GetEngine()->GetObject
- (theFace6->GetStudyID(), theFace6->GetEntry());
+ Handle(GEOM_Object) anFace1 = GetObjectImpl(theFace1);
+ Handle(GEOM_Object) anFace2 = GetObjectImpl(theFace2);
+ Handle(GEOM_Object) anFace3 = GetObjectImpl(theFace3);
+ Handle(GEOM_Object) anFace4 = GetObjectImpl(theFace4);
+ Handle(GEOM_Object) anFace5 = GetObjectImpl(theFace5);
+ Handle(GEOM_Object) anFace6 = GetObjectImpl(theFace6);
if (anFace1.IsNull() || anFace2.IsNull() ||
anFace3.IsNull() || anFace4.IsNull() ||
//Set a not done flag
GetOperations()->SetNotDone();
- if (theFace1 == NULL || theFace2 == NULL) return aGEOMObject._retn();
-
//Get the reference Faces
- Handle(GEOM_Object) anFace1 = GetOperations()->GetEngine()->GetObject
- (theFace1->GetStudyID(), theFace1->GetEntry());
- Handle(GEOM_Object) anFace2 = GetOperations()->GetEngine()->GetObject
- (theFace2->GetStudyID(), theFace2->GetEntry());
+ Handle(GEOM_Object) anFace1 = GetObjectImpl(theFace1);
+ Handle(GEOM_Object) anFace2 = GetObjectImpl(theFace2);
if (anFace1.IsNull() || anFace2.IsNull()) return aGEOMObject._retn();
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return aGEOMObject._retn();
-
//Get the reference Compound
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return aGEOMObject._retn();
//Create the Blocks Compound
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetPoint (GEOM::GEOM_Object_ptr theShape,
- const CORBA::Double theX,
- const CORBA::Double theY,
- const CORBA::Double theZ,
- const CORBA::Double theEpsilon)
+ const CORBA::Double theX,
+ const CORBA::Double theY,
+ const CORBA::Double theZ,
+ const CORBA::Double theEpsilon)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
-
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return aGEOMObject._retn();
//Create the Point
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetVertexNearPoint
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetVertexNearPoint
+ (GEOM::GEOM_Object_ptr theShape,
+ GEOM::GEOM_Object_ptr thePoint)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Get the reference Objects
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+ if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
+
+ // Create the Point
+ Handle(GEOM_Object) anObject =
+ GetOperations()->GetVertexNearPoint(aShape, aPoint);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* GetEdge
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetEdge (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2)
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL ||
- thePoint1 == NULL || thePoint2 == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
- (thePoint1->GetStudyID(), thePoint1->GetEntry());
- Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
- (thePoint2->GetStudyID(), thePoint2->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+ Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
if (aShape.IsNull() ||
aPoint1.IsNull() || aPoint2.IsNull()) return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint)
+ GEOM::GEOM_Object_ptr thePoint)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL || thePoint == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
- (thePoint->GetStudyID(), thePoint->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByPoints
(GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint1,
- GEOM::GEOM_Object_ptr thePoint2,
- GEOM::GEOM_Object_ptr thePoint3,
- GEOM::GEOM_Object_ptr thePoint4)
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2,
+ GEOM::GEOM_Object_ptr thePoint3,
+ GEOM::GEOM_Object_ptr thePoint4)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL ||
- thePoint1 == NULL || thePoint2 == NULL ||
- thePoint3 == NULL || thePoint4 == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
- (thePoint1->GetStudyID(), thePoint1->GetEntry());
- Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
- (thePoint2->GetStudyID(), thePoint2->GetEntry());
- Handle(GEOM_Object) aPoint3 = GetOperations()->GetEngine()->GetObject
- (thePoint3->GetStudyID(), thePoint3->GetEntry());
- Handle(GEOM_Object) aPoint4 = GetOperations()->GetEngine()->GetObject
- (thePoint4->GetStudyID(), thePoint4->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
+ Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
+ Handle(GEOM_Object) aPoint3 = GetObjectImpl(thePoint3);
+ Handle(GEOM_Object) aPoint4 = GetObjectImpl(thePoint4);
if (aShape.IsNull() ||
aPoint1.IsNull() || aPoint2.IsNull() ||
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByEdges
(GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr theEdge1,
- GEOM::GEOM_Object_ptr theEdge2)
+ GEOM::GEOM_Object_ptr theEdge1,
+ GEOM::GEOM_Object_ptr theEdge2)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL ||
- theEdge1 == NULL || theEdge2 == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) anEdge1 = GetOperations()->GetEngine()->GetObject
- (theEdge1->GetStudyID(), theEdge1->GetEntry());
- Handle(GEOM_Object) anEdge2 = GetOperations()->GetEngine()->GetObject
- (theEdge2->GetStudyID(), theEdge2->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) anEdge1 = GetObjectImpl(theEdge1);
+ Handle(GEOM_Object) anEdge2 = GetObjectImpl(theEdge2);
if (aShape.IsNull() ||
anEdge1.IsNull() || anEdge2.IsNull()) return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetOppositeFace (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr theFace)
+ GEOM::GEOM_Object_ptr theFace)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL || theFace == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
- (theFace->GetStudyID(), theFace->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
if (aShape.IsNull() || aFace.IsNull()) return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePoint)
+ GEOM::GEOM_Object_ptr thePoint)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL || thePoint == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
- (thePoint->GetStudyID(), thePoint->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByNormale (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr theVector)
+ GEOM::GEOM_Object_ptr theVector)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL || theVector == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
- Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject
- (theVector->GetStudyID(), theVector->GetEntry());
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aVector = GetObjectImpl(theVector);
if (aShape.IsNull() || aVector.IsNull()) return aGEOMObject._retn();
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetShapesNearPoint
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetShapesNearPoint
+ (GEOM::GEOM_Object_ptr theShape,
+ GEOM::GEOM_Object_ptr thePoint,
+ CORBA::Long theShapeType,
+ CORBA::Double theTolerance)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Get the reference Objects
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+
+ if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
+
+ // Create the Shape
+ Handle(GEOM_Object) anObject =
+ GetOperations()->GetShapesNearPoint(aShape, aPoint, theShapeType, theTolerance);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* ExplodeCompoundOfBlocks
//=============================================================================
GEOM::ListOfGO* GEOM_IBlocksOperations_i::ExplodeCompoundOfBlocks
(GEOM::GEOM_Object_ptr theCompound,
- const CORBA::Long theMinNbFaces,
- const CORBA::Long theMaxNbFaces)
+ const CORBA::Long theMinNbFaces,
+ const CORBA::Long theMaxNbFaces)
{
GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return aSeq._retn();
-
//Get the reference Compound
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return aSeq._retn();
//Explode
//=============================================================================
CORBA::Boolean GEOM_IBlocksOperations_i::IsCompoundOfBlocks
(GEOM::GEOM_Object_ptr theCompound,
- const CORBA::Long theMinNbFaces,
- const CORBA::Long theMaxNbFaces,
- CORBA::Long& theNbBlocks)
+ const CORBA::Long theMinNbFaces,
+ const CORBA::Long theMaxNbFaces,
+ CORBA::Long& theNbBlocks)
{
theNbBlocks = 0;
CORBA::Boolean isComp = false;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return isComp;
-
//Get the reference Compound
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return isComp;
//Check
Standard_Integer nbBlocks = 0;
isComp = GetOperations()->IsCompoundOfBlocks(aCompound,
- theMinNbFaces,
- theMaxNbFaces,
- nbBlocks);
+ theMinNbFaces,
+ theMaxNbFaces,
+ nbBlocks);
if (!GetOperations()->IsDone())
return isComp;
//=============================================================================
CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
(GEOM::GEOM_Object_ptr theCompound,
- GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
+ GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
{
CORBA::Boolean isComp = false;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return isComp;
-
//Get the reference Compound
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return isComp;
//Check
- list<GEOMImpl_IBlocksOperations::BCError> errList;
+ std::list<GEOMImpl_IBlocksOperations::BCError> errList;
isComp = GetOperations()->CheckCompoundOfBlocks(aCompound, errList);
if (!GetOperations()->IsDone())
return isComp;
anErrArray->length(nbErr);
// fill the local CORBA array with values from lists
- list<GEOMImpl_IBlocksOperations::BCError>::iterator errIt = errList.begin();
+ std::list<GEOMImpl_IBlocksOperations::BCError>::iterator errIt = errList.begin();
int i = 0;
for (; errIt != errList.end(); i++, errIt++) {
GEOM::GEOM_IBlocksOperations::BCError_var anError =
break;
}
- list<int> sshList = errStruct.incriminated;
+ std::list<int> sshList = errStruct.incriminated;
GEOM::ListOfLong_var anIncrims = new GEOM::ListOfLong();
anIncrims->length(sshList.size());
- list<int>::iterator sshIt = sshList.begin();
+ std::list<int>::iterator sshIt = sshList.begin();
int jj = 0;
for (; sshIt != sshList.end(); jj++, sshIt++) {
anIncrims[jj] = *sshIt;
//=============================================================================
char* GEOM_IBlocksOperations_i::PrintBCErrors
(GEOM::GEOM_Object_ptr theCompound,
- const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
+ const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
{
//Get the reference Compound
- if (theCompound == NULL) return NULL;
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return NULL;
// Convert the errors sequence
- list<GEOMImpl_IBlocksOperations::BCError> anErrors;
+ std::list<GEOMImpl_IBlocksOperations::BCError> anErrors;
int nbErr = theErrors.length();
int ie = 0;
for (; ie < nbErr; ie++) {
}
TCollection_AsciiString aDescr = GetOperations()->PrintBCErrors(aCompound, anErrors);
- return CORBA::string_dup(aDescr.ToCString());
+ return CORBA::string_dup(aDescr.ToCString());
}
//=============================================================================
* RemoveExtraEdges
*/
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape)
+GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::RemoveExtraEdges
+ (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theOptimumNbFaces)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
-
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return aGEOMObject._retn();
//Get the result
- Handle(GEOM_Object) anObject =
- GetOperations()->RemoveExtraEdges(aShape);
+ Handle(GEOM_Object) anObject = GetOperations()->RemoveExtraEdges(aShape, theOptimumNbFaces);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return aGEOMObject._retn();
//Get the result
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
- GEOM::GEOM_Object_ptr thePoint)
+ GEOM::GEOM_Object_ptr thePoint)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL || thePoint == NULL) return aGEOMObject._retn();
-
//Get the reference Objects
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
- Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
- (thePoint->GetStudyID(), thePoint->GetEntry());
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
+ Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
if (aCompound.IsNull() || aPoint.IsNull()) return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
- const GEOM::ListOfGO& theParts)
+ const GEOM::ListOfGO& theParts)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return aGEOMObject._retn();
-
//Get the reference Compound
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return aGEOMObject._retn();
//Get the parts
aLen = theParts.length();
for (ind = 0; ind < aLen; ind++) {
- if (theParts[ind] == NULL) return aGEOMObject._retn();
- Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
- (theParts[ind]->GetStudyID(), theParts[ind]->GetEntry());
+ Handle(GEOM_Object) aSh = GetObjectImpl(theParts[ind]);
if (aSh.IsNull()) return aGEOMObject._retn();
aParts->Append(aSh);
}
*/
//=============================================================================
GEOM::ListOfGO* GEOM_IBlocksOperations_i::GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
- const GEOM::ListOfGO& theParts)
+ const GEOM::ListOfGO& theParts)
{
GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theCompound == NULL) return aSeq._retn();
-
//Get the reference Compound
- Handle(GEOM_Object) aCompound = GetOperations()->GetEngine()->GetObject
- (theCompound->GetStudyID(), theCompound->GetEntry());
-
+ Handle(GEOM_Object) aCompound = GetObjectImpl(theCompound);
if (aCompound.IsNull()) return aSeq._retn();
//Get the parts
aLen = theParts.length();
for (ind = 0; ind < aLen; ind++) {
- if (theParts[ind] == NULL) return aSeq._retn();
- Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
- (theParts[ind]->GetStudyID(), theParts[ind]->GetEntry());
+ Handle(GEOM_Object) aSh = GetObjectImpl(theParts[ind]);
if (aSh.IsNull()) return aSeq._retn();
aParts->Append(aSh);
}
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeMultiTransformation1D
(GEOM::GEOM_Object_ptr theBlock,
- const CORBA::Long theDirFace1,
- const CORBA::Long theDirFace2,
- const CORBA::Long theNbTimes)
+ const CORBA::Long theDirFace1,
+ const CORBA::Long theDirFace2,
+ const CORBA::Long theNbTimes)
{
GEOM::GEOM_Object_var aGEOMObject;
- //Set a not done flag
+ //Set a not done flag
GetOperations()->SetNotDone();
- if (theBlock == NULL) return aGEOMObject._retn();
-
- //Get the object itself and the vector of translation
- Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
- (theBlock->GetStudyID(), theBlock->GetEntry());
-
- if (aBasicObject.IsNull()) return aGEOMObject._retn();
+ //Get the object itself and the vector of translation
+ Handle(GEOM_Object) aBasicObject = GetObjectImpl(theBlock);
+ if (aBasicObject.IsNull()) return aGEOMObject._retn();
- //Perform the transformation
- Handle(GEOM_Object) anObject = GetOperations()->MakeMultiTransformation1D
- (aBasicObject, theDirFace1, theDirFace2, theNbTimes);
- if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
+ //Perform the transformation
+ Handle(GEOM_Object) anObject = GetOperations()->MakeMultiTransformation1D
+ (aBasicObject, theDirFace1, theDirFace2, theNbTimes);
+ if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
- return GetObject(anObject);
+ return GetObject(anObject);
}
//=============================================================================
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::MakeMultiTransformation2D
(GEOM::GEOM_Object_ptr theBlock,
- const CORBA::Long theDirFace1U,
- const CORBA::Long theDirFace2U,
- const CORBA::Long theNbTimesU,
- const CORBA::Long theDirFace1V,
- const CORBA::Long theDirFace2V,
- const CORBA::Long theNbTimesV)
+ const CORBA::Long theDirFace1U,
+ const CORBA::Long theDirFace2U,
+ const CORBA::Long theNbTimesU,
+ const CORBA::Long theDirFace1V,
+ const CORBA::Long theDirFace2V,
+ const CORBA::Long theNbTimesV)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
- if (theBlock == NULL) return aGEOMObject._retn();
-
//Get the object itself
- Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
- (theBlock->GetStudyID(), theBlock->GetEntry());
-
+ Handle(GEOM_Object) aBasicObject = GetObjectImpl(theBlock);
if (aBasicObject.IsNull()) return aGEOMObject._retn();
//Perform the transformation
//Set a not done flag
GetOperations()->SetNotDone();
- if (theShape == NULL) return aSeq._retn();
-
//Get the reference Shape
- Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
- (theShape->GetStudyID(), theShape->GetEntry());
-
+ Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return aSeq._retn();
//Get the Propagation chains