From 848fa7e315437435ef540611eadc398fd5a94b34 Mon Sep 17 00:00:00 2001 From: oan Date: Wed, 17 Sep 2014 17:00:32 +0400 Subject: [PATCH] 0025154: Collections in BRepMesh package are named in non-conformant manner - BRepMesh converted to nocdlpack, - Collections are defined in namespace BRepMesh, - Doxygen comments corrected to use @ instead of \. --- adm/UDLIST | 2 +- src/BRepMesh/BRepMesh.cdl | 88 ------ src/BRepMesh/BRepMesh.hxx | 129 +++++++++ src/BRepMesh/BRepMesh_Circle.hxx | 8 +- src/BRepMesh/BRepMesh_CircleInspector.hxx | 40 +-- src/BRepMesh/BRepMesh_CircleTool.cxx | 8 +- src/BRepMesh/BRepMesh_CircleTool.hxx | 68 ++--- src/BRepMesh/BRepMesh_Classifier.hxx | 24 +- src/BRepMesh/BRepMesh_Collections.hxx | 147 ---------- .../BRepMesh_DataStructureOfDelaun.cxx | 28 +- .../BRepMesh_DataStructureOfDelaun.hxx | 132 ++++----- src/BRepMesh/BRepMesh_Delaun.cxx | 265 +++++++++--------- src/BRepMesh/BRepMesh_Delaun.hxx | 168 +++++------ src/BRepMesh/BRepMesh_DiscretFactory.hxx | 6 +- src/BRepMesh/BRepMesh_Edge.hxx | 78 +----- src/BRepMesh/BRepMesh_EdgeChecker.hxx | 10 +- src/BRepMesh/BRepMesh_EdgeTessellator.hxx | 10 +- src/BRepMesh/BRepMesh_FaceAttribute.cxx | 88 ++++-- src/BRepMesh/BRepMesh_FaceAttribute.hxx | 94 ++++--- src/BRepMesh/BRepMesh_FaceChecker.hxx | 4 +- src/BRepMesh/BRepMesh_FastDiscret.cxx | 22 +- src/BRepMesh/BRepMesh_FastDiscret.hxx | 65 ++--- src/BRepMesh/BRepMesh_FastDiscretFace.cxx | 76 ++--- src/BRepMesh/BRepMesh_FastDiscretFace.hxx | 73 +++-- src/BRepMesh/BRepMesh_GeomTool.hxx | 112 ++++---- src/BRepMesh/BRepMesh_IncrementalMesh.cxx | 16 +- src/BRepMesh/BRepMesh_IncrementalMesh.hxx | 60 ++-- src/BRepMesh/BRepMesh_OrientedEdge.hxx | 91 ++++++ src/BRepMesh/BRepMesh_PairOfIndex.hxx | 8 +- src/BRepMesh/BRepMesh_PairOfPolygon.hxx | 4 +- ...epMesh_SelectorOfDataStructureOfDelaun.cxx | 2 +- ...epMesh_SelectorOfDataStructureOfDelaun.hxx | 18 +- src/BRepMesh/BRepMesh_ShapeTool.cxx | 8 +- src/BRepMesh/BRepMesh_ShapeTool.hxx | 2 +- src/BRepMesh/BRepMesh_Triangle.hxx | 24 +- src/BRepMesh/BRepMesh_Vertex.hxx | 26 +- src/BRepMesh/BRepMesh_VertexInspector.hxx | 34 +-- src/BRepMesh/BRepMesh_VertexTool.cxx | 16 +- src/BRepMesh/BRepMesh_VertexTool.hxx | 67 ++--- src/BRepMesh/BRepMesh_WireChecker.cxx | 71 +++-- src/BRepMesh/BRepMesh_WireChecker.hxx | 67 +++-- .../BRepMesh_WireInterferenceChecker.cxx | 53 ++-- .../BRepMesh_WireInterferenceChecker.hxx | 45 +-- src/BRepMesh/FILES | 3 +- src/MeshTest/MeshTest.cdl | 3 +- src/StdPrs/StdPrs.cdl | 1 - 46 files changed, 1173 insertions(+), 1191 deletions(-) delete mode 100644 src/BRepMesh/BRepMesh.cdl create mode 100644 src/BRepMesh/BRepMesh.hxx delete mode 100644 src/BRepMesh/BRepMesh_Collections.hxx create mode 100644 src/BRepMesh/BRepMesh_OrientedEdge.hxx diff --git a/adm/UDLIST b/adm/UDLIST index 1e9c93a464..be32f80619 100644 --- a/adm/UDLIST +++ b/adm/UDLIST @@ -105,7 +105,7 @@ p BRepGProp p BRepIntCurveSurface p BRepLib p BRepMAT2d -p BRepMesh +n BRepMesh p BRepOffset p BRepOffsetAPI p BRepPrim diff --git a/src/BRepMesh/BRepMesh.cdl b/src/BRepMesh/BRepMesh.cdl deleted file mode 100644 index 088351178a..0000000000 --- a/src/BRepMesh/BRepMesh.cdl +++ /dev/null @@ -1,88 +0,0 @@ --- Created on: 1993-09-22 --- Created by: Didier PIFFAULT --- Copyright (c) 1993-1999 Matra Datavision --- Copyright (c) 1999-2014 OPEN CASCADE SAS --- --- This file is part of Open CASCADE Technology software library. --- --- This library is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License version 2.1 as published --- by the Free Software Foundation, with special exception defined in the file --- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT --- distribution for complete text of the license and disclaimer of any warranty. --- --- Alternatively, this file may be used under the terms of Open CASCADE --- commercial license or contractual agreement. - -package BRepMesh - - ---Purpose: Instantiated package for the class of packages - - ---Level : Advanced. - -- All methods of all classes will be advanced. - - -uses Standard, - gp, - Bnd, - TColStd, - TColgp, - GCPnts, - BRepAdaptor, - BRepTopAdaptor, - TCollection, - MMgt, - TopoDS, - TopAbs, - TopExp, - TopTools, - Poly, - Geom2d, - GeomAbs, - GeomAdaptor, - TopLoc, - SortTools, - Plugin - -is - imported DegreeOfFreedom from BRepMesh; - imported Status from BRepMesh; - imported FactoryError from BRepMesh; - imported Vertex from BRepMesh; - imported Edge from BRepMesh; - imported Triangle from BRepMesh; - imported Circle from BRepMesh; - imported DiscretRoot from BRepMesh; - imported DiscretFactory from BRepMesh; - - imported ShapeTool from BRepMesh; - imported Collections from BRepMesh; - imported Delaun from BRepMesh; - imported PairOfIndex from BRepMesh; - imported CircleInspector from BRepMesh; - imported VertexInspector from BRepMesh; - imported WireInterferenceChecker from BRepMesh; - imported EdgeChecker from BRepMesh; - imported FaceChecker from BRepMesh; - imported EdgeParameterProvider from BRepMesh; - imported IEdgeTool from BRepMesh; - imported EdgeTessellationExtractor from BRepMesh; - imported EdgeTessellator from BRepMesh; - - primitive PluginEntryType; - - imported SelectorOfDataStructureOfDelaun from BRepMesh; - imported DataStructureOfDelaun from BRepMesh; - imported CircleTool from BRepMesh; - imported VertexTool from BRepMesh; - imported BiPoint from BRepMesh; - imported FastDiscretFace from BRepMesh; - imported FastDiscret from BRepMesh; - imported FaceAttribute from BRepMesh; - imported Classifier from BRepMesh; - imported WireChecker from BRepMesh; - imported IncrementalMesh from BRepMesh; - imported GeomTool from BRepMesh; - imported PairOfPolygon from BRepMesh; - -end BRepMesh; diff --git a/src/BRepMesh/BRepMesh.hxx b/src/BRepMesh/BRepMesh.hxx new file mode 100644 index 0000000000..4c24eb7900 --- /dev/null +++ b/src/BRepMesh/BRepMesh.hxx @@ -0,0 +1,129 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _BRepMesh_HeaderFile +#define _BRepMesh_HeaderFile + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +class BRepMesh_Vertex; +class TopoDS_Edge; +class TopoDS_Vertex; +class Handle_BRepMesh_FaceAttribute; +class BRepMesh_VertexInspector; +class BRepMesh_CircleInspector; +class BRepMesh_Classifier; +class Poly_Triangulation; + +namespace BRepMesh +{ + //! Structure keeping parameters of segment. + struct Segment + { + gp_XY StartPnt; + gp_XY EndPnt; + }; + + //! Sequences + typedef NCollection_Sequence SequenceOfBndB2d; + typedef NCollection_Sequence SequenceOfInteger; + typedef NCollection_Sequence SequenceOfReal; + + //! Vectors + typedef NCollection_Vector VectorOfVertex; + typedef NCollection_Vector VectorOfInteger; + typedef NCollection_Vector VectorOfCircle; + + //! Trees + typedef NCollection_EBTree BndBox2dTree; + typedef NCollection_UBTreeFiller BndBox2dTreeFiller; + + //! Arrays + typedef NCollection_Array1 Array1OfVertexOfDelaun; + typedef NCollection_Array1 Array1OfInteger; + typedef NCollection_Array1 Array1OfReal; + typedef NCollection_Array1 Array1OfSegments; + + //! Lists + typedef NCollection_List ListOfXY; + typedef NCollection_List ListOfVertex; + typedef NCollection_List ListOfInteger; + + //! Maps + typedef NCollection_Map MapOfInteger; + typedef NCollection_Map MapOfTriangulation; + typedef NCollection_Map MapOfShape; + + typedef NCollection_DataMap MapOfIntegerInteger; + typedef NCollection_DataMap DMapOfVertexInteger; + typedef NCollection_DataMap DMapOfFaceAttribute; + typedef NCollection_DataMap DMapOfShapePairOfPolygon; + typedef NCollection_DataMap DMapOfIntegerPnt; + typedef NCollection_DataMap DMapOfIntegerListOfXY; + typedef NCollection_DataMap DMapOfIntegerListOfInteger; + typedef NCollection_DataMap DMapOfEdgeListOfTriangulation; + + typedef NCollection_IndexedMap IMapOfInteger; + typedef NCollection_IndexedMap IMapOfReal; + typedef NCollection_IndexedMap IMapOfElement; + typedef NCollection_IndexedDataMap IDMapOfLink; + + //! CellFilters + typedef NCollection_CellFilter CircleCellFilter; + typedef NCollection_CellFilter VertexCellFilter; + + //! Handles + typedef NCollection_Handle HMapOfInteger; + typedef NCollection_Handle HIMapOfInteger; + typedef NCollection_Handle HDMapOfShapePairOfPolygon; + typedef NCollection_Handle HDMapOfIntegerPnt; + typedef NCollection_Handle HClassifier; + typedef NCollection_Handle HBndBox2dTree; + typedef NCollection_Handle HArray1OfSegments; + typedef NCollection_Handle HDMapOfVertexInteger; + + //! Other data structures + typedef std::pair SegmentsTree; + typedef NCollection_Array1 Array1OfSegmentsTree; +}; + +#endif diff --git a/src/BRepMesh/BRepMesh_Circle.hxx b/src/BRepMesh/BRepMesh_Circle.hxx index 3f8f41952e..5938a5c2e5 100644 --- a/src/BRepMesh/BRepMesh_Circle.hxx +++ b/src/BRepMesh/BRepMesh_Circle.hxx @@ -33,8 +33,8 @@ public: } //! Constructor. - //! \param theLocation location of a circle. - //! \param theRadius radius of a circle. + //! @param theLocation location of a circle. + //! @param theRadius radius of a circle. Standard_EXPORT BRepMesh_Circle(const gp_XY& theLocation, const Standard_Real theRadius) : myLocation(theLocation), @@ -43,14 +43,14 @@ public: } //! Sets location of a circle. - //! \param theLocation location of a circle. + //! @param theLocation location of a circle. inline void SetLocation(const gp_XY& theLocation) { myLocation = theLocation; } //! Sets radius of a circle. - //! \param theRadius radius of a circle. + //! @param theRadius radius of a circle. inline void SetRadius(const Standard_Real theRadius) { myRadius = theRadius; diff --git a/src/BRepMesh/BRepMesh_CircleInspector.hxx b/src/BRepMesh/BRepMesh_CircleInspector.hxx index 311dfe7e2c..2836e39b76 100644 --- a/src/BRepMesh/BRepMesh_CircleInspector.hxx +++ b/src/BRepMesh/BRepMesh_CircleInspector.hxx @@ -16,7 +16,7 @@ #ifndef BRepMesh_CircleInspector_Header #define BRepMesh_CircleInspector_Header -#include +#include #include #include #include @@ -30,13 +30,13 @@ public: typedef Standard_Integer Target; //! Constructor. - //! \param theTolerance tolerance to be used for identification of shot circles. - //! \param theReservedSize size to be reserved for vector of circles. - //! \param theAllocator memory allocator to be used by internal collections. + //! @param theTolerance tolerance to be used for identification of shot circles. + //! @param theReservedSize size to be reserved for vector of circles. + //! @param theAllocator memory allocator to be used by internal collections. Standard_EXPORT BRepMesh_CircleInspector( - const Standard_Real theTolerance, - const Standard_Integer theReservedSize, - const BRepMeshCol::Allocator& theAllocator) + const Standard_Real theTolerance, + const Standard_Integer theReservedSize, + const Handle(NCollection_IncAllocator)& theAllocator) : myTolerance(theTolerance*theTolerance), myResIndices(theAllocator), myCircles(theReservedSize) @@ -44,8 +44,8 @@ public: } //! Adds the circle to vector of circles at the given position. - //! \param theIndex position of circle in the vector. - //! \param theCircle circle to be added. + //! @param theIndex position of circle in the vector. + //! @param theCircle circle to be added. inline void Bind(const Standard_Integer theIndex, const BRepMesh_Circle& theCircle) { @@ -53,21 +53,21 @@ public: } //! Resutns vector of registered circles. - inline BRepMeshCol::VectorOfCircle& Circles() + inline const BRepMesh::VectorOfCircle& Circles() const { return myCircles; } //! Returns circle with the given index. - //! \param theIndex index of circle. - //! \return circle with the given index. + //! @param theIndex index of circle. + //! @return circle with the given index. inline BRepMesh_Circle& Circle(const Standard_Integer theIndex) { return myCircles(theIndex); } //! Set reference point to be checked. - //! \param thePoint bullet point. + //! @param thePoint bullet point. inline void SetPoint(const gp_XY& thePoint) { myResIndices.Clear(); @@ -75,14 +75,14 @@ public: } //! Returns list of circles shot by the reference point. - inline BRepMeshCol::ListOfInteger& GetShotCircles() + inline BRepMesh::ListOfInteger& GetShotCircles() { return myResIndices; } //! Performs inspection of a circle with the given index. - //! \param theTargetIndex index of a circle to be checked. - //! \return status of the check. + //! @param theTargetIndex index of a circle to be checked. + //! @return status of the check. Standard_EXPORT NCollection_CellFilter_Action Inspect( const Standard_Integer theTargetIndex); @@ -95,10 +95,10 @@ public: } private: - Standard_Real myTolerance; - BRepMeshCol::ListOfInteger myResIndices; - BRepMeshCol::VectorOfCircle myCircles; - gp_XY myPoint; + Standard_Real myTolerance; + BRepMesh::ListOfInteger myResIndices; + BRepMesh::VectorOfCircle myCircles; + gp_XY myPoint; }; #endif diff --git a/src/BRepMesh/BRepMesh_CircleTool.cxx b/src/BRepMesh/BRepMesh_CircleTool.cxx index 3b106971f4..b1fc784396 100644 --- a/src/BRepMesh/BRepMesh_CircleTool.cxx +++ b/src/BRepMesh/BRepMesh_CircleTool.cxx @@ -47,7 +47,7 @@ NCollection_CellFilter_Action BRepMesh_CircleInspector::Inspect( //purpose : //======================================================================= BRepMesh_CircleTool::BRepMesh_CircleTool( - const BRepMeshCol::Allocator& theAllocator) + const Handle(NCollection_IncAllocator)& theAllocator) : myTolerance (Precision::PConfusion() * Precision::PConfusion()), myAllocator (theAllocator), myCellFilter(10, theAllocator), @@ -60,8 +60,8 @@ BRepMesh_CircleTool::BRepMesh_CircleTool( //purpose : //======================================================================= BRepMesh_CircleTool::BRepMesh_CircleTool( - const Standard_Integer theReservedSize, - const BRepMeshCol::Allocator& theAllocator) + const Standard_Integer theReservedSize, + const Handle(NCollection_IncAllocator)& theAllocator) : myTolerance (Precision::PConfusion() * Precision::PConfusion()), myAllocator (theAllocator), myCellFilter(10, theAllocator), @@ -164,7 +164,7 @@ void BRepMesh_CircleTool::Delete(const Standard_Integer theIndex) //function : Select //purpose : //======================================================================= -BRepMeshCol::ListOfInteger& BRepMesh_CircleTool::Select(const gp_XY& thePoint) +BRepMesh::ListOfInteger& BRepMesh_CircleTool::Select(const gp_XY& thePoint) { mySelector.SetPoint(thePoint); myCellFilter.Inspect(thePoint, mySelector); diff --git a/src/BRepMesh/BRepMesh_CircleTool.hxx b/src/BRepMesh/BRepMesh_CircleTool.hxx index 11433d1548..394c2a37a9 100644 --- a/src/BRepMesh/BRepMesh_CircleTool.hxx +++ b/src/BRepMesh/BRepMesh_CircleTool.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include class gp_Circ2d; @@ -36,32 +36,34 @@ public: DEFINE_STANDARD_ALLOC //! Constructor. - //! \param theAllocator memory allocator to be used by internal structures. - Standard_EXPORT BRepMesh_CircleTool(const BRepMeshCol::Allocator& theAllocator); + //! @param theAllocator memory allocator to be used by internal structures. + Standard_EXPORT BRepMesh_CircleTool( + const Handle(NCollection_IncAllocator)& theAllocator); //! Constructor. - //! \param theReservedSize size to be reserved for vector of circles. - //! \param theAllocator memory allocator to be used by internal structures. - Standard_EXPORT BRepMesh_CircleTool(const Standard_Integer theReservedSize, - const BRepMeshCol::Allocator& theAllocator); + //! @param theReservedSize size to be reserved for vector of circles. + //! @param theAllocator memory allocator to be used by internal structures. + Standard_EXPORT BRepMesh_CircleTool( + const Standard_Integer theReservedSize, + const Handle(NCollection_IncAllocator)& theAllocator); //! Initializes the tool. - //! \param theReservedSize size to be reserved for vector of circles. + //! @param theReservedSize size to be reserved for vector of circles. inline void Init(const Standard_Integer /*theReservedSize*/) { myTolerance = Precision::PConfusion() * Precision::PConfusion(); } //! Sets new size for cell filter. - //! \param theSize cell size to be set for X and Y dimensions. + //! @param theSize cell size to be set for X and Y dimensions. inline void SetCellSize(const Standard_Real theSize) { myCellFilter.Reset(theSize, myAllocator); } //! Sets new size for cell filter. - //! \param theSizeX cell size to be set for X dimension. - //! \param theSizeY cell size to be set for Y dimension. + //! @param theSizeX cell size to be set for X dimension. + //! @param theSizeY cell size to be set for Y dimension. inline void SetCellSize(const Standard_Real theSizeX, const Standard_Real theSizeY) { @@ -70,8 +72,8 @@ public: } //! Sets limits of inspection area. - //! \param theMin bottom left corner of inspection area. - //! \param theMax top right corner of inspection area. + //! @param theMin bottom left corner of inspection area. + //! @param theMax top right corner of inspection area. inline void SetMinMaxSize(const gp_XY& theMin, const gp_XY& theMax) { @@ -80,17 +82,17 @@ public: } //! Binds the circle to the tool. - //! \param theIndex index a circle should be bound with. - //! \param theCircle circle to be bound. + //! @param theIndex index a circle should be bound with. + //! @param theCircle circle to be bound. Standard_EXPORT void Bind(const Standard_Integer theIndex, const gp_Circ2d& theCircle); //! Computes circle on three points and bind it to the tool. - //! \param theIndex index a circle should be bound with. - //! \param thePoint1 first point. - //! \param thePoint2 second point. - //! \param thePoint3 third point. - //! \return FALSE in case of impossibility to build a circle + //! @param theIndex index a circle should be bound with. + //! @param thePoint1 first point. + //! @param thePoint2 second point. + //! @param thePoint3 third point. + //! @return FALSE in case of impossibility to build a circle //! on the given points, TRUE elsewhere. Standard_EXPORT Standard_Boolean Bind(const Standard_Integer theIndex, const gp_XY& thePoint1, @@ -98,35 +100,35 @@ public: const gp_XY& thePoint3); //! Binds implicit zero circle. - //! \param theIndex index a zero circle should be bound with. + //! @param theIndex index a zero circle should be bound with. Standard_EXPORT void MocBind(const Standard_Integer theIndex); //! Deletes a circle from the tool. - //! \param theIndex index of a circle to be removed. + //! @param theIndex index of a circle to be removed. Standard_EXPORT void Delete(const Standard_Integer theIndex); //! Select the circles shot by the given point. - //! \param thePoint bullet point. - Standard_EXPORT BRepMeshCol::ListOfInteger& Select(const gp_XY& thePoint); + //! @param thePoint bullet point. + Standard_EXPORT BRepMesh::ListOfInteger& Select(const gp_XY& thePoint); private: //! Creates circle with the given parameters and binds it to the tool. - //! \param theIndex index a circle should be bound with. - //! \param theLocation location of a circle. - //! \param theRadius radius of a circle. + //! @param theIndex index a circle should be bound with. + //! @param theLocation location of a circle. + //! @param theRadius radius of a circle. void bind(const Standard_Integer theIndex, const gp_XY& theLocation, const Standard_Real theRadius); private: - Standard_Real myTolerance; - BRepMeshCol::Allocator myAllocator; - BRepMeshCol::CircleCellFilter myCellFilter; - BRepMesh_CircleInspector mySelector; - gp_XY myFaceMax; - gp_XY myFaceMin; + Standard_Real myTolerance; + Handle(NCollection_IncAllocator) myAllocator; + BRepMesh::CircleCellFilter myCellFilter; + BRepMesh_CircleInspector mySelector; + gp_XY myFaceMax; + gp_XY myFaceMin; }; #endif diff --git a/src/BRepMesh/BRepMesh_Classifier.hxx b/src/BRepMesh/BRepMesh_Classifier.hxx index 42c266dc67..4a87b84b61 100644 --- a/src/BRepMesh/BRepMesh_Classifier.hxx +++ b/src/BRepMesh/BRepMesh_Classifier.hxx @@ -24,9 +24,7 @@ #include #include #include - -class gp_Pnt2d; -class TColgp_SequenceOfPnt2d; +#include //! Auxilary class contains information about correctness of discretized //! face and used for classification of points regarding face internals. @@ -40,7 +38,7 @@ public: Standard_EXPORT BRepMesh_Classifier(); //! Destructor. - ~BRepMesh_Classifier() + Standard_EXPORT virtual ~BRepMesh_Classifier() { Destroy(); } @@ -50,19 +48,19 @@ public: Standard_EXPORT void Destroy(); //! Performs classification of the given point regarding to face internals. - //! \param thePoint Point in parametric space to be classified. - //! \return + //! @param thePoint Point in parametric space to be classified. + //! @return Standard_EXPORT TopAbs_State Perform(const gp_Pnt2d& thePoint) const; //! Registers wire specified by sequence of points for //! further classification of points. - //! \param theWire Wire to be registered. Specified by sequence of points. - //! \param theTolUV Tolerance to be used for calculations in parametric space. - //! \param theUmin Lower U boundary of the face in parametric space. - //! \param theUmax Upper U boundary of the face in parametric space. - //! \param theVmin Lower V boundary of the face in parametric space. - //! \param theVmax Upper V boundary of the face in parametric space. - void RegisterWire( + //! @param theWire Wire to be registered. Specified by sequence of points. + //! @param theTolUV Tolerance to be used for calculations in parametric space. + //! @param theUmin Lower U boundary of the face in parametric space. + //! @param theUmax Upper U boundary of the face in parametric space. + //! @param theVmin Lower V boundary of the face in parametric space. + //! @param theVmax Upper V boundary of the face in parametric space. + Standard_EXPORT void RegisterWire( const NCollection_Sequence& theWire, const Standard_Real theTolUV, const Standard_Real theUmin, diff --git a/src/BRepMesh/BRepMesh_Collections.hxx b/src/BRepMesh/BRepMesh_Collections.hxx deleted file mode 100644 index 13a818d89e..0000000000 --- a/src/BRepMesh/BRepMesh_Collections.hxx +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _BRepMesh_Collections_HeaderFile -#define _BRepMesh_Collections_HeaderFile - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -class BRepMesh_Vertex; -class TopoDS_Shape; -class TopoDS_Face; -class TopoDS_Edge; -class TopoDS_Vertex; -class Handle_BRepMesh_FaceAttribute; -class BRepMesh_VertexInspector; -class BRepMesh_CircleInspector; -class BRepMesh_Classifier; -class Poly_Triangulation; - -//! Short names for collections -#define N_SEQUENCE NCollection_Sequence -#define N_VECTOR NCollection_Vector -#define N_ARRAY1 NCollection_Array1 -#define N_LIST NCollection_List -#define N_MAP NCollection_Map -#define N_HANDLE NCollection_Handle -#define N_DATAMAP NCollection_DataMap -#define N_IMAP NCollection_IndexedMap -#define N_IDMAP NCollection_IndexedDataMap -#define N_CELLFILTER NCollection_CellFilter - -namespace BRepMeshCol -{ - //! Structure keeping parameters of segment. - struct Segment - { - gp_XY StartPnt; - gp_XY EndPnt; - }; - - //! Memory allocators - typedef Handle(NCollection_IncAllocator) Allocator; - - //! Short names for hashers - typedef TopTools_ShapeMapHasher ShapeMapHasher; - - //! Sequences - typedef N_SEQUENCE SequenceOfBndB2d; - typedef N_SEQUENCE SequenceOfInteger; - typedef N_SEQUENCE SequenceOfReal; - - //! Vectors - typedef N_VECTOR VectorOfVertex; - typedef N_VECTOR VectorOfInteger; - typedef N_VECTOR VectorOfCircle; - - //! Trees - typedef NCollection_EBTree BndBox2dTree; - typedef NCollection_UBTreeFiller BndBox2dTreeFiller; - - //! Arrays - typedef N_ARRAY1 Array1OfVertexOfDelaun; - typedef N_ARRAY1 Array1OfInteger; - typedef N_ARRAY1 Array1OfReal; - typedef std::vector Array1OfSegments; - - //! Lists - typedef N_LIST ListOfXY; - typedef N_LIST ListOfVertex; - typedef N_LIST ListOfInteger; - - //! Maps - typedef N_MAP MapOfInteger; - typedef N_MAP MapOfTriangulation; - typedef N_MAP MapOfShape; - - typedef N_DATAMAP MapOfIntegerInteger; - typedef N_DATAMAP DMapOfVertexInteger; - typedef N_DATAMAP DMapOfFaceAttribute; - typedef N_DATAMAP DMapOfShapePairOfPolygon; - typedef N_DATAMAP DMapOfIntegerPnt; - typedef N_DATAMAP DMapOfIntegerListOfXY; - typedef N_DATAMAP DMapOfIntegerListOfInteger; - typedef N_DATAMAP DMapOfEdgeListOfTriangulation; - - typedef N_IMAP IMapOfInteger; - typedef N_IMAP IMapOfReal; - typedef N_IMAP IMapOfElement; - typedef N_IDMAP IDMapOfLink; - - //! CellFilters - typedef N_CELLFILTER CircleCellFilter; - typedef N_CELLFILTER VertexCellFilter; - - //! Handles - typedef N_HANDLE HMapOfInteger; - typedef N_HANDLE HIMapOfInteger; - typedef N_HANDLE HDMapOfShapePairOfPolygon; - typedef N_HANDLE HDMapOfIntegerPnt; - typedef N_HANDLE HClassifier; - typedef N_HANDLE HBndBox2dTree; - typedef N_HANDLE HArray1OfSegments; - - //! Other data structures - typedef std::pair SegmentsTree; - typedef std::vector Array1OfSegmentsTree; -}; - -#endif diff --git a/src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx b/src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx index e34e47c332..c84de01be6 100644 --- a/src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx +++ b/src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx @@ -31,8 +31,8 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_DataStructureOfDelaun, Standard_Transient) //purpose : //======================================================================= BRepMesh_DataStructureOfDelaun::BRepMesh_DataStructureOfDelaun( - const BRepMeshCol::Allocator& theAllocator, - const Standard_Integer theReservedNodeSize) + const Handle(NCollection_IncAllocator)& theAllocator, + const Standard_Integer theReservedNodeSize) : myNodes (theReservedNodeSize, theAllocator), myLinks (theReservedNodeSize * 3), myDelLinks (theAllocator), @@ -54,7 +54,7 @@ Standard_Boolean BRepMesh_DataStructureOfDelaun::SubstituteNode( if (myNodes.FindIndex(theNewNode) != 0) return Standard_False; - const BRepMeshCol::ListOfInteger& aLinks = myNodes(theIndex); + const BRepMesh::ListOfInteger& aLinks = myNodes(theIndex); myNodes.Substitute(theIndex, theNewNode, aLinks); return Standard_True; } @@ -158,8 +158,8 @@ void BRepMesh_DataStructureOfDelaun::cleanLink( const Standard_Integer aNodeId = (i == 0) ? theLink.FirstNode() : theLink.LastNode(); - BRepMeshCol::ListOfInteger& aLinkList = myNodes(aNodeId); - BRepMeshCol::ListOfInteger::Iterator aLinkIt(aLinkList); + BRepMesh::ListOfInteger& aLinkList = myNodes(aNodeId); + BRepMesh::ListOfInteger::Iterator aLinkIt(aLinkList); for(; aLinkIt.More(); aLinkIt.Next()) { if (aLinkIt.Value() == theIndex) @@ -315,8 +315,8 @@ void BRepMesh_DataStructureOfDelaun::ElementNodes( //======================================================================= void BRepMesh_DataStructureOfDelaun::ClearDomain() { - BRepMeshCol::MapOfInteger aFreeEdges; - BRepMeshCol::MapOfInteger::Iterator aElementIt(myElementsOfDomain); + BRepMesh::MapOfInteger aFreeEdges; + BRepMesh::MapOfInteger::Iterator aElementIt(myElementsOfDomain); for (; aElementIt.More(); aElementIt.Next()) { const Standard_Integer aElementId = aElementIt.Key(); @@ -334,7 +334,7 @@ void BRepMesh_DataStructureOfDelaun::ClearDomain() } myElementsOfDomain.Clear(); - BRepMeshCol::MapOfInteger::Iterator aEdgeIt(aFreeEdges); + BRepMesh::MapOfInteger::Iterator aEdgeIt(aFreeEdges); for (; aEdgeIt.More(); aEdgeIt.Next()) RemoveLink(aEdgeIt.Key()); } @@ -374,7 +374,7 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedLinks() --aLastLiveItem; const Standard_Integer aLastLiveItemId = aLastLiveItem + 1; - BRepMeshCol::ListOfInteger::Iterator aLinkIt; + BRepMesh::ListOfInteger::Iterator aLinkIt; // update link references for (Standard_Integer i = 0; i < 2; ++i) { @@ -421,8 +421,8 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedLinks() //======================================================================= void BRepMesh_DataStructureOfDelaun::clearDeletedNodes() { - BRepMeshCol::ListOfInteger& aDelNodes = - (BRepMeshCol::ListOfInteger&)myNodes.GetListOfDelNodes(); + BRepMesh::ListOfInteger& aDelNodes = + (BRepMesh::ListOfInteger&)myNodes.GetListOfDelNodes(); Standard_Integer aLastLiveItem = NbNodes(); while (!aDelNodes.IsEmpty()) @@ -443,7 +443,7 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedNodes() continue; BRepMesh_Vertex aNode = GetNode(aLastLiveItem); - BRepMeshCol::ListOfInteger& aLinkList = myNodes(aLastLiveItem); + BRepMesh::ListOfInteger& aLinkList = myNodes(aLastLiveItem); myNodes.RemoveLast(); --aLastLiveItem; @@ -451,7 +451,7 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedNodes() myNodes.Substitute(aDelItem, aNode, aLinkList); const Standard_Integer aLastLiveItemId = aLastLiveItem + 1; - BRepMeshCol::ListOfInteger::Iterator aLinkIt(aLinkList); + BRepMesh::ListOfInteger::Iterator aLinkIt(aLinkList); for (; aLinkIt.More(); aLinkIt.Next()) { const Standard_Integer aLinkId = aLinkIt.Value(); @@ -518,7 +518,7 @@ Standard_CString BRepMesh_Dump(void* theMeshHandlePtr, { OCC_CATCH_SIGNALS - BRepMeshCol::MapOfInteger::Iterator aLinksIt(aMeshData->LinksOfDomain()); + BRepMesh::MapOfInteger::Iterator aLinksIt(aMeshData->LinksOfDomain()); for (; aLinksIt.More(); aLinksIt.Next()) { const BRepMesh_Edge& aLink = aMeshData->GetLink(aLinksIt.Value()); diff --git a/src/BRepMesh/BRepMesh_DataStructureOfDelaun.hxx b/src/BRepMesh/BRepMesh_DataStructureOfDelaun.hxx index 3b80b8a744..3177224fca 100644 --- a/src/BRepMesh/BRepMesh_DataStructureOfDelaun.hxx +++ b/src/BRepMesh/BRepMesh_DataStructureOfDelaun.hxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include class BRepMesh_Vertex; class BRepMesh_VertexTool; @@ -34,15 +34,15 @@ class BRepMesh_DataStructureOfDelaun : public Standard_Transient public: //! Constructor. - //! \param theAllocator memory allocator to be used by internal structures. - //! \param theReservedNodeSize presumed number of nodes in this mesh. + //! @param theAllocator memory allocator to be used by internal structures. + //! @param theReservedNodeSize presumed number of nodes in this mesh. Standard_EXPORT BRepMesh_DataStructureOfDelaun( - const BRepMeshCol::Allocator& theAllocator, - const Standard_Integer theReservedNodeSize = 100); + const Handle(NCollection_IncAllocator)& theAllocator, + const Standard_Integer theReservedNodeSize = 100); -public: //! \name API for accessing mesh nodes. +public: //! @name API for accessing mesh nodes. //! Returns number of nodes. inline Standard_Integer NbNodes() const @@ -52,24 +52,24 @@ public: //! \name API for accessing mesh nodes. //! Adds node to the mesh if it is not already in the mesh. - //! \param theNode node to be added to the mesh. - //! \return index of the node in the structure. + //! @param theNode node to be added to the mesh. + //! @return index of the node in the structure. inline Standard_Integer AddNode(const BRepMesh_Vertex& theNode) { return myNodes.Add(theNode); } //! Finds the index of the given node. - //! \param theNode node to find. - //! \return index of the given element of zero if node is not in the mesh. + //! @param theNode node to find. + //! @return index of the given element of zero if node is not in the mesh. Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Vertex& theNode) { return myNodes.FindIndex(theNode); } //! Get node by the index. - //! \param theIndex index of a node. - //! \return node with the given index. + //! @param theIndex index of a node. + //! @return node with the given index. inline const BRepMesh_Vertex& GetNode(const Standard_Integer theIndex) { return myNodes.FindKey(theIndex); @@ -82,7 +82,7 @@ public: //! \name API for accessing mesh nodes. } //! Replaces nodes of mesh by the given ones. - //! \param theNewNodes nodes to be set instead of existing ones. + //! @param theNewNodes nodes to be set instead of existing ones. Standard_EXPORT void ReplaceNodes(const BRepMesh_VertexTool& theNewNodes) { if (theNewNodes.IsEmpty()) @@ -92,17 +92,17 @@ public: //! \name API for accessing mesh nodes. } //! Substitutes the node with the given index by new one. - //! \param theIndex index of node to be substituted. - //! \param theNewNode substituting node. - //! \return FALSE in case if new node is already in the structure, TRUE elsewhere. + //! @param theIndex index of node to be substituted. + //! @param theNewNode substituting node. + //! @return FALSE in case if new node is already in the structure, TRUE elsewhere. Standard_EXPORT Standard_Boolean SubstituteNode( const Standard_Integer theIndex, const BRepMesh_Vertex& theNewNode); //! Removes node from the mesh in case if it has no connected links //! and its type is Free. - //! \param theIndex index of node to be removed. - //! \param isForce if TRUE node will be removed even if movability + //! @param theIndex index of node to be removed. + //! @param isForce if TRUE node will be removed even if movability //! is not Free. Standard_EXPORT void RemoveNode(const Standard_Integer theIndex, const Standard_Boolean isForce = Standard_False) @@ -115,9 +115,9 @@ public: //! \name API for accessing mesh nodes. } //! Get list of links attached to the node with the given index. - //! \param theIndex index of node whose links should be retrieved. - //! \return list of links attached to the node. - inline const BRepMeshCol::ListOfInteger& LinksConnectedTo( + //! @param theIndex index of node whose links should be retrieved. + //! @return list of links attached to the node. + inline const BRepMesh::ListOfInteger& LinksConnectedTo( const Standard_Integer theIndex) const { return myNodes.FindFromIndex(theIndex); @@ -125,7 +125,7 @@ public: //! \name API for accessing mesh nodes. -public: //! \name API for accessing mesh links. +public: //! @name API for accessing mesh links. //! Returns number of links. inline Standard_Integer NbLinks() const @@ -134,50 +134,50 @@ public: //! \name API for accessing mesh links. } //! Adds link to the mesh if it is not already in the mesh. - //! \param theLink link to be added to the mesh. - //! \return index of the link in the structure. + //! @param theLink link to be added to the mesh. + //! @return index of the link in the structure. Standard_EXPORT Standard_Integer AddLink(const BRepMesh_Edge& theLink); //! Finds the index of the given link. - //! \param theLink link to find. - //! \return index of the given element of zero if link is not in the mesh. + //! @param theLink link to find. + //! @return index of the given element of zero if link is not in the mesh. Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Edge& theLink) const { return myLinks.FindIndex(theLink); } //! Get link by the index. - //! \param theIndex index of a link. - //! \return link with the given index. + //! @param theIndex index of a link. + //! @return link with the given index. Standard_EXPORT const BRepMesh_Edge& GetLink(const Standard_Integer theIndex) { return myLinks.FindKey(theIndex); } //! Returns map of indices of links registered in mesh. - inline const BRepMeshCol::MapOfInteger& LinksOfDomain() const + inline const BRepMesh::MapOfInteger& LinksOfDomain() const { return myLinksOfDomain; } //! Substitutes the link with the given index by new one. - //! \param theIndex index of link to be substituted. - //! \param theNewLink substituting link. - //! \return FALSE in case if new link is already in the structure, TRUE elsewhere. + //! @param theIndex index of link to be substituted. + //! @param theNewLink substituting link. + //! @return FALSE in case if new link is already in the structure, TRUE elsewhere. Standard_EXPORT Standard_Boolean SubstituteLink(const Standard_Integer theIndex, const BRepMesh_Edge& theNewLink); //! Removes link from the mesh in case if it has no connected elements //! and its type is Free. - //! \param theIndex index of link to be removed. - //! \param isForce if TRUE link will be removed even if movability + //! @param theIndex index of link to be removed. + //! @param isForce if TRUE link will be removed even if movability //! is not Free. Standard_EXPORT void RemoveLink(const Standard_Integer theIndex, const Standard_Boolean isForce = Standard_False); //! Returns indices of elements conected to the link with the given index. - //! \param theLinkIndex index of link whose data should be retrieved. - //! \return indices of elements conected to the link. + //! @param theLinkIndex index of link whose data should be retrieved. + //! @return indices of elements conected to the link. Standard_EXPORT const BRepMesh_PairOfIndex& ElementsConnectedTo( const Standard_Integer theLinkIndex) const { @@ -186,7 +186,7 @@ public: //! \name API for accessing mesh links. -public: //! \name API for accessing mesh elements. +public: //! @name API for accessing mesh elements. //! Returns number of links. inline Standard_Integer NbElements() const @@ -195,60 +195,60 @@ public: //! \name API for accessing mesh elements. } //! Adds element to the mesh if it is not already in the mesh. - //! \param theElement element to be added to the mesh. - //! \return index of the element in the structure. + //! @param theElement element to be added to the mesh. + //! @return index of the element in the structure. Standard_EXPORT Standard_Integer AddElement(const BRepMesh_Triangle& theElement); //! Finds the index of the given element. - //! \param theElement element to find. - //! \return index of the given element of zero if element is not in the mesh. + //! @param theElement element to find. + //! @return index of the given element of zero if element is not in the mesh. Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Triangle& theElement) const { return myElements.FindIndex(theElement); } //! Get element by the index. - //! \param theIndex index of an element. - //! \return element with the given index. + //! @param theIndex index of an element. + //! @return element with the given index. Standard_EXPORT const BRepMesh_Triangle& GetElement(const Standard_Integer theIndex) { return myElements.FindKey(theIndex); } //! Returns map of indices of elements registered in mesh. - inline const BRepMeshCol::MapOfInteger& ElementsOfDomain() const + inline const BRepMesh::MapOfInteger& ElementsOfDomain() const { return myElementsOfDomain; } //! Substitutes the element with the given index by new one. - //! \param theIndex index of element to be substituted. - //! \param theNewLink substituting element. - //! \return FALSE in case if new element is already in the structure, TRUE elsewhere. + //! @param theIndex index of element to be substituted. + //! @param theNewLink substituting element. + //! @return FALSE in case if new element is already in the structure, TRUE elsewhere. Standard_EXPORT Standard_Boolean SubstituteElement(const Standard_Integer theIndex, const BRepMesh_Triangle& theNewElement); //! Removes element from the mesh. - //! \param theIndex index of element to be removed. + //! @param theIndex index of element to be removed. Standard_EXPORT void RemoveElement(const Standard_Integer theIndex); //! Returns indices of nodes forming the given element. - //! \param theElement element which nodes should be retrieved. - //! \param[out] theNodes nodes of the given element. + //! @param theElement element which nodes should be retrieved. + //! @param[out] theNodes nodes of the given element. Standard_EXPORT void ElementNodes( const BRepMesh_Triangle& theElement, Standard_Integer (&theNodes)[3]); -public: //! \name Auxilary API +public: //! @name Auxilary API //! Dumps information about this structure. - //! \param theStream stream to be used for dump. + //! @param theStream stream to be used for dump. Standard_EXPORT void Statistics(Standard_OStream& theStream) const; //! Returns memory allocator used by the structure. - inline const BRepMeshCol::Allocator& Allocator() const + inline const Handle(NCollection_IncAllocator)& Allocator() const { return myAllocator; } @@ -283,35 +283,35 @@ private: Standard_EXPORT void clearDeletedNodes(); //! Cleans dependent structures from the given link. - //! \param theIndex index of link in the data structure. - //! \param theLink reference to the link to avoid double accessing + //! @param theIndex index of link in the data structure. + //! @param theLink reference to the link to avoid double accessing //! to map of links. void cleanLink(const Standard_Integer theIndex, const BRepMesh_Edge& theLink); //! Cleans dependent structures from the given element. - //! \param theIndex index of element in the data structure. - //! \param theElement reference to the element to avoid double accessing + //! @param theIndex index of element in the data structure. + //! @param theElement reference to the element to avoid double accessing //! to map of elements. void cleanElement(const Standard_Integer theIndex, const BRepMesh_Triangle& theElement); //! Removes element index from the given pair. Used by cleanElement. - //! \param theIndex index of element to be removed. - //! \param thePair pair of elements to be cleaned. + //! @param theIndex index of element to be removed. + //! @param thePair pair of elements to be cleaned. void removeElementIndex(const Standard_Integer theIndex, BRepMesh_PairOfIndex& thePair); private: - BRepMesh_VertexTool myNodes; - BRepMeshCol::IDMapOfLink myLinks; - BRepMeshCol::ListOfInteger myDelLinks; - BRepMeshCol::IMapOfElement myElements; - BRepMeshCol::MapOfInteger myElementsOfDomain; - BRepMeshCol::MapOfInteger myLinksOfDomain; - BRepMeshCol::Allocator myAllocator; + BRepMesh_VertexTool myNodes; + BRepMesh::IDMapOfLink myLinks; + BRepMesh::ListOfInteger myDelLinks; + BRepMesh::IMapOfElement myElements; + BRepMesh::MapOfInteger myElementsOfDomain; + BRepMesh::MapOfInteger myLinksOfDomain; + Handle(NCollection_IncAllocator) myAllocator; }; DEFINE_STANDARD_HANDLE(BRepMesh_DataStructureOfDelaun,Standard_Transient) diff --git a/src/BRepMesh/BRepMesh_Delaun.cxx b/src/BRepMesh/BRepMesh_Delaun.cxx index 654783414b..b300b13927 100644 --- a/src/BRepMesh/BRepMesh_Delaun.cxx +++ b/src/BRepMesh/BRepMesh_Delaun.cxx @@ -76,7 +76,7 @@ namespace { //purpose : Creates the triangulation with an empty Mesh data structure //======================================================================= BRepMesh_Delaun::BRepMesh_Delaun( - BRepMeshCol::Array1OfVertexOfDelaun& theVertices) + BRepMesh::Array1OfVertexOfDelaun& theVertices) : myCircles( theVertices.Length(), new NCollection_IncAllocator() ) { if ( theVertices.Length() > 2 ) @@ -93,7 +93,7 @@ BRepMesh_Delaun::BRepMesh_Delaun( //======================================================================= BRepMesh_Delaun::BRepMesh_Delaun( const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh, - BRepMeshCol::Array1OfVertexOfDelaun& theVertices) + BRepMesh::Array1OfVertexOfDelaun& theVertices) : myCircles( theVertices.Length(), theOldMesh->Allocator() ) { myMeshData = theOldMesh; @@ -107,7 +107,7 @@ BRepMesh_Delaun::BRepMesh_Delaun( //======================================================================= BRepMesh_Delaun::BRepMesh_Delaun( const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh, - BRepMeshCol::Array1OfInteger& theVertexIndices) + BRepMesh::Array1OfInteger& theVertexIndices) : myCircles( theVertexIndices.Length(), theOldMesh->Allocator() ) { myMeshData = theOldMesh; @@ -127,12 +127,12 @@ BRepMesh_Delaun::BRepMesh_Delaun( //function : Init //purpose : Initializes the triangulation with an Array of Vertex //======================================================================= -void BRepMesh_Delaun::Init( BRepMeshCol::Array1OfVertexOfDelaun& theVertices ) +void BRepMesh_Delaun::Init(BRepMesh::Array1OfVertexOfDelaun& theVertices) { Bnd_Box2d aBox; Standard_Integer aLowerIdx = theVertices.Lower(); Standard_Integer anUpperIdx = theVertices.Upper(); - BRepMeshCol::Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx ); + BRepMesh::Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx ); Standard_Integer anIndex = aLowerIdx; for ( ; anIndex <= anUpperIdx; ++anIndex ) @@ -148,8 +148,8 @@ void BRepMesh_Delaun::Init( BRepMeshCol::Array1OfVertexOfDelaun& theVertices ) //function : perform //purpose : Create super mesh and run triangulation procedure //======================================================================= -void BRepMesh_Delaun::perform( Bnd_Box2d& theBndBox, - BRepMeshCol::Array1OfInteger& theVertexIndexes ) +void BRepMesh_Delaun::perform(Bnd_Box2d& theBndBox, + BRepMesh::Array1OfInteger& theVertexIndexes) { theBndBox.Enlarge( Precision ); superMesh( theBndBox ); @@ -218,8 +218,8 @@ void BRepMesh_Delaun::superMesh( const Bnd_Box2d& theBox ) // edges into the map. // When an edge is suppressed more than one time it is destroyed. //======================================================================= -void BRepMesh_Delaun::deleteTriangle( const Standard_Integer theIndex, - BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) +void BRepMesh_Delaun::deleteTriangle(const Standard_Integer theIndex, + BRepMesh::MapOfIntegerInteger& theLoopEdges ) { myCircles.Delete( theIndex ); @@ -244,10 +244,10 @@ void BRepMesh_Delaun::deleteTriangle( const Standard_Integer theIndex, //purpose : Computes the triangulation and add the vertices edges and // triangles to the Mesh data structure //======================================================================= -void BRepMesh_Delaun::compute( BRepMeshCol::Array1OfInteger& theVertexIndexes ) +void BRepMesh_Delaun::compute(BRepMesh::Array1OfInteger& theVertexIndexes) { // Insertion of edges of super triangles in the list of free edges: - BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); + BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); Standard_Integer e[3]; Standard_Boolean o[3]; mySupTrian.Edges( e, o ); @@ -272,13 +272,13 @@ void BRepMesh_Delaun::compute( BRepMeshCol::Array1OfInteger& theVertexIndexes ) aSelector.NeighboursOfNode( mySupVert[aSupVertId] ); aLoopEdges.Clear(); - BRepMeshCol::MapOfInteger::Iterator aFreeTriangles( aSelector.Elements() ); + BRepMesh::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 - BRepMeshCol::MapOfIntegerInteger::Iterator aFreeEdges( aLoopEdges ); + BRepMesh::MapOfIntegerInteger::Iterator aFreeEdges( aLoopEdges ); for ( ; aFreeEdges.More(); aFreeEdges.Next() ) { if ( myMeshData->ElementsConnectedTo( aFreeEdges.Key() ).IsEmpty() ) @@ -294,13 +294,13 @@ void BRepMesh_Delaun::compute( BRepMeshCol::Array1OfInteger& theVertexIndexes ) //function : createTriangles //purpose : Creates the triangles beetween the node and the polyline. //======================================================================= -void BRepMesh_Delaun::createTriangles ( const Standard_Integer theVertexIndex, - BRepMeshCol::MapOfIntegerInteger& thePoly ) +void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexIndex, + BRepMesh::MapOfIntegerInteger& thePoly) { - BRepMeshCol::ListOfInteger aLoopEdges, anExternalEdges; + BRepMesh::ListOfInteger aLoopEdges, anExternalEdges; const gp_XY& aVertexCoord = myMeshData->GetNode( theVertexIndex ).Coord(); - BRepMeshCol::MapOfIntegerInteger::Iterator anEdges( thePoly ); + BRepMesh::MapOfIntegerInteger::Iterator anEdges( thePoly ); for ( ; anEdges.More(); anEdges.Next() ) { Standard_Integer anEdgeId = anEdges.Key(); @@ -415,9 +415,10 @@ void BRepMesh_Delaun::createTriangles ( const Standard_Integer theVer //function : createTrianglesOnNewVertices //purpose : Creation of triangles from the new nodes //======================================================================= -void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger& theVertexIndexes ) +void BRepMesh_Delaun::createTrianglesOnNewVertices( + BRepMesh::Array1OfInteger& theVertexIndexes) { - BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); + BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); // Insertion of nodes : Standard_Boolean isModify = Standard_True; @@ -432,10 +433,10 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger const BRepMesh_Vertex& aVertex = GetVertex( aVertexIdx ); // Iterator in the list of indexes of circles containing the node - BRepMeshCol::ListOfInteger& aCirclesList = myCircles.Select( aVertex.Coord() ); + BRepMesh::ListOfInteger& aCirclesList = myCircles.Select( aVertex.Coord() ); Standard_Integer onEgdeId = 0, aTriangleId = 0; - BRepMeshCol::ListOfInteger::Iterator aCircleIt( aCirclesList ); + BRepMesh::ListOfInteger::Iterator aCircleIt( aCirclesList ); for ( ; aCircleIt.More(); aCircleIt.Next() ) { // To add a node in the mesh it is necessary to check conditions: @@ -466,7 +467,7 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger while ( isModify && !aCirclesList.IsEmpty() ) { isModify = Standard_False; - BRepMeshCol::ListOfInteger::Iterator aCircleIt1( aCirclesList ); + BRepMesh::ListOfInteger::Iterator aCircleIt1( aCirclesList ); for ( ; aCircleIt1.More(); aCircleIt1.Next() ) { Standard_Integer e[3]; @@ -491,11 +492,11 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger } } // Check that internal edges are not crossed by triangles - BRepMeshCol::HMapOfInteger anInternalEdges = InternalEdges(); + BRepMesh::HMapOfInteger anInternalEdges = InternalEdges(); // Destruction of triancles intersecting internal edges // and their replacement by makeshift triangles - BRepMeshCol::MapOfInteger::Iterator anInernalEdgesIt( *anInternalEdges ); + BRepMesh::MapOfInteger::Iterator anInernalEdgesIt( *anInternalEdges ); for ( ; anInernalEdgesIt.More(); anInernalEdgesIt.Next() ) { Standard_Integer aNbC; @@ -575,11 +576,11 @@ void BRepMesh_Delaun::cleanupMesh() { for(;;) { - BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); - BRepMeshCol::MapOfInteger aDelTriangles; + BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); + BRepMesh::MapOfInteger aDelTriangles; - BRepMeshCol::HMapOfInteger aFreeEdges = FreeEdges(); - BRepMeshCol::MapOfInteger::Iterator aFreeEdgesIt( *aFreeEdges ); + BRepMesh::HMapOfInteger aFreeEdges = FreeEdges(); + BRepMesh::MapOfInteger::Iterator aFreeEdgesIt( *aFreeEdges ); for ( ; aFreeEdgesIt.More(); aFreeEdgesIt.Next() ) { const Standard_Integer& aFreeEdgeId = aFreeEdgesIt.Key(); @@ -641,7 +642,7 @@ void BRepMesh_Delaun::cleanupMesh() // Destruction of triangles : Standard_Integer aDeletedTrianglesNb = 0; - BRepMeshCol::MapOfInteger::Iterator aDelTrianglesIt( aDelTriangles ); + BRepMesh::MapOfInteger::Iterator aDelTrianglesIt( aDelTriangles ); for ( ; aDelTrianglesIt.More(); aDelTrianglesIt.Next() ) { deleteTriangle( aDelTrianglesIt.Key(), aLoopEdges ); @@ -649,7 +650,7 @@ void BRepMesh_Delaun::cleanupMesh() } // Destruction of remaining hanging edges - BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); + BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() ) { if ( myMeshData->ElementsConnectedTo( aLoopEdgesIt.Key() ).IsEmpty() ) @@ -667,17 +668,17 @@ void BRepMesh_Delaun::cleanupMesh() //======================================================================= void BRepMesh_Delaun::frontierAdjust() { - BRepMeshCol::HMapOfInteger aFrontier = Frontier(); - BRepMeshCol::VectorOfInteger aFailedFrontiers; - BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); - BRepMeshCol::HMapOfInteger aIntFrontierEdges = new BRepMeshCol::MapOfInteger; + BRepMesh::HMapOfInteger aFrontier = Frontier(); + BRepMesh::VectorOfInteger aFailedFrontiers; + BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); + BRepMesh::HMapOfInteger aIntFrontierEdges = new BRepMesh::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. - BRepMeshCol::MapOfInteger::Iterator aFrontierIt( *aFrontier ); + BRepMesh::MapOfInteger::Iterator aFrontierIt( *aFrontier ); for ( ; aFrontierIt.More(); aFrontierIt.Next() ) { Standard_Integer aFrontierId = aFrontierIt.Key(); @@ -711,7 +712,7 @@ void BRepMesh_Delaun::frontierAdjust() } // destrucrion of remaining hanging edges : - BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); + BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() ) { Standard_Integer aLoopEdgeId = aLoopEdgesIt.Key(); @@ -742,7 +743,7 @@ void BRepMesh_Delaun::frontierAdjust() // 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. - BRepMeshCol::VectorOfInteger::Iterator aFailedFrontiersIt( aFailedFrontiers ); + BRepMesh::VectorOfInteger::Iterator aFailedFrontiersIt( aFailedFrontiers ); for ( ; aFailedFrontiersIt.More(); aFailedFrontiersIt.Next() ) { Standard_Integer aFrontierId = aFailedFrontiersIt.Value(); @@ -758,9 +759,9 @@ void BRepMesh_Delaun::frontierAdjust() //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( BRepMeshCol::SequenceOfBndB2d& theBoxes, - const BRepMesh_Vertex& theV1, - const BRepMesh_Vertex& theV2 ) +void BRepMesh_Delaun::fillBndBox(BRepMesh::SequenceOfBndB2d& theBoxes, + const BRepMesh_Vertex& theV1, + const BRepMesh_Vertex& theV2) { Bnd_B2d aBox; aBox.Add( theV1.Coord() ); @@ -773,16 +774,16 @@ void BRepMesh_Delaun::fillBndBox( BRepMeshCol::SequenceOfBndB2d& theBoxes, //purpose : Collect the polygon at the left of the given edge (material side) //======================================================================= Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf( - const Standard_Integer theStartEdgeId, - const Standard_Boolean isForward, - BRepMeshCol::HMapOfInteger theSkipped ) + const Standard_Integer theStartEdgeId, + const Standard_Boolean isForward, + BRepMesh::HMapOfInteger theSkipped ) { if ( !theSkipped.IsNull() && theSkipped->Contains( theStartEdgeId ) ) return Standard_True; const BRepMesh_Edge& aRefEdge = GetEdge( theStartEdgeId ); - BRepMeshCol::SequenceOfInteger aPolygon; + BRepMesh::SequenceOfInteger aPolygon; Standard_Integer aStartNode, aPivotNode; if ( isForward ) { @@ -810,14 +811,14 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf( // Auxilary structures. // Bounding boxes of polygon links to be used for preliminary // analysis of intersections - BRepMeshCol::SequenceOfBndB2d aBoxes; + BRepMesh::SequenceOfBndB2d aBoxes; fillBndBox( aBoxes, aStartEdgeVertexS, aPivotVertex ); // Hanging ends - BRepMeshCol::MapOfInteger aDeadLinks; + BRepMesh::MapOfInteger aDeadLinks; // Links are temporarily excluded from consideration - BRepMeshCol::MapOfInteger aLeprousLinks; + BRepMesh::MapOfInteger aLeprousLinks; aLeprousLinks.Add( theStartEdgeId ); Standard_Boolean isSkipLeprous = Standard_True; @@ -902,26 +903,26 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf( // consideration next time until a hanging end is occured. //======================================================================= Standard_Integer BRepMesh_Delaun::findNextPolygonLink( - const Standard_Integer& theFirstNode, - const Standard_Integer& thePivotNode, - const BRepMesh_Vertex& thePivotVertex, - const gp_Vec2d& theRefLinkDir, - const BRepMeshCol::SequenceOfBndB2d& theBoxes, - const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::HMapOfInteger theSkipped, - const Standard_Boolean& isSkipLeprous, - BRepMeshCol::MapOfInteger& theLeprousLinks, - BRepMeshCol::MapOfInteger& theDeadLinks, - Standard_Integer& theNextPivotNode, - gp_Vec2d& theNextLinkDir, - Bnd_B2d& theNextLinkBndBox ) + const Standard_Integer& theFirstNode, + const Standard_Integer& thePivotNode, + const BRepMesh_Vertex& thePivotVertex, + const gp_Vec2d& theRefLinkDir, + const BRepMesh::SequenceOfBndB2d& theBoxes, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::HMapOfInteger theSkipped, + const Standard_Boolean& isSkipLeprous, + BRepMesh::MapOfInteger& theLeprousLinks, + BRepMesh::MapOfInteger& theDeadLinks, + Standard_Integer& theNextPivotNode, + gp_Vec2d& theNextLinkDir, + Bnd_B2d& theNextLinkBndBox ) { // Find the next link having the greatest angle // respect to a direction of a reference one Standard_Real aMaxAngle = RealFirst(); Standard_Integer aNextLinkId = 0; - BRepMeshCol::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( thePivotNode ) ); + BRepMesh::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( thePivotNode ) ); for ( ; aLinkIt.More(); aLinkIt.Next() ) { const Standard_Integer& aNeighbourLinkInfo = aLinkIt.Value(); @@ -1011,13 +1012,13 @@ Standard_Integer BRepMesh_Delaun::findNextPolygonLink( // parameter. //======================================================================= Standard_Boolean BRepMesh_Delaun::checkIntersection( - 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 + const BRepMesh_Edge& theLink, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::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() ); @@ -1081,17 +1082,17 @@ inline void BRepMesh_Delaun::addTriangle( const Standard_Integer (&theEdgesId)[3 //function : cleanupPolygon //purpose : Remove internal triangles from the given polygon //======================================================================= -void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes ) +void BRepMesh_Delaun::cleanupPolygon(const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes ) { Standard_Integer aPolyLen = thePolygon.Length(); if ( aPolyLen < 3 ) return; - BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); - BRepMeshCol::MapOfInteger anIgnoredEdges; - BRepMeshCol::MapOfInteger aPolyVerticesFindMap; - BRepMeshCol::VectorOfInteger aPolyVertices; + BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); + BRepMesh::MapOfInteger anIgnoredEdges; + BRepMesh::MapOfInteger aPolyVerticesFindMap; + BRepMesh::VectorOfInteger aPolyVertices; // Collect boundary vertices of the polygon for ( Standard_Integer aPolyIt = 1; aPolyIt <= aPolyLen; ++aPolyIt ) { @@ -1157,7 +1158,7 @@ void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& theP if ( aPolyVertices.First() != aPolyVertices.Last() ) aPolyVertices.Append( aPolyVertices.First() ); - BRepMeshCol::MapOfInteger aSurvivedLinks( anIgnoredEdges ); + BRepMesh::MapOfInteger aSurvivedLinks( anIgnoredEdges ); Standard_Integer aPolyVertIt = 0; Standard_Integer anUniqueVerticesNum = aPolyVertices.Length() - 1; @@ -1168,7 +1169,7 @@ void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& theP thePolyBoxes, aSurvivedLinks, aLoopEdges ); } - BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); + BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() ) { const Standard_Integer& aLoopEdgeId = aLoopEdgesIt.Key(); @@ -1186,19 +1187,19 @@ void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& theP // inside the polygon or crossed it. //======================================================================= void BRepMesh_Delaun::killTrianglesAroundVertex( - 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 ) + const Standard_Integer theZombieNodeId, + const BRepMesh::VectorOfInteger& thePolyVertices, + const BRepMesh::MapOfInteger& thePolyVerticesFindMap, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes, + BRepMesh::MapOfInteger& theSurvivedLinks, + BRepMesh::MapOfIntegerInteger& theLoopEdges ) { - BRepMeshCol::ListOfInteger::Iterator aNeighborsIt = + BRepMesh::ListOfInteger::Iterator aNeighborsIt = myMeshData->LinksConnectedTo( theZombieNodeId ); // Try to infect neighbor nodes - BRepMeshCol::VectorOfInteger aVictimNodes; + BRepMesh::VectorOfInteger aVictimNodes; for ( ; aNeighborsIt.More(); aNeighborsIt.Next() ) { const Standard_Integer& aNeighborLinkId = aNeighborsIt.Value(); @@ -1256,7 +1257,7 @@ void BRepMesh_Delaun::killTrianglesAroundVertex( } // Go and do your job! - BRepMeshCol::VectorOfInteger::Iterator aVictimIt( aVictimNodes ); + BRepMesh::VectorOfInteger::Iterator aVictimIt( aVictimNodes ); for ( ; aVictimIt.More(); aVictimIt.Next() ) { killTrianglesAroundVertex( aVictimIt.Value(), thePolyVertices, @@ -1270,8 +1271,8 @@ void BRepMesh_Delaun::killTrianglesAroundVertex( //purpose : Checks is the given vertex lies inside the polygon //======================================================================= Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon( - const Standard_Integer& theVertexId, - const BRepMeshCol::VectorOfInteger& thePolygonVertices ) const + const Standard_Integer& theVertexId, + const BRepMesh::VectorOfInteger& thePolygonVertices ) const { Standard_Integer aPolyLen = thePolygonVertices.Length(); if ( aPolyLen < 3 ) @@ -1311,13 +1312,13 @@ Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon( // boundary intersection. Does nothing elsewhere. //======================================================================= void BRepMesh_Delaun::killTrianglesOnIntersectingLinks( - const Standard_Integer& theLinkToCheckId, - const BRepMesh_Edge& theLinkToCheck, - const Standard_Integer& theEndPoint, - const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, - BRepMeshCol::MapOfInteger& theSurvivedLinks, - BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) + const Standard_Integer& theLinkToCheckId, + const BRepMesh_Edge& theLinkToCheck, + const Standard_Integer& theEndPoint, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes, + BRepMesh::MapOfInteger& theSurvivedLinks, + BRepMesh::MapOfIntegerInteger& theLoopEdges ) { if ( theSurvivedLinks.Contains( theLinkToCheckId ) ) return; @@ -1335,7 +1336,7 @@ void BRepMesh_Delaun::killTrianglesOnIntersectingLinks( killLinkTriangles( theLinkToCheckId, theLoopEdges ); - BRepMeshCol::ListOfInteger::Iterator aNeighborsIt = + BRepMesh::ListOfInteger::Iterator aNeighborsIt = myMeshData->LinksConnectedTo( theEndPoint ); for ( ; aNeighborsIt.More(); aNeighborsIt.Next() ) @@ -1357,8 +1358,8 @@ void BRepMesh_Delaun::killTrianglesOnIntersectingLinks( //purpose : Kill triangles bound to the given link. //======================================================================= void BRepMesh_Delaun::killLinkTriangles( - const Standard_Integer& theLinkId, - BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) + const Standard_Integer& theLinkId, + BRepMesh::MapOfIntegerInteger& theLoopEdges ) { const BRepMesh_PairOfIndex& aPair = myMeshData->ElementsConnectedTo( theLinkId ); @@ -1400,17 +1401,17 @@ void BRepMesh_Delaun::getOrientedNodes(const BRepMesh_Edge& theEdge, //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 BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes) +void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkFrom, + const Standard_Integer theLinkTo, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes) { Standard_Integer aNbOfLinksInLoop = theLinkTo - theLinkFrom - 1; if ( aNbOfLinksInLoop < 3 ) return; - BRepMeshCol::SequenceOfInteger aPolygon; - BRepMeshCol::SequenceOfBndB2d aPolyBoxes; + BRepMesh::SequenceOfInteger aPolygon; + BRepMesh::SequenceOfBndB2d aPolyBoxes; for ( ; aNbOfLinksInLoop > 0; --aNbOfLinksInLoop ) { Standard_Integer aLoopLinkIndex = theLinkFrom + aNbOfLinksInLoop; @@ -1426,12 +1427,12 @@ void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkF // given polygon. //======================================================================= Standard_Integer BRepMesh_Delaun::createAndReplacePolygonLink( - const Standard_Integer *theNodes, - const gp_Pnt2d *thePnts, - const Standard_Integer theRootIndex, - const ReplaceFlag theReplaceFlag, - BRepMeshCol::SequenceOfInteger& thePolygon, - BRepMeshCol::SequenceOfBndB2d& thePolyBoxes ) + const Standard_Integer *theNodes, + const gp_Pnt2d *thePnts, + const Standard_Integer theRootIndex, + const ReplaceFlag theReplaceFlag, + BRepMesh::SequenceOfInteger& thePolygon, + BRepMesh::SequenceOfBndB2d& thePolyBoxes ) { Standard_Integer aNewEdgeId = myMeshData->AddLink( BRepMesh_Edge( @@ -1466,9 +1467,9 @@ Standard_Integer BRepMesh_Delaun::createAndReplacePolygonLink( //function : meshPolygon //purpose : //======================================================================= -void BRepMesh_Delaun::meshPolygon( BRepMeshCol::SequenceOfInteger& thePolygon, - BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, - BRepMeshCol::HMapOfInteger theSkipped ) +void BRepMesh_Delaun::meshPolygon(BRepMesh::SequenceOfInteger& thePolygon, + BRepMesh::SequenceOfBndB2d& thePolyBoxes, + BRepMesh::HMapOfInteger theSkipped ) { // Check is the source polygon elementary if ( meshElementaryPolygon( thePolygon ) ) @@ -1690,7 +1691,7 @@ void BRepMesh_Delaun::meshPolygon( BRepMeshCol::SequenceOfInteger& thePolygon, //purpose : Triangulation of closed polygon containing only three edges. //======================================================================= inline Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon( - const BRepMeshCol::SequenceOfInteger& thePolygon ) + const BRepMesh::SequenceOfInteger& thePolygon) { Standard_Integer aPolyLen = thePolygon.Length(); if ( aPolyLen < 3 ) @@ -1732,8 +1733,8 @@ inline Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon( // its edges in the structure. // (negative index means reversed edge) //======================================================================= -void BRepMesh_Delaun::meshSimplePolygon( BRepMeshCol::SequenceOfInteger& thePolygon, - BRepMeshCol::SequenceOfBndB2d& thePolyBoxes ) +void BRepMesh_Delaun::meshSimplePolygon(BRepMesh::SequenceOfInteger& thePolygon, + BRepMesh::SequenceOfBndB2d& thePolyBoxes ) { // Check is the given polygon elementary if ( meshElementaryPolygon( thePolygon ) ) @@ -1874,11 +1875,11 @@ void BRepMesh_Delaun::meshSimplePolygon( BRepMeshCol::SequenceOfInteger& thePoly // polygon. if ( aUsedLinkId < aPolyLen ) { - BRepMeshCol::SequenceOfInteger aRightPolygon; + BRepMesh::SequenceOfInteger aRightPolygon; thePolygon.Split( aUsedLinkId, aRightPolygon ); aRightPolygon.Prepend( -aNewEdgesInfo[2] ); - BRepMeshCol::SequenceOfBndB2d aRightPolyBoxes; + BRepMesh::SequenceOfBndB2d aRightPolyBoxes; thePolyBoxes.Split( aUsedLinkId, aRightPolyBoxes ); Bnd_B2d aBox; @@ -1917,17 +1918,17 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex ) BRepMesh_SelectorOfDataStructureOfDelaun aSelector( myMeshData ); aSelector.NeighboursOf( theVertex ); - BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); + BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); // Loop on triangles to be destroyed : - BRepMeshCol::MapOfInteger::Iterator aTriangleIt( aSelector.Elements() ); + BRepMesh::MapOfInteger::Iterator aTriangleIt( aSelector.Elements() ); for ( ; aTriangleIt.More(); aTriangleIt.Next() ) deleteTriangle( aTriangleIt.Key(), aLoopEdges ); - BRepMeshCol::SequenceOfBndB2d aBoxes; - BRepMeshCol::SequenceOfInteger aPolygon; + BRepMesh::SequenceOfBndB2d aBoxes; + BRepMesh::SequenceOfInteger aPolygon; Standard_Integer aLoopEdgesCount = aLoopEdges.Extent(); - BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); + BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); if ( aLoopEdgesIt.More() ) { @@ -1957,7 +1958,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex ) aLastNode = aFirstNode; while ( aPivotNode != aLastNode ) { - BRepMeshCol::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( aPivotNode ) ); + BRepMesh::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( aPivotNode ) ); for ( ; aLinkIt.More(); aLinkIt.Next() ) { if ( aLinkIt.Value() != anEdgeId && @@ -1998,7 +1999,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex ) //function : AddVertices //purpose : Adds some vertices in the triangulation. //======================================================================= -void BRepMesh_Delaun::AddVertices( BRepMeshCol::Array1OfVertexOfDelaun& theVertices ) +void BRepMesh_Delaun::AddVertices(BRepMesh::Array1OfVertexOfDelaun& theVertices) { std::make_heap(theVertices.begin(), theVertices.end(), ComparatorOfVertexOfDelaun()); std::sort_heap(theVertices.begin(), theVertices.end(), ComparatorOfVertexOfDelaun()); @@ -2006,7 +2007,7 @@ void BRepMesh_Delaun::AddVertices( BRepMeshCol::Array1OfVertexOfDelaun& theVerti Standard_Integer aLower = theVertices.Lower(); Standard_Integer anUpper = theVertices.Upper(); - BRepMeshCol::Array1OfInteger aVertexIndexes( aLower, anUpper ); + BRepMesh::Array1OfInteger aVertexIndexes( aLower, anUpper ); for ( Standard_Integer i = aLower; i <= anUpper; ++i ) aVertexIndexes(i) = myMeshData->AddNode( theVertices(i) ); @@ -2105,11 +2106,11 @@ Standard_Boolean BRepMesh_Delaun::UseEdge( const Standard_Integer /*theIndex*/ ) //function : getEdgesByType //purpose : Gives the list of edges with type defined by input parameter //======================================================================= -BRepMeshCol::HMapOfInteger BRepMesh_Delaun::getEdgesByType( +BRepMesh::HMapOfInteger BRepMesh_Delaun::getEdgesByType( const BRepMesh_DegreeOfFreedom theEdgeType ) const { - BRepMeshCol::HMapOfInteger aResult = new BRepMeshCol::MapOfInteger; - BRepMeshCol::MapOfInteger::Iterator anEdgeIt( myMeshData->LinksOfDomain() ); + BRepMesh::HMapOfInteger aResult = new BRepMesh::MapOfInteger; + BRepMesh::MapOfInteger::Iterator anEdgeIt( myMeshData->LinksOfDomain() ); for ( ; anEdgeIt.More(); anEdgeIt.Next() ) { @@ -2263,9 +2264,9 @@ BRepMesh_GeomTool::IntFlag BRepMesh_Delaun::intSegSeg( //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 BRepMeshCol::SequenceOfInteger& thePolygon, - const Standard_Integer theStartIndex, - const Standard_Integer theEndIndex ) const +Standard_Real BRepMesh_Delaun::polyArea(const BRepMesh::SequenceOfInteger& thePolygon, + const Standard_Integer theStartIndex, + const Standard_Integer theEndIndex) const { Standard_Real aArea = 0.0; Standard_Integer aPolyLen = thePolygon.Length(); diff --git a/src/BRepMesh/BRepMesh_Delaun.hxx b/src/BRepMesh/BRepMesh_Delaun.hxx index e6484a1663..fd289e18cf 100755 --- a/src/BRepMesh/BRepMesh_Delaun.hxx +++ b/src/BRepMesh/BRepMesh_Delaun.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -40,24 +40,24 @@ public: DEFINE_STANDARD_ALLOC //! Creates the triangulation with an empty Mesh data structure. - Standard_EXPORT BRepMesh_Delaun (BRepMeshCol::Array1OfVertexOfDelaun& theVertices); + Standard_EXPORT BRepMesh_Delaun (BRepMesh::Array1OfVertexOfDelaun& theVertices); //! Creates the triangulation with an existent Mesh data structure. Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh, - BRepMeshCol::Array1OfVertexOfDelaun& theVertices); + BRepMesh::Array1OfVertexOfDelaun& theVertices); //! Creates the triangulation with an existant Mesh data structure. Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh, - BRepMeshCol::Array1OfInteger& theVertexIndices); + BRepMesh::Array1OfInteger& theVertexIndices); //! Initializes the triangulation with an array of vertices. - Standard_EXPORT void Init (BRepMeshCol::Array1OfVertexOfDelaun& theVertices); + Standard_EXPORT void Init (BRepMesh::Array1OfVertexOfDelaun& theVertices); //! Removes a vertex from the triangulation. Standard_EXPORT void RemoveVertex (const BRepMesh_Vertex& theVertex); //! Adds some vertices into the triangulation. - Standard_EXPORT void AddVertices (BRepMeshCol::Array1OfVertexOfDelaun& theVertices); + Standard_EXPORT void AddVertices (BRepMesh::Array1OfVertexOfDelaun& theVertices); //! Modify mesh to use the edge. //! @return True if done @@ -70,19 +70,19 @@ public: } //! Gives the list of frontier edges. - inline BRepMeshCol::HMapOfInteger Frontier() const + inline BRepMesh::HMapOfInteger Frontier() const { return getEdgesByType (BRepMesh_Frontier); } //! Gives the list of internal edges. - inline BRepMeshCol::HMapOfInteger InternalEdges() const + inline BRepMesh::HMapOfInteger InternalEdges() const { return getEdgesByType (BRepMesh_Fixed); } //! Gives the list of free edges used only one time - inline BRepMeshCol::HMapOfInteger FreeEdges() const + inline BRepMesh::HMapOfInteger FreeEdges() const { return getEdgesByType (BRepMesh_Free); } @@ -121,86 +121,86 @@ private: InsertBefore }; - typedef NCollection_DataMap DataMapOfMap; + typedef NCollection_DataMap DataMapOfMap; //! Add boundig box for edge defined by start & end point to //! the given vector of bounding boxes for triangulation edges. - void fillBndBox (BRepMeshCol::SequenceOfBndB2d& theBoxes, - const BRepMesh_Vertex& theV1, - const BRepMesh_Vertex& theV2); + void fillBndBox (BRepMesh::SequenceOfBndB2d& theBoxes, + const BRepMesh_Vertex& theV1, + const BRepMesh_Vertex& theV2); //! Gives the list of edges with type defined by the input parameter. //! If the given type is BRepMesh_Free returns list of edges //! that have number of connected elements less or equal 1. - BRepMeshCol::HMapOfInteger getEdgesByType (const BRepMesh_DegreeOfFreedom theEdgeType) const; + BRepMesh::HMapOfInteger getEdgesByType (const BRepMesh_DegreeOfFreedom theEdgeType) const; //! Create super mesh and run triangulation procedure. - void perform (Bnd_Box2d& theBndBox, - BRepMeshCol::Array1OfInteger& theVertexIndices); + void perform (Bnd_Box2d& theBndBox, + BRepMesh::Array1OfInteger& theVertexIndices); //! Build the super mesh. void superMesh (const Bnd_Box2d& theBox); //! Computes the triangulation and adds the vertices, //! edges and triangles to the Mesh data structure. - void compute (BRepMeshCol::Array1OfInteger& theVertexIndices); + void compute (BRepMesh::Array1OfInteger& theVertexIndices); //! Adjust the mesh on the frontier. void frontierAdjust(); //! Find left polygon of the given edge and call meshPolygon. - Standard_Boolean meshLeftPolygonOf (const Standard_Integer theEdgeIndex, - const Standard_Boolean isForward, - BRepMeshCol::HMapOfInteger theSkipped = NULL); + Standard_Boolean meshLeftPolygonOf (const Standard_Integer theEdgeIndex, + const Standard_Boolean isForward, + BRepMesh::HMapOfInteger theSkipped = NULL); //! Find next link starting from the given node and has maximum //! angle respect the given reference link. //! Each time the next link is found other neighbor links at the pivot //! node are marked as leprous and will be excluded from consideration //! next time until a hanging end is occured. - Standard_Integer findNextPolygonLink (const Standard_Integer& theFirstNode, - const Standard_Integer& thePivotNode, - const BRepMesh_Vertex& thePivotVertex, - const gp_Vec2d& theRefLinkDir, - const BRepMeshCol::SequenceOfBndB2d& theBoxes, - const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::HMapOfInteger theSkipped, - const Standard_Boolean& isSkipLeprous, - BRepMeshCol::MapOfInteger& theLeprousLinks, - BRepMeshCol::MapOfInteger& theDeadLinks, - Standard_Integer& theNextPivotNode, - gp_Vec2d& theNextLinkDir, - Bnd_B2d& theNextLinkBndBox); + Standard_Integer findNextPolygonLink (const Standard_Integer& theFirstNode, + const Standard_Integer& thePivotNode, + const BRepMesh_Vertex& thePivotVertex, + const gp_Vec2d& theRefLinkDir, + const BRepMesh::SequenceOfBndB2d& theBoxes, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::HMapOfInteger theSkipped, + const Standard_Boolean& isSkipLeprous, + BRepMesh::MapOfInteger& theLeprousLinks, + BRepMesh::MapOfInteger& theDeadLinks, + Standard_Integer& theNextPivotNode, + gp_Vec2d& theNextLinkDir, + Bnd_B2d& theNextLinkBndBox); //! Check is the given link intersects the polygon boundaries. //! Returns bounding box for the given link trough the theLinkBndBox parameter. - Standard_Boolean checkIntersection (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; + Standard_Boolean checkIntersection (const BRepMesh_Edge& theLink, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes, + const Standard_Boolean isConsiderEndPointTouch, + const Standard_Boolean isConsiderPointOnEdge, + const Standard_Boolean isSkipLastEdge, + Bnd_B2d& theLinkBndBox) const; //! Triangulatiion of a closed polygon described by the list //! of indexes of its edges in the structure. //! (negative index means reversed edge) - void meshPolygon (BRepMeshCol::SequenceOfInteger& thePolygon, - BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, - BRepMeshCol::HMapOfInteger theSkipped = NULL); + void meshPolygon (BRepMesh::SequenceOfInteger& thePolygon, + BRepMesh::SequenceOfBndB2d& thePolyBoxes, + BRepMesh::HMapOfInteger theSkipped = NULL); //! Triangulatiion of a closed simple polygon (polygon without glued edges and loops) //! described by the list of indexes of its edges in the structure. //! (negative index means reversed edge) - void meshSimplePolygon (BRepMeshCol::SequenceOfInteger& thePolygon, - BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); + void meshSimplePolygon (BRepMesh::SequenceOfInteger& thePolygon, + BRepMesh::SequenceOfBndB2d& thePolyBoxes); //! Triangulation of closed polygon containing only three edges. - inline Standard_Boolean meshElementaryPolygon (const BRepMeshCol::SequenceOfInteger& thePolygon); + inline Standard_Boolean meshElementaryPolygon (const BRepMesh::SequenceOfInteger& thePolygon); //! Creates the triangles beetween the given node and the given polyline. - void createTriangles (const Standard_Integer theVertexIndex, - BRepMeshCol::MapOfIntegerInteger& thePoly); + void createTriangles (const Standard_Integer theVertexIndex, + BRepMesh::MapOfIntegerInteger& thePoly); //! Add a triangle based on the given oriented edges into mesh inline void addTriangle (const Standard_Integer (&theEdgesId)[3], @@ -209,8 +209,8 @@ private: //! Deletes the triangle with the given index and adds the free edges into the map. //! When an edge is suppressed more than one time it is destroyed. - void deleteTriangle (const Standard_Integer theIndex, - BRepMeshCol::MapOfIntegerInteger& theLoopEdges); + void deleteTriangle (const Standard_Integer theIndex, + BRepMesh::MapOfIntegerInteger& theLoopEdges); //! Returns start and end nodes of the given edge in respect to its orientation. void getOrientedNodes (const BRepMesh_Edge& theEdge, @@ -219,21 +219,21 @@ private: //! Processes loop within the given polygon formed by range of its //! links specified by start and end link indices. - void processLoop (const Standard_Integer theLinkFrom, - const Standard_Integer theLinkTo, - const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); + void processLoop (const Standard_Integer theLinkFrom, + const Standard_Integer theLinkTo, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes); //! Creates new link based on the given nodes and updates the given polygon. - Standard_Integer createAndReplacePolygonLink (const Standard_Integer theNodes[], - const gp_Pnt2d thePnts [], - const Standard_Integer theRootIndex, - const ReplaceFlag theReplaceFlag, - BRepMeshCol::SequenceOfInteger& thePolygon, - BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); + Standard_Integer createAndReplacePolygonLink (const Standard_Integer theNodes[], + const gp_Pnt2d thePnts [], + const Standard_Integer theRootIndex, + const ReplaceFlag theReplaceFlag, + BRepMesh::SequenceOfInteger& thePolygon, + BRepMesh::SequenceOfBndB2d& thePolyBoxes); //! Creates the triangles on new nodes. - void createTrianglesOnNewVertices (BRepMeshCol::Array1OfInteger& theVertexIndices); + void createTrianglesOnNewVertices (BRepMesh::Array1OfInteger& theVertexIndices); //! Cleanup mesh from the free triangles. void cleanupMesh(); @@ -249,35 +249,35 @@ private: const Standard_Integer thePrevElementId); //! Remove internal triangles from the given polygon. - void cleanupPolygon (const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); + void cleanupPolygon (const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes); //! Checks is the given vertex lies inside the polygon. - Standard_Boolean isVertexInsidePolygon (const Standard_Integer& theVertexId, - const BRepMeshCol::VectorOfInteger& thePolygonVertices) const; + Standard_Boolean isVertexInsidePolygon (const Standard_Integer& theVertexId, + const BRepMesh::VectorOfInteger& thePolygonVertices) const; //! Remove all triangles and edges that are placed inside the polygon or crossed it. - void killTrianglesAroundVertex (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); + void killTrianglesAroundVertex (const Standard_Integer theZombieNodeId, + const BRepMesh::VectorOfInteger& thePolyVertices, + const BRepMesh::MapOfInteger& thePolyVerticesFindMap, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes, + BRepMesh::MapOfInteger& theSurvivedLinks, + BRepMesh::MapOfIntegerInteger& theLoopEdges); //! Checks is the given link crosses the polygon boundary. //! If yes, kills its triangles and checks neighbor links on boundary intersection. Does nothing elsewhere. - void killTrianglesOnIntersectingLinks (const Standard_Integer& theLinkToCheckId, - const BRepMesh_Edge& theLinkToCheck, - const Standard_Integer& theEndPoint, - const BRepMeshCol::SequenceOfInteger& thePolygon, - const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, - BRepMeshCol::MapOfInteger& theSurvivedLinks, - BRepMeshCol::MapOfIntegerInteger& theLoopEdges); + void killTrianglesOnIntersectingLinks (const Standard_Integer& theLinkToCheckId, + const BRepMesh_Edge& theLinkToCheck, + const Standard_Integer& theEndPoint, + const BRepMesh::SequenceOfInteger& thePolygon, + const BRepMesh::SequenceOfBndB2d& thePolyBoxes, + BRepMesh::MapOfInteger& theSurvivedLinks, + BRepMesh::MapOfIntegerInteger& theLoopEdges); //! Kill triangles bound to the given link. - void killLinkTriangles (const Standard_Integer& theLinkId, - BRepMeshCol::MapOfIntegerInteger& theLoopEdges); + void killLinkTriangles (const Standard_Integer& theLinkId, + BRepMesh::MapOfIntegerInteger& theLoopEdges); //! Calculates distances between the given point and edges of triangle. Standard_Real calculateDist (const gp_XY theVEdges[3], @@ -297,9 +297,9 @@ private: gp_Pnt2d& theIntPnt) const; //! Returns area of the loop of the given polygon defined by indices of its start and end links. - Standard_Real polyArea (const BRepMeshCol::SequenceOfInteger& thePolygon, - const Standard_Integer theStartIndex, - const Standard_Integer theEndIndex) const; + Standard_Real polyArea (const BRepMesh::SequenceOfInteger& thePolygon, + const Standard_Integer theStartIndex, + const Standard_Integer theEndIndex) const; private: diff --git a/src/BRepMesh/BRepMesh_DiscretFactory.hxx b/src/BRepMesh/BRepMesh_DiscretFactory.hxx index 6d3bac9f3a..57ddcec1e6 100644 --- a/src/BRepMesh/BRepMesh_DiscretFactory.hxx +++ b/src/BRepMesh/BRepMesh_DiscretFactory.hxx @@ -89,9 +89,9 @@ public: const TCollection_AsciiString& theFuncName = "DISCRETALGO"); //! Returns triangulation algorithm instance. - //! \param theShape shape to be meshed. - //! \param theLinDeflection linear deflection to be used for meshing. - //! \param theAngDeflection angular deflection to be used for meshing. + //! @param theShape shape to be meshed. + //! @param theLinDeflection linear deflection to be used for meshing. + //! @param theAngDeflection angular deflection to be used for meshing. Standard_EXPORT Handle(BRepMesh_DiscretRoot) Discret(const TopoDS_Shape& theShape, const Standard_Real theLinDeflection, const Standard_Real theAngDeflection); diff --git a/src/BRepMesh/BRepMesh_Edge.hxx b/src/BRepMesh/BRepMesh_Edge.hxx index 5a46ebbb74..69c92e072e 100644 --- a/src/BRepMesh/BRepMesh_Edge.hxx +++ b/src/BRepMesh/BRepMesh_Edge.hxx @@ -18,69 +18,7 @@ #include #include #include - -//! Light weighted structure representing simple link. -class BRepMesh_OrientedEdge -{ -public: - - DEFINE_STANDARD_ALLOC - - //! Default constructor. - Standard_EXPORT BRepMesh_OrientedEdge() - : myFirstNode(-1), - myLastNode(-1) - { - } - - //! Constructs a link between two vertices. - Standard_EXPORT BRepMesh_OrientedEdge( - const Standard_Integer theFirstNode, - const Standard_Integer theLastNode) - : myFirstNode(theFirstNode), - myLastNode(theLastNode) - { - } - - //! Returns index of first node of the Link. - inline Standard_Integer FirstNode() const - { - return myFirstNode; - } - - //! Returns index of last node of the Link. - inline Standard_Integer LastNode() const - { - return myLastNode; - } - - //! Returns hash code for this edge. - //! @param theUpper upper index in the container. - //! @return hash code. - Standard_EXPORT Standard_Integer HashCode(const Standard_Integer theUpper) const - { - return ::HashCode(myFirstNode + myLastNode, theUpper); - } - - //! Checks this and other edge for equality. - //! @param theOther edge to be checked against this one. - //! @retrun TRUE if edges have the same orientation, FALSE if not. - inline Standard_Boolean IsEqual(const BRepMesh_OrientedEdge& theOther) const - { - return (myFirstNode == theOther.myFirstNode && myLastNode == theOther.myLastNode); - } - - //! Alias for IsEqual. - Standard_Boolean operator ==(const BRepMesh_OrientedEdge& Other) const - { - return IsEqual(Other); - } - -private: - - Standard_Integer myFirstNode; - Standard_Integer myLastNode; -}; +#include //! Light weighted structure representing link of the mesh. class BRepMesh_Edge : public BRepMesh_OrientedEdge @@ -111,14 +49,14 @@ public: } //! Sets movability flag of the Link. - //! \param theMovability flag to be set. + //! @param theMovability flag to be set. inline void SetMovability(const BRepMesh_DegreeOfFreedom theMovability) { myMovability = theMovability; } //! Checks if the given edge and this one have the same orientation. - //! \param theOther edge to be checked against this one. + //! @param theOther edge to be checked against this one. //! \retrun TRUE if edges have the same orientation, FALSE if not. inline Standard_Boolean IsSameOrientation(const BRepMesh_Edge& theOther) const { @@ -126,8 +64,8 @@ public: } //! Checks for equality with another edge. - //! \param theOther edge to be checked against this one. - //! \return TRUE if equal, FALSE if not. + //! @param theOther edge to be checked against this one. + //! @return TRUE if equal, FALSE if not. inline Standard_Boolean IsEqual(const BRepMesh_Edge& theOther) const { if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted) @@ -148,12 +86,6 @@ private: BRepMesh_DegreeOfFreedom myMovability; }; -inline Standard_Integer HashCode(const BRepMesh_OrientedEdge& theEdge, - const Standard_Integer theUpper) -{ - return theEdge.HashCode(theUpper); -} - inline Standard_Integer HashCode(const BRepMesh_Edge& theEdge, const Standard_Integer theUpper) { diff --git a/src/BRepMesh/BRepMesh_EdgeChecker.hxx b/src/BRepMesh/BRepMesh_EdgeChecker.hxx index 8cc3a53b0b..f5587088cf 100644 --- a/src/BRepMesh/BRepMesh_EdgeChecker.hxx +++ b/src/BRepMesh/BRepMesh_EdgeChecker.hxx @@ -31,10 +31,10 @@ class BRepMesh_EdgeChecker public: //! Constructor - //! \param theFaceTri Poly triangulation of face the edges relie to. - //! \param theFaceLoc Face location to be used to extract polygon on triangulation. - //! \param theMutex Upper level shared mutex to protect isFailed flag from concurrent write access. - //! \param isFailed Upper level shared flag indicating that polygon on triangulation of checked + //! @param theFaceTri Poly triangulation of face the edges relie to. + //! @param theFaceLoc Face location to be used to extract polygon on triangulation. + //! @param theMutex Upper level shared mutex to protect isFailed flag from concurrent write access. + //! @param isFailed Upper level shared flag indicating that polygon on triangulation of checked //! edge is not consistent. If this flag is set to TRUE, other tasks will not check details of their data. BRepMesh_EdgeChecker( Handle(Poly_Triangulation)& theFaceTri, TopLoc_Location& theFaceLoc, @@ -48,7 +48,7 @@ public: } //! Checker's body. - //! \param theEdge edge to be checked. + //! @param theEdge edge to be checked. void operator ()(const TopoDS_Edge& theEdge) const { if (theEdge.IsNull() || myIsFailed) diff --git a/src/BRepMesh/BRepMesh_EdgeTessellator.hxx b/src/BRepMesh/BRepMesh_EdgeTessellator.hxx index d64bf6705a..5eb9f0df90 100644 --- a/src/BRepMesh/BRepMesh_EdgeTessellator.hxx +++ b/src/BRepMesh/BRepMesh_EdgeTessellator.hxx @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -77,10 +77,10 @@ private: const Standard_Integer theNbIter); private: - N_HANDLE myTool; - Handle(BRepAdaptor_HSurface) mySurface; - BRepAdaptor_Curve myCOnS; - Standard_Real mySquareEdgeDef; + NCollection_Handle myTool; + Handle(BRepAdaptor_HSurface) mySurface; + BRepAdaptor_Curve myCOnS; + Standard_Real mySquareEdgeDef; }; DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool) diff --git a/src/BRepMesh/BRepMesh_FaceAttribute.cxx b/src/BRepMesh/BRepMesh_FaceAttribute.cxx index 716f3e04e6..9529ef2e65 100644 --- a/src/BRepMesh/BRepMesh_FaceAttribute.cxx +++ b/src/BRepMesh/BRepMesh_FaceAttribute.cxx @@ -22,14 +22,32 @@ IMPLEMENT_STANDARD_HANDLE (BRepMesh_FaceAttribute, Standard_Transient) IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_FaceAttribute, Standard_Transient) +//======================================================================= +//function : Constructor +//purpose : +//======================================================================= +BRepMesh_FaceAttribute::BRepMesh_FaceAttribute() + : myDefFace (0.), + myUMin (0.), + myUMax (0.), + myVMin (0.), + myVMax (0.), + myDeltaX (1.), + myDeltaY (1.), + myStatus (BRepMesh_NoError), + myAllocator (new NCollection_IncAllocator(64000)) +{ + init(); +} + //======================================================================= //function : Constructor //purpose : //======================================================================= BRepMesh_FaceAttribute::BRepMesh_FaceAttribute( - const TopoDS_Face& theFace, - BRepMeshCol::DMapOfVertexInteger& theBoundaryVertices, - BRepMeshCol::DMapOfIntegerPnt& theBoundaryPoints) + const TopoDS_Face& theFace, + const BRepMesh::HDMapOfVertexInteger& theBoundaryVertices, + const BRepMesh::HDMapOfIntegerPnt& theBoundaryPoints) : myDefFace (0.), myUMin (0.), myUMax (0.), @@ -40,21 +58,10 @@ BRepMesh_FaceAttribute::BRepMesh_FaceAttribute( myStatus (BRepMesh_NoError), myBoundaryVertices(theBoundaryVertices), myBoundaryPoints (theBoundaryPoints), + myFace (theFace), myAllocator (new NCollection_IncAllocator(64000)) { - myVertexEdgeMap = new BRepMeshCol::IMapOfInteger; - myInternalEdges = new BRepMeshCol::DMapOfShapePairOfPolygon; - mySurfacePoints = new BRepMeshCol::DMapOfIntegerPnt; - myClassifier = new BRepMesh_Classifier; - - myFace = theFace; - BRepTools::Update(myFace); - myFace.Orientation(TopAbs_FORWARD); - - BRepAdaptor_Surface aSurfAdaptor(myFace, Standard_False); - mySurface = new BRepAdaptor_HSurface(aSurfAdaptor); - - ResetStructure(); + init(); } //======================================================================= @@ -72,6 +79,29 @@ BRepMesh_FaceAttribute::~BRepMesh_FaceAttribute() myAllocator.Nullify(); } +//======================================================================= +//function : init +//purpose : +//======================================================================= +void BRepMesh_FaceAttribute::init() +{ + myVertexEdgeMap = new BRepMesh::IMapOfInteger; + myInternalEdges = new BRepMesh::DMapOfShapePairOfPolygon; + mySurfacePoints = new BRepMesh::DMapOfIntegerPnt; + myClassifier = new BRepMesh_Classifier; + + if (!myFace.IsNull()) + { + BRepTools::Update(myFace); + myFace.Orientation(TopAbs_FORWARD); + + BRepAdaptor_Surface aSurfAdaptor(myFace, Standard_False); + mySurface = new BRepAdaptor_HSurface(aSurfAdaptor); + } + + ResetStructure(); +} + //======================================================================= //function : clearLocal //purpose : @@ -96,7 +126,9 @@ Handle(BRepMesh_DataStructureOfDelaun)& BRepMesh_FaceAttribute::ResetStructure() clearLocal(); myStructure = new BRepMesh_DataStructureOfDelaun(myAllocator); - BRepTools::UVBounds(myFace, myUMin, myUMax, myVMin, myVMax); + if (!myFace.IsNull()) + BRepTools::UVBounds(myFace, myUMin, myUMax, myVMin, myVMax); + Standard_Real aTolU = ToleranceU(); Standard_Real aTolV = ToleranceV(); @@ -125,8 +157,8 @@ Standard_Boolean BRepMesh_FaceAttribute::getVertexIndex( const TopoDS_Vertex& theVertex, Standard_Integer& theVertexIndex) const { - if (myBoundaryVertices.IsBound(theVertex)) - theVertexIndex = myBoundaryVertices.Find(theVertex); + if (!myBoundaryVertices.IsNull() && myBoundaryVertices->IsBound(theVertex)) + theVertexIndex = myBoundaryVertices->Find(theVertex); else if (mySurfaceVertices.IsBound(theVertex)) theVertexIndex = mySurfaceVertices.Find(theVertex); else @@ -164,3 +196,21 @@ gp_XY BRepMesh_FaceAttribute::Scale(const gp_XY& thePoint2d, gp_XY((thePoint2d.X() - myUMin) / myDeltaX, (thePoint2d.Y() - myVMin) / myDeltaY) : gp_XY(thePoint2d.X() * myDeltaX + myUMin, thePoint2d.Y() * myDeltaY + myVMin); } + +//======================================================================= +//function : ToleranceU +//purpose : +//======================================================================= +Standard_Real BRepMesh_FaceAttribute::ToleranceU() const +{ + return computeParametricTolerance(myUMin, myUMax); +} + +//======================================================================= +//function : ToleranceV +//purpose : +//======================================================================= +Standard_Real BRepMesh_FaceAttribute::ToleranceV() const +{ + return computeParametricTolerance(myVMin, myVMax); +} diff --git a/src/BRepMesh/BRepMesh_FaceAttribute.hxx b/src/BRepMesh/BRepMesh_FaceAttribute.hxx index 94d9068426..8c85ce65b7 100644 --- a/src/BRepMesh/BRepMesh_FaceAttribute.hxx +++ b/src/BRepMesh/BRepMesh_FaceAttribute.hxx @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -30,6 +30,9 @@ class BRepMesh_FaceAttribute : public Standard_Transient { public: + //! Default constructor. + Standard_EXPORT BRepMesh_FaceAttribute(); + //! Constructor. //! @param theFace face the attribute is created for. //! Used for default initialization. Attribute keeps reference @@ -37,12 +40,12 @@ public: //! @param theBoundaryVertices shared map of shape vertices. //! @param theBoundaryPoints shared discretization points of shape boundaries. Standard_EXPORT BRepMesh_FaceAttribute( - const TopoDS_Face& theFace, - BRepMeshCol::DMapOfVertexInteger& theBoundaryVertices, - BRepMeshCol::DMapOfIntegerPnt& theBoundaryPoints); + const TopoDS_Face& theFace, + const BRepMesh::HDMapOfVertexInteger& theBoundaryVertices, + const BRepMesh::HDMapOfIntegerPnt& theBoundaryPoints); //! Destructor. - virtual ~BRepMesh_FaceAttribute(); + Standard_EXPORT virtual ~BRepMesh_FaceAttribute(); public: //! @name main geometrical properties. @@ -52,24 +55,36 @@ public: //! @name main geometrical properties. return mySurface; } + //! Sets reference face. + inline void SetFace(const TopoDS_Face& theFace) + { + myFace = theFace; + } + //! Returns forward oriented face to be used for calculations. inline const TopoDS_Face& Face() const { return myFace; } + //! Sets boundary vertices map. + inline void SetBoundaryVertices(const BRepMesh::HDMapOfVertexInteger& theVertices) + { + myBoundaryVertices = theVertices; + } + + //! Sets boundary points map. + inline void SetBoundaryPoints(const BRepMesh::HDMapOfIntegerPnt& theBoundaryPoints) + { + myBoundaryPoints = theBoundaryPoints; + } + //! Returns U tolerance of face calculated regarding its parameters. - inline Standard_Real ToleranceU() const - { - return computeParametricTolerance(myUMin, myUMax); - } - + Standard_EXPORT Standard_Real ToleranceU() const; + //! Returns V tolerance of face calculated regarding its parameters. - inline Standard_Real ToleranceV() const - { - return computeParametricTolerance(myVMin, myVMax); - } - + Standard_EXPORT Standard_Real ToleranceV() const; + //! Gives face deflection parameter. inline Standard_Real GetDefFace() const { @@ -174,33 +189,30 @@ public: //! @name main geometrical properties. public: //! @name auxiliary structures - //! Clear all face attribute. - Standard_EXPORT void Clear(); - //! Resets mesh data structure. //! @returns reset data structure. Standard_EXPORT Handle(BRepMesh_DataStructureOfDelaun)& ResetStructure(); //! Gives reference to map of internal edges of face. - inline BRepMeshCol::HDMapOfShapePairOfPolygon& ChangeInternalEdges() + inline BRepMesh::HDMapOfShapePairOfPolygon& ChangeInternalEdges() { return myInternalEdges; } //! Gives reference to map of 2D points of discretization. - inline BRepMeshCol::DMapOfIntegerListOfXY& ChangeLocation2D() + inline BRepMesh::DMapOfIntegerListOfXY& ChangeLocation2D() { return myLocation2D; } //! Gives reference to map of 3D points of discretization. - inline BRepMeshCol::HDMapOfIntegerPnt& ChangeSurfacePoints() + inline BRepMesh::HDMapOfIntegerPnt& ChangeSurfacePoints() { return mySurfacePoints; } //! Gives reference on map of (vertex, edge) pairs of face. - inline BRepMeshCol::HIMapOfInteger& ChangeVertexEdgeMap() + inline BRepMesh::HIMapOfInteger& ChangeVertexEdgeMap() { return myVertexEdgeMap; } @@ -212,7 +224,7 @@ public: //! @name auxiliary structures } //! Returns classifier. - inline BRepMeshCol::HClassifier& ChangeClassifier() + inline BRepMesh::HClassifier& ChangeClassifier() { return myClassifier; } @@ -222,7 +234,8 @@ public: //! @name Point/Vertex/Node manipulators //! Gives the number of different locations in 3D space. inline Standard_Integer LastPointId() const { - return myBoundaryPoints.Extent() + mySurfacePoints->Extent(); + return (myBoundaryPoints.IsNull() ? 0 : myBoundaryPoints->Extent()) + + mySurfacePoints->Extent(); } //! Gives the 3D location of the vertex. @@ -234,10 +247,10 @@ public: //! @name Point/Vertex/Node manipulators //! Gives the 3D location of the vertex. inline const gp_Pnt& GetPoint(const Standard_Integer theIndex) const { - if (theIndex > myBoundaryPoints.Extent()) + if (myBoundaryPoints.IsNull() || theIndex > myBoundaryPoints->Extent()) return mySurfacePoints->Find(theIndex); - return myBoundaryPoints(theIndex); + return myBoundaryPoints->Find(theIndex); } //! Returns index of the given vertex if it exists in cache, @@ -262,14 +275,14 @@ public: //! @name Point/Vertex/Node manipulators { aNewVertexIndex = LastPointId() + 1; - BRepMeshCol::DMapOfIntegerPnt& aPointsMap = isFillEdgeVertices ? - myBoundaryPoints : *mySurfacePoints; + BRepMesh::DMapOfIntegerPnt& aPointsMap = isFillEdgeVertices ? + *myBoundaryPoints : *mySurfacePoints; aPointsMap.Bind(aNewVertexIndex, theVertexExplorer->Point()); } - BRepMeshCol::DMapOfVertexInteger& aVertexMap = isFillEdgeVertices ? - myBoundaryVertices : mySurfaceVertices; + BRepMesh::DMapOfVertexInteger& aVertexMap = isFillEdgeVertices ? + *myBoundaryVertices : mySurfaceVertices; aVertexMap.Bind(aVertex, aNewVertexIndex); @@ -308,6 +321,9 @@ private: { } + //! Initializes internal data structures. + void init(); + //! Computes parametric tolerance of a face regarding the given limits. Standard_Real computeParametricTolerance( const Standard_Real theFirstParam, @@ -335,21 +351,21 @@ private: Standard_Real myDeltaY; Standard_Integer myStatus; - BRepMeshCol::DMapOfVertexInteger& myBoundaryVertices; - BRepMeshCol::DMapOfIntegerPnt& myBoundaryPoints; + BRepMesh::HDMapOfVertexInteger myBoundaryVertices; + BRepMesh::HDMapOfIntegerPnt myBoundaryPoints; TopoDS_Face myFace; Handle(BRepAdaptor_HSurface) mySurface; - BRepMeshCol::DMapOfVertexInteger mySurfaceVertices; - BRepMeshCol::HDMapOfIntegerPnt mySurfacePoints; + BRepMesh::DMapOfVertexInteger mySurfaceVertices; + BRepMesh::HDMapOfIntegerPnt mySurfacePoints; - BRepMeshCol::DMapOfIntegerListOfXY myLocation2D; - BRepMeshCol::HIMapOfInteger myVertexEdgeMap; - BRepMeshCol::HDMapOfShapePairOfPolygon myInternalEdges; + BRepMesh::DMapOfIntegerListOfXY myLocation2D; + BRepMesh::HIMapOfInteger myVertexEdgeMap; + BRepMesh::HDMapOfShapePairOfPolygon myInternalEdges; Handle(BRepMesh_DataStructureOfDelaun) myStructure; - BRepMeshCol::HClassifier myClassifier; - BRepMeshCol::Allocator myAllocator; + BRepMesh::HClassifier myClassifier; + Handle(NCollection_IncAllocator) myAllocator; }; DEFINE_STANDARD_HANDLE(BRepMesh_FaceAttribute, Standard_Transient) diff --git a/src/BRepMesh/BRepMesh_FaceChecker.hxx b/src/BRepMesh/BRepMesh_FaceChecker.hxx index 2085079a85..350e3453ca 100644 --- a/src/BRepMesh/BRepMesh_FaceChecker.hxx +++ b/src/BRepMesh/BRepMesh_FaceChecker.hxx @@ -40,7 +40,7 @@ class BRepMesh_FaceChecker public: //! Constructor - //! \param isInParallel Flag indicates that face edges should be checked in parallel. + //! @param isInParallel Flag indicates that face edges should be checked in parallel. BRepMesh_FaceChecker(const Standard_Boolean isInParallel) : myIsFailed(Standard_False), myIsInParallel(isInParallel) @@ -48,7 +48,7 @@ public: } //! Checker's body. - //! \param theFace Face to be checked. + //! @param theFace Face to be checked. void operator ()(const TopoDS_Face& theFace) const { if (theFace.IsNull() || myIsFailed) diff --git a/src/BRepMesh/BRepMesh_FastDiscret.cxx b/src/BRepMesh/BRepMesh_FastDiscret.cxx index ba76f40996..b70f724ee8 100644 --- a/src/BRepMesh/BRepMesh_FastDiscret.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscret.cxx @@ -100,7 +100,9 @@ BRepMesh_FastDiscret::BRepMesh_FastDiscret( myInParallel (isInParallel), myRelative (theRelative), myShapetrigu (theShapetrigu), - myInshape (theInshape) + myInshape (theInshape), + myBoundaryVertices(new BRepMesh::DMapOfVertexInteger), + myBoundaryPoints(new BRepMesh::DMapOfIntegerPnt) { if ( myRelative ) BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale); @@ -125,7 +127,9 @@ BRepMesh_FastDiscret::BRepMesh_FastDiscret(const TopoDS_Shape& theShape, myInParallel (isInParallel), myRelative (theRelative), myShapetrigu (theShapetrigu), - myInshape (theInshape) + myInshape (theInshape), + myBoundaryVertices(new BRepMesh::DMapOfVertexInteger), + myBoundaryPoints(new BRepMesh::DMapOfIntegerPnt) { if ( myRelative ) BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale); @@ -227,8 +231,8 @@ Standard_Integer BRepMesh_FastDiscret::Add(const TopoDS_Face& theFace) if (!myWithShare) { myEdges.Clear(); - myBoundaryVertices.Clear(); - myBoundaryPoints.Clear(); + myBoundaryVertices->Clear(); + myBoundaryPoints->Clear(); } Standard_Real defedge; @@ -241,8 +245,8 @@ Standard_Integer BRepMesh_FastDiscret::Add(const TopoDS_Face& theFace) if (!myRelative) defface = Max(myDeflection, maxdef); - N_SEQUENCE aPCurves; - N_SEQUENCE aFaceEdges; + NCollection_Sequence aPCurves; + NCollection_Sequence aFaceEdges; const TopoDS_Face& aFace = myAttribute->Face(); const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); @@ -414,7 +418,7 @@ Standard_Integer BRepMesh_FastDiscret::Add(const TopoDS_Face& theFace) Standard_Real deltaY = 1.0; { - BRepMeshCol::HClassifier& aClassifier = myAttribute->ChangeClassifier(); + BRepMesh::HClassifier& aClassifier = myAttribute->ChangeClassifier(); BRepMesh_WireChecker aDFaceChecker(aFace, Precision::PConfusion(), myInternalEdges, myVertexEdgeMap, myStructure, myumin, myumax, myvmin, myvmax, myInParallel ); @@ -770,7 +774,7 @@ void BRepMesh_FastDiscret::add( for (Standard_Integer i = 2; i < aNodesNb; ++i) { const Standard_Integer aPointId = aNodes(i); - gp_Pnt& aPnt = myBoundaryPoints(aPointId); + const gp_Pnt& aPnt = myBoundaryPoints->Find(aPointId); const Standard_Real aParam = aProvider.Parameter(i, aPnt); gp_Pnt2d aUV = thePCurve.Curve2d->Value(aParam); @@ -892,7 +896,7 @@ void BRepMesh_FastDiscret::update( gp_Pnt2d aUV; Standard_Real aParam; aEdgeTool->Value(i, aParam, aPnt, aUV); - myBoundaryPoints.Bind(++aLastPointId, aPnt); + myBoundaryPoints->Bind(++aLastPointId, aPnt); Standard_Integer iv2, isv; myAttribute->AddNode(aLastPointId, aUV.Coord(), BRepMesh_Frontier, iv2, isv); diff --git a/src/BRepMesh/BRepMesh_FastDiscret.hxx b/src/BRepMesh/BRepMesh_FastDiscret.hxx index 35b02f6ef0..7d303e138c 100644 --- a/src/BRepMesh/BRepMesh_FastDiscret.hxx +++ b/src/BRepMesh/BRepMesh_FastDiscret.hxx @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -120,9 +120,6 @@ public: return myInParallel; } - //! Gives the list of indices of the vertices
- Standard_EXPORT void VerticesOfDomain(BRepMeshCol::MapOfInteger& Indices) const; - //! returns the deflection value.
inline Standard_Real GetDeflection() const { @@ -167,7 +164,7 @@ public: //! Returns number of boundary 3d points. inline Standard_Integer NbBoundaryPoints() const { - return myBoundaryPoints.Extent(); + return myBoundaryPoints->Extent(); } DEFINE_STANDARD_RTTI(BRepMesh_FastDiscret) @@ -260,20 +257,20 @@ private: //! used for tessellation. struct EdgeAttributes { - TopoDS_Vertex FirstVertex; - TopoDS_Vertex LastVertex; + TopoDS_Vertex FirstVertex; + TopoDS_Vertex LastVertex; - Standard_Real FirstParam; - Standard_Real LastParam; + Standard_Real FirstParam; + Standard_Real LastParam; - gp_Pnt2d FirstUV; - gp_Pnt2d LastUV; + gp_Pnt2d FirstUV; + gp_Pnt2d LastUV; - Standard_Boolean IsSameUV; - Standard_Real MinDist; + Standard_Boolean IsSameUV; + Standard_Real MinDist; - N_HANDLE FirstVExtractor; - N_HANDLE LastVExtractor; + NCollection_Handle FirstVExtractor; + NCollection_Handle LastVExtractor; }; //! Structure keeps geometrical parameters of edge's PCurve. @@ -348,29 +345,29 @@ private: private: - TopoDS_Face myFace; - Standard_Real myAngle; - Standard_Real myDeflection; - Standard_Real myDtotale; - Standard_Boolean myWithShare; - Standard_Boolean myInParallel; - BRepMeshCol::DMapOfShapePairOfPolygon myEdges; - BRepMeshCol::DMapOfFaceAttribute myAttributes; - Standard_Boolean myRelative; - Standard_Boolean myShapetrigu; - Standard_Boolean myInshape; - TopTools_DataMapOfShapeReal myMapdefle; + TopoDS_Face myFace; + Standard_Real myAngle; + Standard_Real myDeflection; + Standard_Real myDtotale; + Standard_Boolean myWithShare; + Standard_Boolean myInParallel; + BRepMesh::DMapOfShapePairOfPolygon myEdges; + BRepMesh::DMapOfFaceAttribute myAttributes; + Standard_Boolean myRelative; + Standard_Boolean myShapetrigu; + Standard_Boolean myInshape; + TopTools_DataMapOfShapeReal myMapdefle; // Data shared for whole shape - BRepMeshCol::DMapOfVertexInteger myBoundaryVertices; - BRepMeshCol::DMapOfIntegerPnt myBoundaryPoints; + BRepMesh::HDMapOfVertexInteger myBoundaryVertices; + BRepMesh::HDMapOfIntegerPnt myBoundaryPoints; // Fast access to attributes of current face - Handle(BRepMesh_FaceAttribute) myAttribute; - Handle(BRepMesh_DataStructureOfDelaun) myStructure; - BRepMeshCol::HIMapOfInteger myVertexEdgeMap; - BRepMeshCol::HDMapOfShapePairOfPolygon myInternalEdges; - TopTools_IndexedDataMapOfShapeListOfShape mySharedFaces; + Handle(BRepMesh_FaceAttribute) myAttribute; + Handle(BRepMesh_DataStructureOfDelaun) myStructure; + BRepMesh::HIMapOfInteger myVertexEdgeMap; + BRepMesh::HDMapOfShapePairOfPolygon myInternalEdges; + TopTools_IndexedDataMapOfShapeListOfShape mySharedFaces; }; DEFINE_STANDARD_HANDLE(BRepMesh_FastDiscret, Standard_Transient) diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx index 949f26a7ac..caba67d0e6 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx @@ -196,7 +196,7 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr const Standard_Real deltaX = myAttribute->GetDeltaX(); const Standard_Real deltaY = myAttribute->GetDeltaY(); - BRepMeshCol::Array1OfInteger tabvert_corr(1, nbVertices); + BRepMesh::Array1OfInteger tabvert_corr(1, nbVertices); // Check the necessity to fill the map of parameters const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus || @@ -223,7 +223,7 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr aPnt2d = myAttribute->Scale(aPnt2d, Standard_True); BRepMesh_Vertex v_new(aPnt2d, v.Location3d(), v.Movability()); - const BRepMeshCol::ListOfInteger& alist = myStructure->LinksConnectedTo(i); + const BRepMesh::ListOfInteger& alist = myStructure->LinksConnectedTo(i); aMoveNodes.Add(v_new, alist); tabvert_corr(i) = i; } @@ -261,7 +261,7 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr Standard_Real aDef = -1; if ( !isaline && myStructure->ElementsOfDomain().Extent() > 0 ) { - BRepMeshCol::ListOfVertex aNewVertices; + BRepMesh::ListOfVertex aNewVertices; if ( !rajout ) { aDef = control(aNewVertices, trigu, Standard_True); @@ -298,7 +298,7 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr const BRepMesh_Vertex& v = myStructure->GetNode(i); gp_XY aPnt2d = myAttribute->Scale(v.Coord(), Standard_False); BRepMesh_Vertex v_new(aPnt2d, v.Location3d(), v.Movability()); - const BRepMeshCol::ListOfInteger& alist = myStructure->LinksConnectedTo(i); + const BRepMesh::ListOfInteger& alist = myStructure->LinksConnectedTo(i); aMoveNodes.Add(v_new, alist); // Register internal nodes used in triangulation @@ -316,14 +316,14 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr //purpose : //======================================================================= Standard_Boolean BRepMesh_FastDiscretFace::addVerticesToMesh( - const BRepMeshCol::ListOfVertex& theVertices, - BRepMesh_Delaun& theMeshBuilder) + const BRepMesh::ListOfVertex& theVertices, + BRepMesh_Delaun& theMeshBuilder) { if (theVertices.IsEmpty()) return Standard_False; - BRepMeshCol::Array1OfVertexOfDelaun aArrayOfNewVertices(1, theVertices.Extent()); - BRepMeshCol::ListOfVertex::Iterator aVertexIt(theVertices); + BRepMesh::Array1OfVertexOfDelaun aArrayOfNewVertices(1, theVertices.Extent()); + BRepMesh::ListOfVertex::Iterator aVertexIt(theVertices); for (Standard_Integer aVertexId = 0; aVertexIt.More(); aVertexIt.Next()) aArrayOfNewVertices(++aVertexId) = aVertexIt.Value(); @@ -335,13 +335,13 @@ Standard_Boolean BRepMesh_FastDiscretFace::addVerticesToMesh( //function : insertInternalVertices //purpose : //======================================================================= -static void filterParameters(const BRepMeshCol::IMapOfReal& theParams, - const Standard_Real theMinDist, - const Standard_Real theFilterDist, - BRepMeshCol::SequenceOfReal& theResult) +static void filterParameters(const BRepMesh::IMapOfReal& theParams, + const Standard_Real theMinDist, + const Standard_Real theFilterDist, + BRepMesh::SequenceOfReal& theResult) { // Sort sequence of parameters - BRepMeshCol::SequenceOfReal aParamTmp; + BRepMesh::SequenceOfReal aParamTmp; Standard_Integer aParamLength = 1; const Standard_Integer anInitLen = theParams.Extent(); @@ -430,8 +430,8 @@ static void filterParameters(const BRepMeshCol::IMapOfReal& theParams, } void BRepMesh_FastDiscretFace::insertInternalVertices( - BRepMeshCol::ListOfVertex& theNewVertices, - BRepMesh_Delaun& theMeshBuilder) + BRepMesh::ListOfVertex& theNewVertices, + BRepMesh_Delaun& theMeshBuilder) { const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); switch (gFace->GetType()) @@ -470,7 +470,7 @@ void BRepMesh_FastDiscretFace::insertInternalVertices( //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertInternalVerticesSphere( - BRepMeshCol::ListOfVertex& theNewVertices) + BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umin = myAttribute->GetUMin(); @@ -517,7 +517,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesSphere( //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertInternalVerticesCylinder( - BRepMeshCol::ListOfVertex& theNewVertices) + BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umin = myAttribute->GetUMin(); @@ -557,7 +557,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesCylinder( //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertInternalVerticesCone( - BRepMeshCol::ListOfVertex& theNewVertices) + BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umin = myAttribute->GetUMin(); @@ -592,7 +592,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesCone( //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertInternalVerticesTorus( - BRepMeshCol::ListOfVertex& theNewVertices) + BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umin = myAttribute->GetUMin(); @@ -609,7 +609,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesTorus( Standard_Real pp, pasu, pasv; Standard_Real r = T.MinorRadius(), R = T.MajorRadius(); - BRepMeshCol::SequenceOfReal ParamU, ParamV; + BRepMesh::SequenceOfReal ParamU, ParamV; Standard_Real Du, Dv;//, pasu, pasv; Dv = Max(1.0e0 - (aDefFace / r), 0.0e0); @@ -726,7 +726,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesTorus( //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( - BRepMeshCol::ListOfVertex& theNewVertices) + BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real aRange[2][2] = { { myAttribute->GetUMax(), myAttribute->GetUMin() }, @@ -741,7 +741,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( const Standard_Real aDefFace = myAttribute->GetDefFace(); const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); - BRepMeshCol::SequenceOfReal aParams[2]; + BRepMesh::SequenceOfReal aParams[2]; for (Standard_Integer i = 0; i < 2; ++i) { Standard_Boolean isU = (i == 0); @@ -773,8 +773,8 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( const Standard_Real aSqPrecision = aPrecision * aPrecision; for (Standard_Integer k = 0; k < 2; ++k) { - BRepMeshCol::SequenceOfReal& aParams1 = aParams[k]; - BRepMeshCol::SequenceOfReal& aParams2 = aParams[(k + 1) % 2]; + BRepMesh::SequenceOfReal& aParams1 = aParams[k]; + BRepMesh::SequenceOfReal& aParams2 = aParams[(k + 1) % 2]; const Standard_Boolean isU = (k == 0); Standard_Integer aStartIndex, aEndIndex; if (isU) @@ -873,7 +873,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertInternalVerticesOther( - BRepMeshCol::ListOfVertex& theNewVertices) + BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real aAngle = 0.35; const Standard_Real aRange[2][2] = { @@ -884,7 +884,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( const Standard_Real aDefFace = myAttribute->GetDefFace(); const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); - BRepMeshCol::SequenceOfReal aParams[2]; + BRepMesh::SequenceOfReal aParams[2]; const Standard_Integer aIsoPointsNb = 11; for (Standard_Integer k = 0; k < 2; ++k) { @@ -918,8 +918,8 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( } } - BRepMeshCol::SequenceOfReal& aParams2 = aParams[aOtherParamsIndex]; - GCPnts_TangentialDeflection& aDIso = aDiscretIso[aMaxIndex]; + BRepMesh::SequenceOfReal& aParams2 = aParams[aOtherParamsIndex]; + GCPnts_TangentialDeflection& aDIso = aDiscretIso[aMaxIndex]; for (Standard_Integer i = 1; i <= aMaxPointsNb; ++i) aParams2.Append(aDIso.Parameter(i)); @@ -953,9 +953,9 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( //purpose : //======================================================================= Standard_Real BRepMesh_FastDiscretFace::control( - BRepMeshCol::ListOfVertex& theNewVertices, - BRepMesh_Delaun& theTrigu, - const Standard_Boolean theIsFirst) + BRepMesh::ListOfVertex& theNewVertices, + BRepMesh_Delaun& theTrigu, + const Standard_Boolean theIsFirst) #define CHECK_DEF_AND_INSERT_CURRENT(isSkipped) \ if (aSqDef > aMaxSqDef) \ @@ -989,7 +989,7 @@ if (aSqDef > aSqDefFace) \ aBSpline = gFace->BSpline(); NCollection_DataMap aNorMap; - BRepMeshCol::MapOfIntegerInteger aStatMap; + BRepMesh::MapOfIntegerInteger aStatMap; NCollection_Map aCouples(3 * aTrianglesNb); // Perform refinement passes @@ -1014,8 +1014,8 @@ if (aSqDef > aSqDefFace) \ break; // Iterate on current triangles - const BRepMeshCol::MapOfInteger& aTriangles = myStructure->ElementsOfDomain(); - BRepMeshCol::MapOfInteger::Iterator aTriangleIt(aTriangles); + const BRepMesh::MapOfInteger& aTriangles = myStructure->ElementsOfDomain(); + BRepMesh::MapOfInteger::Iterator aTriangleIt(aTriangles); for (; aTriangleIt.More(); aTriangleIt.Next()) { const Standard_Integer aTriangleId = aTriangleIt.Key(); @@ -1181,7 +1181,7 @@ void BRepMesh_FastDiscretFace::add(const TopoDS_Vertex& theVertex) gp_Pnt2d aPnt2d = BRep_Tool::Parameters(theVertex, myAttribute->Face()); - N_HANDLE aFixedVExplorer = new FixedVExplorer(theVertex); + NCollection_Handle aFixedVExplorer = new FixedVExplorer(theVertex); Standard_Integer aIndex = myAttribute->GetVertexIndex(aFixedVExplorer); gp_XY anUV = BRepMesh_ShapeTool::FindUV(aIndex, aPnt2d, theVertex, BRep_Tool::Tolerance(theVertex), myAttribute); @@ -1199,9 +1199,9 @@ void BRepMesh_FastDiscretFace::add(const TopoDS_Vertex& theVertex) //purpose : //======================================================================= void BRepMesh_FastDiscretFace::insertVertex( - const gp_Pnt& thePnt3d, - const gp_XY& theUV, - BRepMeshCol::ListOfVertex& theVertices) + const gp_Pnt& thePnt3d, + const gp_XY& theUV, + BRepMesh::ListOfVertex& theVertices) { Standard_Integer aNbLocat = myAttribute->LastPointId(); mySurfacePoints->Bind(++aNbLocat, thePnt3d); diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.hxx b/src/BRepMesh/BRepMesh_FastDiscretFace.hxx index 74fdc90340..4871108ebf 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.hxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.hxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -49,25 +49,22 @@ class gp_Pnt; class BRepMesh_FastDiscretFace : public Standard_Transient { public: - - - Standard_EXPORT BRepMesh_FastDiscretFace(const Standard_Real theAngle, - const Standard_Boolean theWithShare = Standard_True); + + Standard_EXPORT BRepMesh_FastDiscretFace( + const Standard_Real theAngle, + const Standard_Boolean theWithShare = Standard_True); Standard_EXPORT void Add(const Handle(BRepMesh_FaceAttribute)& theAttribute); - //! Gives the triangle of .
- Standard_EXPORT const BRepMesh_Triangle& Triangle(const Standard_Integer theIndex) const; - DEFINE_STANDARD_RTTI(BRepMesh_FastDiscretFace) private: void add(const TopoDS_Vertex& theVertex); - Standard_Real control(BRepMeshCol::ListOfVertex& theNewVertices, - BRepMesh_Delaun& theMeshBuilder, - const Standard_Boolean theIsFirst); + Standard_Real control(BRepMesh::ListOfVertex& theNewVertices, + BRepMesh_Delaun& theMeshBuilder, + const Standard_Boolean theIsFirst); //! Registers the given nodes in mesh data structure and //! performs refinement of existing mesh. @@ -76,39 +73,39 @@ private: //! in respect to inserting nodes. //! @return TRUE if vertices were been inserted, FALSE elewhere. Standard_Boolean addVerticesToMesh( - const BRepMeshCol::ListOfVertex& theVertices, - BRepMesh_Delaun& theMeshBuilder); + const BRepMesh::ListOfVertex& theVertices, + BRepMesh_Delaun& theMeshBuilder); //! Calculates nodes lying on face's surface and inserts them to a mesh. //! @param theNewVertices list of vertices to be extended and added to mesh. //! @param theMeshBuilder initialized tool refining mesh //! in respect to inserting nodes. - void insertInternalVertices(BRepMeshCol::ListOfVertex& theNewVertices, - BRepMesh_Delaun& theMeshBuilder); + void insertInternalVertices(BRepMesh::ListOfVertex& theNewVertices, + BRepMesh_Delaun& theMeshBuilder); //! Calculates nodes lying on spherical surface. //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesSphere(BRepMeshCol::ListOfVertex& theNewVertices); + void insertInternalVerticesSphere(BRepMesh::ListOfVertex& theNewVertices); //! Calculates nodes lying on cylindrical surface. //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesCylinder(BRepMeshCol::ListOfVertex& theNewVertices); + void insertInternalVerticesCylinder(BRepMesh::ListOfVertex& theNewVertices); //! Calculates nodes lying on conical surface. //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesCone(BRepMeshCol::ListOfVertex& theNewVertices); + void insertInternalVerticesCone(BRepMesh::ListOfVertex& theNewVertices); //! Calculates nodes lying on toroidal surface. //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesTorus(BRepMeshCol::ListOfVertex& theNewVertices); + void insertInternalVerticesTorus(BRepMesh::ListOfVertex& theNewVertices); //! Calculates nodes lying on Bezier/BSpline surface. //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesBSpline(BRepMeshCol::ListOfVertex& theNewVertices); + void insertInternalVerticesBSpline(BRepMesh::ListOfVertex& theNewVertices); //! Calculates nodes lying on custom-type surface. //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesOther(BRepMeshCol::ListOfVertex& theNewVertices); + void insertInternalVerticesOther(BRepMesh::ListOfVertex& theNewVertices); //! Template method trying to insert new internal vertex corresponded to //! the given 2d point. Calculates 3d position analytically using the given @@ -117,9 +114,9 @@ private: //! @param theAnalyticSurface analytic surface to calculate 3d point. //! @param[out] theVertices list of vertices to be updated. template - void tryToInsertAnalyticVertex(const gp_Pnt2d& thePnt2d, - const AnalyticSurface& theAnalyticSurface, - BRepMeshCol::ListOfVertex& theVertices) + void tryToInsertAnalyticVertex(const gp_Pnt2d& thePnt2d, + const AnalyticSurface& theAnalyticSurface, + BRepMesh::ListOfVertex& theVertices) { if (!myClassifier->Perform(thePnt2d) == TopAbs_IN) return; @@ -133,25 +130,25 @@ private: //! @param thePnt3d 3d point corresponded to the vertex. //! @param theUV UV point corresponded to the vertex. //! @param[out] theVertices list of vertices to be updated. - void insertVertex(const gp_Pnt& thePnt3d, - const gp_XY& theUV, - BRepMeshCol::ListOfVertex& theVertices); + void insertVertex(const gp_Pnt& thePnt3d, + const gp_XY& theUV, + BRepMesh::ListOfVertex& theVertices); private: - Standard_Real myAngle; - Standard_Boolean myWithShare; - Standard_Boolean myInternalVerticesMode; - BRepMeshCol::IMapOfReal myUParam; - BRepMeshCol::IMapOfReal myVParam; - BRepMeshCol::Allocator myAllocator; + Standard_Real myAngle; + Standard_Boolean myWithShare; + Standard_Boolean myInternalVerticesMode; + BRepMesh::IMapOfReal myUParam; + BRepMesh::IMapOfReal myVParam; + Handle(NCollection_IncAllocator) myAllocator; // Fast access to attributes of current face - Handle(BRepMesh_FaceAttribute) myAttribute; - Handle(BRepMesh_DataStructureOfDelaun) myStructure; - BRepMeshCol::HIMapOfInteger myVertexEdgeMap; - BRepMeshCol::HClassifier myClassifier; - BRepMeshCol::HDMapOfIntegerPnt mySurfacePoints; + Handle(BRepMesh_FaceAttribute) myAttribute; + Handle(BRepMesh_DataStructureOfDelaun) myStructure; + BRepMesh::HIMapOfInteger myVertexEdgeMap; + BRepMesh::HClassifier myClassifier; + BRepMesh::HDMapOfIntegerPnt mySurfacePoints; }; DEFINE_STANDARD_HANDLE (BRepMesh_FastDiscretFace, Standard_Transient) diff --git a/src/BRepMesh/BRepMesh_GeomTool.hxx b/src/BRepMesh/BRepMesh_GeomTool.hxx index ba4e673721..4887246d3f 100644 --- a/src/BRepMesh/BRepMesh_GeomTool.hxx +++ b/src/BRepMesh/BRepMesh_GeomTool.hxx @@ -50,12 +50,12 @@ public: //! Constructor. //! Initiates discretization of the given geometric curve. - //! \param theCurve curve to be discretized. - //! \param theFirstParam first parameter of the curve. - //! \param theLastParam last parameter of the curve. - //! \param theLinDeflection linear deflection. - //! \param theAngDeflection angular deflection. - //! \param theMinPointsNb minimum nuber of points to be produced. + //! @param theCurve curve to be discretized. + //! @param theFirstParam first parameter of the curve. + //! @param theLastParam last parameter of the curve. + //! @param theLinDeflection linear deflection. + //! @param theAngDeflection angular deflection. + //! @param theMinPointsNb minimum nuber of points to be produced. Standard_EXPORT BRepMesh_GeomTool(const BRepAdaptor_Curve& theCurve, const Standard_Real theFirstParam, const Standard_Real theLastParam, @@ -66,14 +66,14 @@ public: //! Constructor. //! Initiates discretization of geometric curve corresponding //! to iso curve of the given surface. - //! \param theSurface surface the iso curve to be taken from. - //! \param theIsoType type of iso curve to be used, U or V. - //! \param theParamIso parameter on the surface specifying the iso curve. - //! \param theFirstParam first parameter of the curve. - //! \param theLastParam last parameter of the curve. - //! \param theLinDeflection linear deflection. - //! \param theAngDeflection angular deflection. - //! \param theMinPointsNb minimum nuber of points to be produced. + //! @param theSurface surface the iso curve to be taken from. + //! @param theIsoType type of iso curve to be used, U or V. + //! @param theParamIso parameter on the surface specifying the iso curve. + //! @param theFirstParam first parameter of the curve. + //! @param theLastParam last parameter of the curve. + //! @param theLinDeflection linear deflection. + //! @param theAngDeflection angular deflection. + //! @param theMinPointsNb minimum nuber of points to be produced. Standard_EXPORT BRepMesh_GeomTool(const Handle(BRepAdaptor_HSurface)& theSurface, const GeomAbs_IsoType theIsoType, const Standard_Real theParamIso, @@ -84,11 +84,11 @@ public: const Standard_Integer theMinPointsNb = 2); //! Adds point to already calculated points (or replaces existing). - //! \param thePoint point to be added. - //! \param theParam parameter on the curve corresponding to the given point. - //! \param theIsReplace if TRUE replaces existing point lying within + //! @param thePoint point to be added. + //! @param theParam parameter on the curve corresponding to the given point. + //! @param theIsReplace if TRUE replaces existing point lying within //! parameteric tolerance of the given point. - //! \return index of new added point or found with parametric tolerance + //! @return index of new added point or found with parametric tolerance inline Standard_Integer AddPoint(const gp_Pnt& thePoint, const Standard_Real theParam, const Standard_Boolean theIsReplace = Standard_True) @@ -103,13 +103,13 @@ public: } //! Gets parameters of discretization point with the given index. - //! \param theIndex index of discretization point. - //! \param theIsoParam parameter on surface to be used as second coordinate + //! @param theIndex index of discretization point. + //! @param theIsoParam parameter on surface to be used as second coordinate //! of resulting 2d point. - //! \param theParam[out] parameter of the point on the iso curve. - //! \param thePoint[out] discretization point. - //! \param theUV[out] discretization point in parametric space of the surface. - //! \return TRUE on success, FALSE elsewhere. + //! @param theParam[out] parameter of the point on the iso curve. + //! @param thePoint[out] discretization point. + //! @param theUV[out] discretization point in parametric space of the surface. + //! @return TRUE on success, FALSE elsewhere. Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex, const Standard_Real theIsoParam, Standard_Real& theParam, @@ -117,26 +117,26 @@ public: gp_Pnt2d& theUV) const; //! Gets parameters of discretization point with the given index. - //! \param theIndex index of discretization point. - //! \param theSurface surface the curve is lying onto. - //! \param theParam[out] parameter of the point on the curve. - //! \param thePoint[out] discretization point. - //! \param theUV[out] discretization point in parametric space of the surface. - //! \return TRUE on success, FALSE elsewhere. + //! @param theIndex index of discretization point. + //! @param theSurface surface the curve is lying onto. + //! @param theParam[out] parameter of the point on the curve. + //! @param thePoint[out] discretization point. + //! @param theUV[out] discretization point in parametric space of the surface. + //! @return TRUE on success, FALSE elsewhere. Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex, const Handle(BRepAdaptor_HSurface)& theSurface, Standard_Real& theParam, gp_Pnt& thePoint, gp_Pnt2d& theUV) const; -public: //! \name static API +public: //! @name static API - //! \param theSurface surface the nomal should be found for. - //! \param theParamU U parameter in parametric space of the surface. - //! \param theParamV V parameter in parametric space of the surface. - //! \param[out] thePoint 3d point corresponding to the given parameters. - //! \param[out] theNormal normal vector at the point specified by the parameters. - //! \return FALSE if the normal can not be computed, TRUE elsewhere. + //! @param theSurface surface the nomal should be found for. + //! @param theParamU U parameter in parametric space of the surface. + //! @param theParamV V parameter in parametric space of the surface. + //! @param[out] thePoint 3d point corresponding to the given parameters. + //! @param[out] theNormal normal vector at the point specified by the parameters. + //! @return FALSE if the normal can not be computed, TRUE elsewhere. static Standard_Boolean Normal(const Handle(BRepAdaptor_HSurface)& theSurface, const Standard_Real theParamU, const Standard_Real theParamV, @@ -144,14 +144,14 @@ public: //! \name static API gp_Dir& theNormal); //! Checks intersection between two lines defined by two points. - //! \param theStartPnt1 start point of first line. - //! \param theEndPnt1 end point of first line. - //! \param theStartPnt2 start point of second line. - //! \param theEndPnt2 end point of second line. - //! \param[out] theIntPnt point of intersection. - //! \param[out] theParamOnSegment parameters of intersection point + //! @param theStartPnt1 start point of first line. + //! @param theEndPnt1 end point of first line. + //! @param theStartPnt2 start point of second line. + //! @param theEndPnt2 end point of second line. + //! @param[out] theIntPnt point of intersection. + //! @param[out] theParamOnSegment parameters of intersection point //! corresponding to first and second segment. - //! \return status of intersection check. + //! @return status of intersection check. static IntFlag IntLinLin(const gp_XY& theStartPnt1, const gp_XY& theEndPnt1, const gp_XY& theStartPnt2, @@ -161,18 +161,18 @@ public: //! \name static API //! Checks intersection between the two segments. //! Checks that intersection point lies within ranges of both segments. - //! \param theStartPnt1 start point of first segment. - //! \param theEndPnt1 end point of first segment. - //! \param theStartPnt2 start point of second segment. - //! \param theEndPnt2 end point of second segment. - //! \param isConsiderEndPointTouch if TRUE EndPointTouch status will be + //! @param theStartPnt1 start point of first segment. + //! @param theEndPnt1 end point of first segment. + //! @param theStartPnt2 start point of second segment. + //! @param theEndPnt2 end point of second segment. + //! @param isConsiderEndPointTouch if TRUE EndPointTouch status will be //! returned in case if segments are touching by end points, if FALSE //! returns NoIntersection flag. - //! \param isConsiderPointOnSegment if TRUE PointOnSegment status will be + //! @param isConsiderPointOnSegment if TRUE PointOnSegment status will be //! returned in case if end point of one segment lies onto another one, //! if FALSE returns NoIntersection flag. - //! \param[out] theIntPnt point of intersection. - //! \return status of intersection check. + //! @param[out] theIntPnt point of intersection. + //! @return status of intersection check. static IntFlag IntSegSeg(const gp_XY& theStartPnt1, const gp_XY& theEndPnt1, const gp_XY& theStartPnt2, @@ -184,10 +184,10 @@ public: //! \name static API private: //! Classifies the point in case of coincidence of two vectors. - //! \param thePoint1 the start point of a segment (base point). - //! \param thePoint2 the end point of a segment. - //! \param thePointToCheck the point to classify. - //! \return zero value if point is out of segment and non zero value + //! @param thePoint1 the start point of a segment (base point). + //! @param thePoint2 the end point of a segment. + //! @param thePointToCheck the point to classify. + //! @return zero value if point is out of segment and non zero value //! if point is between the first and the second point of segment. static Standard_Integer classifyPoint (const gp_XY& thePoint1, const gp_XY& thePoint2, diff --git a/src/BRepMesh/BRepMesh_IncrementalMesh.cxx b/src/BRepMesh/BRepMesh_IncrementalMesh.cxx index 4fd3418fe8..2cba2750c3 100644 --- a/src/BRepMesh/BRepMesh_IncrementalMesh.cxx +++ b/src/BRepMesh/BRepMesh_IncrementalMesh.cxx @@ -371,7 +371,7 @@ void BRepMesh_IncrementalMesh::update(const TopoDS_Edge& theEdge) } if (!myEmptyEdges.IsBound(theEdge)) - myEmptyEdges.Bind(theEdge, BRepMeshCol::MapOfTriangulation()); + myEmptyEdges.Bind(theEdge, BRepMesh::MapOfTriangulation()); if (!aTriangulation.IsNull()) myEmptyEdges(theEdge).Add(aTriangulation); @@ -407,7 +407,7 @@ Standard_Boolean BRepMesh_IncrementalMesh::toBeMeshed( if (!myEmptyEdges.IsBound(aEdge)) continue; - BRepMeshCol::MapOfTriangulation& aTriMap = myEmptyEdges(aEdge); + BRepMesh::MapOfTriangulation& aTriMap = myEmptyEdges(aEdge); isEdgesConsistent &= !aTriMap.IsEmpty() && !aTriMap.Contains(aTriangulation); } @@ -444,7 +444,7 @@ void BRepMesh_IncrementalMesh::update(const TopoDS_Face& theFace) if (aStatus != BRepMesh_ReMesh) return; - BRepMeshCol::MapOfShape aUsedFaces; + BRepMesh::MapOfShape aUsedFaces; aUsedFaces.Add(theFace); const TopTools_IndexedDataMapOfShapeListOfShape& aMapOfSharedFaces = @@ -515,11 +515,11 @@ void BRepMesh_IncrementalMesh::commitFace(const TopoDS_Face& theFace) OCC_CATCH_SIGNALS Handle(BRepMesh_DataStructureOfDelaun)& aStructure = aFaceAttribute->ChangeStructure(); - const BRepMeshCol::MapOfInteger& aTriangles = aStructure->ElementsOfDomain(); + const BRepMesh::MapOfInteger& aTriangles = aStructure->ElementsOfDomain(); if (aTriangles.IsEmpty()) return; - BRepMeshCol::HIMapOfInteger& aVetrexEdgeMap = aFaceAttribute->ChangeVertexEdgeMap(); + BRepMesh::HIMapOfInteger& aVetrexEdgeMap = aFaceAttribute->ChangeVertexEdgeMap(); // Store triangles Standard_Integer aVerticesNb = aVetrexEdgeMap->Extent(); @@ -530,7 +530,7 @@ void BRepMesh_IncrementalMesh::commitFace(const TopoDS_Face& theFace) Poly_Array1OfTriangle& aPolyTrianges = aNewTriangulation->ChangeTriangles(); Standard_Integer aTriangeId = 1; - BRepMeshCol::MapOfInteger::Iterator aTriIt(aTriangles); + BRepMesh::MapOfInteger::Iterator aTriIt(aTriangles); for (; aTriIt.More(); aTriIt.Next()) { const BRepMesh_Triangle& aCurElem = aStructure->GetElement(aTriIt.Key()); @@ -563,8 +563,8 @@ void BRepMesh_IncrementalMesh::commitFace(const TopoDS_Face& theFace) BRepMesh_ShapeTool::AddInFace(aFace, aNewTriangulation); // Store discretization of edges - BRepMeshCol::HDMapOfShapePairOfPolygon& aInternalEdges = aFaceAttribute->ChangeInternalEdges(); - BRepMeshCol::DMapOfShapePairOfPolygon::Iterator aEdgeIt(*aInternalEdges); + BRepMesh::HDMapOfShapePairOfPolygon& aInternalEdges = aFaceAttribute->ChangeInternalEdges(); + BRepMesh::DMapOfShapePairOfPolygon::Iterator aEdgeIt(*aInternalEdges); for (; aEdgeIt.More(); aEdgeIt.Next()) { const TopoDS_Edge& aEdge = TopoDS::Edge(aEdgeIt.Key()); diff --git a/src/BRepMesh/BRepMesh_IncrementalMesh.hxx b/src/BRepMesh/BRepMesh_IncrementalMesh.hxx index 7e53483e47..b99d79d1b5 100644 --- a/src/BRepMesh/BRepMesh_IncrementalMesh.hxx +++ b/src/BRepMesh/BRepMesh_IncrementalMesh.hxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include @@ -35,7 +35,7 @@ class TopoDS_Face; //! correctly triangulated parts class BRepMesh_IncrementalMesh : public BRepMesh_DiscretRoot { -public: //! \name mesher API +public: //! @name mesher API //! Default constructor Standard_EXPORT BRepMesh_IncrementalMesh(); @@ -45,13 +45,13 @@ public: //! \name mesher API //! Constructor. //! Automatically calls method Perform. - //! \param theShape shape to be meshed. - //! \param theLinDeflection linear deflection. - //! \param isRelative if TRUE deflection used for discretization of + //! @param theShape shape to be meshed. + //! @param theLinDeflection linear deflection. + //! @param isRelative if TRUE deflection used for discretization of //! each edge will be * . Deflection //! used for the faces will be the maximum deflection of their edges. - //! \param theAngDeflection angular deflection. - //! \param isInParallel if TRUE shape will be meshed in parallel. + //! @param theAngDeflection angular deflection. + //! @param isInParallel if TRUE shape will be meshed in parallel. Standard_EXPORT BRepMesh_IncrementalMesh( const TopoDS_Shape& theShape, const Standard_Real theLinDeflection, @@ -62,10 +62,10 @@ public: //! \name mesher API //! Performs meshing ot the shape. Standard_EXPORT virtual void Perform(); -public: //! \name accessing to parameters. +public: //! @name accessing to parameters. //! Enables using relative deflection. - //! \param isRelative if TRUE deflection used for discretization of + //! @param isRelative if TRUE deflection used for discretization of //! each edge will be * . Deflection //! used for the faces will be the maximum deflection of their edges. inline void SetRelative(const Standard_Boolean isRelative) @@ -103,14 +103,14 @@ public: //! \name accessing to parameters. return myInParallel; } -public: //! \name plugin API +public: //! @name plugin API //! Plugin interface for the Mesh Factories. //! Initializes meshing algorithm with the given parameters. - //! \param theShape shape to be meshed. - //! \param theLinDeflection linear deflection. - //! \param theAngDeflection angular deflection. - //! \param[out] theAlgo pointer to initialized algorithm. + //! @param theShape shape to be meshed. + //! @param theLinDeflection linear deflection. + //! @param theAngDeflection angular deflection. + //! @param[out] theAlgo pointer to initialized algorithm. Standard_EXPORT static Standard_Integer Discret(const TopoDS_Shape& theShape, const Standard_Real theLinDeflection, const Standard_Real theAngDeflection, @@ -142,7 +142,7 @@ private: //! i.e. PolygonOnTriangulation of particular edge connected //! to the same Triangulation data structure as stored inside //! a parent face. - //! \return TRUE on success, FALSE in case of inconsistencies. + //! @return TRUE on success, FALSE in case of inconsistencies. Standard_Boolean isCorrectPolyData(); //! Builds the incremental mesh for the shape. @@ -151,12 +151,12 @@ private: //! Checks triangulation of the given face for consistency //! with the chosen tolerance. If some edge of face has no //! discrete representation triangulation will be calculated. - //! \param theFace face to be checked. + //! @param theFace face to be checked. void update(const TopoDS_Face& theFace); //! Checks discretization of the given edge for consistency //! with the chosen tolerance. - //! \param theEdge edge to be checked. + //! @param theEdge edge to be checked. void update(const TopoDS_Edge& theEdge); //! Collects faces suitable for meshing. @@ -166,7 +166,7 @@ private: void discretizeFreeEdges(); //! Returns deflection of the given edge. - //! \param theEdge edge which tolerance should be taken. + //! @param theEdge edge which tolerance should be taken. Standard_Real edgeDeflection(const TopoDS_Edge& theEdge); //! Returns deflection of the given face. @@ -177,12 +177,12 @@ private: //! Prepares the given face for meshing. //! Nullifies triangulation of face and polygons of face's edges. - //! \param theFace face to be checked. - //! \param isWithCheck if TRUE, checks parameters of triangulation + //! @param theFace face to be checked. + //! @param isWithCheck if TRUE, checks parameters of triangulation //! existing in face. If its deflection satisfies the given value and //! each edge of face has polygon corresponded to this triangulation, //! method return FALSE. - //! \return TRUE in case if the given face should be meshed. + //! @return TRUE in case if the given face should be meshed. Standard_Boolean toBeMeshed(const TopoDS_Face& theFace, const Standard_Boolean isWithCheck); @@ -194,15 +194,15 @@ private: protected: - Standard_Boolean myRelative; - Standard_Boolean myInParallel; - BRepMeshCol::DMapOfEdgeListOfTriangulation myEmptyEdges; - Handle(BRepMesh_FastDiscret) myMesh; - Standard_Boolean myModified; - TopTools_DataMapOfShapeReal myEdgeDeflection; - Standard_Real myMaxShapeSize; - Standard_Integer myStatus; - std::vector myFaces; + Standard_Boolean myRelative; + Standard_Boolean myInParallel; + BRepMesh::DMapOfEdgeListOfTriangulation myEmptyEdges; + Handle(BRepMesh_FastDiscret) myMesh; + Standard_Boolean myModified; + TopTools_DataMapOfShapeReal myEdgeDeflection; + Standard_Real myMaxShapeSize; + Standard_Integer myStatus; + std::vector myFaces; }; DEFINE_STANDARD_HANDLE(BRepMesh_IncrementalMesh,BRepMesh_DiscretRoot) diff --git a/src/BRepMesh/BRepMesh_OrientedEdge.hxx b/src/BRepMesh/BRepMesh_OrientedEdge.hxx new file mode 100644 index 0000000000..0365ecab5c --- /dev/null +++ b/src/BRepMesh/BRepMesh_OrientedEdge.hxx @@ -0,0 +1,91 @@ +// Copyright (c) 2013 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _BRepMesh_OrientedEdge_HeaderFile +#define _BRepMesh_OrientedEdge_HeaderFile + +#include +#include +#include +#include + +//! Light weighted structure representing simple link. +class BRepMesh_OrientedEdge +{ +public: + + DEFINE_STANDARD_ALLOC + + //! Default constructor. + Standard_EXPORT BRepMesh_OrientedEdge() + : myFirstNode(-1), + myLastNode(-1) + { + } + + //! Constructs a link between two vertices. + Standard_EXPORT BRepMesh_OrientedEdge( + const Standard_Integer theFirstNode, + const Standard_Integer theLastNode) + : myFirstNode(theFirstNode), + myLastNode(theLastNode) + { + } + + //! Returns index of first node of the Link. + inline Standard_Integer FirstNode() const + { + return myFirstNode; + } + + //! Returns index of last node of the Link. + inline Standard_Integer LastNode() const + { + return myLastNode; + } + + //! Returns hash code for this edge. + //! @param theUpper upper index in the container. + //! @return hash code. + Standard_EXPORT Standard_Integer HashCode(const Standard_Integer theUpper) const + { + return ::HashCode(myFirstNode + myLastNode, theUpper); + } + + //! Checks this and other edge for equality. + //! @param theOther edge to be checked against this one. + //! @retrun TRUE if edges have the same orientation, FALSE if not. + inline Standard_Boolean IsEqual(const BRepMesh_OrientedEdge& theOther) const + { + return (myFirstNode == theOther.myFirstNode && myLastNode == theOther.myLastNode); + } + + //! Alias for IsEqual. + Standard_Boolean operator ==(const BRepMesh_OrientedEdge& Other) const + { + return IsEqual(Other); + } + +private: + + Standard_Integer myFirstNode; + Standard_Integer myLastNode; +}; + +inline Standard_Integer HashCode(const BRepMesh_OrientedEdge& theEdge, + const Standard_Integer theUpper) +{ + return theEdge.HashCode(theUpper); +} + +#endif diff --git a/src/BRepMesh/BRepMesh_PairOfIndex.hxx b/src/BRepMesh/BRepMesh_PairOfIndex.hxx index db5fd58c6b..ddd92ef487 100644 --- a/src/BRepMesh/BRepMesh_PairOfIndex.hxx +++ b/src/BRepMesh/BRepMesh_PairOfIndex.hxx @@ -88,7 +88,7 @@ public: } //! Returns index corresponding to the given position in the pair. - //! \param thePairPos position of index in the pair (1 or 2). + //! @param thePairPos position of index in the pair (1 or 2). inline Standard_Integer Index(const Standard_Integer thePairPos) const { if (thePairPos != 1 && thePairPos != 2) @@ -98,8 +98,8 @@ public: } //! Sets index corresponding to the given position in the pair. - //! \param thePairPos position of index in the pair (1 or 2). - //! \param theIndex index to be stored. + //! @param thePairPos position of index in the pair (1 or 2). + //! @param theIndex index to be stored. inline void SetIndex(const Standard_Integer thePairPos, const Standard_Integer theIndex) { @@ -110,7 +110,7 @@ public: } //! Remove index from the given position. - //! \param thePairPos position of index in the pair (1 or 2). + //! @param thePairPos position of index in the pair (1 or 2). inline void RemoveIndex(const Standard_Integer thePairPos) { if (thePairPos != 1 && thePairPos != 2) diff --git a/src/BRepMesh/BRepMesh_PairOfPolygon.hxx b/src/BRepMesh/BRepMesh_PairOfPolygon.hxx index 65978bb63d..dc38bcd628 100644 --- a/src/BRepMesh/BRepMesh_PairOfPolygon.hxx +++ b/src/BRepMesh/BRepMesh_PairOfPolygon.hxx @@ -41,7 +41,7 @@ public: //! Sets the first element of the pair. //! If last element is empty, also assignes the given polygon to it. - //! \param thePolygon plygon to be set. + //! @param thePolygon plygon to be set. inline void Prepend(const Handle(Poly_PolygonOnTriangulation)& thePolygon) { myFirst = thePolygon; @@ -52,7 +52,7 @@ public: //! Sets the last element of the pair. //! If first element is empty, also assignes the given polygon to it. - //! \param thePolygon plygon to be set. + //! @param thePolygon plygon to be set. inline void Append(const Handle(Poly_PolygonOnTriangulation)& thePolygon) { if (myFirst.IsNull()) diff --git a/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cxx b/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cxx index ae3037e334..c434e6c799 100644 --- a/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cxx +++ b/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cxx @@ -74,7 +74,7 @@ void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOf( void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOfNode( const Standard_Integer theNodeIndex) { - BRepMeshCol::ListOfInteger::Iterator aLinkIt( + BRepMesh::ListOfInteger::Iterator aLinkIt( myMesh->LinksConnectedTo(theNodeIndex)); for (; aLinkIt.More(); aLinkIt.Next()) diff --git a/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.hxx b/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.hxx index 57b9021447..718869293a 100644 --- a/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.hxx +++ b/src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.hxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -75,25 +75,25 @@ public: } //! Returns selected nodes. - inline const BRepMeshCol::MapOfInteger& Nodes() const + inline const BRepMesh::MapOfInteger& Nodes() const { return myNodes; } //! Returns selected links. - inline const BRepMeshCol::MapOfInteger& Links() const + inline const BRepMesh::MapOfInteger& Links() const { return myLinks; } //! Returns selected elements. - inline const BRepMeshCol::MapOfInteger& Elements() const + inline const BRepMesh::MapOfInteger& Elements() const { return myElements; } //! Gives the list of incices of frontier links. - inline const BRepMeshCol::MapOfInteger& FrontierLinks() const + inline const BRepMesh::MapOfInteger& FrontierLinks() const { return myFrontier; } @@ -105,10 +105,10 @@ private: private: Handle(BRepMesh_DataStructureOfDelaun) myMesh; - BRepMeshCol::MapOfInteger myNodes; - BRepMeshCol::MapOfInteger myLinks; - BRepMeshCol::MapOfInteger myElements; - BRepMeshCol::MapOfInteger myFrontier; + BRepMesh::MapOfInteger myNodes; + BRepMesh::MapOfInteger myLinks; + BRepMesh::MapOfInteger myElements; + BRepMesh::MapOfInteger myFrontier; }; #endif diff --git a/src/BRepMesh/BRepMesh_ShapeTool.cxx b/src/BRepMesh/BRepMesh_ShapeTool.cxx index 38cc71aa2c..d5573aa083 100644 --- a/src/BRepMesh/BRepMesh_ShapeTool.cxx +++ b/src/BRepMesh/BRepMesh_ShapeTool.cxx @@ -135,23 +135,23 @@ gp_XY BRepMesh_ShapeTool::FindUV( const Handle(BRepMesh_FaceAttribute)& theFaceAttribute) { const gp_XY& aPnt2d = thePnt2d.Coord(); - BRepMeshCol::DMapOfIntegerListOfXY& aLocation2D = + BRepMesh::DMapOfIntegerListOfXY& aLocation2D = theFaceAttribute->ChangeLocation2D(); if (!aLocation2D.IsBound(theIndexOfPnt3d)) { - BRepMeshCol::ListOfXY aPoints2d; + BRepMesh::ListOfXY aPoints2d; aPoints2d.Append(aPnt2d); aLocation2D.Bind(theIndexOfPnt3d, aPoints2d); return aPnt2d; } - BRepMeshCol::ListOfXY& aPoints2d = aLocation2D.ChangeFind(theIndexOfPnt3d); + BRepMesh::ListOfXY& aPoints2d = aLocation2D.ChangeFind(theIndexOfPnt3d); // Find the most closest 2d point to the given one. gp_XY aUV; Standard_Real aMinDist = RealLast(); - BRepMeshCol::ListOfXY::Iterator aPoint2dIt(aPoints2d); + BRepMesh::ListOfXY::Iterator aPoint2dIt(aPoints2d); for (; aPoint2dIt.More(); aPoint2dIt.Next()) { const gp_XY& aCurPnt2d = aPoint2dIt.Value(); diff --git a/src/BRepMesh/BRepMesh_ShapeTool.hxx b/src/BRepMesh/BRepMesh_ShapeTool.hxx index 9486d21926..705e0c761c 100644 --- a/src/BRepMesh/BRepMesh_ShapeTool.hxx +++ b/src/BRepMesh/BRepMesh_ShapeTool.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include class TopoDS_Face; diff --git a/src/BRepMesh/BRepMesh_Triangle.hxx b/src/BRepMesh/BRepMesh_Triangle.hxx index 62dc16cd61..7f2c1afd3a 100644 --- a/src/BRepMesh/BRepMesh_Triangle.hxx +++ b/src/BRepMesh/BRepMesh_Triangle.hxx @@ -45,9 +45,9 @@ public: } //! Constructor. - //! \param theEdges array of edges of triangle. - //! \param theOrientations array of edge's orientations. - //! \param theMovability movability of triangle. + //! @param theEdges array of edges of triangle. + //! @param theOrientations array of edge's orientations. + //! @param theMovability movability of triangle. Standard_EXPORT BRepMesh_Triangle( const Standard_Integer (&theEdges)[3], const Standard_Boolean (&theOrientations)[3], @@ -57,9 +57,9 @@ public: } //! Initializes the triangle by the given parameters. - //! \param theEdges array of edges of triangle. - //! \param theOrientations array of edge's orientations. - //! \param theMovability movability of triangle. + //! @param theEdges array of edges of triangle. + //! @param theOrientations array of edge's orientations. + //! @param theMovability movability of triangle. inline void Initialize( const Standard_Integer (&theEdges)[3], const Standard_Boolean (&theOrientations)[3], @@ -75,8 +75,8 @@ public: } //! Gets edges with orientations composing the triangle. - //! \param[out] theEdges array edges are stored to. - //! \param[out] theOrientations array orientations are stored to. + //! @param[out] theEdges array edges are stored to. + //! @param[out] theOrientations array orientations are stored to. inline void Edges(Standard_Integer (&theEdges)[3], Standard_Boolean (&theOrientations)[3]) const { @@ -101,16 +101,16 @@ public: } //! Returns hash code for this triangle. - //! \param theUpper upper index in the container. - //! \return hash code. + //! @param theUpper upper index in the container. + //! @return hash code. Standard_EXPORT Standard_Integer HashCode(const Standard_Integer theUpper) const { return ::HashCode(myEdge1 + myEdge2 + myEdge3, theUpper); } //! Checks for equality with another triangle. - //! \param theOther triangle to be checked against this one. - //! \return TRUE if equal, FALSE if not. + //! @param theOther triangle to be checked against this one. + //! @return TRUE if equal, FALSE if not. Standard_EXPORT Standard_Boolean IsEqual(const BRepMesh_Triangle& theOther) const { if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted) diff --git a/src/BRepMesh/BRepMesh_Vertex.hxx b/src/BRepMesh/BRepMesh_Vertex.hxx index b288b3d53a..afb2aa48a8 100644 --- a/src/BRepMesh/BRepMesh_Vertex.hxx +++ b/src/BRepMesh/BRepMesh_Vertex.hxx @@ -38,9 +38,9 @@ public: } //! Creates vertex associated with point in 3d space. - //! \param theUV position of vertex in parametric space. - //! \param theLocation3d index of 3d point to be associated with vertex. - //! \param theMovability movability of the vertex. + //! @param theUV position of vertex in parametric space. + //! @param theLocation3d index of 3d point to be associated with vertex. + //! @param theMovability movability of the vertex. Standard_EXPORT BRepMesh_Vertex(const gp_XY& theUV, const Standard_Integer theLocation3d, const BRepMesh_DegreeOfFreedom theMovability) @@ -49,9 +49,9 @@ public: } //! Creates vertex without association with point in 3d space. - //! \param theU U position of vertex in parametric space. - //! \param theV V position of vertex in parametric space. - //! \param theMovability movability of the vertex. + //! @param theU U position of vertex in parametric space. + //! @param theV V position of vertex in parametric space. + //! @param theMovability movability of the vertex. Standard_EXPORT BRepMesh_Vertex(const Standard_Real theU, const Standard_Real theV, const BRepMesh_DegreeOfFreedom theMovability) @@ -61,9 +61,9 @@ public: {} //! Initializes vertex associated with point in 3d space. - //! \param theUV position of vertex in parametric space. - //! \param theLocation3d index of 3d point to be associated with vertex. - //! \param theMovability movability of the vertex. + //! @param theUV position of vertex in parametric space. + //! @param theLocation3d index of 3d point to be associated with vertex. + //! @param theMovability movability of the vertex. inline void Initialize(const gp_XY& theUV, const Standard_Integer theLocation3d, const BRepMesh_DegreeOfFreedom theMovability) @@ -98,16 +98,16 @@ public: } //! Returns hash code for this vertex. - //! \param theUpper upper index in the container. - //! \return hash code. + //! @param theUpper upper index in the container. + //! @return hash code. Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const { return ::HashCode(Floor(1e5 * myUV.X()) * Floor(1e5 * myUV.Y()), Upper); } //! Checks for equality with another vertex. - //! \param theOther vertex to be checked against this one. - //! \return TRUE if equal, FALSE if not. + //! @param theOther vertex to be checked against this one. + //! @return TRUE if equal, FALSE if not. Standard_EXPORT Standard_Boolean IsEqual(const BRepMesh_Vertex& theOther) const { if (myMovability == BRepMesh_Deleted || diff --git a/src/BRepMesh/BRepMesh_VertexInspector.hxx b/src/BRepMesh/BRepMesh_VertexInspector.hxx index 4a78330728..899458d3b0 100644 --- a/src/BRepMesh/BRepMesh_VertexInspector.hxx +++ b/src/BRepMesh/BRepMesh_VertexInspector.hxx @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -30,11 +30,11 @@ public: typedef Standard_Integer Target; //! Constructor. - //! \param theReservedSize size to be reserved for vector of vertices. - //! \param theAllocator memory allocator to be used by internal collections. + //! @param theReservedSize size to be reserved for vector of vertices. + //! @param theAllocator memory allocator to be used by internal collections. Standard_EXPORT BRepMesh_VertexInspector ( - const Standard_Integer theReservedSize, - const BRepMeshCol::Allocator& theAllocator) + const Standard_Integer theReservedSize, + const Handle(NCollection_IncAllocator)& theAllocator) : myResIndices(theAllocator), myVertices (theReservedSize), myDelNodes (theAllocator) @@ -43,7 +43,7 @@ public: } //! Registers the given vertex. - //! \param theVertex vertex to be registered. + //! @param theVertex vertex to be registered. Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex) { if( myDelNodes.IsEmpty() ) @@ -69,8 +69,8 @@ public: //! Sets the tolerance to be used for identification of //! coincident vertices. - //! \param theToleranceX tolerance for X dimension. - //! \param theToleranceY tolerance for Y dimension. + //! @param theToleranceX tolerance for X dimension. + //! @param theToleranceY tolerance for Y dimension. inline void SetTolerance(const Standard_Real theToleranceX, const Standard_Real theToleranceY) { @@ -86,7 +86,7 @@ public: } //! Deletes vertex with the given index. - //! \param theIndex index of vertex to be removed. + //! @param theIndex index of vertex to be removed. inline void Delete(const Standard_Integer theIndex) { myVertices(theIndex - 1).SetMovability(BRepMesh_Deleted); @@ -124,14 +124,14 @@ public: //! Returns list with indexes of vertices that have movability attribute //! equal to BRepMesh_Deleted and can be replaced with another node. - inline const BRepMeshCol::ListOfInteger& GetListOfDelPoints() const + inline const BRepMesh::ListOfInteger& GetListOfDelPoints() const { return myDelNodes; } //! Performs inspection of a point with the given index. - //! \param theTargetIndex index of a circle to be checked. - //! \return status of the check. + //! @param theTargetIndex index of a circle to be checked. + //! @return status of the check. Standard_EXPORT NCollection_CellFilter_Action Inspect(const Standard_Integer theTargetIndex); //! Checks indices for equlity. @@ -143,11 +143,11 @@ public: private: - Standard_Real myTolerance[2]; - BRepMeshCol::ListOfInteger myResIndices; - BRepMeshCol::VectorOfVertex myVertices; - BRepMeshCol::ListOfInteger myDelNodes; - gp_XY myPoint; + Standard_Real myTolerance[2]; + BRepMesh::ListOfInteger myResIndices; + BRepMesh::VectorOfVertex myVertices; + BRepMesh::ListOfInteger myDelNodes; + gp_XY myPoint; }; #endif diff --git a/src/BRepMesh/BRepMesh_VertexTool.cxx b/src/BRepMesh/BRepMesh_VertexTool.cxx index 583c485a91..c5238f7f82 100644 --- a/src/BRepMesh/BRepMesh_VertexTool.cxx +++ b/src/BRepMesh/BRepMesh_VertexTool.cxx @@ -56,8 +56,8 @@ NCollection_CellFilter_Action BRepMesh_VertexInspector::Inspect( //purpose : //======================================================================= BRepMesh_VertexTool::BRepMesh_VertexTool( - const Standard_Integer theReservedSize, - const BRepMeshCol::Allocator& theAllocator) + const Standard_Integer theReservedSize, + const Handle(NCollection_IncAllocator)& theAllocator) : myAllocator (theAllocator), myCellFilter(0., myAllocator), mySelector (Max(theReservedSize, 64),myAllocator) @@ -76,7 +76,7 @@ Standard_Integer BRepMesh_VertexTool::Add(const BRepMesh_Vertex& theVertex) Standard_Integer aIndex = FindIndex(theVertex); if (aIndex == 0) { - BRepMeshCol::ListOfInteger aParams(myAllocator); + BRepMesh::ListOfInteger aParams(myAllocator); aIndex = Add(theVertex, aParams); } return aIndex; @@ -87,8 +87,8 @@ Standard_Integer BRepMesh_VertexTool::Add(const BRepMesh_Vertex& theVertex) //purpose : //======================================================================= Standard_Integer BRepMesh_VertexTool::Add( - const BRepMesh_Vertex& theVertex, - const BRepMeshCol::ListOfInteger& theParams) + const BRepMesh_Vertex& theVertex, + const BRepMesh::ListOfInteger& theParams) { Standard_Integer aIndex = mySelector.Add(theVertex); myLinksMap.Bind(aIndex, theParams); @@ -120,9 +120,9 @@ void BRepMesh_VertexTool::Delete(const Standard_Integer theIndex) //purpose : //======================================================================= void BRepMesh_VertexTool::Substitute( - const Standard_Integer theIndex, - const BRepMesh_Vertex& theVertex, - const BRepMeshCol::ListOfInteger& theData) + const Standard_Integer theIndex, + const BRepMesh_Vertex& theVertex, + const BRepMesh::ListOfInteger& theData) { BRepMesh_Vertex& aV = mySelector.GetVertex(theIndex); diff --git a/src/BRepMesh/BRepMesh_VertexTool.hxx b/src/BRepMesh/BRepMesh_VertexTool.hxx index ee079a8924..b49a36dadb 100644 --- a/src/BRepMesh/BRepMesh_VertexTool.hxx +++ b/src/BRepMesh/BRepMesh_VertexTool.hxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,10 +35,11 @@ public: DEFINE_STANDARD_ALLOC //! Constructor. - //! \param theReservedSize size to be reserved for vector of vertices. - //! \param theAllocator memory allocator to be used by internal collections. - Standard_EXPORT BRepMesh_VertexTool(const Standard_Integer theReservedSize, - const BRepMeshCol::Allocator& theAllocator); + //! @param theReservedSize size to be reserved for vector of vertices. + //! @param theAllocator memory allocator to be used by internal collections. + Standard_EXPORT BRepMesh_VertexTool( + const Standard_Integer theReservedSize, + const Handle(NCollection_IncAllocator)& theAllocator); //! Sets new size of cell for cellfilter equal in both directions. Standard_EXPORT void SetCellSize(const Standard_Real theSize) @@ -48,8 +49,8 @@ public: } //! Sets new size of cell for cellfilter. - //! \param theSizeX size for X dimension. - //! \param theSizeY size for Y dimension. + //! @param theSizeX size for X dimension. + //! @param theSizeY size for Y dimension. Standard_EXPORT void SetCellSize(const Standard_Real theSizeX, const Standard_Real theSizeY) { @@ -69,8 +70,8 @@ public: //! Sets the tolerance to be used for identification of //! coincident vertices. - //! \param theToleranceX tolerance for X dimension. - //! \param theToleranceY tolerance for Y dimension. + //! @param theToleranceX tolerance for X dimension. + //! @param theToleranceY tolerance for Y dimension. Standard_EXPORT void SetTolerance(const Standard_Real theToleranceX, const Standard_Real theToleranceY) { @@ -83,24 +84,24 @@ public: Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex); //! Adds vertex with associated data to the tool. - //! \param theVertex vertex to be added. - //! \param theParams data associated with the vertex. - Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex, - const BRepMeshCol::ListOfInteger& theParams); + //! @param theVertex vertex to be added. + //! @param theParams data associated with the vertex. + Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex, + const BRepMesh::ListOfInteger& theParams); //! Deletes vertex with the given index from the tool. Standard_EXPORT void Delete(const Standard_Integer theIndex); //! Returns data assigned to link with the given index. - //! \param theIndex index of link which data should be returned. - //! \return attached data. - inline BRepMeshCol::ListOfInteger& FindFromIndex(const Standard_Integer theIndex) const + //! @param theIndex index of link which data should be returned. + //! @return attached data. + inline BRepMesh::ListOfInteger& FindFromIndex(const Standard_Integer theIndex) const { - return (BRepMeshCol::ListOfInteger&)myLinksMap.Find(theIndex); + return (BRepMesh::ListOfInteger&)myLinksMap.Find(theIndex); } //! Alias for FindFromIndex. - BRepMeshCol::ListOfInteger& operator()(const Standard_Integer theIndex) const + BRepMesh::ListOfInteger& operator()(const Standard_Integer theIndex) const { return FindFromIndex(theIndex); } @@ -132,12 +133,12 @@ public: } //! Substitutes vertex with the given by the given vertex with attributes. - //! \param theIndex index of vertex to be substituted. - //! \param theVertex replacement vertex. - //! \param theData data associated to the vertex. - Standard_EXPORT void Substitute(const Standard_Integer theIndex, - const BRepMesh_Vertex& theVertex, - const BRepMeshCol::ListOfInteger& theData); + //! @param theIndex index of vertex to be substituted. + //! @param theVertex replacement vertex. + //! @param theData data associated to the vertex. + Standard_EXPORT void Substitute(const Standard_Integer theIndex, + const BRepMesh_Vertex& theVertex, + const BRepMesh::ListOfInteger& theData); //! Remove last node from the structure. inline void RemoveLast() @@ -147,7 +148,7 @@ public: //! Returns the list with indexes of vertices that have movability attribute //! equal to BRepMesh_Deleted and can be replaced with another node. - inline const BRepMeshCol::ListOfInteger& GetListOfDelNodes() const + inline const BRepMesh::ListOfInteger& GetListOfDelNodes() const { return mySelector.GetListOfDelPoints(); } @@ -158,9 +159,9 @@ public: private: //! Expands the given point according to specified tolerance. - //! \param thePoint point to be expanded. - //! \param[out] theMinPoint bottom left corner of area defined by expanded point. - //! \param[out] theMaxPoint top right corner of area defined by expanded point. + //! @param thePoint point to be expanded. + //! @param[out] theMinPoint bottom left corner of area defined by expanded point. + //! @param[out] theMaxPoint top right corner of area defined by expanded point. inline void expandPoint(const gp_XY& thePoint, gp_XY& theMinPoint, gp_XY& theMaxPoint) @@ -173,11 +174,11 @@ private: private: - BRepMeshCol::Allocator myAllocator; - BRepMeshCol::VertexCellFilter myCellFilter; - BRepMesh_VertexInspector mySelector; - BRepMeshCol::DMapOfIntegerListOfInteger myLinksMap; - Standard_Real myTolerance[2]; + Handle(NCollection_IncAllocator) myAllocator; + BRepMesh::VertexCellFilter myCellFilter; + BRepMesh_VertexInspector mySelector; + BRepMesh::DMapOfIntegerListOfInteger myLinksMap; + Standard_Real myTolerance[2]; }; #endif diff --git a/src/BRepMesh/BRepMesh_WireChecker.cxx b/src/BRepMesh/BRepMesh_WireChecker.cxx index e939050593..bed115d467 100644 --- a/src/BRepMesh/BRepMesh_WireChecker.cxx +++ b/src/BRepMesh/BRepMesh_WireChecker.cxx @@ -107,7 +107,7 @@ void BRepMesh_WireChecker::BndBox2dTreeSelector::SetSkippedIndex( //function : Indices //purpose : //======================================================================= -const BRepMeshCol::Array1OfInteger& +const BRepMesh::Array1OfInteger& BRepMesh_WireChecker::BndBox2dTreeSelector::Indices() const { return myIndices; @@ -129,8 +129,8 @@ Standard_Integer BRepMesh_WireChecker::BndBox2dTreeSelector::IndicesNb() const BRepMesh_WireChecker::BRepMesh_WireChecker( const TopoDS_Face& theFace, const Standard_Real theTolUV, - const BRepMeshCol::HDMapOfShapePairOfPolygon& theEdges, - const BRepMeshCol::HIMapOfInteger& theVertexMap, + const BRepMesh::HDMapOfShapePairOfPolygon& theEdges, + const BRepMesh::HIMapOfInteger& theVertexMap, const Handle(BRepMesh_DataStructureOfDelaun)& theStructure, const Standard_Real theUmin, const Standard_Real theUmax, @@ -156,8 +156,8 @@ BRepMesh_WireChecker::BRepMesh_WireChecker( { const TopoDS_Wire& aWire = TopoDS::Wire(aFaceExplorer.Current()); - myWiresEdges.push_back(ListOfEdges()); - ListOfEdges& aEdges = myWiresEdges.back(); + myWiresEdges.Append(ListOfEdges()); + ListOfEdges& aEdges = myWiresEdges.ChangeLast(); // Start traversing the wires BRepTools_WireExplorer aWireExplorer(aWire, aFace); @@ -172,7 +172,7 @@ BRepMesh_WireChecker::BRepMesh_WireChecker( } if (aEdges.IsEmpty()) - myWiresEdges.pop_back(); + myWiresEdges.Remove(myWiresEdges.Size()); } } @@ -180,7 +180,7 @@ BRepMesh_WireChecker::BRepMesh_WireChecker( //function : ReCompute //purpose : //======================================================================= -void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) +void BRepMesh_WireChecker::ReCompute(BRepMesh::HClassifier& theClassifier) { if (theClassifier.IsNull()) return; @@ -192,9 +192,8 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) if (!collectDiscretizedWires(aDWires)) return; - const Standard_Integer aNbWires = (Standard_Integer)aDWires.size(); - - BRepMeshCol::Array1OfSegmentsTree aWiresBiPoints(aNbWires); + const Standard_Integer aNbWires = aDWires.Size(); + BRepMesh::Array1OfSegmentsTree aWiresBiPoints(1, aNbWires); fillSegmentsTree(aDWires, aWiresBiPoints); #ifdef HAVE_TBB @@ -205,7 +204,7 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) if (myIsInParallel && aNbWires > 1) { // check wires in parallel threads using TBB - tbb::parallel_for(tbb::blocked_range(0, aNbWires), + tbb::parallel_for(tbb::blocked_range(1, aNbWires + 1), aIntChecker); } else @@ -213,7 +212,7 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) #else BRepMesh_WireInterferenceChecker aIntChecker(aWiresBiPoints, &myStatus); #endif - for (Standard_Integer i = 0; i < aNbWires; ++i) + for (Standard_Integer i = 1; i <= aNbWires; ++i) aIntChecker(i); #ifdef HAVE_TBB } @@ -223,10 +222,10 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) return; // Find holes - SeqOfDWires::iterator aDWiresIt = aDWires.begin(); - for (; aDWiresIt != aDWires.end(); ++aDWiresIt) + SeqOfDWires::Iterator aDWiresIt(aDWires); + for (; aDWiresIt.More(); aDWiresIt.Next()) { - const SeqOfPnt2d& aDWire = *aDWiresIt; + const SeqOfPnt2d& aDWire = aDWiresIt.Value(); theClassifier->RegisterWire(aDWire, myTolUV, myUmin, myUmax, myVmin, myVmax); } } @@ -238,11 +237,10 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires( SeqOfDWires& theDWires) { - // TODO: Collect disretized wires in parallel - SeqOfWireEdges::iterator aWireIt = myWiresEdges.begin(); - for(; aWireIt != myWiresEdges.end(); ++aWireIt) + SeqOfWireEdges::Iterator aWireIt(myWiresEdges); + for(; aWireIt.More(); aWireIt.Next()) { - const ListOfEdges& aEdges = *aWireIt; + const ListOfEdges& aEdges = aWireIt.Value(); // For each wire we create a data map, linking vertices (only // the ends of edges) with their positions in the sequence of // all 2d points from this wire. @@ -252,8 +250,8 @@ Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires( // loop from the map, but since they can't appear twice on the // valid wire, leave them for a little speed up. - SeqOfPnt2d aSeqPnt2d; - DataMapIntInt aNodeInSeq; + SeqOfPnt2d aSeqPnt2d; + BRepMesh::MapOfIntegerInteger aNodeInSeq; Standard_Integer aFirstIndex = 0, aLastIndex = 0; // Start traversing the wire @@ -331,8 +329,8 @@ Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires( const Standard_Integer aIdxWireStart = aNodeInSeq(aLastVertexId); if(aIdxWireStart < aSeqPnt2d.Length()) { - theDWires.push_back(SeqOfPnt2d()); - SeqOfPnt2d& aWire = theDWires.back(); + theDWires.Append(SeqOfPnt2d()); + SeqOfPnt2d& aWire = theDWires.ChangeLast(); aSeqPnt2d.Split(aIdxWireStart, aWire); } } @@ -357,22 +355,22 @@ Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires( //purpose : //======================================================================= void BRepMesh_WireChecker::fillSegmentsTree( - const SeqOfDWires& theDWires, - BRepMeshCol::Array1OfSegmentsTree& theWiresSegmentsTree) + const SeqOfDWires& theDWires, + BRepMesh::Array1OfSegmentsTree& theWiresSegmentsTree) { - const size_t aNbWires = theDWires.size(); - for (size_t aWireIt = 0; aWireIt < aNbWires; ++aWireIt) + const Standard_Integer aNbWires = theDWires.Size(); + for (Standard_Integer aWireIt = 1; aWireIt <= aNbWires; ++aWireIt) { - const SeqOfPnt2d& aWire = theDWires[aWireIt]; + const SeqOfPnt2d& aWire = theDWires(aWireIt); const Standard_Integer aWireLen = aWire.Size(); - BRepMeshCol::HArray1OfSegments aWireSegments = - new BRepMeshCol::Array1OfSegments(aWireLen); + BRepMesh::HArray1OfSegments aWireSegments = + new BRepMesh::Array1OfSegments(1, aWireLen); - BRepMeshCol::HBndBox2dTree aBndBoxTree = - new BRepMeshCol::BndBox2dTree; + BRepMesh::HBndBox2dTree aBndBoxTree = + new BRepMesh::BndBox2dTree; - BRepMeshCol::BndBox2dTreeFiller aBndBoxTreeFiller(*aBndBoxTree); + BRepMesh::BndBox2dTreeFiller aBndBoxTreeFiller(*aBndBoxTree); Standard_Real x1 = 0., y1 = 0., aXstart = 0., aYstart = 0.; for (Standard_Integer aPntIt = 0; aPntIt <= aWireLen; ++aPntIt) @@ -402,22 +400,21 @@ void BRepMesh_WireChecker::fillSegmentsTree( gp_Pnt2d aStartPnt(x1, y1); gp_Pnt2d aEndPnt(x2, y2); - const Standard_Integer aPointId = aPntIt - 1; - BRepMeshCol::Segment& aSegment = aWireSegments->at(aPointId); + BRepMesh::Segment& aSegment = aWireSegments->ChangeValue(aPntIt); aSegment.StartPnt = aStartPnt.XY(); aSegment.EndPnt = aEndPnt.XY(); Bnd_Box2d aBox; aBox.Add(aStartPnt); aBox.Add( aEndPnt); - aBndBoxTreeFiller.Add(aPointId, aBox); + aBndBoxTreeFiller.Add(aPntIt, aBox); } x1 = x2; y1 = y2; } aBndBoxTreeFiller.Fill(); - BRepMeshCol::SegmentsTree& aSegmentsTree = theWiresSegmentsTree[aWireIt]; + BRepMesh::SegmentsTree& aSegmentsTree = theWiresSegmentsTree(aWireIt); aSegmentsTree.first = aWireSegments; aSegmentsTree.second = aBndBoxTree; } diff --git a/src/BRepMesh/BRepMesh_WireChecker.hxx b/src/BRepMesh/BRepMesh_WireChecker.hxx index d49259943c..2f77330833 100644 --- a/src/BRepMesh/BRepMesh_WireChecker.hxx +++ b/src/BRepMesh/BRepMesh_WireChecker.hxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ public: //! Used to identify segments with overlapped bounding boxes. //! Note that instance of selector can be used only once due to //! unextentable array of indices. - class BndBox2dTreeSelector : public BRepMeshCol::BndBox2dTree::Selector + class BndBox2dTreeSelector : public BRepMesh::BndBox2dTree::Selector { public: Standard_EXPORT BndBox2dTreeSelector(const Standard_Integer theReservedSize); @@ -53,42 +53,41 @@ public: Standard_EXPORT void Clear(); Standard_EXPORT void SetBox(const Bnd_Box2d& theBox2D); Standard_EXPORT void SetSkippedIndex(const Standard_Integer theIndex); - Standard_EXPORT const BRepMeshCol::Array1OfInteger& Indices() const; + Standard_EXPORT const BRepMesh::Array1OfInteger& Indices() const; Standard_EXPORT Standard_Integer IndicesNb() const; protected: - Bnd_Box2d myBox2D; - Standard_Integer mySkippedIndex; - BRepMeshCol::Array1OfInteger myIndices; - Standard_Integer myIndicesNb; + Bnd_Box2d myBox2D; + Standard_Integer mySkippedIndex; + BRepMesh::Array1OfInteger myIndices; + Standard_Integer myIndicesNb; }; private: - typedef NCollection_List ListOfEdges; - typedef std::vector SeqOfWireEdges; - typedef NCollection_Sequence SeqOfPnt2d; - typedef std::vector SeqOfDWires; - typedef NCollection_DataMap DataMapIntInt; - typedef std::pair PairIntPnt; + typedef NCollection_List ListOfEdges; + typedef NCollection_Sequence SeqOfWireEdges; + + typedef NCollection_Sequence SeqOfPnt2d; + typedef NCollection_Sequence SeqOfDWires; public: //! Constructor. - //! \param theFace Face to be checked. - //! \param theTolUV Tolerance to be used for calculations in parametric space. - //! \param theEdges Map of edges with associated polygon on triangulation. - //! \param theVertexMap Map of face vertices. - //! \param theStructure Discretized representation of face in parametric space. - //! \param theUmin Lower U boundary of the face in parametric space. - //! \param theUmax Upper U boundary of the face in parametric space. - //! \param theVmin Lower V boundary of the face in parametric space. - //! \param theVmax Upper V boundary of the face in parametric space. + //! @param theFace Face to be checked. + //! @param theTolUV Tolerance to be used for calculations in parametric space. + //! @param theEdges Map of edges with associated polygon on triangulation. + //! @param theVertexMap Map of face vertices. + //! @param theStructure Discretized representation of face in parametric space. + //! @param theUmin Lower U boundary of the face in parametric space. + //! @param theUmax Upper U boundary of the face in parametric space. + //! @param theVmin Lower V boundary of the face in parametric space. + //! @param theVmax Upper V boundary of the face in parametric space. Standard_EXPORT BRepMesh_WireChecker( const TopoDS_Face& theFace, const Standard_Real theTolUV, - const BRepMeshCol::HDMapOfShapePairOfPolygon& theEdges, - const BRepMeshCol::HIMapOfInteger& theVertexMap, + const BRepMesh::HDMapOfShapePairOfPolygon& theEdges, + const BRepMesh::HIMapOfInteger& theVertexMap, const Handle(BRepMesh_DataStructureOfDelaun)& theStructure, const Standard_Real theUmin, const Standard_Real theUmax, @@ -97,8 +96,8 @@ public: const Standard_Boolean isInParallel); //! Recompute data using parameters passed in constructor. - //! \param[out] theClassifier Classifier to be updated using calculated data. - Standard_EXPORT void ReCompute(BRepMeshCol::HClassifier& theClassifier); + //! @param[out] theClassifier Classifier to be updated using calculated data. + Standard_EXPORT void ReCompute(BRepMesh::HClassifier& theClassifier); //! Returns status of the check. inline BRepMesh_Status Status() const @@ -109,17 +108,17 @@ public: private: //! Collects disñrete wires. - //! \param[out] theDWires sequence of discretized wires to be filled. - //! \return TRUE on success, FALSE in case of open wire. + //! @param[out] theDWires sequence of discretized wires to be filled. + //! @return TRUE on success, FALSE in case of open wire. Standard_Boolean collectDiscretizedWires(SeqOfDWires& theDWires); //! Fills array of BiPoints for corresponding wire. - //! \param theDWires Sequence of wires to be processed. - //! \param theWiresSegmentsTree Array of segments with corresponding + //! @param theDWires Sequence of wires to be processed. + //! @param theWiresSegmentsTree Array of segments with corresponding //! bounding boxes trees to be filled. void fillSegmentsTree( - const SeqOfDWires& theDWires, - BRepMeshCol::Array1OfSegmentsTree& theWiresSegmentsTree); + const SeqOfDWires& theDWires, + BRepMesh::Array1OfSegmentsTree& theWiresSegmentsTree); //! Assignment operator. void operator =(BRepMesh_WireChecker& /*theOther*/) @@ -129,8 +128,8 @@ private: private: const Standard_Real myTolUV; - const BRepMeshCol::HDMapOfShapePairOfPolygon& myEdges; - const BRepMeshCol::HIMapOfInteger& myVertexMap; + const BRepMesh::HDMapOfShapePairOfPolygon& myEdges; + const BRepMesh::HIMapOfInteger& myVertexMap; const Handle(BRepMesh_DataStructureOfDelaun)& myStructure; const Standard_Real myUmin; const Standard_Real myUmax; diff --git a/src/BRepMesh/BRepMesh_WireInterferenceChecker.cxx b/src/BRepMesh/BRepMesh_WireInterferenceChecker.cxx index 8122624548..a8273b3f08 100644 --- a/src/BRepMesh/BRepMesh_WireInterferenceChecker.cxx +++ b/src/BRepMesh/BRepMesh_WireInterferenceChecker.cxx @@ -26,13 +26,12 @@ static const Standard_Real MIN_LOOP_S = 2 * M_PI * 2.E-5; //purpose : //======================================================================= BRepMesh_WireInterferenceChecker::BRepMesh_WireInterferenceChecker( - const std::vector& theWires, - BRepMesh_Status* theStatus, - Standard_Mutex* theMutex) -: myWires (&theWires.front()), - myWiresNb ((Standard_Integer)theWires.size()), - myStatus (theStatus), - myMutex (theMutex) + const BRepMesh::Array1OfSegmentsTree& theWires, + BRepMesh_Status* theStatus, + Standard_Mutex* theMutex) +: myWires (theWires), + myStatus(theStatus), + myMutex (theMutex) { } @@ -52,11 +51,10 @@ void BRepMesh_WireInterferenceChecker::operator ()( //purpose : //======================================================================= BRepMesh_WireInterferenceChecker::BRepMesh_WireInterferenceChecker( - const std::vector& theWires, - BRepMesh_Status* theStatus) -: myWires (&theWires.front()), - myWiresNb ((Standard_Integer)theWires.size()), - myStatus (theStatus) + const BRepMesh::Array1OfSegmentsTree& theWires, + BRepMesh_Status* theStatus) +: myWires (theWires), + myStatus(theStatus) { } #endif @@ -71,12 +69,11 @@ void BRepMesh_WireInterferenceChecker::operator ()( if (*myStatus == BRepMesh_SelfIntersectingWire) return; - const BRepMeshCol::SegmentsTree& aWireSegTree1 = myWires[theWireId]; - const BRepMeshCol::Segment* aWireSegments1 = &aWireSegTree1.first->front(); - const BRepMeshCol::HBndBox2dTree& aWireBoxTree1 = aWireSegTree1.second; - const Standard_Integer aWireLen1 = (Standard_Integer)aWireSegTree1.first->size(); + const BRepMesh::SegmentsTree& aWireSegTree1 = myWires(theWireId); + const BRepMesh::HArray1OfSegments& aWireSegments1 = aWireSegTree1.first; + const BRepMesh::HBndBox2dTree& aWireBoxTree1 = aWireSegTree1.second; - for (Standard_Integer aWireIt = theWireId; aWireIt < myWiresNb; ++aWireIt) + for (Standard_Integer aWireIt = theWireId; aWireIt <= myWires.Upper(); ++aWireIt) { #ifdef HAVE_TBB // Break execution in case if flag was raised by another thread @@ -85,14 +82,16 @@ void BRepMesh_WireInterferenceChecker::operator ()( #endif const Standard_Boolean isSelfIntCheck = (aWireIt == theWireId); - const BRepMeshCol::SegmentsTree& aWireSegTree2 = - isSelfIntCheck ? aWireSegTree1 : myWires[aWireIt]; + const BRepMesh::SegmentsTree& aWireSegTree2 = + isSelfIntCheck ? aWireSegTree1 : myWires(aWireIt); - const BRepMeshCol::Segment* aWireSegments2 = &aWireSegTree2.first->front(); - const BRepMeshCol::HBndBox2dTree& aWireBoxTree2 = aWireSegTree2.second; + const BRepMesh::HArray1OfSegments& aWireSegments2 = aWireSegTree2.first; + const BRepMesh::HBndBox2dTree& aWireBoxTree2 = aWireSegTree2.second; - BRepMesh_WireChecker::BndBox2dTreeSelector aSelector ((Standard_Integer)aWireSegTree2.first->size()); - for (Standard_Integer aSegmentId1 = 0; aSegmentId1 < aWireLen1; ++aSegmentId1) + BRepMesh_WireChecker::BndBox2dTreeSelector aSelector (aWireSegments2->Size()); + + Standard_Integer aSegmentId1 = aWireSegments1->Lower(); + for (; aSegmentId1 <= aWireSegments1->Upper(); ++aSegmentId1) { #ifdef HAVE_TBB // Break execution in case if flag was raised by another thread @@ -108,8 +107,8 @@ void BRepMesh_WireInterferenceChecker::operator ()( if (aWireBoxTree2->Select(aSelector) == 0) continue; - const BRepMeshCol::Segment& aSegment1 = aWireSegments1[aSegmentId1]; - const BRepMeshCol::Array1OfInteger& aSelected = aSelector.Indices(); + const BRepMesh::Segment& aSegment1 = aWireSegments1->Value(aSegmentId1); + const BRepMesh::Array1OfInteger& aSelected = aSelector.Indices(); const Standard_Integer aSelectedNb = aSelector.IndicesNb(); for (Standard_Integer aBndIt = 0; aBndIt < aSelectedNb; ++aBndIt) { @@ -120,7 +119,7 @@ void BRepMesh_WireInterferenceChecker::operator ()( #endif const Standard_Integer aSegmentId2 = aSelected(aBndIt); - const BRepMeshCol::Segment& aSegment2 = aWireSegments2[aSegmentId2]; + const BRepMesh::Segment& aSegment2 = aWireSegments2->Value(aSegmentId2); gp_Pnt2d aIntPnt; BRepMesh_GeomTool::IntFlag aIntStatus = BRepMesh_GeomTool::IntSegSeg( @@ -139,7 +138,7 @@ void BRepMesh_WireInterferenceChecker::operator ()( const gp_XY& aRefPnt = aIntPnt.Coord(); for (Standard_Integer i = aSegmentId1; i < aSegmentId2; ++i) { - const BRepMeshCol::Segment& aSeg = aWireSegments1[i]; + const BRepMesh::Segment& aSeg = aWireSegments1->Value(i); gp_XY aCurVec = aSeg.EndPnt - aRefPnt; if (aCurVec.SquareModulus() < gp::Resolution()) diff --git a/src/BRepMesh/BRepMesh_WireInterferenceChecker.hxx b/src/BRepMesh/BRepMesh_WireInterferenceChecker.hxx index 5432662404..bdc866ba6f 100644 --- a/src/BRepMesh/BRepMesh_WireInterferenceChecker.hxx +++ b/src/BRepMesh/BRepMesh_WireInterferenceChecker.hxx @@ -45,48 +45,53 @@ public: #ifdef HAVE_TBB //! Constructor - //! \param theWires wires that should be checked. - //! \param theStatus shared flag to set status of the check. - //! \param theMutex shared mutex for parallel processing. + //! @param theWires wires that should be checked. + //! @param theStatus shared flag to set status of the check. + //! @param theMutex shared mutex for parallel processing. BRepMesh_WireInterferenceChecker( - const std::vector& theWires, - BRepMesh_Status* theStatus, - Standard_Mutex* theMutex); + const BRepMesh::Array1OfSegmentsTree& theWires, + BRepMesh_Status* theStatus, + Standard_Mutex* theMutex); //! Checker's body. - //! \param theWireRange range of wires to be checked. + //! @param theWireRange range of wires to be checked. void operator ()(const tbb::blocked_range& theWireRange) const; #else //! Constructor - //! \param theWires wires that should be checked. - //! \param theStatus shared flag to set status of the check. + //! @param theWires wires that should be checked. + //! @param theStatus shared flag to set status of the check. BRepMesh_WireInterferenceChecker( - const std::vector& theWires, - BRepMesh_Status* theStatus); + const BRepMesh::Array1OfSegmentsTree& theWires, + BRepMesh_Status* theStatus); #endif //! Checker's body. - //! \param theWireId Id of discretized wire to be checked. + //! @param theWireId Id of discretized wire to be checked. void operator ()(const Standard_Integer& theWireId) const; private: //! Classifies the point in case of coincidence of two vectors. - //! \param thePoint1 the start point of a segment (base point). - //! \param thePoint2 the end point of a segment. - //! \param thePointToCheck the point to classify. - //! \return zero value if point is out of segment and non zero value + //! @param thePoint1 the start point of a segment (base point). + //! @param thePoint2 the end point of a segment. + //! @param thePointToCheck the point to classify. + //! @return zero value if point is out of segment and non zero value //! if point is between the first and the second point of segment. static Standard_Integer classifyPoint (const gp_XY& thePoint1, const gp_XY& thePoint2, const gp_XY& thePointToCheck); + + //! Assignment operator. + void operator =(const BRepMesh_WireInterferenceChecker& /*theOther*/) + { + } + private: - const BRepMeshCol::SegmentsTree* myWires; - Standard_Integer myWiresNb; - BRepMesh_Status* myStatus; + const BRepMesh::Array1OfSegmentsTree& myWires; + BRepMesh_Status* myStatus; #ifdef HAVE_TBB - Standard_Mutex* myMutex; + Standard_Mutex* myMutex; #endif }; diff --git a/src/BRepMesh/FILES b/src/BRepMesh/FILES index e7c3736d2c..683eed9766 100755 --- a/src/BRepMesh/FILES +++ b/src/BRepMesh/FILES @@ -1,8 +1,10 @@ +BRepMesh.hxx BRepMesh_PluginEntryType.hxx BRepMesh_PluginMacro.hxx BRepMesh_DegreeOfFreedom.hxx BRepMesh_FactoryError.hxx BRepMesh_Vertex.hxx +BRepMesh_OrientedEdge.hxx BRepMesh_Edge.hxx BRepMesh_Triangle.hxx BRepMesh_Circle.hxx @@ -16,7 +18,6 @@ BRepMesh_DiscretRoot.hxx BRepMesh_DiscretRoot.cxx BRepMesh_DiscretFactory.hxx BRepMesh_DiscretFactory.cxx -BRepMesh_Collections.hxx BRepMesh_DataStructureOfDelaun.hxx BRepMesh_DataStructureOfDelaun.cxx BRepMesh_CircleTool.hxx diff --git a/src/MeshTest/MeshTest.cdl b/src/MeshTest/MeshTest.cdl index 3cc524a783..e1fc836193 100644 --- a/src/MeshTest/MeshTest.cdl +++ b/src/MeshTest/MeshTest.cdl @@ -21,8 +21,7 @@ package MeshTest uses TColStd, Draw, - TopoDS, - BRepMesh + TopoDS is diff --git a/src/StdPrs/StdPrs.cdl b/src/StdPrs/StdPrs.cdl index 7f11d3e77e..a3bf056139 100644 --- a/src/StdPrs/StdPrs.cdl +++ b/src/StdPrs/StdPrs.cdl @@ -41,7 +41,6 @@ uses HLRAlgo, HLRBRep, Quantity, - BRepMesh, gp, TColgp, Poly,