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
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);
}
//=======================================================================
-//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,
- 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!
+//function : checkShape
+//purpose :
//=======================================================================
-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
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));
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));
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));