#include <BamgQuadtree.h>
|
| BamgQuadtree () |
|
| BamgQuadtree (Mesh *t, long nbv=-1) |
|
| ~BamgQuadtree () |
|
void | Add (BamgVertex &w) |
|
int | BoxNumber (int i, int j, int l) |
|
bool | Intersection (int a, int b, int x, int y) |
|
BamgVertex * | NearestVertex (int i, int j) |
|
BamgQuadtreeBox * | NewBamgQuadtreeBox (void) |
|
int | Norm (int xi1, int yi1, int xi2, int yi2) |
|
void | SubBoxCoords (int *pi, int *pj, int boxcoord, int length) |
|
BamgVertex * | TooClose (BamgVertex *, double, int, int) |
|
Definition at line 10 of file BamgQuadtree.h.
◆ BamgQuadtree() [1/2]
bamg::BamgQuadtree::BamgQuadtree |
( |
| ) |
|
◆ BamgQuadtree() [2/2]
bamg::BamgQuadtree::BamgQuadtree |
( |
Mesh * |
t, |
|
|
long |
nbv = -1 |
|
) |
| |
Definition at line 72 of file BamgQuadtree.cpp.
85 if(nbv==-1) nbv=t->nbv;
86 for(
int i=0;i<nbv;i++){
87 this->
Add(t->vertices[i]);
◆ ~BamgQuadtree()
bamg::BamgQuadtree::~BamgQuadtree |
( |
| ) |
|
Definition at line 92 of file BamgQuadtree.cpp.
94 vector<BamgQuadtreeBox*>::reverse_iterator object;
◆ Add()
Definition at line 104 of file BamgQuadtree.cpp.
106 BamgQuadtreeBox** pb=NULL;
107 BamgQuadtreeBox* b=NULL;
110 long i=w.i.x, j=w.i.y;
119 while((b=*pb) && (b->nbitems<0)){
134 if (b->nbitems > 3 && b->v[3] == &w)
return;
135 if (b->nbitems > 2 && b->v[2] == &w)
return;
136 if (b->nbitems > 1 && b->v[1] == &w)
return;
137 if (b->nbitems > 0 && b->v[0] == &w)
return;
145 while ((b= *pb) && (b->nbitems == 4)){
156 b->nbitems = -b->nbitems;
159 b->box[0]=b->box[1]=b->box[2]=b->box[3]=NULL;
165 for (
int k=0;k<4;k++){
169 BamgQuadtreeBox *bb = b->box[ij=
BoxNumber(v4[k]->i.x,v4[k]->i.y,level)];
175 bb->v[bb->nbitems++] = v4[k];
186 b->v[b->nbitems++]=&w;
◆ BoxNumber()
int bamg::BamgQuadtree::BoxNumber |
( |
int |
i, |
|
|
int |
j, |
|
|
int |
l |
|
) |
| |
Definition at line 192 of file BamgQuadtree.cpp.
221 return ((j&l) ? ((i&l) ? 3:2 ) :((i&l) ? 1:0 ));
◆ Intersection()
bool bamg::BamgQuadtree::Intersection |
( |
int |
a, |
|
|
int |
b, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
◆ NearestVertex()
BamgVertex * bamg::BamgQuadtree::NearestVertex |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
Definition at line 227 of file BamgQuadtree.cpp.
230 BamgVertex* nearest_v=NULL;
244 BamgQuadtreeBox* b = this->
root;
258 BamgQuadtreeBox* b0 = b->box[k];
261 if((b0==NULL) || (b0->nbitems==0))
break;
280 for(
int k=0;k<n0;k++){
281 int xiv = b->v[k]->i.x;
282 int yiv = b->v[k]->i.y;
284 int h0 =
Norm(xi2,xiv,yi2,yiv);
305 pi[0]=b->nbitems>0?(int)b->nbitems:4;
327 int h0 =
Norm(xi2,b->v[k]->i.x,yi2,b->v[k]->i.y);
338 BamgQuadtreeBox* b0=b;
354 pi[level] = b->nbitems>0 ? b->nbitems:4 ;
◆ NewBamgQuadtreeBox()
Definition at line 499 of file BamgQuadtree.cpp.
502 BamgQuadtreeBox* newbox=NULL;
505 newbox=
new BamgQuadtreeBox;
◆ Norm()
int bamg::BamgQuadtree::Norm |
( |
int |
xi1, |
|
|
int |
yi1, |
|
|
int |
xi2, |
|
|
int |
yi2 |
|
) |
| |
Definition at line 382 of file BamgQuadtree.cpp.
384 int deltax = xi2 - xi1;
385 int deltay = yi2 - yi1;
387 if(deltax<0) deltax = -deltax;
388 if(deltay<0) deltay = -deltay;
◆ SubBoxCoords()
void bamg::BamgQuadtree::SubBoxCoords |
( |
int * |
pi, |
|
|
int * |
pj, |
|
|
int |
boxcoord, |
|
|
int |
length |
|
) |
| |
Definition at line 397 of file BamgQuadtree.cpp.
419 *pi += ((boxnumber & 1) ? length:0);
421 *pj += ((boxnumber & 2) ? length:0);
◆ TooClose()
Definition at line 424 of file BamgQuadtree.cpp.
428 const double Xx = v->r.x;
429 const double Xy = v->r.y;
430 Metric* Mx =
new Metric(v->m);
455 int i2x = b->v[k]->i.x;
456 int i2y = b->v[k]->i.y;
457 if (
ABS(i-i2x)<hx &&
ABS(j-i2y) <hy ){
458 double XYx = b->v[k]->r.x - Xx;
459 double XYy = b->v[k]->r.y - Xy;
460 if(
LengthInterpole(Mx->Length(XYx,XYy),b->v[k]->m.Length(XYx,XYy)) < threshold){
467 BamgQuadtreeBox *b0=b;
476 pi[l]= b->nbitems>0 ?(int) b->nbitems : 4 ;
◆ boxcontainer
◆ root
◆ NbQuadtreeBox
long bamg::BamgQuadtree::NbQuadtreeBox |
◆ NbVertices
long bamg::BamgQuadtree::NbVertices |
The documentation for this class was generated from the following files: