-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019 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
GEOM::ListOfDouble_var aDoublesArray = new GEOM::ListOfDouble();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (!aShape.IsNull()) {
Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
Zz = Xx = 1.;
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return;
// Get shape parameters
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return aGEOMObject._retn();
// Make Point - centre of mass of theShape
- Handle(GEOM_Object) anObject = GetOperations()->GetCentreOfMass(aShape);
+ Handle(::GEOM_Object) anObject = GetOperations()->GetCentreOfMass(aShape);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if ( aShape.IsNull() ) return aGEOMObject._retn();
// Get vertex by index
- Handle(GEOM_Object) anObject = GetOperations()->GetVertexByIndex(aShape, theIndex);
+ Handle(::GEOM_Object) anObject = GetOperations()->GetVertexByIndex(aShape, theIndex);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
+ Handle(::GEOM_Object) aFace = GetObjectImpl(theFace);
if (aFace.IsNull()) return aGEOMObject._retn();
// Get the OptionalPoint (can be not defined)
- Handle(GEOM_Object) anOptionalPoint = GetObjectImpl(theOptionalPoint);
+ Handle(::GEOM_Object) anOptionalPoint = GetObjectImpl(theOptionalPoint);
// Make Vector - normal to theFace (in point theOptionalPoint if the face is not planar)
- Handle(GEOM_Object) anObject = GetOperations()->GetNormal(aFace, anOptionalPoint);
+ Handle(::GEOM_Object) anObject = GetOperations()->GetNormal(aFace, anOptionalPoint);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
*/
//=============================================================================
void GEOM_IMeasureOperations_i::GetBasicProperties (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Double theTolerance,
CORBA::Double& theLength,
CORBA::Double& theSurfArea,
CORBA::Double& theVolume)
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return;
// Get shape parameters
- GetOperations()->GetBasicProperties(aShape, theLength, theSurfArea, theVolume);
+ GetOperations()->GetBasicProperties(aShape, theTolerance, theLength,
+ theSurfArea, theVolume);
}
//=============================================================================
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return;
// Get shape parameters
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return;
// Get shape parameters
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return aGEOMObject._retn();
// Make Box - bounding box of theShape
- Handle(GEOM_Object) anObject =
+ Handle(::GEOM_Object) anObject =
GetOperations()->GetBoundingBox(aShape, precise);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return;
// Get shape parameters
}
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull())
{
}
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull())
{
const GEOM::GEOM_IMeasureOperations::ShapeErrors &theErrors)
{
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) {
return NULL;
GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
// Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (!aShape.IsNull()) {
GEOMImpl_IMeasureOperations::SICheckLevel aCheckLevel;
GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
// Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (!aShape.IsNull()) {
Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
return isGood;
}
+//=============================================================================
+/*!
+ * CheckBOPArguments
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IMeasureOperations_i::CheckBOPArguments
+ (GEOM::GEOM_Object_ptr theShape)
+{
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Get the reference shape
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
+ bool isGood = false;
+
+ if (!aShape.IsNull()) {
+ // Check BOP arguments
+ isGood = GetOperations()->CheckBOPArguments(aShape);
+ }
+
+ return isGood;
+}
+
//=============================================================================
/*!
* FastIntersect
GEOM::ListOfLong_var anIntegersArray2 = new GEOM::ListOfLong();
// Get the reference shape
- Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
- Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+ Handle(::GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+ Handle(::GEOM_Object) aShape2 = GetObjectImpl(theShape2);
if (!aShape1.IsNull() && !aShape2.IsNull()) {
Handle(TColStd_HSequenceOfInteger) anIntegers1 = new TColStd_HSequenceOfInteger;
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return CORBA::string_dup("WRN_NULL_OBJECT_OR_SHAPE");
// Get shape parameters
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return NULL;
// Get shape parameters
//Set a not done flag
GetOperations()->SetNotDone();
- unsigned int nb_points = theCoords.length()/3;
+ int nb_points = theCoords.length()/3;
GEOM::ListOfBool_var aResults = new GEOM::ListOfBool;
aResults->length(nb_points);
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
std::vector<double> tmp(3*nb_points);
for (int i = 0; i < 3*nb_points; i++)
tmp[i] = theCoords[i];
std::vector<bool> res = GetOperations()->AreCoordsInside(aShape, tmp, tolerance);
- for (int i = 0; i < nb_points; i++)
- aResults[i] = i < res.size() ? res[i] : false;
+ for (int i = 0, resSize = res.size(); i < nb_points; i++)
+ aResults[i] = i < resSize ? res[i] : false;
return aResults._retn();
}
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
- Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+ Handle(::GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+ Handle(::GEOM_Object) aShape2 = GetObjectImpl(theShape2);
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
// Get shape parameters
GEOM::ListOfDouble_var aDoublesArray = new GEOM::ListOfDouble();
//Get the reference shape
- Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
- Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+ Handle(::GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+ Handle(::GEOM_Object) aShape2 = GetObjectImpl(theShape2);
if (!aShape1.IsNull() && !aShape2.IsNull()) {
Handle(TColStd_HSequenceOfReal) aDoubles = new TColStd_HSequenceOfReal;
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull())
return;
GetOperations()->SetNotDone();
//Get the reference shapes
- Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
- Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+ Handle(::GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+ Handle(::GEOM_Object) aShape2 = GetObjectImpl(theShape2);
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
// Get the angle
GetOperations()->SetNotDone();
//Get the reference shapes
- Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
- Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+ Handle(::GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+ Handle(::GEOM_Object) aShape2 = GetObjectImpl(theShape2);
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
// Get the angle
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theCurve);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theCurve);
if(aShape.IsNull()) return -1.0;
return GetOperations()->CurveCurvatureByParam(aShape,theParam);
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theCurve);
- Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theCurve);
+ Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint);
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
return GetOperations()->CurveCurvatureByPoint(aShape,aPoint);
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theSurf);
if(aShape.IsNull()) return -1.0;
return GetOperations()->MaxSurfaceCurvatureByParam(aShape,theUParam,theVParam);
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
- Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theSurf);
+ Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint);
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
return GetOperations()->MaxSurfaceCurvatureByPoint(aShape,aPoint);
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theSurf);
if (aShape.IsNull()) return -1.0;
return GetOperations()->MinSurfaceCurvatureByParam(aShape,theUParam,theVParam);
GetOperations()->SetNotDone();
//Get the reference shape
- Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
- Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+ Handle(::GEOM_Object) aShape = GetObjectImpl(theSurf);
+ Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint);
if (aShape.IsNull() || aPoint.IsNull()) return -1.0;
return GetOperations()->MinSurfaceCurvatureByPoint(aShape,aPoint);