14 #ifndef __GEO_Curve_h__
15 #define __GEO_Curve_h__
68 int evaluateHomogeneous(
float u,
UT_Vector4 &pos,
69 unsigned du=0,
int uoffset=-1)
const;
71 bool evaluateHomogeneous(
fpreal u,
74 int du=0,
int uoffset=-1)
const;
80 virtual int evaluateBasisDerivs(
float u,
float bmatx[][
GA_MAXORDER],
81 int &cvoffset,
unsigned du = 0,
82 int uoffset = -1)
const = 0;
89 virtual int evaluateBasis(
float u,
float *ubvals,
int &cvoffset,
90 unsigned du=0,
int uoffset=-1)
const = 0;
94 float computeBValue(
float u,
int i)
const;
106 template <
typename T>
109 unsigned du=0)
const;
112 UT_Vector4 *pos,
unsigned du=0)
const override;
124 int evaluateNormal(
float u,
UT_Vector3 &nml)
const;
127 int curvature(
float u,
UT_Vector3 &curv)
const;
134 float arcLength(
float u0,
float u1,
bool use_frwd_diff =
true,
135 int divs = 10)
const;
136 double arcLength(
double u0,
double u1,
bool use_frwd_diff =
true,
137 int divs = 10)
const;
151 double u0,
double u1,
bool use_frwd_diff =
true,
int divs = 10)
const;
165 {
return raiseOrderRefMap(neworder, map); }
167 {
return raiseOrderInt(neworder); }
174 virtual int translateBreakpoints(
const UT_IntArray &uindices,
180 virtual int transformBreakpoints(
const UT_IntArray &uindices,
197 float bias = 0.5
f,
float tolerance = 1.0
f,
204 virtual int domainRangeOfCV(
int cvidx,
int &mink,
205 int &maxk)
const = 0;
212 virtual int breakpointRangeOfCV(
int cvidx,
int &minbkp,
213 int &maxbkp)
const = 0;
235 void weights(
unsigned short on_off)
override;
240 int setWeight(
unsigned int r,
float w);
243 float getWeight(
unsigned int r)
const;
246 int isRational()
const;
251 void normalizeWeights();
257 myBasis->normalize(len, neworigin);
269 int ulen)
const override;
276 float tolerance = 1e-05F)
const override;
282 void validRange(
float &ua,
float &ub)
const override;
287 bool uniformTexture (
const GA_RWHandleV3 &txth,
bool ptattrib);
288 bool grevilleTexture(
const GA_RWHandleV3 &txth,
bool ptattrib);
289 bool chordLenTexture(
const GA_RWHandleV3 &txth,
bool ptattrib);
299 if (ub && ub->
checkValid((
int)getVertexCount(),
309 virtual void setBasisCopy(
const GA_Basis *basis) = 0;
320 {
return (
unsigned)
myBasis->getDimension(); }
331 static void dehomogenizeData(
GA_Offset *vertices,
339 float *u0,
float *
u1,
340 float *
v0,
float *
v1)
override;
388 int elevateOrder(
int order);
394 bool interpends,
bool nonrational)
const=0;
402 int &ind1,
int &ind2,
int keep) = 0;
405 virtual void openAt(
float u) = 0;
409 bool interpretBreakpoint(
int idx,
UT_Vector3 &p)
const;
420 static void computeDataPtsUnitTangents(
const UT_MatrixF &data_pts,
444 bool savePrivateH9(std::ostream &os,
445 bool binary) const override;
450 virtual
GA_Basis *newBasis() const = 0;
455 bool validate() const override;
458 void setOrder(
unsigned ord) {
myBasis->setOrder(ord); }
466 uint du=0,
uint = 0)
const override;
469 float u_unit,
float=0,
470 unsigned du=0,
unsigned = 0)
const override;
474 int du=0,
int uoffset=-1)
const override;
476 unsigned du=0,
int uoffset=-1)
const override;
478 virtual int raiseOrderRefMap(
int neworder,
480 virtual int raiseOrderInt(
int neworder)=0;
496 double realToUnitDomainD(
double u_real)
const;
499 double unitLengthToUnitDomainD(
double ulength,
double ftolerance)
const;
502 double unitToUnitLengthDomainD(
double uparm)
const;
505 double unitToRealDomainD(
double u_unit)
const;
int raiseOrder(int neworder, GA_AttributeRefMap &map)
virtual int breakCount() const =0
virtual bool changePointRef(GA_Offset from, GA_Offset to)
void reverse() override
Reverse the order of vertices.
virtual void unitToRealSequence(float *uunit, float *ureal, int ulen) const
#define SYS_DEPRECATED_PUSH_DISABLE()
virtual bool evaluateRefMap(fpreal u, GA_Offset result_vtx, GA_AttributeRefMap &gah, int du=0, int uoffset=-1) const
#define SYS_DEPRECATED_POP_DISABLE()
virtual float breakSegmIndexToDomain(int ustartidx, int ustopidx, int lod, int index) const
const GLuint GLenum const void * binary
Specialization of GA_ROGenericHandleVertex for GA_Offset.
virtual void validRange(float &ua, float &ub) const
GLboolean GLboolean GLboolean GLboolean a
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
**But if you need a result
virtual int parametricBBox(float u, float v, float *u0, float *u1, float *v0, float *v1)
GA_PwHandle< true > GA_PwHandleRO
SYS_FORCE_INLINE bool isClosed() const
UT_Array< float > myUvals
SYS_FORCE_INLINE int64 getBaseMemoryUsage() const
Report approximate memory usage for myVertexList for subclasses.
virtual float unitLengthToUnitDomain(float ulength, float tolerance=1e-04F) const
#define GA_INVALID_OFFSET
GEO_Primitive * copy(int preserve_shared_pts=0) const override
GEO_Curve(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
bool evaluateMesh(const UT_Span< const float > &uvals, GA_Offset *results, GA_AttributeRefMap &hlist, unsigned du=0) const override
virtual void validInterval(int &a, int &b) const
OIIO_FORCEINLINE bool extract(const vbool4 &a)
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
virtual bool checkValid(int cvLen, int bLen, bool doesWrap) const =0
virtual int evaluateV4(float u, UT_Vector4 &pos, unsigned du=0, int uoffset=-1) const
virtual int attach(const GEO_Face &face, int blend=1, float bias=0.5f, float tolerance=1.0f, int unrefine=1, GA_PointGroup *ptgroup=0)=0
GLsizei GLsizei GLchar * source
Bezier or NURBS basis classes which maintain knot vectors.
GLdouble GLdouble GLint GLint order
bool evaluatePoint(GA_Offset result_vtx, GA_AttributeRefMap &map, fpreal u, fpreal v=0, uint du=0, uint dv=0) const
A handle to simplify manipulation of multiple attributes.
virtual float unitToRealDomain(float u_unit) const
bool evaluatePointRefMap(GA_Offset result_vtx, GA_AttributeRefMap &vtxdata, fpreal u, fpreal v=0, uint du=0, uint dv=0) const override
int evaluatePointV4(UT_Vector4 &pos, float u_unit, float=0, unsigned du=0, unsigned dv=0) const override
GLboolean GLboolean GLboolean b
bool evaluate(fpreal u, GEO_Vertex result, GEO_AttributeHandleList &gah, int du=0, int uoffset=-1) const
void copySubclassData(const GA_Primitive *source) override
IMATH_HOSTDEVICE constexpr int divs(int x, int y) IMATH_NOEXCEPT
const GA_Basis * getBasis() const
GLfloat GLfloat GLfloat GLfloat h
ImageBuf OIIO_API cut(const ImageBuf &src, ROI roi={}, int nthreads=0)
virtual unsigned getOrder() const =0
static const UT_Array< GA_AttribSaveDataH9 > & theEmptySaveAttribs
Convience objects to pass as arguments to saveH9()/loadH9().
virtual float realToUnitDomain(float u_real) const
virtual bool jsonLoadBasis(UT_JSONParser &p)
virtual bool jsonSaveBasis(UT_JSONWriter &w) const
int setBasis(GA_Basis *ub)
virtual bool evaluateMesh(const UT_Span< const float > &uvals, GA_Offset *results, GA_AttributeRefMap &hlist, unsigned du=0) const
void setAnyBasis(GA_Basis *ub)
Class to store JSON objects as C++ objects.
static GA_PrimitiveFamilyMask buildFamilyMask()
Container class for all geometry.
virtual void weights(unsigned short on_off)
GLubyte GLubyte GLubyte GLubyte w
Specialization of GA_ROGenericHandle for GA_ATTRIB_VERTEX offsets.
virtual float unitToUnitLengthDomain(float uparm) const
int raiseOrder(int neworder)
void normalizeDomain(float len=0.0F, fpreal *neworigin=0)
bool isDegenerate() const override
Is the primitive degenerate.
void countBaseMemory(UT_MemoryCounter &counter) const
static GA_PrimitiveFamilyMask buildFamilyMask()
void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const override
friend std::ostream & operator<<(std::ostream &os, const GEO_Curve &d)
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
bool saveH9(std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const override
void copyPrimitive(const GEO_Primitive *src) override
GA_DECLARE_INTRINSICS(override)