Removed unused code

This commit is contained in:
Alexey SOZINOV 2022-08-15 17:04:00 +03:00 committed by jfa
parent 39ff0b5f09
commit f6bdbc8b8e
5 changed files with 10 additions and 179 deletions

View File

@ -42,54 +42,6 @@
namespace
{
//=======================================================================
//function : GetPairsOfFaultyShapes
//purpose :
//=======================================================================
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> GetPairsOfFaultyShapes(
const BOPAlgo_ArgumentAnalyzer& theAnalyzer,
const BOPAlgo_CheckStatus theErrorStatus)
{
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> aResList;
const BOPAlgo_ListOfCheckResult& aResult = theAnalyzer.GetCheckResult();
BOPAlgo_ListIteratorOfListOfCheckResult anIt(aResult);
for (; anIt.More(); anIt.Next())
{
if (anIt.Value().GetCheckStatus() == theErrorStatus)
{
auto aFaultyShapes = anIt.Value().GetFaultyShapes1();
aResList.Append({ aFaultyShapes.First(),
aFaultyShapes.Size() == 1 ? TopoDS_Shape() : aFaultyShapes.Last() });
}
}
return aResList;
}
//=======================================================================
//function : GetListOfSmallEdges
//purpose :
//=======================================================================
TopTools_ListOfShape GetListOfSmallEdges(const BOPAlgo_ArgumentAnalyzer& theAnalyzer)
{
TopTools_ListOfShape aResList;
const BOPAlgo_ListOfCheckResult& aResult = theAnalyzer.GetCheckResult();
BOPAlgo_ListIteratorOfListOfCheckResult anIt(aResult);
for (; anIt.More(); anIt.Next())
{
if (anIt.Value().GetCheckStatus() == BOPAlgo_CheckStatus::BOPAlgo_TooSmallEdge)
{
auto aFaultyShapes = anIt.Value().GetFaultyShapes1();
aResList.Append(aFaultyShapes.First());
}
}
return aResList;
}
//=======================================================================
//function : ConvertShapesToIndices
//purpose : Convert sub-shapes of shapes to sequence of indices
@ -176,34 +128,6 @@ Standard_Integer GEOMImpl_ConformityDriver::Execute(Handle(TFunction_Logbook)& l
switch (aType)
{
case CONFORMITY_DISTANT_SHAPES:
{
Standard_Integer aType1 = aCI.GetShapeType1();
Standard_Integer aType2 = aCI.GetShapeType2();
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> aRes;
if (aType1 == -1 && aType2 == -1)
{
aRes = distantShapes(aShape);
}
else if (aType1 == -1)
{
aRes = distantShapes(aShape, (TopAbs_ShapeEnum)aType2);
}
else if (aType2 == -1)
{
aRes = distantShapes(aShape, (TopAbs_ShapeEnum)aType1);
}
else
{
aRes = distantShapes(aShape, (TopAbs_ShapeEnum)aType1, (TopAbs_ShapeEnum)aType2);
}
if (!aRes.IsEmpty())
{
Handle(TColStd_HArray2OfInteger) anArray = ConvertShapesToIndices(aShape, aRes);
aCI.SetListOfShapesIndices(anArray);
}
}
break;
case CONFORMITY_UPDATE_TOL:
{
Standard_Real aTolerance = updateTolerance(aShape);
@ -226,76 +150,9 @@ Standard_Integer GEOMImpl_ConformityDriver::Execute(Handle(TFunction_Logbook)& l
}
//=======================================================================
//function : distantShapes
//purpose : TODO: Not implemented! Wait for required functionality!
//function : checkShape
//purpose :
//=======================================================================
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> GEOMImpl_ConformityDriver::distantShapes(
const TopoDS_Shape& theShape,
const TopAbs_ShapeEnum theShapeType,
const TopAbs_ShapeEnum theSubShapeType,
Standard_Real theTolerance) const
{
// TODO: Not implemented! Wait for required functionality!
return NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>>();
}
//=======================================================================
//function : distantShapes
//purpose : TODO: Not implemented! Wait for required functionality!
//=======================================================================
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> GEOMImpl_ConformityDriver::distantShapes(
const TopoDS_Shape& theShape,
const TopAbs_ShapeEnum theShapeType,
Standard_Real theTolerance) const
{
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> aDistShapes;
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> aDistShapesTmp;
switch (theShapeType)
{
case TopAbs_VERTEX:
aDistShapesTmp = distantShapes(theShape, TopAbs_EDGE, theShapeType, theTolerance);
aDistShapes.Append(aDistShapesTmp);
aDistShapesTmp = distantShapes(theShape, TopAbs_FACE, theShapeType, theTolerance);
aDistShapes.Append(aDistShapesTmp);
break;
case TopAbs_EDGE:
aDistShapesTmp = distantShapes(theShape, theShapeType, TopAbs_VERTEX, theTolerance);
aDistShapes.Append(aDistShapesTmp);
aDistShapesTmp = distantShapes(theShape, TopAbs_FACE, theShapeType, theTolerance);
aDistShapes.Append(aDistShapesTmp);
break;
case TopAbs_FACE:
aDistShapesTmp = distantShapes(theShape, theShapeType, TopAbs_VERTEX, theTolerance);
aDistShapes.Append(aDistShapesTmp);
aDistShapesTmp = distantShapes(theShape, theShapeType, TopAbs_EDGE, theTolerance);
aDistShapes.Append(aDistShapesTmp);
break;
}
return aDistShapes;
}
//=======================================================================
//function : distantShapes
//purpose : TODO: Not implemented! Wait for required functionality!
//=======================================================================
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> GEOMImpl_ConformityDriver::distantShapes
(const TopoDS_Shape& theShape,
Standard_Real theTolerance) const
{
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> aDistShapes;
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> aDistShapesTmp;
aDistShapesTmp = distantShapes(theShape, TopAbs_EDGE, TopAbs_VERTEX, theTolerance);
aDistShapes.Append(aDistShapesTmp);
aDistShapesTmp = distantShapes(theShape, TopAbs_FACE, TopAbs_VERTEX, theTolerance);
aDistShapes.Append(aDistShapesTmp);
aDistShapesTmp = distantShapes(theShape, TopAbs_FACE, TopAbs_EDGE, theTolerance);
aDistShapes.Append(aDistShapesTmp);
return aDistShapes;
}
void GEOMImpl_ConformityDriver::checkShape(const TopoDS_Shape & theShape,
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>>& theFailedShape,
Handle(TColStd_HArray1OfInteger)& theTypesOfCheck) const

View File

@ -42,19 +42,6 @@ public:
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)&) const {}
private:
Standard_EXPORT NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> distantShapes(const TopoDS_Shape& theShape,
const TopAbs_ShapeEnum theShapeType,
const TopAbs_ShapeEnum theSubShapeType,
Standard_Real theTolerance = -1.) const;
Standard_EXPORT NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> distantShapes(const TopoDS_Shape& theShape,
const TopAbs_ShapeEnum theShapeType,
Standard_Real theTolerance = -1.) const;
Standard_EXPORT NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>> distantShapes(const TopoDS_Shape& theShape,
Standard_Real theTolerance = -1.) const;
Standard_EXPORT void checkShape(const TopoDS_Shape& theShape,
NCollection_List<std::pair<TopoDS_Shape, TopoDS_Shape>>& theFailedShape,
Handle(TColStd_HArray1OfInteger)& theTypesOfCheck) const;

View File

@ -2805,14 +2805,6 @@ std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects>
MESSAGE("GEOMImpl_IMeasureOperations::selfIntersected2D");
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects> aSelfInters2D;
Handle(GEOM_Object) aConformity = GetEngine()->AddObject(GEOM_CHECKCONFORMITY);
Handle(GEOM_Function) aFunction = aConformity->AddFunction(GEOMImpl_ConformityDriver::GetID(), CONFORMITY_SELFINTERSECTED);
if (aFunction.IsNull()) return aSelfInters2D;
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ConformityDriver::GetID()) return aSelfInters2D;
GEOMImpl_IConformity aCI(aFunction);
try
{
OCC_CATCH_SIGNALS;

View File

@ -399,13 +399,8 @@
#define TD_GET_IN_PLACE_BY_HISTORY 3
// Conformity operations
#define CONFORMITY_IS_VALID 2
#define CONFORMITY_SELFINTERSECTED 3
#define CONFORMITY_INTERFERENCE 4
#define CONFORMITY_SMALL_EDGES 5
#define CONFORMITY_DISTANT_SHAPES 6
#define CONFORMITY_UPDATE_TOL 7
#define CONFORMITY_CHECK_SHAPE 8
#define CONFORMITY_UPDATE_TOL 2
#define CONFORMITY_CHECK_SHAPE 3
// Plugins specified constants
#define PLUGIN_NAME "Plugin Name"

View File

@ -1261,13 +1261,13 @@ GEOM::GEOM_IMeasureOperations::SequenceOfPairOfShape* GEOM_IMeasureOperations_i:
std::list<GEOMImpl_IMeasureOperations::FailedChecks> aResults;
ConvertToList(theResuts, aResults);
std::list<GEOMImpl_IMeasureOperations::FailedShapes> aSelfInters = GetOperations()->SelfIntersected2D(aResults);
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects> aSelfInters = GetOperations()->SelfIntersected2D(aResults);
if (!GetOperations()->IsDone() || aSelfInters.empty())
return aSeq._retn();
Standard_Integer aLength = aSelfInters.size();
aSeq->length(aLength);
std::list<GEOMImpl_IMeasureOperations::FailedShapes>::iterator anIter(aSelfInters.begin());
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects>::iterator anIter(aSelfInters.begin());
for (Standard_Integer i = 0; i < aLength; i++, ++anIter)
{
aSeq[i].first = GetObject(Handle(::GEOM_Object)::DownCast((*anIter).first));
@ -1298,14 +1298,14 @@ GEOM::GEOM_IMeasureOperations::SequenceOfPairOfShape* GEOM_IMeasureOperations_i:
std::list<GEOMImpl_IMeasureOperations::FailedChecks> aResults;
ConvertToList(theResuts, aResults);
std::list<GEOMImpl_IMeasureOperations::FailedShapes> aSelfInterf =
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects> aSelfInterf =
GetOperations()->InterferingSubshapes(aResults, theShapeType1, theShapeType2);
if (!GetOperations()->IsDone() || aSelfInterf.empty())
return aSeq._retn();
Standard_Integer aLength = aSelfInterf.size();
aSeq->length(aLength);
std::list<GEOMImpl_IMeasureOperations::FailedShapes>::iterator anIter(aSelfInterf.begin());
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects>::iterator anIter(aSelfInterf.begin());
for (Standard_Integer i = 0; i < aLength; i++, ++anIter)
{
aSeq[i].first = GetObject(Handle(::GEOM_Object)::DownCast((*anIter).first));
@ -1365,14 +1365,14 @@ GEOM::GEOM_IMeasureOperations::SequenceOfPairOfShape* GEOM_IMeasureOperations_i:
ConvertToList(theResuts, aResults);
// Perform patch face operation
std::list<GEOMImpl_IMeasureOperations::FailedShapes> aDistantS =
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects> aDistantS =
GetOperations()->DistantShapes(aResults, theShapeType, theSubShapeType, theTolerance);
if (!GetOperations()->IsDone() || aDistantS.empty())
return aSeq._retn();
Standard_Integer aLength = aDistantS.size();
aSeq->length(aLength);
std::list<GEOMImpl_IMeasureOperations::FailedShapes>::iterator anIter(aDistantS.begin());
std::list<GEOMImpl_IMeasureOperations::CoupleOfObjects>::iterator anIter(aDistantS.begin());
for (Standard_Integer i = 0; i < aLength; i++, ++anIter)
{
aSeq[i].first = GetObject(Handle(::GEOM_Object)::DownCast((*anIter).first));