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;
123 int evaluateNormal(
float u,
UT_Vector3 &nml)
const;
126 int curvature(
float u,
UT_Vector3 &curv)
const;
133 float arcLength(
float u0,
float u1,
bool use_frwd_diff =
true,
134 int divs = 10)
const;
148 {
return raiseOrderRefMap(neworder, map); }
150 {
return raiseOrderInt(neworder); }
157 virtual int translateBreakpoints(
const UT_IntArray &uindices,
163 virtual int transformBreakpoints(
const UT_IntArray &uindices,
180 float bias = 0.5
f,
float tolerance = 1.0
f,
187 virtual int domainRangeOfCV(
int cvidx,
int &mink,
188 int &maxk)
const = 0;
195 virtual int breakpointRangeOfCV(
int cvidx,
int &minbkp,
196 int &maxbkp)
const = 0;
218 void weights(
unsigned short onOff)
override;
223 int setWeight(
unsigned int r,
float w);
226 float getWeight(
unsigned int r)
const;
229 int isRational()
const;
234 void normalizeWeights();
253 int ulen)
const override;
261 float tolerance = 1e-05F)
const override;
267 void validRange(
float &ua,
float &ub)
const override;
272 bool uniformTexture (
const GA_RWHandleV3 &txth,
bool ptattrib);
273 bool grevilleTexture(
const GA_RWHandleV3 &txth,
bool ptattrib);
274 bool chordLenTexture(
const GA_RWHandleV3 &txth,
bool ptattrib);
284 if (ub && ub->
checkValid((
int)getVertexCount(),
294 virtual void setBasisCopy(
const GA_Basis *basis) = 0;
305 {
return (
unsigned)
myBasis->getDimension(); }
316 static void dehomogenizeData(
GA_Offset *vertices,
324 float *u0,
float *
u1,
325 float *
v0,
float *
v1)
override;
373 int elevateOrder(
int order);
379 bool interpends,
bool nonrational)
const=0;
387 int &ind1,
int &ind2,
int keep) = 0;
390 virtual void openAt(
float u) = 0;
394 bool interpretBreakpoint(
int idx,
UT_Vector3 &
p)
const;
405 static void computeDataPtsUnitTangents(
const UT_MatrixF &dataPts,
429 bool savePrivateH9(std::ostream &os,
440 bool validate() const override;
443 void setOrder(
unsigned ord) {
myBasis->setOrder(ord); }
448 return (count > 0) ? ((stop -
start)/(
float)
count)
458 uint du=0,
uint = 0)
const override;
461 float u_unit,
float=0,
462 unsigned du=0,
unsigned = 0)
const override;
466 int du=0,
int uOffset=-1)
const override;
468 unsigned du=0,
int uOffset=-1)
const override;
470 virtual int raiseOrderRefMap(
int neworder,
472 virtual int raiseOrderInt(
int neworder)=0;
int raiseOrder(int neworder, GA_AttributeRefMap &map)
virtual int breakCount() const =0
GLboolean GLboolean GLboolean b
virtual bool changePointRef(GA_Offset from, GA_Offset to)
void reverse() override
Reverse the order of vertices.
GLuint GLdouble GLdouble GLint GLint order
virtual void unitToRealSequence(float *uunit, float *ureal, int ulen) const
#define SYS_DEPRECATED_PUSH_DISABLE()
#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.
float stepSize(float start, float stop, int count) const
virtual void validRange(float &ua, float &ub) const
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
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
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
GLubyte GLubyte GLubyte GLubyte w
GEO_Curve(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
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 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
GLboolean GLboolean GLboolean GLboolean a
virtual void weights(unsigned short onOff)
bool evaluate(fpreal u, GEO_Vertex result, GEO_AttributeHandleList &gah, int du=0, int uOffset=-1) const
Bezier or NURBS basis classes which maintain knot vectors.
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 int evaluateV4(float u, UT_Vector4 &pos, unsigned du=0, int uOffset=-1) const
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
void copySubclassData(const GA_Primitive *source) override
IMATH_HOSTDEVICE constexpr int divs(int x, int y) IMATH_NOEXCEPT
const GA_Basis * getBasis() const
bool evaluateMesh(const UT_FloatArray &uvals, GA_Offset *results, GA_AttributeRefMap &hlist, unsigned du=0) const override
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_FloatArray &uvals, GA_Offset *results, GA_AttributeRefMap &hlist, unsigned du=0) const
virtual bool evaluateRefMap(fpreal u, GA_Offset result_vtx, GA_AttributeRefMap &gah, int du=0, int uOffset=-1) const
void setAnyBasis(GA_Basis *ub)
Class to store JSON objects as C++ objects.
static GA_PrimitiveFamilyMask buildFamilyMask()
Container class for all geometry.
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.
GLuint GLdouble GLdouble u2
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
GLenum GLuint GLint GLenum face
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)