13 #ifndef __GA_NUBBasis__
14 #define __GA_NUBBasis__
34 #define GA_NUB_UNCLAMP_SCALE 3.0
56 GA_NUBBasis(
int bkpoints,
int multiplicity,
int ord);
63 {
return !(*
this ==
a); }
66 void reset()
override;
80 {
return myEndInterpolation; }
92 {
return findNURBSValidStart(u, uoffset); }
99 {
return findNURBSStart(k, start_idx); }
106 int deriv,
fpreal32 *vals)
const override;
135 int findBreakpoint(
int idx)
const;
136 int findBreakpoint(
fpreal t)
const;
149 fpreal tol=theBasisTolerance)
const override;
161 void refine(
fpreal k,
int kidx,
int r,
bool wrapped);
168 int &start_cv,
int &end_cv)
const override;
170 int &start_cv,
int &end_cv)
const override;
177 int &startcv,
int &stopcv)
const override;
180 bool saveH9(std::ostream &os,
bool wrapped,
181 bool binary)
const override;
189 bool end_interpolation=
true);
205 bool does_wrap)
const override;
211 bool wrap=
false)
const override;
215 int grow(
bool wrapped=
false)
override;
219 int shrink(
bool wrapped=
false)
override;
225 int growAt(
unsigned cv_idx,
bool wrapped);
230 int shrinkAt(
unsigned cv_idx,
bool wrapped);
240 bool spread=
false)
override;
247 void setEndInterpolation(
bool value,
bool modify_knots);
250 void reverse(
bool wrapped)
override;
262 int a0,
int a1,
int b0,
int b1,
282 fpreal ubias=0.5)
override;
285 bool cycle(
int amount,
bool keep_span);
290 void setKnotsByEqualSpacing(
UT_Vector &
param,
bool wrapped=
false);
299 { setEndInterpolation(!myEndInterpolation,
true); }
300 void makeNURBSPeriodic();
303 void updateEndInterpolation();
308 int64 mem = inclusive ?
sizeof(*this) : 0;
314 bool isUniform()
const;
318 int length,
int order,
bool interp);
320 int findNURBSStart(
fpreal k,
int start=0)
const;
321 int findNURBSValidStart(
fpreal u,
int off=-1)
const;
323 void spreadNURBSKnots(
int ai,
int bi);
326 bool myEndInterpolation;
virtual int shrink(bool wrapped=false)=0
UT_VectorT< fpreal64 > UT_Vector
virtual void makeUniform(fpreal ustep=1)=0
Make the basis uniform of just find out if it is uniform:
virtual fpreal getGreville(int idx, bool clamp=true, bool wrap=false) const =0
int64 getMemoryUsage(bool inclusive) const override
Return the amount of memory used.
virtual int getMultiplicity(fpreal u, int &uidx) const =0
virtual int findOffset(fpreal k, int startIdx=0) const =0
Find index in the knot vector for the break point corresponding to k.
const GLuint GLenum const void * binary
virtual int getBreakpoints(GA_KnotVector &a, fpreal tol=theBasisTolerance) const =0
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
virtual void evalInterval(fpreal u, int offset, int deriv, fpreal64 *vals) const =0
virtual fpreal computeBValue(int index, fpreal u) const =0
virtual bool slideRange(fpreal umin, fpreal umax, fpreal ubias=0.5)=0
virtual int findStartOffset(fpreal u, int uoffset) const =0
virtual int getBreakCount() const =0
virtual void reset()=0
Re-initializes the basis to default values.
bool operator!=(const GA_NUBBasis &a) const
virtual bool copyFrom(const GA_Basis &b, bool compatible=false)
virtual int grow(bool wrapped=false)=0
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
virtual bool checkValid(int cvLen, int bLen, bool doesWrap) const =0
virtual int knotToBreakpoint(int &kidx, int a, int b) const =0
virtual GA_BASIS_TYPE getType() const =0
Return the type of the basis.
Bezier or NURBS basis classes which maintain knot vectors.
NURBS basis classes which maintain knot vectors.
GLdouble GLdouble GLint GLint order
virtual int64 getMemoryUsage(bool inclusive) const
Return the amount of memory used.
virtual void setWrapping(bool wrap)=0
virtual int getDimension() const =0
virtual void rebuild(fpreal ustart=0, fpreal ustep=1)=0
Rebuild the basis as a uniform sequence with a given step.
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
virtual bool validate(int adapt=GA_Basis::GA_BASIS_ADAPT_NONE)=0
GLboolean GLboolean GLboolean b
virtual void chord(UT_Vector4Array &cvs)=0
virtual bool attach(const GA_Basis &b, bool overlap=true, bool spread=false)=0
virtual bool loadH9(UT_IStream &is, int cvs, bool wrapped)=0
void toggleEndInterpolation()
TODO: Public for GD_PrimNURBCurve use.
virtual bool saveH9(std::ostream &os, bool wrapped, bool binary) const =0
I/O functions for houdini9 format.
int findStart(fpreal k, int start_idx=0) const
virtual const char * getTypeName() const =0
Return the name of the basis.
virtual void reverse(bool wrapped)=0
Reverse the breakpoints in the basis.
bool getEndInterpolation() const
Return the end-interpolation flag.
virtual int getEndMultiplicity() const
Return the expected multiplicity of the end knots (1 by default):
virtual void getCvRangeOfDomain(int ustartidx, int ustopidx, int &start_cv, int &end_cv) const =0
virtual void getCvRangeOfBreakpoint(int bkp, int &startcv, int &stopcv) const =0
virtual bool getValidInterval(int &a, int &b) const =0
Get the boundaries of the valid evaluation interval (as indices)
virtual void evalDerivativeMatrix(fpreal u, int offset, int deriv, fpreal64 bmatx[][GA_MAXORDER]) const =0
Evaluate all the derivatives of the basis from 0 to deriv (inclusive).
virtual bool isEqual(const GA_Basis &basis) const =0
Compare to see whether the basis is equal.
int findValidStart(fpreal u, int uoffset=-1) const