mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-02 17:46:22 +03:00
OCC22138 Remove *.gxx files from Mesh algorithm
This commit is contained in:
parent
d772319aab
commit
0d88155bb2
@ -8,7 +8,6 @@
|
||||
package BRepMesh
|
||||
|
||||
---Purpose: Instantiated package for the class of packages
|
||||
-- MeshAlgo, and so on ...
|
||||
|
||||
---Level : Advanced.
|
||||
-- All methods of all classes will be advanced.
|
||||
@ -22,8 +21,6 @@ uses Standard,
|
||||
GCPnts,
|
||||
BRepAdaptor,
|
||||
BRepTopAdaptor,
|
||||
MeshDS,
|
||||
MeshAlgo,
|
||||
TCollection,
|
||||
MMgt,
|
||||
TopoDS,
|
||||
@ -34,10 +31,18 @@ uses Standard,
|
||||
Geom2d,
|
||||
GeomAbs,
|
||||
GeomAdaptor,
|
||||
TopLoc
|
||||
TopLoc,
|
||||
SortTools
|
||||
|
||||
|
||||
is
|
||||
is enumeration DegreeOfFreedom is
|
||||
Free,
|
||||
InVolume,
|
||||
OnSurface,
|
||||
OnCurve,
|
||||
Fixed,
|
||||
Frontier,
|
||||
Deleted;
|
||||
|
||||
enumeration Status is
|
||||
---Purpose: Discribes the wires discretisation.
|
||||
@ -45,7 +50,7 @@ is
|
||||
OpenWire,
|
||||
SelfIntersectingWire,
|
||||
Failure,
|
||||
ReMesh
|
||||
ReMesh
|
||||
end Status;
|
||||
|
||||
enumeration FactoryError is
|
||||
@ -62,16 +67,63 @@ is
|
||||
class Triangle;
|
||||
|
||||
class ShapeTool;
|
||||
|
||||
|
||||
class Circ;
|
||||
|
||||
deferred class DiscretRoot;
|
||||
class DiscretFactory;
|
||||
--
|
||||
pointer PDiscretRoot to DiscretRoot from BRepMesh;
|
||||
--
|
||||
imported MapOfIntegerInteger from BRepMesh;
|
||||
imported MapOfInteger from BRepMesh;
|
||||
imported ListOfInteger from BRepMesh;
|
||||
imported BaseAllocator from BRepMesh;
|
||||
imported PairOfIndex from BRepMesh;
|
||||
imported CircleInspector from BRepMesh;
|
||||
imported CellFilter from BRepMesh;
|
||||
|
||||
class Delaun instantiates Delaunay from MeshAlgo(Vertex from BRepMesh,
|
||||
Edge from BRepMesh,
|
||||
Triangle from BRepMesh);
|
||||
class ComparatorOfVertexOfDelaun;
|
||||
class ComparatorOfIndexedVertexOfDelaun;
|
||||
class SelectorOfDataStructureOfDelaun;
|
||||
class Delaun;
|
||||
class DataStructureOfDelaun;
|
||||
class CircleTool;
|
||||
|
||||
class Array1OfVertexOfDelaun instantiates Array1 from TCollection
|
||||
(Vertex from BRepMesh);
|
||||
|
||||
class HArray1OfVertexOfDelaun instantiates HArray1 from TCollection
|
||||
(Vertex from BRepMesh, Array1OfVertexOfDelaun);
|
||||
|
||||
class HeapSortVertexOfDelaun instantiates HeapSort from SortTools
|
||||
(Vertex from BRepMesh, Array1OfVertexOfDelaun,
|
||||
ComparatorOfVertexOfDelaun from BRepMesh);
|
||||
|
||||
class HeapSortIndexedVertexOfDelaun instantiates HeapSort from SortTools
|
||||
(Integer, Array1OfInteger from TColStd,
|
||||
ComparatorOfIndexedVertexOfDelaun from BRepMesh);
|
||||
|
||||
class NodeHasherOfDataStructureOfDelaun instantiates MapHasher from TCollection
|
||||
(Vertex from BRepMesh);
|
||||
class LinkHasherOfDataStructureOfDelaun instantiates MapHasher from TCollection
|
||||
(Edge from BRepMesh);
|
||||
class ElemHasherOfDataStructureOfDelaun instantiates MapHasher from TCollection
|
||||
(Triangle from BRepMesh);
|
||||
|
||||
class IDMapOfNodeOfDataStructureOfDelaun instantiates IndexedDataMap from TCollection
|
||||
(Vertex from BRepMesh,
|
||||
ListOfInteger from BRepMesh,
|
||||
NodeHasherOfDataStructureOfDelaun);
|
||||
|
||||
class IDMapOfLinkOfDataStructureOfDelaun instantiates IndexedDataMap from TCollection
|
||||
(Edge from BRepMesh,
|
||||
PairOfIndex from BRepMesh,
|
||||
LinkHasherOfDataStructureOfDelaun);
|
||||
|
||||
class IMapOfElementOfDataStructureOfDelaun instantiates IndexedMap from TCollection
|
||||
(Triangle from BRepMesh,
|
||||
ElemHasherOfDataStructureOfDelaun);
|
||||
|
||||
class DataMapOfVertexInteger instantiates DataMap from TCollection
|
||||
(Vertex from TopoDS, Integer from Standard, ShapeMapHasher from TopTools);
|
||||
|
3
src/BRepMesh/BRepMesh_BaseAllocator.hxx
Executable file
3
src/BRepMesh/BRepMesh_BaseAllocator.hxx
Executable file
@ -0,0 +1,3 @@
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
|
||||
typedef Handle_NCollection_IncAllocator BRepMesh_BaseAllocator;
|
12
src/BRepMesh/BRepMesh_CellFilter.hxx
Executable file
12
src/BRepMesh/BRepMesh_CellFilter.hxx
Executable file
@ -0,0 +1,12 @@
|
||||
// File: BRepMesh_CellFilter.hxx
|
||||
// Created: May 26 16:40:53 2008
|
||||
// Author: Ekaterina SMIRNOVA
|
||||
// Copyright: Open CASCADE SAS 2008
|
||||
|
||||
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <NCollection_CellFilter.hxx>
|
||||
#include <BRepMesh_CircleInspector.hxx>
|
||||
|
||||
typedef NCollection_CellFilter<BRepMesh_CircleInspector> BRepMesh_CellFilter;
|
45
src/BRepMesh/BRepMesh_Circ.cdl
Executable file
45
src/BRepMesh/BRepMesh_Circ.cdl
Executable file
@ -0,0 +1,45 @@
|
||||
-- File: BRepMesh_Circ.cdl
|
||||
-- Created: Mon Aug 9 16:31:05 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class Circ from BRepMesh
|
||||
|
||||
---Purpose: Describes a 2d circle with a size of only 3
|
||||
-- Standard Real numbers instead of gp who needs 7
|
||||
-- Standard Real numbers.
|
||||
|
||||
uses Real from Standard,
|
||||
XY from gp
|
||||
|
||||
|
||||
is Create returns Circ from BRepMesh;
|
||||
|
||||
Create (loc : XY from gp; rad : Real from Standard)
|
||||
returns Circ from BRepMesh;
|
||||
|
||||
SetLocation(me : in out; loc : XY from gp)
|
||||
is static;
|
||||
|
||||
SetRadius (me : in out; rad : Real from Standard)
|
||||
is static;
|
||||
|
||||
Location (me)
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
returns XY from gp
|
||||
is static;
|
||||
|
||||
Radius (me)
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
returns Real from Standard
|
||||
is static;
|
||||
|
||||
|
||||
fields location : XY from gp;
|
||||
radius : Real from Standard;
|
||||
|
||||
end Circ;
|
23
src/BRepMesh/BRepMesh_Circ.cxx
Executable file
23
src/BRepMesh/BRepMesh_Circ.cxx
Executable file
@ -0,0 +1,23 @@
|
||||
// File: BRepMesh_Circ.cxx
|
||||
// Created: Mon Aug 9 17:48:36 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_Circ.hxx>
|
||||
|
||||
BRepMesh_Circ::BRepMesh_Circ()
|
||||
{}
|
||||
|
||||
BRepMesh_Circ::BRepMesh_Circ(const gp_XY& loc, const Standard_Real rad)
|
||||
: location(loc), radius(rad)
|
||||
{}
|
||||
|
||||
void BRepMesh_Circ::SetLocation(const gp_XY& loc)
|
||||
{
|
||||
location=loc;
|
||||
}
|
||||
|
||||
void BRepMesh_Circ::SetRadius(const Standard_Real rad)
|
||||
{
|
||||
radius=rad;
|
||||
}
|
10
src/BRepMesh/BRepMesh_Circ.lxx
Executable file
10
src/BRepMesh/BRepMesh_Circ.lxx
Executable file
@ -0,0 +1,10 @@
|
||||
// File: BRepMesh_Circ.lxx
|
||||
// Created: Mon Aug 9 17:46:36 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
inline const gp_XY& BRepMesh_Circ::Location() const
|
||||
{ return location;}
|
||||
|
||||
inline const Standard_Real& BRepMesh_Circ::Radius() const
|
||||
{ return radius;}
|
84
src/BRepMesh/BRepMesh_CircleInspector.hxx
Executable file
84
src/BRepMesh/BRepMesh_CircleInspector.hxx
Executable file
@ -0,0 +1,84 @@
|
||||
// File: BRepMesh_CircleInspector.hxx
|
||||
// Created: May 26 16:40:53 2008
|
||||
// Author: Ekaterina SMIRNOVA
|
||||
// Copyright: Open CASCADE SAS 2008
|
||||
|
||||
|
||||
#ifndef BRepMesh_CircleInspector_Header
|
||||
#define BRepMesh_CircleInspector_Header
|
||||
|
||||
#include <BRepMesh_Circ.hxx>
|
||||
|
||||
#include <BRepMesh_ListOfInteger.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
|
||||
#include <NCollection_CellFilter.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
|
||||
typedef NCollection_Vector<BRepMesh_Circ> CircVector;
|
||||
|
||||
//=======================================================================
|
||||
//! The class to find in the coincidence points
|
||||
//=======================================================================
|
||||
|
||||
class BRepMesh_CircleInspector : public NCollection_CellFilter_InspectorXY
|
||||
{
|
||||
public:
|
||||
typedef Standard_Integer Target;
|
||||
//! Constructor; remembers tolerance and collector data structure.
|
||||
//! All the found points are put in the map and excluded from further
|
||||
//! consideration.
|
||||
BRepMesh_CircleInspector (Standard_Real theTol,
|
||||
Standard_Integer nbComp,
|
||||
const BRepMesh_BaseAllocator& theAlloc);
|
||||
|
||||
void Add(Standard_Integer theInd,const BRepMesh_Circ& theCircle)
|
||||
{
|
||||
myInitCircle.SetValue(theInd, theCircle);
|
||||
}
|
||||
|
||||
void ClerResList()
|
||||
{
|
||||
myResInd.Clear();
|
||||
}
|
||||
|
||||
CircVector& MapOfCirc()
|
||||
{
|
||||
return myInitCircle;
|
||||
}
|
||||
|
||||
BRepMesh_Circ& GetCirc(Standard_Integer theInd)
|
||||
{
|
||||
return myInitCircle(theInd);
|
||||
}
|
||||
|
||||
//! Set current node to be checked
|
||||
void SetCurrent (const gp_XY& theCurCircle)
|
||||
{
|
||||
myCurrent = theCurCircle;
|
||||
}
|
||||
|
||||
//!Get result index of node
|
||||
BRepMesh_ListOfInteger& GetCoincidentInd()
|
||||
{
|
||||
return myResInd;
|
||||
}
|
||||
|
||||
//! Implementation of inspection method
|
||||
NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget);
|
||||
|
||||
static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget)
|
||||
{
|
||||
return (theIdx == theTarget);
|
||||
}
|
||||
|
||||
private:
|
||||
Standard_Real myTol;
|
||||
BRepMesh_ListOfInteger myResInd;
|
||||
CircVector myInitCircle;
|
||||
gp_XY myCurrent;
|
||||
};
|
||||
|
||||
#endif
|
93
src/BRepMesh/BRepMesh_CircleTool.cdl
Executable file
93
src/BRepMesh/BRepMesh_CircleTool.cdl
Executable file
@ -0,0 +1,93 @@
|
||||
-- File: BRepMesh_CircleTool.cdl
|
||||
-- Created: Wed May 12 09:30:49 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class CircleTool from BRepMesh
|
||||
|
||||
---Purpose: Create sort and destroy the circles used in
|
||||
-- triangulation.
|
||||
|
||||
uses Boolean from Standard,
|
||||
Integer from Standard,
|
||||
Real from Standard,
|
||||
XY from gp,
|
||||
Circ2d from gp,
|
||||
ListOfInteger from BRepMesh,
|
||||
CellFilter from BRepMesh,
|
||||
CircleInspector from BRepMesh,
|
||||
BaseAllocator from BRepMesh
|
||||
|
||||
is Create (theAlloc : in BaseAllocator from BRepMesh)
|
||||
returns CircleTool from BRepMesh;
|
||||
|
||||
|
||||
Create (numberOfComponents : in Integer from Standard;
|
||||
theAlloc : in BaseAllocator from BRepMesh)
|
||||
---Purpose: Constructs a CircleTool with the maximal dimension
|
||||
-- of the occuped space and an evaluation of the
|
||||
-- number of circles.
|
||||
returns CircleTool from BRepMesh;
|
||||
|
||||
Initialize (me : in out;
|
||||
numberOfComponents : in Integer from Standard)
|
||||
---Purpose: Constructs a CircleTool with the maximal dimension
|
||||
-- of the occuped space and an evaluation of the
|
||||
-- number of circles.
|
||||
is static;
|
||||
|
||||
SetCellSize(me : in out;
|
||||
theSize : in Real from Standard)
|
||||
---Purpose: Sets new size for cellfilter
|
||||
is static;
|
||||
|
||||
SetCellSize(me : in out;
|
||||
theXSize : in Real from Standard;
|
||||
theYSize : in Real from Standard)
|
||||
---Purpose: Sets new size for cellfilter
|
||||
is static;
|
||||
|
||||
SetMinMaxSize(me : in out;
|
||||
theMin : in XY from gp;
|
||||
theMax : in XY from gp)
|
||||
---Purpose: Sets min and max size for circle
|
||||
is static;
|
||||
|
||||
Add (me : in out;
|
||||
theCirc : in Circ2d from gp;
|
||||
theIndex : in Integer from Standard)
|
||||
---Purpose: Adds and binds circle to the tool.
|
||||
is static;
|
||||
|
||||
|
||||
Add (me : in out;
|
||||
p1, p2, p3 : in XY from gp;
|
||||
theIndex : in Integer from Standard)
|
||||
---Purpose: Computes adds and binds circle to the tool.
|
||||
returns Boolean from Standard is static;
|
||||
|
||||
MocAdd (me : in out;
|
||||
theIndex : in Integer from Standard);
|
||||
---Purpose: Adds implicit zero circle
|
||||
|
||||
|
||||
Delete (me : in out; theIndex : Integer from Standard)
|
||||
---Purpose: Deletes a circle from the tool.
|
||||
is static;
|
||||
|
||||
|
||||
Select (me : in out; thePnt : XY from gp)
|
||||
---Purpose: Select the circles which contains thePnt.
|
||||
---C++: return &
|
||||
returns ListOfInteger from BRepMesh is static;
|
||||
|
||||
fields Tolerance : Real from Standard;
|
||||
Allocator : BaseAllocator from BRepMesh;
|
||||
CellFilter : CellFilter from BRepMesh;
|
||||
Selector : CircleInspector from BRepMesh;
|
||||
FaceMax : XY from gp;
|
||||
FaceMin : XY from gp;
|
||||
|
||||
end CircleTool;
|
269
src/BRepMesh/BRepMesh_CircleTool.cxx
Executable file
269
src/BRepMesh/BRepMesh_CircleTool.cxx
Executable file
@ -0,0 +1,269 @@
|
||||
// File: BRepMesh_CircleTool.cxx
|
||||
// Created: Tue Jun 15 19:10:25 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_CircleTool.ixx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRepMesh_Circ.hxx>
|
||||
#include <BRepMesh_CircleInspector.hxx>
|
||||
#include <BRepMesh_BaseAllocator.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_CircleInspector
|
||||
//purpose : Constructor
|
||||
//
|
||||
//=======================================================================
|
||||
|
||||
BRepMesh_CircleInspector::BRepMesh_CircleInspector (Standard_Real theTol,
|
||||
Standard_Integer nbComp,
|
||||
const BRepMesh_BaseAllocator& theAlloc)
|
||||
: myTol(theTol*theTol),
|
||||
myResInd(theAlloc),
|
||||
myInitCircle(nbComp)
|
||||
{
|
||||
// myTol = theTol*theTol;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Inspect
|
||||
//purpose :
|
||||
//
|
||||
//=======================================================================
|
||||
NCollection_CellFilter_Action BRepMesh_CircleInspector::Inspect (const Standard_Integer theTarget)
|
||||
{
|
||||
const BRepMesh_Circ& Circ = myInitCircle(theTarget);
|
||||
Standard_Real R = Circ.Radius();
|
||||
if(R < 0)
|
||||
return CellFilter_Purge;
|
||||
Standard_Real dx,dy;
|
||||
const gp_XY& aLoc=Circ.Location();
|
||||
dx=myCurrent.X()-aLoc.X();
|
||||
dy=myCurrent.Y()-aLoc.Y();
|
||||
if ((dx*dx+dy*dy)-(R*R) <= myTol)
|
||||
myResInd.Append(theTarget);
|
||||
return CellFilter_Keep;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_CircleTool
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_CircleTool::BRepMesh_CircleTool(const BRepMesh_BaseAllocator& theAlloc)
|
||||
: Tolerance(Precision::PConfusion()),
|
||||
Allocator(theAlloc),
|
||||
CellFilter(10, theAlloc),
|
||||
Selector(Tolerance,64,theAlloc)
|
||||
{
|
||||
Tolerance=Tolerance*Tolerance;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_CircleTool
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_CircleTool::BRepMesh_CircleTool(const Standard_Integer nbComp,
|
||||
const BRepMesh_BaseAllocator& theAlloc)
|
||||
: Tolerance(Precision::PConfusion()),
|
||||
Allocator(theAlloc),
|
||||
CellFilter(10, theAlloc),
|
||||
Selector(Tolerance,Max(nbComp,64),theAlloc)
|
||||
{
|
||||
Tolerance=Tolerance*Tolerance;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Initialize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_CircleTool::Initialize(const Standard_Integer /*nbComp*/)
|
||||
{
|
||||
Tolerance=Precision::PConfusion();
|
||||
Tolerance=Tolerance*Tolerance;
|
||||
}
|
||||
|
||||
void BRepMesh_CircleTool::SetCellSize(const Standard_Real theSize)
|
||||
{
|
||||
CellFilter.Reset(theSize, Allocator);
|
||||
}
|
||||
|
||||
void BRepMesh_CircleTool::SetCellSize(const Standard_Real theXSize,
|
||||
const Standard_Real theYSize)
|
||||
{
|
||||
Standard_Real aCellSize[2];
|
||||
aCellSize[0] = theXSize;
|
||||
aCellSize[1] = theYSize;
|
||||
|
||||
CellFilter.Reset(aCellSize, Allocator);
|
||||
}
|
||||
|
||||
|
||||
void BRepMesh_CircleTool::SetMinMaxSize(const gp_XY& theMin,
|
||||
const gp_XY& theMax)
|
||||
{
|
||||
FaceMin = theMin;
|
||||
FaceMax = theMax;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_CircleTool::Add(const gp_Circ2d& theCirc,
|
||||
const Standard_Integer theIndex)
|
||||
{
|
||||
gp_XY aCoord(theCirc.Location().Coord());
|
||||
Standard_Real R = theCirc.Radius();
|
||||
BRepMesh_Circ aCir(aCoord, R);
|
||||
|
||||
//compute coords
|
||||
Standard_Real xMax=Min(aCoord.X()+R,FaceMax.X());
|
||||
Standard_Real xMin=Max(aCoord.X()-R,FaceMin.X());
|
||||
Standard_Real yMax=Min(aCoord.Y()+R,FaceMax.Y());
|
||||
Standard_Real yMin=Max(aCoord.Y()-R,FaceMin.Y());
|
||||
|
||||
gp_XY MinPnt(xMin,yMin);
|
||||
gp_XY MaxPnt(xMax,yMax);
|
||||
|
||||
CellFilter.Add(theIndex, MinPnt, MaxPnt);
|
||||
Selector.Add(theIndex, aCir);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_CircleTool::Add(const gp_XY& p1,
|
||||
const gp_XY& p2,
|
||||
const gp_XY& p3,
|
||||
const Standard_Integer theIndex)
|
||||
{
|
||||
gp_XY m1((p1.X()+p2.X())/2., (p1.Y()+p2.Y())/2.);
|
||||
gp_XY m2((p2.X()+p3.X())/2., (p2.Y()+p3.Y())/2.);
|
||||
gp_XY m3((p3.X()+p1.X())/2., (p3.Y()+p1.Y())/2.);
|
||||
Standard_Real dx=m1.X()-m2.X();
|
||||
Standard_Real dy=m1.Y()-m2.Y();
|
||||
Standard_Real d12=(dx*dx)+(dy*dy);
|
||||
dx=m2.X()-m3.X();
|
||||
dy=m2.Y()-m3.Y();
|
||||
Standard_Real d23=(dx*dx)+(dy*dy);
|
||||
dx=m3.X()-m1.X();
|
||||
dy=m3.Y()-m1.Y();
|
||||
Standard_Real d31=(dx*dx)+(dy*dy);
|
||||
gp_XY pl11, pl12, pl21, pl22;
|
||||
|
||||
if (d12>d23 && d12>d31) {
|
||||
dy=p2.Y()-p1.Y();
|
||||
dx=p1.X()-p2.X();
|
||||
if (dy!=0. || dx!=0.) {
|
||||
pl11 = m1;
|
||||
pl12 = gp_XY(dy, dx);
|
||||
}
|
||||
else return Standard_False;
|
||||
|
||||
dy=p3.Y()-p2.Y();
|
||||
dx=p2.X()-p3.X();
|
||||
if (dy!=0. || dx!=0.) {
|
||||
pl21 = m2;
|
||||
pl22 = gp_XY(dy, dx);
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
else {
|
||||
if (d23>d31) {
|
||||
dy=p3.Y()-p2.Y();
|
||||
dx=p2.X()-p3.X();
|
||||
if (dy!=0. || dx!=0.) {
|
||||
pl11 = m2;
|
||||
pl12 = gp_XY(dy, dx);
|
||||
}
|
||||
else return Standard_False;
|
||||
|
||||
dy=p1.Y()-p3.Y();
|
||||
dx=p3.X()-p1.X();
|
||||
if (dy!=0. || dx!=0.) {
|
||||
pl21 = m3;
|
||||
pl22 = gp_XY(dy, dx);
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
else {
|
||||
dy=p1.Y()-p3.Y();
|
||||
dx=p3.X()-p1.X();
|
||||
if (dy!=0. || dx!=0.) {
|
||||
pl11 = m3;
|
||||
pl12 = gp_XY(dy, dx);
|
||||
}
|
||||
else return Standard_False;
|
||||
|
||||
dy=p2.Y()-p1.Y();
|
||||
dx=p1.X()-p2.X();
|
||||
if (dy!=0. || dx!=0.) {
|
||||
pl21 = m1;
|
||||
pl22 = gp_XY(dy, dx);
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
gp_XY aVecO1O2 = pl21 - pl11;
|
||||
Standard_Real aCrossD1D2 = pl12 ^ pl22;
|
||||
Standard_Real theSinAngle = Abs(aCrossD1D2);
|
||||
if (theSinAngle < gp::Resolution())
|
||||
return Standard_False;
|
||||
Standard_Real theParam1 = (aVecO1O2 ^ pl22) / aCrossD1D2;
|
||||
gp_XY pInt = pl11+pl12*theParam1;
|
||||
dx=p1.X()-pInt.X();
|
||||
dy=p1.Y()-pInt.Y();
|
||||
Standard_Real R = Sqrt(dx*dx+dy*dy);
|
||||
BRepMesh_Circ aCir(pInt, R);
|
||||
|
||||
//compute coords
|
||||
Standard_Real xMax=Min(pInt.X()+R,FaceMax.X());
|
||||
Standard_Real xMin=Max(pInt.X()-R,FaceMin.X());
|
||||
Standard_Real yMax=Min(pInt.Y()+R,FaceMax.Y());
|
||||
Standard_Real yMin=Max(pInt.Y()-R,FaceMin.Y());
|
||||
|
||||
gp_XY MinPnt(xMin,yMin);
|
||||
gp_XY MaxPnt(xMax,yMax);
|
||||
|
||||
CellFilter.Add(theIndex, MinPnt, MaxPnt);
|
||||
|
||||
Selector.Add(theIndex, aCir);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Delete
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_CircleTool::Delete(const Standard_Integer theIndex)
|
||||
{
|
||||
BRepMesh_Circ& Circ = Selector.GetCirc(theIndex);
|
||||
if(Circ.Radius() > 0.) {
|
||||
Circ.SetRadius(-1);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Select
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_ListOfInteger& BRepMesh_CircleTool::Select(const gp_XY& thePnt)
|
||||
{
|
||||
Selector.ClerResList();
|
||||
Selector.SetCurrent(thePnt);
|
||||
CellFilter.Inspect (thePnt, Selector);
|
||||
return Selector.GetCoincidentInd();
|
||||
}
|
||||
|
||||
void BRepMesh_CircleTool::MocAdd(const Standard_Integer theIndex)
|
||||
{
|
||||
gp_XY nullPnt(0.,0.);
|
||||
BRepMesh_Circ theNullCir(nullPnt, -1.);
|
||||
Selector.Add(theIndex, theNullCir);
|
||||
}
|
40
src/BRepMesh/BRepMesh_ComparatorOfIndexedVertexOfDelaun.cdl
Executable file
40
src/BRepMesh/BRepMesh_ComparatorOfIndexedVertexOfDelaun.cdl
Executable file
@ -0,0 +1,40 @@
|
||||
-- File: BRepMesh_ComparatorOfIndexedVertex.cdl
|
||||
-- Created: Tue Apr 5 11:45:18 1994
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
class ComparatorOfIndexedVertexOfDelaun from BRepMesh
|
||||
|
||||
---Purpose: Sort two point in a given direction.
|
||||
|
||||
|
||||
uses Boolean from Standard,
|
||||
XY from gp,
|
||||
DataStructureOfDelaun from BRepMesh
|
||||
|
||||
is Create (theDir : XY from gp;
|
||||
TheTol : Real from Standard;
|
||||
HDS : DataStructureOfDelaun from BRepMesh)
|
||||
returns ComparatorOfIndexedVertexOfDelaun;
|
||||
|
||||
|
||||
IsLower (me; Left, Right: Integer)
|
||||
---Purpose: returns True if <Left> is lower than <Right>
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsGreater (me; Left, Right: Integer)
|
||||
---Purpose: returns True if <Left> is greater than <Right>
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsEqual(me; Left, Right: Integer)
|
||||
---Purpose: returns True when <Right> and <Left> are equal.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
fields IndexedStructure : DataStructureOfDelaun from BRepMesh;
|
||||
DirectionOfSort : XY from gp;
|
||||
Tolerance : Real from Standard;
|
||||
|
||||
end ComparatorOfIndexedVertexOfDelaun;
|
56
src/BRepMesh/BRepMesh_ComparatorOfIndexedVertexOfDelaun.cxx
Executable file
56
src/BRepMesh/BRepMesh_ComparatorOfIndexedVertexOfDelaun.cxx
Executable file
@ -0,0 +1,56 @@
|
||||
// File: BRepMesh_ComparatorOfIndexedVertexOfDelaun.cxx
|
||||
// Created: Tue Apr 5 11:50:40 1994
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_ComparatorOfIndexedVertexOfDelaun.ixx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_ComparatorOfIndexedVertexOfDelaun
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepMesh_ComparatorOfIndexedVertexOfDelaun::BRepMesh_ComparatorOfIndexedVertexOfDelaun
|
||||
(const gp_XY& theDir,
|
||||
const Standard_Real theTol,
|
||||
const Handle(BRepMesh_DataStructureOfDelaun)& HDS)
|
||||
: IndexedStructure(HDS),DirectionOfSort(theDir), Tolerance(theTol)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsLower
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepMesh_ComparatorOfIndexedVertexOfDelaun::IsLower
|
||||
(const Standard_Integer Left, const Standard_Integer Right) const
|
||||
{
|
||||
return ((IndexedStructure->GetNode(Left).Coord()*DirectionOfSort) <
|
||||
(IndexedStructure->GetNode(Right).Coord()*DirectionOfSort));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsGreater
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepMesh_ComparatorOfIndexedVertexOfDelaun::IsGreater
|
||||
(const Standard_Integer Left, const Standard_Integer Right) const
|
||||
{
|
||||
return ((IndexedStructure->GetNode(Left).Coord()*DirectionOfSort) >
|
||||
(IndexedStructure->GetNode(Right).Coord()*DirectionOfSort));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsEqual
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepMesh_ComparatorOfIndexedVertexOfDelaun::IsEqual
|
||||
(const Standard_Integer Left, const Standard_Integer Right) const
|
||||
{
|
||||
return (IndexedStructure->GetNode(Left).Coord().IsEqual
|
||||
(IndexedStructure->GetNode(Right).Coord(), Tolerance));
|
||||
}
|
||||
|
38
src/BRepMesh/BRepMesh_ComparatorOfVertexOfDelaun.cdl
Executable file
38
src/BRepMesh/BRepMesh_ComparatorOfVertexOfDelaun.cdl
Executable file
@ -0,0 +1,38 @@
|
||||
-- File: BRepMesh_ComparatorOfVertexOfDelaun.cdl
|
||||
-- Created: Fri Jun 18 13:46:14 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class ComparatorOfVertexOfDelaun from BRepMesh
|
||||
|
||||
---Purpose: Sort two point in a given direction.
|
||||
|
||||
|
||||
uses Boolean from Standard,
|
||||
Vertex from BRepMesh,
|
||||
XY from gp
|
||||
|
||||
|
||||
is Create (theDir : XY from gp; TheTol: Real from Standard)
|
||||
returns ComparatorOfVertexOfDelaun;
|
||||
|
||||
|
||||
IsLower (me; Left, Right: Vertex from BRepMesh)
|
||||
---Purpose: returns True if <Left> is lower than <Right>
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsGreater (me; Left, Right: Vertex from BRepMesh)
|
||||
---Purpose: returns True if <Left> is greater than <Right>
|
||||
returns Boolean from Standard;
|
||||
|
||||
IsEqual(me; Left, Right: Vertex from BRepMesh)
|
||||
---Purpose: returns True when <Right> and <Left> are equal.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
fields DirectionOfSort : XY from gp;
|
||||
Tolerance : Real from Standard;
|
||||
|
||||
end ComparatorOfVertexOfDelaun;
|
52
src/BRepMesh/BRepMesh_ComparatorOfVertexOfDelaun.cxx
Executable file
52
src/BRepMesh/BRepMesh_ComparatorOfVertexOfDelaun.cxx
Executable file
@ -0,0 +1,52 @@
|
||||
// File: BRepMesh_ComparatorOfVertexOfDelaun.cxx
|
||||
// Created: Fri Jun 18 17:04:44 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_ComparatorOfVertexOfDelaun.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_ComparatorOfVertexOfDelaun
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepMesh_ComparatorOfVertexOfDelaun::BRepMesh_ComparatorOfVertexOfDelaun(const gp_XY& theDir,
|
||||
const Standard_Real theTol)
|
||||
: DirectionOfSort(theDir), Tolerance(theTol)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsLower
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepMesh_ComparatorOfVertexOfDelaun::IsLower(const BRepMesh_Vertex& Left,
|
||||
const BRepMesh_Vertex& Right) const
|
||||
{
|
||||
return (Left.Coord()*DirectionOfSort) <
|
||||
(Right.Coord()*DirectionOfSort);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsGreater
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepMesh_ComparatorOfVertexOfDelaun::IsGreater(const BRepMesh_Vertex& Left,
|
||||
const BRepMesh_Vertex& Right) const
|
||||
{
|
||||
return (Left.Coord()*DirectionOfSort) >
|
||||
(Right.Coord()*DirectionOfSort);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsEqual
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BRepMesh_ComparatorOfVertexOfDelaun::IsEqual(const BRepMesh_Vertex& Left,
|
||||
const BRepMesh_Vertex& Right) const
|
||||
{
|
||||
return Left.IsEqual(Right);
|
||||
}
|
||||
|
257
src/BRepMesh/BRepMesh_DataStructureOfDelaun.cdl
Executable file
257
src/BRepMesh/BRepMesh_DataStructureOfDelaun.cdl
Executable file
@ -0,0 +1,257 @@
|
||||
-- File: BRepMesh_DataStructureOfDelaun.cdl
|
||||
-- Created: Wed Mar 17 11:20:52 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class DataStructureOfDelaun from BRepMesh inherits TShared from MMgt
|
||||
|
||||
---Purpose: Describes the data structure necessary for the
|
||||
-- mesh algorithms in two dimensions plane or on
|
||||
-- surface by meshing in UV space.
|
||||
|
||||
|
||||
uses Integer from Standard,
|
||||
ListOfInteger from BRepMesh,
|
||||
MapOfInteger from BRepMesh,
|
||||
PairOfIndex from BRepMesh,
|
||||
Box from Bnd,
|
||||
BoundSortBox from Bnd,
|
||||
BaseAllocator from BRepMesh,
|
||||
NodeHasherOfDataStructureOfDelaun from BRepMesh,
|
||||
LinkHasherOfDataStructureOfDelaun from BRepMesh,
|
||||
ElemHasherOfDataStructureOfDelaun from BRepMesh,
|
||||
IDMapOfNodeOfDataStructureOfDelaun from BRepMesh,
|
||||
IDMapOfLinkOfDataStructureOfDelaun from BRepMesh,
|
||||
IMapOfElementOfDataStructureOfDelaun from BRepMesh,
|
||||
SelectorOfDataStructureOfDelaun from BRepMesh,
|
||||
Vertex from BRepMesh,
|
||||
Edge from BRepMesh,
|
||||
Triangle from BRepMesh
|
||||
|
||||
is Create (theAllocator: BaseAllocator from BRepMesh;
|
||||
NodeNumber : Integer from Standard = 100)
|
||||
---Purpose: <NodeNumber> is just an evaluation of the
|
||||
-- presumed number of nodes in this mesh. The
|
||||
-- Mesh data structure will be automatically
|
||||
-- redimensioned if necessary.
|
||||
returns mutable DataStructureOfDelaun from BRepMesh ;
|
||||
|
||||
AddNode (me : mutable ;
|
||||
theNode : Vertex from BRepMesh)
|
||||
returns Integer from Standard
|
||||
---Purpose: Adds a node to the mesh if the node is not
|
||||
-- already in the Mesh. Returns the index of the
|
||||
-- node in the structure.
|
||||
is static;
|
||||
|
||||
GetNode (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
returns Vertex from BRepMesh
|
||||
---Purpose: Get the value of node <Index>.
|
||||
---C++: return const &
|
||||
---C++: alias operator ()
|
||||
is static;
|
||||
|
||||
GetNodeList (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
returns ListOfInteger from BRepMesh
|
||||
---Purpose: Get the list of node <Index>.
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
ForceRemoveNode (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
---Purpose: Removes the node of index <index> from the mesh.
|
||||
is static;
|
||||
|
||||
ForceRemoveLink (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
---Purpose: Removes the link of index <index> from the mesh.
|
||||
is static;
|
||||
|
||||
ReplaceNodes (me : mutable;
|
||||
NewNodes : IDMapOfNodeOfDataStructureOfDelaun from BRepMesh)
|
||||
---Purpose: Removes the all nodes and sets new map of
|
||||
-- nodes from the mesh.
|
||||
-- For internal use only.
|
||||
is static;
|
||||
|
||||
RemoveNode (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
---Purpose: Removes the node of index <index> from the mesh.
|
||||
is static;
|
||||
|
||||
MoveNode (me : mutable ;
|
||||
Index : Integer from Standard;
|
||||
newNode : Vertex from BRepMesh)
|
||||
---Purpose: Changes the UV value of node of index <Index> by
|
||||
-- <newNode>. Returns false if <newnode> is already in
|
||||
-- the structure.
|
||||
returns Boolean from Standard is static;
|
||||
|
||||
NbNodes (me)
|
||||
returns Integer from Standard
|
||||
---Purpose: Gives the number of nodes in this mesh.
|
||||
is static;
|
||||
|
||||
|
||||
AddLink (me : mutable;
|
||||
theLink : Edge from BRepMesh)
|
||||
returns Integer from Standard
|
||||
---Purpose: Adds a Link to the mesh if the Link is not
|
||||
-- already in the structure. Returns the index of
|
||||
-- the link in the structure.
|
||||
is static;
|
||||
|
||||
GetLink (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
returns Edge from BRepMesh
|
||||
---Purpose: Get the value of Link <Index>.
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
RemoveLink (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
---Purpose: Removes the Link of index <Index> from the
|
||||
-- mesh.
|
||||
is static;
|
||||
|
||||
SubstituteLink (me : mutable ;
|
||||
Index : Integer from Standard;
|
||||
newLink : Edge from BRepMesh)
|
||||
---Purpose: Substitutes the Link of index <Index> by
|
||||
-- <newLink> clear the connectivity.
|
||||
returns Boolean from Standard is static;
|
||||
|
||||
NbLinks (me)
|
||||
returns Integer from Standard
|
||||
---Purpose: Gives the number of elements in this mesh.
|
||||
is static;
|
||||
|
||||
|
||||
AddElement (me : mutable;
|
||||
theElement : Triangle from BRepMesh)
|
||||
returns Integer from Standard
|
||||
---Purpose: Adds an element to the mesh if it is not
|
||||
-- already in the Mesh. Returns the index of the
|
||||
-- element in the structure.
|
||||
is static;
|
||||
|
||||
GetElement (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
returns Triangle from BRepMesh
|
||||
---Purpose: Get the value of Element <Index>.
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
RemoveElement (me : mutable;
|
||||
Index : Integer from Standard)
|
||||
---Purpose: Removes the element of index <Index> in the mesh.
|
||||
is static;
|
||||
|
||||
SubstituteElement (me : mutable ;
|
||||
Index : Integer from Standard;
|
||||
newElement : Triangle from BRepMesh)
|
||||
---Purpose: Substitutes the element of index <Index> by
|
||||
-- <newElement>. The links connectivity is updated.
|
||||
returns Boolean from Standard is static;
|
||||
|
||||
NbElements (me)
|
||||
returns Integer from Standard
|
||||
---Purpose: Gives the number of elements in this mesh.
|
||||
is static;
|
||||
|
||||
|
||||
ClearDomain (me : mutable)
|
||||
---Purpose: Removes all elements
|
||||
is static;
|
||||
|
||||
|
||||
IndexOf (me;
|
||||
aNode : Vertex from BRepMesh)
|
||||
---Purpose: Finds the index of the node. Returns 0 if the
|
||||
-- node is not in the mesh.
|
||||
returns Integer from Standard;
|
||||
|
||||
IndexOf (me;
|
||||
aLink : Edge from BRepMesh)
|
||||
---Purpose: Finds the index of the Link. Returns 0 if the
|
||||
-- Link is not in the mesh.
|
||||
returns Integer from Standard;
|
||||
|
||||
IndexOf (me;
|
||||
anElement : Triangle from BRepMesh)
|
||||
---Purpose: Finds the index of the Element. Returns 0 if
|
||||
-- the Element is not in the mesh.
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
LinkNeighboursOf (me;
|
||||
theNode : in Integer from Standard)
|
||||
returns ListOfInteger from BRepMesh
|
||||
---C++: return const &
|
||||
---Purpose: Gives the list of Link's indices handling the
|
||||
-- node <theNode>.
|
||||
is static;
|
||||
|
||||
|
||||
ElemConnectedTo (me;
|
||||
theLink : in Integer from Standard)
|
||||
returns PairOfIndex from BRepMesh
|
||||
---C++: return const &
|
||||
---Purpose: Gives the element's indices conected
|
||||
-- to <theLink>.
|
||||
is static;
|
||||
|
||||
ElemOfDomain (me)
|
||||
returns MapOfInteger from BRepMesh
|
||||
---C++: return const &
|
||||
---Purpose: Gives the list of element's indices
|
||||
is static;
|
||||
|
||||
|
||||
LinkOfDomain (me)
|
||||
returns MapOfInteger from BRepMesh
|
||||
---C++: return const &
|
||||
---Purpose: Gives the list of link's indices
|
||||
is static;
|
||||
|
||||
|
||||
ClearDeleted (me : mutable)
|
||||
---Purpose: This method substitute the deleted items by
|
||||
-- the last in Indexed Data Maps to have only
|
||||
-- non-deleted elements, links or nodes in the
|
||||
-- structure.
|
||||
is static;
|
||||
|
||||
|
||||
-- Internal methods :
|
||||
|
||||
ClearElement (me : mutable;
|
||||
Index : Integer from Standard;
|
||||
theElem : Triangle from BRepMesh)
|
||||
---Purpose: Deletes the element of index <Index> in
|
||||
-- the mesh. Used by RemoveElement.
|
||||
is static private;
|
||||
|
||||
Statistics (me;
|
||||
flot : in out OStream from Standard)
|
||||
---Purpose: Give informations on map.
|
||||
is static;
|
||||
|
||||
Allocator (me) returns BaseAllocator from BRepMesh;
|
||||
---C++: return const&
|
||||
|
||||
|
||||
fields myNodes : IDMapOfNodeOfDataStructureOfDelaun from BRepMesh;
|
||||
myDelNodes : ListOfInteger from BRepMesh;
|
||||
myLinks : IDMapOfLinkOfDataStructureOfDelaun from BRepMesh;
|
||||
myDelLinks : ListOfInteger from BRepMesh;
|
||||
myElements : IMapOfElementOfDataStructureOfDelaun from BRepMesh;
|
||||
--myDelElements : ListOfInteger from BRepMesh;
|
||||
myElemOfDomain : MapOfInteger from BRepMesh;
|
||||
myLinkOfDomain : MapOfInteger from BRepMesh;
|
||||
myAllocator : BaseAllocator from BRepMesh;
|
||||
end DataStructureOfDelaun;
|
687
src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx
Executable file
687
src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx
Executable file
@ -0,0 +1,687 @@
|
||||
// File: BRepMesh_DataStructureOfDelaun.cxx
|
||||
// Created: Tue May 11 16:01:57 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@nonox>
|
||||
|
||||
#include <BRepMesh_DataStructureOfDelaun.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_DataStructureOfDelaun
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_DataStructureOfDelaun::BRepMesh_DataStructureOfDelaun(const BRepMesh_BaseAllocator& theAlloc,
|
||||
const Standard_Integer NodeNumber)
|
||||
: myNodes(NodeNumber+3),
|
||||
myDelNodes(theAlloc),
|
||||
myLinks(NodeNumber*3),
|
||||
myDelLinks(theAlloc),
|
||||
myElements(NodeNumber*2),
|
||||
// Not_Debuged_Yet myDelElements(theAlloc),
|
||||
myElemOfDomain(NodeNumber*2,theAlloc),
|
||||
myLinkOfDomain(NodeNumber*2,theAlloc)
|
||||
{
|
||||
myAllocator = theAlloc;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddNode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::AddNode(const BRepMesh_Vertex& theNode)
|
||||
{
|
||||
Standard_Integer NodeIndex=myNodes.FindIndex(theNode);
|
||||
if (NodeIndex>0 && !myDelNodes.IsEmpty()) {
|
||||
if (myNodes.FindKey(NodeIndex).Movability()==BRepMesh_Deleted)
|
||||
NodeIndex=0;
|
||||
}
|
||||
if (NodeIndex<=0) {
|
||||
BRepMesh_ListOfInteger thelist(myAllocator);
|
||||
if (!myDelNodes.IsEmpty()) {
|
||||
NodeIndex=myDelNodes.First();
|
||||
myNodes.Substitute(NodeIndex, theNode, thelist);
|
||||
myDelNodes.RemoveFirst();
|
||||
}
|
||||
else {
|
||||
NodeIndex=myNodes.Add(theNode, thelist);
|
||||
}
|
||||
}
|
||||
return NodeIndex;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetNode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_Vertex& BRepMesh_DataStructureOfDelaun::GetNode(const Standard_Integer Index)
|
||||
{
|
||||
return myNodes.FindKey(Index);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetNodeList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_ListOfInteger& BRepMesh_DataStructureOfDelaun::GetNodeList(const Standard_Integer Index)
|
||||
{
|
||||
return myNodes.FindFromIndex(Index);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ForceRemoveNode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::ForceRemoveNode(const Standard_Integer Index)
|
||||
{
|
||||
//Warning, the static cast from const& to & is called for
|
||||
//performance reasons. This is applicable only in case if later
|
||||
//modification of element (field movability) does not influent on
|
||||
//has calculation.
|
||||
BRepMesh_Vertex& vref=(BRepMesh_Vertex&)myNodes.FindKey(Index);
|
||||
if ( myNodes.FindFromIndex(Index).Extent()==0) {
|
||||
vref.SetMovability(BRepMesh_Deleted);
|
||||
myDelNodes.Append(Index);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReplaceNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::ReplaceNodes(const BRepMesh_IDMapOfNodeOfDataStructureOfDelaun& NewNodes)
|
||||
{
|
||||
if (NewNodes.IsEmpty() || NewNodes.Extent() != myNodes.Extent())
|
||||
return;
|
||||
/*for (Standard_Integer i = 1; i <= myNodes.Extent(); i++)
|
||||
ForceRemoveNode(i);*/
|
||||
|
||||
myNodes.Assign(NewNodes);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ForceRemoveLink
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::ForceRemoveLink(const Standard_Integer Index)
|
||||
{
|
||||
//Warning, the static cast from const& to & is called for
|
||||
//performance reasons. This is applicable only in case if later
|
||||
//modification of element (field movability) does not influent on
|
||||
//has calculation.
|
||||
BRepMesh_Edge& lref=(BRepMesh_Edge&)myLinks.FindKey(Index);
|
||||
if (lref.Movability()!=BRepMesh_Deleted) {
|
||||
if (myLinks.FindFromIndex(Index).Extent()==0) {
|
||||
BRepMesh_ListOfInteger::Iterator tit;
|
||||
BRepMesh_ListOfInteger& aList1 = myNodes(lref.FirstNode());
|
||||
for(tit.Init(aList1); tit.More(); tit.Next()){
|
||||
if (tit.Value()==Index) {
|
||||
aList1.Remove(tit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BRepMesh_ListOfInteger& aList2 = myNodes(lref.LastNode());
|
||||
for(tit.Init(aList2); tit.More(); tit.Next()){
|
||||
if (tit.Value()==Index) {
|
||||
aList2.Remove(tit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
myLinkOfDomain.Remove(Index);
|
||||
lref.SetMovability(BRepMesh_Deleted);
|
||||
myDelLinks.Append(Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RemoveNode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::RemoveNode(const Standard_Integer Index)
|
||||
{
|
||||
//Warning, the static cast from const& to & is called for
|
||||
//performance reasons. This is applicable only in case if later
|
||||
//modification of element (field movability) does not influent on
|
||||
//has calculation.
|
||||
BRepMesh_Vertex& vref=(BRepMesh_Vertex&)myNodes.FindKey(Index);
|
||||
if (vref.Movability()==BRepMesh_Free &&
|
||||
myNodes.FindFromIndex(Index).Extent()==0) {
|
||||
vref.SetMovability(BRepMesh_Deleted);
|
||||
myDelNodes.Append(Index);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MoveNode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_DataStructureOfDelaun::MoveNode(const Standard_Integer Index,
|
||||
const BRepMesh_Vertex& newNode)
|
||||
{
|
||||
if (myNodes.FindIndex(newNode)==0) {
|
||||
BRepMesh_Vertex vref(myNodes.FindKey(Index));
|
||||
const BRepMesh_ListOfInteger& refLink=myNodes(Index);
|
||||
vref.SetMovability(BRepMesh_Deleted);
|
||||
myNodes.Substitute(Index, vref, refLink);
|
||||
myNodes.Substitute(Index, newNode, refLink);
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::NbNodes()const
|
||||
{
|
||||
return myNodes.Extent();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddLink
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::AddLink(const BRepMesh_Edge& theLink)
|
||||
{
|
||||
Standard_Integer LinkIndex=myLinks.FindIndex(theLink);
|
||||
if (LinkIndex<=0) {
|
||||
BRepMesh_PairOfIndex aPair;
|
||||
if (!myDelLinks.IsEmpty()) {
|
||||
LinkIndex=myDelLinks.First();
|
||||
myLinks.Substitute(LinkIndex, theLink, aPair);
|
||||
myDelLinks.RemoveFirst();
|
||||
}
|
||||
else {
|
||||
LinkIndex=myLinks.Add(theLink, aPair);
|
||||
}
|
||||
myNodes(theLink.FirstNode()).Append(Abs(LinkIndex));
|
||||
myNodes(theLink.LastNode()).Append(Abs(LinkIndex));
|
||||
myLinkOfDomain.Add(LinkIndex);
|
||||
}
|
||||
else if (!theLink.SameOrientation(myLinks.FindKey(LinkIndex)))
|
||||
LinkIndex=-LinkIndex;
|
||||
|
||||
return LinkIndex;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetLink
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_Edge& BRepMesh_DataStructureOfDelaun::GetLink(const Standard_Integer Index)
|
||||
{
|
||||
return myLinks.FindKey(Index);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RemoveLink
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::RemoveLink(const Standard_Integer Index)
|
||||
{
|
||||
//Warning, the static cast from const& to & is called for
|
||||
//performance reasons. This is applicable only in case if later
|
||||
//modification of element (field movability) does not influent on
|
||||
//has calculation.
|
||||
BRepMesh_Edge& lref=(BRepMesh_Edge&)myLinks.FindKey(Index);
|
||||
if (lref.Movability()!=BRepMesh_Deleted) {
|
||||
if (lref.Movability()==BRepMesh_Free &&
|
||||
myLinks.FindFromIndex(Index).Extent()==0) {
|
||||
BRepMesh_ListOfInteger::Iterator tit;
|
||||
BRepMesh_ListOfInteger& aList1 = myNodes(lref.FirstNode());
|
||||
for(tit.Init(aList1); tit.More(); tit.Next()){
|
||||
if (tit.Value()==Index) {
|
||||
aList1.Remove(tit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
BRepMesh_ListOfInteger& aList2 = myNodes(lref.LastNode());
|
||||
for(tit.Init(aList2); tit.More(); tit.Next()){
|
||||
if (tit.Value()==Index) {
|
||||
aList2.Remove(tit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
myLinkOfDomain.Remove(Index);
|
||||
lref.SetMovability(BRepMesh_Deleted);
|
||||
myDelLinks.Append(Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SubstituteLink
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_DataStructureOfDelaun::SubstituteLink(const Standard_Integer Index,
|
||||
const BRepMesh_Edge& newLink)
|
||||
{
|
||||
//BRepMesh_ListOfInteger thelist(myAllocator);
|
||||
BRepMesh_PairOfIndex aPair;
|
||||
BRepMesh_Edge lref=myLinks.FindKey(Index);
|
||||
if (lref.Movability()==BRepMesh_Deleted)
|
||||
myLinks.Substitute(Index, newLink, aPair);
|
||||
else {
|
||||
if (myLinks.FindIndex(newLink)!=0)
|
||||
return Standard_False;
|
||||
|
||||
lref.SetMovability(BRepMesh_Deleted);
|
||||
myLinks.Substitute(Index, lref, aPair);
|
||||
|
||||
BRepMesh_ListOfInteger::Iterator tit;
|
||||
for(tit.Init(myNodes(lref.FirstNode())); tit.More(); tit.Next()){
|
||||
if (tit.Value()==Index) {
|
||||
myNodes(lref.FirstNode()).Remove(tit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(tit.Init(myNodes(lref.LastNode())); tit.More(); tit.Next()){
|
||||
if (tit.Value()==Index) {
|
||||
myNodes(lref.LastNode()).Remove(tit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
myLinks.Substitute(Index, newLink, aPair);
|
||||
myNodes(newLink.FirstNode()).Append(Abs(Index));
|
||||
myNodes(newLink.LastNode()).Append(Abs(Index));
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbLinks
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::NbLinks()const
|
||||
{
|
||||
return myLinks.Extent();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::AddElement(const BRepMesh_Triangle& theElement)
|
||||
{
|
||||
Standard_Integer ElemIndex=myElements.FindIndex(theElement);
|
||||
|
||||
if (ElemIndex<=0) {
|
||||
/* Not_Debuged_Yet
|
||||
if (!myDelElements.IsEmpty()) {
|
||||
ElemIndex=myDelElements.First();
|
||||
myElements.Substitute(ElemIndex, theElement);
|
||||
myDelElements.RemoveFirst();
|
||||
}
|
||||
else */
|
||||
ElemIndex=myElements.Add(theElement);
|
||||
|
||||
myElemOfDomain.Add(ElemIndex);
|
||||
|
||||
Standard_Integer ed1, ed2, ed3;
|
||||
Standard_Boolean or1, or2, or3;
|
||||
theElement.Edges(ed1, ed2, ed3, or1, or2, or3);
|
||||
myLinks(ed1).Append(ElemIndex);
|
||||
myLinks(ed2).Append(ElemIndex);
|
||||
myLinks(ed3).Append(ElemIndex);
|
||||
}
|
||||
|
||||
return ElemIndex;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_Triangle& BRepMesh_DataStructureOfDelaun::GetElement(const Standard_Integer Index)
|
||||
{
|
||||
return myElements.FindKey(Index);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RemoveElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::RemoveElement(const Standard_Integer Index)
|
||||
{
|
||||
//Warning, the static cast from const& to & is called for
|
||||
//performance reasons. This is applicable only in case if later
|
||||
//modification of element (field movability) does not influent on
|
||||
//has calculation.
|
||||
BRepMesh_Triangle& lelem=(BRepMesh_Triangle&)myElements.FindKey(Index);
|
||||
if (lelem.Movability()!=BRepMesh_Deleted) {
|
||||
ClearElement(Index, lelem);
|
||||
lelem.SetMovability(BRepMesh_Deleted);
|
||||
// Not_Debuged_Yet myDelElements.Append(Index);
|
||||
myElemOfDomain.Remove(Index);
|
||||
}
|
||||
}
|
||||
|
||||
static void removeElementIndex(BRepMesh_PairOfIndex& thePair,
|
||||
const Standard_Integer Index)
|
||||
{
|
||||
for(Standard_Integer i = 1, n = thePair.Extent(); i <= n; i++) {
|
||||
if (thePair.Index(i)==Index) {
|
||||
thePair.RemoveIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BRepMesh_DataStructureOfDelaun::ClearElement(const Standard_Integer Index,
|
||||
const BRepMesh_Triangle& theElem)
|
||||
{
|
||||
if (theElem.Movability()==BRepMesh_Free) {
|
||||
Standard_Integer ed1, ed2, ed3;
|
||||
Standard_Boolean or1, or2, or3;
|
||||
theElem.Edges(ed1, ed2, ed3, or1, or2, or3);
|
||||
removeElementIndex(myLinks(ed1),Index);
|
||||
removeElementIndex(myLinks(ed2),Index);
|
||||
removeElementIndex(myLinks(ed3),Index);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SubstituteElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_DataStructureOfDelaun::SubstituteElement
|
||||
(const Standard_Integer Index, const BRepMesh_Triangle& newElement)
|
||||
{
|
||||
const BRepMesh_Triangle& lelem=myElements.FindKey(Index);
|
||||
if (lelem.Movability()==BRepMesh_Deleted)
|
||||
myElements.Substitute(Index, newElement);
|
||||
else {
|
||||
if (myElements.FindIndex(newElement)==0) {
|
||||
ClearElement(Index, lelem);
|
||||
// Warning: here new element and old element should have different Hash code
|
||||
myElements.Substitute(Index, newElement);
|
||||
|
||||
Standard_Integer ed1, ed2, ed3;
|
||||
Standard_Boolean or1, or2, or3;
|
||||
newElement.Edges(ed1, ed2, ed3, or1, or2, or3);
|
||||
myLinks(ed1).Append(Index);
|
||||
myLinks(ed2).Append(Index);
|
||||
myLinks(ed3).Append(Index);
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearDomain
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::ClearDomain()
|
||||
{
|
||||
BRepMesh_MapOfInteger freeEdges;
|
||||
Standard_Integer ed1, ed2, ed3;
|
||||
Standard_Boolean or1, or2, or3;
|
||||
BRepMesh_MapOfInteger::Iterator itDom(myElemOfDomain);
|
||||
//Warning, the static cast from const& to & is called for
|
||||
//performance reasons. This is applicable only in case if later
|
||||
//modification of element (field movability) does not influent on
|
||||
//has calculation.
|
||||
for (;itDom.More(); itDom.Next()) {
|
||||
BRepMesh_Triangle& lelem=(BRepMesh_Triangle&)myElements.FindKey(itDom.Key());
|
||||
lelem.Edges(ed1, ed2, ed3, or1, or2, or3);
|
||||
freeEdges.Add(ed1);
|
||||
freeEdges.Add(ed2);
|
||||
freeEdges.Add(ed3);
|
||||
ClearElement(itDom.Key(), lelem);
|
||||
lelem.SetMovability(BRepMesh_Deleted);
|
||||
// Not_Debuged_Yet myDelElements.Append(itDom.Key());
|
||||
}
|
||||
myElemOfDomain.Clear();
|
||||
BRepMesh_MapOfInteger::Iterator edgeIt(freeEdges);
|
||||
for (; edgeIt.More(); edgeIt.Next())
|
||||
RemoveLink(edgeIt.Key());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbElements
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::NbElements()const
|
||||
{
|
||||
return myElements.Extent();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::IndexOf(const BRepMesh_Vertex& aNode)const
|
||||
{
|
||||
return myNodes.FindIndex(aNode);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::IndexOf(const BRepMesh_Edge& aLink)const
|
||||
{
|
||||
return myLinks.FindIndex(aLink);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IndexOf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMesh_DataStructureOfDelaun::IndexOf(const BRepMesh_Triangle& anElement)const
|
||||
{
|
||||
return myElements.FindIndex(anElement);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LinkNeighboursOf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_ListOfInteger& BRepMesh_DataStructureOfDelaun::LinkNeighboursOf
|
||||
(const Standard_Integer theNode)const
|
||||
{
|
||||
return myNodes.FindFromIndex(theNode);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ElemConnectedTo
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_PairOfIndex& BRepMesh_DataStructureOfDelaun::ElemConnectedTo
|
||||
(const Standard_Integer theLink)const
|
||||
{
|
||||
return myLinks.FindFromIndex(theLink);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ElemOfDomain
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_MapOfInteger& BRepMesh_DataStructureOfDelaun::ElemOfDomain () const
|
||||
{
|
||||
return myElemOfDomain;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LinkOfDomain
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_MapOfInteger& BRepMesh_DataStructureOfDelaun::LinkOfDomain () const
|
||||
{
|
||||
return myLinkOfDomain;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearDeleted
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::ClearDeleted()
|
||||
{
|
||||
|
||||
// Traitement des Elements
|
||||
|
||||
Standard_Integer IndexDelItem;
|
||||
|
||||
Standard_Integer lastNonDelItem=myElements.Extent();
|
||||
/* // Not_Debuged_Yet
|
||||
while (!myDelElements.IsEmpty()) {
|
||||
while (lastNonDelItem>0) {
|
||||
if (myElements.FindKey(lastNonDelItem).Movability()!=BRepMesh_Deleted)
|
||||
break;
|
||||
myElements.RemoveLast();
|
||||
lastNonDelItem--;
|
||||
}
|
||||
|
||||
IndexDelItem=myDelElements.First();
|
||||
myDelElements.RemoveFirst();
|
||||
|
||||
if (IndexDelItem<lastNonDelItem) {
|
||||
BRepMesh_Triangle eItem=myElements.FindKey(lastNonDelItem);
|
||||
myElements.RemoveLast();
|
||||
myElements.Substitute(IndexDelItem, eItem);
|
||||
myElemOfDomain.Remove(lastNonDelItem);
|
||||
myElemOfDomain.Add(IndexDelItem);
|
||||
lastNonDelItem--;
|
||||
|
||||
Standard_Integer ed[3], ied;
|
||||
Standard_Boolean orient[3];
|
||||
eItem.Edges(ed[0], ed[1], ed[2], orient[0], orient[1], orient[2]);
|
||||
BRepMesh_ListOfInteger::Iterator itList;
|
||||
for (ied=0; ied<3; ied++) {
|
||||
BRepMesh_PairOfIndex& aPair = myLinks(ed[ied]);
|
||||
for(Standard_Integer j = 1, jn = aPair.Extent(); j <= jn; j++)
|
||||
if (aPair.Index(j)==(lastNonDelItem+1)) {
|
||||
aPair.SetIndex(j,IndexDelItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Traitement des Links
|
||||
|
||||
lastNonDelItem=myLinks.Extent();
|
||||
|
||||
while (!myDelLinks.IsEmpty()) {
|
||||
while (lastNonDelItem>0) {
|
||||
if (myLinks.FindKey(lastNonDelItem).Movability()!=BRepMesh_Deleted)
|
||||
break;
|
||||
myLinks.RemoveLast();
|
||||
lastNonDelItem--;
|
||||
}
|
||||
|
||||
IndexDelItem=myDelLinks.First();
|
||||
myDelLinks.RemoveFirst();
|
||||
|
||||
if (IndexDelItem<lastNonDelItem) {
|
||||
BRepMesh_Edge lItem=myLinks.FindKey(lastNonDelItem);
|
||||
BRepMesh_PairOfIndex Data(myLinks(lastNonDelItem));
|
||||
myLinks.RemoveLast();
|
||||
myLinks.Substitute(IndexDelItem, lItem, Data);
|
||||
myLinkOfDomain.Remove(lastNonDelItem);
|
||||
myLinkOfDomain.Add(IndexDelItem);
|
||||
lastNonDelItem--;
|
||||
|
||||
Standard_Integer iv[2], ivx;
|
||||
iv[0]=lItem.FirstNode();
|
||||
iv[1]=lItem.LastNode();
|
||||
|
||||
BRepMesh_ListOfInteger::Iterator itLis;
|
||||
for (ivx=0; ivx<2; ivx++) {
|
||||
for (itLis.Init(myNodes(iv[ivx]));
|
||||
itLis.More(); itLis.Next()) {
|
||||
if (itLis.Value()==(lastNonDelItem+1)) {
|
||||
itLis.ChangeValue()=IndexDelItem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(Standard_Integer j = 1, jn = Data.Extent(); j <= jn; j++) {
|
||||
const BRepMesh_Triangle& Elem=myElements.FindKey(Data.Index(j));
|
||||
|
||||
Standard_Integer el[3], iel;
|
||||
Standard_Boolean orl[3];
|
||||
Elem.Edges(el[0], el[1], el[2], orl[0], orl[1], orl[2]);
|
||||
for (iel=0; iel<3; iel++) {
|
||||
if (el[iel]==lastNonDelItem+1) {
|
||||
el[iel]=IndexDelItem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
myElements.Substitute(itLis.Value(),
|
||||
BRepMesh_Triangle(el[0], el[1], el[2],
|
||||
orl[0], orl[1], orl[2],
|
||||
Elem.Movability() ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Traitement des Nodes :
|
||||
|
||||
lastNonDelItem=myNodes.Extent();
|
||||
|
||||
while (!myDelNodes.IsEmpty()) {
|
||||
while (lastNonDelItem>0) {
|
||||
if (myNodes.FindKey(lastNonDelItem).Movability()!=BRepMesh_Deleted)
|
||||
break;
|
||||
myNodes.RemoveLast();
|
||||
lastNonDelItem--;
|
||||
}
|
||||
IndexDelItem=myDelNodes.First();
|
||||
myDelNodes.RemoveFirst();
|
||||
|
||||
if (IndexDelItem<lastNonDelItem) {
|
||||
BRepMesh_Vertex nItem=myNodes.FindKey(lastNonDelItem);
|
||||
BRepMesh_ListOfInteger Data;
|
||||
Data.Append(myNodes(lastNonDelItem));
|
||||
myNodes.RemoveLast();
|
||||
lastNonDelItem--;
|
||||
myNodes.Substitute(IndexDelItem, nItem, Data);
|
||||
|
||||
BRepMesh_ListOfInteger::Iterator itLi;
|
||||
for (itLi.Init(Data); itLi.More(); itLi.Next()) {
|
||||
const BRepMesh_Edge& li=myLinks.FindKey(itLi.Value());
|
||||
BRepMesh_PairOfIndex conx(myLinks(itLi.Value()));
|
||||
Standard_Integer iv1=li.FirstNode();
|
||||
Standard_Integer iv2=li.LastNode();
|
||||
if (iv1==lastNonDelItem+1) iv1=IndexDelItem;
|
||||
else if (iv2==lastNonDelItem+1) iv2=IndexDelItem;
|
||||
|
||||
myLinks.Substitute(itLi.Value(),
|
||||
BRepMesh_Edge(iv1, iv2, li.Movability()), conx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Statistics
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DataStructureOfDelaun::Statistics(Standard_OStream& S) const
|
||||
{
|
||||
S << " Map de nodes : \n";
|
||||
myNodes.Statistics(S);
|
||||
S << "\n Deleted nodes : " << myDelNodes.Extent() << endl;
|
||||
|
||||
S << "\n\n Map de Links : \n";
|
||||
myLinks.Statistics(S);
|
||||
S << "\n Deleted links : " << myDelLinks.Extent() << endl;
|
||||
|
||||
S << "\n\n Map d elements : \n";
|
||||
myElements.Statistics(S);
|
||||
// Not_Debuged_Yet S << "\n Deleted elements : " << myDelElements.Extent() << endl;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Allocator()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_BaseAllocator& BRepMesh_DataStructureOfDelaun::Allocator() const
|
||||
{
|
||||
return myAllocator;
|
||||
}
|
227
src/BRepMesh/BRepMesh_Delaun.cdl
Executable file
227
src/BRepMesh/BRepMesh_Delaun.cdl
Executable file
@ -0,0 +1,227 @@
|
||||
-- File: BRepMesh_Delaun.cdl
|
||||
-- Created: Tue May 11 17:19:19 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@nonox>
|
||||
---Copyright: Matra Datavision 1993, 1994
|
||||
|
||||
|
||||
class Delaun from BRepMesh
|
||||
|
||||
---Purpose: Compute the Delaunay's triangulation with the
|
||||
-- algorithm of Watson.
|
||||
|
||||
|
||||
uses Integer from Standard,
|
||||
SequenceOfInteger from TColStd,
|
||||
Array1OfInteger from TColStd,
|
||||
Box2d from Bnd,
|
||||
CircleTool from BRepMesh,
|
||||
MapOfInteger from BRepMesh,
|
||||
DataStructureOfDelaun from BRepMesh,
|
||||
MapOfIntegerInteger from BRepMesh,
|
||||
Vertex from BRepMesh,
|
||||
Edge from BRepMesh,
|
||||
Triangle from BRepMesh,
|
||||
ComparatorOfVertexOfDelaun from BRepMesh,
|
||||
ComparatorOfIndexedVertexOfDelaun from BRepMesh,
|
||||
Array1OfVertexOfDelaun from BRepMesh,
|
||||
HArray1OfVertexOfDelaun from BRepMesh,
|
||||
HeapSortVertexOfDelaun from BRepMesh,
|
||||
HeapSortIndexedVertexOfDelaun from BRepMesh
|
||||
|
||||
|
||||
is
|
||||
-- Interface :
|
||||
|
||||
Create (Vertices : in out Array1OfVertexOfDelaun from BRepMesh;
|
||||
ZPositive : in Boolean from Standard=Standard_True)
|
||||
---Purpose: Creates the triangulation with an empty Mesh
|
||||
-- data structure.
|
||||
returns Delaun from BRepMesh;
|
||||
|
||||
|
||||
Create (OldMesh : mutable DataStructureOfDelaun from BRepMesh;
|
||||
Vertices : in out Array1OfVertexOfDelaun from BRepMesh;
|
||||
ZPositive : in Boolean from Standard=Standard_True)
|
||||
---Purpose: Creates the triangulation with and existant
|
||||
-- Mesh data structure.
|
||||
returns Delaun from BRepMesh;
|
||||
|
||||
|
||||
Create (OldMesh : mutable DataStructureOfDelaun from BRepMesh;
|
||||
VertexIndices : in out Array1OfInteger from TColStd;
|
||||
ZPositive : in Boolean from Standard=Standard_True)
|
||||
---Purpose: Creates the triangulation with and existant
|
||||
-- Mesh data structure.
|
||||
returns Delaun from BRepMesh;
|
||||
|
||||
|
||||
AddVertex (me : in out;
|
||||
theVertex : in Vertex from BRepMesh);
|
||||
---Purpose: Adds a new vertex in the triangulation.
|
||||
|
||||
|
||||
RemoveVertex (me : in out;
|
||||
theVertex : in Vertex from BRepMesh);
|
||||
---Purpose: Removes a vertex in the triangulation.
|
||||
|
||||
|
||||
AddVertices (me : in out;
|
||||
Vertices : in out Array1OfVertexOfDelaun from BRepMesh);
|
||||
---Purpose: Adds some vertices in the triangulation.
|
||||
|
||||
|
||||
RevertDiagonal (me : in out;
|
||||
theEdge : in Integer from Standard)
|
||||
---Purpose: Substitutes the Edge beetween to triangles by the
|
||||
-- other diagonal of the quadrilatere if it is
|
||||
-- possible (convex polygon). Return True if done.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
UseEdge (me : in out;
|
||||
theEdge : in Integer from Standard)
|
||||
---Purpose: Modify mesh to use the edge. Return True if done.
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
SmoothMesh (me : in out;
|
||||
Epsilon : in Real from Standard);
|
||||
---Purpose: Smooths the mesh in 2d space. The method is to
|
||||
-- move the free and OnSurface vertices at the
|
||||
-- barycentre of their polygon.
|
||||
|
||||
|
||||
Result (me)
|
||||
---C++: return const &
|
||||
---Purpose: Gives the Mesh data structure.
|
||||
returns DataStructureOfDelaun from BRepMesh;
|
||||
|
||||
|
||||
Frontier (me : in out)
|
||||
---Purpose: Gives the list of frontier edges
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh;
|
||||
|
||||
|
||||
InternalEdges (me : in out)
|
||||
---Purpose: Gives the list of internal edges
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh;
|
||||
|
||||
|
||||
FreeEdges (me : in out)
|
||||
---Purpose: Gives the list of free edges used only one time
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh;
|
||||
|
||||
|
||||
GetVertex (me;
|
||||
vIndex : in Integer from Standard)
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
returns Vertex from BRepMesh;
|
||||
|
||||
|
||||
GetEdge (me;
|
||||
eIndex : in Integer from Standard)
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
returns Edge from BRepMesh;
|
||||
|
||||
|
||||
GetTriangle (me;
|
||||
tIndex : in Integer from Standard)
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
returns Triangle from BRepMesh;
|
||||
|
||||
|
||||
-- Implementation :
|
||||
|
||||
Init (me : in out;
|
||||
Vertices : in out Array1OfVertexOfDelaun from BRepMesh);
|
||||
---Purpose: Initializes the triangulation with an Array of
|
||||
-- Vertex.
|
||||
|
||||
Compute (me : in out;
|
||||
VertexIndices : in out Array1OfInteger from TColStd);
|
||||
---Purpose: Computes the triangulation and add the vertices
|
||||
-- edges and triangles to the Mesh data structure.
|
||||
|
||||
ReCompute (me : in out;
|
||||
VertexIndices : in out Array1OfInteger from TColStd);
|
||||
---Purpose: Clear the existing triangles and recomputes
|
||||
-- the triangulation .
|
||||
|
||||
SuperMesh (me : in out;
|
||||
theBox : Box2d from Bnd);
|
||||
---Purpose: Build the super mesh .
|
||||
|
||||
|
||||
FrontierAdjust (me : in out)
|
||||
---Purpose: Adjust the mesh on the frontier.
|
||||
is private;
|
||||
|
||||
|
||||
MeshLeftPolygonOf (me : in out;
|
||||
EdgeIndex : Integer from Standard;
|
||||
EdgeSens : Boolean from Standard)
|
||||
---Purpose: Find left polygon of the edge and call MeshPolygon.
|
||||
is private;
|
||||
|
||||
|
||||
MeshPolygon (me : in out;
|
||||
Polygon : in out SequenceOfInteger from TColStd)
|
||||
---Purpose: Mesh closed polygon.
|
||||
is private;
|
||||
|
||||
|
||||
CreateTriangles(me : in out;
|
||||
vertexIndex : Integer from Standard;
|
||||
--vertex : in Vertex from BRepMesh;
|
||||
freeEdges: out MapOfIntegerInteger from BRepMesh)
|
||||
---Purpose: Creates the triangles beetween the node
|
||||
-- <Vertex> and the polyline <freeEdges>.
|
||||
is private;
|
||||
|
||||
|
||||
DeleteTriangle (me : in out;
|
||||
TrianIndex : Integer from Standard;
|
||||
freeEdges : out MapOfIntegerInteger from BRepMesh)
|
||||
---Purpose: Deletes the triangle of index <TrianIndex> and
|
||||
-- add the free edges to the map.
|
||||
-- When an edge is suppressed more than one time
|
||||
-- it is destroyed.
|
||||
is private;
|
||||
|
||||
|
||||
Contains (me;
|
||||
TrianIndex : Integer from Standard;
|
||||
theVertex : in Vertex from BRepMesh;
|
||||
edgeOn : out Integer from Standard)
|
||||
---Purpose: Test if triangle of index <TrianIndex>
|
||||
-- contains geometricaly <theVertex>. If <EdgeOn>
|
||||
-- is != 0 then theVertex is on Edge of index
|
||||
-- <edgeOn>.
|
||||
returns Boolean from Standard;
|
||||
|
||||
TriangleContaining
|
||||
(me : in out;
|
||||
theVertex : in Vertex from BRepMesh)
|
||||
---Purpose: Gives the index of triangle containing
|
||||
-- geometricaly <theVertex>.
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
fields MeshData : DataStructureOfDelaun from BRepMesh;
|
||||
PositiveOrientation : Boolean from Standard;
|
||||
tCircles : CircleTool from BRepMesh;
|
||||
supVert1 : Integer from Standard;
|
||||
supVert2 : Integer from Standard;
|
||||
supVert3 : Integer from Standard;
|
||||
supTrian : Triangle from BRepMesh;
|
||||
mapEdges : MapOfInteger from BRepMesh;
|
||||
|
||||
|
||||
end Delaun;
|
1601
src/BRepMesh/BRepMesh_Delaun.cxx
Executable file
1601
src/BRepMesh/BRepMesh_Delaun.cxx
Executable file
File diff suppressed because it is too large
Load Diff
27
src/BRepMesh/BRepMesh_Delaun.lxx
Executable file
27
src/BRepMesh/BRepMesh_Delaun.lxx
Executable file
@ -0,0 +1,27 @@
|
||||
// File: BRepMesh_Delaun.lxx
|
||||
// Created: Thu Aug 19 10:52:01 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
|
||||
#include <BRepMesh_DataStructureOfDelaun.hxx>
|
||||
|
||||
inline const BRepMesh_Vertex& BRepMesh_Delaun::GetVertex
|
||||
(const Standard_Integer vIndex) const
|
||||
{
|
||||
return MeshData->GetNode(vIndex);
|
||||
}
|
||||
|
||||
|
||||
inline const BRepMesh_Edge& BRepMesh_Delaun::GetEdge
|
||||
(const Standard_Integer eIndex) const
|
||||
{
|
||||
return MeshData->GetLink(eIndex);
|
||||
}
|
||||
|
||||
|
||||
inline const BRepMesh_Triangle& BRepMesh_Delaun::GetTriangle
|
||||
(const Standard_Integer tIndex) const
|
||||
{
|
||||
return MeshData->GetElement(tIndex);
|
||||
}
|
@ -1,71 +1,71 @@
|
||||
-- File: BRepMesh_Edge.cdl
|
||||
-- Created: Wed Sep 22 18:07:31 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
-- File: BRepMesh_Edge.cdl
|
||||
-- Created: Wed Sep 22 18:07:31 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class Edge from BRepMesh
|
||||
|
||||
---Purpose:
|
||||
---Purpose:
|
||||
|
||||
|
||||
uses Boolean from Standard,
|
||||
Integer from Standard,
|
||||
DegreeOfFreedom from MeshDS
|
||||
Integer from Standard,
|
||||
DegreeOfFreedom from BRepMesh
|
||||
|
||||
|
||||
is Create (vDebut : Integer from Standard;
|
||||
vFin : Integer from Standard;
|
||||
canMove : DegreeOfFreedom from MeshDS)
|
||||
---Purpose: Contructs a link beetween to vertices.
|
||||
returns Edge from BRepMesh;
|
||||
is Create (vDebut : Integer from Standard;
|
||||
vFin : Integer from Standard;
|
||||
canMove : DegreeOfFreedom from BRepMesh)
|
||||
---Purpose: Contructs a link beetween to vertices.
|
||||
returns Edge from BRepMesh;
|
||||
|
||||
|
||||
FirstNode (me)
|
||||
---Purpose: Give the index of first node of the Link.
|
||||
---C++: inline
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
FirstNode (me)
|
||||
---Purpose: Give the index of first node of the Link.
|
||||
---C++: inline
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
|
||||
LastNode (me)
|
||||
---Purpose: Give the index of Last node of the Link.
|
||||
---C++: inline
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
LastNode (me)
|
||||
---Purpose: Give the index of Last node of the Link.
|
||||
---C++: inline
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Movability (me)
|
||||
---C++: inline
|
||||
returns DegreeOfFreedom from MeshDS
|
||||
is static;
|
||||
Movability (me)
|
||||
---C++: inline
|
||||
returns DegreeOfFreedom from BRepMesh
|
||||
is static;
|
||||
|
||||
|
||||
SetMovability (me : in out;
|
||||
Move : DegreeOfFreedom from MeshDS)
|
||||
is static;
|
||||
SetMovability (me : in out;
|
||||
Move : DegreeOfFreedom from BRepMesh)
|
||||
is static;
|
||||
|
||||
HashCode (me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---C++: function call
|
||||
is static;
|
||||
HashCode (me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---C++: function call
|
||||
is static;
|
||||
|
||||
|
||||
SameOrientation(me; Other : Edge from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
SameOrientation(me; Other : Edge from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsEqual (me; Other : Edge from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
---C++: alias operator ==
|
||||
is static;
|
||||
IsEqual (me; Other : Edge from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
---C++: alias operator ==
|
||||
is static;
|
||||
|
||||
|
||||
fields myFirstNode : Integer from Standard;
|
||||
myLastNode : Integer from Standard;
|
||||
myMovability : DegreeOfFreedom from MeshDS;
|
||||
fields myFirstNode : Integer from Standard;
|
||||
myLastNode : Integer from Standard;
|
||||
myMovability : DegreeOfFreedom from BRepMesh;
|
||||
|
||||
end Edge;
|
||||
end Edge;
|
||||
|
@ -1,17 +1,17 @@
|
||||
// File: BRepMesh_Edge.cxx
|
||||
// Created: Thu Sep 23 13:39:58 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
// File: BRepMesh_Edge.cxx
|
||||
// Created: Thu Sep 23 13:39:58 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_Edge.ixx>
|
||||
|
||||
|
||||
BRepMesh_Edge::BRepMesh_Edge(const Standard_Integer vDebut,
|
||||
const Standard_Integer vFin,
|
||||
const MeshDS_DegreeOfFreedom canMove)
|
||||
: myFirstNode(vDebut), myLastNode(vFin), myMovability(canMove)
|
||||
const Standard_Integer vFin,
|
||||
const BRepMesh_DegreeOfFreedom canMove)
|
||||
: myFirstNode(vDebut), myLastNode(vFin), myMovability(canMove)
|
||||
{}
|
||||
|
||||
void BRepMesh_Edge::SetMovability(const MeshDS_DegreeOfFreedom Move)
|
||||
void BRepMesh_Edge::SetMovability(const BRepMesh_DegreeOfFreedom Move)
|
||||
{
|
||||
myMovability =Move;
|
||||
}
|
||||
@ -23,7 +23,7 @@ Standard_Integer BRepMesh_Edge::HashCode(const Standard_Integer Upper)const
|
||||
|
||||
Standard_Boolean BRepMesh_Edge::IsEqual(const BRepMesh_Edge& Other)const
|
||||
{
|
||||
if (myMovability==MeshDS_Deleted || Other.myMovability==MeshDS_Deleted)
|
||||
if (myMovability==BRepMesh_Deleted || Other.myMovability==BRepMesh_Deleted)
|
||||
return Standard_False;
|
||||
return (myFirstNode==Other.myFirstNode && myLastNode==Other.myLastNode) ||
|
||||
(myFirstNode==Other.myLastNode && myLastNode==Other.myFirstNode);
|
||||
@ -31,7 +31,7 @@ Standard_Boolean BRepMesh_Edge::IsEqual(const BRepMesh_Edge& Other)const
|
||||
|
||||
|
||||
Standard_Boolean BRepMesh_Edge::SameOrientation
|
||||
(const BRepMesh_Edge& Other)const
|
||||
(const BRepMesh_Edge& Other)const
|
||||
{
|
||||
return (myFirstNode==Other.myFirstNode && myLastNode==Other.myLastNode);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// File: BRepMesh_Edge.lxx
|
||||
// Created: Thu Sep 23 13:44:34 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
// File: BRepMesh_Edge.lxx
|
||||
// Created: Thu Sep 23 13:44:34 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
inline Standard_Integer BRepMesh_Edge::FirstNode()const
|
||||
{
|
||||
@ -13,7 +13,7 @@ inline Standard_Integer BRepMesh_Edge::LastNode()const
|
||||
return myLastNode;
|
||||
}
|
||||
|
||||
inline MeshDS_DegreeOfFreedom BRepMesh_Edge::Movability()const
|
||||
inline BRepMesh_DegreeOfFreedom BRepMesh_Edge::Movability()const
|
||||
{
|
||||
return myMovability;
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ uses Boolean from Standard,
|
||||
DataMapOfShapeReal from TopTools,
|
||||
ListOfShape from TopTools,
|
||||
Curve from Geom2d,
|
||||
MapOfInteger from MeshDS,
|
||||
BaseAllocator from MeshDS,
|
||||
MapOfInteger from BRepMesh,
|
||||
BaseAllocator from BRepMesh,
|
||||
DataMapOfFaceAttribute from BRepMesh
|
||||
|
||||
|
||||
@ -202,19 +202,19 @@ is
|
||||
is static;
|
||||
|
||||
VerticesOfDomain
|
||||
(me; Indices : in out MapOfInteger from MeshDS)
|
||||
(me; Indices : in out MapOfInteger from BRepMesh)
|
||||
---Purpose: Gives the list of indices of the vertices
|
||||
is static;
|
||||
|
||||
|
||||
EdgesOfDomain
|
||||
(me; Indices : in out MapOfInteger from MeshDS)
|
||||
(me; Indices : in out MapOfInteger from BRepMesh)
|
||||
---Purpose: Gives the list of indices of the edges
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
TrianglesOfDomain(me; Indices: in out MapOfInteger from MeshDS)
|
||||
TrianglesOfDomain(me; Indices: in out MapOfInteger from BRepMesh)
|
||||
---Purpose: Gives the list of indices of the triangles
|
||||
---C++: inline
|
||||
is static;
|
||||
@ -296,6 +296,6 @@ fields
|
||||
myFacestate : Status from BRepMesh;
|
||||
myMapdefle : DataMapOfShapeReal from TopTools;
|
||||
myNottriangulated : ListOfShape from TopTools;
|
||||
myAllocator : BaseAllocator from MeshDS;
|
||||
myAllocator : BaseAllocator from BRepMesh;
|
||||
|
||||
end FastDiscret;
|
||||
|
@ -774,7 +774,7 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
myVertices.Bind(pBegin, ipf);
|
||||
}
|
||||
theUV = BRepMesh_FastDiscretFace::FindUV(pBegin, uvFirst, ipf, theGFace, mindist, myLocation2d);
|
||||
BRepMesh_Vertex vf(theUV, ipf, MeshDS_Frontier);
|
||||
BRepMesh_Vertex vf(theUV, ipf, BRepMesh_Frontier);
|
||||
Standard_Integer ivf = myStructure->AddNode(vf);
|
||||
|
||||
// Process last vertex
|
||||
@ -805,7 +805,7 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
}
|
||||
}
|
||||
theUV = BRepMesh_FastDiscretFace::FindUV(pEnd, uvLast, ipl, theGFace, mindist, myLocation2d);
|
||||
BRepMesh_Vertex vl(theUV, ipl, MeshDS_Frontier);
|
||||
BRepMesh_Vertex vl(theUV, ipl, BRepMesh_Frontier);
|
||||
Standard_Integer ivl= myStructure->AddNode(vl);
|
||||
|
||||
Standard_Integer isvf = myVemap.FindIndex(ivf);
|
||||
@ -926,7 +926,7 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
myLocation3d.Bind(myNbLocat, P3d);
|
||||
NodInStruct(i) = myNbLocat;
|
||||
// Record 2d point
|
||||
v2.Initialize(uv.Coord(), myNbLocat, MeshDS_OnCurve);
|
||||
v2.Initialize(uv.Coord(), myNbLocat, BRepMesh_OnCurve);
|
||||
iv2=myStructure->AddNode(v2);
|
||||
|
||||
Standard_Integer isv = myVemap.FindIndex(iv2);
|
||||
@ -936,11 +936,11 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
Param(i) = puv;
|
||||
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2, ivf, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2, ivf, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, BRepMesh_Fixed));
|
||||
ivf = iv2;
|
||||
}
|
||||
}
|
||||
@ -956,11 +956,11 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
|
||||
if (ivf != ivl) {
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl, ivf, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl, ivf, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, BRepMesh_Fixed));
|
||||
}
|
||||
|
||||
|
||||
@ -1012,7 +1012,7 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
{
|
||||
const Standard_Real puv = Par->Value(i);
|
||||
theC2d->D0(puv, uv);
|
||||
v2.Initialize(uv.Coord(), NOD(i), MeshDS_OnCurve);
|
||||
v2.Initialize(uv.Coord(), NOD(i), BRepMesh_OnCurve);
|
||||
iv2 = myStructure->AddNode(v2);
|
||||
|
||||
Standard_Integer isv = myVemap.FindIndex(iv2);
|
||||
@ -1021,11 +1021,11 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
PPar(i) = puv;
|
||||
|
||||
if (orEdge==TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2, ivf, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2, ivf, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, BRepMesh_Fixed));
|
||||
|
||||
ivf = iv2;
|
||||
}
|
||||
@ -1059,7 +1059,7 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
pcos.Perform(P3d, wCurFound);
|
||||
if (pcos.IsDone()) wCurFound = pcos.Point().Parameter();
|
||||
theC2d->D0(wCurFound, uv);
|
||||
v2.Initialize(uv.Coord(), NOD(i), MeshDS_OnCurve);
|
||||
v2.Initialize(uv.Coord(), NOD(i), BRepMesh_OnCurve);
|
||||
iv2 = myStructure->AddNode(v2);
|
||||
|
||||
Standard_Integer isv = myVemap.FindIndex(iv2);
|
||||
@ -1068,11 +1068,11 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
PPar(i) = wCurFound;
|
||||
|
||||
if (orEdge==TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2, ivf, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2, ivf, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, iv2, BRepMesh_Fixed));
|
||||
|
||||
ivf = iv2;
|
||||
}
|
||||
@ -1083,11 +1083,11 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
|
||||
|
||||
if (ivf != ivl) {
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl, ivf, MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl, ivf, BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivf, ivl, BRepMesh_Fixed));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1220,7 +1220,7 @@ Standard_Boolean BRepMesh_FastDiscret::Update(const TopoDS_Edge& theEdg
|
||||
}
|
||||
NewNodInStruct(1) = ipf;
|
||||
theUV = BRepMesh_FastDiscretFace::FindUV(pBegin, uvFirst, ipf, gFace, mindist, myLocation2d);
|
||||
BRepMesh_Vertex vf(theUV,ipf,MeshDS_Frontier);
|
||||
BRepMesh_Vertex vf(theUV,ipf,BRepMesh_Frontier);
|
||||
iv1 = myStructure->AddNode(vf);
|
||||
isv1 = myVemap.FindIndex(iv1);
|
||||
if (isv1 == 0) isv1 = myVemap.Add(iv1);
|
||||
@ -1257,7 +1257,7 @@ Standard_Boolean BRepMesh_FastDiscret::Update(const TopoDS_Edge& theEdg
|
||||
}
|
||||
NewNodInStruct(nbnodes) = ipl;
|
||||
theUV = BRepMesh_FastDiscretFace::FindUV(pEnd, uvLast, ipl, gFace, mindist, myLocation2d);
|
||||
BRepMesh_Vertex vl(theUV,ipl,MeshDS_Frontier);
|
||||
BRepMesh_Vertex vl(theUV,ipl,BRepMesh_Frontier);
|
||||
|
||||
ivl = myStructure->AddNode(vl);
|
||||
isvl = myVemap.FindIndex(ivl);
|
||||
@ -1281,7 +1281,7 @@ Standard_Boolean BRepMesh_FastDiscret::Update(const TopoDS_Edge& theEdg
|
||||
NewNodInStruct(i) = myNbLocat;
|
||||
// Record 2d point
|
||||
uv = theC2d->Value(Param->Value(i));
|
||||
v.Initialize(uv.Coord(), myNbLocat, MeshDS_Frontier);
|
||||
v.Initialize(uv.Coord(), myNbLocat, BRepMesh_Frontier);
|
||||
iv2 = myStructure->AddNode(v);
|
||||
isv = myVemap.FindIndex(iv2);
|
||||
if (isv == 0) isv = myVemap.Add(iv2);
|
||||
@ -1289,22 +1289,22 @@ Standard_Boolean BRepMesh_FastDiscret::Update(const TopoDS_Edge& theEdg
|
||||
|
||||
//add links
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2,iv1,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2,iv1,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,BRepMesh_Fixed));
|
||||
iv1 = iv2;
|
||||
}
|
||||
|
||||
// last point
|
||||
if (iv1 != ivl) {
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl,iv1,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl,iv1,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,BRepMesh_Fixed));
|
||||
}
|
||||
|
||||
|
||||
@ -1344,7 +1344,7 @@ Standard_Boolean BRepMesh_FastDiscret::Update(const TopoDS_Edge& theEdg
|
||||
pcos.Perform(P3d, wCurFound);
|
||||
if (pcos.IsDone()) wCurFound = pcos.Point().Parameter();
|
||||
theC2d->D0(wCurFound, uv);
|
||||
v.Initialize(uv.Coord(), myNbLocat, MeshDS_Frontier);
|
||||
v.Initialize(uv.Coord(), myNbLocat, BRepMesh_Frontier);
|
||||
iv2 = myStructure->AddNode(v);
|
||||
isv = myVemap.FindIndex(iv2);
|
||||
if (isv == 0) isv = myVemap.Add(iv2);
|
||||
@ -1353,22 +1353,22 @@ Standard_Boolean BRepMesh_FastDiscret::Update(const TopoDS_Edge& theEdg
|
||||
|
||||
//add links
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2,iv1,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2,iv1,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,BRepMesh_Fixed));
|
||||
iv1 = iv2;
|
||||
}
|
||||
|
||||
// last point
|
||||
if (iv1 != ivl) {
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl,iv1,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl,iv1,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,BRepMesh_Fixed));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1494,15 +1494,15 @@ const gp_Pnt& BRepMesh_FastDiscret::Pnt(const Standard_Integer Index) const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepMesh_FastDiscret::VerticesOfDomain(MeshDS_MapOfInteger& Indices) const
|
||||
void BRepMesh_FastDiscret::VerticesOfDomain(BRepMesh_MapOfInteger& Indices) const
|
||||
{
|
||||
Indices.Clear();
|
||||
|
||||
// recuperate from the map of edges.
|
||||
const MeshDS_MapOfInteger& edmap = myStructure->LinkOfDomain();
|
||||
const BRepMesh_MapOfInteger& edmap = myStructure->LinkOfDomain();
|
||||
|
||||
// iterator on edges.
|
||||
MeshDS_MapOfInteger::Iterator iter(edmap);
|
||||
BRepMesh_MapOfInteger::Iterator iter(edmap);
|
||||
|
||||
Standard_Integer ind_edge;
|
||||
for (iter.Reset(); iter.More(); iter.Next()) {
|
||||
|
@ -41,7 +41,7 @@ inline const TopTools_DataMapOfShapeReal& BRepMesh_FastDiscret::GetMapOfDefEdge(
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void BRepMesh_FastDiscret::EdgesOfDomain(MeshDS_MapOfInteger& Indices) const
|
||||
inline void BRepMesh_FastDiscret::EdgesOfDomain(BRepMesh_MapOfInteger& Indices) const
|
||||
{
|
||||
Indices = myStructure->LinkOfDomain();
|
||||
}
|
||||
@ -51,7 +51,7 @@ inline void BRepMesh_FastDiscret::EdgesOfDomain(MeshDS_MapOfInteger& Indices) c
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void BRepMesh_FastDiscret::TrianglesOfDomain(MeshDS_MapOfInteger& Indices) const
|
||||
inline void BRepMesh_FastDiscret::TrianglesOfDomain(BRepMesh_MapOfInteger& Indices) const
|
||||
{
|
||||
Indices = myStructure->ElemOfDomain();
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ uses Boolean from Standard,
|
||||
Vertex from BRepMesh,
|
||||
FaceAttribute from BRepMesh,
|
||||
ListOfInteger from TColStd,
|
||||
BaseAllocator from MeshDS,
|
||||
BaseAllocator from BRepMesh,
|
||||
DataMapOfIntegerPnt from BRepMesh,
|
||||
IndexedMapOfInteger from TColStd,
|
||||
IndexedMapOfReal from TColStd,
|
||||
@ -153,6 +153,6 @@ fields
|
||||
myInternalVerticesMode : Boolean from Standard; --mode to accounting internal vertices
|
||||
myUParam : IndexedMapOfReal from TColStd;
|
||||
myVParam : IndexedMapOfReal from TColStd;
|
||||
myAllocator : BaseAllocator from MeshDS;
|
||||
myAllocator : BaseAllocator from BRepMesh;
|
||||
|
||||
end FastDiscretFace;
|
||||
|
@ -192,7 +192,7 @@ void BRepMesh_FastDiscretFace::Add(const TopoDS_Face& theFace
|
||||
res.SetCoord((p2d.X()-(myAttrib->GetMinX()))/(myAttrib->GetDeltaX()),
|
||||
(p2d.Y()-(myAttrib->GetMinY()))/(myAttrib->GetDeltaY()));
|
||||
BRepMesh_Vertex v_new(res,v.Location3d(),v.Movability());
|
||||
const MeshDS_ListOfInteger& alist = myStructure->GetNodeList(i);
|
||||
const BRepMesh_ListOfInteger& alist = myStructure->GetNodeList(i);
|
||||
aMoveNodes.Add(v_new,alist);
|
||||
tabvert_corr(i) = i;
|
||||
}
|
||||
@ -224,9 +224,9 @@ void BRepMesh_FastDiscretFace::Add(const TopoDS_Face& theFace
|
||||
if(myStructure->ElemConnectedTo(i).Extent() < 1)
|
||||
{
|
||||
BRepMesh_Edge& anEdge = (BRepMesh_Edge&)trigu.GetEdge(i);
|
||||
if(anEdge.Movability()==MeshDS_Deleted)
|
||||
if(anEdge.Movability()==BRepMesh_Deleted)
|
||||
continue;
|
||||
anEdge.SetMovability(MeshDS_Free);
|
||||
anEdge.SetMovability(BRepMesh_Free);
|
||||
myStructure->RemoveLink(i);
|
||||
}
|
||||
}
|
||||
@ -289,7 +289,7 @@ void BRepMesh_FastDiscretFace::Add(const TopoDS_Face& theFace
|
||||
gp_XY res;
|
||||
res.SetCoord(p2d.X()*deltaX+umin,p2d.Y()*deltaY+vmin);
|
||||
BRepMesh_Vertex v_new(res,v.Location3d(),v.Movability());
|
||||
const MeshDS_ListOfInteger& alist = myStructure->GetNodeList(i);
|
||||
const BRepMesh_ListOfInteger& alist = myStructure->GetNodeList(i);
|
||||
aMoveNodes.Add(v_new,alist);
|
||||
}
|
||||
myStructure->ReplaceNodes(aMoveNodes);
|
||||
@ -388,7 +388,7 @@ Standard_Boolean BRepMesh_FastDiscretFace::RestoreStructureFromTriangulation
|
||||
|
||||
anUV = FindUV(pBegin, uvFirst, ipf, theSurf, mindist, myLocation2d);
|
||||
Standard_Integer iv1, isv1;
|
||||
BRepMesh_Vertex vf(anUV, ipf, MeshDS_Frontier);
|
||||
BRepMesh_Vertex vf(anUV, ipf, BRepMesh_Frontier);
|
||||
iv1 = myStructure->AddNode(vf);
|
||||
isv1 = myVemap.FindIndex(iv1);
|
||||
if (isv1 == 0)
|
||||
@ -428,7 +428,7 @@ Standard_Boolean BRepMesh_FastDiscretFace::RestoreStructureFromTriangulation
|
||||
}
|
||||
|
||||
anUV = FindUV(pEnd, uvLast, ipl, theSurf, mindist, myLocation2d);
|
||||
BRepMesh_Vertex vl(anUV, ipl, MeshDS_Frontier);
|
||||
BRepMesh_Vertex vl(anUV, ipl, BRepMesh_Frontier);
|
||||
|
||||
Standard_Integer isvl;
|
||||
ivl = myStructure->AddNode(vl);
|
||||
@ -453,7 +453,7 @@ Standard_Boolean BRepMesh_FastDiscretFace::RestoreStructureFromTriangulation
|
||||
anUV = UVNodes(Indices(i)).Coord();
|
||||
|
||||
Standard_Integer iv2, isv;
|
||||
v.Initialize(anUV, myNbLocat, MeshDS_Frontier);
|
||||
v.Initialize(anUV, myNbLocat, BRepMesh_Frontier);
|
||||
iv2 = myStructure->AddNode(v);
|
||||
isv = myVemap.FindIndex(iv2);
|
||||
if (isv == 0)
|
||||
@ -462,22 +462,22 @@ Standard_Boolean BRepMesh_FastDiscretFace::RestoreStructureFromTriangulation
|
||||
|
||||
//add links
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2,iv1,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv2,iv1,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,iv2,BRepMesh_Fixed));
|
||||
iv1 = iv2;
|
||||
}
|
||||
|
||||
// last point
|
||||
if (iv1 != ivl) {
|
||||
if (orEdge == TopAbs_FORWARD)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_REVERSED)
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl,iv1,MeshDS_Frontier));
|
||||
myStructure->AddLink(BRepMesh_Edge(ivl,iv1,BRepMesh_Frontier));
|
||||
else if (orEdge == TopAbs_INTERNAL)
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,MeshDS_Fixed));
|
||||
myStructure->AddLink(BRepMesh_Edge(iv1,ivl,BRepMesh_Fixed));
|
||||
}
|
||||
|
||||
Handle(Poly_PolygonOnTriangulation) P1 =
|
||||
@ -538,7 +538,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, p3d);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((U-umin)/deltaX, (V-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -585,7 +585,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, p3d);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((pasu-umin)/deltaX, (pasv-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -622,7 +622,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, p3d);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((pasu-umin)/deltaX, (pasv-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -654,7 +654,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, p3d);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((pasu-umin)/deltaX, (pasv-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -783,7 +783,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, p3d);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((pasu-umin)/deltaX, (pasv-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -955,7 +955,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, P1);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((U1-umin)/deltaX, (v-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -1062,7 +1062,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
|
||||
myLocation3d.Bind(myNbLocat, P1);
|
||||
// Record 2d point
|
||||
p2d.SetCoord((u-umin)/deltaX, (v-vmin)/deltaY);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, MeshDS_Free);
|
||||
newV.Initialize(p2d.XY(), myNbLocat, BRepMesh_Free);
|
||||
theInternalV.Append(newV);
|
||||
}
|
||||
}
|
||||
@ -1181,8 +1181,8 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
if (nbtriangles <= 0) break;
|
||||
|
||||
// Iterate on current triangles
|
||||
MeshDS_MapOfInteger::Iterator triDom;
|
||||
const MeshDS_MapOfInteger& TriMap = myStructure->ElemOfDomain();
|
||||
BRepMesh_MapOfInteger::Iterator triDom;
|
||||
const BRepMesh_MapOfInteger& TriMap = myStructure->ElemOfDomain();
|
||||
triDom.Initialize(TriMap);
|
||||
Standard_Integer aNbPnt = 0;
|
||||
Standard_Real umin = myAttrib->GetUMin();
|
||||
@ -1193,7 +1193,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
{
|
||||
Standard_Integer TriId = triDom.Key();
|
||||
const BRepMesh_Triangle& curTri=Triangle(TriId);
|
||||
if (curTri.Movability()==MeshDS_Deleted) continue;
|
||||
if (curTri.Movability()==BRepMesh_Deleted) continue;
|
||||
|
||||
Standard_Boolean o1, o2, o3;
|
||||
Standard_Integer v1 = 0, v2 = 0, v3 = 0, e1 = 0, e2 = 0, e3 = 0;
|
||||
@ -1203,9 +1203,9 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
const BRepMesh_Edge& edg2=Edge(e2);
|
||||
const BRepMesh_Edge& edg3=Edge(e3);
|
||||
|
||||
Standard_Boolean m1 = (edg1.Movability() == MeshDS_Frontier);
|
||||
Standard_Boolean m2 = (edg2.Movability() == MeshDS_Frontier);
|
||||
Standard_Boolean m3 = (edg3.Movability() == MeshDS_Frontier);
|
||||
Standard_Boolean m1 = (edg1.Movability() == BRepMesh_Frontier);
|
||||
Standard_Boolean m2 = (edg2.Movability() == BRepMesh_Frontier);
|
||||
Standard_Boolean m3 = (edg3.Movability() == BRepMesh_Frontier);
|
||||
if (o1) {
|
||||
v1=edg1.FirstNode();
|
||||
v2=edg1.LastNode();
|
||||
@ -1278,7 +1278,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
myNbLocat++;
|
||||
myLocation3d.Bind(myNbLocat,pDef);
|
||||
mi2d.SetCoord((mi2d.X()-umin)/deltaX,(mi2d.Y()-vmin)/deltaY);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,MeshDS_Free);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,BRepMesh_Free);
|
||||
theInternalV.Append(InsVertex);
|
||||
}
|
||||
theBadTriangles.Append(TriId);
|
||||
@ -1305,7 +1305,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
myNbLocat++;
|
||||
myLocation3d.Bind(myNbLocat,pDef);
|
||||
mi2d.SetCoord((mi2d.X()-umin)/deltaX,(mi2d.Y()-vmin)/deltaY);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,MeshDS_Free);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,BRepMesh_Free);
|
||||
theInternalV.Append(InsVertex);
|
||||
}
|
||||
theBadTriangles.Append(TriId);
|
||||
@ -1334,7 +1334,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
myNbLocat++;
|
||||
myLocation3d.Bind(myNbLocat,pDef);
|
||||
mi2d.SetCoord((mi2d.X()-umin)/deltaX,(mi2d.Y()-vmin)/deltaY);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,MeshDS_Free);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,BRepMesh_Free);
|
||||
theInternalV.Append(InsVertex);
|
||||
}
|
||||
theBadTriangles.Append(TriId);
|
||||
@ -1363,7 +1363,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
myNbLocat++;
|
||||
myLocation3d.Bind(myNbLocat,pDef);
|
||||
mi2d.SetCoord((mi2d.X()-umin)/deltaX,(mi2d.Y()-vmin)/deltaY);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,MeshDS_Free);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,BRepMesh_Free);
|
||||
theInternalV.Append(InsVertex);
|
||||
}
|
||||
theBadTriangles.Append(TriId);
|
||||
@ -1423,7 +1423,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
theCaro->D0(mi2d.X(), mi2d.Y(), pDef);
|
||||
myLocation3d.Bind(myNbLocat,pDef);
|
||||
mi2d.SetCoord((mi2d.X()-umin)/deltaX,(mi2d.Y()-vmin)/deltaY);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,MeshDS_Free);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,BRepMesh_Free);
|
||||
theInternalV.Append(InsVertex);
|
||||
theBadTriangles.Append(TriId);
|
||||
}
|
||||
@ -1472,7 +1472,7 @@ Standard_Real BRepMesh_FastDiscretFace::Control(const Handle(BRepAdaptor_HSurfac
|
||||
theCaro->D0(mi2d.X(), mi2d.Y(), pDef);
|
||||
myLocation3d.Bind(myNbLocat,pDef);
|
||||
mi2d.SetCoord((mi2d.X()-umin)/deltaX,(mi2d.Y()-vmin)/deltaY);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,MeshDS_Free);
|
||||
InsVertex.Initialize(mi2d,myNbLocat,BRepMesh_Free);
|
||||
theInternalV.Append(InsVertex);
|
||||
theBadTriangles.Append(TriId);
|
||||
}
|
||||
@ -1513,7 +1513,7 @@ void BRepMesh_FastDiscretFace::AddInShape(const TopoDS_Face& theFace,
|
||||
B.UpdateFace(theFace,TNull);
|
||||
|
||||
try{
|
||||
MeshDS_MapOfInteger::Iterator it;
|
||||
BRepMesh_MapOfInteger::Iterator it;
|
||||
|
||||
Standard_Integer e1, e2, e3, nTri;
|
||||
Standard_Integer v1, v2, v3, iv1, iv2, iv3;
|
||||
@ -1521,7 +1521,7 @@ void BRepMesh_FastDiscretFace::AddInShape(const TopoDS_Face& theFace,
|
||||
Standard_Boolean o1, o2, o3;
|
||||
TopAbs_Orientation orFace = theFace.Orientation();
|
||||
|
||||
const MeshDS_MapOfInteger& TriMap = myStructure->ElemOfDomain();
|
||||
const BRepMesh_MapOfInteger& TriMap = myStructure->ElemOfDomain();
|
||||
it.Initialize(TriMap);
|
||||
|
||||
nTri = TriMap.Extent();
|
||||
@ -1776,7 +1776,7 @@ void BRepMesh_FastDiscretFace::Add(const TopoDS_Vertex& theVert,
|
||||
Standard_Real mindist = BRep_Tool::Tolerance(theVert);
|
||||
// gp_Pnt2d uvXY = BRep_Tool::Parameters(theVert,theFace);
|
||||
gp_XY anUV = FindUV(theVert, uvXY, indVert, thegFace, mindist, myLocation2d);
|
||||
BRepMesh_Vertex vf(anUV, indVert, MeshDS_Fixed);
|
||||
BRepMesh_Vertex vf(anUV, indVert, BRepMesh_Fixed);
|
||||
Standard_Integer ivff = myStructure->AddNode(vf);
|
||||
Standard_Integer isvf = myVemap.FindIndex(ivff);
|
||||
if (isvf == 0) isvf = myVemap.Add(ivff);
|
||||
|
3
src/BRepMesh/BRepMesh_ListOfInteger.hxx
Executable file
3
src/BRepMesh/BRepMesh_ListOfInteger.hxx
Executable file
@ -0,0 +1,3 @@
|
||||
#include <NCollection_List.hxx>
|
||||
|
||||
typedef NCollection_List<Standard_Integer> BRepMesh_ListOfInteger;
|
3
src/BRepMesh/BRepMesh_MapOfInteger.hxx
Executable file
3
src/BRepMesh/BRepMesh_MapOfInteger.hxx
Executable file
@ -0,0 +1,3 @@
|
||||
#include <NCollection_Map.hxx>
|
||||
|
||||
typedef NCollection_Map<Standard_Integer> BRepMesh_MapOfInteger;
|
12
src/BRepMesh/BRepMesh_MapOfIntegerInteger.hxx
Executable file
12
src/BRepMesh/BRepMesh_MapOfIntegerInteger.hxx
Executable file
@ -0,0 +1,12 @@
|
||||
// File: BRepMesh_MapOfIntegerInteger.hxx
|
||||
// Created: Fri Jan 30 15:15:17 2009
|
||||
// Author: Pavel DURANDIN (pdn)
|
||||
// Copyright: Open CASCADE 2009
|
||||
|
||||
#ifndef BRepMesh_MapOfIntegerInteger_HeaderFile
|
||||
#define BRepMesh_MapOfIntegerInteger_HeaderFile
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
typedef NCollection_DataMap<Standard_Integer, Standard_Integer> BRepMesh_MapOfIntegerInteger;
|
||||
|
||||
#endif
|
105
src/BRepMesh/BRepMesh_PairOfIndex.hxx
Executable file
105
src/BRepMesh/BRepMesh_PairOfIndex.hxx
Executable file
@ -0,0 +1,105 @@
|
||||
// File: BRepMesh_PairOfIndex.hxx
|
||||
// Created: 29.01.09 15:55:25
|
||||
// Author: Pavel TELKOV
|
||||
// Copyright: Open CASCADE 2009
|
||||
|
||||
/*
|
||||
* Purpose: This class represent pair of integer indices
|
||||
* It is restricted to store more than two indices in it
|
||||
* This pair uses to store element indices connected to link
|
||||
*/
|
||||
|
||||
#ifndef BRepMesh_PairOfIndex_HeaderFile
|
||||
#define BRepMesh_PairOfIndex_HeaderFile
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class BRepMesh_PairOfIndex
|
||||
{
|
||||
public:
|
||||
BRepMesh_PairOfIndex()
|
||||
{ myIndx1 = myIndx2 = -1; }
|
||||
|
||||
BRepMesh_PairOfIndex(const BRepMesh_PairOfIndex& theOther)
|
||||
{
|
||||
myIndx1 = theOther.myIndx1;
|
||||
myIndx1 = theOther.myIndx2;
|
||||
}
|
||||
|
||||
//! Clear indices
|
||||
void Clear()
|
||||
{
|
||||
myIndx1 = myIndx2 = -1;
|
||||
}
|
||||
|
||||
//! append index (store first of last index of pair)
|
||||
void Append(const Standard_Integer theIndx)
|
||||
{
|
||||
if ( myIndx1 < 0 )
|
||||
myIndx1 = theIndx;
|
||||
else
|
||||
{
|
||||
if ( myIndx2 >= 0 )
|
||||
Standard_OutOfRange::Raise ("BRepMesh_PairOfIndex::Append, more than two index to store");
|
||||
myIndx2 = theIndx;
|
||||
}
|
||||
}
|
||||
|
||||
//! prepend index (store first index)
|
||||
void Prepend(const Standard_Integer theIndx)
|
||||
{
|
||||
if ( myIndx2 >= 0 )
|
||||
Standard_OutOfRange::Raise ("BRepMesh_PairOfIndex::Append, more than two index to store");
|
||||
myIndx2 = myIndx1;
|
||||
myIndx1 = theIndx;
|
||||
}
|
||||
|
||||
//! returns is pair not initialized by index
|
||||
Standard_Boolean IsEmpty() const
|
||||
{
|
||||
return (myIndx1 < 0 /*optimisation && myIndx2 < 0*/);
|
||||
}
|
||||
|
||||
//! returns numner of initialized indeces
|
||||
Standard_Integer Extent() const
|
||||
{
|
||||
return (myIndx1 < 0 ? 0 : (myIndx2 < 0 ? 1 : 2));
|
||||
}
|
||||
|
||||
//! returns first index from pair
|
||||
Standard_Integer FirstIndex() const
|
||||
{
|
||||
return myIndx1;
|
||||
}
|
||||
|
||||
//! returns last index
|
||||
Standard_Integer LastIndex() const
|
||||
{
|
||||
return (myIndx2 < 0 ? myIndx1 : myIndx2);
|
||||
}
|
||||
|
||||
Standard_Integer Index(const Standard_Integer theNum) const
|
||||
{
|
||||
return (theNum == 1 ? myIndx1 : myIndx2 /*(theNum == 2 ? myIndx2 : -1 )*/);
|
||||
}
|
||||
|
||||
void SetIndex(const Standard_Integer theNum,
|
||||
const Standard_Integer theIndex)
|
||||
{
|
||||
theNum == 1 ? myIndx1 = theIndex : myIndx2 = theIndex;
|
||||
}
|
||||
|
||||
//! remove indicated
|
||||
void RemoveIndex (const Standard_Integer theNum)
|
||||
{
|
||||
if ( theNum == 1 )
|
||||
myIndx1 = myIndx2;
|
||||
myIndx2 = -1;
|
||||
}
|
||||
//! fields
|
||||
private:
|
||||
Standard_Integer myIndx1;
|
||||
Standard_Integer myIndx2;
|
||||
};
|
||||
|
||||
#endif
|
97
src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cdl
Executable file
97
src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cdl
Executable file
@ -0,0 +1,97 @@
|
||||
class SelectorOfDataStructureOfDelaun from BRepMesh
|
||||
|
||||
---Purpose: Describes a selector and an Iterator on a
|
||||
-- selector of components of a Mesh.
|
||||
|
||||
uses Integer from Standard,
|
||||
Box from Bnd,
|
||||
MapOfInteger from BRepMesh,
|
||||
DataStructureOfDelaun from BRepMesh,
|
||||
Vertex from BRepMesh,
|
||||
Edge from BRepMesh,
|
||||
Triangle from BRepMesh
|
||||
|
||||
is Create returns SelectorOfDataStructureOfDelaun from BRepMesh;
|
||||
|
||||
Create (theMesh : DataStructureOfDelaun from BRepMesh)
|
||||
returns SelectorOfDataStructureOfDelaun from BRepMesh;
|
||||
|
||||
Initialize (me : in out;
|
||||
theMesh :DataStructureOfDelaun from BRepMesh)
|
||||
is static;
|
||||
|
||||
|
||||
NeighboursOf(me : in out;
|
||||
theNode : in Vertex from BRepMesh)
|
||||
is static;
|
||||
|
||||
NeighboursOfNode(me : in out;
|
||||
indexNode : in Integer from Standard)
|
||||
is static;
|
||||
|
||||
|
||||
NeighboursOf(me : in out;
|
||||
theLink : in Edge from BRepMesh)
|
||||
is static;
|
||||
|
||||
NeighboursOfLink(me : in out;
|
||||
indexLink : in Integer from Standard)
|
||||
is static;
|
||||
|
||||
|
||||
NeighboursOf(me : in out;
|
||||
theElem : in Triangle from BRepMesh)
|
||||
is static;
|
||||
|
||||
NeighboursOfElement(me : in out;
|
||||
indexElem : in Integer from Standard)
|
||||
---Purpose: All Neighbours Of the Element. By
|
||||
-- edge or by vertices.
|
||||
is static;
|
||||
|
||||
|
||||
NeighboursByEdgeOf (me : in out;
|
||||
theElem : in Triangle from BRepMesh)
|
||||
---Purpose: Neighbours by edge Of the Element.
|
||||
is static;
|
||||
|
||||
|
||||
NeighboursOf(me : in out;
|
||||
theSelector : in SelectorOfDataStructureOfDelaun from BRepMesh)
|
||||
---Purpose: Adds a level of Neighbours by edge
|
||||
-- to the selector <theSelector>.
|
||||
is static;
|
||||
|
||||
|
||||
AddNeighbours(me : in out)
|
||||
---Purpose: Adds a level of Neighbours by edge
|
||||
-- to the selector <me>.
|
||||
is static;
|
||||
|
||||
|
||||
Nodes (me)
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh is static;
|
||||
|
||||
Links (me)
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh is static;
|
||||
|
||||
Elements (me)
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh is static;
|
||||
|
||||
FrontierLinks(me)
|
||||
---Purpose: Gives the list of links incices
|
||||
-- frontier of the selector <me>.
|
||||
---C++: return const &
|
||||
returns MapOfInteger from BRepMesh is static;
|
||||
|
||||
|
||||
fields myMesh :DataStructureOfDelaun from BRepMesh;
|
||||
myNodes : MapOfInteger from BRepMesh;
|
||||
myLinks : MapOfInteger from BRepMesh;
|
||||
myElements : MapOfInteger from BRepMesh;
|
||||
myFrontier : MapOfInteger from BRepMesh;
|
||||
|
||||
end SelectorOfDataStructureOfDelaun;
|
156
src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cxx
Executable file
156
src/BRepMesh/BRepMesh_SelectorOfDataStructureOfDelaun.cxx
Executable file
@ -0,0 +1,156 @@
|
||||
// File: BRepMesh_SelectorOfDataStructureOfDelaun.cxx
|
||||
// Created: Tue Jun 1 11:20:51 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_SelectorOfDataStructureOfDelaun.ixx>
|
||||
#include <BRepMesh_PairOfIndex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepMesh_SelectorOfDataStructureOfDelaun
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_SelectorOfDataStructureOfDelaun::BRepMesh_SelectorOfDataStructureOfDelaun()
|
||||
: myNodes(10, new NCollection_IncAllocator),
|
||||
myLinks(10, new NCollection_IncAllocator),
|
||||
myElements(10, new NCollection_IncAllocator),
|
||||
myFrontier(10, new NCollection_IncAllocator)
|
||||
|
||||
{}
|
||||
|
||||
BRepMesh_SelectorOfDataStructureOfDelaun::BRepMesh_SelectorOfDataStructureOfDelaun(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh)
|
||||
: myMesh(theMesh),
|
||||
myNodes(10, myMesh->Allocator()),
|
||||
myLinks(10, myMesh->Allocator()),
|
||||
myElements(10, myMesh->Allocator()),
|
||||
myFrontier(10, myMesh->Allocator())
|
||||
{}
|
||||
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::Initialize(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh)
|
||||
{
|
||||
myMesh=theMesh;
|
||||
myNodes.Clear();
|
||||
myLinks.Clear();
|
||||
myElements.Clear();
|
||||
myFrontier.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NeighboursOfNode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOf(const BRepMesh_Vertex& theNode)
|
||||
{
|
||||
NeighboursOfNode(myMesh->IndexOf(theNode));
|
||||
}
|
||||
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOfNode(const Standard_Integer indexNode)
|
||||
{
|
||||
BRepMesh_ListOfInteger::Iterator itL(myMesh->LinkNeighboursOf(indexNode));
|
||||
|
||||
for (; itL.More(); itL.Next()) {
|
||||
const BRepMesh_PairOfIndex& aPair = myMesh->ElemConnectedTo(itL.Value());
|
||||
for(Standard_Integer j = 1, jn = aPair.Extent(); j <= jn; j++)
|
||||
myElements.Add(aPair.Index(j));
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NeighboursOfLink
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOf(const BRepMesh_Edge& theLink)
|
||||
{
|
||||
NeighboursOfNode(theLink.FirstNode());
|
||||
NeighboursOfNode(theLink.LastNode());
|
||||
}
|
||||
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOfLink(const Standard_Integer indexLink)
|
||||
{
|
||||
NeighboursOf(myMesh->GetLink(indexLink));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NeighboursOfElement
|
||||
//purpose : by edge and by vertices
|
||||
//=======================================================================
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOf(const BRepMesh_Triangle& theElem)
|
||||
{
|
||||
Standard_Integer v1, v2, v3, ev;
|
||||
Standard_Boolean o1, o2, o3;
|
||||
theElem.Edges(v1, v3, ev, o1, o2, o3);
|
||||
v2=myMesh->GetLink(v1).LastNode();
|
||||
v1=myMesh->GetLink(v1).FirstNode();
|
||||
ev=myMesh->GetLink(v3).LastNode();
|
||||
if (v1!=ev && v2!=ev) v3=ev;
|
||||
else v3=myMesh->GetLink(v3).FirstNode();
|
||||
NeighboursOfNode(v1);
|
||||
NeighboursOfNode(v2);
|
||||
NeighboursOfNode(v3);
|
||||
}
|
||||
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOfElement(const Standard_Integer indexElem)
|
||||
{
|
||||
NeighboursOf(myMesh->GetElement(indexElem));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NeighboursByEdgeOf
|
||||
//purpose : Neighbours Of an element only by edge
|
||||
//=======================================================================
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursByEdgeOf(const BRepMesh_Triangle& theElem)
|
||||
{
|
||||
Standard_Integer e[3], iEd;
|
||||
Standard_Boolean o1, o2, o3;
|
||||
theElem.Edges(e[0], e[1], e[2], o1, o2, o3);
|
||||
|
||||
for (iEd=0; iEd<3; iEd++) {
|
||||
const BRepMesh_PairOfIndex& aPair = myMesh->ElemConnectedTo(e[iEd]);
|
||||
for(Standard_Integer j = 1, jn = aPair.Extent(); j <= jn; j++)
|
||||
myElements.Add(aPair.Index(j));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NeighboursOfSelector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::NeighboursOf(const BRepMesh_SelectorOfDataStructureOfDelaun& /*theSelector*/)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddNeighbours
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_SelectorOfDataStructureOfDelaun::AddNeighbours()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Nodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_MapOfInteger& BRepMesh_SelectorOfDataStructureOfDelaun::Nodes()const
|
||||
{return myNodes;}
|
||||
|
||||
//=======================================================================
|
||||
//function : Links
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_MapOfInteger& BRepMesh_SelectorOfDataStructureOfDelaun::Links()const
|
||||
{return myLinks;}
|
||||
|
||||
//=======================================================================
|
||||
//function : Elements
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_MapOfInteger& BRepMesh_SelectorOfDataStructureOfDelaun::Elements()const
|
||||
{return myElements;}
|
||||
|
||||
//=======================================================================
|
||||
//function : FrontierLinks
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BRepMesh_MapOfInteger& BRepMesh_SelectorOfDataStructureOfDelaun::FrontierLinks()const
|
||||
{return myFrontier;}
|
||||
|
@ -1,72 +1,72 @@
|
||||
-- File: BRepMesh_Triangle.cdl
|
||||
-- Created: Wed Sep 22 18:11:52 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
-- File: BRepMesh_Triangle.cdl
|
||||
-- Created: Wed Sep 22 18:11:52 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class Triangle from BRepMesh
|
||||
|
||||
---Purpose:
|
||||
---Purpose:
|
||||
|
||||
uses Boolean from Standard,
|
||||
Integer from Standard,
|
||||
DegreeOfFreedom from MeshDS
|
||||
|
||||
Integer from Standard,
|
||||
DegreeOfFreedom from BRepMesh
|
||||
|
||||
|
||||
is Create returns Triangle from BRepMesh;
|
||||
|
||||
is Create returns Triangle from BRepMesh;
|
||||
|
||||
|
||||
Create (e1, e2, e3 : Integer from Standard;
|
||||
o1, o2, o3 : Boolean from Standard;
|
||||
canMove : DegreeOfFreedom from MeshDS)
|
||||
returns Triangle from BRepMesh;
|
||||
|
||||
|
||||
Initialize (me : in out;
|
||||
e1, e2, e3 : Integer from Standard;
|
||||
o1, o2, o3 : Boolean from Standard;
|
||||
canMove : DegreeOfFreedom from MeshDS)
|
||||
is static;
|
||||
|
||||
|
||||
Edges (me;
|
||||
e1, e2, e3 : out Integer from Standard;
|
||||
o1, o2, o3 : out Boolean from Standard)
|
||||
is static;
|
||||
Create (e1, e2, e3 : Integer from Standard;
|
||||
o1, o2, o3 : Boolean from Standard;
|
||||
canMove : DegreeOfFreedom from BRepMesh)
|
||||
returns Triangle from BRepMesh;
|
||||
|
||||
|
||||
Movability (me)
|
||||
---C++: inline
|
||||
returns DegreeOfFreedom from MeshDS
|
||||
is static;
|
||||
Initialize (me : in out;
|
||||
e1, e2, e3 : Integer from Standard;
|
||||
o1, o2, o3 : Boolean from Standard;
|
||||
canMove : DegreeOfFreedom from BRepMesh)
|
||||
is static;
|
||||
|
||||
|
||||
SetMovability (me : in out;
|
||||
Move : DegreeOfFreedom from MeshDS)
|
||||
is static;
|
||||
Edges (me;
|
||||
e1, e2, e3 : out Integer from Standard;
|
||||
o1, o2, o3 : out Boolean from Standard)
|
||||
is static;
|
||||
|
||||
|
||||
HashCode (me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---C++: function call
|
||||
is static;
|
||||
Movability (me)
|
||||
---C++: inline
|
||||
returns DegreeOfFreedom from BRepMesh
|
||||
is static;
|
||||
|
||||
|
||||
IsEqual (me; Other : Triangle from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
---C++: alias operator ==
|
||||
is static;
|
||||
SetMovability (me : in out;
|
||||
Move : DegreeOfFreedom from BRepMesh)
|
||||
is static;
|
||||
|
||||
|
||||
fields Edge1 : Integer from Standard;
|
||||
Orientation1 : Boolean from Standard;
|
||||
Edge2 : Integer from Standard;
|
||||
Orientation2 : Boolean from Standard;
|
||||
Edge3 : Integer from Standard;
|
||||
Orientation3 : Boolean from Standard;
|
||||
myMovability : DegreeOfFreedom from MeshDS;
|
||||
HashCode (me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---C++: function call
|
||||
is static;
|
||||
|
||||
|
||||
IsEqual (me; Other : Triangle from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
---C++: alias operator ==
|
||||
is static;
|
||||
|
||||
|
||||
fields Edge1 : Integer from Standard;
|
||||
Orientation1 : Boolean from Standard;
|
||||
Edge2 : Integer from Standard;
|
||||
Orientation2 : Boolean from Standard;
|
||||
Edge3 : Integer from Standard;
|
||||
Orientation3 : Boolean from Standard;
|
||||
myMovability : DegreeOfFreedom from BRepMesh;
|
||||
|
||||
end Triangle;
|
||||
|
@ -1,33 +1,33 @@
|
||||
// File: BRepMesh_Triangle.cxx
|
||||
// Created: Thu Sep 23 13:10:58 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
// File: BRepMesh_Triangle.cxx
|
||||
// Created: Thu Sep 23 13:10:58 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_Triangle.ixx>
|
||||
|
||||
|
||||
BRepMesh_Triangle::BRepMesh_Triangle()
|
||||
: Edge1(0), Edge2(0), Edge3(0), myMovability(MeshDS_Free)
|
||||
: Edge1(0), Edge2(0), Edge3(0), myMovability(BRepMesh_Free)
|
||||
{}
|
||||
|
||||
BRepMesh_Triangle::BRepMesh_Triangle (const Standard_Integer e1,
|
||||
const Standard_Integer e2,
|
||||
const Standard_Integer e3,
|
||||
const Standard_Boolean o1,
|
||||
const Standard_Boolean o2,
|
||||
const Standard_Boolean o3,
|
||||
const MeshDS_DegreeOfFreedom canMove)
|
||||
: Edge1(e1), Orientation1(o1),Edge2(e2), Orientation2(o2),
|
||||
Edge3(e3), Orientation3(o3),
|
||||
myMovability(canMove)
|
||||
const Standard_Integer e2,
|
||||
const Standard_Integer e3,
|
||||
const Standard_Boolean o1,
|
||||
const Standard_Boolean o2,
|
||||
const Standard_Boolean o3,
|
||||
const BRepMesh_DegreeOfFreedom canMove)
|
||||
: Edge1(e1), Orientation1(o1),Edge2(e2), Orientation2(o2),
|
||||
Edge3(e3), Orientation3(o3),
|
||||
myMovability(canMove)
|
||||
{}
|
||||
|
||||
void BRepMesh_Triangle::Initialize(const Standard_Integer e1,
|
||||
const Standard_Integer e2,
|
||||
const Standard_Integer e3,
|
||||
const Standard_Boolean o1,
|
||||
const Standard_Boolean o2,
|
||||
const Standard_Boolean o3,
|
||||
const MeshDS_DegreeOfFreedom canMove)
|
||||
const Standard_Integer e2,
|
||||
const Standard_Integer e3,
|
||||
const Standard_Boolean o1,
|
||||
const Standard_Boolean o2,
|
||||
const Standard_Boolean o3,
|
||||
const BRepMesh_DegreeOfFreedom canMove)
|
||||
{
|
||||
Edge1 =e1;
|
||||
Edge2 =e2;
|
||||
@ -39,11 +39,11 @@ void BRepMesh_Triangle::Initialize(const Standard_Integer e1,
|
||||
}
|
||||
|
||||
void BRepMesh_Triangle::Edges(Standard_Integer& e1,
|
||||
Standard_Integer& e2,
|
||||
Standard_Integer& e3,
|
||||
Standard_Boolean& o1,
|
||||
Standard_Boolean& o2,
|
||||
Standard_Boolean& o3)const
|
||||
Standard_Integer& e2,
|
||||
Standard_Integer& e3,
|
||||
Standard_Boolean& o1,
|
||||
Standard_Boolean& o2,
|
||||
Standard_Boolean& o3)const
|
||||
{
|
||||
e1=Edge1;
|
||||
e2=Edge2;
|
||||
@ -53,21 +53,21 @@ void BRepMesh_Triangle::Edges(Standard_Integer& e1,
|
||||
o3=Orientation3;
|
||||
}
|
||||
|
||||
void BRepMesh_Triangle::SetMovability(const MeshDS_DegreeOfFreedom Move)
|
||||
void BRepMesh_Triangle::SetMovability(const BRepMesh_DegreeOfFreedom Move)
|
||||
{
|
||||
myMovability =Move;
|
||||
}
|
||||
|
||||
Standard_Integer BRepMesh_Triangle::HashCode
|
||||
(const Standard_Integer Upper)const
|
||||
(const Standard_Integer Upper)const
|
||||
{
|
||||
return ::HashCode(Edge1+Edge2+Edge3, Upper);
|
||||
}
|
||||
|
||||
Standard_Boolean BRepMesh_Triangle::IsEqual
|
||||
(const BRepMesh_Triangle& Other)const
|
||||
(const BRepMesh_Triangle& Other)const
|
||||
{
|
||||
if (myMovability==MeshDS_Deleted || Other.myMovability==MeshDS_Deleted)
|
||||
if (myMovability==BRepMesh_Deleted || Other.myMovability==BRepMesh_Deleted)
|
||||
return Standard_False;
|
||||
if (Edge1==Other.Edge1 && Edge2==Other.Edge2 && Edge3==Other.Edge3)
|
||||
return Standard_True;
|
||||
|
@ -1,9 +1,9 @@
|
||||
// File: BRepMesh_Triangle.lxx
|
||||
// Created: Thu Sep 23 13:14:07 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
// File: BRepMesh_Triangle.lxx
|
||||
// Created: Thu Sep 23 13:14:07 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
inline MeshDS_DegreeOfFreedom BRepMesh_Triangle::Movability()const
|
||||
inline BRepMesh_DegreeOfFreedom BRepMesh_Triangle::Movability()const
|
||||
{
|
||||
return myMovability;
|
||||
}
|
||||
|
@ -1,81 +1,80 @@
|
||||
-- File: BRepMesh_Vertex.cdl
|
||||
-- Created: Wed Sep 22 18:04:35 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
-- File: BRepMesh_Vertex.cdl
|
||||
-- Created: Wed Sep 22 18:04:35 1993
|
||||
-- Author: Didier PIFFAULT
|
||||
-- <dpf@zerox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
class Vertex from BRepMesh
|
||||
|
||||
---Purpose:
|
||||
---Purpose:
|
||||
|
||||
|
||||
uses Boolean from Standard,
|
||||
Integer from Standard,
|
||||
Real from Standard,
|
||||
XY from gp,
|
||||
DegreeOfFreedom from MeshDS
|
||||
Integer from Standard,
|
||||
Real from Standard,
|
||||
XY from gp,
|
||||
DegreeOfFreedom from BRepMesh
|
||||
|
||||
|
||||
is Create returns Vertex from BRepMesh;
|
||||
is Create returns Vertex from BRepMesh;
|
||||
|
||||
Create (UV : in XY from gp;
|
||||
Locat3d : in Integer from Standard;
|
||||
Move : in DegreeOfFreedom from MeshDS)
|
||||
returns Vertex from BRepMesh;
|
||||
|
||||
|
||||
Create (U, V : Real from Standard;
|
||||
Move : in DegreeOfFreedom from MeshDS)
|
||||
---Purpose: For MeshAlgo.
|
||||
returns Vertex from BRepMesh;
|
||||
|
||||
|
||||
Initialize (me : in out;
|
||||
UV : in XY from gp;
|
||||
Locat3d : in Integer from Standard;
|
||||
Move : in DegreeOfFreedom from MeshDS)
|
||||
is static;
|
||||
|
||||
|
||||
Coord (me)
|
||||
returns XY from gp
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
Location3d (me)
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
Movability (me)
|
||||
returns DegreeOfFreedom from MeshDS
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
SetMovability (me : in out;
|
||||
Move : DegreeOfFreedom from MeshDS)
|
||||
is static;
|
||||
Create (UV : in XY from gp;
|
||||
Locat3d : in Integer from Standard;
|
||||
Move : in DegreeOfFreedom from BRepMesh)
|
||||
returns Vertex from BRepMesh;
|
||||
|
||||
|
||||
HashCode (me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---C++: function call
|
||||
is static;
|
||||
Create (U, V : Real from Standard;
|
||||
Move : in DegreeOfFreedom from BRepMesh)
|
||||
returns Vertex from BRepMesh;
|
||||
|
||||
|
||||
IsEqual (me; Other : Vertex from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
---C++: alias operator ==
|
||||
is static;
|
||||
Initialize (me : in out;
|
||||
UV : in XY from gp;
|
||||
Locat3d : in Integer from Standard;
|
||||
Move : in DegreeOfFreedom from BRepMesh)
|
||||
is static;
|
||||
|
||||
|
||||
fields myUV : XY from gp;
|
||||
myLocation : Integer from Standard;
|
||||
myMovability : DegreeOfFreedom from MeshDS;
|
||||
Coord (me)
|
||||
returns XY from gp
|
||||
---C++: return const &
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
Location3d (me)
|
||||
returns Integer from Standard
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
Movability (me)
|
||||
returns DegreeOfFreedom from BRepMesh
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
SetMovability (me : in out;
|
||||
Move : DegreeOfFreedom from BRepMesh)
|
||||
is static;
|
||||
|
||||
|
||||
HashCode (me;
|
||||
Upper : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---C++: function call
|
||||
is static;
|
||||
|
||||
|
||||
IsEqual (me; Other : Vertex from BRepMesh)
|
||||
returns Boolean from Standard
|
||||
---C++: alias operator ==
|
||||
is static;
|
||||
|
||||
|
||||
fields myUV : XY from gp;
|
||||
myLocation : Integer from Standard;
|
||||
myMovability : DegreeOfFreedom from BRepMesh;
|
||||
|
||||
end Vertex;
|
||||
|
@ -1,38 +1,38 @@
|
||||
// File: BRepMesh_Vertex.cxx
|
||||
// Created: Thu Sep 23 12:46:51 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
// File: BRepMesh_Vertex.cxx
|
||||
// Created: Thu Sep 23 12:46:51 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
#include <BRepMesh_Vertex.ixx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
|
||||
BRepMesh_Vertex::BRepMesh_Vertex()
|
||||
: myLocation(0), myMovability(MeshDS_Free)
|
||||
: myLocation(0), myMovability(BRepMesh_Free)
|
||||
{}
|
||||
|
||||
BRepMesh_Vertex::BRepMesh_Vertex(const gp_XY& UV,
|
||||
const Standard_Integer Locat3d,
|
||||
const MeshDS_DegreeOfFreedom Move)
|
||||
: myUV(UV), myLocation(Locat3d), myMovability(Move)
|
||||
const Standard_Integer Locat3d,
|
||||
const BRepMesh_DegreeOfFreedom Move)
|
||||
: myUV(UV), myLocation(Locat3d), myMovability(Move)
|
||||
{}
|
||||
|
||||
BRepMesh_Vertex::BRepMesh_Vertex(const Standard_Real U,
|
||||
const Standard_Real V,
|
||||
const MeshDS_DegreeOfFreedom Move)
|
||||
: myUV(U, V), myLocation(0), myMovability(Move)
|
||||
const Standard_Real V,
|
||||
const BRepMesh_DegreeOfFreedom Move)
|
||||
: myUV(U, V), myLocation(0), myMovability(Move)
|
||||
{}
|
||||
|
||||
void BRepMesh_Vertex::Initialize(const gp_XY& UV,
|
||||
const Standard_Integer Locat3d,
|
||||
const MeshDS_DegreeOfFreedom Move)
|
||||
const Standard_Integer Locat3d,
|
||||
const BRepMesh_DegreeOfFreedom Move)
|
||||
{
|
||||
myUV=UV;
|
||||
myLocation=Locat3d;
|
||||
myMovability=Move;
|
||||
}
|
||||
|
||||
void BRepMesh_Vertex::SetMovability(const MeshDS_DegreeOfFreedom Move)
|
||||
void BRepMesh_Vertex::SetMovability(const BRepMesh_DegreeOfFreedom Move)
|
||||
{
|
||||
myMovability=Move;
|
||||
}
|
||||
@ -48,7 +48,7 @@ Standard_Integer BRepMesh_Vertex::HashCode(const Standard_Integer Upper)const
|
||||
|
||||
Standard_Boolean BRepMesh_Vertex::IsEqual(const BRepMesh_Vertex& Other)const
|
||||
{
|
||||
if (myMovability!=MeshDS_Deleted && Other.myMovability!=MeshDS_Deleted)
|
||||
if (myMovability!=BRepMesh_Deleted && Other.myMovability!=BRepMesh_Deleted)
|
||||
return (myUV.IsEqual(Other.myUV, Precision::PConfusion()));
|
||||
return Standard_False;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// File: BRepMesh_Vertex.lxx
|
||||
// Created: Thu Sep 23 12:49:00 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
// File: BRepMesh_Vertex.lxx
|
||||
// Created: Thu Sep 23 12:49:00 1993
|
||||
// Author: Didier PIFFAULT
|
||||
// <dpf@zerox>
|
||||
|
||||
inline const gp_XY& BRepMesh_Vertex::Coord()const
|
||||
{
|
||||
@ -13,7 +13,7 @@ inline Standard_Integer BRepMesh_Vertex::Location3d()const
|
||||
return myLocation;
|
||||
}
|
||||
|
||||
inline MeshDS_DegreeOfFreedom BRepMesh_Vertex::Movability()const
|
||||
inline BRepMesh_DegreeOfFreedom BRepMesh_Vertex::Movability()const
|
||||
{
|
||||
return myMovability;
|
||||
}
|
||||
|
@ -1,3 +1,10 @@
|
||||
BRepMesh_PluginMacro.hxx
|
||||
BRepMesh_ClassifierPtr.hxx
|
||||
BRepMesh_CellFilter.hxx
|
||||
BRepMesh_CircleInspector.hxx
|
||||
BRepMesh_MapOfIntegerInteger.hxx
|
||||
BRepMesh_MapOfInteger.hxx
|
||||
BRepMesh_ListOfInteger.hxx
|
||||
BRepMesh_BaseAllocator.hxx
|
||||
BRepMesh_PairOfIndex.hxx
|
||||
EXTERNLIB
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@
|
||||
#include <Draw_Color.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
#include <Standard_RangeError.hxx>
|
||||
#include <MeshDS_DegreeOfFreedom.hxx>
|
||||
#include <BRepMesh_DegreeOfFreedom.hxx>
|
||||
#include <BRepMesh_Edge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
#include <BRepMesh_Triangle.hxx>
|
||||
@ -25,7 +25,7 @@
|
||||
//=======================================================================
|
||||
|
||||
MeshTest_DrawableMesh::MeshTest_DrawableMesh() :
|
||||
myDeflection(1.), myinshape(Standard_False)
|
||||
myDeflection(1.), myinshape(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
@ -35,14 +35,14 @@ MeshTest_DrawableMesh::MeshTest_DrawableMesh() :
|
||||
//=======================================================================
|
||||
|
||||
MeshTest_DrawableMesh::MeshTest_DrawableMesh(const TopoDS_Shape& S,
|
||||
const Standard_Real Deflect,
|
||||
const Standard_Boolean Partage,
|
||||
const Standard_Boolean inshape) :
|
||||
myDeflection(Deflect), myinshape(inshape)
|
||||
const Standard_Real Deflect,
|
||||
const Standard_Boolean Partage,
|
||||
const Standard_Boolean inshape) :
|
||||
myDeflection(Deflect), myinshape(inshape)
|
||||
{
|
||||
Bnd_Box B;
|
||||
BRepBndLib::Add(S, B);
|
||||
|
||||
|
||||
myMesh = new BRepMesh_FastDiscret(Deflect, S, B, 0.5, Partage, inshape);
|
||||
}
|
||||
|
||||
@ -53,9 +53,9 @@ MeshTest_DrawableMesh::MeshTest_DrawableMesh(const TopoDS_Shape& S,
|
||||
//=======================================================================
|
||||
|
||||
MeshTest_DrawableMesh::MeshTest_DrawableMesh(const Handle(BRepMesh_FastDiscret)& Tr):
|
||||
myDeflection(1.0)
|
||||
myDeflection(1.0)
|
||||
{
|
||||
myMesh = Tr;
|
||||
myMesh = Tr;
|
||||
}
|
||||
|
||||
|
||||
@ -96,18 +96,18 @@ void MeshTest_DrawableMesh::DrawOn(Draw_Display& D) const
|
||||
/* Handle(BRepMesh_DataStructureOfDelaun) struc = myMesh->Result();
|
||||
Standard_Integer nbc;
|
||||
D.SetColor(Draw_vert);
|
||||
|
||||
|
||||
for (Standard_Integer iLi=1; iLi<=myMesh->NbEdges(); iLi++) {
|
||||
const BRepMesh_Edge& ed=myMesh->Edge(iLi);
|
||||
if (ed.Movability()!=MeshDS_Deleted) {
|
||||
nbc=struc->ElemConnectedTo(iLi).Extent();
|
||||
if (nbc<=0) D.SetColor(Draw_bleu);
|
||||
else if (nbc==1) D.SetColor(Draw_jaune);
|
||||
else if (nbc==2) D.SetColor(Draw_vert);
|
||||
else D.SetColor(Draw_corail);
|
||||
D.MoveTo(myMesh->Pnt(ed.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed.LastNode()));
|
||||
}
|
||||
const BRepMesh_Edge& ed=myMesh->Edge(iLi);
|
||||
if (ed.Movability()!=BRepMesh_Deleted) {
|
||||
nbc=struc->ElemConnectedTo(iLi).Extent();
|
||||
if (nbc<=0) D.SetColor(Draw_bleu);
|
||||
else if (nbc==1) D.SetColor(Draw_jaune);
|
||||
else if (nbc==2) D.SetColor(Draw_vert);
|
||||
else D.SetColor(Draw_corail);
|
||||
D.MoveTo(myMesh->Pnt(ed.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed.LastNode()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,38 +117,38 @@ void MeshTest_DrawableMesh::DrawOn(Draw_Display& D) const
|
||||
Standard_Boolean o1, o2, o3;
|
||||
|
||||
for (i = 1; i <= myTriangles.Length(); i++) {
|
||||
const BRepMesh_Triangle& tri=struc->GetElement(myTriangles(i));
|
||||
tri.Edges(e1, e2, e3, o1, o2, o3);
|
||||
const BRepMesh_Edge& ed1=myMesh->Edge(e1);
|
||||
if (ed1.Movability()!=MeshDS_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed1.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed1.LastNode()));
|
||||
}
|
||||
const BRepMesh_Edge& ed2=myMesh->Edge(e2);
|
||||
if (ed2.Movability()!=MeshDS_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed2.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed2.LastNode()));
|
||||
}
|
||||
const BRepMesh_Edge& ed3=myMesh->Edge(e3);
|
||||
if (ed3.Movability()!=MeshDS_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed3.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed3.LastNode()));
|
||||
}
|
||||
const BRepMesh_Triangle& tri=struc->GetElement(myTriangles(i));
|
||||
tri.Edges(e1, e2, e3, o1, o2, o3);
|
||||
const BRepMesh_Edge& ed1=myMesh->Edge(e1);
|
||||
if (ed1.Movability()!=BRepMesh_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed1.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed1.LastNode()));
|
||||
}
|
||||
const BRepMesh_Edge& ed2=myMesh->Edge(e2);
|
||||
if (ed2.Movability()!=BRepMesh_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed2.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed2.LastNode()));
|
||||
}
|
||||
const BRepMesh_Edge& ed3=myMesh->Edge(e3);
|
||||
if (ed3.Movability()!=BRepMesh_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed3.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed3.LastNode()));
|
||||
}
|
||||
}
|
||||
|
||||
// highlighted edges
|
||||
D.SetColor(Draw_rouge);
|
||||
for (i = 1; i <= myEdges.Length(); i++) {
|
||||
const BRepMesh_Edge& ed=myMesh->Edge(myEdges(i));
|
||||
if (ed.Movability()!=MeshDS_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed.LastNode()));
|
||||
}
|
||||
const BRepMesh_Edge& ed=myMesh->Edge(myEdges(i));
|
||||
if (ed.Movability()!=BRepMesh_Deleted) {
|
||||
D.MoveTo(myMesh->Pnt(ed.FirstNode()));
|
||||
D.DrawTo(myMesh->Pnt(ed.LastNode()));
|
||||
}
|
||||
}
|
||||
|
||||
// highlighted vertices
|
||||
for (i = 1; i <= myVertices.Length(); i++) {
|
||||
D.DrawMarker(myMesh->Pnt(myVertices(i)),Draw_Losange);
|
||||
D.DrawMarker(myMesh->Pnt(myVertices(i)),Draw_Losange);
|
||||
}
|
||||
|
||||
*/
|
||||
@ -171,28 +171,28 @@ Handle(Draw_Drawable3D) MeshTest_DrawableMesh::Copy() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void printdegree(MeshDS_DegreeOfFreedom dof)
|
||||
static void printdegree(BRepMesh_DegreeOfFreedom dof)
|
||||
{
|
||||
switch (dof) {
|
||||
case MeshDS_InVolume :
|
||||
case BRepMesh_InVolume :
|
||||
cout << "InVolume";
|
||||
break;
|
||||
case MeshDS_OnSurface :
|
||||
case BRepMesh_OnSurface :
|
||||
cout << "OnSurface";
|
||||
break;
|
||||
case MeshDS_OnCurve :
|
||||
case BRepMesh_OnCurve :
|
||||
cout << "OnCurve";
|
||||
break;
|
||||
case MeshDS_Fixed :
|
||||
case BRepMesh_Fixed :
|
||||
cout << "Fixed";
|
||||
break;
|
||||
case MeshDS_Frontier :
|
||||
case BRepMesh_Frontier :
|
||||
cout << "Frontier";
|
||||
break;
|
||||
case MeshDS_Deleted :
|
||||
case BRepMesh_Deleted :
|
||||
cout << "Deleted";
|
||||
break;
|
||||
case MeshDS_Free :
|
||||
case BRepMesh_Free :
|
||||
cout << "Free";
|
||||
break;
|
||||
}
|
||||
@ -201,7 +201,7 @@ static void printdegree(MeshDS_DegreeOfFreedom dof)
|
||||
void MeshTest_DrawableMesh::Dump(Standard_OStream& S) const
|
||||
{
|
||||
// Should be reimplemented
|
||||
|
||||
|
||||
/*Handle(BRepMesh_DataStructureOfDelaun) struc=myMesh->Result();
|
||||
Standard_Integer e1, e2, e3;
|
||||
Standard_Boolean o1, o2, o3;
|
||||
@ -209,41 +209,41 @@ void MeshTest_DrawableMesh::Dump(Standard_OStream& S) const
|
||||
Standard_Integer nbn=struc->NbNodes();
|
||||
Standard_Integer nbl=struc->NbLinks();
|
||||
Standard_Integer nbe=struc->NbElements();
|
||||
|
||||
|
||||
for (in=1; in<=nbn; in++) {
|
||||
BRepMesh_Vertex nod=struc->GetNode(in);
|
||||
S<<"(node "<<in<<" (uv "<<nod.Coord().X()<<" "
|
||||
<<nod.Coord().Y()<<") (3d "
|
||||
<<nod.Location3d()<<") ";
|
||||
printdegree(nod.Movability());
|
||||
S<<" (edgeconex";
|
||||
MeshDS_ListOfInteger::Iterator tati(struc->LinkNeighboursOf(in));
|
||||
for (; tati.More(); tati.Next()) S<<" "<<tati.Value();
|
||||
S << "))\n";
|
||||
BRepMesh_Vertex nod=struc->GetNode(in);
|
||||
S<<"(node "<<in<<" (uv "<<nod.Coord().X()<<" "
|
||||
<<nod.Coord().Y()<<") (3d "
|
||||
<<nod.Location3d()<<") ";
|
||||
printdegree(nod.Movability());
|
||||
S<<" (edgeconex";
|
||||
BRepMesh_ListOfInteger::Iterator tati(struc->LinkNeighboursOf(in));
|
||||
for (; tati.More(); tati.Next()) S<<" "<<tati.Value();
|
||||
S << "))\n";
|
||||
}
|
||||
S <<endl;
|
||||
for (il=1; il<=nbl; il++) {
|
||||
BRepMesh_Edge edg=struc->GetLink(il);
|
||||
S << "(edge "<<il<<" ("<<edg.FirstNode()<<" "<<edg.LastNode()
|
||||
<<" ";
|
||||
printdegree(edg.Movability());
|
||||
S<<") (triconex";
|
||||
const MeshDS_PairOfIndex& pair = struc->ElemConnectedTo(il);
|
||||
for (Standard_Integer j = 1, jn = pair.Extent(); j <= jn; j++)
|
||||
S<<" "<<pair.Index(j);
|
||||
S << "))\n";
|
||||
BRepMesh_Edge edg=struc->GetLink(il);
|
||||
S << "(edge "<<il<<" ("<<edg.FirstNode()<<" "<<edg.LastNode()
|
||||
<<" ";
|
||||
printdegree(edg.Movability());
|
||||
S<<") (triconex";
|
||||
const BRepMesh_PairOfIndex& pair = struc->ElemConnectedTo(il);
|
||||
for (Standard_Integer j = 1, jn = pair.Extent(); j <= jn; j++)
|
||||
S<<" "<<pair.Index(j);
|
||||
S << "))\n";
|
||||
}
|
||||
S <<endl;
|
||||
for (ie=1; ie<=nbe; ie++) {
|
||||
BRepMesh_Triangle tri=struc->GetElement(ie);
|
||||
tri.Edges(e1, e2, e3, o1, o2, o3);
|
||||
if (!o1) e1=-e1;
|
||||
if (!o2) e2=-e2;
|
||||
if (!o3) e3=-e3;
|
||||
S<<" (maille "<<ie<<" (links "<<e1<<" "
|
||||
<<e2<<" "<<e3<<")";
|
||||
printdegree(tri.Movability());
|
||||
S<<")\n";
|
||||
BRepMesh_Triangle tri=struc->GetElement(ie);
|
||||
tri.Edges(e1, e2, e3, o1, o2, o3);
|
||||
if (!o1) e1=-e1;
|
||||
if (!o2) e2=-e2;
|
||||
if (!o3) e3=-e3;
|
||||
S<<" (maille "<<ie<<" (links "<<e1<<" "
|
||||
<<e2<<" "<<e3<<")";
|
||||
printdegree(tri.Movability());
|
||||
S<<")\n";
|
||||
}
|
||||
S << endl;
|
||||
*/
|
||||
|
@ -1,4 +1,2 @@
|
||||
MeshDS
|
||||
BRepMesh
|
||||
MeshAlgo
|
||||
IntPoly
|
||||
|
Loading…
x
Reference in New Issue
Block a user