GEO_Quadric Class Reference

#include <GEO_Quadric.h>

Inheritance diagram for GEO_Quadric:

GEO_Primitive GA_Primitive GEO_PrimCircle GEO_PrimSphere GEO_PrimTube GU_PrimCircle GEO_PrimMetaBall GEO_PrimMetaSQuad GU_PrimSphere GU_PrimTube GU_PrimMetaBall GU_PrimMetaSQuad

List of all members.

Public Member Functions

 GEO_Quadric (GEO_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
virtual ~GEO_Quadric ()
virtual int getBBox (UT_BoundingBox *bbox) const =0
virtual bool enlargeBoundingSphere (UT_BoundingSphere &b, const GA_Attribute *P) const
virtual UT_Vector3 baryCenter () const
virtual UT_Vector3 computeNormal () const
 Return a normal vector for the primitive.
virtual bool saveH9 (ostream &os, bool binary, const UT_RefArray< GA_AttribSaveDataH9 > &prim_attribs, const UT_RefArray< GA_AttribSaveDataH9 > &vtx_attribs) const
virtual bool loadH9 (UT_IStream &is, const UT_RefArray< GA_AttribLoadDataH9 > &prim_attribs, const UT_RefArray< GA_AttribLoadDataH9 > &vtx_attribs)
virtual void transform (const UT_Matrix4 &mat)
virtual void untransform (void)
virtual GEO_Primitivecopy (int preserve_shared_pts=0) const
virtual void copyPrimitive (const GEO_Primitive *src, GEO_Point **ptredirect)
virtual void copyUnwiredForMerge (const GA_Primitive *src, const GA_MergeMap &map)
virtual void addPointRefToGroup (GA_PointGroup &grp) const
virtual int vertexApply (int(*a)(GEO_Vertex, void *), void *)
virtual int vertexApply (int(*a)(const GEO_Vertex &, void *), void *) const
virtual void reverse (void)
 Reverse the order of vertices.
virtual GA_Size getVertexCount () const
 Return the number of vertices used by this primitive.
virtual GA_Offset getVertexOffset (GA_Size index) const
virtual int detachPoints (GA_PointGroup &grp)
virtual GA_DereferenceStatus dereferencePoint (GA_Offset point, bool dry_run=false)
virtual GA_DereferenceStatus dereferencePoints (const GA_RangeMemberQuery &pt_q, bool dry_run=false)
virtual bool isDegenerate () const
 Is the primitive degenerate.
void getAxes (UT_Vector3 &x, UT_Vector3 &y, UT_Vector3 &z) const
void getXAxis (UT_Vector3 &x) const
void getYAxis (UT_Vector3 &y) const
void getZAxis (UT_Vector3 &z) const
void setAxes (const UT_Vector3 &x, const UT_Vector3 &y, const UT_Vector3 &z)
void setXAxis (const UT_Vector3 &x)
void setYAxis (const UT_Vector3 &y)
void setZAxis (const UT_Vector3 &z)
const UT_Matrix3getTransform (void) const
void setTransform (const UT_Matrix3 &m)
void getTransform4 (UT_Matrix4 &matx) const
void setTransform4 (const UT_Matrix4 &matx)
void setVertex (GEO_Point *ppt)
void setVertexPoint (GA_Offset pt)
void assignVertex (GA_Offset new_vtx, bool update_topology)
virtual void stashed (int onoff, GA_Offset offset=GA_INVALID_OFFSET)
virtual void unitLengthToUnitPair (float ulength, float vlength, float &uparm, float &vparm) const
virtual void unitToUnitLengthPair (float uparm, float vparm, float &ulength, float &vlength) const
virtual bool isQuadric () const
virtual bool enlargeBoundingBox (UT_BoundingRect &b, const GA_Attribute *P) const
virtual bool enlargeBoundingBox (UT_BoundingBox &b, const GA_Attribute *P) const
virtual void enlargePointBounds (UT_BoundingBox &e) const

Protected Member Functions

 GEO_Quadric (const GA_MergeMap &map, GEO_Detail &detail, GA_Offset offset, const GEO_Quadric &src_prim)
virtual void getUnitBoundingBox (UT_BoundingBox &box) const =0
 Return a bounding box for the "unit" primitive (i.e. untransformed).
virtual void copyOffsetPrimitive (const GEO_Primitive *src, int basept)
virtual bool savePrivateH9 (ostream &os, bool binary) const
virtual bool loadPrivateH9 (UT_IStream &is)
virtual int isPointUsed (GA_GBPoint *pt) const
GA_Offset vertexPoint () const
virtual void swapVertexOffsets (const GA_Defragment &defrag)
 Defragmentation.
virtual bool evaluateBaryCenterRefMap (GA_Offset result_vertex, GA_AttributeRefMap &hlist) const
virtual int localIntrinsicTupleSize (const GA_IntrinsicEval &eval) const
virtual int localGetIntrinsicF (const GA_IntrinsicEval &eval, fpreal *val, GA_Size sz) const
virtual int localSetIntrinsicF (const GA_IntrinsicEval &eval, const fpreal *val, GA_Size sz)

Static Protected Member Functions

static GA_PrimitiveFamilyMask buildFamilyMask ()
 Return the family mask for all quadric sub-classes.
static
GA_IntrinsicManager::Registrar 
registerIntrinsics (GA_PrimitiveDefinition &defn)

Friends

ostream & operator<< (ostream &os, const GEO_Quadric &d)


Detailed Description

Definition at line 39 of file GEO_Quadric.h.


Constructor & Destructor Documentation

GEO_Quadric::GEO_Quadric ( GEO_Detail d,
GA_Offset  offset = GA_INVALID_OFFSET 
)

virtual GEO_Quadric::~GEO_Quadric (  )  [virtual]

GEO_Quadric::GEO_Quadric ( const GA_MergeMap map,
GEO_Detail detail,
GA_Offset  offset,
const GEO_Quadric src_prim 
) [protected]

Construct a quadric for merging. This will implement the copyUnwiredForMerge() to prevent the requirement for adding/deleting a vertex during the other constructor.


Member Function Documentation

virtual void GEO_Quadric::addPointRefToGroup ( GA_PointGroup grp  )  const [virtual]

Add all points referenced by the primitive to the given group. This defaults to iterating over the vertices and adding their referenced points.

Reimplemented from GEO_Primitive.

void GEO_Quadric::assignVertex ( GA_Offset  new_vtx,
bool  update_topology 
)

This method assigns a preallocated vertex to the quadric, optionally creating the topological link between the primitive and new vertex.

virtual UT_Vector3 GEO_Quadric::baryCenter (  )  const [virtual]

Return the center of the primitive. This defaults to the center of the bounding box. A better approximation might be the average value of the vertex positions (which could be different).

Reimplemented from GEO_Primitive.

Reimplemented in GEO_PrimCircle.

static GA_PrimitiveFamilyMask GEO_Quadric::buildFamilyMask (  )  [inline, static, protected]

Return the family mask for all quadric sub-classes.

Reimplemented in GEO_PrimCircle, GEO_PrimMetaBall, GEO_PrimMetaSQuad, GEO_PrimSphere, and GEO_PrimTube.

Definition at line 182 of file GEO_Quadric.h.

virtual UT_Vector3 GEO_Quadric::computeNormal (  )  const [virtual]

Return a normal vector for the primitive.

Implements GEO_Primitive.

Reimplemented in GEO_PrimCircle.

virtual GEO_Primitive* GEO_Quadric::copy ( int  preserve_shared_pts = 0  )  const [virtual]

Reimplemented from GEO_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

virtual void GEO_Quadric::copyOffsetPrimitive ( const GEO_Primitive src,
int  basept 
) [protected, virtual]

Implements GEO_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

virtual void GEO_Quadric::copyPrimitive ( const GEO_Primitive src,
GEO_Point **  ptredirect 
) [virtual]

Implements GEO_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

virtual void GEO_Quadric::copyUnwiredForMerge ( const GA_Primitive src,
const GA_MergeMap map 
) [virtual]

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

    map.mapDestFromSource( GA_ATTRIB_VERTEX, source_vertex );

See also:
GA_MergeMap

Implements GA_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

virtual GA_DereferenceStatus GEO_Quadric::dereferencePoint ( GA_Offset  point,
bool  dry_run = false 
) [virtual]

Before a point is deleted, all primitives using the point will be notified. The method should return "false" if it's impossible to delete the point. Otherwise, the vertices should be removed.

Implements GA_Primitive.

virtual GA_DereferenceStatus GEO_Quadric::dereferencePoints ( const GA_RangeMemberQuery pt_q,
bool  dry_run = false 
) [virtual]

Implements GA_Primitive.

virtual int GEO_Quadric::detachPoints ( GA_PointGroup grp  )  [virtual]

Implements GEO_Primitive.

virtual bool GEO_Quadric::enlargeBoundingBox ( UT_BoundingBox b,
const GA_Attribute P 
) const [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. For any attribute other than the position these methods simply enlarge the bounding box based on the vertex.

Reimplemented from GEO_Primitive.

virtual bool GEO_Quadric::enlargeBoundingBox ( UT_BoundingRect b,
const GA_Attribute P 
) const [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. For any attribute other than the position these methods simply enlarge the bounding box based on the vertex.

Reimplemented from GEO_Primitive.

virtual bool GEO_Quadric::enlargeBoundingSphere ( UT_BoundingSphere b,
const GA_Attribute P 
) const [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. For any attribute other than the position this method simply enlarges the sphere based on the vertex.

Reimplemented from GA_Primitive.

virtual void GEO_Quadric::enlargePointBounds ( UT_BoundingBox e  )  const [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. For any attribute other than the position these methods simply enlarge the bounding box based on the vertex.

Reimplemented from GA_Primitive.

virtual bool GEO_Quadric::evaluateBaryCenterRefMap ( GA_Offset  result,
GA_AttributeRefMap map 
) const [protected, virtual]

By default, this will call evaluateInteriorPointRefMap with u=.5 and v=.5. This is likely not the perfect solution. At the current time, this is only used in POPs to birth points at primitive centers.

Reimplemented from GEO_Primitive.

void GEO_Quadric::getAxes ( UT_Vector3 x,
UT_Vector3 y,
UT_Vector3 z 
) const

virtual int GEO_Quadric::getBBox ( UT_BoundingBox bbox  )  const [pure virtual]

Compute the bounding box of the primitive. Return 0 if unable to compute bounds (1 on successful computation)

Implements GEO_Primitive.

Implemented in GEO_PrimCircle, GEO_PrimSphere, and GEO_PrimTube.

const UT_Matrix3& GEO_Quadric::getTransform ( void   )  const [inline]

Definition at line 136 of file GEO_Quadric.h.

void GEO_Quadric::getTransform4 ( UT_Matrix4 matx  )  const

virtual void GEO_Quadric::getUnitBoundingBox ( UT_BoundingBox box  )  const [protected, pure virtual]

Return a bounding box for the "unit" primitive (i.e. untransformed).

Implemented in GEO_PrimCircle, GEO_PrimSphere, and GEO_PrimTube.

virtual GA_Size GEO_Quadric::getVertexCount (  )  const [virtual]

Return the number of vertices used by this primitive.

Implements GA_Primitive.

virtual GA_Offset GEO_Quadric::getVertexOffset ( GA_Size  index  )  const [virtual]

Given an vertex number (into the primitive's vertex list), return the vertex offset.

Implements GA_Primitive.

void GEO_Quadric::getXAxis ( UT_Vector3 x  )  const

void GEO_Quadric::getYAxis ( UT_Vector3 y  )  const

void GEO_Quadric::getZAxis ( UT_Vector3 z  )  const

virtual bool GEO_Quadric::isDegenerate (  )  const [virtual]

Is the primitive degenerate.

Implements GA_Primitive.

Reimplemented in GEO_PrimMetaBall, and GEO_PrimMetaSQuad.

virtual int GEO_Quadric::isPointUsed ( GA_GBPoint *  pt  )  const [protected, virtual]

virtual bool GEO_Quadric::isQuadric (  )  const [inline, virtual]

Reimplemented from GEO_Primitive.

Definition at line 170 of file GEO_Quadric.h.

virtual bool GEO_Quadric::loadH9 ( UT_IStream is,
const UT_RefArray< GA_AttribLoadDataH9 > &  prim_attribs,
const UT_RefArray< GA_AttribLoadDataH9 > &  vtx_attribs 
) [virtual]

Reimplemented from GA_Primitive.

virtual bool GEO_Quadric::loadPrivateH9 ( UT_IStream is  )  [protected, virtual]

virtual int GEO_Quadric::localGetIntrinsicF ( const GA_IntrinsicEval eval,
fpreal val,
GA_Size  sz 
) const [protected, virtual]

Intrinsic attribute interface

  • "float transform[16]" - Read/write 4x4 matrix

Reimplemented from GA_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

virtual int GEO_Quadric::localIntrinsicTupleSize ( const GA_IntrinsicEval eval  )  const [protected, virtual]

Intrinsic attribute interface

  • "float transform[16]" - Read/write 4x4 matrix

Reimplemented from GA_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

virtual int GEO_Quadric::localSetIntrinsicF ( const GA_IntrinsicEval eval,
const fpreal val,
GA_Size  sz 
) [protected, virtual]

Intrinsic attribute interface

  • "float transform[16]" - Read/write 4x4 matrix

Reimplemented from GA_Primitive.

Reimplemented in GEO_PrimMetaBall, GEO_PrimMetaSQuad, and GEO_PrimTube.

static GA_IntrinsicManager::Registrar GEO_Quadric::registerIntrinsics ( GA_PrimitiveDefinition defn  )  [static, protected]

All subclasses should call this method to register the quadric intrinsics.

See also:
GA_AttributeIntrinsic

Reimplemented from GEO_Primitive.

Reimplemented in GEO_PrimCircle, GEO_PrimMetaBall, GEO_PrimMetaSQuad, GEO_PrimSphere, and GEO_PrimTube.

virtual void GEO_Quadric::reverse ( void   )  [virtual]

Reverse the order of vertices.

Implements GEO_Primitive.

virtual bool GEO_Quadric::saveH9 ( ostream &  os,
bool  binary,
const UT_RefArray< GA_AttribSaveDataH9 > &  prim_attribs,
const UT_RefArray< GA_AttribSaveDataH9 > &  vtx_attribs 
) const [virtual]

Reimplemented from GA_Primitive.

virtual bool GEO_Quadric::savePrivateH9 ( ostream &  os,
bool  binary 
) const [protected, virtual]

void GEO_Quadric::setAxes ( const UT_Vector3 x,
const UT_Vector3 y,
const UT_Vector3 z 
)

void GEO_Quadric::setTransform ( const UT_Matrix3 m  )  [inline]

Definition at line 137 of file GEO_Quadric.h.

void GEO_Quadric::setTransform4 ( const UT_Matrix4 matx  ) 

void GEO_Quadric::setVertex ( GEO_Point ppt  )  [inline]

Definition at line 142 of file GEO_Quadric.h.

void GEO_Quadric::setVertexPoint ( GA_Offset  pt  )  [inline]

Definition at line 147 of file GEO_Quadric.h.

void GEO_Quadric::setXAxis ( const UT_Vector3 x  ) 

void GEO_Quadric::setYAxis ( const UT_Vector3 y  ) 

void GEO_Quadric::setZAxis ( const UT_Vector3 z  ) 

virtual void GEO_Quadric::stashed ( int  onoff,
GA_Offset  offset = GA_INVALID_OFFSET 
) [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 from GEO_Primitive.

Reimplemented in GEO_PrimMetaBall, and GEO_PrimMetaSQuad.

virtual void GEO_Quadric::swapVertexOffsets ( const GA_Defragment defrag  )  [protected, virtual]

Defragmentation.

Implements GA_Primitive.

virtual void GEO_Quadric::transform ( const UT_Matrix4 mat  )  [virtual]

Reimplemented from GEO_Primitive.

virtual void GEO_Quadric::unitLengthToUnitPair ( float  ulength,
float  vlength,
float &  uparm,
float &  vparm 
) const [virtual]

Reimplemented from GEO_Primitive.

virtual void GEO_Quadric::unitToUnitLengthPair ( float  uparm,
float  vparm,
float &  ulength,
float &  vlength 
) const [virtual]

Reimplemented from GEO_Primitive.

virtual void GEO_Quadric::untransform ( void   )  [virtual]

virtual int GEO_Quadric::vertexApply ( int(*)(const GEO_Vertex &, void *)  a,
void *   
) const [virtual]

virtual int GEO_Quadric::vertexApply ( int(*)(GEO_Vertex, void *)  a,
void *   
) [virtual]

GA_Offset GEO_Quadric::vertexPoint (  )  const [inline, protected]

Definition at line 211 of file GEO_Quadric.h.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const GEO_Quadric d 
) [friend]

Definition at line 224 of file GEO_Quadric.h.


The documentation for this class was generated from the following file:

Generated on Thu Jan 31 00:31:11 2013 for HDK by  doxygen 1.5.9