//=============================================================================
/*!
- * GetEdge
+ * GetPoint
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetPoint
TopoDS_Shape aBlockOrComp = theShape->GetValue();
if (aBlockOrComp.IsNull()) {
- SetErrorCode("Block or compound is null");
- return NULL;
- }
- if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
- aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
- aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
- SetErrorCode("Shape is neither a block, nor a compound of blocks");
+ SetErrorCode("Given shape is null");
return NULL;
}
TopoDS_Shape aBlockOrComp = theShape->GetValue();
if (aBlockOrComp.IsNull()) {
- SetErrorCode("Block or compound is null");
- return NULL;
- }
- if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
- aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
- aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
- SetErrorCode("Shape is neither a block, nor a compound of blocks");
+ SetErrorCode("Given shape is null");
return NULL;
}
TopoDS_Shape aBlockOrComp = theShape->GetValue();
if (aBlockOrComp.IsNull()) {
- SetErrorCode("Block or compound is null");
- return NULL;
- }
- if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
- aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
- aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
- SetErrorCode("Shape is neither a block, nor a compound of blocks");
+ SetErrorCode("Given shape is null");
return NULL;
}
}
}
+ if (nbEdges == 0) {
+ SetErrorCode("Given shape contains no edges");
+ return NULL;
+ }
+
mapShape.Clear();
Standard_Integer ind = 1;
TopTools_Array1OfShape anEdges (1, nbEdges);
SetErrorCode("Block or compound is null");
return NULL;
}
- if (aBlockOrComp.ShapeType() != TopAbs_SOLID &&
- aBlockOrComp.ShapeType() != TopAbs_COMPOUND &&
- aBlockOrComp.ShapeType() != TopAbs_COMPSOLID) {
- SetErrorCode("Shape is neither a block, nor a compound of blocks");
- return NULL;
- }
TopoDS_Shape anArg1 = thePoint1->GetValue();
TopoDS_Shape anArg2 = thePoint2->GetValue();