Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated copyright message
[modules/geom.git]
/
src
/
GEOMImpl
/
GEOMImpl_IHealingOperations.cxx
diff --git
a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
index 3a2b133052d3b55f86d381d145efd9f3bfb9eab2..240113ec931c7768b0eb1a29faed09ceb9c47556 100644
(file)
--- a/
src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
+++ b/
src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
14 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-20
23 CEA, EDF
, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-25,7
+25,6
@@
#endif
#include <Standard_Version.hxx>
#endif
#include <Standard_Version.hxx>
-#include <Standard_Stream.hxx>
#include <GEOMImpl_IHealingOperations.hxx>
#include <GEOM_PythonDump.hxx>
#include <GEOMImpl_IHealingOperations.hxx>
#include <GEOM_PythonDump.hxx>
@@
-35,20
+34,17
@@
#include <GEOMImpl_IVector.hxx>
#include <GEOMImpl_VectorDriver.hxx>
#include <GEOMImpl_CopyDriver.hxx>
#include <GEOMImpl_IVector.hxx>
#include <GEOMImpl_VectorDriver.hxx>
#include <GEOMImpl_CopyDriver.hxx>
-
-#include <
Basics_OCCTVersion
.hxx>
+#include <ShHealOper_ModifStats.hxx>
+#include <
ShHealOper_ShapeProcess
.hxx>
#include <utilities.h>
#include <utilities.h>
-#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <BRep_Builder.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <BRep_Builder.hxx>
-#include <ShHealOper_ShapeProcess.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <TColStd_HArray1OfExtendedString.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TCollection_AsciiString.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <TColStd_HArray1OfExtendedString.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TCollection_AsciiString.hxx>
-#include <TDF_Tool.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Compound.hxx>
@@
-61,9
+57,10
@@
* constructor:
*/
//=============================================================================
* constructor:
*/
//=============================================================================
-GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine
, int theDocID
)
-: GEOM_IOperations(theEngine
, theDocID
)
+GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
{
+ myModifStats = new ShHealOper_ModifStats;
MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations");
}
MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations");
}
@@
-74,6
+71,7
@@
GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine
//=============================================================================
GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations()
{
//=============================================================================
GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations()
{
+ delete myModifStats;
MESSAGE("GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations");
}
MESSAGE("GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations");
}
@@
-116,7
+114,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SHAPE_PROCESS);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SHAPE_PROCESS);
@@
-134,6
+132,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec
HI.SetParameters( theParams );
HI.SetValues( theValues );
}
HI.SetParameters( theParams );
HI.SetValues( theValues );
}
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-144,10
+143,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure
& aFail
)
{
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-273,6
+271,11
@@
bool GEOMImpl_IHealingOperations::GetParameters (const std::string theOperation,
} else if( theOperation == "DropSmallEdges" ) {
theParams.push_back( "DropSmallEdges.Tolerance3d" );
} else if( theOperation == "DropSmallEdges" ) {
theParams.push_back( "DropSmallEdges.Tolerance3d" );
+ } else if( theOperation == "DropSmallSolids" ) {
+ theParams.push_back( "DropSmallSolids.WidthFactorThreshold" );
+ theParams.push_back( "DropSmallSolids.VolumeThreshold" );
+ theParams.push_back( "DropSmallSolids.MergeSolids" );
+
} else if( theOperation == "BSplineRestriction" ) {
theParams.push_back( "BSplineRestriction.SurfaceMode" );
theParams.push_back( "BSplineRestriction.Curve3dMode" );
} else if( theOperation == "BSplineRestriction" ) {
theParams.push_back( "BSplineRestriction.SurfaceMode" );
theParams.push_back( "BSplineRestriction.Curve3dMode" );
@@
-327,7
+330,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(G
etDocID(), G
EOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SUPPRESS_FACES);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SUPPRESS_FACES);
@@
-341,6
+344,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces
GEOMImpl_IHealing HI (aFunction);
HI.SetFaces(theFaces);
HI.SetOriginal(aLastFunction);
GEOMImpl_IHealing HI (aFunction);
HI.SetFaces(theFaces);
HI.SetOriginal(aLastFunction);
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-351,10
+355,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure
& aFail
)
{
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-394,7
+397,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CLOSE_CONTOUR);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CLOSE_CONTOUR);
@@
-409,6
+412,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour
HI.SetWires( theWires );
HI.SetIsCommonVertex( isCommonVertex );
HI.SetOriginal( aLastFunction );
HI.SetWires( theWires );
HI.SetIsCommonVertex( isCommonVertex );
HI.SetOriginal( aLastFunction );
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-419,10
+423,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure
& aFail
)
{
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-462,7
+465,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INT_WIRES);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INT_WIRES);
@@
-476,6
+479,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires
GEOMImpl_IHealing HI(aFunction);
HI.SetWires( theWires );
HI.SetOriginal( aLastFunction );
GEOMImpl_IHealing HI(aFunction);
HI.SetWires( theWires );
HI.SetOriginal( aLastFunction );
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-486,10
+490,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure
& aFail
)
{
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-528,7
+531,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object)
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), FILL_HOLES);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), FILL_HOLES);
@@
-542,6
+545,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object)
GEOMImpl_IHealing HI(aFunction);
HI.SetWires( theWires );
HI.SetOriginal( aLastFunction );
GEOMImpl_IHealing HI(aFunction);
HI.SetWires( theWires );
HI.SetOriginal( aLastFunction );
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-552,10
+556,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object)
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure
& aFail
)
{
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-600,7
+603,7
@@
GEOMImpl_IHealingOperations::Sew (std::list<Handle(GEOM_Object)>& theObjects,
}
// Add a new object
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING);
//Add the function
int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING);
@@
-616,6
+619,7
@@
GEOMImpl_IHealingOperations::Sew (std::list<Handle(GEOM_Object)>& theObjects,
HI.SetTolerance( theTolerance );
HI.SetOriginal( theObjects.front()->GetLastFunction() ); objects->Remove(1);
HI.SetShapes( objects );
HI.SetTolerance( theTolerance );
HI.SetOriginal( theObjects.front()->GetLastFunction() ); objects->Remove(1);
HI.SetShapes( objects );
+ HI.SetStatistics( myModifStats );
//Compute the result
try {
//Compute the result
try {
@@
-626,9
+630,8
@@
GEOMImpl_IHealingOperations::Sew (std::list<Handle(GEOM_Object)>& theObjects,
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-668,7
+671,7
@@
GEOMImpl_IHealingOperations::RemoveInternalFaces (std::list< Handle(GEOM_Object)
}
// Add a new object
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(G
etDocID(), G
EOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
//Add the function
Handle(GEOM_Function)
//Add the function
Handle(GEOM_Function)
@@
-682,6
+685,7
@@
GEOMImpl_IHealingOperations::RemoveInternalFaces (std::list< Handle(GEOM_Object)
GEOMImpl_IHealing HI (aFunction);
HI.SetOriginal( theSolids.front()->GetLastFunction() ); objects->Remove(1);
HI.SetShapes( objects );
GEOMImpl_IHealing HI (aFunction);
HI.SetOriginal( theSolids.front()->GetLastFunction() ); objects->Remove(1);
HI.SetShapes( objects );
+ HI.SetStatistics( myModifStats );
//Compute the result
try {
//Compute the result
try {
@@
-692,9
+696,8
@@
GEOMImpl_IHealingOperations::RemoveInternalFaces (std::list< Handle(GEOM_Object)
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-725,7
+728,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE);
@@
-741,6
+744,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
HI.SetDevideEdgeValue( theValue );
HI.SetIsByParameter( isByParameter );
HI.SetOriginal( aLastFunction );
HI.SetDevideEdgeValue( theValue );
HI.SetIsByParameter( isByParameter );
HI.SetOriginal( aLastFunction );
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-750,9
+754,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-770,23
+773,28
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
*/
//=============================================================================
Handle(GEOM_Object)
*/
//=============================================================================
Handle(GEOM_Object)
-GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object) theObject,
- int theIndex,
-
Handle(GEOM_Object) thePoint
)
+GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object)
theObject,
+ int
theIndex,
+
std::list< Handle(GEOM_Object)> & thePoints
)
{
// set error code, check parameters
SetErrorCode(KO);
{
// set error code, check parameters
SetErrorCode(KO);
- if (theObject.IsNull() || thePoint
.IsNull()
)
+ if (theObject.IsNull() || thePoint
s.empty()
)
return NULL;
Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
return NULL;
Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
- Handle(GEOM_Function) aPointFunc = thePoint->GetLastFunction();
- if (aLastFunction.IsNull() || aPointFunc.IsNull())
+ if (aLastFunction.IsNull() )
return NULL; //There is no function which creates an object to be processed
return NULL; //There is no function which creates an object to be processed
+ Handle(TColStd_HSequenceOfTransient) aPointFunc = GEOM_Object::GetLastFunctions( thePoints );
+ if ( aPointFunc.IsNull() || aPointFunc->IsEmpty() ) {
+ SetErrorCode("NULL argument points");
+ return NULL;
+ }
+
// Add a new object
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( G
etDocID(), G
EOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT);
@@
-798,12
+806,11
@@
GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object) theObject,
// prepare "data container" class IHealing
GEOMImpl_IHealing HI(aFunction);
// prepare "data container" class IHealing
GEOMImpl_IHealing HI(aFunction);
- HI.SetIndex( theIndex );
- HI.SetOriginal( aLastFunction );
+ HI.SetIndex ( theIndex );
+ HI.SetOriginal ( aLastFunction );
+ HI.SetShapes ( aPointFunc );
- Handle(TColStd_HSequenceOfTransient) funSeq = new TColStd_HSequenceOfTransient;
- funSeq->Append( aPointFunc );
- HI.SetShapes( funSeq );
+ HI.SetStatistics( myModifStats );
//Compute the translation
try {
//Compute the translation
try {
@@
-813,16
+820,15
@@
GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object) theObject,
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
//Make a Python command
GEOM::TPythonDump(aFunction)
<< aNewObject << " = geompy.DivideEdgeByPoint(" << theObject
return NULL;
}
//Make a Python command
GEOM::TPythonDump(aFunction)
<< aNewObject << " = geompy.DivideEdgeByPoint(" << theObject
- << ", " << theIndex << ", " << thePoint << ")";
+ << ", " << theIndex << ", " << thePoint
s
<< ")";
SetErrorCode(OK);
return aNewObject;
SetErrorCode(OK);
return aNewObject;
@@
-842,7
+848,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire
if (theWire.IsNull()) return NULL;
// Add a new object
if (theWire.IsNull()) return NULL;
// Add a new object
- Handle(GEOM_Object) aRes = GetEngine()->AddObject(
GetDocID(),
theWire->GetType());
+ Handle(GEOM_Object) aRes = GetEngine()->AddObject(theWire->GetType());
// Add a new function
Handle(GEOM_Function) aFunction;
// Add a new function
Handle(GEOM_Function) aFunction;
@@
-853,6
+859,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire
if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL;
GEOMImpl_IHealing aCI (aFunction);
if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL;
GEOMImpl_IHealing aCI (aFunction);
+ aCI.SetStatistics( myModifStats );
Handle(GEOM_Function) aRefShape = theWire->GetLastFunction();
if (aRefShape.IsNull()) return NULL;
Handle(GEOM_Function) aRefShape = theWire->GetLastFunction();
if (aRefShape.IsNull()) return NULL;
@@
-878,9
+885,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-954,7
+960,7
@@
bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTra
TopExp_Explorer anExp;
for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
TopExp_Explorer anExp;
for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
- anObj = GetEngine()->AddObject( G
etDocID(), G
EOM_FREE_BOUNDS );
+ anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
@@
-962,7
+968,7
@@
bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTra
}
for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
}
for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
- anObj = GetEngine()->AddObject( G
etDocID(), G
EOM_FREE_BOUNDS );
+ anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
@@
-1039,6
+1045,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_
// prepare "data container" class IVector
GEOMImpl_IVector aVI (aFunction);
aVI.SetCurve(aLastFunction);
// prepare "data container" class IVector
GEOMImpl_IVector aVI (aFunction);
aVI.SetCurve(aLastFunction);
+
+ myModifStats->Clear();
+ myModifStats->AddModif( "Vector reversed" );
}
else {
//Add the function
}
else {
//Add the function
@@
-1051,6
+1060,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_
// prepare "data container" class IHealing
GEOMImpl_IHealing HI (aFunction);
HI.SetOriginal(aLastFunction);
// prepare "data container" class IHealing
GEOMImpl_IHealing HI (aFunction);
HI.SetOriginal(aLastFunction);
+ HI.SetStatistics( myModifStats );
}
//Compute the translation
}
//Compute the translation
@@
-1061,9
+1071,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-1093,7
+1102,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
return NULL; //There is no function which creates an object to be processed
// Add a new object
return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(G
etDocID(), theObject->GetType()
);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(G
EOM_COPY
);
if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066
//Add the function
if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066
//Add the function
@@
-1106,6
+1115,9
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
// prepare "data container" class IVector
GEOMImpl_IVector aVI (aFunction);
aVI.SetCurve(aLastFunction);
// prepare "data container" class IVector
GEOMImpl_IVector aVI (aFunction);
aVI.SetCurve(aLastFunction);
+
+ myModifStats->Clear();
+ myModifStats->AddModif( "Vector reversed" );
}
else {
//Add the function
}
else {
//Add the function
@@
-1118,6
+1130,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
// prepare "data container" class IHealing
GEOMImpl_IHealing aHI (aFunction);
aHI.SetOriginal(aLastFunction);
// prepare "data container" class IHealing
GEOMImpl_IHealing aHI (aFunction);
aHI.SetOriginal(aLastFunction);
+ aHI.SetStatistics( myModifStats );
}
// Compute the result
}
// Compute the result
@@
-1128,9
+1141,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
@@
-1148,7
+1160,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Object) theObject,
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Object) theObject,
- double theTolerance)
+ double theTolerance,
+ TopAbs_ShapeEnum theType)
{
// Set error code, check parameters
SetErrorCode(KO);
{
// Set error code, check parameters
SetErrorCode(KO);
@@
-1161,7
+1174,7
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj
return NULL; // There is no function which creates an object to be processed
// Add a new object
return NULL; // There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(
GetDocID(),
theObject->GetType());
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(theObject->GetType());
// Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE);
// Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE);
@@
-1176,6
+1189,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj
GEOMImpl_IHealing HI (aFunction);
HI.SetOriginal(aLastFunction);
HI.SetTolerance(theTolerance);
GEOMImpl_IHealing HI (aFunction);
HI.SetOriginal(aLastFunction);
HI.SetTolerance(theTolerance);
+ HI.SetType(theType);
+ HI.SetStatistics( myModifStats );
// Compute
try {
// Compute
try {
@@
-1185,9
+1200,8
@@
Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj
return NULL;
}
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}