#include <Bnd_Box2d.hxx>
#include <Bnd_B2d.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_Array1OfBoolean.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-
-#include <BRepMesh_MapOfIntegerInteger.hxx>
-#include <BRepMesh_HeapSortIndexedVertexOfDelaun.hxx>
-#include <BRepMesh_ComparatorOfIndexedVertexOfDelaun.hxx>
-#include <BRepMesh_HeapSortIndexedVertexOfDelaun.hxx>
#include <BRepMesh_SelectorOfDataStructureOfDelaun.hxx>
-#include <BRepMesh_HeapSortVertexOfDelaun.hxx>
-#include <BRepMesh_ComparatorOfVertexOfDelaun.hxx>
-#include <BRepMesh_Array1OfVertexOfDelaun.hxx>
#include <BRepMesh_Edge.hxx>
#include <BRepMesh_Vertex.hxx>
#include <NCollection_Vector.hxx>
-typedef TColStd_ListIteratorOfListOfInteger IteratorOnListOfInteger;
-typedef TColStd_ListOfInteger ListOfInteger;
+#include <algorithm>
const Standard_Real AngDeviation1Deg = M_PI/180.;
const Standard_Real AngDeviation90Deg = 90 * AngDeviation1Deg;
const Standard_Real Angle2PI = 2 * M_PI;
-const Standard_Real Precision = Precision::PConfusion();
-const Standard_Real Precision2 = Precision * Precision;
-const gp_XY SortingDirection(M_SQRT1_2, M_SQRT1_2);
+const Standard_Real Precision = Precision::PConfusion();
+const Standard_Real Precision2 = Precision * Precision;
+
+namespace {
+ //! Sort two points in projection on vector (1,1)
+ struct ComparatorOfVertexOfDelaun
+ {
+ bool operator() (const BRepMesh_Vertex& theLeft, const BRepMesh_Vertex& theRight)
+ {
+ return theLeft.Coord().X() + theLeft.Coord().Y() < theRight.Coord().X() + theRight.Coord().Y();
+ }
+ };
+
+ //! Sort two points in projection on vector (1,1)
+ struct ComparatorOfIndexedVertexOfDelaun
+ {
+ public:
+ ComparatorOfIndexedVertexOfDelaun (const Handle(BRepMesh_DataStructureOfDelaun)& theDS)
+ : myStructure(theDS) {}
+
+ bool operator() (Standard_Integer theLeft, Standard_Integer theRight)
+ {
+ const BRepMesh_Vertex& aLeft = myStructure->GetNode(theLeft);
+ const BRepMesh_Vertex& aRight = myStructure->GetNode(theRight);
+ return ComparatorOfVertexOfDelaun() (aLeft, aRight);
+ }
+
+ private:
+ Handle(BRepMesh_DataStructureOfDelaun) myStructure;
+ };
+} // anonymous namespace
//=======================================================================
//function : BRepMesh_Delaun
//purpose : Creates the triangulation with an empty Mesh data structure
//=======================================================================
-BRepMesh_Delaun::BRepMesh_Delaun( BRepMesh_Array1OfVertexOfDelaun& theVertices,
- const Standard_Boolean isPositive )
+BRepMesh_Delaun::BRepMesh_Delaun( BRepMeshCol::Array1OfVertexOfDelaun& theVertices,
+ const Standard_Boolean isPositive )
: myIsPositiveOrientation( isPositive ),
myCircles( theVertices.Length(), new NCollection_IncAllocator() )
{
//purpose : Creates the triangulation with and existent Mesh data structure
//=======================================================================
BRepMesh_Delaun::BRepMesh_Delaun( const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh,
- BRepMesh_Array1OfVertexOfDelaun& theVertices,
+ BRepMeshCol::Array1OfVertexOfDelaun& theVertices,
const Standard_Boolean isPositive )
: myIsPositiveOrientation( isPositive ),
myCircles( theVertices.Length(), theOldMesh->Allocator() )
//purpose : Creates the triangulation with and existent Mesh data structure
//=======================================================================
BRepMesh_Delaun::BRepMesh_Delaun( const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh,
- TColStd_Array1OfInteger& theVertexIndices,
+ BRepMeshCol::Array1OfInteger& theVertexIndices,
const Standard_Boolean isPositive )
: myIsPositiveOrientation( isPositive ),
myCircles( theVertexIndices.Length(), theOldMesh->Allocator() )
//function : Init
//purpose : Initializes the triangulation with an Array of Vertex
//=======================================================================
-void BRepMesh_Delaun::Init( BRepMesh_Array1OfVertexOfDelaun& theVertices )
+void BRepMesh_Delaun::Init( BRepMeshCol::Array1OfVertexOfDelaun& theVertices )
{
Bnd_Box2d aBox;
Standard_Integer aLowerIdx = theVertices.Lower();
Standard_Integer anUpperIdx = theVertices.Upper();
- TColStd_Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx );
+ BRepMeshCol::Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx );
Standard_Integer anIndex = aLowerIdx;
for ( ; anIndex <= anUpperIdx; ++anIndex )
//function : perform
//purpose : Create super mesh and run triangulation procedure
//=======================================================================
-void BRepMesh_Delaun::perform( Bnd_Box2d& theBndBox,
- TColStd_Array1OfInteger& theVertexIndexes )
+void BRepMesh_Delaun::perform( Bnd_Box2d& theBndBox,
+ BRepMeshCol::Array1OfInteger& theVertexIndexes )
{
theBndBox.Enlarge( Precision );
superMesh( theBndBox );
- BRepMesh_HeapSortIndexedVertexOfDelaun::Sort( theVertexIndexes,
- BRepMesh_ComparatorOfIndexedVertexOfDelaun( SortingDirection,
- Precision, myMeshData ) );
+ ComparatorOfIndexedVertexOfDelaun aCmp(myMeshData);
+ std::make_heap(theVertexIndexes.begin(), theVertexIndexes.end(), aCmp);
+ std::sort_heap(theVertexIndexes.begin(), theVertexIndexes.end(), aCmp);
compute( theVertexIndexes );
}
mySupVert[2] = aTmp;
}
- Standard_Integer anEdgeId[3];
-
+ Standard_Integer e[3];
+ Standard_Boolean o[3];
for (Standard_Integer aNodeId = 0; aNodeId < 3; ++aNodeId)
{
Standard_Integer aFirstNode = aNodeId;
Standard_Integer aLastNode = (aNodeId + 1) % 3;
- anEdgeId[aNodeId] = myMeshData->AddLink( BRepMesh_Edge(
+ Standard_Integer aLinkIndex = myMeshData->AddLink( BRepMesh_Edge(
mySupVert[aFirstNode], mySupVert[aLastNode], BRepMesh_Free ) );
+
+ e[aNodeId] = Abs(aLinkIndex);
+ o[aNodeId] = (aLinkIndex > 0);
}
- mySupTrian = BRepMesh_Triangle(
- Abs( anEdgeId[0] ), Abs( anEdgeId[1] ), Abs( anEdgeId[2] ),
- ( anEdgeId[0] > 0 ), ( anEdgeId[1] > 0 ), ( anEdgeId[2] > 0),
- BRepMesh_Free);
+ mySupTrian = BRepMesh_Triangle(e, o, BRepMesh_Free);
}
//=======================================================================
// edges into the map.
// When an edge is suppressed more than one time it is destroyed.
//=======================================================================
-void BRepMesh_Delaun::deleteTriangle( const Standard_Integer theIndex,
- BRepMesh_MapOfIntegerInteger& theLoopEdges )
+void BRepMesh_Delaun::deleteTriangle( const Standard_Integer theIndex,
+ BRepMeshCol::MapOfIntegerInteger& theLoopEdges )
{
myCircles.Delete( theIndex );
Standard_Integer e[3];
Standard_Boolean o[3];
- GetTriangle( theIndex ).Edges( e[0], e[1], e[2],
- o[0], o[1], o[2] );
+ GetTriangle( theIndex ).Edges( e, o );
myMeshData->RemoveElement( theIndex );
//purpose : Computes the triangulation and add the vertices edges and
// triangles to the Mesh data structure
//=======================================================================
-void BRepMesh_Delaun::compute( TColStd_Array1OfInteger& theVertexIndexes )
+void BRepMesh_Delaun::compute( BRepMeshCol::Array1OfInteger& theVertexIndexes )
{
// Insertion of edges of super triangles in the list of free edges:
- BRepMesh_MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
+ BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
Standard_Integer e[3];
Standard_Boolean o[3];
- mySupTrian.Edges( e[0], e[1], e[2],
- o[0], o[1], o[2] );
+ mySupTrian.Edges( e, o );
aLoopEdges.Bind( e[0], Standard_True );
aLoopEdges.Bind( e[1], Standard_True );
aSelector.NeighboursOfNode( mySupVert[aSupVertId] );
aLoopEdges.Clear();
- BRepMesh_MapOfInteger::Iterator aFreeTriangles( aSelector.Elements() );
+ BRepMeshCol::MapOfInteger::Iterator aFreeTriangles( aSelector.Elements() );
for ( ; aFreeTriangles.More(); aFreeTriangles.Next() )
deleteTriangle( aFreeTriangles.Key(), aLoopEdges );
// All edges that remain free are removed from aLoopEdges;
// only the boundary edges of the triangulation remain there
- BRepMesh_MapOfIntegerInteger::Iterator aFreeEdges( aLoopEdges );
+ BRepMeshCol::MapOfIntegerInteger::Iterator aFreeEdges( aLoopEdges );
for ( ; aFreeEdges.More(); aFreeEdges.Next() )
{
- if ( myMeshData->ElemConnectedTo( aFreeEdges.Key() ).IsEmpty() )
+ if ( myMeshData->ElementsConnectedTo( aFreeEdges.Key() ).IsEmpty() )
myMeshData->RemoveLink( aFreeEdges.Key() );
}
//function : createTriangles
//purpose : Creates the triangles beetween the node and the polyline.
//=======================================================================
-void BRepMesh_Delaun::createTriangles ( const Standard_Integer theVertexIndex,
- BRepMesh_MapOfIntegerInteger& thePoly )
+void BRepMesh_Delaun::createTriangles ( const Standard_Integer theVertexIndex,
+ BRepMeshCol::MapOfIntegerInteger& thePoly )
{
- ListOfInteger aLoopEdges, anExternalEdges;
+ BRepMeshCol::ListOfInteger aLoopEdges, anExternalEdges;
const gp_XY& aVertexCoord = myMeshData->GetNode( theVertexIndex ).Coord();
- BRepMesh_MapOfIntegerInteger::Iterator anEdges( thePoly );
+ BRepMeshCol::MapOfIntegerInteger::Iterator anEdges( thePoly );
for ( ; anEdges.More(); anEdges.Next() )
{
Standard_Integer anEdgeId = anEdges.Key();
while ( !anExternalEdges.IsEmpty() )
{
const BRepMesh_PairOfIndex& aPair =
- myMeshData->ElemConnectedTo( Abs( anExternalEdges.First() ) );
+ myMeshData->ElementsConnectedTo( Abs( anExternalEdges.First() ) );
if ( !aPair.IsEmpty() )
for ( anEdges.Initialize( thePoly ); anEdges.More(); anEdges.Next() )
{
- if ( myMeshData->ElemConnectedTo( anEdges.Key() ).IsEmpty() )
+ if ( myMeshData->ElementsConnectedTo( anEdges.Key() ).IsEmpty() )
myMeshData->RemoveLink( anEdges.Key() );
}
//function : createTrianglesOnNewVertices
//purpose : Creation of triangles from the new nodes
//=======================================================================
-void BRepMesh_Delaun::createTrianglesOnNewVertices( TColStd_Array1OfInteger& theVertexIndexes )
+void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger& theVertexIndexes )
{
- BRepMesh_MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
+ BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
// Insertion of nodes :
Standard_Boolean isModify = Standard_True;
const BRepMesh_Vertex& aVertex = GetVertex( aVertexIdx );
// Iterator in the list of indexes of circles containing the node
- BRepMesh_ListOfInteger& aCirclesList = myCircles.Select( aVertex.Coord() );
+ BRepMeshCol::ListOfInteger& aCirclesList = myCircles.Select( aVertex.Coord() );
Standard_Integer onEgdeId = 0, aTriangleId = 0;
- BRepMesh_ListOfInteger::Iterator aCircleIt( aCirclesList );
+ BRepMeshCol::ListOfInteger::Iterator aCircleIt( aCirclesList );
for ( ; aCircleIt.More(); aCircleIt.Next() )
{
// To add a node in the mesh it is necessary to check conditions:
while ( isModify && !aCirclesList.IsEmpty() )
{
isModify = Standard_False;
- BRepMesh_ListOfInteger::Iterator aCircleIt1( aCirclesList );
+ BRepMeshCol::ListOfInteger::Iterator aCircleIt1( aCirclesList );
for ( ; aCircleIt1.More(); aCircleIt1.Next() )
{
Standard_Integer e[3];
Standard_Boolean o[3];
- GetTriangle( aCircleIt1.Value() ).Edges( e[0], e[1], e[2],
- o[0], o[1], o[2] );
+ GetTriangle( aCircleIt1.Value() ).Edges( e, o );
if ( aLoopEdges.IsBound( e[0] ) ||
aLoopEdges.IsBound( e[1] ) ||
}
}
// Check that internal edges are not crossed by triangles
- Handle(BRepMesh_MapOfInteger) anInternalEdges = InternalEdges();
+ BRepMeshCol::HMapOfInteger anInternalEdges = InternalEdges();
// Destruction of triancles intersecting internal edges
// and their replacement by makeshift triangles
- BRepMesh_MapOfInteger::Iterator anInernalEdgesIt( *anInternalEdges );
+ BRepMeshCol::MapOfInteger::Iterator anInernalEdgesIt( *anInternalEdges );
for ( ; anInernalEdgesIt.More(); anInernalEdgesIt.Next() )
{
Standard_Integer aNbC;
- aNbC = myMeshData->ElemConnectedTo( anInernalEdgesIt.Key() ).Extent();
+ aNbC = myMeshData->ElementsConnectedTo( anInernalEdgesIt.Key() ).Extent();
if ( aNbC == 0 )
{
meshLeftPolygonOf( anInernalEdgesIt.Key(), Standard_True );
const Standard_Integer thePrevElementId)
{
const BRepMesh_PairOfIndex& aPair =
- myMeshData->ElemConnectedTo( theRefLinkId );
+ myMeshData->ElementsConnectedTo( theRefLinkId );
if ( aPair.IsEmpty() )
return Standard_False;
Standard_Integer anEdges[3];
Standard_Boolean anEdgesOri[3];
- GetTriangle( aTriId ).Edges( anEdges[0], anEdges[1], anEdges[2],
- anEdgesOri[0], anEdgesOri[1], anEdgesOri[2] );
+ GetTriangle( aTriId ).Edges( anEdges, anEdgesOri );
for ( Standard_Integer anEdgeIt = 0; anEdgeIt < 3; ++anEdgeIt )
{
{
for(;;)
{
- BRepMesh_MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
- NCollection_Map<Standard_Integer> aDelTriangles;
+ BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
+ BRepMeshCol::MapOfInteger aDelTriangles;
- Handle(BRepMesh_MapOfInteger) aFreeEdges = FreeEdges();
- BRepMesh_MapOfInteger::Iterator aFreeEdgesIt( *aFreeEdges );
+ BRepMeshCol::HMapOfInteger aFreeEdges = FreeEdges();
+ BRepMeshCol::MapOfInteger::Iterator aFreeEdgesIt( *aFreeEdges );
for ( ; aFreeEdgesIt.More(); aFreeEdgesIt.Next() )
{
const Standard_Integer& aFreeEdgeId = aFreeEdgesIt.Key();
continue;
const BRepMesh_PairOfIndex& aPair =
- myMeshData->ElemConnectedTo( aFreeEdgeId );
+ myMeshData->ElementsConnectedTo( aFreeEdgeId );
if ( aPair.IsEmpty() )
{
aLoopEdges.Bind( aFreeEdgeId, Standard_True );
// Check that the connected triangle is not surrounded by another triangles
Standard_Integer anEdges[3];
Standard_Boolean anEdgesOri[3];
- GetTriangle( aTriId ).Edges( anEdges[0], anEdges[1], anEdges[2],
- anEdgesOri[0], anEdgesOri[1], anEdgesOri[2] );
+ GetTriangle( aTriId ).Edges( anEdges, anEdgesOri );
Standard_Boolean isCanNotBeRemoved = Standard_True;
for ( Standard_Integer aCurEdgeIdx = 0; aCurEdgeIdx < 3; ++aCurEdgeIdx )
{
Standard_Integer anOtherEdgeId = ( aCurEdgeIdx + anOtherEdgeIt ) % 3;
const BRepMesh_PairOfIndex& anOtherEdgePair =
- myMeshData->ElemConnectedTo( anEdges[anOtherEdgeId] );
+ myMeshData->ElementsConnectedTo( anEdges[anOtherEdgeId] );
if ( anOtherEdgePair.Extent() < 2 )
{
// Destruction of triangles :
Standard_Integer aDeletedTrianglesNb = 0;
- NCollection_Map<Standard_Integer>::Iterator aDelTrianglesIt( aDelTriangles );
+ BRepMeshCol::MapOfInteger::Iterator aDelTrianglesIt( aDelTriangles );
for ( ; aDelTrianglesIt.More(); aDelTrianglesIt.Next() )
{
deleteTriangle( aDelTrianglesIt.Key(), aLoopEdges );
}
// Destruction of remaining hanging edges
- BRepMesh_MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
+ BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() )
{
- if ( myMeshData->ElemConnectedTo( aLoopEdgesIt.Key() ).IsEmpty() )
+ if ( myMeshData->ElementsConnectedTo( aLoopEdgesIt.Key() ).IsEmpty() )
myMeshData->RemoveLink( aLoopEdgesIt.Key() );
}
//=======================================================================
void BRepMesh_Delaun::frontierAdjust()
{
- Handle(BRepMesh_MapOfInteger) aFrontier = Frontier();
- NCollection_Vector<Standard_Integer> aFailedFrontiers;
- BRepMesh_MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
- BRepMesh_Delaun::HandleOfMapOfInteger aIntFrontierEdges = new NCollection_Map<Standard_Integer>();
+ BRepMeshCol::HMapOfInteger aFrontier = Frontier();
+ BRepMeshCol::VectorOfInteger aFailedFrontiers;
+ BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
+ BRepMeshCol::HMapOfInteger aIntFrontierEdges = new BRepMeshCol::MapOfInteger;
for ( Standard_Integer aPass = 1; aPass <= 2; ++aPass )
{
// 1 pass): find external triangles on boundary edges;
// 2 pass): find external triangles on boundary edges appeared
// during triangles replacement.
- BRepMesh_MapOfInteger::Iterator aFrontierIt( *aFrontier );
+ BRepMeshCol::MapOfInteger::Iterator aFrontierIt( *aFrontier );
for ( ; aFrontierIt.More(); aFrontierIt.Next() )
{
Standard_Integer aFrontierId = aFrontierIt.Key();
- const BRepMesh_PairOfIndex& aPair = myMeshData->ElemConnectedTo( aFrontierId );
+ const BRepMesh_PairOfIndex& aPair = myMeshData->ElementsConnectedTo( aFrontierId );
Standard_Integer aNbElem = aPair.Extent();
for( Standard_Integer aElemIt = 1; aElemIt <= aNbElem; ++aElemIt )
{
Standard_Integer e[3];
Standard_Boolean o[3];
- GetTriangle( aPriorElemId ).Edges( e[0], e[1], e[2],
- o[0], o[1], o[2] );
+ GetTriangle( aPriorElemId ).Edges( e, o );
Standard_Boolean isTriangleFound = Standard_False;
for ( Standard_Integer n = 0; n < 3; ++n )
}
// destrucrion of remaining hanging edges :
- BRepMesh_MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
+ BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() )
{
Standard_Integer aLoopEdgeId = aLoopEdgesIt.Key();
- if (myMeshData->ElemConnectedTo( aLoopEdgeId ).IsEmpty() )
+ if (myMeshData->ElementsConnectedTo( aLoopEdgeId ).IsEmpty() )
myMeshData->RemoveLink( aLoopEdgeId );
}
for ( aFrontierIt.Reset(); aFrontierIt.More(); aFrontierIt.Next() )
{
Standard_Integer aFrontierId = aFrontierIt.Key();
- if ( !myMeshData->ElemConnectedTo( aFrontierId ).IsEmpty() )
+ if ( !myMeshData->ElementsConnectedTo( aFrontierId ).IsEmpty() )
continue;
Standard_Boolean isSuccess =
// situation when frontier edge has a triangle at a right side, but its free
// links cross another frontieres and meshLeftPolygonOf itself can't collect
// a closed polygon.
- NCollection_Vector<Standard_Integer>::Iterator aFailedFrontiersIt( aFailedFrontiers );
+ BRepMeshCol::VectorOfInteger::Iterator aFailedFrontiersIt( aFailedFrontiers );
for ( ; aFailedFrontiersIt.More(); aFailedFrontiersIt.Next() )
{
Standard_Integer aFrontierId = aFailedFrontiersIt.Value();
- if ( !myMeshData->ElemConnectedTo( aFrontierId ).IsEmpty() )
+ if ( !myMeshData->ElementsConnectedTo( aFrontierId ).IsEmpty() )
continue;
meshLeftPolygonOf( aFrontierId, Standard_True, aIntFrontierEdges );
//purpose : Add boundig box for edge defined by start & end point to
// the given vector of bounding boxes for triangulation edges
//=======================================================================
-void BRepMesh_Delaun::fillBndBox( NCollection_Sequence<Bnd_B2d>& theBoxes,
+void BRepMesh_Delaun::fillBndBox( BRepMeshCol::SequenceOfBndB2d& theBoxes,
const BRepMesh_Vertex& theV1,
const BRepMesh_Vertex& theV2 )
{
Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(
const Standard_Integer theStartEdgeId,
const Standard_Boolean isForward,
- BRepMesh_Delaun::HandleOfMapOfInteger theSkipped )
+ BRepMeshCol::HMapOfInteger theSkipped )
{
if ( !theSkipped.IsNull() && theSkipped->Contains( theStartEdgeId ) )
return Standard_True;
const BRepMesh_Edge& aRefEdge = GetEdge( theStartEdgeId );
- TColStd_SequenceOfInteger aPolygon;
+ BRepMeshCol::SequenceOfInteger aPolygon;
Standard_Integer aStartNode, aPivotNode;
if ( isForward )
{
// Auxilary structures.
// Bounding boxes of polygon links to be used for preliminary
// analysis of intersections
- NCollection_Sequence<Bnd_B2d> aBoxes;
+ BRepMeshCol::SequenceOfBndB2d aBoxes;
fillBndBox( aBoxes, aStartEdgeVertexS, aPivotVertex );
// Hanging ends
- NCollection_Map<Standard_Integer> aDeadLinks;
+ BRepMeshCol::MapOfInteger aDeadLinks;
// Links are temporarily excluded from consideration
- NCollection_Map<Standard_Integer> aLeprousLinks;
+ BRepMeshCol::MapOfInteger aLeprousLinks;
aLeprousLinks.Add( theStartEdgeId );
Standard_Boolean isSkipLeprous = Standard_True;
const Standard_Integer& thePivotNode,
const BRepMesh_Vertex& thePivotVertex,
const gp_Vec2d& theRefLinkDir,
- const NCollection_Sequence<Bnd_B2d>& theBoxes,
- const TColStd_SequenceOfInteger& thePolygon,
- const BRepMesh_Delaun::HandleOfMapOfInteger theSkipped,
+ const BRepMeshCol::SequenceOfBndB2d& theBoxes,
+ const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const BRepMeshCol::HMapOfInteger theSkipped,
const Standard_Boolean& isSkipLeprous,
- NCollection_Map<Standard_Integer>& theLeprousLinks,
- NCollection_Map<Standard_Integer>& theDeadLinks,
+ BRepMeshCol::MapOfInteger& theLeprousLinks,
+ BRepMeshCol::MapOfInteger& theDeadLinks,
Standard_Integer& theNextPivotNode,
gp_Vec2d& theNextLinkDir,
Bnd_B2d& theNextLinkBndBox )
RealFirst() : RealLast();
Standard_Integer aNextLinkId = 0;
- BRepMesh_ListOfInteger::Iterator aLinkIt( myMeshData->LinkNeighboursOf( thePivotNode ) );
+ BRepMeshCol::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( thePivotNode ) );
for ( ; aLinkIt.More(); aLinkIt.Next() )
{
const Standard_Integer& aNeighbourLinkInfo = aLinkIt.Value();
// Determine whether the link belongs to the mesh
if ( aNeighbourLink.Movability() == BRepMesh_Free &&
- myMeshData->ElemConnectedTo( aNeighbourLinkInfo ).IsEmpty() )
+ myMeshData->ElementsConnectedTo( aNeighbourLinkInfo ).IsEmpty() )
{
theDeadLinks.Add( aNeighbourLinkId );
continue;
// <theLinkBndBox> parameter.
//=======================================================================
Standard_Boolean BRepMesh_Delaun::checkIntersection(
- const BRepMesh_Edge& theLink,
- const TColStd_SequenceOfInteger& thePolygon,
- const NCollection_Sequence<Bnd_B2d>& thePolyBoxes,
- const Standard_Boolean isConsiderEndPointTouch,
- const Standard_Boolean isConsiderPointOnEdge,
- const Standard_Boolean isSkipLastEdge,
- Bnd_B2d& theLinkBndBox ) const
+ const BRepMesh_Edge& theLink,
+ const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes,
+ const Standard_Boolean isConsiderEndPointTouch,
+ const Standard_Boolean isConsiderPointOnEdge,
+ const Standard_Boolean isSkipLastEdge,
+ Bnd_B2d& theLinkBndBox ) const
{
theLinkBndBox.Add( GetVertex( theLink.FirstNode() ).Coord() );
theLinkBndBox.Add( GetVertex( theLink.LastNode() ).Coord() );
continue;
gp_Pnt2d anIntPnt;
- BRepMesh_WireInterferenceChecker::IntFlag aIntFlag =
- intSegSeg( theLink, aPolyLink, isConsiderEndPointTouch,
- isConsiderPointOnEdge, anIntPnt );
+ BRepMesh_GeomTool::IntFlag aIntFlag = intSegSeg( theLink, aPolyLink,
+ isConsiderEndPointTouch, isConsiderPointOnEdge, anIntPnt );
- if ( aIntFlag != BRepMesh_WireInterferenceChecker::NoIntersection )
+ if ( aIntFlag != BRepMesh_GeomTool::NoIntersection )
return Standard_False;
}
}
const Standard_Integer (&theNodesId)[3] )
{
Standard_Integer aNewTriangleId =
- myMeshData->AddElement( BRepMesh_Triangle(
- theEdgesId[0], theEdgesId[1], theEdgesId[2],
- theEdgesOri[0], theEdgesOri[1], theEdgesOri[2],
- BRepMesh_Free ) );
+ myMeshData->AddElement(BRepMesh_Triangle(theEdgesId,
+ theEdgesOri, BRepMesh_Free));
- Standard_Boolean isAdded = myCircles.Add(
+ Standard_Boolean isAdded = myCircles.Bind(
+ aNewTriangleId,
GetVertex( theNodesId[0] ).Coord(),
GetVertex( theNodesId[1] ).Coord(),
- GetVertex( theNodesId[2] ).Coord(),
- aNewTriangleId );
+ GetVertex( theNodesId[2] ).Coord() );
if ( !isAdded )
myMeshData->RemoveElement( aNewTriangleId );
//function : cleanupPolygon
//purpose : Remove internal triangles from the given polygon
//=======================================================================
-void BRepMesh_Delaun::cleanupPolygon( const TColStd_SequenceOfInteger& thePolygon,
- const NCollection_Sequence<Bnd_B2d>& thePolyBoxes )
+void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes )
{
Standard_Integer aPolyLen = thePolygon.Length();
if ( aPolyLen < 3 )
return;
- BRepMesh_MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
- NCollection_Map<Standard_Integer> anIgnoredEdges;
- NCollection_Map<Standard_Integer> aPolyVerticesFindMap;
- NCollection_Vector<Standard_Integer> aPolyVertices;
+ BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
+ BRepMeshCol::MapOfInteger anIgnoredEdges;
+ BRepMeshCol::MapOfInteger aPolyVerticesFindMap;
+ BRepMeshCol::VectorOfInteger aPolyVertices;
// Collect boundary vertices of the polygon
for ( Standard_Integer aPolyIt = 1; aPolyIt <= aPolyLen; ++aPolyIt )
{
Standard_Boolean isForward = ( aPolyEdgeInfo > 0 );
const BRepMesh_PairOfIndex& aPair =
- myMeshData->ElemConnectedTo( aPolyEdgeId );
+ myMeshData->ElementsConnectedTo( aPolyEdgeId );
Standard_Integer anElemIt = 1;
for ( ; anElemIt <= aPair.Extent(); ++anElemIt )
Standard_Integer anEdges[3];
Standard_Boolean anEdgesOri[3];
- GetTriangle( anElemId ).Edges( anEdges[0], anEdges[1], anEdges[2],
- anEdgesOri[0], anEdgesOri[1], anEdgesOri[2] );
+ GetTriangle( anElemId ).Edges(anEdges, anEdgesOri);
Standard_Integer isTriangleFound = Standard_False;
for ( Standard_Integer anEdgeIt = 0; anEdgeIt < 3; ++anEdgeIt )
if ( aPolyVertices.First() != aPolyVertices.Last() )
aPolyVertices.Append( aPolyVertices.First() );
- NCollection_Map<Standard_Integer> aSurvivedLinks( anIgnoredEdges );
+ BRepMeshCol::MapOfInteger aSurvivedLinks( anIgnoredEdges );
Standard_Integer aPolyVertIt = 0;
Standard_Integer anUniqueVerticesNum = aPolyVertices.Length() - 1;
thePolyBoxes, aSurvivedLinks, aLoopEdges );
}
- BRepMesh_MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
+ BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() )
{
const Standard_Integer& aLoopEdgeId = aLoopEdgesIt.Key();
if ( anIgnoredEdges.Contains( aLoopEdgeId ) )
continue;
- if ( myMeshData->ElemConnectedTo( aLoopEdgeId ).IsEmpty() )
+ if ( myMeshData->ElementsConnectedTo( aLoopEdgeId ).IsEmpty() )
myMeshData->RemoveLink( aLoopEdgesIt.Key() );
}
}
// inside the polygon or crossed it.
//=======================================================================
void BRepMesh_Delaun::killTrianglesAroundVertex(
- const Standard_Integer theZombieNodeId,
- const NCollection_Vector<Standard_Integer>& thePolyVertices,
- const NCollection_Map<Standard_Integer>& thePolyVerticesFindMap,
- const TColStd_SequenceOfInteger& thePolygon,
- const NCollection_Sequence<Bnd_B2d>& thePolyBoxes,
- NCollection_Map<Standard_Integer>& theSurvivedLinks,
- BRepMesh_MapOfIntegerInteger& theLoopEdges )
+ const Standard_Integer theZombieNodeId,
+ const BRepMeshCol::VectorOfInteger& thePolyVertices,
+ const BRepMeshCol::MapOfInteger& thePolyVerticesFindMap,
+ const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes,
+ BRepMeshCol::MapOfInteger& theSurvivedLinks,
+ BRepMeshCol::MapOfIntegerInteger& theLoopEdges )
{
- BRepMesh_ListOfInteger::Iterator aNeighborsIt =
- myMeshData->LinkNeighboursOf( theZombieNodeId );
+ BRepMeshCol::ListOfInteger::Iterator aNeighborsIt =
+ myMeshData->LinksConnectedTo( theZombieNodeId );
// Try to infect neighbor nodes
- NCollection_Vector<Standard_Integer> aVictimNodes;
+ BRepMeshCol::VectorOfInteger aVictimNodes;
for ( ; aNeighborsIt.More(); aNeighborsIt.Next() )
{
const Standard_Integer& aNeighborLinkId = aNeighborsIt.Value();
}
// Go and do your job!
- NCollection_Vector<Standard_Integer>::Iterator aVictimIt( aVictimNodes );
+ BRepMeshCol::VectorOfInteger::Iterator aVictimIt( aVictimNodes );
for ( ; aVictimIt.More(); aVictimIt.Next() )
{
killTrianglesAroundVertex( aVictimIt.Value(), thePolyVertices,
//purpose : Checks is the given vertex lies inside the polygon
//=======================================================================
Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon(
- const Standard_Integer& theVertexId,
- const NCollection_Vector<Standard_Integer>& thePolygonVertices ) const
+ const Standard_Integer& theVertexId,
+ const BRepMeshCol::VectorOfInteger& thePolygonVertices ) const
{
Standard_Integer aPolyLen = thePolygonVertices.Length();
if ( aPolyLen < 3 )
const Standard_Integer& theLinkToCheckId,
const BRepMesh_Edge& theLinkToCheck,
const Standard_Integer& theEndPoint,
- const TColStd_SequenceOfInteger& thePolygon,
- const NCollection_Sequence<Bnd_B2d>& thePolyBoxes,
- NCollection_Map<Standard_Integer>& theSurvivedLinks,
- BRepMesh_MapOfIntegerInteger& theLoopEdges )
+ const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes,
+ BRepMeshCol::MapOfInteger& theSurvivedLinks,
+ BRepMeshCol::MapOfIntegerInteger& theLoopEdges )
{
if ( theSurvivedLinks.Contains( theLinkToCheckId ) )
return;
killLinkTriangles( theLinkToCheckId, theLoopEdges );
- BRepMesh_ListOfInteger::Iterator aNeighborsIt =
- myMeshData->LinkNeighboursOf( theEndPoint );
+ BRepMeshCol::ListOfInteger::Iterator aNeighborsIt =
+ myMeshData->LinksConnectedTo( theEndPoint );
for ( ; aNeighborsIt.More(); aNeighborsIt.Next() )
{
//purpose : Kill triangles bound to the given link.
//=======================================================================
void BRepMesh_Delaun::killLinkTriangles(
- const Standard_Integer& theLinkId,
- BRepMesh_MapOfIntegerInteger& theLoopEdges )
+ const Standard_Integer& theLinkId,
+ BRepMeshCol::MapOfIntegerInteger& theLoopEdges )
{
const BRepMesh_PairOfIndex& aPair =
- myMeshData->ElemConnectedTo( theLinkId );
+ myMeshData->ElementsConnectedTo( theLinkId );
Standard_Integer anElemNb = aPair.Extent();
for ( Standard_Integer aPairIt = 1; aPairIt <= anElemNb; ++aPairIt )
//purpose : Processes loop within the given polygon formed by range of
// its links specified by start and end link indices.
//=======================================================================
-void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkFrom,
- const Standard_Integer theLinkTo,
- const TColStd_SequenceOfInteger& thePolygon,
- const NCollection_Sequence<Bnd_B2d>& thePolyBoxes)
+void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkFrom,
+ const Standard_Integer theLinkTo,
+ const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes)
{
Standard_Integer aNbOfLinksInLoop = theLinkTo - theLinkFrom - 1;
if ( aNbOfLinksInLoop < 3 )
return;
- TColStd_SequenceOfInteger aPolygon;
- NCollection_Sequence<Bnd_B2d> aPolyBoxes;
+ BRepMeshCol::SequenceOfInteger aPolygon;
+ BRepMeshCol::SequenceOfBndB2d aPolyBoxes;
for ( ; aNbOfLinksInLoop > 0; --aNbOfLinksInLoop )
{
Standard_Integer aLoopLinkIndex = theLinkFrom + aNbOfLinksInLoop;
// given polygon.
//=======================================================================
Standard_Integer BRepMesh_Delaun::createAndReplacePolygonLink(
- const Standard_Integer *theNodes,
- const gp_Pnt2d *thePnts,
- const Standard_Integer theRootIndex,
- const ReplaceFlag theReplaceFlag,
- TColStd_SequenceOfInteger& thePolygon,
- NCollection_Sequence<Bnd_B2d>& thePolyBoxes )
+ const Standard_Integer *theNodes,
+ const gp_Pnt2d *thePnts,
+ const Standard_Integer theRootIndex,
+ const ReplaceFlag theReplaceFlag,
+ BRepMeshCol::SequenceOfInteger& thePolygon,
+ BRepMeshCol::SequenceOfBndB2d& thePolyBoxes )
{
Standard_Integer aNewEdgeId =
myMeshData->AddLink( BRepMesh_Edge(
//function : meshPolygon
//purpose :
//=======================================================================
-void BRepMesh_Delaun::meshPolygon( TColStd_SequenceOfInteger& thePolygon,
- NCollection_Sequence<Bnd_B2d>& thePolyBoxes,
- BRepMesh_Delaun::HandleOfMapOfInteger theSkipped )
+void BRepMesh_Delaun::meshPolygon( BRepMeshCol::SequenceOfInteger& thePolygon,
+ BRepMeshCol::SequenceOfBndB2d& thePolyBoxes,
+ BRepMeshCol::HMapOfInteger theSkipped )
{
// Check is the source polygon elementary
if ( meshElementaryPolygon( thePolygon ) )
};
gp_Pnt2d anIntPnt;
- BRepMesh_WireInterferenceChecker::IntFlag aIntFlag = intSegSeg( *aCurEdge,
- *aNextEdge, Standard_False, Standard_True, anIntPnt );
+ BRepMesh_GeomTool::IntFlag aIntFlag = intSegSeg( *aCurEdge, *aNextEdge,
+ Standard_False, Standard_True, anIntPnt );
- if ( aIntFlag == BRepMesh_WireInterferenceChecker::NoIntersection )
+ if ( aIntFlag == BRepMesh_GeomTool::NoIntersection )
continue;
Standard_Boolean isRemoveFromFirst = Standard_False;
Standard_Boolean isAddReplacingEdge = Standard_True;
Standard_Integer aIndexToRemoveTo = aNextPolyIt;
- if ( aIntFlag == BRepMesh_WireInterferenceChecker::Cross )
+ if ( aIntFlag == BRepMesh_GeomTool::Cross )
{
Standard_Real aLoopArea = polyArea( thePolygon, aPolyIt + 1, aNextPolyIt );
gp_Vec2d aVec1( anIntPnt, aCurPnts [1] );
theSkipped->Add( Abs( thePolygon( aSkippedLinkIt ) ) );
}
}
- else if ( aIntFlag == BRepMesh_WireInterferenceChecker::PointOnSegment )
+ else if ( aIntFlag == BRepMesh_GeomTool::PointOnSegment )
{
// Indentify chopping link
Standard_Boolean isFirstChopping = Standard_False;
thePolygon, thePolyBoxes );
}
}
- else if ( aIntFlag == BRepMesh_WireInterferenceChecker::Glued )
+ else if ( aIntFlag == BRepMesh_GeomTool::Glued )
{
if ( aCurNodes[1] == aNextNodes[0] )
{
}
// TODO: Non-adjacent glued links within the polygon
}
- else if ( aIntFlag == BRepMesh_WireInterferenceChecker::Same )
+ else if ( aIntFlag == BRepMesh_GeomTool::Same )
{
processLoop( aPolyIt, aNextPolyIt, thePolygon, thePolyBoxes );
//purpose : Triangulation of closed polygon containing only three edges.
//=======================================================================
inline Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon(
- const TColStd_SequenceOfInteger& thePolygon )
+ const BRepMeshCol::SequenceOfInteger& thePolygon )
{
Standard_Integer aPolyLen = thePolygon.Length();
if ( aPolyLen < 3 )
anEdges[anEdgeIt] = Abs( anEdgeInfo );
anEdgesOri[anEdgeIt] = ( anEdgeInfo > 0 );
}
-
+
const BRepMesh_Edge& anEdge1 = GetEdge( anEdges[0] );
const BRepMesh_Edge& anEdge2 = GetEdge( anEdges[1] );
// its edges in the structure.
// (negative index means reversed edge)
//=======================================================================
-void BRepMesh_Delaun::meshSimplePolygon( TColStd_SequenceOfInteger& thePolygon,
- NCollection_Sequence<Bnd_B2d>& thePolyBoxes )
+void BRepMesh_Delaun::meshSimplePolygon( BRepMeshCol::SequenceOfInteger& thePolygon,
+ BRepMeshCol::SequenceOfBndB2d& thePolyBoxes )
{
// Check is the given polygon elementary
if ( meshElementaryPolygon( thePolygon ) )
// intersection is possible...
gp_Pnt2d anIntPnt;
- BRepMesh_WireInterferenceChecker::IntFlag aIntFlag =
- intSegSeg( aCheckLink, aPolyLink, Standard_False,
- Standard_False, anIntPnt );
+ BRepMesh_GeomTool::IntFlag aIntFlag = intSegSeg( aCheckLink, aPolyLink,
+ Standard_False, Standard_False, anIntPnt );
- if( aIntFlag != BRepMesh_WireInterferenceChecker::NoIntersection )
+ if( aIntFlag != BRepMesh_GeomTool::NoIntersection )
{
isIntersect = Standard_True;
break;
// polygon.
if ( aUsedLinkId < aPolyLen )
{
- TColStd_SequenceOfInteger aRightPolygon;
+ BRepMeshCol::SequenceOfInteger aRightPolygon;
thePolygon.Split( aUsedLinkId, aRightPolygon );
aRightPolygon.Prepend( -aNewEdgesInfo[2] );
- NCollection_Sequence<Bnd_B2d> aRightPolyBoxes;
+ BRepMeshCol::SequenceOfBndB2d aRightPolyBoxes;
thePolyBoxes.Split( aUsedLinkId, aRightPolyBoxes );
Bnd_B2d aBox;
//function : RemoveVertex
//purpose : Removes a vertex from the triangulation
//=======================================================================
-void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex )
+void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex )
{
BRepMesh_SelectorOfDataStructureOfDelaun aSelector( myMeshData );
aSelector.NeighboursOf( theVertex );
- BRepMesh_MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
+ BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
// Loop on triangles to be destroyed :
- BRepMesh_MapOfInteger::Iterator aTriangleIt( aSelector.Elements() );
+ BRepMeshCol::MapOfInteger::Iterator aTriangleIt( aSelector.Elements() );
for ( ; aTriangleIt.More(); aTriangleIt.Next() )
deleteTriangle( aTriangleIt.Key(), aLoopEdges );
- NCollection_Sequence<Bnd_B2d> aBoxes;
- TColStd_SequenceOfInteger aPolygon;
+ BRepMeshCol::SequenceOfBndB2d aBoxes;
+ BRepMeshCol::SequenceOfInteger aPolygon;
Standard_Integer aLoopEdgesCount = aLoopEdges.Extent();
- BRepMesh_MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
+ BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
if ( aLoopEdgesIt.More() )
{
aLastNode = aFirstNode;
while ( aPivotNode != aLastNode )
{
- BRepMesh_ListOfInteger::Iterator aLinkIt( myMeshData->LinkNeighboursOf( aPivotNode ) );
+ BRepMeshCol::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( aPivotNode ) );
for ( ; aLinkIt.More(); aLinkIt.Next() )
{
if ( aLinkIt.Value() != anEdgeId &&
//function : AddVertices
//purpose : Adds some vertices in the triangulation.
//=======================================================================
-void BRepMesh_Delaun::AddVertices( BRepMesh_Array1OfVertexOfDelaun& theVertices )
+void BRepMesh_Delaun::AddVertices( BRepMeshCol::Array1OfVertexOfDelaun& theVertices )
{
- BRepMesh_HeapSortVertexOfDelaun::Sort( theVertices,
- BRepMesh_ComparatorOfVertexOfDelaun( SortingDirection ) );
+ std::make_heap(theVertices.begin(), theVertices.end(), ComparatorOfVertexOfDelaun());
+ std::sort_heap(theVertices.begin(), theVertices.end(), ComparatorOfVertexOfDelaun());
Standard_Integer aLower = theVertices.Lower();
Standard_Integer anUpper = theVertices.Upper();
- TColStd_Array1OfInteger aVertexIndexes( aLower, anUpper );
+ BRepMeshCol::Array1OfInteger aVertexIndexes( aLower, anUpper );
for ( Standard_Integer i = aLower; i <= anUpper; ++i )
aVertexIndexes(i) = myMeshData->AddNode( theVertices(i) );
//function : getEdgesByType
//purpose : Gives the list of edges with type defined by input parameter
//=======================================================================
-Handle(BRepMesh_MapOfInteger) BRepMesh_Delaun::getEdgesByType(
+BRepMeshCol::HMapOfInteger BRepMesh_Delaun::getEdgesByType(
const BRepMesh_DegreeOfFreedom theEdgeType ) const
{
- Handle(BRepMesh_MapOfInteger) aResult = new BRepMesh_MapOfInteger;
- BRepMesh_MapOfInteger::Iterator anEdgeIt( myMeshData->LinkOfDomain() );
+ BRepMeshCol::HMapOfInteger aResult = new BRepMeshCol::MapOfInteger;
+ BRepMeshCol::MapOfInteger::Iterator anEdgeIt( myMeshData->LinksOfDomain() );
for ( ; anEdgeIt.More(); anEdgeIt.Next() )
{
Standard_Integer anEdge = anEdgeIt.Key();
Standard_Boolean isToAdd = (theEdgeType == BRepMesh_Free) ?
- (myMeshData->ElemConnectedTo( anEdge ).Extent() <= 1) :
+ (myMeshData->ElementsConnectedTo( anEdge ).Extent() <= 1) :
(GetEdge( anEdge ).Movability() == theEdgeType);
if (isToAdd)
Standard_Boolean o[3];
Standard_Integer p[3];
- GetTriangle( theTriangleId ).Edges( e[0], e[1], e[2],
- o[0], o[1], o[2] );
-
+ const BRepMesh_Triangle& aElement = GetTriangle( theTriangleId );
+ aElement.Edges(e, o);
+
const BRepMesh_Edge* anEdges[3] = { &GetEdge( e[0] ),
&GetEdge( e[1] ),
&GetEdge( e[2] ) };
- if ( o[0] )
- {
- p[0] = anEdges[0]->FirstNode();
- p[1] = anEdges[0]->LastNode();
- }
- else
- {
- p[1] = anEdges[0]->FirstNode();
- p[0] = anEdges[0]->LastNode();
- }
-
- if ( o[2] )
- p[2] = anEdges[2]->FirstNode();
- else
- p[2] = anEdges[2]->LastNode();
+
+ myMeshData->ElementNodes(aElement, p);
gp_XY aPoints[3];
aPoints[0] = GetVertex( p[0] ).Coord();
//function : intSegSeg
//purpose : Checks intersection between the two segments.
//=============================================================================
-BRepMesh_WireInterferenceChecker::IntFlag BRepMesh_Delaun::intSegSeg(
+BRepMesh_GeomTool::IntFlag BRepMesh_Delaun::intSegSeg(
const BRepMesh_Edge& theEdg1,
const BRepMesh_Edge& theEdg2,
const Standard_Boolean isConsiderEndPointTouch,
p3 = GetVertex( theEdg2.FirstNode() ).Coord();
p4 = GetVertex( theEdg2.LastNode() ).Coord();
- return BRepMesh_WireInterferenceChecker::Intersect(p1, p2, p3, p4,
+ return BRepMesh_GeomTool::IntSegSeg(p1, p2, p3, p4,
isConsiderEndPointTouch, isConsiderPointOnEdge, theIntPnt);
}
//purpose : Returns area of the loop of the given polygon defined by indices
// of its start and end links.
//=============================================================================
-Standard_Real BRepMesh_Delaun::polyArea( const TColStd_SequenceOfInteger& thePolygon,
- const Standard_Integer theStartIndex,
- const Standard_Integer theEndIndex ) const
+Standard_Real BRepMesh_Delaun::polyArea( const BRepMeshCol::SequenceOfInteger& thePolygon,
+ const Standard_Integer theStartIndex,
+ const Standard_Integer theEndIndex ) const
{
Standard_Real aArea = 0.0;
Standard_Integer aPolyLen = thePolygon.Length();