shape_doc 0.1
surface_parametric< C, V > Class Template Reference

#include <surface_parametric.hpp>

Inheritance diagram for surface_parametric< C, V >:
surface< V > SHAPE_OFV

List of all members.

Public Types

Public Member Functions


Detailed Description

template<class C, class V = default_env>
class mmx::shape::surface_parametric< C, V >

Definition at line 39 of file surface_parametric.hpp.


Member Typedef Documentation

typedef use<point_def,V>::Point Point

Reimplemented in surface_bspline, and surface_rational< K, N >.

Definition at line 43 of file surface_parametric.hpp.

Definition at line 44 of file surface_parametric.hpp.


Constructor & Destructor Documentation

surface_parametric ( void  ) [inline]

Definition at line 47 of file surface_parametric.hpp.

{} ;

Member Function Documentation

virtual Point* eval ( double  u,
double  v 
) const [pure virtual]
virtual void eval ( Point p,
double  u,
double  v 
) const [pure virtual]
void eval ( double *  lp,
const double *  u,
int  n 
) const [virtual]

Definition at line 79 of file surface_parametric.hpp.

References mmx::eval().

                                                  {
  Point p;
  for (int i=0; i<n;i++) {
    this->eval(p,u[0],u[1]);
    *r=p.x();r++; 
    *r=p.y();r++;
    *r=p.z();r++;
    u+=2;
  }
}
virtual void get_range ( double &  umin,
double &  umax,
double &  vmin,
double &  vmax 
) const [pure virtual]

Implemented in surface_rational< K, N >.

virtual Point* operator() ( double  u,
double  v 
) const [inline, virtual]

Definition at line 54 of file surface_parametric.hpp.

{ return this->eval(u,v); }
void sample ( PointIterator  lp,
unsigned  m,
unsigned  n 
) const [virtual]

Definition at line 92 of file surface_parametric.hpp.

References mmx::eval(), mmx::shape_ssi::umax(), mmx::shape_ssi::umin(), mmx::shape_ssi::vmax(), and mmx::shape_ssi::vmin().

                                                            {
  assert(m>1 && n>1);
  Scalar 
    hu=(this->umax() - this->umin())/(m-1), u=umin(),
    hv=(this->vmax() - this->vmin())/(n-1), v;
  Point pp;
  for (unsigned i=0; i<m;i++) {
    v=vmin();
    for (unsigned j=0; j<n;j++,p++) {
      this->eval(*p,u,v);
      v+=hv;
    }
    u+=hu;
  }
}
void sample ( PointIterator  lp,
const double *  u,
unsigned  m,
const double *  v,
unsigned  n 
) const [virtual]

Definition at line 132 of file surface_parametric.hpp.

References mmx::eval().

                                                                                               {
  assert(m>1 && n>1);
  const Scalar * v0=v;

  for (unsigned i=0; i<m;i++,u++) {
    v=v0;
    for (unsigned j=0; j<n;j++,p++,v++) {
      this->eval(*p,*u,*v);
    }
  }
}
void sample ( double *  lp,
unsigned  m,
unsigned  n,
double *  u,
double *  v 
) const [virtual]

Definition at line 109 of file surface_parametric.hpp.

References mmx::eval(), mmx::shape_ssi::umax(), mmx::shape_ssi::umin(), mmx::shape_ssi::vmax(), and mmx::shape_ssi::vmin().

                                                                            {
  assert(m>1 && n>1);
  Scalar 
    hu=(this->umax() - this->umin())/(m-1), 
    hv=(this->vmax() - this->vmin())/(n-1);
  Scalar * u0 =u, su=umin(), * v0=v, sv=vmin();
  for (unsigned i=0; i<m;i++){ *u=su; su+=hu; u++; }
  for (unsigned j=0; j<n;j++){ *v=sv; sv+=hv; v++; }

  Point p;
  u=u0;
  for (unsigned i=0; i<m;i++,u++) {
    v=v0;
    for (unsigned j=0; j<n;j++,v++) {
      this->eval(p,*u,*v);
      *r=p.x();r++; 
      *r=p.y();r++;
      *r=p.z();r++;
    }
  }
}
virtual double umax ( void  ) const [pure virtual]

Implemented in surface_rational< K, N >.

virtual double umin ( void  ) const [pure virtual]

Implemented in surface_rational< K, N >.

virtual double vmax ( void  ) const [pure virtual]

Implemented in surface_rational< K, N >.

virtual double vmin ( void  ) const [pure virtual]

Implemented in surface_rational< K, N >.


The documentation for this class was generated from the following file: