HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GQ_Detail Class Reference

#include <GQ_Detail.h>

+ Inheritance diagram for GQ_Detail:

Public Member Functions

 GQ_Detail (GU_Detail *gdp, GA_PrimitiveGroup *=0, fpreal super_point_tolerance=1E-6)
 
 ~GQ_Detail ()
 
void clearAndDestroy ()
 
void cusp (fpreal angle, bool no_cut=false)
 Cusp polygons which have adjacent edges larger than angle (in degrees) More...
 
void cusp (const GA_EdgeGroup &edges, bool do_cut=false)
 Cusp edges in a group. More...
 
void clip (UT_Vector3 &norm, fpreal distance, int normalize)
 
int crease (UT_Vector3 &norm, fpreal distance, int normalize, int outputGroups, GA_PrimitiveGroup *primitive_above=0, GA_PrimitiveGroup *primitive_below=0)
 
void bricker (fpreal sizex=1.0, fpreal sizey=1.0, fpreal sizez=1.0, fpreal offx=0.0, fpreal offy=0.0, fpreal offz=0.0, fpreal anglex=0.0, fpreal angley=0.0, fpreal anglez=0.0, bool fixsharededges=false)
 } More...
 
void smooth (int divisions, fpreal relativeSize, fpreal weight)
 
void createEdgeWeights ()
 
void setCreaseWeight (const GEO_PrimPoly &poly, fpreal weight)
 
void setCreaseWeight (const GEO_PrimPoly &poly, GA_ROHandleF vtxattrib, GA_ROHandleF primattrib)
 
void setCreaseWeight (const GA_Edge &edge, const GU_Detail &edge_gdp, fpreal weight)
 
void setCreaseWeight (const GA_Edge &gedge, const GA_Primitive &prim, GA_ROHandleF vtxattrib, GA_ROHandleF primattrib)
 
fpreal getEdgeWeight (const GA_Edge &edge)
 
fpreal getEdgeWeight (exint edge_index) const
 
bool setEdgeWeight (exint edge_index, fpreal weight)
 
void subdivide (const GQ_SubdivideParms &parms, GA_PrimitiveGroup *nonsubdivprims)
 
void dual (const char *attribs_to_swap=NULL)
 
void stitch (const GQ_StitchParms &parms)
 
int stitchEdges (GEO_PrimPoly &polya, const UT_Array< GEO_PrimPoly * > &facea, GEO_PrimPoly &polyb, const UT_Array< GEO_PrimPoly * > &faceb, GA_PrimitiveGroup &changedpolys, fpreal tol, int clamp, int consolidate)
 
void makeWire (fpreal radius, const GA_Attribute *radscale, bool dospheres, bool docaps)
 
void buildGeometry (GA_PrimitiveGroup *output=NULL)
 
void buildCreases (GA_PrimitiveGroup *group=0)
 
void copyEdgeWeightToVertex ()
 
void unHole (int maintain)
 
void boundary ()
 
void createCuspGroup (GA_Group *group, bool doMinAngle, fpreal minAngle, bool doMaxAngle, fpreal maxAngle)
 
void createBoundaryGroup (GA_Group *grp)
 
void createBoundaryGroup (GA_PointGroup &grp, UT_IntArray *arr)
 
void createBoundaryGroup (GA_Offset ppt, GA_PointGroup &pointgroup)
 
void createBoundaryGroup (const GA_Edge &edge, GA_PointGroup &grp, GEO_PrimPoly *&poly)
 
void createBoundaryList (UT_Array< UT_IntArray > &ptlist)
 
void groupEdgePoints (GA_Offset ptoff, int depth, GA_PointGroup &point_group)
 
int isClose ()
 
void deleteAllShareEdges ()
 
GQ_Point * appendPoint (const GQ_Point *src=0)
 
GQ_Edge * appendEdge ()
 
GQ_Face * appendFace (GEO_PrimPoly *poly)
 
void removePoint (GQ_Point *p)
 
void removePoint (int i)
 
void removeEdge (GQ_Edge *e)
 
void removeEdge (int i)
 
bool removeFace (GQ_Face *f)
 
void removeFace (int i)
 
void collapseEdgeList ()
 
void collapseFaceList ()
 
UT_Array< GQ_Point * > & getPointList ()
 
const UT_Array< GQ_Point * > & getPointList () const
 
UT_ValArray< GQ_Edge * > & getEdgeList ()
 
const UT_ValArray< GQ_Edge * > & getEdgeList () const
 
UT_DoubleArray & getEdgeWeights ()
 
const UT_DoubleArray & getEdgeWeights () const
 
UT_Array< GQ_Point * > & getEdgePoints ()
 
const UT_Array< GQ_Point * > & getEdgePoints () const
 
UT_ValArray< GQ_Face * > & getFaceList ()
 
const UT_ValArray< GQ_Face * > & getFaceList () const
 
GU_Detail * getGdp ()
 
const GU_Detail * getGdp () const
 
GU_RayIntersect * getRay ()
 
void buildRay ()
 
UT_Array< GA_RWAttributeRef > & getOffsets ()
 
GQ_Point * splitEdge (GQ_Edge *edge, fpreal t)
 Split edge will return 0 if t is too close to 0 or 1. More...
 
GQ_Edge * splitEdge (GQ_Edge *, GQ_Point &pt)
 
void deleteShareEdge (GQ_Edge *edge, GA_PrimitiveGroup *deletePrimGroup=0)
 
void wireEdge (GQ_Edge *edge, fpreal radius, const GA_ROHandleF &radscale_h, bool doCaps)
 
void pointSphere (GQ_Point *pt, fpreal radius, const GA_ROHandleF &radscale_h)
 
int nEdges () const
 
int nFaces () const
 
int nPoints () const
 
GU_Detail * getDetail () const
 
int aboveOrBelow (GQ_Face *face)
 
void simpleDecimate (int targetPolys)
 
void decCollapse (GQ_Edge *e, GA_PrimitiveGroup *)
 
void decSplit (GQ_Edge *e)
 
void decSwap (GQ_Edge *e)
 
void save (std::ostream &os) const
 
GQ_Edge * findEdge (const GA_Edge *edge, const GU_Detail *edge_gdp)
 
GQ_Edge * findEdge (const GA_Edge *edge)
 
GQ_Edge * findEdge (const GQ_Point *org, const GQ_Point *dest)
 
GA_Offset stepForwardOffset (const GA_Edge *edge)
 
GA_Offset pickArbitraryConnectedPointOffset (GA_Offset org)
 
GA_Offset rotateAboutOriginOffset (GA_Edge &edge, int dir)
 
GEO_PrimPoly * adjacentFace (const GEO_Face &face, int edge)
 

Friends

std::ostream & operator<< (std::ostream &os, const GQ_Detail &d)
 

Detailed Description

Quad Edge data structure for topological manipulation of polygonal data.

The Quad Edge data structure was invented by Guibas & Stolfi in their 1985 paper, "Primitives for the Manipulation of General Subdivisions and the Computation of Voronoi Diagrams", ACM Transactions on Graphics, 4(2):74-123, April 1985.

That paper has a good description of the capabilities of the data structure, and the definition of its basic operators, makeedge and splice().

Definition at line 70 of file GQ_Detail.h.

Constructor & Destructor Documentation

GQ_Detail::GQ_Detail ( GU_Detail *  gdp,
GA_PrimitiveGroup *  = 0,
fpreal  super_point_tolerance = 1E-6 
)

The super_point_tolerance should probably be set to -1 which flags for no super points to be generated. Super points often cause confusing (for the caller) results.

GQ_Detail::~GQ_Detail ( )

Member Function Documentation

int GQ_Detail::aboveOrBelow ( GQ_Face *  face)
GEO_PrimPoly* GQ_Detail::adjacentFace ( const GEO_Face &  face,
int  edge 
)
GQ_Edge* GQ_Detail::appendEdge ( )
inline

Definition at line 202 of file GQ_Detail.h.

GQ_Face* GQ_Detail::appendFace ( GEO_PrimPoly *  poly)
GQ_Point* GQ_Detail::appendPoint ( const GQ_Point *  src = 0)
void GQ_Detail::boundary ( )
void GQ_Detail::bricker ( fpreal  sizex = 1.0,
fpreal  sizey = 1.0,
fpreal  sizez = 1.0,
fpreal  offx = 0.0,
fpreal  offy = 0.0,
fpreal  offz = 0.0,
fpreal  anglex = 0.0,
fpreal  angley = 0.0,
fpreal  anglez = 0.0,
bool  fixsharededges = false 
)

}

void GQ_Detail::buildCreases ( GA_PrimitiveGroup *  group = 0)
void GQ_Detail::buildGeometry ( GA_PrimitiveGroup *  output = NULL)
void GQ_Detail::buildRay ( )
inline

Definition at line 238 of file GQ_Detail.h.

void GQ_Detail::clearAndDestroy ( )
void GQ_Detail::clip ( UT_Vector3 &  norm,
fpreal  distance,
int  normalize 
)

Both clip() and crease() will invalidate this GQ_Detail. If you wish to do another GQ_Detail operation, create a new GQ_Detail. 'norm' and 'distance' define a plane with 'distance' being measured from the origin. {

void GQ_Detail::collapseEdgeList ( )
inline

Definition at line 222 of file GQ_Detail.h.

void GQ_Detail::collapseFaceList ( )
inline

Definition at line 223 of file GQ_Detail.h.

void GQ_Detail::copyEdgeWeightToVertex ( )
int GQ_Detail::crease ( UT_Vector3 &  norm,
fpreal  distance,
int  normalize,
int  outputGroups,
GA_PrimitiveGroup *  primitive_above = 0,
GA_PrimitiveGroup *  primitive_below = 0 
)
void GQ_Detail::createBoundaryGroup ( GA_Group *  grp)
void GQ_Detail::createBoundaryGroup ( GA_PointGroup &  grp,
UT_IntArray *  arr 
)
void GQ_Detail::createBoundaryGroup ( GA_Offset  ppt,
GA_PointGroup &  pointgroup 
)
void GQ_Detail::createBoundaryGroup ( const GA_Edge &  edge,
GA_PointGroup &  grp,
GEO_PrimPoly *&  poly 
)
void GQ_Detail::createBoundaryList ( UT_Array< UT_IntArray > &  ptlist)

For each boundary loop a separate UT_IntArray is added to the ptlist. These intarrays will contain the point numbers, in order, of the points that belong to those boundaries. This is preferable to the group based approach becausae it can handle duplicate points that show up on the boundary of certain degenerate geometry..

void GQ_Detail::createCuspGroup ( GA_Group *  group,
bool  doMinAngle,
fpreal  minAngle,
bool  doMaxAngle,
fpreal  maxAngle 
)
void GQ_Detail::createEdgeWeights ( )
void GQ_Detail::cusp ( fpreal  angle,
bool  no_cut = false 
)

Cusp polygons which have adjacent edges larger than angle (in degrees)

void GQ_Detail::cusp ( const GA_EdgeGroup &  edges,
bool  do_cut = false 
)

Cusp edges in a group.

void GQ_Detail::decCollapse ( GQ_Edge *  e,
GA_PrimitiveGroup *   
)
void GQ_Detail::decSplit ( GQ_Edge *  e)
void GQ_Detail::decSwap ( GQ_Edge *  e)
void GQ_Detail::deleteAllShareEdges ( )
void GQ_Detail::deleteShareEdge ( GQ_Edge *  edge,
GA_PrimitiveGroup *  deletePrimGroup = 0 
)
void GQ_Detail::dual ( const char *  attribs_to_swap = NULL)
GQ_Edge* GQ_Detail::findEdge ( const GA_Edge *  edge,
const GU_Detail *  edge_gdp 
)

Given a GA_Edge, return the equivalent GQ_Edge. Relatively efficient: O(degree(org)), not O(nedges)

GQ_Edge* GQ_Detail::findEdge ( const GA_Edge *  edge)
inline

Definition at line 282 of file GQ_Detail.h.

GQ_Edge* GQ_Detail::findEdge ( const GQ_Point *  org,
const GQ_Point *  dest 
)
GU_Detail* GQ_Detail::getDetail ( ) const
inline

Definition at line 263 of file GQ_Detail.h.

UT_ValArray<GQ_Edge *>& GQ_Detail::getEdgeList ( )
inline

Definition at line 226 of file GQ_Detail.h.

const UT_ValArray<GQ_Edge *>& GQ_Detail::getEdgeList ( ) const
inline

Definition at line 227 of file GQ_Detail.h.

UT_Array<GQ_Point *>& GQ_Detail::getEdgePoints ( )
inline

Definition at line 230 of file GQ_Detail.h.

const UT_Array<GQ_Point*>& GQ_Detail::getEdgePoints ( ) const
inline

Definition at line 231 of file GQ_Detail.h.

fpreal GQ_Detail::getEdgeWeight ( const GA_Edge &  edge)
fpreal GQ_Detail::getEdgeWeight ( exint  edge_index) const
UT_DoubleArray& GQ_Detail::getEdgeWeights ( )
inline

Definition at line 228 of file GQ_Detail.h.

const UT_DoubleArray& GQ_Detail::getEdgeWeights ( ) const
inline

Definition at line 229 of file GQ_Detail.h.

UT_ValArray<GQ_Face *>& GQ_Detail::getFaceList ( )
inline

Definition at line 233 of file GQ_Detail.h.

const UT_ValArray<GQ_Face *>& GQ_Detail::getFaceList ( ) const
inline

Definition at line 234 of file GQ_Detail.h.

GU_Detail* GQ_Detail::getGdp ( )
inline

Definition at line 235 of file GQ_Detail.h.

const GU_Detail* GQ_Detail::getGdp ( ) const
inline

Definition at line 236 of file GQ_Detail.h.

UT_Array<GA_RWAttributeRef>& GQ_Detail::getOffsets ( )
inline

Definition at line 243 of file GQ_Detail.h.

UT_Array<GQ_Point *>& GQ_Detail::getPointList ( )
inline

Definition at line 224 of file GQ_Detail.h.

const UT_Array<GQ_Point *>& GQ_Detail::getPointList ( ) const
inline

Definition at line 225 of file GQ_Detail.h.

GU_RayIntersect* GQ_Detail::getRay ( )
inline

Definition at line 237 of file GQ_Detail.h.

void GQ_Detail::groupEdgePoints ( GA_Offset  ptoff,
int  depth,
GA_PointGroup &  point_group 
)
int GQ_Detail::isClose ( )
void GQ_Detail::makeWire ( fpreal  radius,
const GA_Attribute *  radscale,
bool  dospheres,
bool  docaps 
)
int GQ_Detail::nEdges ( ) const
inline

Definition at line 260 of file GQ_Detail.h.

int GQ_Detail::nFaces ( ) const
inline

Definition at line 261 of file GQ_Detail.h.

int GQ_Detail::nPoints ( ) const
inline

Definition at line 262 of file GQ_Detail.h.

GA_Offset GQ_Detail::pickArbitraryConnectedPointOffset ( GA_Offset  org)
void GQ_Detail::pointSphere ( GQ_Point *  pt,
fpreal  radius,
const GA_ROHandleF &  radscale_h 
)
void GQ_Detail::removeEdge ( GQ_Edge *  e)
void GQ_Detail::removeEdge ( int  i)
bool GQ_Detail::removeFace ( GQ_Face *  f)
void GQ_Detail::removeFace ( int  i)
void GQ_Detail::removePoint ( GQ_Point *  p)
void GQ_Detail::removePoint ( int  i)
GA_Offset GQ_Detail::rotateAboutOriginOffset ( GA_Edge &  edge,
int  dir 
)
void GQ_Detail::save ( std::ostream &  os) const
void GQ_Detail::setCreaseWeight ( const GEO_PrimPoly &  poly,
fpreal  weight 
)
void GQ_Detail::setCreaseWeight ( const GEO_PrimPoly &  poly,
GA_ROHandleF  vtxattrib,
GA_ROHandleF  primattrib 
)
void GQ_Detail::setCreaseWeight ( const GA_Edge &  edge,
const GU_Detail &  edge_gdp,
fpreal  weight 
)
void GQ_Detail::setCreaseWeight ( const GA_Edge &  gedge,
const GA_Primitive &  prim,
GA_ROHandleF  vtxattrib,
GA_ROHandleF  primattrib 
)
bool GQ_Detail::setEdgeWeight ( exint  edge_index,
fpreal  weight 
)
void GQ_Detail::simpleDecimate ( int  targetPolys)
void GQ_Detail::smooth ( int  divisions,
fpreal  relativeSize,
fpreal  weight 
)
GQ_Point* GQ_Detail::splitEdge ( GQ_Edge *  edge,
fpreal  t 
)

Split edge will return 0 if t is too close to 0 or 1.

GQ_Edge* GQ_Detail::splitEdge ( GQ_Edge *  ,
GQ_Point &  pt 
)
GA_Offset GQ_Detail::stepForwardOffset ( const GA_Edge *  edge)
void GQ_Detail::stitch ( const GQ_StitchParms &  parms)
int GQ_Detail::stitchEdges ( GEO_PrimPoly &  polya,
const UT_Array< GEO_PrimPoly * > &  facea,
GEO_PrimPoly &  polyb,
const UT_Array< GEO_PrimPoly * > &  faceb,
GA_PrimitiveGroup &  changedpolys,
fpreal  tol,
int  clamp,
int  consolidate 
)
void GQ_Detail::subdivide ( const GQ_SubdivideParms &  parms,
GA_PrimitiveGroup *  nonsubdivprims 
)
void GQ_Detail::unHole ( int  maintain)
void GQ_Detail::wireEdge ( GQ_Edge *  edge,
fpreal  radius,
const GA_ROHandleF &  radscale_h,
bool  doCaps 
)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const GQ_Detail &  d 
)
friend

Definition at line 275 of file GQ_Detail.h.


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