16 #ifndef __GEO_Face_H__
17 #define __GEO_Face_H__
32 template<
typename T,
bool B>
class GA_EdgeT;
54 void normal(NormalComp &output)
const override;
71 virtual unsigned getOrder()
const = 0;
76 float &uunit,
float &vunit)
const override;
79 float &ureal,
float &vreal)
const override;
84 float &uparm,
float &vparm)
const override;
86 float &uparm,
float &vparm,
float tolerance)
const override;
88 float &ulength,
float &vlength)
const override;
95 int du=0,
int uOffset=-1)
const;
98 int du=0,
int uOffset=-1)
const
99 {
return evaluateRefMap(u, result_vtx,
102 unsigned du=0,
int uOffset=-1)
const
103 {
return evaluateV4(u, pos, du, uOffset); }
110 float v = 0,
float w = 0)
const override;
117 float u,
int accurate = 1,
int uoffset = -1)
124 int ustartidx,
int ustopidx,
136 virtual int evaluateBreakpoint(
int uidx,
UT_Vector4 &pos,
143 virtual float breakSegmIndexToDomain(
int ustartidx,
int ustopidx,
151 virtual GA_Size removeRepeatedVertices(
bool check_order =
false,
152 bool count_only =
false,
153 bool deleteOrphanedPoints =
false);
154 virtual GA_Size removeRepeatedPoints(
float tol = 0.001F,
155 bool check_order =
false,
156 bool count_only =
false,
157 bool deleteOrphanedPoints =
false);
163 virtual int unroll(
int append_pts = 1);
170 virtual int loft(
int newcount,
int start=-1,
int stop=-1) = 0;
178 {
return subdivideRefMap(u, map); }
180 {
return subdivideFloat(u); }
190 float sharpness = 0.0
f,
float bias = -1.0
f) = 0;
194 int warpAlongNormal(
float u,
float distance,
196 float sharpness,
float bias);
209 float bias = 0.5
f,
float tolerance = 1.0
f,
218 virtual float unitToRealDomain(
float u_unit)
const;
219 virtual float realToUnitDomain(
float u_real)
const;
224 virtual float unitLengthToUnitDomain(
float ulength,
225 float tolerance = 1e-04F)
const;
227 virtual float unitToUnitLengthDomain(
float uparm )
const;
233 virtual void unitToRealSequence(
float *uunit,
float *ureal,
235 static void unitToRealAdjust(
float *uunit,
float *ureal,
240 virtual void validInterval(
int &
a,
int &
b)
const;
241 virtual void validRange(
float &ua,
float &ub)
const;
245 return myVertexList.getExtraFlag();
252 myVertexList.setExtraFlag(isclosed);
254 virtual void close(
int rounded = 1,
int preserveShape = 0);
255 virtual void open(
int preserveShape = 0,
int safe = 0);
264 int getEdgeCount()
const;
271 void sampleEnds(
int n);
275 virtual int cycle(
int amount,
int = 1);
278 float radius()
const;
302 {
return refineRefMap(k, gah,
r); }
304 {
return refineInt(k,
r); }
309 int maxIndex,
int wrap);
313 static void fillBreakVals(
const GA_Basis &ub,
317 int ulod,
bool wrap);
322 int idx,
int nextidx,
331 virtual int pointInFace(
const UT_Vector3 &pos,
335 float uvDist(
float u1,
float v1,
float u2,
float v2)
const override;
338 virtual void weights(
unsigned short onOff);
339 virtual int breakCount()
const = 0;
349 float tol = 0.01F,
int ignoretrim=1)
const =0;
383 const int *facepointnumbers,
384 const bool closed =
true);
391 const int *facepointnumbers,
392 const bool closed =
true);
418 uint du=0,
uint dv=0)
const override;
420 unsigned du=0,
unsigned dv = 0)
const override;
424 int du=0,
int uOffset=-1)
const;
425 virtual int evaluateV4(
float u,
UT_Vector4 &pos,
426 unsigned du=0,
int uOffset=-1)
const;
429 virtual int subdivideFloat(
float u);
432 virtual int refineInt(
float k,
int r=1);
fpreal calcPerimeter() const override
SYS_FORCE_INLINE GEO_Face(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
bool isDegenerate() const override
Is the primitive degenerate.
GLboolean GLboolean GLboolean b
virtual GEO_Primitive * copy(int preserve_shared_pts=0) const
bool findEdgePoints(GA_Offset ptoff0, GA_Offset ptoff1, GA_Size &vtx0, GA_Size &vtx1) const
virtual void copyPrimitive(const GEO_Primitive *src)=0
int subdivide(float u, GA_AttributeRefMap &map)
virtual void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
virtual void copySubclassData(const GA_Primitive *source)
const GLuint GLenum const void * binary
fpreal calcVolume(const UT_Vector3 &) const override
void reverse() override=0
Reverse the order of vertices.
#define GA_DECLARE_INTRINSICS(OVERRIDE)
fpreal calcArea() const override
SYS_FORCE_INLINE bool isClosed() const
virtual void realToUnitPair(float ureal, float vreal, float &uunit, float &vunit) const
exint GA_Size
Defines the bit width for index and offset types in GA.
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
virtual bool loadPrivateH9(UT_IStream &is)=0
#define GA_INVALID_OFFSET
virtual void normal(NormalComp &output) const =0
GLubyte GLubyte GLubyte GLubyte w
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
bool hasEdge(const GA_Edge &edge) const override
Method to determine if a primitive has an edge (undirected).
GLint GLint GLsizei GLint GLenum GLenum type
bool intersect(const Line3< T > &line, const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, Vec3< T > &pt, Vec3< T > &barycentric, bool &front)
GLfloat GLfloat GLfloat v2
GLsizei GLsizei GLfloat distance
virtual bool savePrivateH9(std::ostream &os, bool binary) const =0
bool saveH9(std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const override
GLsizei GLsizei GLchar * source
int refine(float k, GA_AttributeRefMap &gah, int r=1)
GLboolean GLboolean GLboolean GLboolean a
void unitToUnitLengthPair(float uparm, float vparm, float &ulength, float &vlength) const override
Bezier or NURBS basis classes which maintain knot vectors.
std::function< bool(const GA_Edge &edge)> GA_IterateEdgesFunc
A handle to simplify manipulation of multiple attributes.
virtual void iterateEdges(GA_IterateEdgesFunc apply_func) const
virtual float uvDist(float u1, float v1, float u2, float v2) const
#define SYS_DEPRECATED_HDK(__V__)
std::function< bool(GA_Size, GA_Size)> GA_IterateEdgesByVertexFunc
GA_Size getMinVertexCount() const override
bool evaluatePointRefMap(GA_Offset result_vertex, GA_AttributeRefMap &hlist, fpreal u, fpreal v, uint du, uint dv) const override
bool loadH9(UT_IStream &is, const UT_Array< GA_AttribLoadDataH9 > &prim_attribs, const UT_Array< GA_AttribLoadDataH9 > &vtx_attribs) override
static const UT_Array< GA_AttribSaveDataH9 > & theEmptySaveAttribs
Convience objects to pass as arguments to saveH9()/loadH9().
virtual void unitToRealPair(float uunit, float vunit, float &ureal, float &vreal) const
friend std::ostream & operator<<(std::ostream &os, const GEO_Face &d)
virtual int evaluateNormalVector(UT_Vector3 &nml, float u, float v=0, float w=0) const
static GA_PrimitiveFamilyMask buildFamilyMask()
Container class for all geometry.
int refine(float k, int r=1)
ImageBuf OIIO_API warp(const ImageBuf &src, const Imath::M33f &M, string_view filtername=string_view(), float filterwidth=0.0f, bool recompute_roi=false, ImageBuf::WrapMode wrap=ImageBuf::WrapDefault, ROI roi={}, int nthreads=0)
int evaluate(float u, UT_Vector4 &pos, unsigned du=0, int uOffset=-1) const
virtual bool validate() const
GLuint GLdouble GLdouble u2
int evaluatePointV4(UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const override
virtual void iterateEdgesByVertex(GA_IterateEdgesByVertexFunc apply_func) const
static GA_PrimitiveFamilyMask buildFamilyMask()
GLenum GLuint GLint GLenum face
void unitLengthToUnitPair(float ulength, float vlength, float &uparm, float &vparm) const override
bool saveH9(std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const override
SYS_FORCE_INLINE void setClosed(bool isclosed)