#include <BOPCol_ListOfShape.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_MapOfPassKey.hxx>
-#include <BRep_Builder.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
-#include <TopoDS_Compound.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
int geom_type = theShape->GetType();
// check if it's advanced shape
- if ( geom_type > ADVANCED_BASE ) {
+ if ( geom_type > USER_TYPE ) {
SetErrorCode(OK);
return SK_ADVANCED;
}
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
gp_Ax3 anAx3 = GEOMUtils::GetPosition(aShape);
//Compute the CentreOfMass value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute centre of mass");
return NULL;
//Compute
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vertex by index driver failed.");
return NULL;
//Compute the Normale value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute normake of face");
return NULL;
//Compute the parameters
GProp_GProps LProps, SProps;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
BRepGProp::LinearProperties(aShape, LProps);
theLength = LProps.Mass();
GProp_GProps System;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (aShape.ShapeType() == TopAbs_VERTEX ||
aShape.ShapeType() == TopAbs_EDGE ||
aShape.ShapeType() == TopAbs_WIRE) {
Bnd_Box B;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
BRepBuilderAPI_Copy aCopyTool (aShape);
if (!aCopyTool.IsDone()) {
SetErrorCode("GetBoundingBox Error: Bad shape detected");
//Compute the BoundingBox value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute a bounding box");
return NULL;
FaceMax = EdgeMax = VertMax = -RealLast();
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
for (TopExp_Explorer ExF (aShape, TopAbs_FACE); ExF.More(); ExF.Next()) {
TopoDS_Face Face = TopoDS::Face(ExF.Current());
T = BRep_Tool::Tolerance(Face);
//Compute the parameters
bool isValid = false;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
BRepCheck_Analyzer ana (aShape, theIsCheckGeom);
if (ana.IsValid()) {
isValid = true;
if (aShape.IsNull()) return isGood;
// 0. Prepare data
- BRep_Builder aBB;
- TopoDS_Compound aCS;
TopoDS_Shape aScopy;
//
GEOMAlgo_AlgoTools::CopyShape(aShape, aScopy);
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aScopy, anIndices);
- aBB.MakeCompound(aCS);
- aBB.Add(aCS, aScopy);
-
BOPCol_ListOfShape aLCS;
aLCS.Append(aScopy);
//
// 1. Launch the checker
aCSI.Perform();
Standard_Integer iErr = aCSI.ErrorStatus();
- if (iErr) {
- return false; // Error
- }
isGood = true;
//
isGood = false;
}
- SetErrorCode(OK);
+ if (!iErr) {
+ SetErrorCode(OK);
+ }
+
return isGood;
}
Astr = Astr + " Number of sub-shapes : \n";
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
int iType, nbTypes [TopAbs_SHAPE];
for (iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypes[iType] = 0;
//Compute the parameters
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
gp_Pnt aPnt1, aPnt2;
// Compute the extremities
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
// skl 30.06.2008
// additional workaround for bugs 19899, 19908 and 19910 from Mantis
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
theX = aPnt.X();
theY = aPnt.Y();
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Edge E1 = TopoDS::Edge(aLine1);
TopoDS_Edge E2 = TopoDS::Edge(aLine2);
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Edge aE1 = TopoDS::Edge(aVec1);
TopoDS_Edge aE2 = TopoDS::Edge(aVec2);
//Compute curvature
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GeomLProp_CLProps Prop = GeomLProp_CLProps
(aCurve, aP, 2, Precision::Confusion());
aRes = fabs(Prop.Curvature());
//Compute curvature
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GeomAPI_ProjectPointOnCurve PPCurve(aPoint, aCurve, aFP, aLP);
if(PPCurve.NbPoints()>0) {
GeomLProp_CLProps Prop = GeomLProp_CLProps
if (aSurf.IsNull()) return aRes;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GeomLProp_SLProps Prop = GeomLProp_SLProps
(aSurf, theUParam, theVParam, 2, Precision::Confusion());
if(Prop.IsCurvatureDefined()) {