mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-31 08:10:33 +05:00
0020230: Memory perf of BoundingBox
This commit is contained in:
parent
85bed9f0cb
commit
cca851206f
@ -18,7 +18,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
#include "GEOM_I3DPrimOperations_i.hh"
|
#include "GEOM_I3DPrimOperations_i.hh"
|
||||||
@ -87,13 +87,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxTwoPnt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
|
Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
|
||||||
|
Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
|
||||||
//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());
|
|
||||||
|
|
||||||
if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
|
if (aPnt1.IsNull() || aPnt2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -145,12 +140,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceObjHW
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theObj == NULL || theH == 0 || theW == 0)
|
//Get the reference object
|
||||||
return aGEOMObject._retn();
|
Handle(GEOM_Object) anObj = GetObjectImpl(theObj);
|
||||||
|
|
||||||
//Get the reference points
|
|
||||||
Handle(GEOM_Object) anObj = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theObj->GetStudyID(), theObj->GetEntry());
|
|
||||||
|
|
||||||
if (anObj.IsNull())
|
if (anObj.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
@ -177,13 +168,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskPntVecR
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
|
||||||
(thePnt->GetStudyID(), thePnt->GetEntry());
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -210,15 +197,10 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskThreePnt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
Handle(GEOM_Object) aPnt1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPnt1 = GetObjectImpl(thePnt1);
|
||||||
(thePnt1->GetStudyID(), thePnt1->GetEntry());
|
Handle(GEOM_Object) aPnt2 = GetObjectImpl(thePnt2);
|
||||||
Handle(GEOM_Object) aPnt2 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPnt3 = GetObjectImpl(thePnt3);
|
||||||
(thePnt2->GetStudyID(), thePnt2->GetEntry());
|
|
||||||
Handle(GEOM_Object) aPnt3 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePnt3->GetStudyID(), thePnt3->GetEntry());
|
|
||||||
|
|
||||||
if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
|
if (aPnt1.IsNull() || aPnt2.IsNull() || aPnt3.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -290,13 +272,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderPntVecRH
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
|
||||||
(thePnt->GetStudyID(), thePnt->GetEntry());
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -344,13 +322,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeConePntVecR1R2H
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
|
||||||
(thePnt->GetStudyID(), thePnt->GetEntry());
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -396,12 +370,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeSpherePntR
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference point
|
//Get the reference point
|
||||||
CORBA::String_var entry=thePnt->GetEntry();
|
Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
|
||||||
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePnt->GetStudyID(), entry);
|
|
||||||
|
|
||||||
if (aPnt.IsNull()) return aGEOMObject._retn();
|
if (aPnt.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -450,13 +420,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeTorusPntVecRR
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
|
||||||
(thePnt->GetStudyID(), thePnt->GetEntry());
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -483,13 +449,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -516,13 +478,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH2Ways
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -550,16 +508,10 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || thePoint1 == NULL || thePoint2 == NULL)
|
|
||||||
return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
|
||||||
Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
|
||||||
(thePoint1->GetStudyID(), thePoint1->GetEntry());
|
|
||||||
Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePoint2->GetStudyID(), thePoint2->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
|
if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
@ -588,16 +540,10 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || thePoint1 == NULL || thePoint2 == NULL)
|
|
||||||
return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1);
|
||||||
Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2);
|
||||||
(thePoint1->GetStudyID(), thePoint1->GetEntry());
|
|
||||||
Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePoint2->GetStudyID(), thePoint2->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
|
if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
@ -625,11 +571,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -656,11 +599,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ2Ways
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -686,13 +626,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || thePath == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
|
||||||
Handle(GEOM_Object) aPath = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePath->GetStudyID(), thePath->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -719,13 +655,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || theAxis == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
|
||||||
Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theAxis->GetStudyID(), theAxis->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -752,13 +684,9 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle2Ways
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || theAxis == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis);
|
||||||
Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theAxis->GetStudyID(), theAxis->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -789,16 +717,14 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_pt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return aGEOMObject._retn();
|
if (aShape.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the Solid
|
//Create the Solid
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->MakeFilling(aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, theApprox);
|
Handle(GEOM_Object) anObject = GetOperations()->MakeFilling
|
||||||
|
(aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, theApprox);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -825,13 +751,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::Lis
|
|||||||
//Get the shapes
|
//Get the shapes
|
||||||
aLen = theSeqSections.length();
|
aLen = theSeqSections.length();
|
||||||
for (ind = 0; ind < aLen; ind++) {
|
for (ind = 0; ind < aLen; ind++) {
|
||||||
if (theSeqSections[ind] == NULL) continue;
|
Handle(GEOM_Object) aSh = GetObjectImpl(theSeqSections[ind]);
|
||||||
Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theSeqSections[ind]->GetStudyID(), theSeqSections[ind]->GetEntry());
|
|
||||||
if (!aSh.IsNull())
|
if (!aSh.IsNull())
|
||||||
aSeqSections->Append(aSh);
|
aSeqSections->Append(aSh);
|
||||||
}
|
}
|
||||||
if(!aSeqSections->Length())
|
if (!aSeqSections->Length())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
// Make shell or solid
|
// Make shell or solid
|
||||||
@ -848,7 +772,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::Lis
|
|||||||
* MakePipeWithDifferentSections
|
* MakePipeWithDifferentSections
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases,
|
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
|
||||||
|
(const GEOM::ListOfGO& theBases,
|
||||||
const GEOM::ListOfGO& theLocations,
|
const GEOM::ListOfGO& theLocations,
|
||||||
GEOM::GEOM_Object_ptr thePath,
|
GEOM::GEOM_Object_ptr thePath,
|
||||||
CORBA::Boolean theWithContact,
|
CORBA::Boolean theWithContact,
|
||||||
@ -866,31 +791,27 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections(co
|
|||||||
aNbBases = theBases.length();
|
aNbBases = theBases.length();
|
||||||
aNbLocs = theLocations.length();
|
aNbLocs = theLocations.length();
|
||||||
|
|
||||||
if( aNbLocs && aNbBases != aNbLocs)
|
if (aNbLocs && aNbBases != aNbLocs)
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
Handle(GEOM_Object) aPath = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
|
||||||
(thePath->GetStudyID(), thePath->GetEntry());
|
if (aPath.IsNull())
|
||||||
if(aPath.IsNull())
|
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
for (ind = 0; ind < aNbBases; ind++) {
|
for (ind = 0; ind < aNbBases; ind++) {
|
||||||
if (theBases[ind] == NULL) continue;
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject(theBases[ind]->GetStudyID(),
|
if (aBase.IsNull())
|
||||||
theBases[ind]->GetEntry());
|
|
||||||
if(aBase.IsNull())
|
|
||||||
continue;
|
continue;
|
||||||
if(aNbLocs)
|
if (aNbLocs)
|
||||||
{
|
{
|
||||||
Handle(GEOM_Object) aLoc = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
|
||||||
(theLocations[ind]->GetStudyID(), theLocations[ind]->GetEntry());
|
if (aLoc.IsNull())
|
||||||
if(aLoc.IsNull())
|
|
||||||
continue;
|
continue;
|
||||||
aSeqLocations->Append(aLoc);
|
aSeqLocations->Append(aLoc);
|
||||||
}
|
}
|
||||||
aSeqBases->Append(aBase);
|
aSeqBases->Append(aBase);
|
||||||
}
|
}
|
||||||
if(!aSeqBases->Length())
|
if (!aSeqBases->Length())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
// Make pipe
|
// Make pipe
|
||||||
@ -931,42 +852,36 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
|
|||||||
aNbSubBases = theSubBases.length();
|
aNbSubBases = theSubBases.length();
|
||||||
aNbLocs = theLocations.length();
|
aNbLocs = theLocations.length();
|
||||||
|
|
||||||
if( aNbLocs && aNbBases != aNbLocs)
|
if (aNbLocs && aNbBases != aNbLocs)
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
Handle(GEOM_Object) aPath = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
|
||||||
(thePath->GetStudyID(), thePath->GetEntry());
|
if (aPath.IsNull())
|
||||||
if(aPath.IsNull())
|
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
for (ind = 0; ind < aNbBases; ind++) {
|
for (ind = 0; ind < aNbBases; ind++) {
|
||||||
if (theBases[ind] == NULL) continue;
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->
|
if (aBase.IsNull())
|
||||||
GetObject(theBases[ind]->GetStudyID(), theBases[ind]->GetEntry());
|
|
||||||
if(aBase.IsNull())
|
|
||||||
continue;
|
continue;
|
||||||
if(aNbLocs) {
|
if (aNbLocs) {
|
||||||
Handle(GEOM_Object) aLoc = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
|
||||||
(theLocations[ind]->GetStudyID(), theLocations[ind]->GetEntry());
|
if (aLoc.IsNull())
|
||||||
if(aLoc.IsNull())
|
|
||||||
continue;
|
continue;
|
||||||
aSeqLocations->Append(aLoc);
|
aSeqLocations->Append(aLoc);
|
||||||
}
|
}
|
||||||
aSeqBases->Append(aBase);
|
aSeqBases->Append(aBase);
|
||||||
|
|
||||||
if(aNbSubBases>=aNbBases) {
|
if (aNbSubBases >= aNbBases) {
|
||||||
Handle(GEOM_Object) aSubBase = GetOperations()->GetEngine()->
|
Handle(GEOM_Object) aSubBase = GetObjectImpl(theSubBases[ind]);
|
||||||
GetObject(theSubBases[ind]->GetStudyID(), theSubBases[ind]->GetEntry());
|
if (aSubBase.IsNull()) {
|
||||||
if(aSubBase.IsNull()) {
|
|
||||||
aSeqSubBases->Clear();
|
aSeqSubBases->Clear();
|
||||||
aNbSubBases = 0;
|
aNbSubBases = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
aSeqSubBases->Append(aSubBase);
|
aSeqSubBases->Append(aSubBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!aSeqBases->Length())
|
if (!aSeqBases->Length())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
// Make pipe
|
// Make pipe
|
||||||
@ -1002,26 +917,23 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
|
|||||||
aNbBases = theBases.length();
|
aNbBases = theBases.length();
|
||||||
aNbLocs = theLocations.length();
|
aNbLocs = theLocations.length();
|
||||||
|
|
||||||
if( aNbLocs && aNbBases != aNbLocs)
|
if (aNbLocs && aNbBases != aNbLocs)
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
for (ind = 0; ind < aNbBases; ind++) {
|
for (ind = 0; ind < aNbBases; ind++) {
|
||||||
if (theBases[ind] == NULL) continue;
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->
|
if (aBase.IsNull())
|
||||||
GetObject(theBases[ind]->GetStudyID(), theBases[ind]->GetEntry());
|
|
||||||
if(aBase.IsNull())
|
|
||||||
continue;
|
continue;
|
||||||
if(aNbLocs) {
|
if (aNbLocs) {
|
||||||
Handle(GEOM_Object) aLoc = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aLoc = GetObjectImpl(theLocations[ind]);
|
||||||
(theLocations[ind]->GetStudyID(), theLocations[ind]->GetEntry());
|
if (aLoc.IsNull())
|
||||||
if(aLoc.IsNull())
|
|
||||||
continue;
|
continue;
|
||||||
aSeqLocations->Append(aLoc);
|
aSeqLocations->Append(aLoc);
|
||||||
}
|
}
|
||||||
aSeqBases->Append(aBase);
|
aSeqBases->Append(aBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!aSeqBases->Length())
|
if (!aSeqBases->Length())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
// Make pipe
|
// Make pipe
|
||||||
@ -1050,15 +962,10 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theBase == NULL || thePath == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
|
||||||
(theBase->GetStudyID(), theBase->GetEntry());
|
Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
|
||||||
Handle(GEOM_Object) aPath = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
|
||||||
(thePath->GetStudyID(), thePath->GetEntry());
|
|
||||||
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
|
|
||||||
if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
#include "GEOM_IBasicOperations_i.hh"
|
#include "GEOM_IBasicOperations_i.hh"
|
||||||
@ -68,7 +68,6 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointXYZ
|
|||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
//Create the point
|
//Create the point
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->MakePointXYZ(theX, theY, theZ);
|
Handle(GEOM_Object) anObject = GetOperations()->MakePointXYZ(theX, theY, theZ);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
@ -89,18 +88,13 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointWithReference
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if(theReference == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference point
|
//Get the reference point
|
||||||
|
Handle(GEOM_Object) aReference = GetObjectImpl(theReference);
|
||||||
Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
|
if (aReference.IsNull()) return aGEOMObject._retn();
|
||||||
(theReference->GetStudyID(), theReference->GetEntry());
|
|
||||||
if (aRefernce.IsNull()) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Create the point
|
//Create the point
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePointWithReference(aRefernce, theX, theY, theZ);
|
GetOperations()->MakePointWithReference(aReference, theX, theY, theZ);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -120,18 +114,12 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theLine1 == NULL || theLine2 == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference Lines
|
//Get the reference Lines
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(theLine1);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(theLine2);
|
||||||
(theLine1->GetStudyID(), theLine1->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theLine2->GetStudyID(), theLine2->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the point
|
//Create the point
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePointOnLinesIntersection(aRef1, aRef2);
|
GetOperations()->MakePointOnLinesIntersection(aRef1, aRef2);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
@ -140,7 +128,6 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
|
|||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakePointOnCurve
|
* MakePointOnCurve
|
||||||
@ -154,25 +141,19 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theCurve == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference curve
|
//Get the reference curve
|
||||||
|
Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
|
||||||
Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
|
if (aReference.IsNull()) return aGEOMObject._retn();
|
||||||
(theCurve->GetStudyID(), theCurve->GetEntry());
|
|
||||||
if (aRefernce.IsNull()) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Create the point
|
//Create the point
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePointOnCurve(aRefernce, theParameter);
|
GetOperations()->MakePointOnCurve(aReference, theParameter);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakePointOnSurface
|
* MakePointOnSurface
|
||||||
@ -188,16 +169,13 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurface
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theSurface == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference surface
|
//Get the reference surface
|
||||||
Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aReference = GetObjectImpl(theSurface);
|
||||||
(theSurface->GetStudyID(), theSurface->GetEntry());
|
if (aReference.IsNull()) return aGEOMObject._retn();
|
||||||
if (aRefernce.IsNull()) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Create the point
|
//Create the point
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePointOnSurface(aRefernce, theUParameter, theVParameter);
|
GetOperations()->MakePointOnSurface(aReference, theUParameter, theVParameter);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -218,25 +196,19 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentOnCurve
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theCurve == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference curve
|
//Get the reference curve
|
||||||
|
Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
|
||||||
|
if (aReference.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
|
//Create the vector
|
||||||
(theCurve->GetStudyID(), theCurve->GetEntry());
|
|
||||||
if (aRefernce.IsNull()) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Create the point
|
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakeTangentOnCurve(aRefernce, theParameter);
|
GetOperations()->MakeTangentOnCurve(aReference, theParameter);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakeVectorDXDYDZ
|
* MakeVectorDXDYDZ
|
||||||
@ -272,20 +244,13 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeVectorTwoPnt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt1);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(thePnt2);
|
||||||
(thePnt1->GetStudyID(), thePnt1->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePnt2->GetStudyID(), thePnt2->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the vector
|
//Create the vector
|
||||||
|
Handle(GEOM_Object) anObject = GetOperations()->MakeVectorTwoPnt(aRef1, aRef2);
|
||||||
Handle(GEOM_Object) anObject =
|
|
||||||
GetOperations()->MakeVectorTwoPnt(aRef1, aRef2);
|
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -306,20 +271,13 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLine
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL || theDir == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference objects
|
//Get the reference objects
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(theDir);
|
||||||
(thePnt->GetStudyID(), thePnt->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theDir->GetStudyID(), theDir->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the Line
|
//Create the Line
|
||||||
|
Handle(GEOM_Object) anObject = GetOperations()->MakeLine(aRef1, aRef2);
|
||||||
Handle(GEOM_Object) anObject =
|
|
||||||
GetOperations()->MakeLine(aRef1, aRef2);
|
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -339,20 +297,13 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoPnt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt1);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(thePnt2);
|
||||||
(thePnt1->GetStudyID(), thePnt1->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePnt2->GetStudyID(), thePnt2->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the Line
|
//Create the Line
|
||||||
|
Handle(GEOM_Object) anObject = GetOperations()->MakeLineTwoPnt(aRef1, aRef2);
|
||||||
Handle(GEOM_Object) anObject =
|
|
||||||
GetOperations()->MakeLineTwoPnt(aRef1, aRef2);
|
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -372,18 +323,12 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoFaces
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theFace1 == NULL || theFace2 == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(theFace1);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(theFace2);
|
||||||
(theFace1->GetStudyID(), theFace1->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theFace2->GetStudyID(), theFace2->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the Line
|
//Create the Line
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakeLineTwoFaces(aRef1, aRef2);
|
GetOperations()->MakeLineTwoFaces(aRef1, aRef2);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
@ -392,6 +337,7 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoFaces
|
|||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakePlanePntVec
|
* MakePlanePntVec
|
||||||
@ -406,18 +352,12 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlanePntVec
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the references
|
//Get the references
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(theVec);
|
||||||
(thePnt->GetStudyID(), thePnt->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theVec->GetStudyID(), theVec->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the plane
|
//Create the plane
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePlanePntVec(aRef1, aRef2, theTrimSize);
|
GetOperations()->MakePlanePntVec(aRef1, aRef2, theTrimSize);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
@ -440,22 +380,14 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneThreePnt
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL)
|
|
||||||
return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
|
Handle(GEOM_Object) aRef1 = GetObjectImpl(thePnt1);
|
||||||
Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aRef2 = GetObjectImpl(thePnt2);
|
||||||
(thePnt1->GetStudyID(), thePnt1->GetEntry());
|
Handle(GEOM_Object) aRef3 = GetObjectImpl(thePnt3);
|
||||||
Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePnt2->GetStudyID(), thePnt2->GetEntry());
|
|
||||||
Handle(GEOM_Object) aRef3 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePnt3->GetStudyID(), thePnt3->GetEntry());
|
|
||||||
if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull())
|
if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the plane
|
//Create the plane
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePlaneThreePnt(aRef1, aRef2, aRef3, theTrimSize);
|
GetOperations()->MakePlaneThreePnt(aRef1, aRef2, aRef3, theTrimSize);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
@ -477,16 +409,11 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneFace
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theFace == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference face
|
//Get the reference face
|
||||||
|
Handle(GEOM_Object) aRef = GetObjectImpl(theFace);
|
||||||
Handle(GEOM_Object) aRef = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theFace->GetStudyID(), theFace->GetEntry());
|
|
||||||
if (aRef.IsNull()) return aGEOMObject._retn();
|
if (aRef.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the plane
|
//Create the plane
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakePlaneFace(aRef, theTrimSize);
|
GetOperations()->MakePlaneFace(aRef, theTrimSize);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
@ -538,16 +465,11 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentPlaneOnFace
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theFace == NULL) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference face
|
//Get the reference face
|
||||||
|
Handle(GEOM_Object) aRef = GetObjectImpl(theFace);
|
||||||
Handle(GEOM_Object) aRef = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theFace->GetStudyID(), theFace->GetEntry());
|
|
||||||
if (aRef.IsNull()) return aGEOMObject._retn();
|
if (aRef.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the plane
|
//Create the plane
|
||||||
|
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakeTangentPlaneOnFace(aRef, theParameterU,theParameterV,theTrimSize);
|
GetOperations()->MakeTangentPlaneOnFace(aRef, theParameterU,theParameterV,theTrimSize);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
@ -555,4 +477,3 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentPlaneOnFace
|
|||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
#include "GEOM_IMeasureOperations_i.hh"
|
#include "GEOM_IMeasureOperations_i.hh"
|
||||||
@ -69,8 +69,7 @@ GEOM::GEOM_IKindOfShape::shape_kind GEOM_IMeasureOperations_i::KindOfShape
|
|||||||
GEOM::ListOfDouble_var aDoublesArray = new GEOM::ListOfDouble();
|
GEOM::ListOfDouble_var aDoublesArray = new GEOM::ListOfDouble();
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (!aShape.IsNull()) {
|
if (!aShape.IsNull()) {
|
||||||
Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
|
Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
|
||||||
@ -117,12 +116,8 @@ void GEOM_IMeasureOperations_i::GetPosition
|
|||||||
Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.;
|
Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.;
|
||||||
Zz = Xx = 1.;
|
Zz = Xx = 1.;
|
||||||
|
|
||||||
if (theShape == NULL) return;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -142,12 +137,8 @@ GEOM::GEOM_Object_ptr GEOM_IMeasureOperations_i::GetCentreOfMass
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (CORBA::is_nil(theShape)) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return aGEOMObject._retn();
|
if (aShape.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
// Make Point - centre of mass of theShape
|
// Make Point - centre of mass of theShape
|
||||||
@ -172,20 +163,14 @@ GEOM::GEOM_Object_ptr GEOM_IMeasureOperations_i::GetNormal
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (CORBA::is_nil(theFace)) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
|
||||||
(theFace->GetStudyID(), theFace->GetEntry());
|
|
||||||
|
|
||||||
if (aFace.IsNull()) return aGEOMObject._retn();
|
if (aFace.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
// Get the OptionalPoint (can be not defined)
|
||||||
|
Handle(GEOM_Object) anOptionalPoint = GetObjectImpl(theOptionalPoint);
|
||||||
|
|
||||||
// Make Vector - normal to theFace (in point theOptionalPoint if the face is not planar)
|
// Make Vector - normal to theFace (in point theOptionalPoint if the face is not planar)
|
||||||
Handle(GEOM_Object) anOptionalPoint;
|
|
||||||
if (!CORBA::is_nil(theOptionalPoint)) {
|
|
||||||
anOptionalPoint = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theOptionalPoint->GetStudyID(), theOptionalPoint->GetEntry());
|
|
||||||
}
|
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->GetNormal(aFace, anOptionalPoint);
|
Handle(GEOM_Object) anObject = GetOperations()->GetNormal(aFace, anOptionalPoint);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
@ -206,12 +191,8 @@ void GEOM_IMeasureOperations_i::GetBasicProperties (GEOM::GEOM_Object_ptr theSha
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL) return;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -233,12 +214,8 @@ void GEOM_IMeasureOperations_i::GetInertia
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL) return;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -262,12 +239,8 @@ void GEOM_IMeasureOperations_i::GetBoundingBox (GEOM::GEOM_Object_ptr theShape,
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL) return;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -288,12 +261,8 @@ void GEOM_IMeasureOperations_i::GetTolerance
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL) return;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -314,15 +283,14 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckShape (GEOM::GEOM_Object_ptr theS
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL)
|
if (CORBA::is_nil(theShape))
|
||||||
{
|
{
|
||||||
theDescription = CORBA::string_dup("null");
|
theDescription = CORBA::string_dup("null");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull())
|
if (aShape.IsNull())
|
||||||
{
|
{
|
||||||
@ -347,15 +315,14 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckShapeWithGeometry (GEOM::GEOM_Obj
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL)
|
if (CORBA::is_nil(theShape))
|
||||||
{
|
{
|
||||||
theDescription = CORBA::string_dup("null");
|
theDescription = CORBA::string_dup("null");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull())
|
if (aShape.IsNull())
|
||||||
{
|
{
|
||||||
@ -384,12 +351,8 @@ char* GEOM_IMeasureOperations_i::WhatIs (GEOM::GEOM_Object_ptr theShape)
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape == NULL) return NULL;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
(theShape->GetStudyID(), theShape->GetEntry());
|
|
||||||
|
|
||||||
if (aShape.IsNull()) return NULL;
|
if (aShape.IsNull()) return NULL;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -410,14 +373,9 @@ CORBA::Double GEOM_IMeasureOperations_i::GetMinDistance
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape1 == NULL || theShape2 == NULL) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
|
||||||
(theShape1->GetStudyID(), theShape1->GetEntry());
|
Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
|
||||||
Handle(GEOM_Object) aShape2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theShape2->GetStudyID(), theShape2->GetEntry());
|
|
||||||
|
|
||||||
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
|
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -436,14 +394,9 @@ void GEOM_IMeasureOperations_i::PointCoordinates (GEOM::GEOM_Object_ptr theShape
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if ( theShape->_is_nil() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject(
|
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
|
||||||
theShape->GetStudyID(), theShape->GetEntry() );
|
if (aShape.IsNull())
|
||||||
|
|
||||||
if ( aShape.IsNull() )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get shape parameters
|
// Get shape parameters
|
||||||
@ -461,14 +414,9 @@ CORBA::Double GEOM_IMeasureOperations_i::GetAngle (GEOM::GEOM_Object_ptr theShap
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theShape1 == NULL || theShape2 == NULL) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shapes
|
//Get the reference shapes
|
||||||
Handle(GEOM_Object) aShape1 = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
|
||||||
(theShape1->GetStudyID(), theShape1->GetEntry());
|
Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
|
||||||
Handle(GEOM_Object) aShape2 = GetOperations()->GetEngine()->GetObject
|
|
||||||
(theShape2->GetStudyID(), theShape2->GetEntry());
|
|
||||||
|
|
||||||
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
|
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
|
||||||
|
|
||||||
// Get the angle
|
// Get the angle
|
||||||
@ -487,18 +435,13 @@ CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByParam
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if(theCurve==NULL) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theCurve);
|
||||||
(theCurve->GetStudyID(), theCurve->GetEntry());
|
|
||||||
|
|
||||||
if(aShape.IsNull()) return -1.0;
|
if(aShape.IsNull()) return -1.0;
|
||||||
|
|
||||||
return GetOperations()->CurveCurvatureByParam(aShape,theParam);
|
return GetOperations()->CurveCurvatureByParam(aShape,theParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* CurveCurvatureByPoint
|
* CurveCurvatureByPoint
|
||||||
@ -510,14 +453,9 @@ CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByPoint
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if( theCurve==NULL || thePoint==NULL ) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theCurve);
|
||||||
(theCurve->GetStudyID(), theCurve->GetEntry());
|
Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
|
||||||
Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePoint->GetStudyID(), thePoint->GetEntry());
|
|
||||||
|
|
||||||
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
|
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
|
||||||
|
|
||||||
return GetOperations()->CurveCurvatureByPoint(aShape,aPoint);
|
return GetOperations()->CurveCurvatureByPoint(aShape,aPoint);
|
||||||
@ -537,18 +475,13 @@ CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByParam
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if(theSurf==NULL) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
|
||||||
(theSurf->GetStudyID(), theSurf->GetEntry());
|
|
||||||
|
|
||||||
if(aShape.IsNull()) return -1.0;
|
if(aShape.IsNull()) return -1.0;
|
||||||
|
|
||||||
return GetOperations()->MaxSurfaceCurvatureByParam(aShape,theUParam,theVParam);
|
return GetOperations()->MaxSurfaceCurvatureByParam(aShape,theUParam,theVParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MaxSurfaceCurvatureByPoint
|
* MaxSurfaceCurvatureByPoint
|
||||||
@ -560,20 +493,14 @@ CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByPoint
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if( theSurf==NULL || thePoint==NULL ) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
|
||||||
(theSurf->GetStudyID(), theSurf->GetEntry());
|
Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
|
||||||
Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
|
|
||||||
(thePoint->GetStudyID(), thePoint->GetEntry());
|
|
||||||
|
|
||||||
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
|
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
|
||||||
|
|
||||||
return GetOperations()->MaxSurfaceCurvatureByPoint(aShape,aPoint);
|
return GetOperations()->MaxSurfaceCurvatureByPoint(aShape,aPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MinSurfaceCurvatureByParam
|
* MinSurfaceCurvatureByParam
|
||||||
@ -587,18 +514,13 @@ CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByParam
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if(theSurf==NULL) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
|
||||||
(theSurf->GetStudyID(), theSurf->GetEntry());
|
if (aShape.IsNull()) return -1.0;
|
||||||
|
|
||||||
if(aShape.IsNull()) return -1.0;
|
|
||||||
|
|
||||||
return GetOperations()->MinSurfaceCurvatureByParam(aShape,theUParam,theVParam);
|
return GetOperations()->MinSurfaceCurvatureByParam(aShape,theUParam,theVParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MinSurfaceCurvatureByPoint
|
* MinSurfaceCurvatureByPoint
|
||||||
@ -610,15 +532,10 @@ CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByPoint
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if( theSurf==NULL || thePoint==NULL ) return -1.0;
|
|
||||||
|
|
||||||
//Get the reference shape
|
//Get the reference shape
|
||||||
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
|
||||||
(theSurf->GetStudyID(), theSurf->GetEntry());
|
Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
|
||||||
Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
|
if (aShape.IsNull() || aPoint.IsNull()) return -1.0;
|
||||||
(thePoint->GetStudyID(), thePoint->GetEntry());
|
|
||||||
|
|
||||||
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
|
|
||||||
|
|
||||||
return GetOperations()->MinSurfaceCurvatureByPoint(aShape,aPoint);
|
return GetOperations()->MinSurfaceCurvatureByPoint(aShape,aPoint);
|
||||||
}
|
}
|
||||||
|
@ -137,3 +137,19 @@ GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObjec
|
|||||||
GEOM::GEOM_Object_var GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
|
GEOM::GEOM_Object_var GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
|
||||||
return GO._retn();
|
return GO._retn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
/*!
|
||||||
|
* GetObjectImpl
|
||||||
|
*/
|
||||||
|
//=============================================================================
|
||||||
|
Handle(GEOM_Object) GEOM_IOperations_i::GetObjectImpl(GEOM::GEOM_Object_ptr theObject)
|
||||||
|
{
|
||||||
|
Handle(GEOM_Object) anImpl;
|
||||||
|
if (!CORBA::is_nil(theObject)) {
|
||||||
|
CORBA::String_var anEntry = theObject->GetEntry();
|
||||||
|
anImpl = GetImpl()->GetEngine()->GetObject
|
||||||
|
(theObject->GetStudyID(), anEntry);
|
||||||
|
}
|
||||||
|
return anImpl;
|
||||||
|
}
|
||||||
|
@ -47,6 +47,7 @@ class GEOM_I_EXPORT GEOM_IOperations_i : public virtual POA_GEOM::GEOM_IOperatio
|
|||||||
virtual CORBA::Long GetStudyID();
|
virtual CORBA::Long GetStudyID();
|
||||||
|
|
||||||
virtual GEOM::GEOM_Object_ptr GetObject(Handle(GEOM_Object) theObject);
|
virtual GEOM::GEOM_Object_ptr GetObject(Handle(GEOM_Object) theObject);
|
||||||
|
virtual Handle(GEOM_Object) GetObjectImpl(GEOM::GEOM_Object_ptr theObject);
|
||||||
|
|
||||||
virtual void StartOperation();
|
virtual void StartOperation();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user