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