16 #ifndef __GEO_Face_H__
17 #define __GEO_Face_H__
33 template<
typename T,
bool B>
class GA_EdgeT;
56 void normal(NormalComp &output)
const override;
57 void normal(NormalCompD &output)
const override;
74 virtual unsigned getOrder()
const = 0;
79 float &uunit,
float &vunit)
const override;
82 float &ureal,
float &vreal)
const override;
87 float &uparm,
float &vparm)
const override;
89 float &uparm,
float &vparm,
float tolerance)
const override;
91 float &ulength,
float &vlength)
const override;
98 int du=0,
int uoffset=-1) const;
101 int du=0,
int uoffset=-1)
const
102 {
return evaluateRefMap(u, result_vtx,
105 unsigned du=0,
int uoffset=-1)
const
106 {
return evaluateV4(u, pos, du, uoffset); }
113 float v = 0,
float w = 0)
const override;
120 float u,
int accurate = 1,
int uoffset = -1)
127 int ustartidx,
int ustopidx,
139 virtual int evaluateBreakpoint(
int uidx,
UT_Vector4 &pos,
146 virtual float breakSegmIndexToDomain(
int ustartidx,
int ustopidx,
154 virtual GA_Size removeRepeatedVertices(
155 bool check_order =
false,
156 bool count_only =
false,
157 bool delete_orphaned_points =
false);
158 virtual GA_Size removeRepeatedPoints(
160 bool check_order =
false,
161 bool count_only =
false,
162 bool delete_orphaned_points =
false);
168 virtual int unroll(
int append_pts = 1);
175 virtual int loft(
int newcount,
int start=-1,
int stop=-1) = 0;
183 {
return subdivideRefMap(u, map); }
185 {
return subdivideFloat(u); }
195 float sharpness = 0.0
f,
float bias = -1.0
f) = 0;
199 int warpAlongNormal(
float u,
float distance,
201 float sharpness,
float bias);
214 float bias = 0.5
f,
float tolerance = 1.0
f,
223 virtual float unitToRealDomain(
float u_unit)
const;
224 virtual float realToUnitDomain(
float u_real)
const;
229 virtual float unitLengthToUnitDomain(
float ulength,
230 float tolerance = 1e-04F)
const;
232 virtual float unitToUnitLengthDomain(
float uparm )
const;
238 virtual void unitToRealSequence(
float *uunit,
float *ureal,
240 static void unitToRealAdjust(
float *uunit,
float *ureal,
245 virtual void validInterval(
int &
a,
int &
b)
const;
246 virtual void validRange(
float &ua,
float &ub)
const;
250 return myVertexList.getExtraFlag();
257 myVertexList.setExtraFlag(isclosed);
259 virtual void close(
int rounded = 1,
int preserve_shape = 0);
260 virtual void open(
int preserve_shape = 0,
int safe = 0);
269 int getEdgeCount()
const;
276 void sampleEnds(
int n);
280 virtual int cycle(
int amount,
int = 1);
283 float radius()
const;
307 {
return refineRefMap(k, gah,
r); }
309 {
return refineInt(k,
r); }
314 int max_index,
int wrap);
318 static void fillBreakVals(
const GA_Basis &ub,
322 int ulod,
bool wrap);
327 int idx,
int nextidx,
336 virtual int pointInFace(
const UT_Vector3 &pos,
340 float uvDist(
float u1,
float v1,
float u2,
float v2)
const override;
343 virtual void weights(
unsigned short on_off);
344 virtual int breakCount()
const = 0;
354 float tol = 0.01F,
int ignoretrim=1)
const =0;
388 const int *facepointnumbers,
389 const bool closed =
true);
396 const int *facepointnumbers,
397 const bool closed =
true);
400 template <
typename T>
402 template <
typename T>
404 template <
typename T>
405 fpreal internalCalcArea()
const;
406 template <
typename T>
407 fpreal internalCalcPerimeter()
const;
432 uint du=0,
uint dv=0)
const override;
434 unsigned du=0,
unsigned dv = 0)
const override;
438 int du=0,
int uoffset=-1)
const;
439 virtual int evaluateV4(
float u,
UT_Vector4 &pos,
440 unsigned du=0,
int uoffset=-1)
const;
443 virtual int subdivideFloat(
float u);
446 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.
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
virtual UT_Vector3D computeNormalD() const =0
int evaluate(float u, UT_Vector4 &pos, unsigned du=0, int uoffset=-1) 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
GLboolean GLboolean GLboolean GLboolean a
void reverse() override=0
Reverse the order of vertices.
#define GA_DECLARE_INTRINSICS(OVERRIDE)
**But if you need a result
GLfloat GLfloat GLfloat v2
UT_Function< bool(const GA_Edge &edge)> GA_IterateEdgesFunc
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
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).
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
int refine(float k, GA_AttributeRefMap &gah, int r=1)
GLsizei GLsizei GLchar * source
void unitToUnitLengthPair(float uparm, float vparm, float &ulength, float &vlength) const override
UT_Function< bool(GA_Size, GA_Size)> GA_IterateEdgesByVertexFunc
Bezier or NURBS basis classes which maintain knot vectors.
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__)
GLboolean GLboolean GLboolean b
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
IMATH_CONSTEXPR14 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) IMATH_NOEXCEPT
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.
GLubyte GLubyte GLubyte GLubyte w
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)
SIM_API const UT_StringHolder distance
virtual bool validate() const
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()
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)