1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

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 \.
This commit is contained in:
oan 2014-09-17 17:00:32 +04:00 committed by bugmaster
parent d9ff84e8ea
commit 848fa7e315
46 changed files with 1173 additions and 1191 deletions

View File

@ -105,7 +105,7 @@ p BRepGProp
p BRepIntCurveSurface p BRepIntCurveSurface
p BRepLib p BRepLib
p BRepMAT2d p BRepMAT2d
p BRepMesh n BRepMesh
p BRepOffset p BRepOffset
p BRepOffsetAPI p BRepOffsetAPI
p BRepPrim p BRepPrim

View File

@ -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;

129
src/BRepMesh/BRepMesh.hxx Normal file
View File

@ -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 <gp_Pnt.hxx>
#include <gp_XYZ.hxx>
#include <gp_XY.hxx>
#include <Bnd_B2d.hxx>
#include <Bnd_Box2d.hxx>
#include <Standard.hxx>
#include <NCollection_List.hxx>
#include <NCollection_Map.hxx>
#include <NCollection_Vector.hxx>
#include <NCollection_Handle.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_IndexedMap.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <NCollection_Array1.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_CellFilter.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_EBTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <BRepMesh_Edge.hxx>
#include <BRepMesh_Triangle.hxx>
#include <BRepMesh_PairOfPolygon.hxx>
#include <BRepMesh_PairOfIndex.hxx>
#include <BRepMesh_Circle.hxx>
#include <TopTools_ShapeMapHasher.hxx>
#include <Handle_Poly_Triangulation.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <vector>
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<Bnd_B2d> SequenceOfBndB2d;
typedef NCollection_Sequence<Standard_Integer> SequenceOfInteger;
typedef NCollection_Sequence<Standard_Real> SequenceOfReal;
//! Vectors
typedef NCollection_Vector<BRepMesh_Vertex> VectorOfVertex;
typedef NCollection_Vector<Standard_Integer> VectorOfInteger;
typedef NCollection_Vector<BRepMesh_Circle> VectorOfCircle;
//! Trees
typedef NCollection_EBTree<Standard_Integer, Bnd_Box2d> BndBox2dTree;
typedef NCollection_UBTreeFiller<Standard_Integer, Bnd_Box2d> BndBox2dTreeFiller;
//! Arrays
typedef NCollection_Array1<BRepMesh_Vertex> Array1OfVertexOfDelaun;
typedef NCollection_Array1<Standard_Integer> Array1OfInteger;
typedef NCollection_Array1<Standard_Real> Array1OfReal;
typedef NCollection_Array1<Segment> Array1OfSegments;
//! Lists
typedef NCollection_List<gp_XY> ListOfXY;
typedef NCollection_List<BRepMesh_Vertex> ListOfVertex;
typedef NCollection_List<Standard_Integer> ListOfInteger;
//! Maps
typedef NCollection_Map<Standard_Integer> MapOfInteger;
typedef NCollection_Map<Handle(Poly_Triangulation)> MapOfTriangulation;
typedef NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> MapOfShape;
typedef NCollection_DataMap<Standard_Integer, Standard_Integer> MapOfIntegerInteger;
typedef NCollection_DataMap<TopoDS_Vertex, Standard_Integer, TopTools_ShapeMapHasher> DMapOfVertexInteger;
typedef NCollection_DataMap<TopoDS_Face, Handle_BRepMesh_FaceAttribute, TopTools_ShapeMapHasher> DMapOfFaceAttribute;
typedef NCollection_DataMap<TopoDS_Shape, BRepMesh_PairOfPolygon, TopTools_ShapeMapHasher> DMapOfShapePairOfPolygon;
typedef NCollection_DataMap<Standard_Integer, gp_Pnt> DMapOfIntegerPnt;
typedef NCollection_DataMap<Standard_Integer, ListOfXY> DMapOfIntegerListOfXY;
typedef NCollection_DataMap<Standard_Integer, ListOfInteger> DMapOfIntegerListOfInteger;
typedef NCollection_DataMap<TopoDS_Edge, MapOfTriangulation, TopTools_ShapeMapHasher> DMapOfEdgeListOfTriangulation;
typedef NCollection_IndexedMap<Standard_Integer> IMapOfInteger;
typedef NCollection_IndexedMap<Standard_Real> IMapOfReal;
typedef NCollection_IndexedMap<BRepMesh_Triangle> IMapOfElement;
typedef NCollection_IndexedDataMap<BRepMesh_Edge, BRepMesh_PairOfIndex> IDMapOfLink;
//! CellFilters
typedef NCollection_CellFilter<BRepMesh_CircleInspector> CircleCellFilter;
typedef NCollection_CellFilter<BRepMesh_VertexInspector> VertexCellFilter;
//! Handles
typedef NCollection_Handle<MapOfInteger> HMapOfInteger;
typedef NCollection_Handle<IMapOfInteger> HIMapOfInteger;
typedef NCollection_Handle<DMapOfShapePairOfPolygon> HDMapOfShapePairOfPolygon;
typedef NCollection_Handle<DMapOfIntegerPnt> HDMapOfIntegerPnt;
typedef NCollection_Handle<BRepMesh_Classifier> HClassifier;
typedef NCollection_Handle<BndBox2dTree> HBndBox2dTree;
typedef NCollection_Handle<Array1OfSegments> HArray1OfSegments;
typedef NCollection_Handle<DMapOfVertexInteger> HDMapOfVertexInteger;
//! Other data structures
typedef std::pair<HArray1OfSegments, HBndBox2dTree> SegmentsTree;
typedef NCollection_Array1<SegmentsTree> Array1OfSegmentsTree;
};
#endif

View File

@ -33,8 +33,8 @@ public:
} }
//! Constructor. //! Constructor.
//! \param theLocation location of a circle. //! @param theLocation location of a circle.
//! \param theRadius radius of a circle. //! @param theRadius radius of a circle.
Standard_EXPORT BRepMesh_Circle(const gp_XY& theLocation, Standard_EXPORT BRepMesh_Circle(const gp_XY& theLocation,
const Standard_Real theRadius) const Standard_Real theRadius)
: myLocation(theLocation), : myLocation(theLocation),
@ -43,14 +43,14 @@ public:
} }
//! Sets location of a circle. //! Sets location of a circle.
//! \param theLocation location of a circle. //! @param theLocation location of a circle.
inline void SetLocation(const gp_XY& theLocation) inline void SetLocation(const gp_XY& theLocation)
{ {
myLocation = theLocation; myLocation = theLocation;
} }
//! Sets radius of a circle. //! Sets radius of a circle.
//! \param theRadius radius of a circle. //! @param theRadius radius of a circle.
inline void SetRadius(const Standard_Real theRadius) inline void SetRadius(const Standard_Real theRadius)
{ {
myRadius = theRadius; myRadius = theRadius;

View File

@ -16,7 +16,7 @@
#ifndef BRepMesh_CircleInspector_Header #ifndef BRepMesh_CircleInspector_Header
#define BRepMesh_CircleInspector_Header #define BRepMesh_CircleInspector_Header
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <BRepMesh_Circle.hxx> #include <BRepMesh_Circle.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <gp_XY.hxx> #include <gp_XY.hxx>
@ -30,13 +30,13 @@ public:
typedef Standard_Integer Target; typedef Standard_Integer Target;
//! Constructor. //! Constructor.
//! \param theTolerance tolerance to be used for identification of shot circles. //! @param theTolerance tolerance to be used for identification of shot circles.
//! \param theReservedSize size to be reserved for vector of circles. //! @param theReservedSize size to be reserved for vector of circles.
//! \param theAllocator memory allocator to be used by internal collections. //! @param theAllocator memory allocator to be used by internal collections.
Standard_EXPORT BRepMesh_CircleInspector( Standard_EXPORT BRepMesh_CircleInspector(
const Standard_Real theTolerance, const Standard_Real theTolerance,
const Standard_Integer theReservedSize, const Standard_Integer theReservedSize,
const BRepMeshCol::Allocator& theAllocator) const Handle(NCollection_IncAllocator)& theAllocator)
: myTolerance(theTolerance*theTolerance), : myTolerance(theTolerance*theTolerance),
myResIndices(theAllocator), myResIndices(theAllocator),
myCircles(theReservedSize) myCircles(theReservedSize)
@ -44,8 +44,8 @@ public:
} }
//! Adds the circle to vector of circles at the given position. //! Adds the circle to vector of circles at the given position.
//! \param theIndex position of circle in the vector. //! @param theIndex position of circle in the vector.
//! \param theCircle circle to be added. //! @param theCircle circle to be added.
inline void Bind(const Standard_Integer theIndex, inline void Bind(const Standard_Integer theIndex,
const BRepMesh_Circle& theCircle) const BRepMesh_Circle& theCircle)
{ {
@ -53,21 +53,21 @@ public:
} }
//! Resutns vector of registered circles. //! Resutns vector of registered circles.
inline BRepMeshCol::VectorOfCircle& Circles() inline const BRepMesh::VectorOfCircle& Circles() const
{ {
return myCircles; return myCircles;
} }
//! Returns circle with the given index. //! Returns circle with the given index.
//! \param theIndex index of circle. //! @param theIndex index of circle.
//! \return circle with the given index. //! @return circle with the given index.
inline BRepMesh_Circle& Circle(const Standard_Integer theIndex) inline BRepMesh_Circle& Circle(const Standard_Integer theIndex)
{ {
return myCircles(theIndex); return myCircles(theIndex);
} }
//! Set reference point to be checked. //! Set reference point to be checked.
//! \param thePoint bullet point. //! @param thePoint bullet point.
inline void SetPoint(const gp_XY& thePoint) inline void SetPoint(const gp_XY& thePoint)
{ {
myResIndices.Clear(); myResIndices.Clear();
@ -75,14 +75,14 @@ public:
} }
//! Returns list of circles shot by the reference point. //! Returns list of circles shot by the reference point.
inline BRepMeshCol::ListOfInteger& GetShotCircles() inline BRepMesh::ListOfInteger& GetShotCircles()
{ {
return myResIndices; return myResIndices;
} }
//! Performs inspection of a circle with the given index. //! Performs inspection of a circle with the given index.
//! \param theTargetIndex index of a circle to be checked. //! @param theTargetIndex index of a circle to be checked.
//! \return status of the check. //! @return status of the check.
Standard_EXPORT NCollection_CellFilter_Action Inspect( Standard_EXPORT NCollection_CellFilter_Action Inspect(
const Standard_Integer theTargetIndex); const Standard_Integer theTargetIndex);
@ -95,10 +95,10 @@ public:
} }
private: private:
Standard_Real myTolerance; Standard_Real myTolerance;
BRepMeshCol::ListOfInteger myResIndices; BRepMesh::ListOfInteger myResIndices;
BRepMeshCol::VectorOfCircle myCircles; BRepMesh::VectorOfCircle myCircles;
gp_XY myPoint; gp_XY myPoint;
}; };
#endif #endif

View File

@ -47,7 +47,7 @@ NCollection_CellFilter_Action BRepMesh_CircleInspector::Inspect(
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_CircleTool::BRepMesh_CircleTool( BRepMesh_CircleTool::BRepMesh_CircleTool(
const BRepMeshCol::Allocator& theAllocator) const Handle(NCollection_IncAllocator)& theAllocator)
: myTolerance (Precision::PConfusion() * Precision::PConfusion()), : myTolerance (Precision::PConfusion() * Precision::PConfusion()),
myAllocator (theAllocator), myAllocator (theAllocator),
myCellFilter(10, theAllocator), myCellFilter(10, theAllocator),
@ -60,8 +60,8 @@ BRepMesh_CircleTool::BRepMesh_CircleTool(
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_CircleTool::BRepMesh_CircleTool( BRepMesh_CircleTool::BRepMesh_CircleTool(
const Standard_Integer theReservedSize, const Standard_Integer theReservedSize,
const BRepMeshCol::Allocator& theAllocator) const Handle(NCollection_IncAllocator)& theAllocator)
: myTolerance (Precision::PConfusion() * Precision::PConfusion()), : myTolerance (Precision::PConfusion() * Precision::PConfusion()),
myAllocator (theAllocator), myAllocator (theAllocator),
myCellFilter(10, theAllocator), myCellFilter(10, theAllocator),
@ -164,7 +164,7 @@ void BRepMesh_CircleTool::Delete(const Standard_Integer theIndex)
//function : Select //function : Select
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMeshCol::ListOfInteger& BRepMesh_CircleTool::Select(const gp_XY& thePoint) BRepMesh::ListOfInteger& BRepMesh_CircleTool::Select(const gp_XY& thePoint)
{ {
mySelector.SetPoint(thePoint); mySelector.SetPoint(thePoint);
myCellFilter.Inspect(thePoint, mySelector); myCellFilter.Inspect(thePoint, mySelector);

View File

@ -24,7 +24,7 @@
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
class gp_Circ2d; class gp_Circ2d;
@ -36,32 +36,34 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Constructor. //! Constructor.
//! \param theAllocator memory allocator to be used by internal structures. //! @param theAllocator memory allocator to be used by internal structures.
Standard_EXPORT BRepMesh_CircleTool(const BRepMeshCol::Allocator& theAllocator); Standard_EXPORT BRepMesh_CircleTool(
const Handle(NCollection_IncAllocator)& theAllocator);
//! Constructor. //! Constructor.
//! \param theReservedSize size to be reserved for vector of circles. //! @param theReservedSize size to be reserved for vector of circles.
//! \param theAllocator memory allocator to be used by internal structures. //! @param theAllocator memory allocator to be used by internal structures.
Standard_EXPORT BRepMesh_CircleTool(const Standard_Integer theReservedSize, Standard_EXPORT BRepMesh_CircleTool(
const BRepMeshCol::Allocator& theAllocator); const Standard_Integer theReservedSize,
const Handle(NCollection_IncAllocator)& theAllocator);
//! Initializes the tool. //! 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*/) inline void Init(const Standard_Integer /*theReservedSize*/)
{ {
myTolerance = Precision::PConfusion() * Precision::PConfusion(); myTolerance = Precision::PConfusion() * Precision::PConfusion();
} }
//! Sets new size for cell filter. //! 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) inline void SetCellSize(const Standard_Real theSize)
{ {
myCellFilter.Reset(theSize, myAllocator); myCellFilter.Reset(theSize, myAllocator);
} }
//! Sets new size for cell filter. //! Sets new size for cell filter.
//! \param theSizeX cell size to be set for X dimension. //! @param theSizeX cell size to be set for X dimension.
//! \param theSizeY cell size to be set for Y dimension. //! @param theSizeY cell size to be set for Y dimension.
inline void SetCellSize(const Standard_Real theSizeX, inline void SetCellSize(const Standard_Real theSizeX,
const Standard_Real theSizeY) const Standard_Real theSizeY)
{ {
@ -70,8 +72,8 @@ public:
} }
//! Sets limits of inspection area. //! Sets limits of inspection area.
//! \param theMin bottom left corner of inspection area. //! @param theMin bottom left corner of inspection area.
//! \param theMax top right corner of inspection area. //! @param theMax top right corner of inspection area.
inline void SetMinMaxSize(const gp_XY& theMin, inline void SetMinMaxSize(const gp_XY& theMin,
const gp_XY& theMax) const gp_XY& theMax)
{ {
@ -80,17 +82,17 @@ public:
} }
//! Binds the circle to the tool. //! Binds the circle to the tool.
//! \param theIndex index a circle should be bound with. //! @param theIndex index a circle should be bound with.
//! \param theCircle circle to be bound. //! @param theCircle circle to be bound.
Standard_EXPORT void Bind(const Standard_Integer theIndex, Standard_EXPORT void Bind(const Standard_Integer theIndex,
const gp_Circ2d& theCircle); const gp_Circ2d& theCircle);
//! Computes circle on three points and bind it to the tool. //! Computes circle on three points and bind it to the tool.
//! \param theIndex index a circle should be bound with. //! @param theIndex index a circle should be bound with.
//! \param thePoint1 first point. //! @param thePoint1 first point.
//! \param thePoint2 second point. //! @param thePoint2 second point.
//! \param thePoint3 third point. //! @param thePoint3 third point.
//! \return FALSE in case of impossibility to build a circle //! @return FALSE in case of impossibility to build a circle
//! on the given points, TRUE elsewhere. //! on the given points, TRUE elsewhere.
Standard_EXPORT Standard_Boolean Bind(const Standard_Integer theIndex, Standard_EXPORT Standard_Boolean Bind(const Standard_Integer theIndex,
const gp_XY& thePoint1, const gp_XY& thePoint1,
@ -98,35 +100,35 @@ public:
const gp_XY& thePoint3); const gp_XY& thePoint3);
//! Binds implicit zero circle. //! 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); Standard_EXPORT void MocBind(const Standard_Integer theIndex);
//! Deletes a circle from the tool. //! 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); Standard_EXPORT void Delete(const Standard_Integer theIndex);
//! Select the circles shot by the given point. //! Select the circles shot by the given point.
//! \param thePoint bullet point. //! @param thePoint bullet point.
Standard_EXPORT BRepMeshCol::ListOfInteger& Select(const gp_XY& thePoint); Standard_EXPORT BRepMesh::ListOfInteger& Select(const gp_XY& thePoint);
private: private:
//! Creates circle with the given parameters and binds it to the tool. //! Creates circle with the given parameters and binds it to the tool.
//! \param theIndex index a circle should be bound with. //! @param theIndex index a circle should be bound with.
//! \param theLocation location of a circle. //! @param theLocation location of a circle.
//! \param theRadius radius of a circle. //! @param theRadius radius of a circle.
void bind(const Standard_Integer theIndex, void bind(const Standard_Integer theIndex,
const gp_XY& theLocation, const gp_XY& theLocation,
const Standard_Real theRadius); const Standard_Real theRadius);
private: private:
Standard_Real myTolerance; Standard_Real myTolerance;
BRepMeshCol::Allocator myAllocator; Handle(NCollection_IncAllocator) myAllocator;
BRepMeshCol::CircleCellFilter myCellFilter; BRepMesh::CircleCellFilter myCellFilter;
BRepMesh_CircleInspector mySelector; BRepMesh_CircleInspector mySelector;
gp_XY myFaceMax; gp_XY myFaceMax;
gp_XY myFaceMin; gp_XY myFaceMin;
}; };
#endif #endif

View File

@ -24,9 +24,7 @@
#include <TColStd_SequenceOfBoolean.hxx> #include <TColStd_SequenceOfBoolean.hxx>
#include <TopAbs_State.hxx> #include <TopAbs_State.hxx>
#include <NCollection_Sequence.hxx> #include <NCollection_Sequence.hxx>
#include <gp_Pnt2d.hxx>
class gp_Pnt2d;
class TColgp_SequenceOfPnt2d;
//! Auxilary class contains information about correctness of discretized //! Auxilary class contains information about correctness of discretized
//! face and used for classification of points regarding face internals. //! face and used for classification of points regarding face internals.
@ -40,7 +38,7 @@ public:
Standard_EXPORT BRepMesh_Classifier(); Standard_EXPORT BRepMesh_Classifier();
//! Destructor. //! Destructor.
~BRepMesh_Classifier() Standard_EXPORT virtual ~BRepMesh_Classifier()
{ {
Destroy(); Destroy();
} }
@ -50,19 +48,19 @@ public:
Standard_EXPORT void Destroy(); Standard_EXPORT void Destroy();
//! Performs classification of the given point regarding to face internals. //! Performs classification of the given point regarding to face internals.
//! \param thePoint Point in parametric space to be classified. //! @param thePoint Point in parametric space to be classified.
//! \return //! @return
Standard_EXPORT TopAbs_State Perform(const gp_Pnt2d& thePoint) const; Standard_EXPORT TopAbs_State Perform(const gp_Pnt2d& thePoint) const;
//! Registers wire specified by sequence of points for //! Registers wire specified by sequence of points for
//! further classification of points. //! further classification of points.
//! \param theWire Wire to be registered. Specified by sequence 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 theTolUV Tolerance to be used for calculations in parametric space.
//! \param theUmin Lower U boundary of the 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 theUmax Upper U boundary of the face in parametric space.
//! \param theVmin Lower V 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 theVmax Upper V boundary of the face in parametric space.
void RegisterWire( Standard_EXPORT void RegisterWire(
const NCollection_Sequence<gp_Pnt2d>& theWire, const NCollection_Sequence<gp_Pnt2d>& theWire,
const Standard_Real theTolUV, const Standard_Real theTolUV,
const Standard_Real theUmin, const Standard_Real theUmin,

View File

@ -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 <gp_Pnt.hxx>
#include <gp_XYZ.hxx>
#include <gp_XY.hxx>
#include <Bnd_B2d.hxx>
#include <Bnd_Box2d.hxx>
#include <Standard.hxx>
#include <NCollection_List.hxx>
#include <NCollection_Map.hxx>
#include <NCollection_Vector.hxx>
#include <NCollection_Handle.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_IndexedMap.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <NCollection_Array1.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_CellFilter.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_EBTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <BRepMesh_Edge.hxx>
#include <BRepMesh_Triangle.hxx>
#include <BRepMesh_PairOfPolygon.hxx>
#include <BRepMesh_PairOfIndex.hxx>
#include <BRepMesh_Circle.hxx>
#include <TopTools_ShapeMapHasher.hxx>
#include <Handle_Poly_Triangulation.hxx>
#include <TopoDS_Face.hxx>
#include <vector>
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<Bnd_B2d> SequenceOfBndB2d;
typedef N_SEQUENCE<Standard_Integer> SequenceOfInteger;
typedef N_SEQUENCE<Standard_Real> SequenceOfReal;
//! Vectors
typedef N_VECTOR<BRepMesh_Vertex> VectorOfVertex;
typedef N_VECTOR<Standard_Integer> VectorOfInteger;
typedef N_VECTOR<BRepMesh_Circle> VectorOfCircle;
//! Trees
typedef NCollection_EBTree<Standard_Integer, Bnd_Box2d> BndBox2dTree;
typedef NCollection_UBTreeFiller<Standard_Integer, Bnd_Box2d> BndBox2dTreeFiller;
//! Arrays
typedef N_ARRAY1<BRepMesh_Vertex> Array1OfVertexOfDelaun;
typedef N_ARRAY1<Standard_Integer> Array1OfInteger;
typedef N_ARRAY1<Standard_Real> Array1OfReal;
typedef std::vector<Segment> Array1OfSegments;
//! Lists
typedef N_LIST<gp_XY> ListOfXY;
typedef N_LIST<BRepMesh_Vertex> ListOfVertex;
typedef N_LIST<Standard_Integer> ListOfInteger;
//! Maps
typedef N_MAP<Standard_Integer> MapOfInteger;
typedef N_MAP<Handle(Poly_Triangulation)> MapOfTriangulation;
typedef N_MAP<TopoDS_Shape, ShapeMapHasher> MapOfShape;
typedef N_DATAMAP<Standard_Integer, Standard_Integer> MapOfIntegerInteger;
typedef N_DATAMAP<TopoDS_Vertex, Standard_Integer, ShapeMapHasher> DMapOfVertexInteger;
typedef N_DATAMAP<TopoDS_Face, Handle_BRepMesh_FaceAttribute, ShapeMapHasher> DMapOfFaceAttribute;
typedef N_DATAMAP<TopoDS_Shape, BRepMesh_PairOfPolygon, ShapeMapHasher> DMapOfShapePairOfPolygon;
typedef N_DATAMAP<Standard_Integer, gp_Pnt> DMapOfIntegerPnt;
typedef N_DATAMAP<Standard_Integer, ListOfXY> DMapOfIntegerListOfXY;
typedef N_DATAMAP<Standard_Integer, ListOfInteger> DMapOfIntegerListOfInteger;
typedef N_DATAMAP<TopoDS_Edge, MapOfTriangulation, ShapeMapHasher> DMapOfEdgeListOfTriangulation;
typedef N_IMAP<Standard_Integer> IMapOfInteger;
typedef N_IMAP<Standard_Real> IMapOfReal;
typedef N_IMAP<BRepMesh_Triangle> IMapOfElement;
typedef N_IDMAP<BRepMesh_Edge, BRepMesh_PairOfIndex> IDMapOfLink;
//! CellFilters
typedef N_CELLFILTER<BRepMesh_CircleInspector> CircleCellFilter;
typedef N_CELLFILTER<BRepMesh_VertexInspector> VertexCellFilter;
//! Handles
typedef N_HANDLE<MapOfInteger> HMapOfInteger;
typedef N_HANDLE<IMapOfInteger> HIMapOfInteger;
typedef N_HANDLE<DMapOfShapePairOfPolygon> HDMapOfShapePairOfPolygon;
typedef N_HANDLE<DMapOfIntegerPnt> HDMapOfIntegerPnt;
typedef N_HANDLE<BRepMesh_Classifier> HClassifier;
typedef N_HANDLE<BndBox2dTree> HBndBox2dTree;
typedef N_HANDLE<Array1OfSegments> HArray1OfSegments;
//! Other data structures
typedef std::pair<HArray1OfSegments, HBndBox2dTree> SegmentsTree;
typedef std::vector<SegmentsTree> Array1OfSegmentsTree;
};
#endif

View File

@ -31,8 +31,8 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_DataStructureOfDelaun, Standard_Transient)
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_DataStructureOfDelaun::BRepMesh_DataStructureOfDelaun( BRepMesh_DataStructureOfDelaun::BRepMesh_DataStructureOfDelaun(
const BRepMeshCol::Allocator& theAllocator, const Handle(NCollection_IncAllocator)& theAllocator,
const Standard_Integer theReservedNodeSize) const Standard_Integer theReservedNodeSize)
: myNodes (theReservedNodeSize, theAllocator), : myNodes (theReservedNodeSize, theAllocator),
myLinks (theReservedNodeSize * 3), myLinks (theReservedNodeSize * 3),
myDelLinks (theAllocator), myDelLinks (theAllocator),
@ -54,7 +54,7 @@ Standard_Boolean BRepMesh_DataStructureOfDelaun::SubstituteNode(
if (myNodes.FindIndex(theNewNode) != 0) if (myNodes.FindIndex(theNewNode) != 0)
return Standard_False; return Standard_False;
const BRepMeshCol::ListOfInteger& aLinks = myNodes(theIndex); const BRepMesh::ListOfInteger& aLinks = myNodes(theIndex);
myNodes.Substitute(theIndex, theNewNode, aLinks); myNodes.Substitute(theIndex, theNewNode, aLinks);
return Standard_True; return Standard_True;
} }
@ -158,8 +158,8 @@ void BRepMesh_DataStructureOfDelaun::cleanLink(
const Standard_Integer aNodeId = (i == 0) ? const Standard_Integer aNodeId = (i == 0) ?
theLink.FirstNode() : theLink.LastNode(); theLink.FirstNode() : theLink.LastNode();
BRepMeshCol::ListOfInteger& aLinkList = myNodes(aNodeId); BRepMesh::ListOfInteger& aLinkList = myNodes(aNodeId);
BRepMeshCol::ListOfInteger::Iterator aLinkIt(aLinkList); BRepMesh::ListOfInteger::Iterator aLinkIt(aLinkList);
for(; aLinkIt.More(); aLinkIt.Next()) for(; aLinkIt.More(); aLinkIt.Next())
{ {
if (aLinkIt.Value() == theIndex) if (aLinkIt.Value() == theIndex)
@ -315,8 +315,8 @@ void BRepMesh_DataStructureOfDelaun::ElementNodes(
//======================================================================= //=======================================================================
void BRepMesh_DataStructureOfDelaun::ClearDomain() void BRepMesh_DataStructureOfDelaun::ClearDomain()
{ {
BRepMeshCol::MapOfInteger aFreeEdges; BRepMesh::MapOfInteger aFreeEdges;
BRepMeshCol::MapOfInteger::Iterator aElementIt(myElementsOfDomain); BRepMesh::MapOfInteger::Iterator aElementIt(myElementsOfDomain);
for (; aElementIt.More(); aElementIt.Next()) for (; aElementIt.More(); aElementIt.Next())
{ {
const Standard_Integer aElementId = aElementIt.Key(); const Standard_Integer aElementId = aElementIt.Key();
@ -334,7 +334,7 @@ void BRepMesh_DataStructureOfDelaun::ClearDomain()
} }
myElementsOfDomain.Clear(); myElementsOfDomain.Clear();
BRepMeshCol::MapOfInteger::Iterator aEdgeIt(aFreeEdges); BRepMesh::MapOfInteger::Iterator aEdgeIt(aFreeEdges);
for (; aEdgeIt.More(); aEdgeIt.Next()) for (; aEdgeIt.More(); aEdgeIt.Next())
RemoveLink(aEdgeIt.Key()); RemoveLink(aEdgeIt.Key());
} }
@ -374,7 +374,7 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedLinks()
--aLastLiveItem; --aLastLiveItem;
const Standard_Integer aLastLiveItemId = aLastLiveItem + 1; const Standard_Integer aLastLiveItemId = aLastLiveItem + 1;
BRepMeshCol::ListOfInteger::Iterator aLinkIt; BRepMesh::ListOfInteger::Iterator aLinkIt;
// update link references // update link references
for (Standard_Integer i = 0; i < 2; ++i) for (Standard_Integer i = 0; i < 2; ++i)
{ {
@ -421,8 +421,8 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedLinks()
//======================================================================= //=======================================================================
void BRepMesh_DataStructureOfDelaun::clearDeletedNodes() void BRepMesh_DataStructureOfDelaun::clearDeletedNodes()
{ {
BRepMeshCol::ListOfInteger& aDelNodes = BRepMesh::ListOfInteger& aDelNodes =
(BRepMeshCol::ListOfInteger&)myNodes.GetListOfDelNodes(); (BRepMesh::ListOfInteger&)myNodes.GetListOfDelNodes();
Standard_Integer aLastLiveItem = NbNodes(); Standard_Integer aLastLiveItem = NbNodes();
while (!aDelNodes.IsEmpty()) while (!aDelNodes.IsEmpty())
@ -443,7 +443,7 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedNodes()
continue; continue;
BRepMesh_Vertex aNode = GetNode(aLastLiveItem); BRepMesh_Vertex aNode = GetNode(aLastLiveItem);
BRepMeshCol::ListOfInteger& aLinkList = myNodes(aLastLiveItem); BRepMesh::ListOfInteger& aLinkList = myNodes(aLastLiveItem);
myNodes.RemoveLast(); myNodes.RemoveLast();
--aLastLiveItem; --aLastLiveItem;
@ -451,7 +451,7 @@ void BRepMesh_DataStructureOfDelaun::clearDeletedNodes()
myNodes.Substitute(aDelItem, aNode, aLinkList); myNodes.Substitute(aDelItem, aNode, aLinkList);
const Standard_Integer aLastLiveItemId = aLastLiveItem + 1; const Standard_Integer aLastLiveItemId = aLastLiveItem + 1;
BRepMeshCol::ListOfInteger::Iterator aLinkIt(aLinkList); BRepMesh::ListOfInteger::Iterator aLinkIt(aLinkList);
for (; aLinkIt.More(); aLinkIt.Next()) for (; aLinkIt.More(); aLinkIt.Next())
{ {
const Standard_Integer aLinkId = aLinkIt.Value(); const Standard_Integer aLinkId = aLinkIt.Value();
@ -518,7 +518,7 @@ Standard_CString BRepMesh_Dump(void* theMeshHandlePtr,
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
BRepMeshCol::MapOfInteger::Iterator aLinksIt(aMeshData->LinksOfDomain()); BRepMesh::MapOfInteger::Iterator aLinksIt(aMeshData->LinksOfDomain());
for (; aLinksIt.More(); aLinksIt.Next()) for (; aLinksIt.More(); aLinksIt.Next())
{ {
const BRepMesh_Edge& aLink = aMeshData->GetLink(aLinksIt.Value()); const BRepMesh_Edge& aLink = aMeshData->GetLink(aLinksIt.Value());

View File

@ -21,7 +21,7 @@
#include <BRepMesh_Triangle.hxx> #include <BRepMesh_Triangle.hxx>
#include <BRepMesh_PairOfIndex.hxx> #include <BRepMesh_PairOfIndex.hxx>
#include <Standard_OStream.hxx> #include <Standard_OStream.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
class BRepMesh_Vertex; class BRepMesh_Vertex;
class BRepMesh_VertexTool; class BRepMesh_VertexTool;
@ -34,15 +34,15 @@ class BRepMesh_DataStructureOfDelaun : public Standard_Transient
public: public:
//! Constructor. //! Constructor.
//! \param theAllocator memory allocator to be used by internal structures. //! @param theAllocator memory allocator to be used by internal structures.
//! \param theReservedNodeSize presumed number of nodes in this mesh. //! @param theReservedNodeSize presumed number of nodes in this mesh.
Standard_EXPORT BRepMesh_DataStructureOfDelaun( Standard_EXPORT BRepMesh_DataStructureOfDelaun(
const BRepMeshCol::Allocator& theAllocator, const Handle(NCollection_IncAllocator)& theAllocator,
const Standard_Integer theReservedNodeSize = 100); const Standard_Integer theReservedNodeSize = 100);
public: //! \name API for accessing mesh nodes. public: //! @name API for accessing mesh nodes.
//! Returns number of nodes. //! Returns number of nodes.
inline Standard_Integer NbNodes() const 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. //! Adds node to the mesh if it is not already in the mesh.
//! \param theNode node to be added to the mesh. //! @param theNode node to be added to the mesh.
//! \return index of the node in the structure. //! @return index of the node in the structure.
inline Standard_Integer AddNode(const BRepMesh_Vertex& theNode) inline Standard_Integer AddNode(const BRepMesh_Vertex& theNode)
{ {
return myNodes.Add(theNode); return myNodes.Add(theNode);
} }
//! Finds the index of the given node. //! Finds the index of the given node.
//! \param theNode node to find. //! @param theNode node to find.
//! \return index of the given element of zero if node is not in the mesh. //! @return index of the given element of zero if node is not in the mesh.
Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Vertex& theNode) Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Vertex& theNode)
{ {
return myNodes.FindIndex(theNode); return myNodes.FindIndex(theNode);
} }
//! Get node by the index. //! Get node by the index.
//! \param theIndex index of a node. //! @param theIndex index of a node.
//! \return node with the given index. //! @return node with the given index.
inline const BRepMesh_Vertex& GetNode(const Standard_Integer theIndex) inline const BRepMesh_Vertex& GetNode(const Standard_Integer theIndex)
{ {
return myNodes.FindKey(theIndex); return myNodes.FindKey(theIndex);
@ -82,7 +82,7 @@ public: //! \name API for accessing mesh nodes.
} }
//! Replaces nodes of mesh by the given ones. //! 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) Standard_EXPORT void ReplaceNodes(const BRepMesh_VertexTool& theNewNodes)
{ {
if (theNewNodes.IsEmpty()) if (theNewNodes.IsEmpty())
@ -92,17 +92,17 @@ public: //! \name API for accessing mesh nodes.
} }
//! Substitutes the node with the given index by new one. //! Substitutes the node with the given index by new one.
//! \param theIndex index of node to be substituted. //! @param theIndex index of node to be substituted.
//! \param theNewNode substituting node. //! @param theNewNode substituting node.
//! \return FALSE in case if new node is already in the structure, TRUE elsewhere. //! @return FALSE in case if new node is already in the structure, TRUE elsewhere.
Standard_EXPORT Standard_Boolean SubstituteNode( Standard_EXPORT Standard_Boolean SubstituteNode(
const Standard_Integer theIndex, const Standard_Integer theIndex,
const BRepMesh_Vertex& theNewNode); const BRepMesh_Vertex& theNewNode);
//! Removes node from the mesh in case if it has no connected links //! Removes node from the mesh in case if it has no connected links
//! and its type is Free. //! and its type is Free.
//! \param theIndex index of node to be removed. //! @param theIndex index of node to be removed.
//! \param isForce if TRUE node will be removed even if movability //! @param isForce if TRUE node will be removed even if movability
//! is not Free. //! is not Free.
Standard_EXPORT void RemoveNode(const Standard_Integer theIndex, Standard_EXPORT void RemoveNode(const Standard_Integer theIndex,
const Standard_Boolean isForce = Standard_False) 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. //! Get list of links attached to the node with the given index.
//! \param theIndex index of node whose links should be retrieved. //! @param theIndex index of node whose links should be retrieved.
//! \return list of links attached to the node. //! @return list of links attached to the node.
inline const BRepMeshCol::ListOfInteger& LinksConnectedTo( inline const BRepMesh::ListOfInteger& LinksConnectedTo(
const Standard_Integer theIndex) const const Standard_Integer theIndex) const
{ {
return myNodes.FindFromIndex(theIndex); 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. //! Returns number of links.
inline Standard_Integer NbLinks() const 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. //! Adds link to the mesh if it is not already in the mesh.
//! \param theLink link to be added to the mesh. //! @param theLink link to be added to the mesh.
//! \return index of the link in the structure. //! @return index of the link in the structure.
Standard_EXPORT Standard_Integer AddLink(const BRepMesh_Edge& theLink); Standard_EXPORT Standard_Integer AddLink(const BRepMesh_Edge& theLink);
//! Finds the index of the given link. //! Finds the index of the given link.
//! \param theLink link to find. //! @param theLink link to find.
//! \return index of the given element of zero if link is not in the mesh. //! @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 Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Edge& theLink) const
{ {
return myLinks.FindIndex(theLink); return myLinks.FindIndex(theLink);
} }
//! Get link by the index. //! Get link by the index.
//! \param theIndex index of a link. //! @param theIndex index of a link.
//! \return link with the given index. //! @return link with the given index.
Standard_EXPORT const BRepMesh_Edge& GetLink(const Standard_Integer theIndex) Standard_EXPORT const BRepMesh_Edge& GetLink(const Standard_Integer theIndex)
{ {
return myLinks.FindKey(theIndex); return myLinks.FindKey(theIndex);
} }
//! Returns map of indices of links registered in mesh. //! Returns map of indices of links registered in mesh.
inline const BRepMeshCol::MapOfInteger& LinksOfDomain() const inline const BRepMesh::MapOfInteger& LinksOfDomain() const
{ {
return myLinksOfDomain; return myLinksOfDomain;
} }
//! Substitutes the link with the given index by new one. //! Substitutes the link with the given index by new one.
//! \param theIndex index of link to be substituted. //! @param theIndex index of link to be substituted.
//! \param theNewLink substituting link. //! @param theNewLink substituting link.
//! \return FALSE in case if new link is already in the structure, TRUE elsewhere. //! @return FALSE in case if new link is already in the structure, TRUE elsewhere.
Standard_EXPORT Standard_Boolean SubstituteLink(const Standard_Integer theIndex, Standard_EXPORT Standard_Boolean SubstituteLink(const Standard_Integer theIndex,
const BRepMesh_Edge& theNewLink); const BRepMesh_Edge& theNewLink);
//! Removes link from the mesh in case if it has no connected elements //! Removes link from the mesh in case if it has no connected elements
//! and its type is Free. //! and its type is Free.
//! \param theIndex index of link to be removed. //! @param theIndex index of link to be removed.
//! \param isForce if TRUE link will be removed even if movability //! @param isForce if TRUE link will be removed even if movability
//! is not Free. //! is not Free.
Standard_EXPORT void RemoveLink(const Standard_Integer theIndex, Standard_EXPORT void RemoveLink(const Standard_Integer theIndex,
const Standard_Boolean isForce = Standard_False); const Standard_Boolean isForce = Standard_False);
//! Returns indices of elements conected to the link with the given index. //! Returns indices of elements conected to the link with the given index.
//! \param theLinkIndex index of link whose data should be retrieved. //! @param theLinkIndex index of link whose data should be retrieved.
//! \return indices of elements conected to the link. //! @return indices of elements conected to the link.
Standard_EXPORT const BRepMesh_PairOfIndex& ElementsConnectedTo( Standard_EXPORT const BRepMesh_PairOfIndex& ElementsConnectedTo(
const Standard_Integer theLinkIndex) const 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. //! Returns number of links.
inline Standard_Integer NbElements() const 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. //! Adds element to the mesh if it is not already in the mesh.
//! \param theElement element to be added to the mesh. //! @param theElement element to be added to the mesh.
//! \return index of the element in the structure. //! @return index of the element in the structure.
Standard_EXPORT Standard_Integer AddElement(const BRepMesh_Triangle& theElement); Standard_EXPORT Standard_Integer AddElement(const BRepMesh_Triangle& theElement);
//! Finds the index of the given element. //! Finds the index of the given element.
//! \param theElement element to find. //! @param theElement element to find.
//! \return index of the given element of zero if element is not in the mesh. //! @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 Standard_EXPORT Standard_Integer IndexOf(const BRepMesh_Triangle& theElement) const
{ {
return myElements.FindIndex(theElement); return myElements.FindIndex(theElement);
} }
//! Get element by the index. //! Get element by the index.
//! \param theIndex index of an element. //! @param theIndex index of an element.
//! \return element with the given index. //! @return element with the given index.
Standard_EXPORT const BRepMesh_Triangle& GetElement(const Standard_Integer theIndex) Standard_EXPORT const BRepMesh_Triangle& GetElement(const Standard_Integer theIndex)
{ {
return myElements.FindKey(theIndex); return myElements.FindKey(theIndex);
} }
//! Returns map of indices of elements registered in mesh. //! Returns map of indices of elements registered in mesh.
inline const BRepMeshCol::MapOfInteger& ElementsOfDomain() const inline const BRepMesh::MapOfInteger& ElementsOfDomain() const
{ {
return myElementsOfDomain; return myElementsOfDomain;
} }
//! Substitutes the element with the given index by new one. //! Substitutes the element with the given index by new one.
//! \param theIndex index of element to be substituted. //! @param theIndex index of element to be substituted.
//! \param theNewLink substituting element. //! @param theNewLink substituting element.
//! \return FALSE in case if new element is already in the structure, TRUE elsewhere. //! @return FALSE in case if new element is already in the structure, TRUE elsewhere.
Standard_EXPORT Standard_Boolean SubstituteElement(const Standard_Integer theIndex, Standard_EXPORT Standard_Boolean SubstituteElement(const Standard_Integer theIndex,
const BRepMesh_Triangle& theNewElement); const BRepMesh_Triangle& theNewElement);
//! Removes element from the mesh. //! 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); Standard_EXPORT void RemoveElement(const Standard_Integer theIndex);
//! Returns indices of nodes forming the given element. //! Returns indices of nodes forming the given element.
//! \param theElement element which nodes should be retrieved. //! @param theElement element which nodes should be retrieved.
//! \param[out] theNodes nodes of the given element. //! @param[out] theNodes nodes of the given element.
Standard_EXPORT void ElementNodes( Standard_EXPORT void ElementNodes(
const BRepMesh_Triangle& theElement, const BRepMesh_Triangle& theElement,
Standard_Integer (&theNodes)[3]); Standard_Integer (&theNodes)[3]);
public: //! \name Auxilary API public: //! @name Auxilary API
//! Dumps information about this structure. //! 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; Standard_EXPORT void Statistics(Standard_OStream& theStream) const;
//! Returns memory allocator used by the structure. //! Returns memory allocator used by the structure.
inline const BRepMeshCol::Allocator& Allocator() const inline const Handle(NCollection_IncAllocator)& Allocator() const
{ {
return myAllocator; return myAllocator;
} }
@ -283,35 +283,35 @@ private:
Standard_EXPORT void clearDeletedNodes(); Standard_EXPORT void clearDeletedNodes();
//! Cleans dependent structures from the given link. //! Cleans dependent structures from the given link.
//! \param theIndex index of link in the data structure. //! @param theIndex index of link in the data structure.
//! \param theLink reference to the link to avoid double accessing //! @param theLink reference to the link to avoid double accessing
//! to map of links. //! to map of links.
void cleanLink(const Standard_Integer theIndex, void cleanLink(const Standard_Integer theIndex,
const BRepMesh_Edge& theLink); const BRepMesh_Edge& theLink);
//! Cleans dependent structures from the given element. //! Cleans dependent structures from the given element.
//! \param theIndex index of element in the data structure. //! @param theIndex index of element in the data structure.
//! \param theElement reference to the element to avoid double accessing //! @param theElement reference to the element to avoid double accessing
//! to map of elements. //! to map of elements.
void cleanElement(const Standard_Integer theIndex, void cleanElement(const Standard_Integer theIndex,
const BRepMesh_Triangle& theElement); const BRepMesh_Triangle& theElement);
//! Removes element index from the given pair. Used by cleanElement. //! Removes element index from the given pair. Used by cleanElement.
//! \param theIndex index of element to be removed. //! @param theIndex index of element to be removed.
//! \param thePair pair of elements to be cleaned. //! @param thePair pair of elements to be cleaned.
void removeElementIndex(const Standard_Integer theIndex, void removeElementIndex(const Standard_Integer theIndex,
BRepMesh_PairOfIndex& thePair); BRepMesh_PairOfIndex& thePair);
private: private:
BRepMesh_VertexTool myNodes; BRepMesh_VertexTool myNodes;
BRepMeshCol::IDMapOfLink myLinks; BRepMesh::IDMapOfLink myLinks;
BRepMeshCol::ListOfInteger myDelLinks; BRepMesh::ListOfInteger myDelLinks;
BRepMeshCol::IMapOfElement myElements; BRepMesh::IMapOfElement myElements;
BRepMeshCol::MapOfInteger myElementsOfDomain; BRepMesh::MapOfInteger myElementsOfDomain;
BRepMeshCol::MapOfInteger myLinksOfDomain; BRepMesh::MapOfInteger myLinksOfDomain;
BRepMeshCol::Allocator myAllocator; Handle(NCollection_IncAllocator) myAllocator;
}; };
DEFINE_STANDARD_HANDLE(BRepMesh_DataStructureOfDelaun,Standard_Transient) DEFINE_STANDARD_HANDLE(BRepMesh_DataStructureOfDelaun,Standard_Transient)

View File

@ -76,7 +76,7 @@ namespace {
//purpose : Creates the triangulation with an empty Mesh data structure //purpose : Creates the triangulation with an empty Mesh data structure
//======================================================================= //=======================================================================
BRepMesh_Delaun::BRepMesh_Delaun( BRepMesh_Delaun::BRepMesh_Delaun(
BRepMeshCol::Array1OfVertexOfDelaun& theVertices) BRepMesh::Array1OfVertexOfDelaun& theVertices)
: myCircles( theVertices.Length(), new NCollection_IncAllocator() ) : myCircles( theVertices.Length(), new NCollection_IncAllocator() )
{ {
if ( theVertices.Length() > 2 ) if ( theVertices.Length() > 2 )
@ -93,7 +93,7 @@ BRepMesh_Delaun::BRepMesh_Delaun(
//======================================================================= //=======================================================================
BRepMesh_Delaun::BRepMesh_Delaun( BRepMesh_Delaun::BRepMesh_Delaun(
const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh, const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh,
BRepMeshCol::Array1OfVertexOfDelaun& theVertices) BRepMesh::Array1OfVertexOfDelaun& theVertices)
: myCircles( theVertices.Length(), theOldMesh->Allocator() ) : myCircles( theVertices.Length(), theOldMesh->Allocator() )
{ {
myMeshData = theOldMesh; myMeshData = theOldMesh;
@ -107,7 +107,7 @@ BRepMesh_Delaun::BRepMesh_Delaun(
//======================================================================= //=======================================================================
BRepMesh_Delaun::BRepMesh_Delaun( BRepMesh_Delaun::BRepMesh_Delaun(
const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh, const Handle( BRepMesh_DataStructureOfDelaun )& theOldMesh,
BRepMeshCol::Array1OfInteger& theVertexIndices) BRepMesh::Array1OfInteger& theVertexIndices)
: myCircles( theVertexIndices.Length(), theOldMesh->Allocator() ) : myCircles( theVertexIndices.Length(), theOldMesh->Allocator() )
{ {
myMeshData = theOldMesh; myMeshData = theOldMesh;
@ -127,12 +127,12 @@ BRepMesh_Delaun::BRepMesh_Delaun(
//function : Init //function : Init
//purpose : Initializes the triangulation with an Array of Vertex //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; Bnd_Box2d aBox;
Standard_Integer aLowerIdx = theVertices.Lower(); Standard_Integer aLowerIdx = theVertices.Lower();
Standard_Integer anUpperIdx = theVertices.Upper(); Standard_Integer anUpperIdx = theVertices.Upper();
BRepMeshCol::Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx ); BRepMesh::Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx );
Standard_Integer anIndex = aLowerIdx; Standard_Integer anIndex = aLowerIdx;
for ( ; anIndex <= anUpperIdx; ++anIndex ) for ( ; anIndex <= anUpperIdx; ++anIndex )
@ -148,8 +148,8 @@ void BRepMesh_Delaun::Init( BRepMeshCol::Array1OfVertexOfDelaun& theVertices )
//function : perform //function : perform
//purpose : Create super mesh and run triangulation procedure //purpose : Create super mesh and run triangulation procedure
//======================================================================= //=======================================================================
void BRepMesh_Delaun::perform( Bnd_Box2d& theBndBox, void BRepMesh_Delaun::perform(Bnd_Box2d& theBndBox,
BRepMeshCol::Array1OfInteger& theVertexIndexes ) BRepMesh::Array1OfInteger& theVertexIndexes)
{ {
theBndBox.Enlarge( Precision ); theBndBox.Enlarge( Precision );
superMesh( theBndBox ); superMesh( theBndBox );
@ -218,8 +218,8 @@ void BRepMesh_Delaun::superMesh( const Bnd_Box2d& theBox )
// edges into the map. // edges into the map.
// When an edge is suppressed more than one time it is destroyed. // When an edge is suppressed more than one time it is destroyed.
//======================================================================= //=======================================================================
void BRepMesh_Delaun::deleteTriangle( const Standard_Integer theIndex, void BRepMesh_Delaun::deleteTriangle(const Standard_Integer theIndex,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) BRepMesh::MapOfIntegerInteger& theLoopEdges )
{ {
myCircles.Delete( theIndex ); 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 //purpose : Computes the triangulation and add the vertices edges and
// triangles to the Mesh data structure // 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: // 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_Integer e[3];
Standard_Boolean o[3]; Standard_Boolean o[3];
mySupTrian.Edges( e, o ); mySupTrian.Edges( e, o );
@ -272,13 +272,13 @@ void BRepMesh_Delaun::compute( BRepMeshCol::Array1OfInteger& theVertexIndexes )
aSelector.NeighboursOfNode( mySupVert[aSupVertId] ); aSelector.NeighboursOfNode( mySupVert[aSupVertId] );
aLoopEdges.Clear(); aLoopEdges.Clear();
BRepMeshCol::MapOfInteger::Iterator aFreeTriangles( aSelector.Elements() ); BRepMesh::MapOfInteger::Iterator aFreeTriangles( aSelector.Elements() );
for ( ; aFreeTriangles.More(); aFreeTriangles.Next() ) for ( ; aFreeTriangles.More(); aFreeTriangles.Next() )
deleteTriangle( aFreeTriangles.Key(), aLoopEdges ); deleteTriangle( aFreeTriangles.Key(), aLoopEdges );
// All edges that remain free are removed from aLoopEdges; // All edges that remain free are removed from aLoopEdges;
// only the boundary edges of the triangulation remain there // only the boundary edges of the triangulation remain there
BRepMeshCol::MapOfIntegerInteger::Iterator aFreeEdges( aLoopEdges ); BRepMesh::MapOfIntegerInteger::Iterator aFreeEdges( aLoopEdges );
for ( ; aFreeEdges.More(); aFreeEdges.Next() ) for ( ; aFreeEdges.More(); aFreeEdges.Next() )
{ {
if ( myMeshData->ElementsConnectedTo( aFreeEdges.Key() ).IsEmpty() ) if ( myMeshData->ElementsConnectedTo( aFreeEdges.Key() ).IsEmpty() )
@ -294,13 +294,13 @@ void BRepMesh_Delaun::compute( BRepMeshCol::Array1OfInteger& theVertexIndexes )
//function : createTriangles //function : createTriangles
//purpose : Creates the triangles beetween the node and the polyline. //purpose : Creates the triangles beetween the node and the polyline.
//======================================================================= //=======================================================================
void BRepMesh_Delaun::createTriangles ( const Standard_Integer theVertexIndex, void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexIndex,
BRepMeshCol::MapOfIntegerInteger& thePoly ) BRepMesh::MapOfIntegerInteger& thePoly)
{ {
BRepMeshCol::ListOfInteger aLoopEdges, anExternalEdges; BRepMesh::ListOfInteger aLoopEdges, anExternalEdges;
const gp_XY& aVertexCoord = myMeshData->GetNode( theVertexIndex ).Coord(); const gp_XY& aVertexCoord = myMeshData->GetNode( theVertexIndex ).Coord();
BRepMeshCol::MapOfIntegerInteger::Iterator anEdges( thePoly ); BRepMesh::MapOfIntegerInteger::Iterator anEdges( thePoly );
for ( ; anEdges.More(); anEdges.Next() ) for ( ; anEdges.More(); anEdges.Next() )
{ {
Standard_Integer anEdgeId = anEdges.Key(); Standard_Integer anEdgeId = anEdges.Key();
@ -415,9 +415,10 @@ void BRepMesh_Delaun::createTriangles ( const Standard_Integer theVer
//function : createTrianglesOnNewVertices //function : createTrianglesOnNewVertices
//purpose : Creation of triangles from the new nodes //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 : // Insertion of nodes :
Standard_Boolean isModify = Standard_True; Standard_Boolean isModify = Standard_True;
@ -432,10 +433,10 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger
const BRepMesh_Vertex& aVertex = GetVertex( aVertexIdx ); const BRepMesh_Vertex& aVertex = GetVertex( aVertexIdx );
// Iterator in the list of indexes of circles containing the node // 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; Standard_Integer onEgdeId = 0, aTriangleId = 0;
BRepMeshCol::ListOfInteger::Iterator aCircleIt( aCirclesList ); BRepMesh::ListOfInteger::Iterator aCircleIt( aCirclesList );
for ( ; aCircleIt.More(); aCircleIt.Next() ) for ( ; aCircleIt.More(); aCircleIt.Next() )
{ {
// To add a node in the mesh it is necessary to check conditions: // 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() ) while ( isModify && !aCirclesList.IsEmpty() )
{ {
isModify = Standard_False; isModify = Standard_False;
BRepMeshCol::ListOfInteger::Iterator aCircleIt1( aCirclesList ); BRepMesh::ListOfInteger::Iterator aCircleIt1( aCirclesList );
for ( ; aCircleIt1.More(); aCircleIt1.Next() ) for ( ; aCircleIt1.More(); aCircleIt1.Next() )
{ {
Standard_Integer e[3]; Standard_Integer e[3];
@ -491,11 +492,11 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices( BRepMeshCol::Array1OfInteger
} }
} }
// Check that internal edges are not crossed by triangles // Check that internal edges are not crossed by triangles
BRepMeshCol::HMapOfInteger anInternalEdges = InternalEdges(); BRepMesh::HMapOfInteger anInternalEdges = InternalEdges();
// Destruction of triancles intersecting internal edges // Destruction of triancles intersecting internal edges
// and their replacement by makeshift triangles // and their replacement by makeshift triangles
BRepMeshCol::MapOfInteger::Iterator anInernalEdgesIt( *anInternalEdges ); BRepMesh::MapOfInteger::Iterator anInernalEdgesIt( *anInternalEdges );
for ( ; anInernalEdgesIt.More(); anInernalEdgesIt.Next() ) for ( ; anInernalEdgesIt.More(); anInernalEdgesIt.Next() )
{ {
Standard_Integer aNbC; Standard_Integer aNbC;
@ -575,11 +576,11 @@ void BRepMesh_Delaun::cleanupMesh()
{ {
for(;;) for(;;)
{ {
BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
BRepMeshCol::MapOfInteger aDelTriangles; BRepMesh::MapOfInteger aDelTriangles;
BRepMeshCol::HMapOfInteger aFreeEdges = FreeEdges(); BRepMesh::HMapOfInteger aFreeEdges = FreeEdges();
BRepMeshCol::MapOfInteger::Iterator aFreeEdgesIt( *aFreeEdges ); BRepMesh::MapOfInteger::Iterator aFreeEdgesIt( *aFreeEdges );
for ( ; aFreeEdgesIt.More(); aFreeEdgesIt.Next() ) for ( ; aFreeEdgesIt.More(); aFreeEdgesIt.Next() )
{ {
const Standard_Integer& aFreeEdgeId = aFreeEdgesIt.Key(); const Standard_Integer& aFreeEdgeId = aFreeEdgesIt.Key();
@ -641,7 +642,7 @@ void BRepMesh_Delaun::cleanupMesh()
// Destruction of triangles : // Destruction of triangles :
Standard_Integer aDeletedTrianglesNb = 0; Standard_Integer aDeletedTrianglesNb = 0;
BRepMeshCol::MapOfInteger::Iterator aDelTrianglesIt( aDelTriangles ); BRepMesh::MapOfInteger::Iterator aDelTrianglesIt( aDelTriangles );
for ( ; aDelTrianglesIt.More(); aDelTrianglesIt.Next() ) for ( ; aDelTrianglesIt.More(); aDelTrianglesIt.Next() )
{ {
deleteTriangle( aDelTrianglesIt.Key(), aLoopEdges ); deleteTriangle( aDelTrianglesIt.Key(), aLoopEdges );
@ -649,7 +650,7 @@ void BRepMesh_Delaun::cleanupMesh()
} }
// Destruction of remaining hanging edges // Destruction of remaining hanging edges
BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() ) for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() )
{ {
if ( myMeshData->ElementsConnectedTo( aLoopEdgesIt.Key() ).IsEmpty() ) if ( myMeshData->ElementsConnectedTo( aLoopEdgesIt.Key() ).IsEmpty() )
@ -667,17 +668,17 @@ void BRepMesh_Delaun::cleanupMesh()
//======================================================================= //=======================================================================
void BRepMesh_Delaun::frontierAdjust() void BRepMesh_Delaun::frontierAdjust()
{ {
BRepMeshCol::HMapOfInteger aFrontier = Frontier(); BRepMesh::HMapOfInteger aFrontier = Frontier();
BRepMeshCol::VectorOfInteger aFailedFrontiers; BRepMesh::VectorOfInteger aFailedFrontiers;
BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
BRepMeshCol::HMapOfInteger aIntFrontierEdges = new BRepMeshCol::MapOfInteger; BRepMesh::HMapOfInteger aIntFrontierEdges = new BRepMesh::MapOfInteger;
for ( Standard_Integer aPass = 1; aPass <= 2; ++aPass ) for ( Standard_Integer aPass = 1; aPass <= 2; ++aPass )
{ {
// 1 pass): find external triangles on boundary edges; // 1 pass): find external triangles on boundary edges;
// 2 pass): find external triangles on boundary edges appeared // 2 pass): find external triangles on boundary edges appeared
// during triangles replacement. // during triangles replacement.
BRepMeshCol::MapOfInteger::Iterator aFrontierIt( *aFrontier ); BRepMesh::MapOfInteger::Iterator aFrontierIt( *aFrontier );
for ( ; aFrontierIt.More(); aFrontierIt.Next() ) for ( ; aFrontierIt.More(); aFrontierIt.Next() )
{ {
Standard_Integer aFrontierId = aFrontierIt.Key(); Standard_Integer aFrontierId = aFrontierIt.Key();
@ -711,7 +712,7 @@ void BRepMesh_Delaun::frontierAdjust()
} }
// destrucrion of remaining hanging edges : // destrucrion of remaining hanging edges :
BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() ) for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() )
{ {
Standard_Integer aLoopEdgeId = aLoopEdgesIt.Key(); 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 // situation when frontier edge has a triangle at a right side, but its free
// links cross another frontieres and meshLeftPolygonOf itself can't collect // links cross another frontieres and meshLeftPolygonOf itself can't collect
// a closed polygon. // a closed polygon.
BRepMeshCol::VectorOfInteger::Iterator aFailedFrontiersIt( aFailedFrontiers ); BRepMesh::VectorOfInteger::Iterator aFailedFrontiersIt( aFailedFrontiers );
for ( ; aFailedFrontiersIt.More(); aFailedFrontiersIt.Next() ) for ( ; aFailedFrontiersIt.More(); aFailedFrontiersIt.Next() )
{ {
Standard_Integer aFrontierId = aFailedFrontiersIt.Value(); 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 //purpose : Add boundig box for edge defined by start & end point to
// the given vector of bounding boxes for triangulation edges // the given vector of bounding boxes for triangulation edges
//======================================================================= //=======================================================================
void BRepMesh_Delaun::fillBndBox( BRepMeshCol::SequenceOfBndB2d& theBoxes, void BRepMesh_Delaun::fillBndBox(BRepMesh::SequenceOfBndB2d& theBoxes,
const BRepMesh_Vertex& theV1, const BRepMesh_Vertex& theV1,
const BRepMesh_Vertex& theV2 ) const BRepMesh_Vertex& theV2)
{ {
Bnd_B2d aBox; Bnd_B2d aBox;
aBox.Add( theV1.Coord() ); 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) //purpose : Collect the polygon at the left of the given edge (material side)
//======================================================================= //=======================================================================
Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf( Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(
const Standard_Integer theStartEdgeId, const Standard_Integer theStartEdgeId,
const Standard_Boolean isForward, const Standard_Boolean isForward,
BRepMeshCol::HMapOfInteger theSkipped ) BRepMesh::HMapOfInteger theSkipped )
{ {
if ( !theSkipped.IsNull() && theSkipped->Contains( theStartEdgeId ) ) if ( !theSkipped.IsNull() && theSkipped->Contains( theStartEdgeId ) )
return Standard_True; return Standard_True;
const BRepMesh_Edge& aRefEdge = GetEdge( theStartEdgeId ); const BRepMesh_Edge& aRefEdge = GetEdge( theStartEdgeId );
BRepMeshCol::SequenceOfInteger aPolygon; BRepMesh::SequenceOfInteger aPolygon;
Standard_Integer aStartNode, aPivotNode; Standard_Integer aStartNode, aPivotNode;
if ( isForward ) if ( isForward )
{ {
@ -810,14 +811,14 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(
// Auxilary structures. // Auxilary structures.
// Bounding boxes of polygon links to be used for preliminary // Bounding boxes of polygon links to be used for preliminary
// analysis of intersections // analysis of intersections
BRepMeshCol::SequenceOfBndB2d aBoxes; BRepMesh::SequenceOfBndB2d aBoxes;
fillBndBox( aBoxes, aStartEdgeVertexS, aPivotVertex ); fillBndBox( aBoxes, aStartEdgeVertexS, aPivotVertex );
// Hanging ends // Hanging ends
BRepMeshCol::MapOfInteger aDeadLinks; BRepMesh::MapOfInteger aDeadLinks;
// Links are temporarily excluded from consideration // Links are temporarily excluded from consideration
BRepMeshCol::MapOfInteger aLeprousLinks; BRepMesh::MapOfInteger aLeprousLinks;
aLeprousLinks.Add( theStartEdgeId ); aLeprousLinks.Add( theStartEdgeId );
Standard_Boolean isSkipLeprous = Standard_True; Standard_Boolean isSkipLeprous = Standard_True;
@ -902,26 +903,26 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(
// consideration next time until a hanging end is occured. // consideration next time until a hanging end is occured.
//======================================================================= //=======================================================================
Standard_Integer BRepMesh_Delaun::findNextPolygonLink( Standard_Integer BRepMesh_Delaun::findNextPolygonLink(
const Standard_Integer& theFirstNode, const Standard_Integer& theFirstNode,
const Standard_Integer& thePivotNode, const Standard_Integer& thePivotNode,
const BRepMesh_Vertex& thePivotVertex, const BRepMesh_Vertex& thePivotVertex,
const gp_Vec2d& theRefLinkDir, const gp_Vec2d& theRefLinkDir,
const BRepMeshCol::SequenceOfBndB2d& theBoxes, const BRepMesh::SequenceOfBndB2d& theBoxes,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::HMapOfInteger theSkipped, const BRepMesh::HMapOfInteger theSkipped,
const Standard_Boolean& isSkipLeprous, const Standard_Boolean& isSkipLeprous,
BRepMeshCol::MapOfInteger& theLeprousLinks, BRepMesh::MapOfInteger& theLeprousLinks,
BRepMeshCol::MapOfInteger& theDeadLinks, BRepMesh::MapOfInteger& theDeadLinks,
Standard_Integer& theNextPivotNode, Standard_Integer& theNextPivotNode,
gp_Vec2d& theNextLinkDir, gp_Vec2d& theNextLinkDir,
Bnd_B2d& theNextLinkBndBox ) Bnd_B2d& theNextLinkBndBox )
{ {
// Find the next link having the greatest angle // Find the next link having the greatest angle
// respect to a direction of a reference one // respect to a direction of a reference one
Standard_Real aMaxAngle = RealFirst(); Standard_Real aMaxAngle = RealFirst();
Standard_Integer aNextLinkId = 0; Standard_Integer aNextLinkId = 0;
BRepMeshCol::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( thePivotNode ) ); BRepMesh::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( thePivotNode ) );
for ( ; aLinkIt.More(); aLinkIt.Next() ) for ( ; aLinkIt.More(); aLinkIt.Next() )
{ {
const Standard_Integer& aNeighbourLinkInfo = aLinkIt.Value(); const Standard_Integer& aNeighbourLinkInfo = aLinkIt.Value();
@ -1011,13 +1012,13 @@ Standard_Integer BRepMesh_Delaun::findNextPolygonLink(
// <theLinkBndBox> parameter. // <theLinkBndBox> parameter.
//======================================================================= //=======================================================================
Standard_Boolean BRepMesh_Delaun::checkIntersection( Standard_Boolean BRepMesh_Delaun::checkIntersection(
const BRepMesh_Edge& theLink, const BRepMesh_Edge& theLink,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, const BRepMesh::SequenceOfBndB2d& thePolyBoxes,
const Standard_Boolean isConsiderEndPointTouch, const Standard_Boolean isConsiderEndPointTouch,
const Standard_Boolean isConsiderPointOnEdge, const Standard_Boolean isConsiderPointOnEdge,
const Standard_Boolean isSkipLastEdge, const Standard_Boolean isSkipLastEdge,
Bnd_B2d& theLinkBndBox ) const Bnd_B2d& theLinkBndBox ) const
{ {
theLinkBndBox.Add( GetVertex( theLink.FirstNode() ).Coord() ); theLinkBndBox.Add( GetVertex( theLink.FirstNode() ).Coord() );
theLinkBndBox.Add( GetVertex( theLink.LastNode() ).Coord() ); theLinkBndBox.Add( GetVertex( theLink.LastNode() ).Coord() );
@ -1081,17 +1082,17 @@ inline void BRepMesh_Delaun::addTriangle( const Standard_Integer (&theEdgesId)[3
//function : cleanupPolygon //function : cleanupPolygon
//purpose : Remove internal triangles from the given polygon //purpose : Remove internal triangles from the given polygon
//======================================================================= //=======================================================================
void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& thePolygon, void BRepMesh_Delaun::cleanupPolygon(const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes ) const BRepMesh::SequenceOfBndB2d& thePolyBoxes )
{ {
Standard_Integer aPolyLen = thePolygon.Length(); Standard_Integer aPolyLen = thePolygon.Length();
if ( aPolyLen < 3 ) if ( aPolyLen < 3 )
return; return;
BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
BRepMeshCol::MapOfInteger anIgnoredEdges; BRepMesh::MapOfInteger anIgnoredEdges;
BRepMeshCol::MapOfInteger aPolyVerticesFindMap; BRepMesh::MapOfInteger aPolyVerticesFindMap;
BRepMeshCol::VectorOfInteger aPolyVertices; BRepMesh::VectorOfInteger aPolyVertices;
// Collect boundary vertices of the polygon // Collect boundary vertices of the polygon
for ( Standard_Integer aPolyIt = 1; aPolyIt <= aPolyLen; ++aPolyIt ) 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() ) if ( aPolyVertices.First() != aPolyVertices.Last() )
aPolyVertices.Append( aPolyVertices.First() ); aPolyVertices.Append( aPolyVertices.First() );
BRepMeshCol::MapOfInteger aSurvivedLinks( anIgnoredEdges ); BRepMesh::MapOfInteger aSurvivedLinks( anIgnoredEdges );
Standard_Integer aPolyVertIt = 0; Standard_Integer aPolyVertIt = 0;
Standard_Integer anUniqueVerticesNum = aPolyVertices.Length() - 1; Standard_Integer anUniqueVerticesNum = aPolyVertices.Length() - 1;
@ -1168,7 +1169,7 @@ void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& theP
thePolyBoxes, aSurvivedLinks, aLoopEdges ); thePolyBoxes, aSurvivedLinks, aLoopEdges );
} }
BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() ) for ( ; aLoopEdgesIt.More(); aLoopEdgesIt.Next() )
{ {
const Standard_Integer& aLoopEdgeId = aLoopEdgesIt.Key(); const Standard_Integer& aLoopEdgeId = aLoopEdgesIt.Key();
@ -1186,19 +1187,19 @@ void BRepMesh_Delaun::cleanupPolygon( const BRepMeshCol::SequenceOfInteger& theP
// inside the polygon or crossed it. // inside the polygon or crossed it.
//======================================================================= //=======================================================================
void BRepMesh_Delaun::killTrianglesAroundVertex( void BRepMesh_Delaun::killTrianglesAroundVertex(
const Standard_Integer theZombieNodeId, const Standard_Integer theZombieNodeId,
const BRepMeshCol::VectorOfInteger& thePolyVertices, const BRepMesh::VectorOfInteger& thePolyVertices,
const BRepMeshCol::MapOfInteger& thePolyVerticesFindMap, const BRepMesh::MapOfInteger& thePolyVerticesFindMap,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, const BRepMesh::SequenceOfBndB2d& thePolyBoxes,
BRepMeshCol::MapOfInteger& theSurvivedLinks, BRepMesh::MapOfInteger& theSurvivedLinks,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) BRepMesh::MapOfIntegerInteger& theLoopEdges )
{ {
BRepMeshCol::ListOfInteger::Iterator aNeighborsIt = BRepMesh::ListOfInteger::Iterator aNeighborsIt =
myMeshData->LinksConnectedTo( theZombieNodeId ); myMeshData->LinksConnectedTo( theZombieNodeId );
// Try to infect neighbor nodes // Try to infect neighbor nodes
BRepMeshCol::VectorOfInteger aVictimNodes; BRepMesh::VectorOfInteger aVictimNodes;
for ( ; aNeighborsIt.More(); aNeighborsIt.Next() ) for ( ; aNeighborsIt.More(); aNeighborsIt.Next() )
{ {
const Standard_Integer& aNeighborLinkId = aNeighborsIt.Value(); const Standard_Integer& aNeighborLinkId = aNeighborsIt.Value();
@ -1256,7 +1257,7 @@ void BRepMesh_Delaun::killTrianglesAroundVertex(
} }
// Go and do your job! // Go and do your job!
BRepMeshCol::VectorOfInteger::Iterator aVictimIt( aVictimNodes ); BRepMesh::VectorOfInteger::Iterator aVictimIt( aVictimNodes );
for ( ; aVictimIt.More(); aVictimIt.Next() ) for ( ; aVictimIt.More(); aVictimIt.Next() )
{ {
killTrianglesAroundVertex( aVictimIt.Value(), thePolyVertices, killTrianglesAroundVertex( aVictimIt.Value(), thePolyVertices,
@ -1270,8 +1271,8 @@ void BRepMesh_Delaun::killTrianglesAroundVertex(
//purpose : Checks is the given vertex lies inside the polygon //purpose : Checks is the given vertex lies inside the polygon
//======================================================================= //=======================================================================
Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon( Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon(
const Standard_Integer& theVertexId, const Standard_Integer& theVertexId,
const BRepMeshCol::VectorOfInteger& thePolygonVertices ) const const BRepMesh::VectorOfInteger& thePolygonVertices ) const
{ {
Standard_Integer aPolyLen = thePolygonVertices.Length(); Standard_Integer aPolyLen = thePolygonVertices.Length();
if ( aPolyLen < 3 ) if ( aPolyLen < 3 )
@ -1311,13 +1312,13 @@ Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon(
// boundary intersection. Does nothing elsewhere. // boundary intersection. Does nothing elsewhere.
//======================================================================= //=======================================================================
void BRepMesh_Delaun::killTrianglesOnIntersectingLinks( void BRepMesh_Delaun::killTrianglesOnIntersectingLinks(
const Standard_Integer& theLinkToCheckId, const Standard_Integer& theLinkToCheckId,
const BRepMesh_Edge& theLinkToCheck, const BRepMesh_Edge& theLinkToCheck,
const Standard_Integer& theEndPoint, const Standard_Integer& theEndPoint,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, const BRepMesh::SequenceOfBndB2d& thePolyBoxes,
BRepMeshCol::MapOfInteger& theSurvivedLinks, BRepMesh::MapOfInteger& theSurvivedLinks,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) BRepMesh::MapOfIntegerInteger& theLoopEdges )
{ {
if ( theSurvivedLinks.Contains( theLinkToCheckId ) ) if ( theSurvivedLinks.Contains( theLinkToCheckId ) )
return; return;
@ -1335,7 +1336,7 @@ void BRepMesh_Delaun::killTrianglesOnIntersectingLinks(
killLinkTriangles( theLinkToCheckId, theLoopEdges ); killLinkTriangles( theLinkToCheckId, theLoopEdges );
BRepMeshCol::ListOfInteger::Iterator aNeighborsIt = BRepMesh::ListOfInteger::Iterator aNeighborsIt =
myMeshData->LinksConnectedTo( theEndPoint ); myMeshData->LinksConnectedTo( theEndPoint );
for ( ; aNeighborsIt.More(); aNeighborsIt.Next() ) for ( ; aNeighborsIt.More(); aNeighborsIt.Next() )
@ -1357,8 +1358,8 @@ void BRepMesh_Delaun::killTrianglesOnIntersectingLinks(
//purpose : Kill triangles bound to the given link. //purpose : Kill triangles bound to the given link.
//======================================================================= //=======================================================================
void BRepMesh_Delaun::killLinkTriangles( void BRepMesh_Delaun::killLinkTriangles(
const Standard_Integer& theLinkId, const Standard_Integer& theLinkId,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges ) BRepMesh::MapOfIntegerInteger& theLoopEdges )
{ {
const BRepMesh_PairOfIndex& aPair = const BRepMesh_PairOfIndex& aPair =
myMeshData->ElementsConnectedTo( theLinkId ); 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 //purpose : Processes loop within the given polygon formed by range of
// its links specified by start and end link indices. // its links specified by start and end link indices.
//======================================================================= //=======================================================================
void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkFrom, void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkFrom,
const Standard_Integer theLinkTo, const Standard_Integer theLinkTo,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes) const BRepMesh::SequenceOfBndB2d& thePolyBoxes)
{ {
Standard_Integer aNbOfLinksInLoop = theLinkTo - theLinkFrom - 1; Standard_Integer aNbOfLinksInLoop = theLinkTo - theLinkFrom - 1;
if ( aNbOfLinksInLoop < 3 ) if ( aNbOfLinksInLoop < 3 )
return; return;
BRepMeshCol::SequenceOfInteger aPolygon; BRepMesh::SequenceOfInteger aPolygon;
BRepMeshCol::SequenceOfBndB2d aPolyBoxes; BRepMesh::SequenceOfBndB2d aPolyBoxes;
for ( ; aNbOfLinksInLoop > 0; --aNbOfLinksInLoop ) for ( ; aNbOfLinksInLoop > 0; --aNbOfLinksInLoop )
{ {
Standard_Integer aLoopLinkIndex = theLinkFrom + aNbOfLinksInLoop; Standard_Integer aLoopLinkIndex = theLinkFrom + aNbOfLinksInLoop;
@ -1426,12 +1427,12 @@ void BRepMesh_Delaun::processLoop(const Standard_Integer theLinkF
// given polygon. // given polygon.
//======================================================================= //=======================================================================
Standard_Integer BRepMesh_Delaun::createAndReplacePolygonLink( Standard_Integer BRepMesh_Delaun::createAndReplacePolygonLink(
const Standard_Integer *theNodes, const Standard_Integer *theNodes,
const gp_Pnt2d *thePnts, const gp_Pnt2d *thePnts,
const Standard_Integer theRootIndex, const Standard_Integer theRootIndex,
const ReplaceFlag theReplaceFlag, const ReplaceFlag theReplaceFlag,
BRepMeshCol::SequenceOfInteger& thePolygon, BRepMesh::SequenceOfInteger& thePolygon,
BRepMeshCol::SequenceOfBndB2d& thePolyBoxes ) BRepMesh::SequenceOfBndB2d& thePolyBoxes )
{ {
Standard_Integer aNewEdgeId = Standard_Integer aNewEdgeId =
myMeshData->AddLink( BRepMesh_Edge( myMeshData->AddLink( BRepMesh_Edge(
@ -1466,9 +1467,9 @@ Standard_Integer BRepMesh_Delaun::createAndReplacePolygonLink(
//function : meshPolygon //function : meshPolygon
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_Delaun::meshPolygon( BRepMeshCol::SequenceOfInteger& thePolygon, void BRepMesh_Delaun::meshPolygon(BRepMesh::SequenceOfInteger& thePolygon,
BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, BRepMesh::SequenceOfBndB2d& thePolyBoxes,
BRepMeshCol::HMapOfInteger theSkipped ) BRepMesh::HMapOfInteger theSkipped )
{ {
// Check is the source polygon elementary // Check is the source polygon elementary
if ( meshElementaryPolygon( thePolygon ) ) if ( meshElementaryPolygon( thePolygon ) )
@ -1690,7 +1691,7 @@ void BRepMesh_Delaun::meshPolygon( BRepMeshCol::SequenceOfInteger& thePolygon,
//purpose : Triangulation of closed polygon containing only three edges. //purpose : Triangulation of closed polygon containing only three edges.
//======================================================================= //=======================================================================
inline Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon( inline Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon(
const BRepMeshCol::SequenceOfInteger& thePolygon ) const BRepMesh::SequenceOfInteger& thePolygon)
{ {
Standard_Integer aPolyLen = thePolygon.Length(); Standard_Integer aPolyLen = thePolygon.Length();
if ( aPolyLen < 3 ) if ( aPolyLen < 3 )
@ -1732,8 +1733,8 @@ inline Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon(
// its edges in the structure. // its edges in the structure.
// (negative index means reversed edge) // (negative index means reversed edge)
//======================================================================= //=======================================================================
void BRepMesh_Delaun::meshSimplePolygon( BRepMeshCol::SequenceOfInteger& thePolygon, void BRepMesh_Delaun::meshSimplePolygon(BRepMesh::SequenceOfInteger& thePolygon,
BRepMeshCol::SequenceOfBndB2d& thePolyBoxes ) BRepMesh::SequenceOfBndB2d& thePolyBoxes )
{ {
// Check is the given polygon elementary // Check is the given polygon elementary
if ( meshElementaryPolygon( thePolygon ) ) if ( meshElementaryPolygon( thePolygon ) )
@ -1874,11 +1875,11 @@ void BRepMesh_Delaun::meshSimplePolygon( BRepMeshCol::SequenceOfInteger& thePoly
// polygon. // polygon.
if ( aUsedLinkId < aPolyLen ) if ( aUsedLinkId < aPolyLen )
{ {
BRepMeshCol::SequenceOfInteger aRightPolygon; BRepMesh::SequenceOfInteger aRightPolygon;
thePolygon.Split( aUsedLinkId, aRightPolygon ); thePolygon.Split( aUsedLinkId, aRightPolygon );
aRightPolygon.Prepend( -aNewEdgesInfo[2] ); aRightPolygon.Prepend( -aNewEdgesInfo[2] );
BRepMeshCol::SequenceOfBndB2d aRightPolyBoxes; BRepMesh::SequenceOfBndB2d aRightPolyBoxes;
thePolyBoxes.Split( aUsedLinkId, aRightPolyBoxes ); thePolyBoxes.Split( aUsedLinkId, aRightPolyBoxes );
Bnd_B2d aBox; Bnd_B2d aBox;
@ -1917,17 +1918,17 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex )
BRepMesh_SelectorOfDataStructureOfDelaun aSelector( myMeshData ); BRepMesh_SelectorOfDataStructureOfDelaun aSelector( myMeshData );
aSelector.NeighboursOf( theVertex ); aSelector.NeighboursOf( theVertex );
BRepMeshCol::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() ); BRepMesh::MapOfIntegerInteger aLoopEdges( 10, myMeshData->Allocator() );
// Loop on triangles to be destroyed : // Loop on triangles to be destroyed :
BRepMeshCol::MapOfInteger::Iterator aTriangleIt( aSelector.Elements() ); BRepMesh::MapOfInteger::Iterator aTriangleIt( aSelector.Elements() );
for ( ; aTriangleIt.More(); aTriangleIt.Next() ) for ( ; aTriangleIt.More(); aTriangleIt.Next() )
deleteTriangle( aTriangleIt.Key(), aLoopEdges ); deleteTriangle( aTriangleIt.Key(), aLoopEdges );
BRepMeshCol::SequenceOfBndB2d aBoxes; BRepMesh::SequenceOfBndB2d aBoxes;
BRepMeshCol::SequenceOfInteger aPolygon; BRepMesh::SequenceOfInteger aPolygon;
Standard_Integer aLoopEdgesCount = aLoopEdges.Extent(); Standard_Integer aLoopEdgesCount = aLoopEdges.Extent();
BRepMeshCol::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges ); BRepMesh::MapOfIntegerInteger::Iterator aLoopEdgesIt( aLoopEdges );
if ( aLoopEdgesIt.More() ) if ( aLoopEdgesIt.More() )
{ {
@ -1957,7 +1958,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex )
aLastNode = aFirstNode; aLastNode = aFirstNode;
while ( aPivotNode != aLastNode ) while ( aPivotNode != aLastNode )
{ {
BRepMeshCol::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( aPivotNode ) ); BRepMesh::ListOfInteger::Iterator aLinkIt( myMeshData->LinksConnectedTo( aPivotNode ) );
for ( ; aLinkIt.More(); aLinkIt.Next() ) for ( ; aLinkIt.More(); aLinkIt.Next() )
{ {
if ( aLinkIt.Value() != anEdgeId && if ( aLinkIt.Value() != anEdgeId &&
@ -1998,7 +1999,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex )
//function : AddVertices //function : AddVertices
//purpose : Adds some vertices in the triangulation. //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::make_heap(theVertices.begin(), theVertices.end(), ComparatorOfVertexOfDelaun());
std::sort_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 aLower = theVertices.Lower();
Standard_Integer anUpper = theVertices.Upper(); Standard_Integer anUpper = theVertices.Upper();
BRepMeshCol::Array1OfInteger aVertexIndexes( aLower, anUpper ); BRepMesh::Array1OfInteger aVertexIndexes( aLower, anUpper );
for ( Standard_Integer i = aLower; i <= anUpper; ++i ) for ( Standard_Integer i = aLower; i <= anUpper; ++i )
aVertexIndexes(i) = myMeshData->AddNode( theVertices(i) ); aVertexIndexes(i) = myMeshData->AddNode( theVertices(i) );
@ -2105,11 +2106,11 @@ Standard_Boolean BRepMesh_Delaun::UseEdge( const Standard_Integer /*theIndex*/ )
//function : getEdgesByType //function : getEdgesByType
//purpose : Gives the list of edges with type defined by input parameter //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 const BRepMesh_DegreeOfFreedom theEdgeType ) const
{ {
BRepMeshCol::HMapOfInteger aResult = new BRepMeshCol::MapOfInteger; BRepMesh::HMapOfInteger aResult = new BRepMesh::MapOfInteger;
BRepMeshCol::MapOfInteger::Iterator anEdgeIt( myMeshData->LinksOfDomain() ); BRepMesh::MapOfInteger::Iterator anEdgeIt( myMeshData->LinksOfDomain() );
for ( ; anEdgeIt.More(); anEdgeIt.Next() ) 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 //purpose : Returns area of the loop of the given polygon defined by indices
// of its start and end links. // of its start and end links.
//============================================================================= //=============================================================================
Standard_Real BRepMesh_Delaun::polyArea( const BRepMeshCol::SequenceOfInteger& thePolygon, Standard_Real BRepMesh_Delaun::polyArea(const BRepMesh::SequenceOfInteger& thePolygon,
const Standard_Integer theStartIndex, const Standard_Integer theStartIndex,
const Standard_Integer theEndIndex ) const const Standard_Integer theEndIndex) const
{ {
Standard_Real aArea = 0.0; Standard_Real aArea = 0.0;
Standard_Integer aPolyLen = thePolygon.Length(); Standard_Integer aPolyLen = thePolygon.Length();

View File

@ -23,7 +23,7 @@
#include <BRepMesh_CircleTool.hxx> #include <BRepMesh_CircleTool.hxx>
#include <BRepMesh_Triangle.hxx> #include <BRepMesh_Triangle.hxx>
#include <BRepMesh_Edge.hxx> #include <BRepMesh_Edge.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <BRepMesh_DataStructureOfDelaun.hxx> #include <BRepMesh_DataStructureOfDelaun.hxx>
#include <BRepMesh_GeomTool.hxx> #include <BRepMesh_GeomTool.hxx>
@ -40,24 +40,24 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Creates the triangulation with an empty Mesh data structure. //! 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. //! Creates the triangulation with an existent Mesh data structure.
Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh, Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh,
BRepMeshCol::Array1OfVertexOfDelaun& theVertices); BRepMesh::Array1OfVertexOfDelaun& theVertices);
//! Creates the triangulation with an existant Mesh data structure. //! Creates the triangulation with an existant Mesh data structure.
Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh, Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh,
BRepMeshCol::Array1OfInteger& theVertexIndices); BRepMesh::Array1OfInteger& theVertexIndices);
//! Initializes the triangulation with an array of vertices. //! 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. //! Removes a vertex from the triangulation.
Standard_EXPORT void RemoveVertex (const BRepMesh_Vertex& theVertex); Standard_EXPORT void RemoveVertex (const BRepMesh_Vertex& theVertex);
//! Adds some vertices into the triangulation. //! 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. //! Modify mesh to use the edge.
//! @return True if done //! @return True if done
@ -70,19 +70,19 @@ public:
} }
//! Gives the list of frontier edges. //! Gives the list of frontier edges.
inline BRepMeshCol::HMapOfInteger Frontier() const inline BRepMesh::HMapOfInteger Frontier() const
{ {
return getEdgesByType (BRepMesh_Frontier); return getEdgesByType (BRepMesh_Frontier);
} }
//! Gives the list of internal edges. //! Gives the list of internal edges.
inline BRepMeshCol::HMapOfInteger InternalEdges() const inline BRepMesh::HMapOfInteger InternalEdges() const
{ {
return getEdgesByType (BRepMesh_Fixed); return getEdgesByType (BRepMesh_Fixed);
} }
//! Gives the list of free edges used only one time //! Gives the list of free edges used only one time
inline BRepMeshCol::HMapOfInteger FreeEdges() const inline BRepMesh::HMapOfInteger FreeEdges() const
{ {
return getEdgesByType (BRepMesh_Free); return getEdgesByType (BRepMesh_Free);
} }
@ -121,86 +121,86 @@ private:
InsertBefore InsertBefore
}; };
typedef NCollection_DataMap<Standard_Integer, BRepMeshCol::MapOfInteger> DataMapOfMap; typedef NCollection_DataMap<Standard_Integer, BRepMesh::MapOfInteger> DataMapOfMap;
//! Add boundig box for edge defined by start & end point to //! Add boundig box for edge defined by start & end point to
//! the given vector of bounding boxes for triangulation edges. //! the given vector of bounding boxes for triangulation edges.
void fillBndBox (BRepMeshCol::SequenceOfBndB2d& theBoxes, void fillBndBox (BRepMesh::SequenceOfBndB2d& theBoxes,
const BRepMesh_Vertex& theV1, const BRepMesh_Vertex& theV1,
const BRepMesh_Vertex& theV2); const BRepMesh_Vertex& theV2);
//! Gives the list of edges with type defined by the input parameter. //! Gives the list of edges with type defined by the input parameter.
//! If the given type is BRepMesh_Free returns list of edges //! If the given type is BRepMesh_Free returns list of edges
//! that have number of connected elements less or equal 1. //! 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. //! Create super mesh and run triangulation procedure.
void perform (Bnd_Box2d& theBndBox, void perform (Bnd_Box2d& theBndBox,
BRepMeshCol::Array1OfInteger& theVertexIndices); BRepMesh::Array1OfInteger& theVertexIndices);
//! Build the super mesh. //! Build the super mesh.
void superMesh (const Bnd_Box2d& theBox); void superMesh (const Bnd_Box2d& theBox);
//! Computes the triangulation and adds the vertices, //! Computes the triangulation and adds the vertices,
//! edges and triangles to the Mesh data structure. //! edges and triangles to the Mesh data structure.
void compute (BRepMeshCol::Array1OfInteger& theVertexIndices); void compute (BRepMesh::Array1OfInteger& theVertexIndices);
//! Adjust the mesh on the frontier. //! Adjust the mesh on the frontier.
void frontierAdjust(); void frontierAdjust();
//! Find left polygon of the given edge and call meshPolygon. //! Find left polygon of the given edge and call meshPolygon.
Standard_Boolean meshLeftPolygonOf (const Standard_Integer theEdgeIndex, Standard_Boolean meshLeftPolygonOf (const Standard_Integer theEdgeIndex,
const Standard_Boolean isForward, const Standard_Boolean isForward,
BRepMeshCol::HMapOfInteger theSkipped = NULL); BRepMesh::HMapOfInteger theSkipped = NULL);
//! Find next link starting from the given node and has maximum //! Find next link starting from the given node and has maximum
//! angle respect the given reference link. //! angle respect the given reference link.
//! Each time the next link is found other neighbor links at the pivot //! Each time the next link is found other neighbor links at the pivot
//! node are marked as leprous and will be excluded from consideration //! node are marked as leprous and will be excluded from consideration
//! next time until a hanging end is occured. //! next time until a hanging end is occured.
Standard_Integer findNextPolygonLink (const Standard_Integer& theFirstNode, Standard_Integer findNextPolygonLink (const Standard_Integer& theFirstNode,
const Standard_Integer& thePivotNode, const Standard_Integer& thePivotNode,
const BRepMesh_Vertex& thePivotVertex, const BRepMesh_Vertex& thePivotVertex,
const gp_Vec2d& theRefLinkDir, const gp_Vec2d& theRefLinkDir,
const BRepMeshCol::SequenceOfBndB2d& theBoxes, const BRepMesh::SequenceOfBndB2d& theBoxes,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::HMapOfInteger theSkipped, const BRepMesh::HMapOfInteger theSkipped,
const Standard_Boolean& isSkipLeprous, const Standard_Boolean& isSkipLeprous,
BRepMeshCol::MapOfInteger& theLeprousLinks, BRepMesh::MapOfInteger& theLeprousLinks,
BRepMeshCol::MapOfInteger& theDeadLinks, BRepMesh::MapOfInteger& theDeadLinks,
Standard_Integer& theNextPivotNode, Standard_Integer& theNextPivotNode,
gp_Vec2d& theNextLinkDir, gp_Vec2d& theNextLinkDir,
Bnd_B2d& theNextLinkBndBox); Bnd_B2d& theNextLinkBndBox);
//! Check is the given link intersects the polygon boundaries. //! Check is the given link intersects the polygon boundaries.
//! Returns bounding box for the given link trough the theLinkBndBox parameter. //! Returns bounding box for the given link trough the theLinkBndBox parameter.
Standard_Boolean checkIntersection (const BRepMesh_Edge& theLink, Standard_Boolean checkIntersection (const BRepMesh_Edge& theLink,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, const BRepMesh::SequenceOfBndB2d& thePolyBoxes,
const Standard_Boolean isConsiderEndPointTouch, const Standard_Boolean isConsiderEndPointTouch,
const Standard_Boolean isConsiderPointOnEdge, const Standard_Boolean isConsiderPointOnEdge,
const Standard_Boolean isSkipLastEdge, const Standard_Boolean isSkipLastEdge,
Bnd_B2d& theLinkBndBox) const; Bnd_B2d& theLinkBndBox) const;
//! Triangulatiion of a closed polygon described by the list //! Triangulatiion of a closed polygon described by the list
//! of indexes of its edges in the structure. //! of indexes of its edges in the structure.
//! (negative index means reversed edge) //! (negative index means reversed edge)
void meshPolygon (BRepMeshCol::SequenceOfInteger& thePolygon, void meshPolygon (BRepMesh::SequenceOfInteger& thePolygon,
BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, BRepMesh::SequenceOfBndB2d& thePolyBoxes,
BRepMeshCol::HMapOfInteger theSkipped = NULL); BRepMesh::HMapOfInteger theSkipped = NULL);
//! Triangulatiion of a closed simple polygon (polygon without glued edges and loops) //! Triangulatiion of a closed simple polygon (polygon without glued edges and loops)
//! described by the list of indexes of its edges in the structure. //! described by the list of indexes of its edges in the structure.
//! (negative index means reversed edge) //! (negative index means reversed edge)
void meshSimplePolygon (BRepMeshCol::SequenceOfInteger& thePolygon, void meshSimplePolygon (BRepMesh::SequenceOfInteger& thePolygon,
BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); BRepMesh::SequenceOfBndB2d& thePolyBoxes);
//! Triangulation of closed polygon containing only three edges. //! 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. //! Creates the triangles beetween the given node and the given polyline.
void createTriangles (const Standard_Integer theVertexIndex, void createTriangles (const Standard_Integer theVertexIndex,
BRepMeshCol::MapOfIntegerInteger& thePoly); BRepMesh::MapOfIntegerInteger& thePoly);
//! Add a triangle based on the given oriented edges into mesh //! Add a triangle based on the given oriented edges into mesh
inline void addTriangle (const Standard_Integer (&theEdgesId)[3], 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. //! 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. //! When an edge is suppressed more than one time it is destroyed.
void deleteTriangle (const Standard_Integer theIndex, void deleteTriangle (const Standard_Integer theIndex,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges); BRepMesh::MapOfIntegerInteger& theLoopEdges);
//! Returns start and end nodes of the given edge in respect to its orientation. //! Returns start and end nodes of the given edge in respect to its orientation.
void getOrientedNodes (const BRepMesh_Edge& theEdge, void getOrientedNodes (const BRepMesh_Edge& theEdge,
@ -219,21 +219,21 @@ private:
//! Processes loop within the given polygon formed by range of its //! Processes loop within the given polygon formed by range of its
//! links specified by start and end link indices. //! links specified by start and end link indices.
void processLoop (const Standard_Integer theLinkFrom, void processLoop (const Standard_Integer theLinkFrom,
const Standard_Integer theLinkTo, const Standard_Integer theLinkTo,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); const BRepMesh::SequenceOfBndB2d& thePolyBoxes);
//! Creates new link based on the given nodes and updates the given polygon. //! Creates new link based on the given nodes and updates the given polygon.
Standard_Integer createAndReplacePolygonLink (const Standard_Integer theNodes[], Standard_Integer createAndReplacePolygonLink (const Standard_Integer theNodes[],
const gp_Pnt2d thePnts [], const gp_Pnt2d thePnts [],
const Standard_Integer theRootIndex, const Standard_Integer theRootIndex,
const ReplaceFlag theReplaceFlag, const ReplaceFlag theReplaceFlag,
BRepMeshCol::SequenceOfInteger& thePolygon, BRepMesh::SequenceOfInteger& thePolygon,
BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); BRepMesh::SequenceOfBndB2d& thePolyBoxes);
//! Creates the triangles on new nodes. //! Creates the triangles on new nodes.
void createTrianglesOnNewVertices (BRepMeshCol::Array1OfInteger& theVertexIndices); void createTrianglesOnNewVertices (BRepMesh::Array1OfInteger& theVertexIndices);
//! Cleanup mesh from the free triangles. //! Cleanup mesh from the free triangles.
void cleanupMesh(); void cleanupMesh();
@ -249,35 +249,35 @@ private:
const Standard_Integer thePrevElementId); const Standard_Integer thePrevElementId);
//! Remove internal triangles from the given polygon. //! Remove internal triangles from the given polygon.
void cleanupPolygon (const BRepMeshCol::SequenceOfInteger& thePolygon, void cleanupPolygon (const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes); const BRepMesh::SequenceOfBndB2d& thePolyBoxes);
//! Checks is the given vertex lies inside the polygon. //! Checks is the given vertex lies inside the polygon.
Standard_Boolean isVertexInsidePolygon (const Standard_Integer& theVertexId, Standard_Boolean isVertexInsidePolygon (const Standard_Integer& theVertexId,
const BRepMeshCol::VectorOfInteger& thePolygonVertices) const; const BRepMesh::VectorOfInteger& thePolygonVertices) const;
//! Remove all triangles and edges that are placed inside the polygon or crossed it. //! Remove all triangles and edges that are placed inside the polygon or crossed it.
void killTrianglesAroundVertex (const Standard_Integer theZombieNodeId, void killTrianglesAroundVertex (const Standard_Integer theZombieNodeId,
const BRepMeshCol::VectorOfInteger& thePolyVertices, const BRepMesh::VectorOfInteger& thePolyVertices,
const BRepMeshCol::MapOfInteger& thePolyVerticesFindMap, const BRepMesh::MapOfInteger& thePolyVerticesFindMap,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, const BRepMesh::SequenceOfBndB2d& thePolyBoxes,
BRepMeshCol::MapOfInteger& theSurvivedLinks, BRepMesh::MapOfInteger& theSurvivedLinks,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges); BRepMesh::MapOfIntegerInteger& theLoopEdges);
//! Checks is the given link crosses the polygon boundary. //! Checks is the given link crosses the polygon boundary.
//! If yes, kills its triangles and checks neighbor links on boundary intersection. Does nothing elsewhere. //! If yes, kills its triangles and checks neighbor links on boundary intersection. Does nothing elsewhere.
void killTrianglesOnIntersectingLinks (const Standard_Integer& theLinkToCheckId, void killTrianglesOnIntersectingLinks (const Standard_Integer& theLinkToCheckId,
const BRepMesh_Edge& theLinkToCheck, const BRepMesh_Edge& theLinkToCheck,
const Standard_Integer& theEndPoint, const Standard_Integer& theEndPoint,
const BRepMeshCol::SequenceOfInteger& thePolygon, const BRepMesh::SequenceOfInteger& thePolygon,
const BRepMeshCol::SequenceOfBndB2d& thePolyBoxes, const BRepMesh::SequenceOfBndB2d& thePolyBoxes,
BRepMeshCol::MapOfInteger& theSurvivedLinks, BRepMesh::MapOfInteger& theSurvivedLinks,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges); BRepMesh::MapOfIntegerInteger& theLoopEdges);
//! Kill triangles bound to the given link. //! Kill triangles bound to the given link.
void killLinkTriangles (const Standard_Integer& theLinkId, void killLinkTriangles (const Standard_Integer& theLinkId,
BRepMeshCol::MapOfIntegerInteger& theLoopEdges); BRepMesh::MapOfIntegerInteger& theLoopEdges);
//! Calculates distances between the given point and edges of triangle. //! Calculates distances between the given point and edges of triangle.
Standard_Real calculateDist (const gp_XY theVEdges[3], Standard_Real calculateDist (const gp_XY theVEdges[3],
@ -297,9 +297,9 @@ private:
gp_Pnt2d& theIntPnt) const; gp_Pnt2d& theIntPnt) const;
//! Returns area of the loop of the given polygon defined by indices of its start and end links. //! 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, Standard_Real polyArea (const BRepMesh::SequenceOfInteger& thePolygon,
const Standard_Integer theStartIndex, const Standard_Integer theStartIndex,
const Standard_Integer theEndIndex) const; const Standard_Integer theEndIndex) const;
private: private:

View File

@ -89,9 +89,9 @@ public:
const TCollection_AsciiString& theFuncName = "DISCRETALGO"); const TCollection_AsciiString& theFuncName = "DISCRETALGO");
//! Returns triangulation algorithm instance. //! Returns triangulation algorithm instance.
//! \param theShape shape to be meshed. //! @param theShape shape to be meshed.
//! \param theLinDeflection linear deflection to be used for meshing. //! @param theLinDeflection linear deflection to be used for meshing.
//! \param theAngDeflection angular 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, Standard_EXPORT Handle(BRepMesh_DiscretRoot) Discret(const TopoDS_Shape& theShape,
const Standard_Real theLinDeflection, const Standard_Real theLinDeflection,
const Standard_Real theAngDeflection); const Standard_Real theAngDeflection);

View File

@ -18,69 +18,7 @@
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <BRepMesh_DegreeOfFreedom.hxx> #include <BRepMesh_DegreeOfFreedom.hxx>
#include <BRepMesh_OrientedEdge.hxx>
//! 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;
};
//! Light weighted structure representing link of the mesh. //! Light weighted structure representing link of the mesh.
class BRepMesh_Edge : public BRepMesh_OrientedEdge class BRepMesh_Edge : public BRepMesh_OrientedEdge
@ -111,14 +49,14 @@ public:
} }
//! Sets movability flag of the Link. //! 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) inline void SetMovability(const BRepMesh_DegreeOfFreedom theMovability)
{ {
myMovability = theMovability; myMovability = theMovability;
} }
//! Checks if the given edge and this one have the same orientation. //! 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. //! \retrun TRUE if edges have the same orientation, FALSE if not.
inline Standard_Boolean IsSameOrientation(const BRepMesh_Edge& theOther) const inline Standard_Boolean IsSameOrientation(const BRepMesh_Edge& theOther) const
{ {
@ -126,8 +64,8 @@ public:
} }
//! Checks for equality with another edge. //! Checks for equality with another edge.
//! \param theOther edge to be checked against this one. //! @param theOther edge to be checked against this one.
//! \return TRUE if equal, FALSE if not. //! @return TRUE if equal, FALSE if not.
inline Standard_Boolean IsEqual(const BRepMesh_Edge& theOther) const inline Standard_Boolean IsEqual(const BRepMesh_Edge& theOther) const
{ {
if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted) if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted)
@ -148,12 +86,6 @@ private:
BRepMesh_DegreeOfFreedom myMovability; 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, inline Standard_Integer HashCode(const BRepMesh_Edge& theEdge,
const Standard_Integer theUpper) const Standard_Integer theUpper)
{ {

View File

@ -31,10 +31,10 @@ class BRepMesh_EdgeChecker
public: public:
//! Constructor //! Constructor
//! \param theFaceTri Poly triangulation of face the edges relie to. //! @param theFaceTri Poly triangulation of face the edges relie to.
//! \param theFaceLoc Face location to be used to extract polygon on triangulation. //! @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 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 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. //! 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, BRepMesh_EdgeChecker( Handle(Poly_Triangulation)& theFaceTri,
TopLoc_Location& theFaceLoc, TopLoc_Location& theFaceLoc,
@ -48,7 +48,7 @@ public:
} }
//! Checker's body. //! Checker's body.
//! \param theEdge edge to be checked. //! @param theEdge edge to be checked.
void operator ()(const TopoDS_Edge& theEdge) const void operator ()(const TopoDS_Edge& theEdge) const
{ {
if (theEdge.IsNull() || myIsFailed) if (theEdge.IsNull() || myIsFailed)

View File

@ -18,7 +18,7 @@
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <BRepMesh_IEdgeTool.hxx> #include <BRepMesh_IEdgeTool.hxx>
#include <BRepMesh_GeomTool.hxx> #include <BRepMesh_GeomTool.hxx>
#include <BRepMesh_FaceAttribute.hxx> #include <BRepMesh_FaceAttribute.hxx>
@ -77,10 +77,10 @@ private:
const Standard_Integer theNbIter); const Standard_Integer theNbIter);
private: private:
N_HANDLE<BRepMesh_GeomTool> myTool; NCollection_Handle<BRepMesh_GeomTool> myTool;
Handle(BRepAdaptor_HSurface) mySurface; Handle(BRepAdaptor_HSurface) mySurface;
BRepAdaptor_Curve myCOnS; BRepAdaptor_Curve myCOnS;
Standard_Real mySquareEdgeDef; Standard_Real mySquareEdgeDef;
}; };
DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool) DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool)

View File

@ -22,14 +22,32 @@
IMPLEMENT_STANDARD_HANDLE (BRepMesh_FaceAttribute, Standard_Transient) IMPLEMENT_STANDARD_HANDLE (BRepMesh_FaceAttribute, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(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 //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_FaceAttribute::BRepMesh_FaceAttribute( BRepMesh_FaceAttribute::BRepMesh_FaceAttribute(
const TopoDS_Face& theFace, const TopoDS_Face& theFace,
BRepMeshCol::DMapOfVertexInteger& theBoundaryVertices, const BRepMesh::HDMapOfVertexInteger& theBoundaryVertices,
BRepMeshCol::DMapOfIntegerPnt& theBoundaryPoints) const BRepMesh::HDMapOfIntegerPnt& theBoundaryPoints)
: myDefFace (0.), : myDefFace (0.),
myUMin (0.), myUMin (0.),
myUMax (0.), myUMax (0.),
@ -40,21 +58,10 @@ BRepMesh_FaceAttribute::BRepMesh_FaceAttribute(
myStatus (BRepMesh_NoError), myStatus (BRepMesh_NoError),
myBoundaryVertices(theBoundaryVertices), myBoundaryVertices(theBoundaryVertices),
myBoundaryPoints (theBoundaryPoints), myBoundaryPoints (theBoundaryPoints),
myFace (theFace),
myAllocator (new NCollection_IncAllocator(64000)) myAllocator (new NCollection_IncAllocator(64000))
{ {
myVertexEdgeMap = new BRepMeshCol::IMapOfInteger; init();
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();
} }
//======================================================================= //=======================================================================
@ -72,6 +79,29 @@ BRepMesh_FaceAttribute::~BRepMesh_FaceAttribute()
myAllocator.Nullify(); 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 //function : clearLocal
//purpose : //purpose :
@ -96,7 +126,9 @@ Handle(BRepMesh_DataStructureOfDelaun)& BRepMesh_FaceAttribute::ResetStructure()
clearLocal(); clearLocal();
myStructure = new BRepMesh_DataStructureOfDelaun(myAllocator); 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 aTolU = ToleranceU();
Standard_Real aTolV = ToleranceV(); Standard_Real aTolV = ToleranceV();
@ -125,8 +157,8 @@ Standard_Boolean BRepMesh_FaceAttribute::getVertexIndex(
const TopoDS_Vertex& theVertex, const TopoDS_Vertex& theVertex,
Standard_Integer& theVertexIndex) const Standard_Integer& theVertexIndex) const
{ {
if (myBoundaryVertices.IsBound(theVertex)) if (!myBoundaryVertices.IsNull() && myBoundaryVertices->IsBound(theVertex))
theVertexIndex = myBoundaryVertices.Find(theVertex); theVertexIndex = myBoundaryVertices->Find(theVertex);
else if (mySurfaceVertices.IsBound(theVertex)) else if (mySurfaceVertices.IsBound(theVertex))
theVertexIndex = mySurfaceVertices.Find(theVertex); theVertexIndex = mySurfaceVertices.Find(theVertex);
else 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() - myUMin) / myDeltaX, (thePoint2d.Y() - myVMin) / myDeltaY) :
gp_XY(thePoint2d.X() * myDeltaX + myUMin, thePoint2d.Y() * myDeltaY + myVMin); 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);
}

View File

@ -19,7 +19,7 @@
#include <Standard_DefineHandle.hxx> #include <Standard_DefineHandle.hxx>
#include <BRepMesh_Status.hxx> #include <BRepMesh_Status.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <BRepMesh_DataStructureOfDelaun.hxx> #include <BRepMesh_DataStructureOfDelaun.hxx>
#include <Handle_BRepAdaptor_HSurface.hxx> #include <Handle_BRepAdaptor_HSurface.hxx>
@ -30,6 +30,9 @@ class BRepMesh_FaceAttribute : public Standard_Transient
{ {
public: public:
//! Default constructor.
Standard_EXPORT BRepMesh_FaceAttribute();
//! Constructor. //! Constructor.
//! @param theFace face the attribute is created for. //! @param theFace face the attribute is created for.
//! Used for default initialization. Attribute keeps reference //! Used for default initialization. Attribute keeps reference
@ -37,12 +40,12 @@ public:
//! @param theBoundaryVertices shared map of shape vertices. //! @param theBoundaryVertices shared map of shape vertices.
//! @param theBoundaryPoints shared discretization points of shape boundaries. //! @param theBoundaryPoints shared discretization points of shape boundaries.
Standard_EXPORT BRepMesh_FaceAttribute( Standard_EXPORT BRepMesh_FaceAttribute(
const TopoDS_Face& theFace, const TopoDS_Face& theFace,
BRepMeshCol::DMapOfVertexInteger& theBoundaryVertices, const BRepMesh::HDMapOfVertexInteger& theBoundaryVertices,
BRepMeshCol::DMapOfIntegerPnt& theBoundaryPoints); const BRepMesh::HDMapOfIntegerPnt& theBoundaryPoints);
//! Destructor. //! Destructor.
virtual ~BRepMesh_FaceAttribute(); Standard_EXPORT virtual ~BRepMesh_FaceAttribute();
public: //! @name main geometrical properties. public: //! @name main geometrical properties.
@ -52,24 +55,36 @@ public: //! @name main geometrical properties.
return mySurface; return mySurface;
} }
//! Sets reference face.
inline void SetFace(const TopoDS_Face& theFace)
{
myFace = theFace;
}
//! Returns forward oriented face to be used for calculations. //! Returns forward oriented face to be used for calculations.
inline const TopoDS_Face& Face() const inline const TopoDS_Face& Face() const
{ {
return myFace; 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. //! Returns U tolerance of face calculated regarding its parameters.
inline Standard_Real ToleranceU() const Standard_EXPORT Standard_Real ToleranceU() const;
{
return computeParametricTolerance(myUMin, myUMax);
}
//! Returns V tolerance of face calculated regarding its parameters. //! Returns V tolerance of face calculated regarding its parameters.
inline Standard_Real ToleranceV() const Standard_EXPORT Standard_Real ToleranceV() const;
{
return computeParametricTolerance(myVMin, myVMax);
}
//! Gives face deflection parameter. //! Gives face deflection parameter.
inline Standard_Real GetDefFace() const inline Standard_Real GetDefFace() const
{ {
@ -174,33 +189,30 @@ public: //! @name main geometrical properties.
public: //! @name auxiliary structures public: //! @name auxiliary structures
//! Clear all face attribute.
Standard_EXPORT void Clear();
//! Resets mesh data structure. //! Resets mesh data structure.
//! @returns reset data structure. //! @returns reset data structure.
Standard_EXPORT Handle(BRepMesh_DataStructureOfDelaun)& ResetStructure(); Standard_EXPORT Handle(BRepMesh_DataStructureOfDelaun)& ResetStructure();
//! Gives reference to map of internal edges of face. //! Gives reference to map of internal edges of face.
inline BRepMeshCol::HDMapOfShapePairOfPolygon& ChangeInternalEdges() inline BRepMesh::HDMapOfShapePairOfPolygon& ChangeInternalEdges()
{ {
return myInternalEdges; return myInternalEdges;
} }
//! Gives reference to map of 2D points of discretization. //! Gives reference to map of 2D points of discretization.
inline BRepMeshCol::DMapOfIntegerListOfXY& ChangeLocation2D() inline BRepMesh::DMapOfIntegerListOfXY& ChangeLocation2D()
{ {
return myLocation2D; return myLocation2D;
} }
//! Gives reference to map of 3D points of discretization. //! Gives reference to map of 3D points of discretization.
inline BRepMeshCol::HDMapOfIntegerPnt& ChangeSurfacePoints() inline BRepMesh::HDMapOfIntegerPnt& ChangeSurfacePoints()
{ {
return mySurfacePoints; return mySurfacePoints;
} }
//! Gives reference on map of (vertex, edge) pairs of face. //! Gives reference on map of (vertex, edge) pairs of face.
inline BRepMeshCol::HIMapOfInteger& ChangeVertexEdgeMap() inline BRepMesh::HIMapOfInteger& ChangeVertexEdgeMap()
{ {
return myVertexEdgeMap; return myVertexEdgeMap;
} }
@ -212,7 +224,7 @@ public: //! @name auxiliary structures
} }
//! Returns classifier. //! Returns classifier.
inline BRepMeshCol::HClassifier& ChangeClassifier() inline BRepMesh::HClassifier& ChangeClassifier()
{ {
return myClassifier; return myClassifier;
} }
@ -222,7 +234,8 @@ public: //! @name Point/Vertex/Node manipulators
//! Gives the number of different locations in 3D space. //! Gives the number of different locations in 3D space.
inline Standard_Integer LastPointId() const 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. //! Gives the 3D location of the vertex.
@ -234,10 +247,10 @@ public: //! @name Point/Vertex/Node manipulators
//! Gives the 3D location of the vertex. //! Gives the 3D location of the vertex.
inline const gp_Pnt& GetPoint(const Standard_Integer theIndex) const 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 mySurfacePoints->Find(theIndex);
return myBoundaryPoints(theIndex); return myBoundaryPoints->Find(theIndex);
} }
//! Returns index of the given vertex if it exists in cache, //! Returns index of the given vertex if it exists in cache,
@ -262,14 +275,14 @@ public: //! @name Point/Vertex/Node manipulators
{ {
aNewVertexIndex = LastPointId() + 1; aNewVertexIndex = LastPointId() + 1;
BRepMeshCol::DMapOfIntegerPnt& aPointsMap = isFillEdgeVertices ? BRepMesh::DMapOfIntegerPnt& aPointsMap = isFillEdgeVertices ?
myBoundaryPoints : *mySurfacePoints; *myBoundaryPoints : *mySurfacePoints;
aPointsMap.Bind(aNewVertexIndex, theVertexExplorer->Point()); aPointsMap.Bind(aNewVertexIndex, theVertexExplorer->Point());
} }
BRepMeshCol::DMapOfVertexInteger& aVertexMap = isFillEdgeVertices ? BRepMesh::DMapOfVertexInteger& aVertexMap = isFillEdgeVertices ?
myBoundaryVertices : mySurfaceVertices; *myBoundaryVertices : mySurfaceVertices;
aVertexMap.Bind(aVertex, aNewVertexIndex); 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. //! Computes parametric tolerance of a face regarding the given limits.
Standard_Real computeParametricTolerance( Standard_Real computeParametricTolerance(
const Standard_Real theFirstParam, const Standard_Real theFirstParam,
@ -335,21 +351,21 @@ private:
Standard_Real myDeltaY; Standard_Real myDeltaY;
Standard_Integer myStatus; Standard_Integer myStatus;
BRepMeshCol::DMapOfVertexInteger& myBoundaryVertices; BRepMesh::HDMapOfVertexInteger myBoundaryVertices;
BRepMeshCol::DMapOfIntegerPnt& myBoundaryPoints; BRepMesh::HDMapOfIntegerPnt myBoundaryPoints;
TopoDS_Face myFace; TopoDS_Face myFace;
Handle(BRepAdaptor_HSurface) mySurface; Handle(BRepAdaptor_HSurface) mySurface;
BRepMeshCol::DMapOfVertexInteger mySurfaceVertices; BRepMesh::DMapOfVertexInteger mySurfaceVertices;
BRepMeshCol::HDMapOfIntegerPnt mySurfacePoints; BRepMesh::HDMapOfIntegerPnt mySurfacePoints;
BRepMeshCol::DMapOfIntegerListOfXY myLocation2D; BRepMesh::DMapOfIntegerListOfXY myLocation2D;
BRepMeshCol::HIMapOfInteger myVertexEdgeMap; BRepMesh::HIMapOfInteger myVertexEdgeMap;
BRepMeshCol::HDMapOfShapePairOfPolygon myInternalEdges; BRepMesh::HDMapOfShapePairOfPolygon myInternalEdges;
Handle(BRepMesh_DataStructureOfDelaun) myStructure; Handle(BRepMesh_DataStructureOfDelaun) myStructure;
BRepMeshCol::HClassifier myClassifier; BRepMesh::HClassifier myClassifier;
BRepMeshCol::Allocator myAllocator; Handle(NCollection_IncAllocator) myAllocator;
}; };
DEFINE_STANDARD_HANDLE(BRepMesh_FaceAttribute, Standard_Transient) DEFINE_STANDARD_HANDLE(BRepMesh_FaceAttribute, Standard_Transient)

View File

@ -40,7 +40,7 @@ class BRepMesh_FaceChecker
public: public:
//! Constructor //! 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) BRepMesh_FaceChecker(const Standard_Boolean isInParallel)
: myIsFailed(Standard_False), : myIsFailed(Standard_False),
myIsInParallel(isInParallel) myIsInParallel(isInParallel)
@ -48,7 +48,7 @@ public:
} }
//! Checker's body. //! Checker's body.
//! \param theFace Face to be checked. //! @param theFace Face to be checked.
void operator ()(const TopoDS_Face& theFace) const void operator ()(const TopoDS_Face& theFace) const
{ {
if (theFace.IsNull() || myIsFailed) if (theFace.IsNull() || myIsFailed)

View File

@ -100,7 +100,9 @@ BRepMesh_FastDiscret::BRepMesh_FastDiscret(
myInParallel (isInParallel), myInParallel (isInParallel),
myRelative (theRelative), myRelative (theRelative),
myShapetrigu (theShapetrigu), myShapetrigu (theShapetrigu),
myInshape (theInshape) myInshape (theInshape),
myBoundaryVertices(new BRepMesh::DMapOfVertexInteger),
myBoundaryPoints(new BRepMesh::DMapOfIntegerPnt)
{ {
if ( myRelative ) if ( myRelative )
BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale); BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale);
@ -125,7 +127,9 @@ BRepMesh_FastDiscret::BRepMesh_FastDiscret(const TopoDS_Shape& theShape,
myInParallel (isInParallel), myInParallel (isInParallel),
myRelative (theRelative), myRelative (theRelative),
myShapetrigu (theShapetrigu), myShapetrigu (theShapetrigu),
myInshape (theInshape) myInshape (theInshape),
myBoundaryVertices(new BRepMesh::DMapOfVertexInteger),
myBoundaryPoints(new BRepMesh::DMapOfIntegerPnt)
{ {
if ( myRelative ) if ( myRelative )
BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale); BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale);
@ -227,8 +231,8 @@ Standard_Integer BRepMesh_FastDiscret::Add(const TopoDS_Face& theFace)
if (!myWithShare) if (!myWithShare)
{ {
myEdges.Clear(); myEdges.Clear();
myBoundaryVertices.Clear(); myBoundaryVertices->Clear();
myBoundaryPoints.Clear(); myBoundaryPoints->Clear();
} }
Standard_Real defedge; Standard_Real defedge;
@ -241,8 +245,8 @@ Standard_Integer BRepMesh_FastDiscret::Add(const TopoDS_Face& theFace)
if (!myRelative) if (!myRelative)
defface = Max(myDeflection, maxdef); defface = Max(myDeflection, maxdef);
N_SEQUENCE<EdgePCurve> aPCurves; NCollection_Sequence<EdgePCurve> aPCurves;
N_SEQUENCE<TopoDS_Edge> aFaceEdges; NCollection_Sequence<TopoDS_Edge> aFaceEdges;
const TopoDS_Face& aFace = myAttribute->Face(); const TopoDS_Face& aFace = myAttribute->Face();
const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); 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; Standard_Real deltaY = 1.0;
{ {
BRepMeshCol::HClassifier& aClassifier = myAttribute->ChangeClassifier(); BRepMesh::HClassifier& aClassifier = myAttribute->ChangeClassifier();
BRepMesh_WireChecker aDFaceChecker(aFace, Precision::PConfusion(), BRepMesh_WireChecker aDFaceChecker(aFace, Precision::PConfusion(),
myInternalEdges, myVertexEdgeMap, myStructure, myInternalEdges, myVertexEdgeMap, myStructure,
myumin, myumax, myvmin, myvmax, myInParallel ); myumin, myumax, myvmin, myvmax, myInParallel );
@ -770,7 +774,7 @@ void BRepMesh_FastDiscret::add(
for (Standard_Integer i = 2; i < aNodesNb; ++i) for (Standard_Integer i = 2; i < aNodesNb; ++i)
{ {
const Standard_Integer aPointId = aNodes(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); const Standard_Real aParam = aProvider.Parameter(i, aPnt);
gp_Pnt2d aUV = thePCurve.Curve2d->Value(aParam); gp_Pnt2d aUV = thePCurve.Curve2d->Value(aParam);
@ -892,7 +896,7 @@ void BRepMesh_FastDiscret::update(
gp_Pnt2d aUV; gp_Pnt2d aUV;
Standard_Real aParam; Standard_Real aParam;
aEdgeTool->Value(i, aParam, aPnt, aUV); aEdgeTool->Value(i, aParam, aPnt, aUV);
myBoundaryPoints.Bind(++aLastPointId, aPnt); myBoundaryPoints->Bind(++aLastPointId, aPnt);
Standard_Integer iv2, isv; Standard_Integer iv2, isv;
myAttribute->AddNode(aLastPointId, aUV.Coord(), BRepMesh_Frontier, iv2, isv); myAttribute->AddNode(aLastPointId, aUV.Coord(), BRepMesh_Frontier, iv2, isv);

View File

@ -30,7 +30,7 @@
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
#include <BRepMesh_Triangle.hxx> #include <BRepMesh_Triangle.hxx>
#include <BRepMesh_FaceAttribute.hxx> #include <BRepMesh_FaceAttribute.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <TColgp_Array1OfPnt.hxx> #include <TColgp_Array1OfPnt.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepMesh_ShapeTool.hxx> #include <BRepMesh_ShapeTool.hxx>
@ -120,9 +120,6 @@ public:
return myInParallel; return myInParallel;
} }
//! Gives the list of indices of the vertices <br>
Standard_EXPORT void VerticesOfDomain(BRepMeshCol::MapOfInteger& Indices) const;
//! returns the deflection value. <br> //! returns the deflection value. <br>
inline Standard_Real GetDeflection() const inline Standard_Real GetDeflection() const
{ {
@ -167,7 +164,7 @@ public:
//! Returns number of boundary 3d points. //! Returns number of boundary 3d points.
inline Standard_Integer NbBoundaryPoints() const inline Standard_Integer NbBoundaryPoints() const
{ {
return myBoundaryPoints.Extent(); return myBoundaryPoints->Extent();
} }
DEFINE_STANDARD_RTTI(BRepMesh_FastDiscret) DEFINE_STANDARD_RTTI(BRepMesh_FastDiscret)
@ -260,20 +257,20 @@ private:
//! used for tessellation. //! used for tessellation.
struct EdgeAttributes struct EdgeAttributes
{ {
TopoDS_Vertex FirstVertex; TopoDS_Vertex FirstVertex;
TopoDS_Vertex LastVertex; TopoDS_Vertex LastVertex;
Standard_Real FirstParam; Standard_Real FirstParam;
Standard_Real LastParam; Standard_Real LastParam;
gp_Pnt2d FirstUV; gp_Pnt2d FirstUV;
gp_Pnt2d LastUV; gp_Pnt2d LastUV;
Standard_Boolean IsSameUV; Standard_Boolean IsSameUV;
Standard_Real MinDist; Standard_Real MinDist;
N_HANDLE<TopoDSVExplorer> FirstVExtractor; NCollection_Handle<TopoDSVExplorer> FirstVExtractor;
N_HANDLE<TopoDSVExplorer> LastVExtractor; NCollection_Handle<TopoDSVExplorer> LastVExtractor;
}; };
//! Structure keeps geometrical parameters of edge's PCurve. //! Structure keeps geometrical parameters of edge's PCurve.
@ -348,29 +345,29 @@ private:
private: private:
TopoDS_Face myFace; TopoDS_Face myFace;
Standard_Real myAngle; Standard_Real myAngle;
Standard_Real myDeflection; Standard_Real myDeflection;
Standard_Real myDtotale; Standard_Real myDtotale;
Standard_Boolean myWithShare; Standard_Boolean myWithShare;
Standard_Boolean myInParallel; Standard_Boolean myInParallel;
BRepMeshCol::DMapOfShapePairOfPolygon myEdges; BRepMesh::DMapOfShapePairOfPolygon myEdges;
BRepMeshCol::DMapOfFaceAttribute myAttributes; BRepMesh::DMapOfFaceAttribute myAttributes;
Standard_Boolean myRelative; Standard_Boolean myRelative;
Standard_Boolean myShapetrigu; Standard_Boolean myShapetrigu;
Standard_Boolean myInshape; Standard_Boolean myInshape;
TopTools_DataMapOfShapeReal myMapdefle; TopTools_DataMapOfShapeReal myMapdefle;
// Data shared for whole shape // Data shared for whole shape
BRepMeshCol::DMapOfVertexInteger myBoundaryVertices; BRepMesh::HDMapOfVertexInteger myBoundaryVertices;
BRepMeshCol::DMapOfIntegerPnt myBoundaryPoints; BRepMesh::HDMapOfIntegerPnt myBoundaryPoints;
// Fast access to attributes of current face // Fast access to attributes of current face
Handle(BRepMesh_FaceAttribute) myAttribute; Handle(BRepMesh_FaceAttribute) myAttribute;
Handle(BRepMesh_DataStructureOfDelaun) myStructure; Handle(BRepMesh_DataStructureOfDelaun) myStructure;
BRepMeshCol::HIMapOfInteger myVertexEdgeMap; BRepMesh::HIMapOfInteger myVertexEdgeMap;
BRepMeshCol::HDMapOfShapePairOfPolygon myInternalEdges; BRepMesh::HDMapOfShapePairOfPolygon myInternalEdges;
TopTools_IndexedDataMapOfShapeListOfShape mySharedFaces; TopTools_IndexedDataMapOfShapeListOfShape mySharedFaces;
}; };
DEFINE_STANDARD_HANDLE(BRepMesh_FastDiscret, Standard_Transient) DEFINE_STANDARD_HANDLE(BRepMesh_FastDiscret, Standard_Transient)

View File

@ -196,7 +196,7 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr
const Standard_Real deltaX = myAttribute->GetDeltaX(); const Standard_Real deltaX = myAttribute->GetDeltaX();
const Standard_Real deltaY = myAttribute->GetDeltaY(); 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 // Check the necessity to fill the map of parameters
const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus || 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); aPnt2d = myAttribute->Scale(aPnt2d, Standard_True);
BRepMesh_Vertex v_new(aPnt2d, v.Location3d(), v.Movability()); 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); aMoveNodes.Add(v_new, alist);
tabvert_corr(i) = i; tabvert_corr(i) = i;
} }
@ -261,7 +261,7 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr
Standard_Real aDef = -1; Standard_Real aDef = -1;
if ( !isaline && myStructure->ElementsOfDomain().Extent() > 0 ) if ( !isaline && myStructure->ElementsOfDomain().Extent() > 0 )
{ {
BRepMeshCol::ListOfVertex aNewVertices; BRepMesh::ListOfVertex aNewVertices;
if ( !rajout ) if ( !rajout )
{ {
aDef = control(aNewVertices, trigu, Standard_True); 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); const BRepMesh_Vertex& v = myStructure->GetNode(i);
gp_XY aPnt2d = myAttribute->Scale(v.Coord(), Standard_False); gp_XY aPnt2d = myAttribute->Scale(v.Coord(), Standard_False);
BRepMesh_Vertex v_new(aPnt2d, v.Location3d(), v.Movability()); 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); aMoveNodes.Add(v_new, alist);
// Register internal nodes used in triangulation // Register internal nodes used in triangulation
@ -316,14 +316,14 @@ void BRepMesh_FastDiscretFace::Add(const Handle(BRepMesh_FaceAttribute)& theAttr
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BRepMesh_FastDiscretFace::addVerticesToMesh( Standard_Boolean BRepMesh_FastDiscretFace::addVerticesToMesh(
const BRepMeshCol::ListOfVertex& theVertices, const BRepMesh::ListOfVertex& theVertices,
BRepMesh_Delaun& theMeshBuilder) BRepMesh_Delaun& theMeshBuilder)
{ {
if (theVertices.IsEmpty()) if (theVertices.IsEmpty())
return Standard_False; return Standard_False;
BRepMeshCol::Array1OfVertexOfDelaun aArrayOfNewVertices(1, theVertices.Extent()); BRepMesh::Array1OfVertexOfDelaun aArrayOfNewVertices(1, theVertices.Extent());
BRepMeshCol::ListOfVertex::Iterator aVertexIt(theVertices); BRepMesh::ListOfVertex::Iterator aVertexIt(theVertices);
for (Standard_Integer aVertexId = 0; aVertexIt.More(); aVertexIt.Next()) for (Standard_Integer aVertexId = 0; aVertexIt.More(); aVertexIt.Next())
aArrayOfNewVertices(++aVertexId) = aVertexIt.Value(); aArrayOfNewVertices(++aVertexId) = aVertexIt.Value();
@ -335,13 +335,13 @@ Standard_Boolean BRepMesh_FastDiscretFace::addVerticesToMesh(
//function : insertInternalVertices //function : insertInternalVertices
//purpose : //purpose :
//======================================================================= //=======================================================================
static void filterParameters(const BRepMeshCol::IMapOfReal& theParams, static void filterParameters(const BRepMesh::IMapOfReal& theParams,
const Standard_Real theMinDist, const Standard_Real theMinDist,
const Standard_Real theFilterDist, const Standard_Real theFilterDist,
BRepMeshCol::SequenceOfReal& theResult) BRepMesh::SequenceOfReal& theResult)
{ {
// Sort sequence of parameters // Sort sequence of parameters
BRepMeshCol::SequenceOfReal aParamTmp; BRepMesh::SequenceOfReal aParamTmp;
Standard_Integer aParamLength = 1; Standard_Integer aParamLength = 1;
const Standard_Integer anInitLen = theParams.Extent(); const Standard_Integer anInitLen = theParams.Extent();
@ -430,8 +430,8 @@ static void filterParameters(const BRepMeshCol::IMapOfReal& theParams,
} }
void BRepMesh_FastDiscretFace::insertInternalVertices( void BRepMesh_FastDiscretFace::insertInternalVertices(
BRepMeshCol::ListOfVertex& theNewVertices, BRepMesh::ListOfVertex& theNewVertices,
BRepMesh_Delaun& theMeshBuilder) BRepMesh_Delaun& theMeshBuilder)
{ {
const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface();
switch (gFace->GetType()) switch (gFace->GetType())
@ -470,7 +470,7 @@ void BRepMesh_FastDiscretFace::insertInternalVertices(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertInternalVerticesSphere( void BRepMesh_FastDiscretFace::insertInternalVerticesSphere(
BRepMeshCol::ListOfVertex& theNewVertices) BRepMesh::ListOfVertex& theNewVertices)
{ {
const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umax = myAttribute->GetUMax();
const Standard_Real umin = myAttribute->GetUMin(); const Standard_Real umin = myAttribute->GetUMin();
@ -517,7 +517,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesSphere(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertInternalVerticesCylinder( void BRepMesh_FastDiscretFace::insertInternalVerticesCylinder(
BRepMeshCol::ListOfVertex& theNewVertices) BRepMesh::ListOfVertex& theNewVertices)
{ {
const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umax = myAttribute->GetUMax();
const Standard_Real umin = myAttribute->GetUMin(); const Standard_Real umin = myAttribute->GetUMin();
@ -557,7 +557,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesCylinder(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertInternalVerticesCone( void BRepMesh_FastDiscretFace::insertInternalVerticesCone(
BRepMeshCol::ListOfVertex& theNewVertices) BRepMesh::ListOfVertex& theNewVertices)
{ {
const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umax = myAttribute->GetUMax();
const Standard_Real umin = myAttribute->GetUMin(); const Standard_Real umin = myAttribute->GetUMin();
@ -592,7 +592,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesCone(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertInternalVerticesTorus( void BRepMesh_FastDiscretFace::insertInternalVerticesTorus(
BRepMeshCol::ListOfVertex& theNewVertices) BRepMesh::ListOfVertex& theNewVertices)
{ {
const Standard_Real umax = myAttribute->GetUMax(); const Standard_Real umax = myAttribute->GetUMax();
const Standard_Real umin = myAttribute->GetUMin(); const Standard_Real umin = myAttribute->GetUMin();
@ -609,7 +609,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesTorus(
Standard_Real pp, pasu, pasv; Standard_Real pp, pasu, pasv;
Standard_Real r = T.MinorRadius(), R = T.MajorRadius(); Standard_Real r = T.MinorRadius(), R = T.MajorRadius();
BRepMeshCol::SequenceOfReal ParamU, ParamV; BRepMesh::SequenceOfReal ParamU, ParamV;
Standard_Real Du, Dv;//, pasu, pasv; Standard_Real Du, Dv;//, pasu, pasv;
Dv = Max(1.0e0 - (aDefFace / r), 0.0e0); Dv = Max(1.0e0 - (aDefFace / r), 0.0e0);
@ -726,7 +726,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesTorus(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline(
BRepMeshCol::ListOfVertex& theNewVertices) BRepMesh::ListOfVertex& theNewVertices)
{ {
const Standard_Real aRange[2][2] = { const Standard_Real aRange[2][2] = {
{ myAttribute->GetUMax(), myAttribute->GetUMin() }, { myAttribute->GetUMax(), myAttribute->GetUMin() },
@ -741,7 +741,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline(
const Standard_Real aDefFace = myAttribute->GetDefFace(); const Standard_Real aDefFace = myAttribute->GetDefFace();
const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface();
BRepMeshCol::SequenceOfReal aParams[2]; BRepMesh::SequenceOfReal aParams[2];
for (Standard_Integer i = 0; i < 2; ++i) for (Standard_Integer i = 0; i < 2; ++i)
{ {
Standard_Boolean isU = (i == 0); Standard_Boolean isU = (i == 0);
@ -773,8 +773,8 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline(
const Standard_Real aSqPrecision = aPrecision * aPrecision; const Standard_Real aSqPrecision = aPrecision * aPrecision;
for (Standard_Integer k = 0; k < 2; ++k) for (Standard_Integer k = 0; k < 2; ++k)
{ {
BRepMeshCol::SequenceOfReal& aParams1 = aParams[k]; BRepMesh::SequenceOfReal& aParams1 = aParams[k];
BRepMeshCol::SequenceOfReal& aParams2 = aParams[(k + 1) % 2]; BRepMesh::SequenceOfReal& aParams2 = aParams[(k + 1) % 2];
const Standard_Boolean isU = (k == 0); const Standard_Boolean isU = (k == 0);
Standard_Integer aStartIndex, aEndIndex; Standard_Integer aStartIndex, aEndIndex;
if (isU) if (isU)
@ -873,7 +873,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertInternalVerticesOther( void BRepMesh_FastDiscretFace::insertInternalVerticesOther(
BRepMeshCol::ListOfVertex& theNewVertices) BRepMesh::ListOfVertex& theNewVertices)
{ {
const Standard_Real aAngle = 0.35; const Standard_Real aAngle = 0.35;
const Standard_Real aRange[2][2] = { const Standard_Real aRange[2][2] = {
@ -884,7 +884,7 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther(
const Standard_Real aDefFace = myAttribute->GetDefFace(); const Standard_Real aDefFace = myAttribute->GetDefFace();
const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface();
BRepMeshCol::SequenceOfReal aParams[2]; BRepMesh::SequenceOfReal aParams[2];
const Standard_Integer aIsoPointsNb = 11; const Standard_Integer aIsoPointsNb = 11;
for (Standard_Integer k = 0; k < 2; ++k) for (Standard_Integer k = 0; k < 2; ++k)
{ {
@ -918,8 +918,8 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther(
} }
} }
BRepMeshCol::SequenceOfReal& aParams2 = aParams[aOtherParamsIndex]; BRepMesh::SequenceOfReal& aParams2 = aParams[aOtherParamsIndex];
GCPnts_TangentialDeflection& aDIso = aDiscretIso[aMaxIndex]; GCPnts_TangentialDeflection& aDIso = aDiscretIso[aMaxIndex];
for (Standard_Integer i = 1; i <= aMaxPointsNb; ++i) for (Standard_Integer i = 1; i <= aMaxPointsNb; ++i)
aParams2.Append(aDIso.Parameter(i)); aParams2.Append(aDIso.Parameter(i));
@ -953,9 +953,9 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther(
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real BRepMesh_FastDiscretFace::control( Standard_Real BRepMesh_FastDiscretFace::control(
BRepMeshCol::ListOfVertex& theNewVertices, BRepMesh::ListOfVertex& theNewVertices,
BRepMesh_Delaun& theTrigu, BRepMesh_Delaun& theTrigu,
const Standard_Boolean theIsFirst) const Standard_Boolean theIsFirst)
#define CHECK_DEF_AND_INSERT_CURRENT(isSkipped) \ #define CHECK_DEF_AND_INSERT_CURRENT(isSkipped) \
if (aSqDef > aMaxSqDef) \ if (aSqDef > aMaxSqDef) \
@ -989,7 +989,7 @@ if (aSqDef > aSqDefFace) \
aBSpline = gFace->BSpline(); aBSpline = gFace->BSpline();
NCollection_DataMap<Standard_Integer, gp_Dir> aNorMap; NCollection_DataMap<Standard_Integer, gp_Dir> aNorMap;
BRepMeshCol::MapOfIntegerInteger aStatMap; BRepMesh::MapOfIntegerInteger aStatMap;
NCollection_Map<BRepMesh_OrientedEdge> aCouples(3 * aTrianglesNb); NCollection_Map<BRepMesh_OrientedEdge> aCouples(3 * aTrianglesNb);
// Perform refinement passes // Perform refinement passes
@ -1014,8 +1014,8 @@ if (aSqDef > aSqDefFace) \
break; break;
// Iterate on current triangles // Iterate on current triangles
const BRepMeshCol::MapOfInteger& aTriangles = myStructure->ElementsOfDomain(); const BRepMesh::MapOfInteger& aTriangles = myStructure->ElementsOfDomain();
BRepMeshCol::MapOfInteger::Iterator aTriangleIt(aTriangles); BRepMesh::MapOfInteger::Iterator aTriangleIt(aTriangles);
for (; aTriangleIt.More(); aTriangleIt.Next()) for (; aTriangleIt.More(); aTriangleIt.Next())
{ {
const Standard_Integer aTriangleId = aTriangleIt.Key(); 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()); gp_Pnt2d aPnt2d = BRep_Tool::Parameters(theVertex, myAttribute->Face());
N_HANDLE<FixedVExplorer> aFixedVExplorer = new FixedVExplorer(theVertex); NCollection_Handle<FixedVExplorer> aFixedVExplorer = new FixedVExplorer(theVertex);
Standard_Integer aIndex = myAttribute->GetVertexIndex(aFixedVExplorer); Standard_Integer aIndex = myAttribute->GetVertexIndex(aFixedVExplorer);
gp_XY anUV = BRepMesh_ShapeTool::FindUV(aIndex, aPnt2d, gp_XY anUV = BRepMesh_ShapeTool::FindUV(aIndex, aPnt2d,
theVertex, BRep_Tool::Tolerance(theVertex), myAttribute); theVertex, BRep_Tool::Tolerance(theVertex), myAttribute);
@ -1199,9 +1199,9 @@ void BRepMesh_FastDiscretFace::add(const TopoDS_Vertex& theVertex)
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::insertVertex( void BRepMesh_FastDiscretFace::insertVertex(
const gp_Pnt& thePnt3d, const gp_Pnt& thePnt3d,
const gp_XY& theUV, const gp_XY& theUV,
BRepMeshCol::ListOfVertex& theVertices) BRepMesh::ListOfVertex& theVertices)
{ {
Standard_Integer aNbLocat = myAttribute->LastPointId(); Standard_Integer aNbLocat = myAttribute->LastPointId();
mySurfacePoints->Bind(++aNbLocat, thePnt3d); mySurfacePoints->Bind(++aNbLocat, thePnt3d);

View File

@ -18,7 +18,7 @@
#include <Standard_DefineHandle.hxx> #include <Standard_DefineHandle.hxx>
#include <BRepMesh_FastDiscretFace.hxx> #include <BRepMesh_FastDiscretFace.hxx>
#include <BRepMesh_DataStructureOfDelaun.hxx> #include <BRepMesh_DataStructureOfDelaun.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <BRepMesh_FaceAttribute.hxx> #include <BRepMesh_FaceAttribute.hxx>
#include <Standard_Transient.hxx> #include <Standard_Transient.hxx>
#include <TopTools_MutexForShapeProvider.hxx> #include <TopTools_MutexForShapeProvider.hxx>
@ -49,25 +49,22 @@ class gp_Pnt;
class BRepMesh_FastDiscretFace : public Standard_Transient class BRepMesh_FastDiscretFace : public Standard_Transient
{ {
public: public:
Standard_EXPORT BRepMesh_FastDiscretFace(
Standard_EXPORT BRepMesh_FastDiscretFace(const Standard_Real theAngle, const Standard_Real theAngle,
const Standard_Boolean theWithShare = Standard_True); const Standard_Boolean theWithShare = Standard_True);
Standard_EXPORT void Add(const Handle(BRepMesh_FaceAttribute)& theAttribute); Standard_EXPORT void Add(const Handle(BRepMesh_FaceAttribute)& theAttribute);
//! Gives the triangle of <Index>. <br>
Standard_EXPORT const BRepMesh_Triangle& Triangle(const Standard_Integer theIndex) const;
DEFINE_STANDARD_RTTI(BRepMesh_FastDiscretFace) DEFINE_STANDARD_RTTI(BRepMesh_FastDiscretFace)
private: private:
void add(const TopoDS_Vertex& theVertex); void add(const TopoDS_Vertex& theVertex);
Standard_Real control(BRepMeshCol::ListOfVertex& theNewVertices, Standard_Real control(BRepMesh::ListOfVertex& theNewVertices,
BRepMesh_Delaun& theMeshBuilder, BRepMesh_Delaun& theMeshBuilder,
const Standard_Boolean theIsFirst); const Standard_Boolean theIsFirst);
//! Registers the given nodes in mesh data structure and //! Registers the given nodes in mesh data structure and
//! performs refinement of existing mesh. //! performs refinement of existing mesh.
@ -76,39 +73,39 @@ private:
//! in respect to inserting nodes. //! in respect to inserting nodes.
//! @return TRUE if vertices were been inserted, FALSE elewhere. //! @return TRUE if vertices were been inserted, FALSE elewhere.
Standard_Boolean addVerticesToMesh( Standard_Boolean addVerticesToMesh(
const BRepMeshCol::ListOfVertex& theVertices, const BRepMesh::ListOfVertex& theVertices,
BRepMesh_Delaun& theMeshBuilder); BRepMesh_Delaun& theMeshBuilder);
//! Calculates nodes lying on face's surface and inserts them to a mesh. //! 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 theNewVertices list of vertices to be extended and added to mesh.
//! @param theMeshBuilder initialized tool refining mesh //! @param theMeshBuilder initialized tool refining mesh
//! in respect to inserting nodes. //! in respect to inserting nodes.
void insertInternalVertices(BRepMeshCol::ListOfVertex& theNewVertices, void insertInternalVertices(BRepMesh::ListOfVertex& theNewVertices,
BRepMesh_Delaun& theMeshBuilder); BRepMesh_Delaun& theMeshBuilder);
//! Calculates nodes lying on spherical surface. //! Calculates nodes lying on spherical surface.
//! @param theNewVertices list of vertices to be extended and added to mesh. //! @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. //! Calculates nodes lying on cylindrical surface.
//! @param theNewVertices list of vertices to be extended and added to mesh. //! @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. //! Calculates nodes lying on conical surface.
//! @param theNewVertices list of vertices to be extended and added to mesh. //! @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. //! Calculates nodes lying on toroidal surface.
//! @param theNewVertices list of vertices to be extended and added to mesh. //! @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. //! Calculates nodes lying on Bezier/BSpline surface.
//! @param theNewVertices list of vertices to be extended and added to mesh. //! @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. //! Calculates nodes lying on custom-type surface.
//! @param theNewVertices list of vertices to be extended and added to mesh. //! @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 //! Template method trying to insert new internal vertex corresponded to
//! the given 2d point. Calculates 3d position analytically using the given //! 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 theAnalyticSurface analytic surface to calculate 3d point.
//! @param[out] theVertices list of vertices to be updated. //! @param[out] theVertices list of vertices to be updated.
template<class AnalyticSurface> template<class AnalyticSurface>
void tryToInsertAnalyticVertex(const gp_Pnt2d& thePnt2d, void tryToInsertAnalyticVertex(const gp_Pnt2d& thePnt2d,
const AnalyticSurface& theAnalyticSurface, const AnalyticSurface& theAnalyticSurface,
BRepMeshCol::ListOfVertex& theVertices) BRepMesh::ListOfVertex& theVertices)
{ {
if (!myClassifier->Perform(thePnt2d) == TopAbs_IN) if (!myClassifier->Perform(thePnt2d) == TopAbs_IN)
return; return;
@ -133,25 +130,25 @@ private:
//! @param thePnt3d 3d point corresponded to the vertex. //! @param thePnt3d 3d point corresponded to the vertex.
//! @param theUV UV point corresponded to the vertex. //! @param theUV UV point corresponded to the vertex.
//! @param[out] theVertices list of vertices to be updated. //! @param[out] theVertices list of vertices to be updated.
void insertVertex(const gp_Pnt& thePnt3d, void insertVertex(const gp_Pnt& thePnt3d,
const gp_XY& theUV, const gp_XY& theUV,
BRepMeshCol::ListOfVertex& theVertices); BRepMesh::ListOfVertex& theVertices);
private: private:
Standard_Real myAngle; Standard_Real myAngle;
Standard_Boolean myWithShare; Standard_Boolean myWithShare;
Standard_Boolean myInternalVerticesMode; Standard_Boolean myInternalVerticesMode;
BRepMeshCol::IMapOfReal myUParam; BRepMesh::IMapOfReal myUParam;
BRepMeshCol::IMapOfReal myVParam; BRepMesh::IMapOfReal myVParam;
BRepMeshCol::Allocator myAllocator; Handle(NCollection_IncAllocator) myAllocator;
// Fast access to attributes of current face // Fast access to attributes of current face
Handle(BRepMesh_FaceAttribute) myAttribute; Handle(BRepMesh_FaceAttribute) myAttribute;
Handle(BRepMesh_DataStructureOfDelaun) myStructure; Handle(BRepMesh_DataStructureOfDelaun) myStructure;
BRepMeshCol::HIMapOfInteger myVertexEdgeMap; BRepMesh::HIMapOfInteger myVertexEdgeMap;
BRepMeshCol::HClassifier myClassifier; BRepMesh::HClassifier myClassifier;
BRepMeshCol::HDMapOfIntegerPnt mySurfacePoints; BRepMesh::HDMapOfIntegerPnt mySurfacePoints;
}; };
DEFINE_STANDARD_HANDLE (BRepMesh_FastDiscretFace, Standard_Transient) DEFINE_STANDARD_HANDLE (BRepMesh_FastDiscretFace, Standard_Transient)

View File

@ -50,12 +50,12 @@ public:
//! Constructor. //! Constructor.
//! Initiates discretization of the given geometric curve. //! Initiates discretization of the given geometric curve.
//! \param theCurve curve to be discretized. //! @param theCurve curve to be discretized.
//! \param theFirstParam first parameter of the curve. //! @param theFirstParam first parameter of the curve.
//! \param theLastParam last parameter of the curve. //! @param theLastParam last parameter of the curve.
//! \param theLinDeflection linear deflection. //! @param theLinDeflection linear deflection.
//! \param theAngDeflection angular deflection. //! @param theAngDeflection angular deflection.
//! \param theMinPointsNb minimum nuber of points to be produced. //! @param theMinPointsNb minimum nuber of points to be produced.
Standard_EXPORT BRepMesh_GeomTool(const BRepAdaptor_Curve& theCurve, Standard_EXPORT BRepMesh_GeomTool(const BRepAdaptor_Curve& theCurve,
const Standard_Real theFirstParam, const Standard_Real theFirstParam,
const Standard_Real theLastParam, const Standard_Real theLastParam,
@ -66,14 +66,14 @@ public:
//! Constructor. //! Constructor.
//! Initiates discretization of geometric curve corresponding //! Initiates discretization of geometric curve corresponding
//! to iso curve of the given surface. //! to iso curve of the given surface.
//! \param theSurface surface the iso curve to be taken from. //! @param theSurface surface the iso curve to be taken from.
//! \param theIsoType type of iso curve to be used, U or V. //! @param theIsoType type of iso curve to be used, U or V.
//! \param theParamIso parameter on the surface specifying the iso curve. //! @param theParamIso parameter on the surface specifying the iso curve.
//! \param theFirstParam first parameter of the curve. //! @param theFirstParam first parameter of the curve.
//! \param theLastParam last parameter of the curve. //! @param theLastParam last parameter of the curve.
//! \param theLinDeflection linear deflection. //! @param theLinDeflection linear deflection.
//! \param theAngDeflection angular deflection. //! @param theAngDeflection angular deflection.
//! \param theMinPointsNb minimum nuber of points to be produced. //! @param theMinPointsNb minimum nuber of points to be produced.
Standard_EXPORT BRepMesh_GeomTool(const Handle(BRepAdaptor_HSurface)& theSurface, Standard_EXPORT BRepMesh_GeomTool(const Handle(BRepAdaptor_HSurface)& theSurface,
const GeomAbs_IsoType theIsoType, const GeomAbs_IsoType theIsoType,
const Standard_Real theParamIso, const Standard_Real theParamIso,
@ -84,11 +84,11 @@ public:
const Standard_Integer theMinPointsNb = 2); const Standard_Integer theMinPointsNb = 2);
//! Adds point to already calculated points (or replaces existing). //! Adds point to already calculated points (or replaces existing).
//! \param thePoint point to be added. //! @param thePoint point to be added.
//! \param theParam parameter on the curve corresponding to the given point. //! @param theParam parameter on the curve corresponding to the given point.
//! \param theIsReplace if TRUE replaces existing point lying within //! @param theIsReplace if TRUE replaces existing point lying within
//! parameteric tolerance of the given point. //! 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, inline Standard_Integer AddPoint(const gp_Pnt& thePoint,
const Standard_Real theParam, const Standard_Real theParam,
const Standard_Boolean theIsReplace = Standard_True) const Standard_Boolean theIsReplace = Standard_True)
@ -103,13 +103,13 @@ public:
} }
//! Gets parameters of discretization point with the given index. //! Gets parameters of discretization point with the given index.
//! \param theIndex index of discretization point. //! @param theIndex index of discretization point.
//! \param theIsoParam parameter on surface to be used as second coordinate //! @param theIsoParam parameter on surface to be used as second coordinate
//! of resulting 2d point. //! of resulting 2d point.
//! \param theParam[out] parameter of the point on the iso curve. //! @param theParam[out] parameter of the point on the iso curve.
//! \param thePoint[out] discretization point. //! @param thePoint[out] discretization point.
//! \param theUV[out] discretization point in parametric space of the surface. //! @param theUV[out] discretization point in parametric space of the surface.
//! \return TRUE on success, FALSE elsewhere. //! @return TRUE on success, FALSE elsewhere.
Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex, Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex,
const Standard_Real theIsoParam, const Standard_Real theIsoParam,
Standard_Real& theParam, Standard_Real& theParam,
@ -117,26 +117,26 @@ public:
gp_Pnt2d& theUV) const; gp_Pnt2d& theUV) const;
//! Gets parameters of discretization point with the given index. //! Gets parameters of discretization point with the given index.
//! \param theIndex index of discretization point. //! @param theIndex index of discretization point.
//! \param theSurface surface the curve is lying onto. //! @param theSurface surface the curve is lying onto.
//! \param theParam[out] parameter of the point on the curve. //! @param theParam[out] parameter of the point on the curve.
//! \param thePoint[out] discretization point. //! @param thePoint[out] discretization point.
//! \param theUV[out] discretization point in parametric space of the surface. //! @param theUV[out] discretization point in parametric space of the surface.
//! \return TRUE on success, FALSE elsewhere. //! @return TRUE on success, FALSE elsewhere.
Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex, Standard_EXPORT Standard_Boolean Value(const Standard_Integer theIndex,
const Handle(BRepAdaptor_HSurface)& theSurface, const Handle(BRepAdaptor_HSurface)& theSurface,
Standard_Real& theParam, Standard_Real& theParam,
gp_Pnt& thePoint, gp_Pnt& thePoint,
gp_Pnt2d& theUV) const; gp_Pnt2d& theUV) const;
public: //! \name static API public: //! @name static API
//! \param theSurface surface the nomal should be found for. //! @param theSurface surface the nomal should be found for.
//! \param theParamU U parameter in parametric space of the surface. //! @param theParamU U parameter in parametric space of the surface.
//! \param theParamV V 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] thePoint 3d point corresponding to the given parameters.
//! \param[out] theNormal normal vector at the point specified by the parameters. //! @param[out] theNormal normal vector at the point specified by the parameters.
//! \return FALSE if the normal can not be computed, TRUE elsewhere. //! @return FALSE if the normal can not be computed, TRUE elsewhere.
static Standard_Boolean Normal(const Handle(BRepAdaptor_HSurface)& theSurface, static Standard_Boolean Normal(const Handle(BRepAdaptor_HSurface)& theSurface,
const Standard_Real theParamU, const Standard_Real theParamU,
const Standard_Real theParamV, const Standard_Real theParamV,
@ -144,14 +144,14 @@ public: //! \name static API
gp_Dir& theNormal); gp_Dir& theNormal);
//! Checks intersection between two lines defined by two points. //! Checks intersection between two lines defined by two points.
//! \param theStartPnt1 start point of first line. //! @param theStartPnt1 start point of first line.
//! \param theEndPnt1 end point of first line. //! @param theEndPnt1 end point of first line.
//! \param theStartPnt2 start point of second line. //! @param theStartPnt2 start point of second line.
//! \param theEndPnt2 end point of second line. //! @param theEndPnt2 end point of second line.
//! \param[out] theIntPnt point of intersection. //! @param[out] theIntPnt point of intersection.
//! \param[out] theParamOnSegment parameters of intersection point //! @param[out] theParamOnSegment parameters of intersection point
//! corresponding to first and second segment. //! corresponding to first and second segment.
//! \return status of intersection check. //! @return status of intersection check.
static IntFlag IntLinLin(const gp_XY& theStartPnt1, static IntFlag IntLinLin(const gp_XY& theStartPnt1,
const gp_XY& theEndPnt1, const gp_XY& theEndPnt1,
const gp_XY& theStartPnt2, const gp_XY& theStartPnt2,
@ -161,18 +161,18 @@ public: //! \name static API
//! Checks intersection between the two segments. //! Checks intersection between the two segments.
//! Checks that intersection point lies within ranges of both segments. //! Checks that intersection point lies within ranges of both segments.
//! \param theStartPnt1 start point of first segment. //! @param theStartPnt1 start point of first segment.
//! \param theEndPnt1 end point of first segment. //! @param theEndPnt1 end point of first segment.
//! \param theStartPnt2 start point of second segment. //! @param theStartPnt2 start point of second segment.
//! \param theEndPnt2 end point of second segment. //! @param theEndPnt2 end point of second segment.
//! \param isConsiderEndPointTouch if TRUE EndPointTouch status will be //! @param isConsiderEndPointTouch if TRUE EndPointTouch status will be
//! returned in case if segments are touching by end points, if FALSE //! returned in case if segments are touching by end points, if FALSE
//! returns NoIntersection flag. //! 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, //! returned in case if end point of one segment lies onto another one,
//! if FALSE returns NoIntersection flag. //! if FALSE returns NoIntersection flag.
//! \param[out] theIntPnt point of intersection. //! @param[out] theIntPnt point of intersection.
//! \return status of intersection check. //! @return status of intersection check.
static IntFlag IntSegSeg(const gp_XY& theStartPnt1, static IntFlag IntSegSeg(const gp_XY& theStartPnt1,
const gp_XY& theEndPnt1, const gp_XY& theEndPnt1,
const gp_XY& theStartPnt2, const gp_XY& theStartPnt2,
@ -184,10 +184,10 @@ public: //! \name static API
private: private:
//! Classifies the point in case of coincidence of two vectors. //! Classifies the point in case of coincidence of two vectors.
//! \param thePoint1 the start point of a segment (base point). //! @param thePoint1 the start point of a segment (base point).
//! \param thePoint2 the end point of a segment. //! @param thePoint2 the end point of a segment.
//! \param thePointToCheck the point to classify. //! @param thePointToCheck the point to classify.
//! \return zero value if point is out of segment and non zero value //! @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. //! if point is between the first and the second point of segment.
static Standard_Integer classifyPoint (const gp_XY& thePoint1, static Standard_Integer classifyPoint (const gp_XY& thePoint1,
const gp_XY& thePoint2, const gp_XY& thePoint2,

View File

@ -371,7 +371,7 @@ void BRepMesh_IncrementalMesh::update(const TopoDS_Edge& theEdge)
} }
if (!myEmptyEdges.IsBound(theEdge)) if (!myEmptyEdges.IsBound(theEdge))
myEmptyEdges.Bind(theEdge, BRepMeshCol::MapOfTriangulation()); myEmptyEdges.Bind(theEdge, BRepMesh::MapOfTriangulation());
if (!aTriangulation.IsNull()) if (!aTriangulation.IsNull())
myEmptyEdges(theEdge).Add(aTriangulation); myEmptyEdges(theEdge).Add(aTriangulation);
@ -407,7 +407,7 @@ Standard_Boolean BRepMesh_IncrementalMesh::toBeMeshed(
if (!myEmptyEdges.IsBound(aEdge)) if (!myEmptyEdges.IsBound(aEdge))
continue; continue;
BRepMeshCol::MapOfTriangulation& aTriMap = myEmptyEdges(aEdge); BRepMesh::MapOfTriangulation& aTriMap = myEmptyEdges(aEdge);
isEdgesConsistent &= !aTriMap.IsEmpty() && !aTriMap.Contains(aTriangulation); isEdgesConsistent &= !aTriMap.IsEmpty() && !aTriMap.Contains(aTriangulation);
} }
@ -444,7 +444,7 @@ void BRepMesh_IncrementalMesh::update(const TopoDS_Face& theFace)
if (aStatus != BRepMesh_ReMesh) if (aStatus != BRepMesh_ReMesh)
return; return;
BRepMeshCol::MapOfShape aUsedFaces; BRepMesh::MapOfShape aUsedFaces;
aUsedFaces.Add(theFace); aUsedFaces.Add(theFace);
const TopTools_IndexedDataMapOfShapeListOfShape& aMapOfSharedFaces = const TopTools_IndexedDataMapOfShapeListOfShape& aMapOfSharedFaces =
@ -515,11 +515,11 @@ void BRepMesh_IncrementalMesh::commitFace(const TopoDS_Face& theFace)
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
Handle(BRepMesh_DataStructureOfDelaun)& aStructure = aFaceAttribute->ChangeStructure(); Handle(BRepMesh_DataStructureOfDelaun)& aStructure = aFaceAttribute->ChangeStructure();
const BRepMeshCol::MapOfInteger& aTriangles = aStructure->ElementsOfDomain(); const BRepMesh::MapOfInteger& aTriangles = aStructure->ElementsOfDomain();
if (aTriangles.IsEmpty()) if (aTriangles.IsEmpty())
return; return;
BRepMeshCol::HIMapOfInteger& aVetrexEdgeMap = aFaceAttribute->ChangeVertexEdgeMap(); BRepMesh::HIMapOfInteger& aVetrexEdgeMap = aFaceAttribute->ChangeVertexEdgeMap();
// Store triangles // Store triangles
Standard_Integer aVerticesNb = aVetrexEdgeMap->Extent(); Standard_Integer aVerticesNb = aVetrexEdgeMap->Extent();
@ -530,7 +530,7 @@ void BRepMesh_IncrementalMesh::commitFace(const TopoDS_Face& theFace)
Poly_Array1OfTriangle& aPolyTrianges = aNewTriangulation->ChangeTriangles(); Poly_Array1OfTriangle& aPolyTrianges = aNewTriangulation->ChangeTriangles();
Standard_Integer aTriangeId = 1; Standard_Integer aTriangeId = 1;
BRepMeshCol::MapOfInteger::Iterator aTriIt(aTriangles); BRepMesh::MapOfInteger::Iterator aTriIt(aTriangles);
for (; aTriIt.More(); aTriIt.Next()) for (; aTriIt.More(); aTriIt.Next())
{ {
const BRepMesh_Triangle& aCurElem = aStructure->GetElement(aTriIt.Key()); 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); BRepMesh_ShapeTool::AddInFace(aFace, aNewTriangulation);
// Store discretization of edges // Store discretization of edges
BRepMeshCol::HDMapOfShapePairOfPolygon& aInternalEdges = aFaceAttribute->ChangeInternalEdges(); BRepMesh::HDMapOfShapePairOfPolygon& aInternalEdges = aFaceAttribute->ChangeInternalEdges();
BRepMeshCol::DMapOfShapePairOfPolygon::Iterator aEdgeIt(*aInternalEdges); BRepMesh::DMapOfShapePairOfPolygon::Iterator aEdgeIt(*aInternalEdges);
for (; aEdgeIt.More(); aEdgeIt.Next()) for (; aEdgeIt.More(); aEdgeIt.Next())
{ {
const TopoDS_Edge& aEdge = TopoDS::Edge(aEdgeIt.Key()); const TopoDS_Edge& aEdge = TopoDS::Edge(aEdgeIt.Key());

View File

@ -22,7 +22,7 @@
#include <TopTools_DataMapOfShapeReal.hxx> #include <TopTools_DataMapOfShapeReal.hxx>
#include <BRepMesh_DiscretRoot.hxx> #include <BRepMesh_DiscretRoot.hxx>
#include <Handle_Poly_Triangulation.hxx> #include <Handle_Poly_Triangulation.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <vector> #include <vector>
@ -35,7 +35,7 @@ class TopoDS_Face;
//! correctly triangulated parts //! correctly triangulated parts
class BRepMesh_IncrementalMesh : public BRepMesh_DiscretRoot class BRepMesh_IncrementalMesh : public BRepMesh_DiscretRoot
{ {
public: //! \name mesher API public: //! @name mesher API
//! Default constructor //! Default constructor
Standard_EXPORT BRepMesh_IncrementalMesh(); Standard_EXPORT BRepMesh_IncrementalMesh();
@ -45,13 +45,13 @@ public: //! \name mesher API
//! Constructor. //! Constructor.
//! Automatically calls method Perform. //! Automatically calls method Perform.
//! \param theShape shape to be meshed. //! @param theShape shape to be meshed.
//! \param theLinDeflection linear deflection. //! @param theLinDeflection linear deflection.
//! \param isRelative if TRUE deflection used for discretization of //! @param isRelative if TRUE deflection used for discretization of
//! each edge will be <theLinDeflection> * <size of edge>. Deflection //! each edge will be <theLinDeflection> * <size of edge>. Deflection
//! used for the faces will be the maximum deflection of their edges. //! used for the faces will be the maximum deflection of their edges.
//! \param theAngDeflection angular deflection. //! @param theAngDeflection angular deflection.
//! \param isInParallel if TRUE shape will be meshed in parallel. //! @param isInParallel if TRUE shape will be meshed in parallel.
Standard_EXPORT BRepMesh_IncrementalMesh( Standard_EXPORT BRepMesh_IncrementalMesh(
const TopoDS_Shape& theShape, const TopoDS_Shape& theShape,
const Standard_Real theLinDeflection, const Standard_Real theLinDeflection,
@ -62,10 +62,10 @@ public: //! \name mesher API
//! Performs meshing ot the shape. //! Performs meshing ot the shape.
Standard_EXPORT virtual void Perform(); Standard_EXPORT virtual void Perform();
public: //! \name accessing to parameters. public: //! @name accessing to parameters.
//! Enables using relative deflection. //! 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 <theLinDeflection> * <size of edge>. Deflection //! each edge will be <theLinDeflection> * <size of edge>. Deflection
//! used for the faces will be the maximum deflection of their edges. //! used for the faces will be the maximum deflection of their edges.
inline void SetRelative(const Standard_Boolean isRelative) inline void SetRelative(const Standard_Boolean isRelative)
@ -103,14 +103,14 @@ public: //! \name accessing to parameters.
return myInParallel; return myInParallel;
} }
public: //! \name plugin API public: //! @name plugin API
//! Plugin interface for the Mesh Factories. //! Plugin interface for the Mesh Factories.
//! Initializes meshing algorithm with the given parameters. //! Initializes meshing algorithm with the given parameters.
//! \param theShape shape to be meshed. //! @param theShape shape to be meshed.
//! \param theLinDeflection linear deflection. //! @param theLinDeflection linear deflection.
//! \param theAngDeflection angular deflection. //! @param theAngDeflection angular deflection.
//! \param[out] theAlgo pointer to initialized algorithm. //! @param[out] theAlgo pointer to initialized algorithm.
Standard_EXPORT static Standard_Integer Discret(const TopoDS_Shape& theShape, Standard_EXPORT static Standard_Integer Discret(const TopoDS_Shape& theShape,
const Standard_Real theLinDeflection, const Standard_Real theLinDeflection,
const Standard_Real theAngDeflection, const Standard_Real theAngDeflection,
@ -142,7 +142,7 @@ private:
//! i.e. PolygonOnTriangulation of particular edge connected //! i.e. PolygonOnTriangulation of particular edge connected
//! to the same Triangulation data structure as stored inside //! to the same Triangulation data structure as stored inside
//! a parent face. //! a parent face.
//! \return TRUE on success, FALSE in case of inconsistencies. //! @return TRUE on success, FALSE in case of inconsistencies.
Standard_Boolean isCorrectPolyData(); Standard_Boolean isCorrectPolyData();
//! Builds the incremental mesh for the shape. //! Builds the incremental mesh for the shape.
@ -151,12 +151,12 @@ private:
//! Checks triangulation of the given face for consistency //! Checks triangulation of the given face for consistency
//! with the chosen tolerance. If some edge of face has no //! with the chosen tolerance. If some edge of face has no
//! discrete representation triangulation will be calculated. //! discrete representation triangulation will be calculated.
//! \param theFace face to be checked. //! @param theFace face to be checked.
void update(const TopoDS_Face& theFace); void update(const TopoDS_Face& theFace);
//! Checks discretization of the given edge for consistency //! Checks discretization of the given edge for consistency
//! with the chosen tolerance. //! with the chosen tolerance.
//! \param theEdge edge to be checked. //! @param theEdge edge to be checked.
void update(const TopoDS_Edge& theEdge); void update(const TopoDS_Edge& theEdge);
//! Collects faces suitable for meshing. //! Collects faces suitable for meshing.
@ -166,7 +166,7 @@ private:
void discretizeFreeEdges(); void discretizeFreeEdges();
//! Returns deflection of the given edge. //! 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); Standard_Real edgeDeflection(const TopoDS_Edge& theEdge);
//! Returns deflection of the given face. //! Returns deflection of the given face.
@ -177,12 +177,12 @@ private:
//! Prepares the given face for meshing. //! Prepares the given face for meshing.
//! Nullifies triangulation of face and polygons of face's edges. //! Nullifies triangulation of face and polygons of face's edges.
//! \param theFace face to be checked. //! @param theFace face to be checked.
//! \param isWithCheck if TRUE, checks parameters of triangulation //! @param isWithCheck if TRUE, checks parameters of triangulation
//! existing in face. If its deflection satisfies the given value and //! existing in face. If its deflection satisfies the given value and
//! each edge of face has polygon corresponded to this triangulation, //! each edge of face has polygon corresponded to this triangulation,
//! method return FALSE. //! 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, Standard_Boolean toBeMeshed(const TopoDS_Face& theFace,
const Standard_Boolean isWithCheck); const Standard_Boolean isWithCheck);
@ -194,15 +194,15 @@ private:
protected: protected:
Standard_Boolean myRelative; Standard_Boolean myRelative;
Standard_Boolean myInParallel; Standard_Boolean myInParallel;
BRepMeshCol::DMapOfEdgeListOfTriangulation myEmptyEdges; BRepMesh::DMapOfEdgeListOfTriangulation myEmptyEdges;
Handle(BRepMesh_FastDiscret) myMesh; Handle(BRepMesh_FastDiscret) myMesh;
Standard_Boolean myModified; Standard_Boolean myModified;
TopTools_DataMapOfShapeReal myEdgeDeflection; TopTools_DataMapOfShapeReal myEdgeDeflection;
Standard_Real myMaxShapeSize; Standard_Real myMaxShapeSize;
Standard_Integer myStatus; Standard_Integer myStatus;
std::vector<TopoDS_Face> myFaces; std::vector<TopoDS_Face> myFaces;
}; };
DEFINE_STANDARD_HANDLE(BRepMesh_IncrementalMesh,BRepMesh_DiscretRoot) DEFINE_STANDARD_HANDLE(BRepMesh_IncrementalMesh,BRepMesh_DiscretRoot)

View File

@ -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 <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>
#include <BRepMesh_DegreeOfFreedom.hxx>
//! 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

View File

@ -88,7 +88,7 @@ public:
} }
//! Returns index corresponding to the given position in the pair. //! 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 inline Standard_Integer Index(const Standard_Integer thePairPos) const
{ {
if (thePairPos != 1 && thePairPos != 2) if (thePairPos != 1 && thePairPos != 2)
@ -98,8 +98,8 @@ public:
} }
//! Sets index corresponding to the given position in the pair. //! Sets 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).
//! \param theIndex index to be stored. //! @param theIndex index to be stored.
inline void SetIndex(const Standard_Integer thePairPos, inline void SetIndex(const Standard_Integer thePairPos,
const Standard_Integer theIndex) const Standard_Integer theIndex)
{ {
@ -110,7 +110,7 @@ public:
} }
//! Remove index from the given position. //! 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) inline void RemoveIndex(const Standard_Integer thePairPos)
{ {
if (thePairPos != 1 && thePairPos != 2) if (thePairPos != 1 && thePairPos != 2)

View File

@ -41,7 +41,7 @@ public:
//! Sets the first element of the pair. //! Sets the first element of the pair.
//! If last element is empty, also assignes the given polygon to it. //! 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) inline void Prepend(const Handle(Poly_PolygonOnTriangulation)& thePolygon)
{ {
myFirst = thePolygon; myFirst = thePolygon;
@ -52,7 +52,7 @@ public:
//! Sets the last element of the pair. //! Sets the last element of the pair.
//! If first element is empty, also assignes the given polygon to it. //! 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) inline void Append(const Handle(Poly_PolygonOnTriangulation)& thePolygon)
{ {
if (myFirst.IsNull()) if (myFirst.IsNull())

View File

@ -74,7 +74,7 @@ void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOf(
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOfNode( void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOfNode(
const Standard_Integer theNodeIndex) const Standard_Integer theNodeIndex)
{ {
BRepMeshCol::ListOfInteger::Iterator aLinkIt( BRepMesh::ListOfInteger::Iterator aLinkIt(
myMesh->LinksConnectedTo(theNodeIndex)); myMesh->LinksConnectedTo(theNodeIndex));
for (; aLinkIt.More(); aLinkIt.Next()) for (; aLinkIt.More(); aLinkIt.Next())

View File

@ -18,7 +18,7 @@
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <BRepMesh_DataStructureOfDelaun.hxx> #include <BRepMesh_DataStructureOfDelaun.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <BRepMesh_Triangle.hxx> #include <BRepMesh_Triangle.hxx>
@ -75,25 +75,25 @@ public:
} }
//! Returns selected nodes. //! Returns selected nodes.
inline const BRepMeshCol::MapOfInteger& Nodes() const inline const BRepMesh::MapOfInteger& Nodes() const
{ {
return myNodes; return myNodes;
} }
//! Returns selected links. //! Returns selected links.
inline const BRepMeshCol::MapOfInteger& Links() const inline const BRepMesh::MapOfInteger& Links() const
{ {
return myLinks; return myLinks;
} }
//! Returns selected elements. //! Returns selected elements.
inline const BRepMeshCol::MapOfInteger& Elements() const inline const BRepMesh::MapOfInteger& Elements() const
{ {
return myElements; return myElements;
} }
//! Gives the list of incices of frontier links. //! Gives the list of incices of frontier links.
inline const BRepMeshCol::MapOfInteger& FrontierLinks() const inline const BRepMesh::MapOfInteger& FrontierLinks() const
{ {
return myFrontier; return myFrontier;
} }
@ -105,10 +105,10 @@ private:
private: private:
Handle(BRepMesh_DataStructureOfDelaun) myMesh; Handle(BRepMesh_DataStructureOfDelaun) myMesh;
BRepMeshCol::MapOfInteger myNodes; BRepMesh::MapOfInteger myNodes;
BRepMeshCol::MapOfInteger myLinks; BRepMesh::MapOfInteger myLinks;
BRepMeshCol::MapOfInteger myElements; BRepMesh::MapOfInteger myElements;
BRepMeshCol::MapOfInteger myFrontier; BRepMesh::MapOfInteger myFrontier;
}; };
#endif #endif

View File

@ -135,23 +135,23 @@ gp_XY BRepMesh_ShapeTool::FindUV(
const Handle(BRepMesh_FaceAttribute)& theFaceAttribute) const Handle(BRepMesh_FaceAttribute)& theFaceAttribute)
{ {
const gp_XY& aPnt2d = thePnt2d.Coord(); const gp_XY& aPnt2d = thePnt2d.Coord();
BRepMeshCol::DMapOfIntegerListOfXY& aLocation2D = BRepMesh::DMapOfIntegerListOfXY& aLocation2D =
theFaceAttribute->ChangeLocation2D(); theFaceAttribute->ChangeLocation2D();
if (!aLocation2D.IsBound(theIndexOfPnt3d)) if (!aLocation2D.IsBound(theIndexOfPnt3d))
{ {
BRepMeshCol::ListOfXY aPoints2d; BRepMesh::ListOfXY aPoints2d;
aPoints2d.Append(aPnt2d); aPoints2d.Append(aPnt2d);
aLocation2D.Bind(theIndexOfPnt3d, aPoints2d); aLocation2D.Bind(theIndexOfPnt3d, aPoints2d);
return aPnt2d; return aPnt2d;
} }
BRepMeshCol::ListOfXY& aPoints2d = aLocation2D.ChangeFind(theIndexOfPnt3d); BRepMesh::ListOfXY& aPoints2d = aLocation2D.ChangeFind(theIndexOfPnt3d);
// Find the most closest 2d point to the given one. // Find the most closest 2d point to the given one.
gp_XY aUV; gp_XY aUV;
Standard_Real aMinDist = RealLast(); Standard_Real aMinDist = RealLast();
BRepMeshCol::ListOfXY::Iterator aPoint2dIt(aPoints2d); BRepMesh::ListOfXY::Iterator aPoint2dIt(aPoints2d);
for (; aPoint2dIt.More(); aPoint2dIt.Next()) for (; aPoint2dIt.More(); aPoint2dIt.Next())
{ {
const gp_XY& aCurPnt2d = aPoint2dIt.Value(); const gp_XY& aCurPnt2d = aPoint2dIt.Value();

View File

@ -20,7 +20,7 @@
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <Handle_BRepAdaptor_HSurface.hxx> #include <Handle_BRepAdaptor_HSurface.hxx>
#include <BRepMesh_FaceAttribute.hxx> #include <BRepMesh_FaceAttribute.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <Handle_Poly_Triangulation.hxx> #include <Handle_Poly_Triangulation.hxx>
class TopoDS_Face; class TopoDS_Face;

View File

@ -45,9 +45,9 @@ public:
} }
//! Constructor. //! Constructor.
//! \param theEdges array of edges of triangle. //! @param theEdges array of edges of triangle.
//! \param theOrientations array of edge's orientations. //! @param theOrientations array of edge's orientations.
//! \param theMovability movability of triangle. //! @param theMovability movability of triangle.
Standard_EXPORT BRepMesh_Triangle( Standard_EXPORT BRepMesh_Triangle(
const Standard_Integer (&theEdges)[3], const Standard_Integer (&theEdges)[3],
const Standard_Boolean (&theOrientations)[3], const Standard_Boolean (&theOrientations)[3],
@ -57,9 +57,9 @@ public:
} }
//! Initializes the triangle by the given parameters. //! Initializes the triangle by the given parameters.
//! \param theEdges array of edges of triangle. //! @param theEdges array of edges of triangle.
//! \param theOrientations array of edge's orientations. //! @param theOrientations array of edge's orientations.
//! \param theMovability movability of triangle. //! @param theMovability movability of triangle.
inline void Initialize( inline void Initialize(
const Standard_Integer (&theEdges)[3], const Standard_Integer (&theEdges)[3],
const Standard_Boolean (&theOrientations)[3], const Standard_Boolean (&theOrientations)[3],
@ -75,8 +75,8 @@ public:
} }
//! Gets edges with orientations composing the triangle. //! Gets edges with orientations composing the triangle.
//! \param[out] theEdges array edges are stored to. //! @param[out] theEdges array edges are stored to.
//! \param[out] theOrientations array orientations are stored to. //! @param[out] theOrientations array orientations are stored to.
inline void Edges(Standard_Integer (&theEdges)[3], inline void Edges(Standard_Integer (&theEdges)[3],
Standard_Boolean (&theOrientations)[3]) const Standard_Boolean (&theOrientations)[3]) const
{ {
@ -101,16 +101,16 @@ public:
} }
//! Returns hash code for this triangle. //! Returns hash code for this triangle.
//! \param theUpper upper index in the container. //! @param theUpper upper index in the container.
//! \return hash code. //! @return hash code.
Standard_EXPORT Standard_Integer HashCode(const Standard_Integer theUpper) const Standard_EXPORT Standard_Integer HashCode(const Standard_Integer theUpper) const
{ {
return ::HashCode(myEdge1 + myEdge2 + myEdge3, theUpper); return ::HashCode(myEdge1 + myEdge2 + myEdge3, theUpper);
} }
//! Checks for equality with another triangle. //! Checks for equality with another triangle.
//! \param theOther triangle to be checked against this one. //! @param theOther triangle to be checked against this one.
//! \return TRUE if equal, FALSE if not. //! @return TRUE if equal, FALSE if not.
Standard_EXPORT Standard_Boolean IsEqual(const BRepMesh_Triangle& theOther) const Standard_EXPORT Standard_Boolean IsEqual(const BRepMesh_Triangle& theOther) const
{ {
if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted) if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted)

View File

@ -38,9 +38,9 @@ public:
} }
//! Creates vertex associated with point in 3d space. //! Creates vertex associated with point in 3d space.
//! \param theUV position of vertex in parametric space. //! @param theUV position of vertex in parametric space.
//! \param theLocation3d index of 3d point to be associated with vertex. //! @param theLocation3d index of 3d point to be associated with vertex.
//! \param theMovability movability of the vertex. //! @param theMovability movability of the vertex.
Standard_EXPORT BRepMesh_Vertex(const gp_XY& theUV, Standard_EXPORT BRepMesh_Vertex(const gp_XY& theUV,
const Standard_Integer theLocation3d, const Standard_Integer theLocation3d,
const BRepMesh_DegreeOfFreedom theMovability) const BRepMesh_DegreeOfFreedom theMovability)
@ -49,9 +49,9 @@ public:
} }
//! Creates vertex without association with point in 3d space. //! Creates vertex without association with point in 3d space.
//! \param theU U position of vertex in parametric space. //! @param theU U position of vertex in parametric space.
//! \param theV V position of vertex in parametric space. //! @param theV V position of vertex in parametric space.
//! \param theMovability movability of the vertex. //! @param theMovability movability of the vertex.
Standard_EXPORT BRepMesh_Vertex(const Standard_Real theU, Standard_EXPORT BRepMesh_Vertex(const Standard_Real theU,
const Standard_Real theV, const Standard_Real theV,
const BRepMesh_DegreeOfFreedom theMovability) const BRepMesh_DegreeOfFreedom theMovability)
@ -61,9 +61,9 @@ public:
{} {}
//! Initializes vertex associated with point in 3d space. //! Initializes vertex associated with point in 3d space.
//! \param theUV position of vertex in parametric space. //! @param theUV position of vertex in parametric space.
//! \param theLocation3d index of 3d point to be associated with vertex. //! @param theLocation3d index of 3d point to be associated with vertex.
//! \param theMovability movability of the vertex. //! @param theMovability movability of the vertex.
inline void Initialize(const gp_XY& theUV, inline void Initialize(const gp_XY& theUV,
const Standard_Integer theLocation3d, const Standard_Integer theLocation3d,
const BRepMesh_DegreeOfFreedom theMovability) const BRepMesh_DegreeOfFreedom theMovability)
@ -98,16 +98,16 @@ public:
} }
//! Returns hash code for this vertex. //! Returns hash code for this vertex.
//! \param theUpper upper index in the container. //! @param theUpper upper index in the container.
//! \return hash code. //! @return hash code.
Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const
{ {
return ::HashCode(Floor(1e5 * myUV.X()) * Floor(1e5 * myUV.Y()), Upper); return ::HashCode(Floor(1e5 * myUV.X()) * Floor(1e5 * myUV.Y()), Upper);
} }
//! Checks for equality with another vertex. //! Checks for equality with another vertex.
//! \param theOther vertex to be checked against this one. //! @param theOther vertex to be checked against this one.
//! \return TRUE if equal, FALSE if not. //! @return TRUE if equal, FALSE if not.
Standard_EXPORT Standard_Boolean IsEqual(const BRepMesh_Vertex& theOther) const Standard_EXPORT Standard_Boolean IsEqual(const BRepMesh_Vertex& theOther) const
{ {
if (myMovability == BRepMesh_Deleted || if (myMovability == BRepMesh_Deleted ||

View File

@ -19,7 +19,7 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <gp_XY.hxx> #include <gp_XY.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <NCollection_CellFilter.hxx> #include <NCollection_CellFilter.hxx>
#include <BRepMesh_Vertex.hxx> #include <BRepMesh_Vertex.hxx>
@ -30,11 +30,11 @@ public:
typedef Standard_Integer Target; typedef Standard_Integer Target;
//! Constructor. //! Constructor.
//! \param theReservedSize size to be reserved for vector of vertices. //! @param theReservedSize size to be reserved for vector of vertices.
//! \param theAllocator memory allocator to be used by internal collections. //! @param theAllocator memory allocator to be used by internal collections.
Standard_EXPORT BRepMesh_VertexInspector ( Standard_EXPORT BRepMesh_VertexInspector (
const Standard_Integer theReservedSize, const Standard_Integer theReservedSize,
const BRepMeshCol::Allocator& theAllocator) const Handle(NCollection_IncAllocator)& theAllocator)
: myResIndices(theAllocator), : myResIndices(theAllocator),
myVertices (theReservedSize), myVertices (theReservedSize),
myDelNodes (theAllocator) myDelNodes (theAllocator)
@ -43,7 +43,7 @@ public:
} }
//! Registers the given vertex. //! 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) Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex)
{ {
if( myDelNodes.IsEmpty() ) if( myDelNodes.IsEmpty() )
@ -69,8 +69,8 @@ public:
//! Sets the tolerance to be used for identification of //! Sets the tolerance to be used for identification of
//! coincident vertices. //! coincident vertices.
//! \param theToleranceX tolerance for X dimension. //! @param theToleranceX tolerance for X dimension.
//! \param theToleranceY tolerance for Y dimension. //! @param theToleranceY tolerance for Y dimension.
inline void SetTolerance(const Standard_Real theToleranceX, inline void SetTolerance(const Standard_Real theToleranceX,
const Standard_Real theToleranceY) const Standard_Real theToleranceY)
{ {
@ -86,7 +86,7 @@ public:
} }
//! Deletes vertex with the given index. //! 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) inline void Delete(const Standard_Integer theIndex)
{ {
myVertices(theIndex - 1).SetMovability(BRepMesh_Deleted); myVertices(theIndex - 1).SetMovability(BRepMesh_Deleted);
@ -124,14 +124,14 @@ public:
//! Returns list with indexes of vertices that have movability attribute //! Returns list with indexes of vertices that have movability attribute
//! equal to BRepMesh_Deleted and can be replaced with another node. //! 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; return myDelNodes;
} }
//! Performs inspection of a point with the given index. //! Performs inspection of a point with the given index.
//! \param theTargetIndex index of a circle to be checked. //! @param theTargetIndex index of a circle to be checked.
//! \return status of the check. //! @return status of the check.
Standard_EXPORT NCollection_CellFilter_Action Inspect(const Standard_Integer theTargetIndex); Standard_EXPORT NCollection_CellFilter_Action Inspect(const Standard_Integer theTargetIndex);
//! Checks indices for equlity. //! Checks indices for equlity.
@ -143,11 +143,11 @@ public:
private: private:
Standard_Real myTolerance[2]; Standard_Real myTolerance[2];
BRepMeshCol::ListOfInteger myResIndices; BRepMesh::ListOfInteger myResIndices;
BRepMeshCol::VectorOfVertex myVertices; BRepMesh::VectorOfVertex myVertices;
BRepMeshCol::ListOfInteger myDelNodes; BRepMesh::ListOfInteger myDelNodes;
gp_XY myPoint; gp_XY myPoint;
}; };
#endif #endif

View File

@ -56,8 +56,8 @@ NCollection_CellFilter_Action BRepMesh_VertexInspector::Inspect(
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_VertexTool::BRepMesh_VertexTool( BRepMesh_VertexTool::BRepMesh_VertexTool(
const Standard_Integer theReservedSize, const Standard_Integer theReservedSize,
const BRepMeshCol::Allocator& theAllocator) const Handle(NCollection_IncAllocator)& theAllocator)
: myAllocator (theAllocator), : myAllocator (theAllocator),
myCellFilter(0., myAllocator), myCellFilter(0., myAllocator),
mySelector (Max(theReservedSize, 64),myAllocator) mySelector (Max(theReservedSize, 64),myAllocator)
@ -76,7 +76,7 @@ Standard_Integer BRepMesh_VertexTool::Add(const BRepMesh_Vertex& theVertex)
Standard_Integer aIndex = FindIndex(theVertex); Standard_Integer aIndex = FindIndex(theVertex);
if (aIndex == 0) if (aIndex == 0)
{ {
BRepMeshCol::ListOfInteger aParams(myAllocator); BRepMesh::ListOfInteger aParams(myAllocator);
aIndex = Add(theVertex, aParams); aIndex = Add(theVertex, aParams);
} }
return aIndex; return aIndex;
@ -87,8 +87,8 @@ Standard_Integer BRepMesh_VertexTool::Add(const BRepMesh_Vertex& theVertex)
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer BRepMesh_VertexTool::Add( Standard_Integer BRepMesh_VertexTool::Add(
const BRepMesh_Vertex& theVertex, const BRepMesh_Vertex& theVertex,
const BRepMeshCol::ListOfInteger& theParams) const BRepMesh::ListOfInteger& theParams)
{ {
Standard_Integer aIndex = mySelector.Add(theVertex); Standard_Integer aIndex = mySelector.Add(theVertex);
myLinksMap.Bind(aIndex, theParams); myLinksMap.Bind(aIndex, theParams);
@ -120,9 +120,9 @@ void BRepMesh_VertexTool::Delete(const Standard_Integer theIndex)
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_VertexTool::Substitute( void BRepMesh_VertexTool::Substitute(
const Standard_Integer theIndex, const Standard_Integer theIndex,
const BRepMesh_Vertex& theVertex, const BRepMesh_Vertex& theVertex,
const BRepMeshCol::ListOfInteger& theData) const BRepMesh::ListOfInteger& theData)
{ {
BRepMesh_Vertex& aV = mySelector.GetVertex(theIndex); BRepMesh_Vertex& aV = mySelector.GetVertex(theIndex);

View File

@ -18,7 +18,7 @@
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <BRepMesh_VertexInspector.hxx> #include <BRepMesh_VertexInspector.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <Standard_OStream.hxx> #include <Standard_OStream.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <gp_XY.hxx> #include <gp_XY.hxx>
@ -35,10 +35,11 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Constructor. //! Constructor.
//! \param theReservedSize size to be reserved for vector of vertices. //! @param theReservedSize size to be reserved for vector of vertices.
//! \param theAllocator memory allocator to be used by internal collections. //! @param theAllocator memory allocator to be used by internal collections.
Standard_EXPORT BRepMesh_VertexTool(const Standard_Integer theReservedSize, Standard_EXPORT BRepMesh_VertexTool(
const BRepMeshCol::Allocator& theAllocator); const Standard_Integer theReservedSize,
const Handle(NCollection_IncAllocator)& theAllocator);
//! Sets new size of cell for cellfilter equal in both directions. //! Sets new size of cell for cellfilter equal in both directions.
Standard_EXPORT void SetCellSize(const Standard_Real theSize) Standard_EXPORT void SetCellSize(const Standard_Real theSize)
@ -48,8 +49,8 @@ public:
} }
//! Sets new size of cell for cellfilter. //! Sets new size of cell for cellfilter.
//! \param theSizeX size for X dimension. //! @param theSizeX size for X dimension.
//! \param theSizeY size for Y dimension. //! @param theSizeY size for Y dimension.
Standard_EXPORT void SetCellSize(const Standard_Real theSizeX, Standard_EXPORT void SetCellSize(const Standard_Real theSizeX,
const Standard_Real theSizeY) const Standard_Real theSizeY)
{ {
@ -69,8 +70,8 @@ public:
//! Sets the tolerance to be used for identification of //! Sets the tolerance to be used for identification of
//! coincident vertices. //! coincident vertices.
//! \param theToleranceX tolerance for X dimension. //! @param theToleranceX tolerance for X dimension.
//! \param theToleranceY tolerance for Y dimension. //! @param theToleranceY tolerance for Y dimension.
Standard_EXPORT void SetTolerance(const Standard_Real theToleranceX, Standard_EXPORT void SetTolerance(const Standard_Real theToleranceX,
const Standard_Real theToleranceY) const Standard_Real theToleranceY)
{ {
@ -83,24 +84,24 @@ public:
Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex); Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex);
//! Adds vertex with associated data to the tool. //! Adds vertex with associated data to the tool.
//! \param theVertex vertex to be added. //! @param theVertex vertex to be added.
//! \param theParams data associated with the vertex. //! @param theParams data associated with the vertex.
Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex, Standard_EXPORT Standard_Integer Add(const BRepMesh_Vertex& theVertex,
const BRepMeshCol::ListOfInteger& theParams); const BRepMesh::ListOfInteger& theParams);
//! Deletes vertex with the given index from the tool. //! Deletes vertex with the given index from the tool.
Standard_EXPORT void Delete(const Standard_Integer theIndex); Standard_EXPORT void Delete(const Standard_Integer theIndex);
//! Returns data assigned to link with the given index. //! Returns data assigned to link with the given index.
//! \param theIndex index of link which data should be returned. //! @param theIndex index of link which data should be returned.
//! \return attached data. //! @return attached data.
inline BRepMeshCol::ListOfInteger& FindFromIndex(const Standard_Integer theIndex) const inline BRepMesh::ListOfInteger& FindFromIndex(const Standard_Integer theIndex) const
{ {
return (BRepMeshCol::ListOfInteger&)myLinksMap.Find(theIndex); return (BRepMesh::ListOfInteger&)myLinksMap.Find(theIndex);
} }
//! Alias for FindFromIndex. //! Alias for FindFromIndex.
BRepMeshCol::ListOfInteger& operator()(const Standard_Integer theIndex) const BRepMesh::ListOfInteger& operator()(const Standard_Integer theIndex) const
{ {
return FindFromIndex(theIndex); return FindFromIndex(theIndex);
} }
@ -132,12 +133,12 @@ public:
} }
//! Substitutes vertex with the given by the given vertex with attributes. //! Substitutes vertex with the given by the given vertex with attributes.
//! \param theIndex index of vertex to be substituted. //! @param theIndex index of vertex to be substituted.
//! \param theVertex replacement vertex. //! @param theVertex replacement vertex.
//! \param theData data associated to the vertex. //! @param theData data associated to the vertex.
Standard_EXPORT void Substitute(const Standard_Integer theIndex, Standard_EXPORT void Substitute(const Standard_Integer theIndex,
const BRepMesh_Vertex& theVertex, const BRepMesh_Vertex& theVertex,
const BRepMeshCol::ListOfInteger& theData); const BRepMesh::ListOfInteger& theData);
//! Remove last node from the structure. //! Remove last node from the structure.
inline void RemoveLast() inline void RemoveLast()
@ -147,7 +148,7 @@ public:
//! Returns the list with indexes of vertices that have movability attribute //! Returns the list with indexes of vertices that have movability attribute
//! equal to BRepMesh_Deleted and can be replaced with another node. //! 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(); return mySelector.GetListOfDelPoints();
} }
@ -158,9 +159,9 @@ public:
private: private:
//! Expands the given point according to specified tolerance. //! Expands the given point according to specified tolerance.
//! \param thePoint point to be expanded. //! @param thePoint point to be expanded.
//! \param[out] theMinPoint bottom left corner of area defined by expanded point. //! @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[out] theMaxPoint top right corner of area defined by expanded point.
inline void expandPoint(const gp_XY& thePoint, inline void expandPoint(const gp_XY& thePoint,
gp_XY& theMinPoint, gp_XY& theMinPoint,
gp_XY& theMaxPoint) gp_XY& theMaxPoint)
@ -173,11 +174,11 @@ private:
private: private:
BRepMeshCol::Allocator myAllocator; Handle(NCollection_IncAllocator) myAllocator;
BRepMeshCol::VertexCellFilter myCellFilter; BRepMesh::VertexCellFilter myCellFilter;
BRepMesh_VertexInspector mySelector; BRepMesh_VertexInspector mySelector;
BRepMeshCol::DMapOfIntegerListOfInteger myLinksMap; BRepMesh::DMapOfIntegerListOfInteger myLinksMap;
Standard_Real myTolerance[2]; Standard_Real myTolerance[2];
}; };
#endif #endif

View File

@ -107,7 +107,7 @@ void BRepMesh_WireChecker::BndBox2dTreeSelector::SetSkippedIndex(
//function : Indices //function : Indices
//purpose : //purpose :
//======================================================================= //=======================================================================
const BRepMeshCol::Array1OfInteger& const BRepMesh::Array1OfInteger&
BRepMesh_WireChecker::BndBox2dTreeSelector::Indices() const BRepMesh_WireChecker::BndBox2dTreeSelector::Indices() const
{ {
return myIndices; return myIndices;
@ -129,8 +129,8 @@ Standard_Integer BRepMesh_WireChecker::BndBox2dTreeSelector::IndicesNb() const
BRepMesh_WireChecker::BRepMesh_WireChecker( BRepMesh_WireChecker::BRepMesh_WireChecker(
const TopoDS_Face& theFace, const TopoDS_Face& theFace,
const Standard_Real theTolUV, const Standard_Real theTolUV,
const BRepMeshCol::HDMapOfShapePairOfPolygon& theEdges, const BRepMesh::HDMapOfShapePairOfPolygon& theEdges,
const BRepMeshCol::HIMapOfInteger& theVertexMap, const BRepMesh::HIMapOfInteger& theVertexMap,
const Handle(BRepMesh_DataStructureOfDelaun)& theStructure, const Handle(BRepMesh_DataStructureOfDelaun)& theStructure,
const Standard_Real theUmin, const Standard_Real theUmin,
const Standard_Real theUmax, const Standard_Real theUmax,
@ -156,8 +156,8 @@ BRepMesh_WireChecker::BRepMesh_WireChecker(
{ {
const TopoDS_Wire& aWire = TopoDS::Wire(aFaceExplorer.Current()); const TopoDS_Wire& aWire = TopoDS::Wire(aFaceExplorer.Current());
myWiresEdges.push_back(ListOfEdges()); myWiresEdges.Append(ListOfEdges());
ListOfEdges& aEdges = myWiresEdges.back(); ListOfEdges& aEdges = myWiresEdges.ChangeLast();
// Start traversing the wires // Start traversing the wires
BRepTools_WireExplorer aWireExplorer(aWire, aFace); BRepTools_WireExplorer aWireExplorer(aWire, aFace);
@ -172,7 +172,7 @@ BRepMesh_WireChecker::BRepMesh_WireChecker(
} }
if (aEdges.IsEmpty()) if (aEdges.IsEmpty())
myWiresEdges.pop_back(); myWiresEdges.Remove(myWiresEdges.Size());
} }
} }
@ -180,7 +180,7 @@ BRepMesh_WireChecker::BRepMesh_WireChecker(
//function : ReCompute //function : ReCompute
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier) void BRepMesh_WireChecker::ReCompute(BRepMesh::HClassifier& theClassifier)
{ {
if (theClassifier.IsNull()) if (theClassifier.IsNull())
return; return;
@ -192,9 +192,8 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier)
if (!collectDiscretizedWires(aDWires)) if (!collectDiscretizedWires(aDWires))
return; return;
const Standard_Integer aNbWires = (Standard_Integer)aDWires.size(); const Standard_Integer aNbWires = aDWires.Size();
BRepMesh::Array1OfSegmentsTree aWiresBiPoints(1, aNbWires);
BRepMeshCol::Array1OfSegmentsTree aWiresBiPoints(aNbWires);
fillSegmentsTree(aDWires, aWiresBiPoints); fillSegmentsTree(aDWires, aWiresBiPoints);
#ifdef HAVE_TBB #ifdef HAVE_TBB
@ -205,7 +204,7 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier)
if (myIsInParallel && aNbWires > 1) if (myIsInParallel && aNbWires > 1)
{ {
// check wires in parallel threads using TBB // check wires in parallel threads using TBB
tbb::parallel_for(tbb::blocked_range<Standard_Integer>(0, aNbWires), tbb::parallel_for(tbb::blocked_range<Standard_Integer>(1, aNbWires + 1),
aIntChecker); aIntChecker);
} }
else else
@ -213,7 +212,7 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier)
#else #else
BRepMesh_WireInterferenceChecker aIntChecker(aWiresBiPoints, &myStatus); BRepMesh_WireInterferenceChecker aIntChecker(aWiresBiPoints, &myStatus);
#endif #endif
for (Standard_Integer i = 0; i < aNbWires; ++i) for (Standard_Integer i = 1; i <= aNbWires; ++i)
aIntChecker(i); aIntChecker(i);
#ifdef HAVE_TBB #ifdef HAVE_TBB
} }
@ -223,10 +222,10 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier)
return; return;
// Find holes // Find holes
SeqOfDWires::iterator aDWiresIt = aDWires.begin(); SeqOfDWires::Iterator aDWiresIt(aDWires);
for (; aDWiresIt != aDWires.end(); ++aDWiresIt) for (; aDWiresIt.More(); aDWiresIt.Next())
{ {
const SeqOfPnt2d& aDWire = *aDWiresIt; const SeqOfPnt2d& aDWire = aDWiresIt.Value();
theClassifier->RegisterWire(aDWire, myTolUV, myUmin, myUmax, myVmin, myVmax); theClassifier->RegisterWire(aDWire, myTolUV, myUmin, myUmax, myVmin, myVmax);
} }
} }
@ -238,11 +237,10 @@ void BRepMesh_WireChecker::ReCompute(BRepMeshCol::HClassifier& theClassifier)
Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires( Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires(
SeqOfDWires& theDWires) SeqOfDWires& theDWires)
{ {
// TODO: Collect disretized wires in parallel SeqOfWireEdges::Iterator aWireIt(myWiresEdges);
SeqOfWireEdges::iterator aWireIt = myWiresEdges.begin(); for(; aWireIt.More(); aWireIt.Next())
for(; aWireIt != myWiresEdges.end(); ++aWireIt)
{ {
const ListOfEdges& aEdges = *aWireIt; const ListOfEdges& aEdges = aWireIt.Value();
// For each wire we create a data map, linking vertices (only // For each wire we create a data map, linking vertices (only
// the ends of edges) with their positions in the sequence of // the ends of edges) with their positions in the sequence of
// all 2d points from this wire. // 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 // loop from the map, but since they can't appear twice on the
// valid wire, leave them for a little speed up. // valid wire, leave them for a little speed up.
SeqOfPnt2d aSeqPnt2d; SeqOfPnt2d aSeqPnt2d;
DataMapIntInt aNodeInSeq; BRepMesh::MapOfIntegerInteger aNodeInSeq;
Standard_Integer aFirstIndex = 0, aLastIndex = 0; Standard_Integer aFirstIndex = 0, aLastIndex = 0;
// Start traversing the wire // Start traversing the wire
@ -331,8 +329,8 @@ Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires(
const Standard_Integer aIdxWireStart = aNodeInSeq(aLastVertexId); const Standard_Integer aIdxWireStart = aNodeInSeq(aLastVertexId);
if(aIdxWireStart < aSeqPnt2d.Length()) if(aIdxWireStart < aSeqPnt2d.Length())
{ {
theDWires.push_back(SeqOfPnt2d()); theDWires.Append(SeqOfPnt2d());
SeqOfPnt2d& aWire = theDWires.back(); SeqOfPnt2d& aWire = theDWires.ChangeLast();
aSeqPnt2d.Split(aIdxWireStart, aWire); aSeqPnt2d.Split(aIdxWireStart, aWire);
} }
} }
@ -357,22 +355,22 @@ Standard_Boolean BRepMesh_WireChecker::collectDiscretizedWires(
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepMesh_WireChecker::fillSegmentsTree( void BRepMesh_WireChecker::fillSegmentsTree(
const SeqOfDWires& theDWires, const SeqOfDWires& theDWires,
BRepMeshCol::Array1OfSegmentsTree& theWiresSegmentsTree) BRepMesh::Array1OfSegmentsTree& theWiresSegmentsTree)
{ {
const size_t aNbWires = theDWires.size(); const Standard_Integer aNbWires = theDWires.Size();
for (size_t aWireIt = 0; aWireIt < aNbWires; ++aWireIt) for (Standard_Integer aWireIt = 1; aWireIt <= aNbWires; ++aWireIt)
{ {
const SeqOfPnt2d& aWire = theDWires[aWireIt]; const SeqOfPnt2d& aWire = theDWires(aWireIt);
const Standard_Integer aWireLen = aWire.Size(); const Standard_Integer aWireLen = aWire.Size();
BRepMeshCol::HArray1OfSegments aWireSegments = BRepMesh::HArray1OfSegments aWireSegments =
new BRepMeshCol::Array1OfSegments(aWireLen); new BRepMesh::Array1OfSegments(1, aWireLen);
BRepMeshCol::HBndBox2dTree aBndBoxTree = BRepMesh::HBndBox2dTree aBndBoxTree =
new BRepMeshCol::BndBox2dTree; new BRepMesh::BndBox2dTree;
BRepMeshCol::BndBox2dTreeFiller aBndBoxTreeFiller(*aBndBoxTree); BRepMesh::BndBox2dTreeFiller aBndBoxTreeFiller(*aBndBoxTree);
Standard_Real x1 = 0., y1 = 0., aXstart = 0., aYstart = 0.; Standard_Real x1 = 0., y1 = 0., aXstart = 0., aYstart = 0.;
for (Standard_Integer aPntIt = 0; aPntIt <= aWireLen; ++aPntIt) for (Standard_Integer aPntIt = 0; aPntIt <= aWireLen; ++aPntIt)
@ -402,22 +400,21 @@ void BRepMesh_WireChecker::fillSegmentsTree(
gp_Pnt2d aStartPnt(x1, y1); gp_Pnt2d aStartPnt(x1, y1);
gp_Pnt2d aEndPnt(x2, y2); gp_Pnt2d aEndPnt(x2, y2);
const Standard_Integer aPointId = aPntIt - 1; BRepMesh::Segment& aSegment = aWireSegments->ChangeValue(aPntIt);
BRepMeshCol::Segment& aSegment = aWireSegments->at(aPointId);
aSegment.StartPnt = aStartPnt.XY(); aSegment.StartPnt = aStartPnt.XY();
aSegment.EndPnt = aEndPnt.XY(); aSegment.EndPnt = aEndPnt.XY();
Bnd_Box2d aBox; Bnd_Box2d aBox;
aBox.Add(aStartPnt); aBox.Add(aStartPnt);
aBox.Add( aEndPnt); aBox.Add( aEndPnt);
aBndBoxTreeFiller.Add(aPointId, aBox); aBndBoxTreeFiller.Add(aPntIt, aBox);
} }
x1 = x2; x1 = x2;
y1 = y2; y1 = y2;
} }
aBndBoxTreeFiller.Fill(); aBndBoxTreeFiller.Fill();
BRepMeshCol::SegmentsTree& aSegmentsTree = theWiresSegmentsTree[aWireIt]; BRepMesh::SegmentsTree& aSegmentsTree = theWiresSegmentsTree(aWireIt);
aSegmentsTree.first = aWireSegments; aSegmentsTree.first = aWireSegments;
aSegmentsTree.second = aBndBoxTree; aSegmentsTree.second = aBndBoxTree;
} }

View File

@ -21,7 +21,7 @@
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <BRepMesh_Status.hxx> #include <BRepMesh_Status.hxx>
#include <BRepMesh_DataStructureOfDelaun.hxx> #include <BRepMesh_DataStructureOfDelaun.hxx>
#include <BRepMesh_Collections.hxx> #include <BRepMesh.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <Bnd_Box2d.hxx> #include <Bnd_Box2d.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
@ -43,7 +43,7 @@ public:
//! Used to identify segments with overlapped bounding boxes. //! Used to identify segments with overlapped bounding boxes.
//! Note that instance of selector can be used only once due to //! Note that instance of selector can be used only once due to
//! unextentable array of indices. //! unextentable array of indices.
class BndBox2dTreeSelector : public BRepMeshCol::BndBox2dTree::Selector class BndBox2dTreeSelector : public BRepMesh::BndBox2dTree::Selector
{ {
public: public:
Standard_EXPORT BndBox2dTreeSelector(const Standard_Integer theReservedSize); Standard_EXPORT BndBox2dTreeSelector(const Standard_Integer theReservedSize);
@ -53,42 +53,41 @@ public:
Standard_EXPORT void Clear(); Standard_EXPORT void Clear();
Standard_EXPORT void SetBox(const Bnd_Box2d& theBox2D); Standard_EXPORT void SetBox(const Bnd_Box2d& theBox2D);
Standard_EXPORT void SetSkippedIndex(const Standard_Integer theIndex); 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; Standard_EXPORT Standard_Integer IndicesNb() const;
protected: protected:
Bnd_Box2d myBox2D; Bnd_Box2d myBox2D;
Standard_Integer mySkippedIndex; Standard_Integer mySkippedIndex;
BRepMeshCol::Array1OfInteger myIndices; BRepMesh::Array1OfInteger myIndices;
Standard_Integer myIndicesNb; Standard_Integer myIndicesNb;
}; };
private: private:
typedef NCollection_List<TopoDS_Edge> ListOfEdges; typedef NCollection_List<TopoDS_Edge> ListOfEdges;
typedef std::vector<ListOfEdges> SeqOfWireEdges; typedef NCollection_Sequence<ListOfEdges> SeqOfWireEdges;
typedef NCollection_Sequence<gp_Pnt2d> SeqOfPnt2d;
typedef std::vector<SeqOfPnt2d> SeqOfDWires; typedef NCollection_Sequence<gp_Pnt2d> SeqOfPnt2d;
typedef NCollection_DataMap<Standard_Integer, Standard_Integer> DataMapIntInt; typedef NCollection_Sequence<SeqOfPnt2d> SeqOfDWires;
typedef std::pair<Standard_Integer, gp_XY> PairIntPnt;
public: public:
//! Constructor. //! Constructor.
//! \param theFace Face to be checked. //! @param theFace Face to be checked.
//! \param theTolUV Tolerance to be used for calculations in parametric space. //! @param theTolUV Tolerance to be used for calculations in parametric space.
//! \param theEdges Map of edges with associated polygon on triangulation. //! @param theEdges Map of edges with associated polygon on triangulation.
//! \param theVertexMap Map of face vertices. //! @param theVertexMap Map of face vertices.
//! \param theStructure Discretized representation of face in parametric space. //! @param theStructure Discretized representation of face in parametric space.
//! \param theUmin Lower U boundary of the 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 theUmax Upper U boundary of the face in parametric space.
//! \param theVmin Lower V 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 theVmax Upper V boundary of the face in parametric space.
Standard_EXPORT BRepMesh_WireChecker( Standard_EXPORT BRepMesh_WireChecker(
const TopoDS_Face& theFace, const TopoDS_Face& theFace,
const Standard_Real theTolUV, const Standard_Real theTolUV,
const BRepMeshCol::HDMapOfShapePairOfPolygon& theEdges, const BRepMesh::HDMapOfShapePairOfPolygon& theEdges,
const BRepMeshCol::HIMapOfInteger& theVertexMap, const BRepMesh::HIMapOfInteger& theVertexMap,
const Handle(BRepMesh_DataStructureOfDelaun)& theStructure, const Handle(BRepMesh_DataStructureOfDelaun)& theStructure,
const Standard_Real theUmin, const Standard_Real theUmin,
const Standard_Real theUmax, const Standard_Real theUmax,
@ -97,8 +96,8 @@ public:
const Standard_Boolean isInParallel); const Standard_Boolean isInParallel);
//! Recompute data using parameters passed in constructor. //! Recompute data using parameters passed in constructor.
//! \param[out] theClassifier Classifier to be updated using calculated data. //! @param[out] theClassifier Classifier to be updated using calculated data.
Standard_EXPORT void ReCompute(BRepMeshCol::HClassifier& theClassifier); Standard_EXPORT void ReCompute(BRepMesh::HClassifier& theClassifier);
//! Returns status of the check. //! Returns status of the check.
inline BRepMesh_Status Status() const inline BRepMesh_Status Status() const
@ -109,17 +108,17 @@ public:
private: private:
//! Collects disñrete wires. //! Collects disñrete wires.
//! \param[out] theDWires sequence of discretized wires to be filled. //! @param[out] theDWires sequence of discretized wires to be filled.
//! \return TRUE on success, FALSE in case of open wire. //! @return TRUE on success, FALSE in case of open wire.
Standard_Boolean collectDiscretizedWires(SeqOfDWires& theDWires); Standard_Boolean collectDiscretizedWires(SeqOfDWires& theDWires);
//! Fills array of BiPoints for corresponding wire. //! Fills array of BiPoints for corresponding wire.
//! \param theDWires Sequence of wires to be processed. //! @param theDWires Sequence of wires to be processed.
//! \param theWiresSegmentsTree Array of segments with corresponding //! @param theWiresSegmentsTree Array of segments with corresponding
//! bounding boxes trees to be filled. //! bounding boxes trees to be filled.
void fillSegmentsTree( void fillSegmentsTree(
const SeqOfDWires& theDWires, const SeqOfDWires& theDWires,
BRepMeshCol::Array1OfSegmentsTree& theWiresSegmentsTree); BRepMesh::Array1OfSegmentsTree& theWiresSegmentsTree);
//! Assignment operator. //! Assignment operator.
void operator =(BRepMesh_WireChecker& /*theOther*/) void operator =(BRepMesh_WireChecker& /*theOther*/)
@ -129,8 +128,8 @@ private:
private: private:
const Standard_Real myTolUV; const Standard_Real myTolUV;
const BRepMeshCol::HDMapOfShapePairOfPolygon& myEdges; const BRepMesh::HDMapOfShapePairOfPolygon& myEdges;
const BRepMeshCol::HIMapOfInteger& myVertexMap; const BRepMesh::HIMapOfInteger& myVertexMap;
const Handle(BRepMesh_DataStructureOfDelaun)& myStructure; const Handle(BRepMesh_DataStructureOfDelaun)& myStructure;
const Standard_Real myUmin; const Standard_Real myUmin;
const Standard_Real myUmax; const Standard_Real myUmax;

View File

@ -26,13 +26,12 @@ static const Standard_Real MIN_LOOP_S = 2 * M_PI * 2.E-5;
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_WireInterferenceChecker::BRepMesh_WireInterferenceChecker( BRepMesh_WireInterferenceChecker::BRepMesh_WireInterferenceChecker(
const std::vector<BRepMeshCol::SegmentsTree>& theWires, const BRepMesh::Array1OfSegmentsTree& theWires,
BRepMesh_Status* theStatus, BRepMesh_Status* theStatus,
Standard_Mutex* theMutex) Standard_Mutex* theMutex)
: myWires (&theWires.front()), : myWires (theWires),
myWiresNb ((Standard_Integer)theWires.size()), myStatus(theStatus),
myStatus (theStatus), myMutex (theMutex)
myMutex (theMutex)
{ {
} }
@ -52,11 +51,10 @@ void BRepMesh_WireInterferenceChecker::operator ()(
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepMesh_WireInterferenceChecker::BRepMesh_WireInterferenceChecker( BRepMesh_WireInterferenceChecker::BRepMesh_WireInterferenceChecker(
const std::vector<BRepMeshCol::SegmentsTree>& theWires, const BRepMesh::Array1OfSegmentsTree& theWires,
BRepMesh_Status* theStatus) BRepMesh_Status* theStatus)
: myWires (&theWires.front()), : myWires (theWires),
myWiresNb ((Standard_Integer)theWires.size()), myStatus(theStatus)
myStatus (theStatus)
{ {
} }
#endif #endif
@ -71,12 +69,11 @@ void BRepMesh_WireInterferenceChecker::operator ()(
if (*myStatus == BRepMesh_SelfIntersectingWire) if (*myStatus == BRepMesh_SelfIntersectingWire)
return; return;
const BRepMeshCol::SegmentsTree& aWireSegTree1 = myWires[theWireId]; const BRepMesh::SegmentsTree& aWireSegTree1 = myWires(theWireId);
const BRepMeshCol::Segment* aWireSegments1 = &aWireSegTree1.first->front(); const BRepMesh::HArray1OfSegments& aWireSegments1 = aWireSegTree1.first;
const BRepMeshCol::HBndBox2dTree& aWireBoxTree1 = aWireSegTree1.second; const BRepMesh::HBndBox2dTree& aWireBoxTree1 = aWireSegTree1.second;
const Standard_Integer aWireLen1 = (Standard_Integer)aWireSegTree1.first->size();
for (Standard_Integer aWireIt = theWireId; aWireIt < myWiresNb; ++aWireIt) for (Standard_Integer aWireIt = theWireId; aWireIt <= myWires.Upper(); ++aWireIt)
{ {
#ifdef HAVE_TBB #ifdef HAVE_TBB
// Break execution in case if flag was raised by another thread // Break execution in case if flag was raised by another thread
@ -85,14 +82,16 @@ void BRepMesh_WireInterferenceChecker::operator ()(
#endif #endif
const Standard_Boolean isSelfIntCheck = (aWireIt == theWireId); const Standard_Boolean isSelfIntCheck = (aWireIt == theWireId);
const BRepMeshCol::SegmentsTree& aWireSegTree2 = const BRepMesh::SegmentsTree& aWireSegTree2 =
isSelfIntCheck ? aWireSegTree1 : myWires[aWireIt]; isSelfIntCheck ? aWireSegTree1 : myWires(aWireIt);
const BRepMeshCol::Segment* aWireSegments2 = &aWireSegTree2.first->front(); const BRepMesh::HArray1OfSegments& aWireSegments2 = aWireSegTree2.first;
const BRepMeshCol::HBndBox2dTree& aWireBoxTree2 = aWireSegTree2.second; const BRepMesh::HBndBox2dTree& aWireBoxTree2 = aWireSegTree2.second;
BRepMesh_WireChecker::BndBox2dTreeSelector aSelector ((Standard_Integer)aWireSegTree2.first->size()); BRepMesh_WireChecker::BndBox2dTreeSelector aSelector (aWireSegments2->Size());
for (Standard_Integer aSegmentId1 = 0; aSegmentId1 < aWireLen1; ++aSegmentId1)
Standard_Integer aSegmentId1 = aWireSegments1->Lower();
for (; aSegmentId1 <= aWireSegments1->Upper(); ++aSegmentId1)
{ {
#ifdef HAVE_TBB #ifdef HAVE_TBB
// Break execution in case if flag was raised by another thread // Break execution in case if flag was raised by another thread
@ -108,8 +107,8 @@ void BRepMesh_WireInterferenceChecker::operator ()(
if (aWireBoxTree2->Select(aSelector) == 0) if (aWireBoxTree2->Select(aSelector) == 0)
continue; continue;
const BRepMeshCol::Segment& aSegment1 = aWireSegments1[aSegmentId1]; const BRepMesh::Segment& aSegment1 = aWireSegments1->Value(aSegmentId1);
const BRepMeshCol::Array1OfInteger& aSelected = aSelector.Indices(); const BRepMesh::Array1OfInteger& aSelected = aSelector.Indices();
const Standard_Integer aSelectedNb = aSelector.IndicesNb(); const Standard_Integer aSelectedNb = aSelector.IndicesNb();
for (Standard_Integer aBndIt = 0; aBndIt < aSelectedNb; ++aBndIt) for (Standard_Integer aBndIt = 0; aBndIt < aSelectedNb; ++aBndIt)
{ {
@ -120,7 +119,7 @@ void BRepMesh_WireInterferenceChecker::operator ()(
#endif #endif
const Standard_Integer aSegmentId2 = aSelected(aBndIt); const Standard_Integer aSegmentId2 = aSelected(aBndIt);
const BRepMeshCol::Segment& aSegment2 = aWireSegments2[aSegmentId2]; const BRepMesh::Segment& aSegment2 = aWireSegments2->Value(aSegmentId2);
gp_Pnt2d aIntPnt; gp_Pnt2d aIntPnt;
BRepMesh_GeomTool::IntFlag aIntStatus = BRepMesh_GeomTool::IntSegSeg( BRepMesh_GeomTool::IntFlag aIntStatus = BRepMesh_GeomTool::IntSegSeg(
@ -139,7 +138,7 @@ void BRepMesh_WireInterferenceChecker::operator ()(
const gp_XY& aRefPnt = aIntPnt.Coord(); const gp_XY& aRefPnt = aIntPnt.Coord();
for (Standard_Integer i = aSegmentId1; i < aSegmentId2; ++i) 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; gp_XY aCurVec = aSeg.EndPnt - aRefPnt;
if (aCurVec.SquareModulus() < gp::Resolution()) if (aCurVec.SquareModulus() < gp::Resolution())

View File

@ -45,48 +45,53 @@ public:
#ifdef HAVE_TBB #ifdef HAVE_TBB
//! Constructor //! Constructor
//! \param theWires wires that should be checked. //! @param theWires wires that should be checked.
//! \param theStatus shared flag to set status of the check. //! @param theStatus shared flag to set status of the check.
//! \param theMutex shared mutex for parallel processing. //! @param theMutex shared mutex for parallel processing.
BRepMesh_WireInterferenceChecker( BRepMesh_WireInterferenceChecker(
const std::vector<BRepMeshCol::SegmentsTree>& theWires, const BRepMesh::Array1OfSegmentsTree& theWires,
BRepMesh_Status* theStatus, BRepMesh_Status* theStatus,
Standard_Mutex* theMutex); Standard_Mutex* theMutex);
//! Checker's body. //! 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<Standard_Integer>& theWireRange) const; void operator ()(const tbb::blocked_range<Standard_Integer>& theWireRange) const;
#else #else
//! Constructor //! Constructor
//! \param theWires wires that should be checked. //! @param theWires wires that should be checked.
//! \param theStatus shared flag to set status of the check. //! @param theStatus shared flag to set status of the check.
BRepMesh_WireInterferenceChecker( BRepMesh_WireInterferenceChecker(
const std::vector<BRepMeshCol::SegmentsTree>& theWires, const BRepMesh::Array1OfSegmentsTree& theWires,
BRepMesh_Status* theStatus); BRepMesh_Status* theStatus);
#endif #endif
//! Checker's body. //! 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; void operator ()(const Standard_Integer& theWireId) const;
private: private:
//! Classifies the point in case of coincidence of two vectors. //! Classifies the point in case of coincidence of two vectors.
//! \param thePoint1 the start point of a segment (base point). //! @param thePoint1 the start point of a segment (base point).
//! \param thePoint2 the end point of a segment. //! @param thePoint2 the end point of a segment.
//! \param thePointToCheck the point to classify. //! @param thePointToCheck the point to classify.
//! \return zero value if point is out of segment and non zero value //! @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. //! if point is between the first and the second point of segment.
static Standard_Integer classifyPoint (const gp_XY& thePoint1, static Standard_Integer classifyPoint (const gp_XY& thePoint1,
const gp_XY& thePoint2, const gp_XY& thePoint2,
const gp_XY& thePointToCheck); const gp_XY& thePointToCheck);
//! Assignment operator.
void operator =(const BRepMesh_WireInterferenceChecker& /*theOther*/)
{
}
private: private:
const BRepMeshCol::SegmentsTree* myWires; const BRepMesh::Array1OfSegmentsTree& myWires;
Standard_Integer myWiresNb; BRepMesh_Status* myStatus;
BRepMesh_Status* myStatus;
#ifdef HAVE_TBB #ifdef HAVE_TBB
Standard_Mutex* myMutex; Standard_Mutex* myMutex;
#endif #endif
}; };

View File

@ -1,8 +1,10 @@
BRepMesh.hxx
BRepMesh_PluginEntryType.hxx BRepMesh_PluginEntryType.hxx
BRepMesh_PluginMacro.hxx BRepMesh_PluginMacro.hxx
BRepMesh_DegreeOfFreedom.hxx BRepMesh_DegreeOfFreedom.hxx
BRepMesh_FactoryError.hxx BRepMesh_FactoryError.hxx
BRepMesh_Vertex.hxx BRepMesh_Vertex.hxx
BRepMesh_OrientedEdge.hxx
BRepMesh_Edge.hxx BRepMesh_Edge.hxx
BRepMesh_Triangle.hxx BRepMesh_Triangle.hxx
BRepMesh_Circle.hxx BRepMesh_Circle.hxx
@ -16,7 +18,6 @@ BRepMesh_DiscretRoot.hxx
BRepMesh_DiscretRoot.cxx BRepMesh_DiscretRoot.cxx
BRepMesh_DiscretFactory.hxx BRepMesh_DiscretFactory.hxx
BRepMesh_DiscretFactory.cxx BRepMesh_DiscretFactory.cxx
BRepMesh_Collections.hxx
BRepMesh_DataStructureOfDelaun.hxx BRepMesh_DataStructureOfDelaun.hxx
BRepMesh_DataStructureOfDelaun.cxx BRepMesh_DataStructureOfDelaun.cxx
BRepMesh_CircleTool.hxx BRepMesh_CircleTool.hxx

View File

@ -21,8 +21,7 @@ package MeshTest
uses uses
TColStd, TColStd,
Draw, Draw,
TopoDS, TopoDS
BRepMesh
is is

View File

@ -41,7 +41,6 @@ uses
HLRAlgo, HLRAlgo,
HLRBRep, HLRBRep,
Quantity, Quantity,
BRepMesh,
gp, gp,
TColgp, TColgp,
Poly, Poly,