mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
OCC22138 Remove *.gxx files from Mesh algorithm Removing MeshAlgo and MeshDS packages
This commit is contained in:
parent
703a6abd43
commit
d772319aab
@ -1,2 +0,0 @@
|
|||||||
MeshAlgo_CellFilter.hxx
|
|
||||||
MeshAlgo_CircleInspector.hxx
|
|
@ -1,54 +0,0 @@
|
|||||||
-- File: MeshAlgo.cdl
|
|
||||||
-- Created: Tue May 11 16:03:43 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@nonox>
|
|
||||||
---Copyright: Matra Datavision 1993, 1994
|
|
||||||
|
|
||||||
|
|
||||||
package MeshAlgo
|
|
||||||
|
|
||||||
---Purpose: Manages different algorithms for triangulation.
|
|
||||||
-- (like Delaunay)
|
|
||||||
|
|
||||||
|
|
||||||
---Level : Advanced.
|
|
||||||
-- All methods of all classes will be advanced.
|
|
||||||
|
|
||||||
|
|
||||||
uses Standard,
|
|
||||||
gp,
|
|
||||||
TCollection,
|
|
||||||
SortTools,
|
|
||||||
TColStd,
|
|
||||||
Bnd,
|
|
||||||
MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
is
|
|
||||||
imported CellFilter from MeshAlgo;
|
|
||||||
|
|
||||||
imported CircleInspector from MeshAlgo;
|
|
||||||
|
|
||||||
deferred class Vertex from MeshAlgo; -- signature
|
|
||||||
|
|
||||||
deferred class Edge from MeshAlgo; -- signature
|
|
||||||
|
|
||||||
deferred class Triangle from MeshAlgo; -- signature
|
|
||||||
|
|
||||||
class Circ from MeshAlgo;
|
|
||||||
|
|
||||||
class CircleTool from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
generic class PntComparator from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
generic class IndexedPntComparator from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
generic class Delaunay from MeshAlgo, DataStructure,
|
|
||||||
ComparatorOfVertex, ComparatorOfIndexedVertex,
|
|
||||||
Array1OfVertex, HArray1OfVertex,
|
|
||||||
HeapSortVertex, HeapSortIndexedVertex;
|
|
||||||
|
|
||||||
end MeshAlgo;
|
|
@ -1,12 +0,0 @@
|
|||||||
// File: MeshAlgo_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 <MeshAlgo_CircleInspector.hxx>
|
|
||||||
|
|
||||||
typedef NCollection_CellFilter<MeshAlgo_CircleInspector> MeshAlgo_CellFilter;
|
|
@ -1,45 +0,0 @@
|
|||||||
-- File: MeshAlgo_Circ.cdl
|
|
||||||
-- Created: Mon Aug 9 16:31:05 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@zerox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
class Circ from MeshAlgo
|
|
||||||
|
|
||||||
---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 MeshAlgo;
|
|
||||||
|
|
||||||
Create (loc : XY from gp; rad : Real from Standard)
|
|
||||||
returns Circ from MeshAlgo;
|
|
||||||
|
|
||||||
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;
|
|
@ -1,23 +0,0 @@
|
|||||||
// File: MeshAlgo_Circ.cxx
|
|
||||||
// Created: Mon Aug 9 17:48:36 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
#include <MeshAlgo_Circ.ixx>
|
|
||||||
|
|
||||||
MeshAlgo_Circ::MeshAlgo_Circ()
|
|
||||||
{}
|
|
||||||
|
|
||||||
MeshAlgo_Circ::MeshAlgo_Circ(const gp_XY& loc, const Standard_Real rad)
|
|
||||||
: location(loc), radius(rad)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void MeshAlgo_Circ::SetLocation(const gp_XY& loc)
|
|
||||||
{
|
|
||||||
location=loc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MeshAlgo_Circ::SetRadius(const Standard_Real rad)
|
|
||||||
{
|
|
||||||
radius=rad;
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
// File: MeshAlgo_Circ.lxx
|
|
||||||
// Created: Mon Aug 9 17:46:36 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
inline const gp_XY& MeshAlgo_Circ::Location() const
|
|
||||||
{ return location;}
|
|
||||||
|
|
||||||
inline const Standard_Real& MeshAlgo_Circ::Radius() const
|
|
||||||
{ return radius;}
|
|
@ -1,84 +0,0 @@
|
|||||||
// File: MeshAlgo_CircleInspector.hxx
|
|
||||||
// Created: May 26 16:40:53 2008
|
|
||||||
// Author: Ekaterina SMIRNOVA
|
|
||||||
// Copyright: Open CASCADE SAS 2008
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MeshAlgo_CircleInspector_Header
|
|
||||||
#define MeshAlgo_CircleInspector_Header
|
|
||||||
|
|
||||||
#include <MeshAlgo_Circ.hxx>
|
|
||||||
|
|
||||||
#include <MeshDS_ListOfInteger.hxx>
|
|
||||||
#include <Precision.hxx>
|
|
||||||
#include <gp_XY.hxx>
|
|
||||||
#include <gp_XYZ.hxx>
|
|
||||||
|
|
||||||
#include <NCollection_CellFilter.hxx>
|
|
||||||
#include <NCollection_Vector.hxx>
|
|
||||||
|
|
||||||
typedef NCollection_Vector<MeshAlgo_Circ> CircVector;
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//! The class to find in the coincidence points
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
class MeshAlgo_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.
|
|
||||||
MeshAlgo_CircleInspector (Standard_Real theTol,
|
|
||||||
Standard_Integer nbComp,
|
|
||||||
const MeshDS_BaseAllocator& theAlloc);
|
|
||||||
|
|
||||||
void Add(Standard_Integer theInd,const MeshAlgo_Circ& theCircle)
|
|
||||||
{
|
|
||||||
myInitCircle.SetValue(theInd, theCircle);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClerResList()
|
|
||||||
{
|
|
||||||
myResInd.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
CircVector& MapOfCirc()
|
|
||||||
{
|
|
||||||
return myInitCircle;
|
|
||||||
}
|
|
||||||
|
|
||||||
MeshAlgo_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
|
|
||||||
MeshDS_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;
|
|
||||||
MeshDS_ListOfInteger myResInd;
|
|
||||||
CircVector myInitCircle;
|
|
||||||
gp_XY myCurrent;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,93 +0,0 @@
|
|||||||
-- File: MeshAlgo_CircleTool.cdl
|
|
||||||
-- Created: Wed May 12 09:30:49 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@zerox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
class CircleTool from MeshAlgo
|
|
||||||
|
|
||||||
---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 MeshDS,
|
|
||||||
CellFilter from MeshAlgo,
|
|
||||||
CircleInspector from MeshAlgo,
|
|
||||||
BaseAllocator from MeshDS
|
|
||||||
|
|
||||||
is Create (theAlloc : in BaseAllocator from MeshDS)
|
|
||||||
returns CircleTool from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
Create (numberOfComponents : in Integer from Standard;
|
|
||||||
theAlloc : in BaseAllocator from MeshDS)
|
|
||||||
---Purpose: Constructs a CircleTool with the maximal dimension
|
|
||||||
-- of the occuped space and an evaluation of the
|
|
||||||
-- number of circles.
|
|
||||||
returns CircleTool from MeshAlgo;
|
|
||||||
|
|
||||||
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 MeshDS is static;
|
|
||||||
|
|
||||||
fields Tolerance : Real from Standard;
|
|
||||||
Allocator : BaseAllocator from MeshDS;
|
|
||||||
CellFilter : CellFilter from MeshAlgo;
|
|
||||||
Selector : CircleInspector from MeshAlgo;
|
|
||||||
FaceMax : XY from gp;
|
|
||||||
FaceMin : XY from gp;
|
|
||||||
|
|
||||||
end CircleTool;
|
|
@ -1,268 +0,0 @@
|
|||||||
// File: MeshAlgo_CircleTool.cxx
|
|
||||||
// Created: Tue Jun 15 19:10:25 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
#include <MeshAlgo_CircleTool.ixx>
|
|
||||||
#include <gp_XY.hxx>
|
|
||||||
#include <Precision.hxx>
|
|
||||||
#include <MeshAlgo_Circ.hxx>
|
|
||||||
#include <MeshAlgo_CircleInspector.hxx>
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MeshAlgo_CircleInspector
|
|
||||||
//purpose : Constructor
|
|
||||||
//
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
MeshAlgo_CircleInspector::MeshAlgo_CircleInspector (Standard_Real theTol,
|
|
||||||
Standard_Integer nbComp,
|
|
||||||
const MeshDS_BaseAllocator& theAlloc)
|
|
||||||
: myTol(theTol*theTol),
|
|
||||||
myResInd(theAlloc),
|
|
||||||
myInitCircle(nbComp)
|
|
||||||
{
|
|
||||||
// myTol = theTol*theTol;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Inspect
|
|
||||||
//purpose :
|
|
||||||
//
|
|
||||||
//=======================================================================
|
|
||||||
NCollection_CellFilter_Action MeshAlgo_CircleInspector::Inspect (const Standard_Integer theTarget)
|
|
||||||
{
|
|
||||||
const MeshAlgo_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 : MeshAlgo_CircleTool
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
MeshAlgo_CircleTool::MeshAlgo_CircleTool(const MeshDS_BaseAllocator& theAlloc)
|
|
||||||
: Tolerance(Precision::PConfusion()),
|
|
||||||
Allocator(theAlloc),
|
|
||||||
CellFilter(10, theAlloc),
|
|
||||||
Selector(Tolerance,64,theAlloc)
|
|
||||||
{
|
|
||||||
Tolerance=Tolerance*Tolerance;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MeshAlgo_CircleTool
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
MeshAlgo_CircleTool::MeshAlgo_CircleTool(const Standard_Integer nbComp,
|
|
||||||
const MeshDS_BaseAllocator& theAlloc)
|
|
||||||
: Tolerance(Precision::PConfusion()),
|
|
||||||
Allocator(theAlloc),
|
|
||||||
CellFilter(10, theAlloc),
|
|
||||||
Selector(Tolerance,Max(nbComp,64),theAlloc)
|
|
||||||
{
|
|
||||||
Tolerance=Tolerance*Tolerance;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Initialize
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshAlgo_CircleTool::Initialize(const Standard_Integer /*nbComp*/)
|
|
||||||
{
|
|
||||||
Tolerance=Precision::PConfusion();
|
|
||||||
Tolerance=Tolerance*Tolerance;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MeshAlgo_CircleTool::SetCellSize(const Standard_Real theSize)
|
|
||||||
{
|
|
||||||
CellFilter.Reset(theSize, Allocator);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MeshAlgo_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 MeshAlgo_CircleTool::SetMinMaxSize(const gp_XY& theMin,
|
|
||||||
const gp_XY& theMax)
|
|
||||||
{
|
|
||||||
FaceMin = theMin;
|
|
||||||
FaceMax = theMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Add
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshAlgo_CircleTool::Add(const gp_Circ2d& theCirc,
|
|
||||||
const Standard_Integer theIndex)
|
|
||||||
{
|
|
||||||
gp_XY aCoord(theCirc.Location().Coord());
|
|
||||||
Standard_Real R = theCirc.Radius();
|
|
||||||
MeshAlgo_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 MeshAlgo_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);
|
|
||||||
MeshAlgo_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 MeshAlgo_CircleTool::Delete(const Standard_Integer theIndex)
|
|
||||||
{
|
|
||||||
MeshAlgo_Circ& Circ = Selector.GetCirc(theIndex);
|
|
||||||
if(Circ.Radius() > 0.) {
|
|
||||||
Circ.SetRadius(-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Select
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
MeshDS_ListOfInteger& MeshAlgo_CircleTool::Select(const gp_XY& thePnt)
|
|
||||||
{
|
|
||||||
Selector.ClerResList();
|
|
||||||
Selector.SetCurrent(thePnt);
|
|
||||||
CellFilter.Inspect (thePnt, Selector);
|
|
||||||
return Selector.GetCoincidentInd();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MeshAlgo_CircleTool::MocAdd(const Standard_Integer theIndex)
|
|
||||||
{
|
|
||||||
gp_XY nullPnt(0.,0.);
|
|
||||||
MeshAlgo_Circ theNullCir(nullPnt, -1.);
|
|
||||||
Selector.Add(theIndex, theNullCir);
|
|
||||||
}
|
|
@ -1,241 +0,0 @@
|
|||||||
-- File: MeshAlgo_Delaunay.cdl
|
|
||||||
-- Created: Tue May 11 17:19:19 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@nonox>
|
|
||||||
---Copyright: Matra Datavision 1993, 1994
|
|
||||||
|
|
||||||
|
|
||||||
generic class Delaunay from MeshAlgo (Vertex as any;
|
|
||||||
Edge as any;
|
|
||||||
Triangle as any)
|
|
||||||
|
|
||||||
---Purpose: Compute the Delaunay's triangulation with the
|
|
||||||
-- algorithm of Watson.
|
|
||||||
|
|
||||||
|
|
||||||
uses Integer from Standard,
|
|
||||||
SequenceOfInteger from TColStd,
|
|
||||||
Array1OfInteger from TColStd,
|
|
||||||
XY from gp,
|
|
||||||
Box2d from Bnd,
|
|
||||||
CircleTool from MeshAlgo,
|
|
||||||
MapOfInteger from MeshDS,
|
|
||||||
MapOfIntegerInteger from MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
class DataStructure instantiates Mesh2d from MeshDS
|
|
||||||
(Vertex, Edge, Triangle);
|
|
||||||
|
|
||||||
class ComparatorOfVertex instantiates PntComparator(Vertex,XY from gp);
|
|
||||||
|
|
||||||
class ComparatorOfIndexedVertex instantiates IndexedPntComparator
|
|
||||||
(DataStructure from MeshAlgo, XY from gp);
|
|
||||||
|
|
||||||
class Array1OfVertex instantiates Array1 from TCollection(Vertex);
|
|
||||||
|
|
||||||
class HArray1OfVertex instantiates HArray1 from TCollection
|
|
||||||
(Vertex, Array1OfVertex);
|
|
||||||
|
|
||||||
class HeapSortVertex instantiates HeapSort from SortTools
|
|
||||||
(Vertex, Array1OfVertex, ComparatorOfVertex);
|
|
||||||
|
|
||||||
class HeapSortIndexedVertex instantiates HeapSort from SortTools
|
|
||||||
(Integer, Array1OfInteger from TColStd, ComparatorOfIndexedVertex);
|
|
||||||
|
|
||||||
|
|
||||||
is
|
|
||||||
|
|
||||||
-- Interface :
|
|
||||||
|
|
||||||
Create (Vertices : in out Array1OfVertex from MeshAlgo;
|
|
||||||
ZPositive : in Boolean from Standard=Standard_True)
|
|
||||||
---Purpose: Creates the triangulation with an empty Mesh
|
|
||||||
-- data structure.
|
|
||||||
returns Delaunay from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
Create (OldMesh : mutable DataStructure from MeshAlgo;
|
|
||||||
Vertices : in out Array1OfVertex from MeshAlgo;
|
|
||||||
ZPositive : in Boolean from Standard=Standard_True)
|
|
||||||
---Purpose: Creates the triangulation with and existant
|
|
||||||
-- Mesh data structure.
|
|
||||||
returns Delaunay from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
Create (OldMesh : mutable DataStructure from MeshAlgo;
|
|
||||||
VertexIndices : in out Array1OfInteger from TColStd;
|
|
||||||
ZPositive : in Boolean from Standard=Standard_True)
|
|
||||||
---Purpose: Creates the triangulation with and existant
|
|
||||||
-- Mesh data structure.
|
|
||||||
returns Delaunay from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
AddVertex (me : in out;
|
|
||||||
theVertex : in Vertex);
|
|
||||||
---Purpose: Adds a new vertex in the triangulation.
|
|
||||||
|
|
||||||
|
|
||||||
RemoveVertex (me : in out;
|
|
||||||
theVertex : in Vertex);
|
|
||||||
---Purpose: Removes a vertex in the triangulation.
|
|
||||||
|
|
||||||
|
|
||||||
AddVertices (me : in out;
|
|
||||||
Vertices : in out Array1OfVertex from MeshAlgo);
|
|
||||||
---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 DataStructure from MeshAlgo;
|
|
||||||
|
|
||||||
|
|
||||||
Frontier (me : in out)
|
|
||||||
---Purpose: Gives the list of frontier edges
|
|
||||||
---C++: return const &
|
|
||||||
returns MapOfInteger from MeshDS;
|
|
||||||
|
|
||||||
|
|
||||||
InternalEdges (me : in out)
|
|
||||||
---Purpose: Gives the list of internal edges
|
|
||||||
---C++: return const &
|
|
||||||
returns MapOfInteger from MeshDS;
|
|
||||||
|
|
||||||
|
|
||||||
FreeEdges (me : in out)
|
|
||||||
---Purpose: Gives the list of free edges used only one time
|
|
||||||
---C++: return const &
|
|
||||||
returns MapOfInteger from MeshDS;
|
|
||||||
|
|
||||||
|
|
||||||
GetVertex (me;
|
|
||||||
vIndex : in Integer from Standard)
|
|
||||||
---C++: return const &
|
|
||||||
---C++: inline
|
|
||||||
returns Vertex;
|
|
||||||
|
|
||||||
|
|
||||||
GetEdge (me;
|
|
||||||
eIndex : in Integer from Standard)
|
|
||||||
---C++: return const &
|
|
||||||
---C++: inline
|
|
||||||
returns Edge;
|
|
||||||
|
|
||||||
|
|
||||||
GetTriangle (me;
|
|
||||||
tIndex : in Integer from Standard)
|
|
||||||
---C++: return const &
|
|
||||||
---C++: inline
|
|
||||||
returns Triangle;
|
|
||||||
|
|
||||||
|
|
||||||
-- Implementation :
|
|
||||||
|
|
||||||
Init (me : in out;
|
|
||||||
Vertices : in out Array1OfVertex from MeshAlgo);
|
|
||||||
---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;
|
|
||||||
freeEdges: out MapOfIntegerInteger from MeshDS)
|
|
||||||
---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 MeshDS)
|
|
||||||
---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;
|
|
||||||
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)
|
|
||||||
---Purpose: Gives the index of triangle containing
|
|
||||||
-- geometricaly <theVertex>.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
fields MeshData : DataStructure from MeshAlgo;
|
|
||||||
PositiveOrientation : Boolean from Standard;
|
|
||||||
tCircles : CircleTool from MeshAlgo;
|
|
||||||
supVert1 : Integer from Standard;
|
|
||||||
supVert2 : Integer from Standard;
|
|
||||||
supVert3 : Integer from Standard;
|
|
||||||
supTrian : Triangle;
|
|
||||||
mapEdges : MapOfInteger from MeshDS;
|
|
||||||
|
|
||||||
|
|
||||||
end Delaunay;
|
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +0,0 @@
|
|||||||
// File: MeshAlgo_Delaunay.lxx
|
|
||||||
// Created: Thu Aug 19 10:52:01 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
|
|
||||||
#include MeshAlgo_DataStructure_hxx
|
|
||||||
|
|
||||||
inline const Vertex& MeshAlgo_Delaunay::GetVertex
|
|
||||||
(const Standard_Integer vIndex) const
|
|
||||||
{
|
|
||||||
return MeshData->GetNode(vIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Edge& MeshAlgo_Delaunay::GetEdge
|
|
||||||
(const Standard_Integer eIndex) const
|
|
||||||
{
|
|
||||||
return MeshData->GetLink(eIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Triangle& MeshAlgo_Delaunay::GetTriangle
|
|
||||||
(const Standard_Integer tIndex) const
|
|
||||||
{
|
|
||||||
return MeshData->GetElement(tIndex);
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
-- File: MeshAlgo_Edge.cdl
|
|
||||||
-- Created: Tue May 11 16:38:19 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@nonox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
-- signature
|
|
||||||
deferred class Edge from MeshAlgo
|
|
||||||
|
|
||||||
---Purpose: Describes the data structure of a Edge.
|
|
||||||
|
|
||||||
|
|
||||||
uses Integer from Standard,
|
|
||||||
Boolean from Standard,
|
|
||||||
DegreeOfFreedom from MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
is Initialize (node1, node2 : Integer from Standard;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
---Purpose: Contructs an Edge beetween to vertices.
|
|
||||||
|
|
||||||
|
|
||||||
FirstNode (me)
|
|
||||||
---Purpose: Give the index of first node of the Edge.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
LastNode (me)
|
|
||||||
---Purpose: Give the index of Last node of the Edge.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
Movability (me)
|
|
||||||
returns DegreeOfFreedom from MeshDS;
|
|
||||||
|
|
||||||
SetMovability (me : in out;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
SameOrientation(me; Other : Edge from MeshAlgo)
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
---Purpose: For maping the Edges.
|
|
||||||
-- Same Edge -> Same HashCode
|
|
||||||
-- Different Edges -> Not IsEqual but can have same HashCode
|
|
||||||
|
|
||||||
HashCode (me;
|
|
||||||
Upper : Integer from Standard)
|
|
||||||
---C++: function call
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
IsEqual (me; Other: Edge from MeshAlgo)
|
|
||||||
---C++: alias operator ==
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
end Edge;
|
|
@ -1,6 +0,0 @@
|
|||||||
// File: MeshAlgo_Edge.cxx
|
|
||||||
// Created: Fri Jul 2 11:33:41 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
#include <MeshAlgo_Edge.ixx>
|
|
@ -1,40 +0,0 @@
|
|||||||
-- File: MeshAlgo_IndexedPntComparator.cdl
|
|
||||||
-- Created: Tue Apr 5 11:45:18 1994
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@zerox>
|
|
||||||
---Copyright: Matra Datavision 1994
|
|
||||||
|
|
||||||
|
|
||||||
generic class IndexedPntComparator from MeshAlgo
|
|
||||||
(HandledStructureOfPnt as any; Direction as any)
|
|
||||||
|
|
||||||
---Purpose: Sort two point in a given direction.
|
|
||||||
|
|
||||||
|
|
||||||
uses Boolean from Standard
|
|
||||||
|
|
||||||
|
|
||||||
is Create (theDir : Direction;
|
|
||||||
TheTol : Real from Standard;
|
|
||||||
HDS : HandledStructureOfPnt)
|
|
||||||
returns IndexedPntComparator;
|
|
||||||
|
|
||||||
|
|
||||||
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 : HandledStructureOfPnt;
|
|
||||||
DirectionOfSort : Direction;
|
|
||||||
Tolerance : Real from Standard;
|
|
||||||
|
|
||||||
end IndexedPntComparator;
|
|
@ -1,56 +0,0 @@
|
|||||||
// File: MeshAlgo_IndexedPntComparator.gxx
|
|
||||||
// Created: Tue Apr 5 11:50:40 1994
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MeshAlgo_IndexedPntComparator
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
#include <BRepMesh_Vertex.hxx>
|
|
||||||
|
|
||||||
|
|
||||||
MeshAlgo_IndexedPntComparator::MeshAlgo_IndexedPntComparator
|
|
||||||
(const Direction& theDir,
|
|
||||||
const Standard_Real theTol,
|
|
||||||
const HandledStructureOfPnt& HDS)
|
|
||||||
: IndexedStructure(HDS),DirectionOfSort(theDir), Tolerance(theTol)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsLower
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
Standard_Boolean MeshAlgo_IndexedPntComparator::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 MeshAlgo_IndexedPntComparator::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 MeshAlgo_IndexedPntComparator::IsEqual
|
|
||||||
(const Standard_Integer Left, const Standard_Integer Right) const
|
|
||||||
{
|
|
||||||
return (IndexedStructure->GetNode(Left).Coord().IsEqual
|
|
||||||
(IndexedStructure->GetNode(Right).Coord(), Tolerance));
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
-- File: MeshAlgo_PntComparator.cdl
|
|
||||||
-- Created: Fri Jun 18 13:46:14 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@zerox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
generic class PntComparator from MeshAlgo (Point as any; Direction as any)
|
|
||||||
|
|
||||||
---Purpose: Sort two point in a given direction.
|
|
||||||
|
|
||||||
|
|
||||||
uses Boolean from Standard
|
|
||||||
|
|
||||||
|
|
||||||
is Create (theDir : Direction; TheTol: Real from Standard)
|
|
||||||
returns PntComparator;
|
|
||||||
|
|
||||||
|
|
||||||
IsLower (me; Left, Right: Point)
|
|
||||||
---Purpose: returns True if <Left> is lower than <Right>
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
IsGreater (me; Left, Right: Point)
|
|
||||||
---Purpose: returns True if <Left> is greater than <Right>
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
IsEqual(me; Left, Right: Point)
|
|
||||||
---Purpose: returns True when <Right> and <Left> are equal.
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
fields DirectionOfSort : Direction;
|
|
||||||
Tolerance : Real from Standard;
|
|
||||||
|
|
||||||
end PntComparator;
|
|
@ -1,50 +0,0 @@
|
|||||||
// File: MeshAlgo_PntComparator.gxx
|
|
||||||
// Created: Fri Jun 18 17:04:44 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MeshAlgo_PntComparator
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
MeshAlgo_PntComparator::MeshAlgo_PntComparator(const Direction& theDir,
|
|
||||||
const Standard_Real theTol)
|
|
||||||
: DirectionOfSort(theDir), Tolerance(theTol)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsLower
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
Standard_Boolean MeshAlgo_PntComparator::IsLower(const Point& Left,
|
|
||||||
const Point& Right) const
|
|
||||||
{
|
|
||||||
return (Left.Coord()*DirectionOfSort) <
|
|
||||||
(Right.Coord()*DirectionOfSort);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsGreater
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
Standard_Boolean MeshAlgo_PntComparator::IsGreater(const Point& Left,
|
|
||||||
const Point& Right) const
|
|
||||||
{
|
|
||||||
return (Left.Coord()*DirectionOfSort) >
|
|
||||||
(Right.Coord()*DirectionOfSort);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsEqual
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
Standard_Boolean MeshAlgo_PntComparator::IsEqual(const Point& Left,
|
|
||||||
const Point& Right) const
|
|
||||||
{
|
|
||||||
return Left.IsEqual(Right);
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
-- File: MeshAlgo_Triangle.cdl
|
|
||||||
-- Created: Tue May 11 16:43:27 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@nonox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
-- signature
|
|
||||||
deferred class Triangle from MeshAlgo
|
|
||||||
|
|
||||||
---Purpose: Describes the data structure of a Triangle for
|
|
||||||
-- Deleaunay triangulation.
|
|
||||||
|
|
||||||
|
|
||||||
uses Boolean from Standard,
|
|
||||||
Integer from Standard,
|
|
||||||
ListOfInteger from TColStd,
|
|
||||||
DegreeOfFreedom from MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
is Initialize (e1, e2, e3 : Integer from Standard;
|
|
||||||
o1, o2, o3 : Boolean from Standard;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
|
|
||||||
Edges (me;
|
|
||||||
e1, e2, e3 : out Integer from Standard;
|
|
||||||
o1, o2, o3 : out Boolean from Standard);
|
|
||||||
|
|
||||||
|
|
||||||
Movability (me)
|
|
||||||
returns DegreeOfFreedom from MeshDS;
|
|
||||||
|
|
||||||
|
|
||||||
SetMovability (me : in out;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
|
|
||||||
---Purpose: For maping the Triangles.
|
|
||||||
-- Same Triangle -> Same HashCode
|
|
||||||
-- Different Triangles -> Not IsEqual but can have same HashCode
|
|
||||||
|
|
||||||
HashCode (me;
|
|
||||||
Upper : Integer from Standard)
|
|
||||||
---C++: function call
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
IsEqual (me; Other : Triangle from MeshAlgo)
|
|
||||||
---C++: alias operator ==
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
end Triangle;
|
|
@ -1,6 +0,0 @@
|
|||||||
// File: MeshAlgo_Triangle.cxx
|
|
||||||
// Created: Fri Jul 2 11:33:22 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
#include <MeshAlgo_Triangle.ixx>
|
|
@ -1,48 +0,0 @@
|
|||||||
-- File: MeshAlgo_Vertex.cdl
|
|
||||||
-- Created: Tue May 11 16:17:57 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@nonox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
-- signature
|
|
||||||
deferred class Vertex from MeshAlgo
|
|
||||||
|
|
||||||
---Purpose: Describes the data structure for a vertex in a
|
|
||||||
-- Delaunay triangulation.
|
|
||||||
|
|
||||||
uses Boolean from Standard,
|
|
||||||
Integer from Standard,
|
|
||||||
Real from Standard,
|
|
||||||
XY from gp,
|
|
||||||
DegreeOfFreedom from MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
is Initialize (x, y : Real from Standard;
|
|
||||||
theMov : DegreeOfFreedom from MeshDS) ;
|
|
||||||
|
|
||||||
Coord (me)
|
|
||||||
---C++: return const &
|
|
||||||
returns XY from gp;
|
|
||||||
|
|
||||||
Movability (me)
|
|
||||||
returns DegreeOfFreedom from MeshDS;
|
|
||||||
|
|
||||||
SetMovability (me : in out; mov : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
|
|
||||||
---Purpose: For maping the Vertices.
|
|
||||||
-- Same Vertex -> Same HashCode
|
|
||||||
-- Different Vertices -> Not IsEqual but can have same HashCode
|
|
||||||
|
|
||||||
HashCode (me;
|
|
||||||
Upper : Integer from Standard)
|
|
||||||
---C++: function call
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
IsEqual (me; Other : Vertex from MeshAlgo)
|
|
||||||
---C++: alias operator ==
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
end Vertex;
|
|
@ -1,6 +0,0 @@
|
|||||||
// File: MeshAlgo_Vertex.cxx
|
|
||||||
// Created: Fri Jul 2 11:32:53 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
#include <MeshAlgo_Vertex.ixx>
|
|
@ -1,5 +0,0 @@
|
|||||||
MeshDS_MapOfIntegerInteger.hxx
|
|
||||||
MeshDS_MapOfInteger.hxx
|
|
||||||
MeshDS_ListOfInteger.hxx
|
|
||||||
MeshDS_BaseAllocator.hxx
|
|
||||||
MeshDS_PairOfIndex.hxx
|
|
@ -1,53 +0,0 @@
|
|||||||
-- File: MeshDS.cdl
|
|
||||||
-- Created: Mon Mar 15 17:47:36 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@phylox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
package MeshDS
|
|
||||||
|
|
||||||
---Purpose: This package describes the common data structure for
|
|
||||||
-- the differents MESH algorithms.
|
|
||||||
-- Level : Advanced.
|
|
||||||
-- All methods of all classes will be advanced.
|
|
||||||
|
|
||||||
uses Standard,
|
|
||||||
MMgt,
|
|
||||||
TCollection,
|
|
||||||
gp,
|
|
||||||
Bnd
|
|
||||||
|
|
||||||
|
|
||||||
is enumeration DegreeOfFreedom is
|
|
||||||
Free,
|
|
||||||
InVolume,
|
|
||||||
OnSurface,
|
|
||||||
OnCurve,
|
|
||||||
Fixed,
|
|
||||||
Frontier,
|
|
||||||
Deleted;
|
|
||||||
|
|
||||||
imported DataMapOfInteger from MeshDS;
|
|
||||||
imported MapOfIntegerInteger from MeshDS;
|
|
||||||
imported MapOfInteger from MeshDS;
|
|
||||||
imported ListOfInteger from MeshDS;
|
|
||||||
imported BaseAllocator from MeshDS;
|
|
||||||
imported PairOfIndex from MeshDS;
|
|
||||||
|
|
||||||
deferred generic class Node; -- Signature
|
|
||||||
|
|
||||||
deferred generic class Link; -- Signature
|
|
||||||
|
|
||||||
deferred generic class Element2d; -- Signature
|
|
||||||
|
|
||||||
generic class Mesh2d, NodeHasher,
|
|
||||||
LinkHasher,
|
|
||||||
ElemHasher,
|
|
||||||
IDMapOfNode,
|
|
||||||
IDMapOfLink,
|
|
||||||
IMapOfElement,
|
|
||||||
Selector;
|
|
||||||
|
|
||||||
|
|
||||||
end MeshDS;
|
|
@ -1,3 +0,0 @@
|
|||||||
#include <NCollection_IncAllocator.hxx>
|
|
||||||
|
|
||||||
typedef Handle_NCollection_IncAllocator MeshDS_BaseAllocator;
|
|
@ -1,49 +0,0 @@
|
|||||||
-- File: MeshDS_Element2d.cdl
|
|
||||||
-- Created: Tue Mar 16 15:28:35 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@phylox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
deferred generic class Element2d from MeshDS (dummyarg as any)
|
|
||||||
|
|
||||||
---Purpose: Describes the necessary services of an Element2d
|
|
||||||
-- for a mesh data structure.
|
|
||||||
|
|
||||||
|
|
||||||
uses Integer from Standard,
|
|
||||||
Boolean from Standard,
|
|
||||||
DegreeOfFreedom from MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
is Edges (me; e1, e2, e3 : out Integer from Standard;
|
|
||||||
o1, o2, o3 : out Boolean from Standard);
|
|
||||||
---Purpose: Gives the indices of the edges and the
|
|
||||||
-- orientation of each one.
|
|
||||||
|
|
||||||
|
|
||||||
Movability (me)
|
|
||||||
returns DegreeOfFreedom from MeshDS;
|
|
||||||
---Purpose: The movability of the triangle.
|
|
||||||
|
|
||||||
|
|
||||||
SetMovability (me : in out;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
|
|
||||||
---Purpose: For maping the Elements.
|
|
||||||
-- Same Element -> Same HashCode
|
|
||||||
-- Different Elements -> Not IsEqual but can have same HashCode
|
|
||||||
|
|
||||||
HashCode (me;
|
|
||||||
Upper : Integer from Standard)
|
|
||||||
---C++: function call
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
IsEqual (me; Other: Element2d from MeshDS)
|
|
||||||
---C++: alias operator ==
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
end Element2d;
|
|
@ -1,56 +0,0 @@
|
|||||||
-- File: MeshDS_Link.cdl
|
|
||||||
-- Created: Thu Apr 29 11:23:38 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@phylox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
deferred generic class Link from MeshDS (dummyarg as any)
|
|
||||||
|
|
||||||
---Purpose: Describes the necessary services of a Link for a
|
|
||||||
-- mesh data structure.
|
|
||||||
|
|
||||||
|
|
||||||
uses Integer from Standard,
|
|
||||||
Boolean from Standard,
|
|
||||||
DegreeOfFreedom from MeshDS
|
|
||||||
|
|
||||||
|
|
||||||
is Initialize (node1, node2 : Integer from Standard;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
---Purpose: Contructs a Link beetween to vertices.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FirstNode (me)
|
|
||||||
---Purpose: Give the index of first node of the Link.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
LastNode (me)
|
|
||||||
---Purpose: Give the index of Last node of the Link.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
Movability (me)
|
|
||||||
returns DegreeOfFreedom from MeshDS;
|
|
||||||
|
|
||||||
SetMovability (me : in out;
|
|
||||||
canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
SameOrientation(me; Other : Link from MeshDS)
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
---Purpose: For maping the Links.
|
|
||||||
-- Same Link -> Same HashCode
|
|
||||||
-- Different Links -> Not IsEqual but can have same HashCode
|
|
||||||
|
|
||||||
HashCode (me;
|
|
||||||
Upper : Integer from Standard)
|
|
||||||
---C++: function call
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
IsEqual (me; Other: Link from MeshDS)
|
|
||||||
---C++: alias operator ==
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
end Link;
|
|
@ -1,3 +0,0 @@
|
|||||||
#include <NCollection_List.hxx>
|
|
||||||
|
|
||||||
typedef NCollection_List<Standard_Integer> MeshDS_ListOfInteger;
|
|
@ -1,3 +0,0 @@
|
|||||||
#include <NCollection_Map.hxx>
|
|
||||||
|
|
||||||
typedef NCollection_Map<Standard_Integer> MeshDS_MapOfInteger;
|
|
@ -1,12 +0,0 @@
|
|||||||
// File: MeshDS_MapOfIntegerInteger.hxx
|
|
||||||
// Created: Fri Jan 30 15:15:17 2009
|
|
||||||
// Author: Pavel DURANDIN (pdn)
|
|
||||||
// Copyright: Open CASCADE 2009
|
|
||||||
|
|
||||||
#ifndef MeshDS_MapOfIntegerInteger_HeaderFile
|
|
||||||
#define MeshDS_MapOfIntegerInteger_HeaderFile
|
|
||||||
|
|
||||||
#include <NCollection_DataMap.hxx>
|
|
||||||
typedef NCollection_DataMap<Standard_Integer, Standard_Integer> MeshDS_MapOfIntegerInteger;
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,368 +0,0 @@
|
|||||||
-- File: MeshDS_Mesh2d.cdl
|
|
||||||
-- Created: Wed Mar 17 11:20:52 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@phylox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
generic class Mesh2d from MeshDS
|
|
||||||
(Node as any; -- Signature of Node from MeshDS
|
|
||||||
Link as any; -- Signature of Link from MeshDS
|
|
||||||
Element as any) -- Signature of Element2d from MeshDS
|
|
||||||
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 MeshDS,
|
|
||||||
MapOfInteger from MeshDS,
|
|
||||||
PairOfIndex from MeshDS,
|
|
||||||
Box from Bnd,
|
|
||||||
BoundSortBox from Bnd,
|
|
||||||
BaseAllocator from MeshDS
|
|
||||||
|
|
||||||
class NodeHasher instantiates MapHasher(Node);
|
|
||||||
class LinkHasher instantiates MapHasher(Link);
|
|
||||||
class ElemHasher instantiates MapHasher(Element);
|
|
||||||
|
|
||||||
class IDMapOfNode instantiates IndexedDataMap from TCollection
|
|
||||||
(Node,
|
|
||||||
ListOfInteger from MeshDS,
|
|
||||||
NodeHasher);
|
|
||||||
|
|
||||||
|
|
||||||
class IDMapOfLink instantiates IndexedDataMap from TCollection
|
|
||||||
(Link,
|
|
||||||
PairOfIndex from MeshDS,
|
|
||||||
LinkHasher);
|
|
||||||
|
|
||||||
|
|
||||||
class IMapOfElement instantiates IndexedMap from TCollection
|
|
||||||
(Element,
|
|
||||||
ElemHasher);
|
|
||||||
|
|
||||||
|
|
||||||
class Selector from MeshDS
|
|
||||||
|
|
||||||
---Purpose: Describes a selector and an Iterator on a
|
|
||||||
-- selector of components of a Mesh.
|
|
||||||
|
|
||||||
uses Integer from Standard,
|
|
||||||
Box from Bnd,
|
|
||||||
MapOfInteger from MeshDS
|
|
||||||
|
|
||||||
is Create returns Selector from MeshDS;
|
|
||||||
|
|
||||||
Create (theMesh : Mesh2d from MeshDS)
|
|
||||||
returns Selector from MeshDS;
|
|
||||||
|
|
||||||
Initialize (me : in out;
|
|
||||||
theMesh : Mesh2d from MeshDS)
|
|
||||||
is static;
|
|
||||||
|
|
||||||
|
|
||||||
NeighboursOf(me : in out;
|
|
||||||
theNode : in Node)
|
|
||||||
is static;
|
|
||||||
|
|
||||||
NeighboursOfNode(me : in out;
|
|
||||||
indexNode : in Integer from Standard)
|
|
||||||
is static;
|
|
||||||
|
|
||||||
|
|
||||||
NeighboursOf(me : in out;
|
|
||||||
theLink : in Link)
|
|
||||||
is static;
|
|
||||||
|
|
||||||
NeighboursOfLink(me : in out;
|
|
||||||
indexLink : in Integer from Standard)
|
|
||||||
is static;
|
|
||||||
|
|
||||||
|
|
||||||
NeighboursOf(me : in out;
|
|
||||||
theElem : in Element)
|
|
||||||
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 Element)
|
|
||||||
---Purpose: Neighbours by edge Of the Element.
|
|
||||||
is static;
|
|
||||||
|
|
||||||
|
|
||||||
NeighboursOf(me : in out;
|
|
||||||
theSelector : in Selector from MeshDS)
|
|
||||||
---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 MeshDS is static;
|
|
||||||
|
|
||||||
Links (me)
|
|
||||||
---C++: return const &
|
|
||||||
returns MapOfInteger from MeshDS is static;
|
|
||||||
|
|
||||||
Elements (me)
|
|
||||||
---C++: return const &
|
|
||||||
returns MapOfInteger from MeshDS is static;
|
|
||||||
|
|
||||||
FrontierLinks(me)
|
|
||||||
---Purpose: Gives the list of links incices
|
|
||||||
-- frontier of the selector <me>.
|
|
||||||
---C++: return const &
|
|
||||||
returns MapOfInteger from MeshDS is static;
|
|
||||||
|
|
||||||
|
|
||||||
fields myMesh : Mesh2d from MeshDS;
|
|
||||||
myNodes : MapOfInteger from MeshDS;
|
|
||||||
myLinks : MapOfInteger from MeshDS;
|
|
||||||
myElements : MapOfInteger from MeshDS;
|
|
||||||
myFrontier : MapOfInteger from MeshDS;
|
|
||||||
|
|
||||||
end Selector;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
is Create (theAllocator: BaseAllocator from MeshDS;
|
|
||||||
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 Mesh2d from MeshDS;
|
|
||||||
|
|
||||||
AddNode (me : mutable ;
|
|
||||||
theNode : Node)
|
|
||||||
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 any Node
|
|
||||||
---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 MeshDS
|
|
||||||
---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 : IDMapOfNode from MeshDS)
|
|
||||||
---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 : Node)
|
|
||||||
---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 : Link)
|
|
||||||
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 any Link
|
|
||||||
---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 : Link)
|
|
||||||
---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 : Element)
|
|
||||||
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 any Element
|
|
||||||
---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 : Element)
|
|
||||||
---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 : Node)
|
|
||||||
---Purpose: Finds the index of the node. Returns 0 if the
|
|
||||||
-- node is not in the mesh.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
IndexOf (me;
|
|
||||||
aLink : Link)
|
|
||||||
---Purpose: Finds the index of the Link. Returns 0 if the
|
|
||||||
-- Link is not in the mesh.
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
IndexOf (me;
|
|
||||||
anElement : Element)
|
|
||||||
---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 MeshDS
|
|
||||||
---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 MeshDS
|
|
||||||
---C++: return const &
|
|
||||||
---Purpose: Gives the element's indices conected
|
|
||||||
-- to <theLink>.
|
|
||||||
is static;
|
|
||||||
|
|
||||||
ElemOfDomain (me)
|
|
||||||
returns MapOfInteger from MeshDS
|
|
||||||
---C++: return const &
|
|
||||||
---Purpose: Gives the list of element's indices
|
|
||||||
is static;
|
|
||||||
|
|
||||||
|
|
||||||
LinkOfDomain (me)
|
|
||||||
returns MapOfInteger from MeshDS
|
|
||||||
---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 : Element)
|
|
||||||
---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 MeshDS;
|
|
||||||
---C++: return const&
|
|
||||||
|
|
||||||
|
|
||||||
fields myNodes : IDMapOfNode from MeshDS;
|
|
||||||
myDelNodes : ListOfInteger from MeshDS;
|
|
||||||
myLinks : IDMapOfLink from MeshDS;
|
|
||||||
myDelLinks : ListOfInteger from MeshDS;
|
|
||||||
myElements : IMapOfElement from MeshDS;
|
|
||||||
--myDelElements : ListOfInteger from MeshDS;
|
|
||||||
myElemOfDomain : MapOfInteger from MeshDS;
|
|
||||||
myLinkOfDomain : MapOfInteger from MeshDS;
|
|
||||||
myAllocator : BaseAllocator from MeshDS;
|
|
||||||
end Mesh2d;
|
|
@ -1,686 +0,0 @@
|
|||||||
// File: MeshDS_Mesh2d.gxx
|
|
||||||
// Created: Tue May 11 16:01:57 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@nonox>
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MeshDS_Mesh2d
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
MeshDS_Mesh2d::MeshDS_Mesh2d(const MeshDS_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 MeshDS_Mesh2d::AddNode(const Node& theNode)
|
|
||||||
{
|
|
||||||
Standard_Integer NodeIndex=myNodes.FindIndex(theNode);
|
|
||||||
if (NodeIndex>0 && !myDelNodes.IsEmpty()) {
|
|
||||||
if (myNodes.FindKey(NodeIndex).Movability()==MeshDS_Deleted)
|
|
||||||
NodeIndex=0;
|
|
||||||
}
|
|
||||||
if (NodeIndex<=0) {
|
|
||||||
MeshDS_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 Node& MeshDS_Mesh2d::GetNode(const Standard_Integer Index)
|
|
||||||
{
|
|
||||||
return myNodes.FindKey(Index);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : GetNodeList
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_ListOfInteger& MeshDS_Mesh2d::GetNodeList(const Standard_Integer Index)
|
|
||||||
{
|
|
||||||
return myNodes.FindFromIndex(Index);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : ForceRemoveNode
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::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.
|
|
||||||
Node& vref=(Node&)myNodes.FindKey(Index);
|
|
||||||
if ( myNodes.FindFromIndex(Index).Extent()==0) {
|
|
||||||
vref.SetMovability(MeshDS_Deleted);
|
|
||||||
myDelNodes.Append(Index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : ReplaceNodes
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::ReplaceNodes(const MeshDS_IDMapOfNode& 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 MeshDS_Mesh2d::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.
|
|
||||||
Link& lref=(Link&)myLinks.FindKey(Index);
|
|
||||||
if (lref.Movability()!=MeshDS_Deleted) {
|
|
||||||
if (myLinks.FindFromIndex(Index).Extent()==0) {
|
|
||||||
MeshDS_ListOfInteger::Iterator tit;
|
|
||||||
MeshDS_ListOfInteger& aList1 = myNodes(lref.FirstNode());
|
|
||||||
for(tit.Init(aList1); tit.More(); tit.Next()){
|
|
||||||
if (tit.Value()==Index) {
|
|
||||||
aList1.Remove(tit);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MeshDS_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(MeshDS_Deleted);
|
|
||||||
myDelLinks.Append(Index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : RemoveNode
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::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.
|
|
||||||
Node& vref=(Node&)myNodes.FindKey(Index);
|
|
||||||
if (vref.Movability()==MeshDS_Free &&
|
|
||||||
myNodes.FindFromIndex(Index).Extent()==0) {
|
|
||||||
vref.SetMovability(MeshDS_Deleted);
|
|
||||||
myDelNodes.Append(Index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MoveNode
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Boolean MeshDS_Mesh2d::MoveNode(const Standard_Integer Index,
|
|
||||||
const Node& newNode)
|
|
||||||
{
|
|
||||||
if (myNodes.FindIndex(newNode)==0) {
|
|
||||||
Node vref(myNodes.FindKey(Index));
|
|
||||||
const MeshDS_ListOfInteger& refLink=myNodes(Index);
|
|
||||||
vref.SetMovability(MeshDS_Deleted);
|
|
||||||
myNodes.Substitute(Index, vref, refLink);
|
|
||||||
myNodes.Substitute(Index, newNode, refLink);
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : NbNodes
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::NbNodes()const
|
|
||||||
{
|
|
||||||
return myNodes.Extent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : AddLink
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::AddLink(const Link& theLink)
|
|
||||||
{
|
|
||||||
Standard_Integer LinkIndex=myLinks.FindIndex(theLink);
|
|
||||||
if (LinkIndex<=0) {
|
|
||||||
MeshDS_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 Link& MeshDS_Mesh2d::GetLink(const Standard_Integer Index)
|
|
||||||
{
|
|
||||||
return myLinks.FindKey(Index);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : RemoveLink
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::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.
|
|
||||||
Link& lref=(Link&)myLinks.FindKey(Index);
|
|
||||||
if (lref.Movability()!=MeshDS_Deleted) {
|
|
||||||
if (lref.Movability()==MeshDS_Free &&
|
|
||||||
myLinks.FindFromIndex(Index).Extent()==0) {
|
|
||||||
MeshDS_ListOfInteger::Iterator tit;
|
|
||||||
MeshDS_ListOfInteger& aList1 = myNodes(lref.FirstNode());
|
|
||||||
for(tit.Init(aList1); tit.More(); tit.Next()){
|
|
||||||
if (tit.Value()==Index) {
|
|
||||||
aList1.Remove(tit);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MeshDS_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(MeshDS_Deleted);
|
|
||||||
myDelLinks.Append(Index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : SubstituteLink
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Boolean MeshDS_Mesh2d::SubstituteLink(const Standard_Integer Index,
|
|
||||||
const Link& newLink)
|
|
||||||
{
|
|
||||||
//MeshDS_ListOfInteger thelist(myAllocator);
|
|
||||||
MeshDS_PairOfIndex aPair;
|
|
||||||
Link lref=myLinks.FindKey(Index);
|
|
||||||
if (lref.Movability()==MeshDS_Deleted)
|
|
||||||
myLinks.Substitute(Index, newLink, aPair);
|
|
||||||
else {
|
|
||||||
if (myLinks.FindIndex(newLink)!=0)
|
|
||||||
return Standard_False;
|
|
||||||
|
|
||||||
lref.SetMovability(MeshDS_Deleted);
|
|
||||||
myLinks.Substitute(Index, lref, aPair);
|
|
||||||
|
|
||||||
MeshDS_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 MeshDS_Mesh2d::NbLinks()const
|
|
||||||
{
|
|
||||||
return myLinks.Extent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : AddElement
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::AddElement(const Element& 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 Element& MeshDS_Mesh2d::GetElement(const Standard_Integer Index)
|
|
||||||
{
|
|
||||||
return myElements.FindKey(Index);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : RemoveElement
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::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.
|
|
||||||
Element& lelem=(Element&)myElements.FindKey(Index);
|
|
||||||
if (lelem.Movability()!=MeshDS_Deleted) {
|
|
||||||
ClearElement(Index, lelem);
|
|
||||||
lelem.SetMovability(MeshDS_Deleted);
|
|
||||||
// Not_Debuged_Yet myDelElements.Append(Index);
|
|
||||||
myElemOfDomain.Remove(Index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void removeElementIndex(MeshDS_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 MeshDS_Mesh2d::ClearElement(const Standard_Integer Index,
|
|
||||||
const Element& theElem)
|
|
||||||
{
|
|
||||||
if (theElem.Movability()==MeshDS_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 MeshDS_Mesh2d::SubstituteElement
|
|
||||||
(const Standard_Integer Index, const Element& newElement)
|
|
||||||
{
|
|
||||||
const Element& lelem=myElements.FindKey(Index);
|
|
||||||
if (lelem.Movability()==MeshDS_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 MeshDS_Mesh2d::ClearDomain()
|
|
||||||
{
|
|
||||||
MeshDS_MapOfInteger freeEdges;
|
|
||||||
Standard_Integer ed1, ed2, ed3;
|
|
||||||
Standard_Boolean or1, or2, or3;
|
|
||||||
MeshDS_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()) {
|
|
||||||
Element& lelem=(Element&)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(MeshDS_Deleted);
|
|
||||||
// Not_Debuged_Yet myDelElements.Append(itDom.Key());
|
|
||||||
}
|
|
||||||
myElemOfDomain.Clear();
|
|
||||||
MeshDS_MapOfInteger::Iterator edgeIt(freeEdges);
|
|
||||||
for (; edgeIt.More(); edgeIt.Next())
|
|
||||||
RemoveLink(edgeIt.Key());
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : NbElements
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::NbElements()const
|
|
||||||
{
|
|
||||||
return myElements.Extent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IndexOf
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::IndexOf(const Node& aNode)const
|
|
||||||
{
|
|
||||||
return myNodes.FindIndex(aNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IndexOf
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::IndexOf(const Link& aLink)const
|
|
||||||
{
|
|
||||||
return myLinks.FindIndex(aLink);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IndexOf
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Standard_Integer MeshDS_Mesh2d::IndexOf(const Element& anElement)const
|
|
||||||
{
|
|
||||||
return myElements.FindIndex(anElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : LinkNeighboursOf
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_ListOfInteger& MeshDS_Mesh2d::LinkNeighboursOf
|
|
||||||
(const Standard_Integer theNode)const
|
|
||||||
{
|
|
||||||
return myNodes.FindFromIndex(theNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : ElemConnectedTo
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_PairOfIndex& MeshDS_Mesh2d::ElemConnectedTo
|
|
||||||
(const Standard_Integer theLink)const
|
|
||||||
{
|
|
||||||
return myLinks.FindFromIndex(theLink);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : ElemOfDomain
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_MapOfInteger& MeshDS_Mesh2d::ElemOfDomain () const
|
|
||||||
{
|
|
||||||
return myElemOfDomain;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : LinkOfDomain
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_MapOfInteger& MeshDS_Mesh2d::LinkOfDomain () const
|
|
||||||
{
|
|
||||||
return myLinkOfDomain;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : ClearDeleted
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::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()!=MeshDS_Deleted)
|
|
||||||
break;
|
|
||||||
myElements.RemoveLast();
|
|
||||||
lastNonDelItem--;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndexDelItem=myDelElements.First();
|
|
||||||
myDelElements.RemoveFirst();
|
|
||||||
|
|
||||||
if (IndexDelItem<lastNonDelItem) {
|
|
||||||
Element 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]);
|
|
||||||
MeshDS_ListOfInteger::Iterator itList;
|
|
||||||
for (ied=0; ied<3; ied++) {
|
|
||||||
MeshDS_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()!=MeshDS_Deleted)
|
|
||||||
break;
|
|
||||||
myLinks.RemoveLast();
|
|
||||||
lastNonDelItem--;
|
|
||||||
}
|
|
||||||
|
|
||||||
IndexDelItem=myDelLinks.First();
|
|
||||||
myDelLinks.RemoveFirst();
|
|
||||||
|
|
||||||
if (IndexDelItem<lastNonDelItem) {
|
|
||||||
Link lItem=myLinks.FindKey(lastNonDelItem);
|
|
||||||
MeshDS_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();
|
|
||||||
|
|
||||||
MeshDS_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 Element& 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(),
|
|
||||||
Element(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()!=MeshDS_Deleted)
|
|
||||||
break;
|
|
||||||
myNodes.RemoveLast();
|
|
||||||
lastNonDelItem--;
|
|
||||||
}
|
|
||||||
IndexDelItem=myDelNodes.First();
|
|
||||||
myDelNodes.RemoveFirst();
|
|
||||||
|
|
||||||
if (IndexDelItem<lastNonDelItem) {
|
|
||||||
Node nItem=myNodes.FindKey(lastNonDelItem);
|
|
||||||
MeshDS_ListOfInteger Data;
|
|
||||||
Data.Append(myNodes(lastNonDelItem));
|
|
||||||
myNodes.RemoveLast();
|
|
||||||
lastNonDelItem--;
|
|
||||||
myNodes.Substitute(IndexDelItem, nItem, Data);
|
|
||||||
|
|
||||||
MeshDS_ListOfInteger::Iterator itLi;
|
|
||||||
for (itLi.Init(Data); itLi.More(); itLi.Next()) {
|
|
||||||
const Link& li=myLinks.FindKey(itLi.Value());
|
|
||||||
MeshDS_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(),
|
|
||||||
Link(iv1, iv2, li.Movability()), conx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Statistics
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Mesh2d::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 MeshDS_BaseAllocator& MeshDS_Mesh2d::Allocator() const
|
|
||||||
{
|
|
||||||
return myAllocator;
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
-- File: MeshDS_Node.cdl
|
|
||||||
-- Created: Thu Sep 9 18:28:16 1993
|
|
||||||
-- Author: Didier PIFFAULT
|
|
||||||
-- <dpf@zerox>
|
|
||||||
---Copyright: Matra Datavision 1993
|
|
||||||
|
|
||||||
|
|
||||||
deferred generic class Node from MeshDS (dummyarg as any)
|
|
||||||
|
|
||||||
---Purpose: Describes the necessary services of a node to use
|
|
||||||
--- it in a Mesh data structure.
|
|
||||||
|
|
||||||
uses DegreeOfFreedom from MeshDS
|
|
||||||
|
|
||||||
is Movability (me)
|
|
||||||
returns DegreeOfFreedom from MeshDS;
|
|
||||||
|
|
||||||
|
|
||||||
SetMovability (me: in out; canMove : DegreeOfFreedom from MeshDS);
|
|
||||||
|
|
||||||
|
|
||||||
Domain (me)
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
---Purpose: For maping the Nodes.
|
|
||||||
-- Same Node -> Same HashCode
|
|
||||||
-- Different Nodes -> Not IsEqual but can have same HashCode
|
|
||||||
|
|
||||||
HashCode (me;
|
|
||||||
Upper : Integer from Standard)
|
|
||||||
---C++: function call
|
|
||||||
returns Integer from Standard;
|
|
||||||
|
|
||||||
|
|
||||||
IsEqual (me; Other : Node from MeshDS)
|
|
||||||
---C++: alias operator ==
|
|
||||||
returns Boolean from Standard;
|
|
||||||
|
|
||||||
end Node;
|
|
@ -1,105 +0,0 @@
|
|||||||
// File: MeshDS_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 MeshDS_PairOfIndex_HeaderFile
|
|
||||||
#define MeshDS_PairOfIndex_HeaderFile
|
|
||||||
|
|
||||||
#include <Standard_OutOfRange.hxx>
|
|
||||||
|
|
||||||
class MeshDS_PairOfIndex
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
MeshDS_PairOfIndex()
|
|
||||||
{ myIndx1 = myIndx2 = -1; }
|
|
||||||
|
|
||||||
MeshDS_PairOfIndex(const MeshDS_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 ("MeshDS_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 ("MeshDS_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
|
|
@ -1,155 +0,0 @@
|
|||||||
// File: MeshDS_Selector.gxx
|
|
||||||
// Created: Tue Jun 1 11:20:51 1993
|
|
||||||
// Author: Didier PIFFAULT
|
|
||||||
// <dpf@zerox>
|
|
||||||
|
|
||||||
#include <MeshDS_PairOfIndex.hxx>
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : MeshDS_Selector
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
MeshDS_Selector::MeshDS_Selector()
|
|
||||||
: myNodes(10, new NCollection_IncAllocator),
|
|
||||||
myLinks(10, new NCollection_IncAllocator),
|
|
||||||
myElements(10, new NCollection_IncAllocator),
|
|
||||||
myFrontier(10, new NCollection_IncAllocator)
|
|
||||||
|
|
||||||
{}
|
|
||||||
|
|
||||||
MeshDS_Selector::MeshDS_Selector(const Handle(MeshDS_Mesh2d)& theMesh)
|
|
||||||
: myMesh(theMesh),
|
|
||||||
myNodes(10, myMesh->Allocator()),
|
|
||||||
myLinks(10, myMesh->Allocator()),
|
|
||||||
myElements(10, myMesh->Allocator()),
|
|
||||||
myFrontier(10, myMesh->Allocator())
|
|
||||||
{}
|
|
||||||
|
|
||||||
void MeshDS_Selector::Initialize(const Handle(MeshDS_Mesh2d)& theMesh)
|
|
||||||
{
|
|
||||||
myMesh=theMesh;
|
|
||||||
myNodes.Clear();
|
|
||||||
myLinks.Clear();
|
|
||||||
myElements.Clear();
|
|
||||||
myFrontier.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : NeighboursOfNode
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Selector::NeighboursOf(const Node& theNode)
|
|
||||||
{
|
|
||||||
NeighboursOfNode(myMesh->IndexOf(theNode));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MeshDS_Selector::NeighboursOfNode(const Standard_Integer indexNode)
|
|
||||||
{
|
|
||||||
MeshDS_ListOfInteger::Iterator itL(myMesh->LinkNeighboursOf(indexNode));
|
|
||||||
|
|
||||||
for (; itL.More(); itL.Next()) {
|
|
||||||
const MeshDS_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 MeshDS_Selector::NeighboursOf(const Link& theLink)
|
|
||||||
{
|
|
||||||
NeighboursOfNode(theLink.FirstNode());
|
|
||||||
NeighboursOfNode(theLink.LastNode());
|
|
||||||
}
|
|
||||||
|
|
||||||
void MeshDS_Selector::NeighboursOfLink(const Standard_Integer indexLink)
|
|
||||||
{
|
|
||||||
NeighboursOf(myMesh->GetLink(indexLink));
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : NeighboursOfElement
|
|
||||||
//purpose : by edge and by vertices
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Selector::NeighboursOf(const Element& 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 MeshDS_Selector::NeighboursOfElement(const Standard_Integer indexElem)
|
|
||||||
{
|
|
||||||
NeighboursOf(myMesh->GetElement(indexElem));
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : NeighboursByEdgeOf
|
|
||||||
//purpose : Neighbours Of an element only by edge
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Selector::NeighboursByEdgeOf(const Element& 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 MeshDS_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 MeshDS_Selector::NeighboursOf(const MeshDS_Selector& /*theSelector*/)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : AddNeighbours
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void MeshDS_Selector::AddNeighbours()
|
|
||||||
{}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Nodes
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_MapOfInteger& MeshDS_Selector::Nodes()const
|
|
||||||
{return myNodes;}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Links
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_MapOfInteger& MeshDS_Selector::Links()const
|
|
||||||
{return myLinks;}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Elements
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_MapOfInteger& MeshDS_Selector::Elements()const
|
|
||||||
{return myElements;}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : FrontierLinks
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const MeshDS_MapOfInteger& MeshDS_Selector::FrontierLinks()const
|
|
||||||
{return myFrontier;}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user