HDK
|
#include <GA_Primitive.h>
Public Types | |
enum | GA_DereferenceStatus { GA_DEREFERENCE_FAIL, GA_DEREFERENCE_OK, GA_DEREFERENCE_DEGENERATE, GA_DEREFERENCE_DESTROY } |
Static Public Member Functions | |
static SYS_FORCE_INLINE GA_PrimCompat::TypeMask | primCompatMaskFromTypeId (int type_id) |
Protected Member Functions | |
SYS_FORCE_INLINE | GA_Primitive (GA_Detail &detail, GA_Offset offset=GA_INVALID_OFFSET) |
void | setNumVertices (GA_Size nvertices) |
GA_Offset | allocateVertex (GA_Offset point=GA_INVALID_OFFSET) |
allocateVertex() will call wireVertex() if the point given is not -1 More... | |
void | destroyVertex (GA_Offset vertex) |
void | wireVertex (GA_Offset vertex, GA_Offset point) |
void | registerVertex (GA_Offset vertex) |
SYS_FORCE_INLINE int64 | getBaseMemoryUsage () const |
Report approximate memory usage for myVertexList for subclasses. More... | |
void | countBaseMemory (UT_MemoryCounter &counter) const |
void | copyVertexListForMerge (const GA_OffsetListRef &src_vertices, const GA_MergeMap &map) |
Protected Attributes | |
GA_OffsetList | myVertexList |
Friends | |
class | GA_PrimitiveList |
Definition at line 110 of file GA_Primitive.h.
The return status of dereferencePoint()
Enumerator | |
---|---|
GA_DEREFERENCE_FAIL | |
GA_DEREFERENCE_OK | |
GA_DEREFERENCE_DEGENERATE | |
GA_DEREFERENCE_DESTROY |
Definition at line 399 of file GA_Primitive.h.
|
inlineprotected |
NOTE: The constructor should only be called from subclass constructors.
Definition at line 116 of file GA_Primitive.h.
|
inlinevirtual |
NOTE: The destructor should only be called from subclass destructors; only GA_PrimitiveList should be calling delete on GA_Primitive pointers.
Definition at line 125 of file GA_Primitive.h.
void GA_Primitive::addPointRefToGroup | ( | GA_PointGroup & | grp | ) | const |
Add all points referenced by the primitive to the given group. This defaults to iterating over the vertices and adding their referenced points.
|
protected |
allocateVertex() will call wireVertex() if the point given is not -1
|
inlinevirtual |
Measure the primitive.
Reimplemented in GEO_Hull, GEO_PrimVolume, GEO_Face, GEO_PrimVDB, GEO_Primitive, GEO_PrimPolySoup, GEO_PrimTube, HDK_Sample::GEO_PrimTetra, GU_PrimPacked, GEO_PrimPacked, GEO_PrimHexahedron, GEO_PrimTetrahedron, GEO_PrimCircle, GEO_PrimSphere, GEO_PrimTriBezier, GEO_PrimTriStrip, and GEO_PrimTriFan.
Definition at line 751 of file GA_Primitive.h.
|
inlinevirtual |
Measure the primitive.
Reimplemented in GEO_Hull, GEO_Face, GEO_Primitive, GEO_PrimNURBCurve, GEO_PrimRBezCurve, GEO_PrimPolySoup, GEO_PrimTube, HDK_Sample::GEO_PrimTetra, GU_PrimPacked, GEO_PrimPacked, GEO_PrimHexahedron, GEO_PrimTetrahedron, GEO_PrimCircle, GEO_PrimSphere, GEO_PrimTriBezier, GEO_PrimTriStrip, and GEO_PrimTriFan.
Definition at line 752 of file GA_Primitive.h.
|
inlinevirtual |
Measure the primitive.
Reimplemented in GEO_Hull, GEO_PrimVolume, GEO_Face, GEO_PrimVDB, GEO_Primitive, GEO_PrimPolySoup, GEO_PrimTube, HDK_Sample::GEO_PrimTetra, GU_PrimPacked, GEO_PrimPacked, GEO_PrimHexahedron, GEO_PrimTetrahedron, GEO_PrimCircle, GEO_PrimSphere, GEO_PrimTriBezier, GEO_PrimTriStrip, and GEO_PrimTriFan.
Definition at line 749 of file GA_Primitive.h.
|
inlinevirtual |
Private interface The clearForDeletion() method is called just prior to the detail being cleared out. This allows the primitive to simplify its data structures, knowing that topology doesn't need to be maintained (i.e. unwiring all vertices);
Reimplemented in GEO_PrimVolume, GEO_Hull, GEO_PrimParticle, GEO_PrimTriBezier, GD_Face, and GEO_TPSurf.
Definition at line 687 of file GA_Primitive.h.
|
inlinevirtual |
Copy all subclass data from source to this.
The vertex lists of source and this must already be equivalent in some manner, though possibly referring to different vertices.
If some subclass data is dependent on the vertex list contents, (such as GEO_PrimPolySoup::myPolygonVertexList), it should be mapped based on the correspondence between the two. GEO_PrimPolySoup is currently the only primitive type with this sort of dependence, so it's probably best not to add more.
NOTE: This must be safe to call on different primitives in parallel at the same time.
Reimplemented in GEO_PrimVolume, GEO_PrimPolySoup, GEO_Hull, GEO_PrimParticle, GEO_PrimTube, GEO_PrimTriBezier, GEO_Quadric, GEO_TPSurf, GEO_Face, GEO_PrimChannel, GD_Curve, HDK_Sample::GEO_PrimTetra, GEO_Curve, GEO_PrimVDB, GEO_PrimPacked, GEO_PrimMetaBall, and GEO_PrimMetaSQuad.
Definition at line 508 of file GA_Primitive.h.
|
inline |
Copy the specified primitive as part of the merge. The source primitive will be of the same type.
Since the vertex offsets will change for the merged geometry, the map should be used to lookup the new vertex offsets. For example
Definition at line 487 of file GA_Primitive.h.
|
protected |
This is the implementation of this level of copyUnwiredForMerge, and enables GA_PrimitiveList to set the vertex list without a source primitive.
|
protected |
This is called by the subclasses to count the memory used by myVertexList
|
virtual |
Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. NOTE: This should always include sizeof(*this).
Reimplemented in GEO_PrimTriBezier, HDK_Sample::GEO_PrimTetra, GU_PrimPacked, GU_PrimChannel, GU_PrimTube, GU_PrimSphere, GU_PrimCircle, GU_PrimMetaSQuad, GEO_PrimNull, GU_PrimMetaBall, GU_PrimNURBSurf, GU_PrimRBezCurve, GU_PrimRBezSurf, GEO_PrimHexahedron, GEO_PrimTetrahedron, GU_PrimNURBCurve, GEO_PrimPoly, GU_PrimMesh, GU_PrimParticle, GU_PrimVolume, GU_PrimVDB, GU_PrimPolySoup, GD_Curve, GU_PrimTriFan, GU_PrimTriStrip, and GD_PrimPoly.
|
pure virtual |
|
pure virtual |
void GA_Primitive::edgeApply | ( | GA_EdgeApplyFunc | apply, |
void * | data = nullptr |
||
) | const |
Calls apply for each directed edge in this primitive
iterateEdges
instead. void GA_Primitive::edgeApplyIndex | ( | GA_EdgeApplyIndexFunc | apply, |
void * | data = nullptr |
||
) | const |
Calls apply for each directed edge in this primitive
iterateEdgesByVertex
instead.
|
virtual |
Enlarge a bounding box by the bounding box of the primitive. A return value of false indicates an error in the operation, most likely an invalid P. By default, these methods simply enlarge the bounding box based on the vertices.
Reimplemented in GEO_PrimVolume, GEO_PrimVDB, GEO_Primitive, GEO_PrimParticle, and GEO_Quadric.
|
virtual |
Enlarge a bounding box by the bounding box of the primitive. A return value of false indicates an error in the operation, most likely an invalid P. By default, these methods simply enlarge the bounding box based on the vertices.
Reimplemented in GEO_PrimVolume, GEO_PrimVDB, GEO_Primitive, GEO_PrimParticle, and GEO_Quadric.
|
virtual |
Enlarge a bounding sphere to encompass the primitive. A return value of false indicates an error in the operation, most likely an invalid P. By default, this method simply enlarges the bounding box based on the vertices.
Reimplemented in GEO_PrimVolume, GEO_PrimVDB, GEO_PrimParticle, and GEO_Quadric.
|
virtual |
Enlarge a point bounding box for implicit primitive bounds. If a primitive (such as a sphere) has a bounding box larger than its point hull, then it should implement this method. Otherwise, it can rely on the default behaviour.
NOTE: If you make a custom primitive type whose bounding box may be larger than the bounding box of the points referenced by vertices of the primitive, you must override this function in order for the detail's bounding box to be correctly computed. It does not suffice to override GEO_Primitive::getBBox(), since GA_Detail::computeQuickBounds will find the point bounding box of the entire detail, and then call enlargePointBounds on all primitives except polygons, tetrahedra, polysoups, and other primitive types that are known in advance to not exceed their point bounding boxes.
Reimplemented in GEO_PrimVDB, GEO_PrimVolume, GEO_Quadric, and GEO_PrimPacked.
|
virtual |
Enlarge a bounding box by the visible bounding box of the primitive.
A return value of false indicates an error in the operation, most likely an invalid P. By default, it merely calls enlargeBoundingBox()
Reimplemented in GEO_Primitive.
bool GA_Primitive::findEdgePoints | ( | GA_Offset | ptoff0, |
GA_Offset | ptoff1, | ||
GA_Size & | vtx0, | ||
GA_Size & | vtx1 | ||
) | const |
Calls edgeApplyIndex to find the vertices within this primitive, corresponding with the first undirected edge between ptoff0 and ptoff1. If the edge is not in this primitive, vtx0 and vtx1 will not be written-to, and the function will return false. When written, vtx0->vtx1 will always be the direction the edge appears in this primitive, which may be opposite ptoff0->ptoff1.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 616 of file GA_Primitive.h.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 612 of file GA_Primitive.h.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 614 of file GA_Primitive.h.
|
inlinevirtual |
Copy any modified caches from the GPU to CPU. Then delete the GPU cache.
Reimplemented in GEO_PrimVolume, and GEO_PrimVDB.
Definition at line 816 of file GA_Primitive.h.
|
inlinevirtual |
Copy any modified caches from the GPU back to CPU cache.
Reimplemented in GEO_PrimVolume, and GEO_PrimVDB.
Definition at line 812 of file GA_Primitive.h.
|
inline |
Calls a functor (e.g. a lambda) for each point offset in this primitive, in the order they occur in the vertex list. This is optimized to only check triviality once and only look up the vertex-to-point topology attribute once.
Definition at line 780 of file GA_Primitive.h.
|
inline |
Calls a functor (e.g. a lambda) for each vertex offset in this primitive, in the order they occur in the vertex list. This is optimized to only check triviality once.
Definition at line 769 of file GA_Primitive.h.
|
inlinevirtual |
Return the next and previous vertex on the "boundary" of the primitive (as understood by the primitive) relative to a given vertex. These are needed to maintain half-edge topology attributes. They must be implemented for primitives that realize a notion of a boundary composed of one or more closed cycles of vertices if we want to be able to use hedges to quickly move from such a primitive to another sharing an edge with it. A GA_INVALID_OFFSET for prev_vtx or next_vtx means that either the primitive doesn't care about hedges, the input vertex is not a boundary vertex in the primitive (or not a vertex at all), or vtx is at an end of a boundary (e.g. open polys).
Reimplemented in GEO_PrimPoly.
Definition at line 699 of file GA_Primitive.h.
|
inlineprotected |
Report approximate memory usage for myVertexList for subclasses.
Definition at line 845 of file GA_Primitive.h.
|
inline |
Gets the detail containing this primitive.
FIXME: This should return a const detail, and a non-const version should return a non-const detail.
Definition at line 141 of file GA_Primitive.h.
|
inline |
Definition at line 179 of file GA_Primitive.h.
|
inline |
Gets the index map for primitives in the detail containing this primitive.
Definition at line 156 of file GA_Primitive.h.
GA_Size GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_String & | val | ||
) | const |
Get the value of a primitive intrinsic. These methods return the number of items retrieved.
GA_Size GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_StringArray & | val | ||
) | const |
Get the value of a primitive intrinsic. These methods return the number of items retrieved.
GA_Size GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_OptionsHolder & | val | ||
) | const |
Get the value of a primitive intrinsic. These methods return the number of items retrieved.
GA_Size GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Array< UT_OptionsHolder > & | val | ||
) | const |
Get the value of a primitive intrinsic. These methods return the number of items retrieved.
GA_Size GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
int64 * | v, | ||
GA_Size | size | ||
) | const |
Get the value of a primitive intrinsic. These methods return the number of items retrieved.
GA_Size GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
fpreal64 * | v, | ||
GA_Size | sz | ||
) | const |
Get the value of a primitive intrinsic. These methods return the number of items retrieved.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
float & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
int & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Vector2 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Vector3 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Vector4 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Matrix2 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Matrix3 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Matrix4 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
double & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
int64 & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Vector2D & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Vector3D & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Vector4D & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Matrix2D & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Matrix3D & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
bool GA_Primitive::getIntrinsic | ( | GA_LocalIntrinsic | h, |
UT_Matrix4D & | v | ||
) | const |
Get the value of a primitive intrinsic. Returns false if not the right type or not found. Always will clear out the provided value.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 622 of file GA_Primitive.h.
|
inline |
Get the intrinsic manager for primitive intrinsics. All primitives have at least the following intrinsics:
Definition at line 603 of file GA_Primitive.h.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 619 of file GA_Primitive.h.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 629 of file GA_Primitive.h.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 627 of file GA_Primitive.h.
|
inline |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
Definition at line 625 of file GA_Primitive.h.
GA_Size GA_Primitive::getIntrinsicTupleSize | ( | GA_LocalIntrinsic | h | ) | const |
Query properties of the primitive intrinsic. Note that the tuple size calls the virtual method since the tuple size may be dynamic (i.e. basis knot vector). This also means that to know whether a single component tuple should collapse to a scalar value, you need to call the getIntrinsicCollapseSingletons method.
|
pure virtual |
This method returns the JSON interface for saving/loading the primitive If the method returns a NULL pointer, then the primitive will not be saved to geometry files (and thus cannot be loaded).
Implemented in GEO_PrimVolume, GEO_PrimPolySoup, GEO_PrimNURBSurf, GEO_PrimNURBCurve, GEO_PrimHexahedron, GEO_PrimRBezSurf, GEO_PrimTetrahedron, GEO_PrimParticle, GEO_PrimRBezCurve, GEO_PrimVDB, GEO_PrimTriBezier, GEO_PrimTube, GEO_PrimPoly, GEO_PrimChannel, GEO_PrimMesh, HDK_Sample::GEO_PrimTetra, GEO_PrimTriStrip, GEO_PrimMetaSQuad, GEO_PrimPacked, GEO_PrimCircle, GEO_PrimMetaBall, GEO_PrimSphere, GEO_PrimTriFan, GEO_PrimNull, GD_Curve, and GD_PrimPoly.
|
virtual |
Return the local transform matrix for the primitive. Some primitives don't store transforms (see hasLocalTransform()
). The default behaviour is to make the transform an identity.
Reimplemented in GEO_PrimVolume, GEO_PrimVDB, GEO_Quadric, and GEO_PrimPacked.
|
virtual |
Return the local transform matrix for the primitive, but with the translates specified by the position of the first vertex of the primitive. This only includes the local transform and the translate due to the point position.
|
inline |
Gets the index of this primitive in the detail containing it.
Definition at line 151 of file GA_Primitive.h.
|
inline |
Gets the offset of this primitive in the detail containing it.
Definition at line 146 of file GA_Primitive.h.
|
inlinevirtual |
Report approximate memory usage, including sizeof(*this) and any shared memory.
Reimplemented in GEO_PrimTriBezier, HDK_Sample::GEO_PrimTetra, GU_PrimPacked, GU_PrimChannel, GU_PrimTube, GU_PrimSphere, GU_PrimCircle, GU_PrimMetaSQuad, GU_PrimMetaBall, GEO_PrimNull, GU_PrimNURBSurf, GU_PrimRBezCurve, GU_PrimRBezSurf, GEO_PrimHexahedron, GEO_PrimTetrahedron, GU_PrimNURBCurve, GEO_PrimPoly, GU_PrimMesh, GU_PrimParticle, GU_PrimVolume, GU_PrimVDB, GU_PrimPolySoup, GD_Curve, GU_PrimTriFan, GU_PrimTriStrip, and GD_PrimPoly.
Definition at line 209 of file GA_Primitive.h.
|
inline |
Definition at line 160 of file GA_Primitive.h.
|
virtual |
A primitive may support any number of secondary details.
Reimplemented in GEO_TPSurf.
|
inline |
Given a vertex number (into the primitive's vertex list), return its point index number.
Definition at line 268 of file GA_Primitive.h.
|
inline |
Given a vertex number (into the primitive's vertex list), return the point offset.
Definition at line 254 of file GA_Primitive.h.
|
inline |
Get a range of all the points accessed by the primitive. Note, the range may visit points multiple times.
Definition at line 319 of file GA_Primitive.h.
|
inline |
Given a vertex number (into the primitive's vertex list), return its point's position.
Definition at line 274 of file GA_Primitive.h.
|
inline |
Definition at line 277 of file GA_Primitive.h.
|
inline |
Definition at line 280 of file GA_Primitive.h.
|
inline |
Given a vertex number (into the primitive's vertex list), return its point's position.
Definition at line 295 of file GA_Primitive.h.
|
inline |
Definition at line 298 of file GA_Primitive.h.
|
inlinevirtual |
Reimplemented in GEO_Primitive, and GD_Primitive.
Definition at line 204 of file GA_Primitive.h.
const GA_Primitive* GA_Primitive::getSecondaryByIndex | ( | GA_Index | detail, |
GA_Index | i | ||
) | const |
GA_Primitive* GA_Primitive::getSecondaryByIndex | ( | GA_Index | detail, |
GA_Index | i | ||
) |
const GA_Primitive* GA_Primitive::getSecondaryByOffset | ( | GA_Index | detail, |
GA_Offset | o | ||
) | const |
GA_Primitive* GA_Primitive::getSecondaryByOffset | ( | GA_Index | detail, |
GA_Offset | o | ||
) |
Reimplemented in GEO_TPSurf.
Reimplemented in GEO_TPSurf.
|
pure virtual |
Implemented in HDK_Sample::GEO_PrimTetra, GU_PrimChannel, GU_PrimTube, GU_PrimSphere, GEO_PrimNull, GU_PrimCircle, GU_PrimMetaSQuad, GU_PrimMetaBall, GU_PrimNURBCurve, GU_PrimVDB, GU_PrimMesh, GU_PrimNURBSurf, GU_PrimParticle, GU_PrimRBezCurve, GU_PrimRBezSurf, GEO_PrimHexahedron, GEO_PrimTetrahedron, GU_PrimPolySoup, GEO_PrimPoly, GU_PrimTriFan, GU_PrimTriStrip, GD_PrimPoly, GU_PrimPacked, GU_PrimVolume, GD_PrimRBezCurve, GEO_PrimTriBezier, and GD_PrimNURBCurve.
|
inline |
Definition at line 177 of file GA_Primitive.h.
|
inline |
Definition at line 133 of file GA_Primitive.h.
|
inline |
Return the number of vertices used by this primitive.
Definition at line 232 of file GA_Primitive.h.
|
inline |
Definition at line 246 of file GA_Primitive.h.
|
inline |
Given an vertex number (into the primitive's vertex list), return the vertex offset.
Definition at line 240 of file GA_Primitive.h.
|
inline |
Get a range of all the vertices accessed by the primitive.
Definition at line 311 of file GA_Primitive.h.
|
virtual |
Method to determine if a primitive has an edge (undirected).
Reimplemented in GEO_Hull, GEO_PrimPolySoup, GEO_Primitive, GEO_Face, and GEO_VolumeElementBase.
|
inline |
Whether the primitive has a transform associated with it.
Definition at line 185 of file GA_Primitive.h.
|
pure virtual |
Is the primitive degenerate.
Implemented in GEO_Hull, GEO_PrimVolume, GEO_TPSurf, GEO_Curve, GD_Curve, GEO_Quadric, GEO_PrimParticle, GEO_PrimPoly, GD_Face, GU_PrimPacked, GEO_PrimTriBezier, GEO_PrimHexahedron, GEO_PrimTetrahedron, GEO_TriMesh, GEO_Face, HDK_Sample::GEO_PrimTetra, GEO_PrimChannel, GEO_PrimVDB, GD_Primitive, GEO_PrimNull, GEO_PrimMetaBall, GEO_PrimPacked, GEO_PrimMetaSQuad, GEO_PrimTriFan, and GEO_PrimTriStrip.
|
inline |
Definition at line 181 of file GA_Primitive.h.
bool GA_Primitive::isPointListTrivial | ( | ) | const |
A trivial point list is doubly-trivial: getPointOffset(i) == getPointOffset(0) + i This requires testing every point so is slower than isVertexListTrivial.
|
inline |
Return whether a point is referenced by a primitive. This simply iterates over the vertices, checking if any vertices reference the point.
Definition at line 329 of file GA_Primitive.h.
|
inline |
Returns true if the primitive is part of a 3D geometry detail (GEO_Detail), and false if it is part of a 2D geometry detail (GD_Detail) for trim/projection curves.
Definition at line 169 of file GA_Primitive.h.
|
inline |
A trivial vertex list is a uniform ascending list, so getFastVertexOffset(i) == getFastVertexOffset(0) + i
Definition at line 758 of file GA_Primitive.h.
|
virtual |
Backward compatible methods for GD library Determine whether the primitive is visisble on the interval of the parent surface. Partial visiblity should return true as well.
0
: Not visible on parent surface1
: Full visibility (default)2
: Partial visibility Reimplemented in GD_Face.
|
inlinevirtual |
Calls apply_func
for each directed edge on the primitive. If the apply_func
function returns false
, then the traversal will be stopped.
Reimplemented in GEO_Hull, GEO_PrimPolySoup, GEO_Face, and GEO_VolumeElementBase.
Definition at line 362 of file GA_Primitive.h.
|
inlinevirtual |
Calls apply_func
for each directed edge on the primitive, passing in the GA_Size
primitive vertex index for each point on the edge. If the apply_func
function returns false
, then the traversal will be stopped.
Reimplemented in GEO_Hull, GEO_PrimPolySoup, GEO_Face, and GEO_VolumeElementBase.
Definition at line 372 of file GA_Primitive.h.
|
virtual |
Reimplemented in GEO_PrimVolume, GEO_Hull, GEO_PrimParticle, GEO_PrimTriBezier, GD_Face, GEO_Quadric, GEO_Face, and GEO_TriMesh.
|
inlinestatic |
Definition at line 823 of file GA_Primitive.h.
|
virtual |
Reimplemented in GEO_PrimVolume, GEO_PrimPacked, and GU_PrimPacked.
Create the topological binding between preallocated vertex and primitive.
Release the given vertex. This is equivalent to deleting a vertex without modifying its topology attributes. In other words, the primitive doesn't use the vertex anymore, but the vertex stays wired to the primitive and to the point it was wired to. The intended use is with stealVertex methods, so that the same vertex can be aquired by another primitive, thus maintaining its offset number and attributes The return value is the vertex offset (same as input) if successful and GA_INVALID_OFFSET otherwise.
Reimplemented in GEO_TriMesh.
Definition at line 717 of file GA_Primitive.h.
|
pure virtual |
Primitives must provide these methods
Implemented in GEO_PrimVolume, GEO_Curve, GEO_Face, GEO_PrimNURBCurve, GEO_Primitive, GEO_PrimRBezCurve, GEO_Hull, GD_Face, GEO_PrimPolySoup, GD_Curve, GEO_PrimParticle, GD_PrimNURBCurve, GD_PrimRBezCurve, GEO_Quadric, GEO_PrimHexahedron, GEO_PrimTetrahedron, HDK_Sample::GEO_PrimTetra, GD_Primitive, GEO_PrimVDB, GEO_PrimChannel, GEO_PrimTriBezier, GEO_PrimNull, GEO_PrimPacked, GEO_PrimTriFan, and GEO_PrimTriStrip.
|
virtual |
Reimplemented in GEO_PrimVolume, GEO_Hull, GEO_PrimParticle, GEO_PrimTriBezier, GD_Face, GEO_Quadric, GEO_Face, and GEO_TriMesh.
|
virtual |
Some primitives can have common/shared data between different instances of the primitives. This method is invoked during the save process to save data. The method requires you to save two objects sequentially (the data is stored in a list) for each shared key:
If there are multiple shared data pointers, the array can continue with name/value pairs.
For example, you might have something like:
Then in the primitive JSON, you'd likely want to have two fields, one for the shared data pointer, the other for an expanded version of the data. The shouldSaveField()
method would be something like:
Then the saveField() method of the primitive JSON would look something like:
During the loading process, you can just get the shared data from the load map.
Reimplemented in GEO_PrimVolume, GEO_PrimPacked, and GU_PrimPacked.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const char * | value | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const UT_StringArray & | value | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const char ** | val, | ||
GA_Size | s | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const UT_OptionsHolder & | value | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const UT_Array< UT_OptionsHolder > & | value | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const UT_OptionsHolder * | value, | ||
GA_Size | s | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const int64 | val | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const fpreal64 | val | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const int64 * | val, | ||
GA_Size | sz | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
GA_Size GA_Primitive::setIntrinsic | ( | GA_LocalIntrinsic | h, |
const fpreal64 * | v, | ||
GA_Size | sz | ||
) |
Set intrinsic attributes. This will fail if the intrinsic is read-only. These methods return the number of items set.
|
virtual |
Set the local transform. The default implementation does nothing.
Reimplemented in GEO_PrimVolume, GEO_PrimVDB, GEO_Quadric, and GEO_PrimPacked.
|
inline |
Given a vertex number (into the primitive's vertex list), set the corresponding point offset.
Definition at line 260 of file GA_Primitive.h.
|
inline |
Given a vertex number (into the primitive's vertex list), move the point to the specified position.
Definition at line 286 of file GA_Primitive.h.
|
inline |
Definition at line 289 of file GA_Primitive.h.
|
inline |
Given a vertex number (into the primitive's vertex list), move the point to the specified position.
Definition at line 304 of file GA_Primitive.h.
|
inline |
Definition at line 307 of file GA_Primitive.h.
|
virtual |
Stash (deactivate) or unstash (reactivate) the primitive.
Stashing a primitive will set its offset to that specified, typically GA_INVALID_OFFSET. Primitives are only stashed as part of clearing a detail, so there is no need to explicitly deallocate vertices. It is safe to delete a stashed primitive.
Unstashing a primitive will re-register that primitive with its parent detail at the specified offset (or a new offset if GA_INVALID_OFFSET).
Reimplemented in GEO_Hull, GEO_PrimVolume, GEO_TPSurf, GEO_PrimVDB, GEO_PrimParticle, GEO_Quadric, GEO_PrimPolySoup, GEO_PrimTriBezier, HDK_Sample::GEO_PrimTetra, GU_PrimPacked, GEO_PrimPacked, and GEO_PrimChannel.
|
inlinevirtual |
Steal the underlying CE buffer from the source.
Reimplemented in GEO_PrimVolume, and GEO_PrimVDB.
Definition at line 819 of file GA_Primitive.h.
|
inlinevirtual |
Primitives that implement getAdjacentBoundaryVertices must respond true to supportsHedge().
Reimplemented in GEO_PrimPoly.
Definition at line 706 of file GA_Primitive.h.
void GA_Primitive::swapOffsetValue | ( | const GA_Defragment & | defrag | ) |
For defragmentation, we need to update the offset.
|
virtual |
This method is called when the vertex index map is being defragmented. Since the defragmentation process moves vertex offsets, primitives need to update their references with the new values.
Reimplemented in GEO_PrimVolume, GEO_Hull, GEO_PrimPolySoup, GD_Face, GEO_PrimParticle, and GEO_PrimTriBezier.
|
inline |
Definition at line 788 of file GA_Primitive.h.
|
friend |
Definition at line 881 of file GA_Primitive.h.
|
protected |
Definition at line 886 of file GA_Primitive.h.