39 #define GA_BASIS_BEZIER_NAME "Bezier"
40 #define GA_BASIS_NURBS_NAME "NURBS"
68 virtual void reset() = 0;
71 virtual bool isEqual(
const GA_Basis &basis)
const = 0;
77 virtual const char *getTypeName()
const = 0;
88 virtual int getDimension()
const = 0;
91 virtual bool getValidInterval(
int &
a,
int &
b)
const = 0;
97 virtual void evalInterval(
fpreal u,
int offset,
int deriv,
100 int deriv,
fpreal32 *vals)
const = 0;
103 virtual void evalDerivativeMatrix(
fpreal u,
int offset,
int deriv,
105 virtual void evalDerivativeMatrix(
fpreal u,
111 virtual int findStartOffset(
fpreal u,
int uoffset)
const = 0;
119 virtual int getBreakCount()
const = 0;
125 virtual int knotToBreakpoint(
int &kidx,
int a,
int b)
const = 0;
131 fpreal tol=theBasisTolerance)
const = 0;
139 virtual int getMultiplicity(
fpreal u,
int &uidx)
const = 0;
142 virtual int getEndMultiplicity()
const;
148 virtual void getCvRangeOfDomain(
int ustartidx,
int ustopidx,
149 int &start_cv,
int &end_cv)
const = 0;
150 virtual void getCvRangeOfDomain(
fpreal ustart,
fpreal ustop,
151 int &start_cv,
int &end_cv)
const = 0;
157 virtual void getCvRangeOfBreakpoint(
int bkp,
158 int &startcv,
int &stopcv)
const = 0;
165 bool testForNan()
const;
168 virtual bool saveH9(std::ostream &os,
bool wrapped,
bool binary)
const = 0;
169 virtual bool loadH9(
UT_IStream &is,
int cvs,
bool wrapped) = 0;
215 virtual bool copyFrom(
const GA_Basis &
b,
bool compatible=
false);
234 virtual bool checkValid(
int cvLen,
int bLen,
bool doesWrap)
const = 0;
237 {
return checkValid(cvLen, getLength(), doesWrap); }
242 virtual fpreal getGreville(
int idx,
bool clamp=
true,
243 bool wrap=
false)
const = 0;
247 virtual int grow(
bool wrapped=
false) = 0;
251 virtual int shrink(
bool wrapped=
false) = 0;
260 virtual bool attach(
const GA_Basis &
b,
bool overlap=
true,
261 bool spread=
false) = 0;
265 virtual void setWrapping(
bool wrap) = 0;
268 virtual void reverse(
bool wrapped) = 0;
271 virtual int findOffset(
fpreal k,
int startIdx=0)
const = 0;
275 fpreal unitToReal(
fpreal u_unit,
bool valid_interval=
true)
const;
278 fpreal realToUnit(
fpreal u_real,
bool valid_interval=
true)
const;
286 return myData.insertKnot(v, i);
289 int remove(
int i) {
return myData.removeIndex(i); }
302 int findMaxSpan(
int start,
int stop)
const;
308 virtual void rebuild(
fpreal ustart=0,
fpreal ustep=1) = 0;
311 virtual void makeUniform(
fpreal ustep=1) = 0;
322 map(myData, myData, newlen, neworig);
332 int uoffset=0)
const;
354 int startidx,
int endidx)
const;
359 int findApproximate(
fpreal val,
int startidx,
360 fpreal tol=theBasisTolerance)
const;
364 void computeRaiseOrderAlphas(
int increment,
381 int64 mem = inclusive ?
sizeof(*this) : 0;
382 mem += myData.getMemoryUsage(
false);
virtual ~GA_Basis()
Destructor.
const GA_KnotFloat * getData() const
void map(fpreal newlen=1, const fpreal *neworig=0)
const GLuint GLenum const void * binary
bool checkValid(int cvLen, bool doesWrap) const
Convenience method to check validity using the basis's length.
GLboolean GLboolean GLboolean GLboolean a
void reverse(I begin, I end)
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
GA_API const UT_StringHolder scale
Bezier or NURBS basis classes which maintain knot vectors.
virtual int64 getMemoryUsage(bool inclusive) const
Return the amount of memory used.
GA_KnotVector & getVector()
static const fpreal theBasisTolerance
GLboolean GLboolean GLboolean b
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
GA_KnotVector & getKnotVector()
int append(fpreal v)
Append a knot value to the end of the knot vector.
int insertKnot(fpreal v, int i)
const GA_KnotVector & getVector() const
int getLength() const
Return the length of the knot vector.
Class to store JSON objects as C++ objects.
GLubyte GLubyte GLubyte GLubyte w
const GA_KnotVector & getKnotVector() const
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
int getOrder() const
Return the order of the basis.