16 template <
int N,
typename Real>
33 inline operator bool()
const;
52 void Evaluate(Real u, Real
v, Real
w,
unsigned int maxOrder,
57 void Compute(
unsigned int uOrder,
unsigned int vOrder,
58 unsigned int wOrder,
int iumin,
int iumax,
int ivmin,
int ivmax,
69 template <
int N,
typename Real>
75 for (
int i = 0; i < 3; ++i)
94 std::copy(controls, controls + numControls,
mControls.begin());
102 std::copy(weights, weights + numControls,
mWeights.begin());
111 template <
int N,
typename Real>
117 template <
int N,
typename Real>
124 template <
int N,
typename Real>
130 template <
int N,
typename Real>
136 template <
int N,
typename Real>
142 template <
int N,
typename Real>
148 template <
int N,
typename Real>
154 template <
int N,
typename Real>
160 template <
int N,
typename Real>
166 template <
int N,
typename Real>
173 for (
int i = 0; i < 10; ++i)
180 int iumin, iumax, ivmin, ivmax, iwmin, iwmax;
188 Compute(0, 0, 0, iumin, iumax, ivmin, ivmax, iwmin, iwmax, X, h);
189 Real invH = ((Real)1) /
h;
190 values[0] = invH * X;
197 Compute(1, 0, 0, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
199 values[1] = invH * (XDerU - hDerU * values[0]);
203 Compute(0, 1, 0, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
205 values[2] = invH * (XDerV - hDerV * values[0]);
209 Compute(0, 0, 1, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
211 values[3] = invH * (XDerW - hDerW * values[0]);
218 Compute(2, 0, 0, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
220 values[4] = invH * (XDerUU - ((Real)2) * hDerU * values[1] -
225 Compute(0, 2, 0, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
227 values[5] = invH * (XDerVV - ((Real)2) * hDerV * values[2] -
232 Compute(0, 0, 2, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
234 values[6] = invH * (XDerWW - ((Real)2) * hDerW * values[3] -
239 Compute(1, 1, 0, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
241 values[7] = invH * (XDerUV - hDerU * values[2]
242 - hDerV * values[1] - hDerUV * values[0]);
246 Compute(1, 0, 1, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
248 values[8] = invH * (XDerUW - hDerU * values[3]
249 - hDerW * values[1] - hDerUW * values[0]);
253 Compute(0, 1, 1, iumin, iumax, ivmin, ivmax, iwmin, iwmax,
255 values[9] = invH * (XDerVW - hDerV * values[3]
256 - hDerW * values[2] - hDerVW * values[0]);
261 template <
int N,
typename Real>
263 unsigned int wOrder,
int iumin,
int iumax,
int ivmin,
int ivmax,
275 for (
int iw = iwmin; iw <= iwmax; ++iw)
278 int jw = (iw >= numControls2 ? iw - numControls2 : iw);
279 for (
int iv = ivmin; iv <= ivmax; ++iv)
282 Real tmpvw = tmpv * tmpw;
283 int jv = (iv >= numControls1 ? iv - numControls1 : iv);
284 for (
int iu = iumin; iu <= iumax; ++iu)
287 int ju = (iu >= numControls0 ? iu - numControls0 : iu);
288 int index = ju + numControls0*(jv + numControls1*jw);
289 Real tmp = (tmpu * tmpvw) *
mWeights[index];
std::vector< Real > mWeights
Real const * GetWeights() const
void Evaluate(Real u, Real v, Real w, unsigned int maxOrder, Vector< N, Real > values[10]) const
std::array< int, 3 > mNumControls
NURBSVolume(BasisFunctionInput< Real > const input[3], Vector< N, Real > const *controls, Real const *weights)
GLenum GLsizei GLsizei GLint * values
GLubyte GLubyte GLubyte GLubyte w
std::vector< Vector< N, Real > > mControls
void Compute(unsigned int uOrder, unsigned int vOrder, unsigned int wOrder, int iumin, int iumax, int ivmin, int ivmax, int iwmin, int iwmax, Vector< N, Real > &X, Real &h) const
Real GetMaxDomain(int dim) const
GLfloat GLfloat GLfloat GLfloat h
BasisFunction< Real > const & GetBasisFunction(int dim) const
Vector< N, Real > const * GetControls() const
GLenum GLenum GLenum input
int GetNumControls(int dim) const
Real GetMinDomain(int dim) const
std::array< BasisFunction< Real >, 3 > mBasisFunction