mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
array operations
This commit is contained in:
parent
c46329ebf7
commit
27861d15a0
@ -1702,9 +1702,9 @@ namespace netgen
|
||||
const float * bmax,
|
||||
Array<int> & pis) const
|
||||
{
|
||||
static Array<inttn6> stack(10000);
|
||||
|
||||
stack.SetSize (10000);
|
||||
// static Array<inttn6> stack(10000);
|
||||
// stack.SetSize (10000);
|
||||
ArrayMem<inttn6,10000> stack(10000);
|
||||
pis.SetSize(0);
|
||||
|
||||
stack[0].node = root;
|
||||
@ -1717,7 +1717,6 @@ namespace netgen
|
||||
int dir = stack[stacks].dir;
|
||||
|
||||
stacks--;
|
||||
|
||||
if (node->pi != -1)
|
||||
{
|
||||
if (node->data[0] > bmax[0] ||
|
||||
@ -1728,7 +1727,9 @@ namespace netgen
|
||||
node->data[5] < bmin[5])
|
||||
;
|
||||
else
|
||||
pis.Append (node->pi);
|
||||
{
|
||||
pis.Append (node->pi);
|
||||
}
|
||||
}
|
||||
|
||||
int ndir = (dir+1) % 6;
|
||||
@ -2112,6 +2113,18 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
Box3dTree :: Box3dTree (const Box<3> & abox)
|
||||
{
|
||||
boxpmin = abox.PMin();
|
||||
boxpmax = abox.PMax();
|
||||
float tpmin[6], tpmax[6];
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
tpmin[i] = tpmin[i+3] = boxpmin(i);
|
||||
tpmax[i] = tpmax[i+3] = boxpmax(i);
|
||||
}
|
||||
tree = new ADTree6 (tpmin, tpmax);
|
||||
}
|
||||
|
||||
Box3dTree :: Box3dTree (const Point<3> & apmin, const Point<3> & apmax)
|
||||
{
|
||||
|
@ -466,6 +466,7 @@ class Box3dTree
|
||||
ADTree6 * tree;
|
||||
Point<3> boxpmin, boxpmax;
|
||||
public:
|
||||
Box3dTree (const Box<3> & abox);
|
||||
Box3dTree (const Point<3> & apmin, const Point<3> & apmax);
|
||||
~Box3dTree ();
|
||||
void Insert (const Point<3> & bmin, const Point<3> & bmax, int pi);
|
||||
|
@ -239,6 +239,22 @@ namespace netgen
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
void Set (const IndirectArray<T1, T2> & points)
|
||||
{
|
||||
Set (points[points.Begin()]);
|
||||
for (int i = points.Begin()+1; i < points.End(); i++)
|
||||
Add (points[i]);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
void Add (const IndirectArray<T1, T2> & points)
|
||||
{
|
||||
for (int i = points.Begin(); i < points.End(); i++)
|
||||
Add (points[i]);
|
||||
}
|
||||
|
||||
|
||||
Point<D> Center () const
|
||||
{
|
||||
Point<D> c;
|
||||
|
Loading…
Reference in New Issue
Block a user