shape_doc 0.1
qnode Struct Reference

#include <ssi_qnode.hpp>

List of all members.

Public Member Functions

Public Attributes


Detailed Description

Definition at line 11 of file ssi_qnode.hpp.


Constructor & Destructor Documentation

qnode ( ) [inline]

Definition at line 18 of file ssi_qnode.hpp.

Referenced by qnode::split_u(), and qnode::split_v().

: l(0), r(0) {};
~qnode ( )

Definition at line 40 of file ssi_qnode.cpp.

References qnode::l, and qnode::r.

{
  if  (l ) delete l;
  if ( r ) delete r;
};

Member Function Documentation

void convert ( vector2 v,
sample s,
int  n 
) const

Definition at line 110 of file ssi_qnode.cpp.

References mmx::shape_ssi::du(), mmx::shape_ssi::dv(), qnode::umax, qnode::umin, sample::uvalue(), qnode::vmax, qnode::vmin, and sample::vvalue().

{
  assert(du(this)==1 && dv(this)==1);
  double u = s->uvalue(umin);
  double v = s->vvalue(vmin);
  double vu = s->uvalue(umax)-u;
  double vv = s->vvalue(vmax)-v;
  for ( int i = 0; i < n; i ++ )
    {
      p[i][0] = u + p[i][0]*vu; 
      p[i][1] = v + p[i][1]*vv;
    };
};
void fill ( vector3 qp,
sample s 
) const

Definition at line 86 of file ssi_qnode.cpp.

References sample::base(), sample::m_ncols, qnode::r, qnode::umax, qnode::umin, qnode::vmax, and qnode::vmin.

{
  vector3  *r = s->base() + this->umin*s->m_ncols + this->vmin;
  qp[0] = *r;
  qp[3] = *(r + this->vmax - this->vmin);
  r = s->base() + this->umax*s->m_ncols + this->vmin;
  qp[1] = *r;
  qp[2] = *(r + this->vmax - this->vmin);
};
void fill ( vector3 **  qp,
sample s 
) const

Definition at line 46 of file ssi_qnode.cpp.

References sample::base(), sample::m_ncols, qnode::umax, qnode::umin, qnode::vmax, and qnode::vmin.

Referenced by dsearch::cnfpush(), qnode::mbox(), and qsegment::scale_conflict().

{
  qp[0] = s->base() + this->umin*s->m_ncols + this->vmin;
  qp[1] = s->base() + this->umax*s->m_ncols + this->vmin;
  qp[2] = qp[1]  + this->vmax - this->vmin;
  qp[3] = qp[0]  + this->vmax - this->vmin;
};
bool leaf ( ) const [inline]

Definition at line 17 of file ssi_qnode.hpp.

References qnode::l.

Referenced by dsearch::search().

{ return (l == 0); };
void mbox ( sample s)

Definition at line 73 of file ssi_qnode.cpp.

References qnode::box, fxv< C, N, H >::data, and qnode::fill().

Referenced by qsegment::make(), and qnode::split().

{
  vector3 * qp[4];
  fill( qp, s );
  for ( int i = 0; i < 3; i ++ ) box[i].m = box[i].M = qp[0]->data[i];
  for ( int i = 1; i < 4; i ++ )
    for ( int d = 0; d < 3; d ++ )
      {
        if ( qp[i]->data[d] < box[d].m ) box[d].m = qp[i]->data[d];
        else {  if ( qp[i]->data[d] > box[d].M ) box[d].M = qp[i]->data[d]; };
      };
};
void split ( sample s)

Definition at line 54 of file ssi_qnode.cpp.

References mmx::shape_ssi::du(), mmx::shape_ssi::dv(), qnode::l, qnode::mbox(), qnode::r, qnode::split_u(), and qnode::split_v().

Referenced by dsearch::search(), dsearch::search_f(), and dsearch::search_s().

{

  if ( l ) return;
  if ( du(this) > dv(this) ) 
    {
      this->split_u();
      l->mbox(s);
      r->mbox(s);
    }
  else if ( dv(this) > 1 ) 
    {
      this->split_v();
      l->mbox(s);
      r->mbox(s);
    };

};
void split_u ( )

Definition at line 12 of file ssi_qnode.cpp.

References qnode::father, qnode::l, qnode::qnode(), qnode::r, qnode::umax, qnode::umin, qnode::vmax, and qnode::vmin.

Referenced by qnode::split().

  {
    l = new qnode();
    r = new qnode();
    l->umin = umin;  
    l->umax = (umin+umax)/2;
    r->umin = (umin+umax)/2;
    r->umax = umax;
    l->vmin = r->vmin = vmin;
    l->vmax = r->vmax = vmax;
    l->father = r->father = this;
  };
void split_v ( )

Definition at line 25 of file ssi_qnode.cpp.

References qnode::father, qnode::l, qnode::qnode(), qnode::r, qnode::umax, qnode::umin, qnode::vmax, and qnode::vmin.

Referenced by qnode::split().

{
  l = new qnode();
  r = new qnode();
  l->vmin = vmin;
  l->vmax = (vmin+vmax)/2;
  r->vmin = l->vmax;
  r->vmax = vmax;
  l->umin = r->umin = umin;
  l->umax = r->umax = umax;
  l->father = this;
  r->father = this;
};

Member Data Documentation


The documentation for this struct was generated from the following files: