17 template <
int N,
typename Real>
44 Real
const&
GetWeight(
int i0,
int i1)
const;
52 virtual void Evaluate(Real u, Real
v,
unsigned int maxOrder,
57 void Compute(
unsigned int uOrder,
unsigned int vOrder,
int iumin,
67 template <
int N,
typename Real>
73 for (
int i = 0; i < 2; ++i)
98 std::copy(controls, controls + numControls,
mControls.begin());
106 std::copy(weights, weights + numControls,
mWeights.begin());
115 template <
int N,
typename Real>
121 template <
int N,
typename Real>
127 template <
int N,
typename Real>
133 template <
int N,
typename Real>
139 template <
int N,
typename Real>
145 template <
int N,
typename Real>
151 template <
int N,
typename Real>
160 template <
int N,
typename Real>
173 template <
int N,
typename Real>
182 template <
int N,
typename Real>
195 template <
int N,
typename Real>
202 for (
int i = 0; i < 6; ++i)
209 int iumin, iumax, ivmin, ivmax;
216 Compute(0, 0, iumin, iumax, ivmin, ivmax, X, w);
217 Real invW = ((Real)1) /
w;
218 values[0] = invW * X;
225 Compute(1, 0, iumin, iumax, ivmin, ivmax, XDerU, wDerU);
226 values[1] = invW * (XDerU - wDerU * values[0]);
230 Compute(0, 1, iumin, iumax, ivmin, ivmax, XDerV, wDerV);
231 values[2] = invW * (XDerV - wDerV * values[0]);
238 Compute(2, 0, iumin, iumax, ivmin, ivmax, XDerUU, wDerUU);
239 values[3] = invW * (XDerUU - ((Real)2) * wDerU * values[1] -
244 Compute(1, 1, iumin, iumax, ivmin, ivmax, XDerUV, wDerUV);
245 values[4] = invW * (XDerUV - wDerU * values[2] - wDerV * values[1]
246 - wDerUV * values[0]);
250 Compute(0, 2, iumin, iumax, ivmin, ivmax, XDerVV, wDerVV);
251 values[5] = invW * (XDerVV - ((Real)2) * wDerV * values[2] -
257 template <
int N,
typename Real>
259 int iumin,
int iumax,
int ivmin,
int ivmax,
Vector<N, Real>& X, Real&
w)
const 269 for (
int iv = ivmin; iv <= ivmax; ++iv)
272 int jv = (iv >= numControls1 ? iv - numControls1 : iv);
273 for (
int iu = iumin; iu <= iumax; ++iu)
276 int ju = (iu >= numControls0 ? iu - numControls0 : iu);
277 int index = ju + numControls0 * jv;
void SetWeight(int i0, int i1, Real weight)
virtual void Evaluate(Real u, Real v, unsigned int maxOrder, Vector< N, Real > values[6]) const
GLuint GLuint GLfloat weight
GLenum GLsizei GLsizei GLint * values
BasisFunction< Real > const & GetBasisFunction(int dim) const
GLubyte GLubyte GLubyte GLubyte w
std::array< BasisFunction< Real >, 2 > mBasisFunction
std::vector< Vector< N, Real > > mControls
std::array< int, 2 > mNumControls
Real const * GetWeights() const
Real const & GetWeight(int i0, int i1) const
void SetControl(int i0, int i1, Vector< N, Real > const &control)
GLenum GLenum GLenum input
NURBSSurface(BasisFunctionInput< Real > const input[2], Vector< N, Real > const *controls, Real const *weights)
int GetNumControls(int dim) const
void Compute(unsigned int uOrder, unsigned int vOrder, int iumin, int iumax, int ivmin, int ivmax, Vector< N, Real > &X, Real &w) const
std::vector< Real > mWeights
Vector< N, Real > const & GetControl(int i0, int i1) const
Vector< N, Real > const * GetControls() const