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

#include <GU_Cookie.h>

Public Member Functions

 GU_Cookie ()
 
virtual ~GU_Cookie ()
 
GU_DetailgetDetail () const
 
void setGroups (const GA_PrimitiveGroup *agrp, const GA_PrimitiveGroup *bgrp, GA_PointGroup *aptgrp, GA_PointGroup *bptgrp)
 
float getTolerance ()
 
void setTolerance (float tol)
 
void setAutoJoin (int aj)
 
void cookie (GU_Detail &gdp, int generatecrease, GA_PrimitiveGroup &aingrp, GA_PrimitiveGroup &aoutgrp, GA_PrimitiveGroup &aoverlapgrp, int aclosed, GA_PrimitiveGroup &bingrp, GA_PrimitiveGroup &boutgrp, GA_PrimitiveGroup &boverlapgrp, int bclosed, int insidetest)
 
void performIsect (int primIdA, int primIdB)
 
void buildTrimSegments (GEO_PrimPoly *dst, GEO_PrimPoly *src)
 
void buildTrimSegmentsCoplanar (GEO_PrimPoly *dst, GEO_PrimPoly *src, bool reverse)
 
void addPointToGroup (GA_Offset ptoff, GEO_PrimPoly *poly)
 
GA_Offset createEdgeVertex (GA_WorkVertexBuffer &vbuf, guTrimInfo *base, int edge, float t, int dir)
 The edge is poly(edge-1) to poly(edge). More...
 
GEO_PrimPolycreatePoly (guTrimInfo *base, const UT_Array< GA_Offset > &vtxes, bool closed, bool preserve_groups=true)
 
void punchHole (GEO_PrimPoly *base, GEO_PrimPoly *hole)
 
UT_IntArraybuildConnectivityGraph ()
 
void classifyPolygons (const GA_PrimitiveGroup &originalgrp, GA_PrimitiveGroup &ingrp, GA_PrimitiveGroup &outgrp, GA_PrimitiveGroup &overlapgrp, UT_IntArray *edges, const GA_PrimitiveGroup &othergrp, GU_RayIntersect *&inter, bool insidetest, bool inter_closed)
 

Protected Types

using EdgeTable = GA_EdgeMap< UT_UniquePtr< guEdgeHashEntry >>
 

Protected Attributes

GU_DetailmyGdp
 
UT_Array< guTrimInfo * > myTrimInfo
 
UT_UniquePtr< EdgeTablemyEdgeTable
 
GA_ElementWranglerCachemyWranglers
 
GA_PointGroupmyPtGrpA
 
GA_PointGroupmyPtGrpB
 
const GA_PrimitiveGroupmyGrpA
 
const GA_PrimitiveGroupmyGrpB
 
UT_Array< guIsectValmyIsects
 
int myAutoJoin
 
float myTol
 

Detailed Description

Definition at line 45 of file GU_Cookie.h.

Member Typedef Documentation

using GU_Cookie::EdgeTable = GA_EdgeMap<UT_UniquePtr<guEdgeHashEntry>>
protected

Definition at line 145 of file GU_Cookie.h.

Constructor & Destructor Documentation

GU_Cookie::GU_Cookie ( )
virtual GU_Cookie::~GU_Cookie ( )
virtual

Member Function Documentation

void GU_Cookie::addPointToGroup ( GA_Offset  ptoff,
GEO_PrimPoly poly 
)
UT_IntArray* GU_Cookie::buildConnectivityGraph ( )
void GU_Cookie::buildTrimSegments ( GEO_PrimPoly dst,
GEO_PrimPoly src 
)

This adds all the isects of the second polygon into the trim list of the first:

void GU_Cookie::buildTrimSegmentsCoplanar ( GEO_PrimPoly dst,
GEO_PrimPoly src,
bool  reverse 
)
void GU_Cookie::classifyPolygons ( const GA_PrimitiveGroup originalgrp,
GA_PrimitiveGroup ingrp,
GA_PrimitiveGroup outgrp,
GA_PrimitiveGroup overlapgrp,
UT_IntArray edges,
const GA_PrimitiveGroup othergrp,
GU_RayIntersect *&  inter,
bool  insidetest,
bool  inter_closed 
)
void GU_Cookie::cookie ( GU_Detail gdp,
int  generatecrease,
GA_PrimitiveGroup aingrp,
GA_PrimitiveGroup aoutgrp,
GA_PrimitiveGroup aoverlapgrp,
int  aclosed,
GA_PrimitiveGroup bingrp,
GA_PrimitiveGroup boutgrp,
GA_PrimitiveGroup boverlapgrp,
int  bclosed,
int  insidetest 
)

Invoke the cookie operation.

The group of polygons to cookie must be setup with the setGroups function.

The [a|b][in|out|overlap]grps are the primitive groups to classify each clipped polygon piece into.

If a set of connected polygons doesn't intersect, and the insidetest is enabled, the insidedness of the polygons will be determined by sending a ray with the winding rule.

If generatecrease is set, instead of clipping the polygons, the line segments generated by poly-poly intersection will be generated.

GA_Offset GU_Cookie::createEdgeVertex ( GA_WorkVertexBuffer vbuf,
guTrimInfo *  base,
int  edge,
float  t,
int  dir 
)

The edge is poly(edge-1) to poly(edge).

GEO_PrimPoly* GU_Cookie::createPoly ( guTrimInfo *  base,
const UT_Array< GA_Offset > &  vtxes,
bool  closed,
bool  preserve_groups = true 
)
GU_Detail* GU_Cookie::getDetail ( ) const
inline

Definition at line 51 of file GU_Cookie.h.

float GU_Cookie::getTolerance ( )
inline

Definition at line 63 of file GU_Cookie.h.

void GU_Cookie::performIsect ( int  primIdA,
int  primIdB 
)

The call back from intersection tests: The two indices are the primitive numbers to intersect.

void GU_Cookie::punchHole ( GEO_PrimPoly base,
GEO_PrimPoly hole 
)

Punches a hole in the polygon base with the polygon hole. The appropriate bridges are formed.

void GU_Cookie::setAutoJoin ( int  aj)
inline

Definition at line 65 of file GU_Cookie.h.

void GU_Cookie::setGroups ( const GA_PrimitiveGroup agrp,
const GA_PrimitiveGroup bgrp,
GA_PointGroup aptgrp,
GA_PointGroup bptgrp 
)
inline

Definition at line 53 of file GU_Cookie.h.

void GU_Cookie::setTolerance ( float  tol)
inline

Definition at line 64 of file GU_Cookie.h.

Member Data Documentation

int GU_Cookie::myAutoJoin
protected

Definition at line 160 of file GU_Cookie.h.

UT_UniquePtr<EdgeTable> GU_Cookie::myEdgeTable
protected

Definition at line 146 of file GU_Cookie.h.

GU_Detail* GU_Cookie::myGdp
protected

Definition at line 142 of file GU_Cookie.h.

const GA_PrimitiveGroup* GU_Cookie::myGrpA
protected

Definition at line 154 of file GU_Cookie.h.

const GA_PrimitiveGroup * GU_Cookie::myGrpB
protected

Definition at line 154 of file GU_Cookie.h.

UT_Array<guIsectVal> GU_Cookie::myIsects
protected

Definition at line 159 of file GU_Cookie.h.

GA_PointGroup* GU_Cookie::myPtGrpA
protected

Definition at line 153 of file GU_Cookie.h.

GA_PointGroup * GU_Cookie::myPtGrpB
protected

Definition at line 153 of file GU_Cookie.h.

float GU_Cookie::myTol
protected

Definition at line 161 of file GU_Cookie.h.

UT_Array<guTrimInfo *> GU_Cookie::myTrimInfo
protected

Definition at line 143 of file GU_Cookie.h.

GA_ElementWranglerCache* GU_Cookie::myWranglers
protected

Definition at line 148 of file GU_Cookie.h.


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