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

#include <GEO_PolyInterface.h>

Classes

struct  HedgeFilter
 
struct  PolyCirculator
 
struct  PolyFilter
 
struct  PrimaryHedgeFilter
 

Public Types

typedef FilteredRange
< PolyFilter, GA_Offset
PolyRange
 
typedef FilteredRange
< HedgeFilter, GEO_Hedge
HedgeRange
 
typedef FilteredRange
< PrimaryHedgeFilter,
GEO_Hedge
PrimaryHedgeRange
 
typedef Cycle< PolyCirculator,
GEO_Hedge
PolyCycle
 

Public Member Functions

 GEO_PolyInterface (GA_Detail *gdp, const GA_PrimitiveGroup *polys=nullptr)
 
 ~GEO_PolyInterface ()
 
void hardenPolys ()
 
GA_Offset copyPolys (GA_Detail *gdp, GA_Attribute *pt_offset_map_attr=nullptr, const GA_PrimitiveGroup *grp=nullptr, bool copy_excluded=false)
 
void wranglePointAttribute (GA_Attribute *attrib)
 
void wranglePointAttribute (const GA_AttributeFilter &filter)
 
void wrangleVertexAttribute (GA_Attribute *attrib)
 
void wrangleVertexAttribute (const GA_AttributeFilter &filter)
 
void wranglePrimitiveAttribute (GA_Attribute *attrib)
 
void wranglePrimitiveAttribute (const GA_AttributeFilter &filter)
 
void resetPointWrangling ()
 Clear the list of wrangled point/vertex/primitive attributes. More...
 
void resetVertexWrangling ()
 
void resetPrimitiveWrangling ()
 
void enablePointWrangling (bool enable)
 
void enableVertexWrangling (bool enable)
 
void enablePrimitiveWrangling (bool enable)
 
SYS_FORCE_INLINE GA_PrimitivehedgePrimitive (GEO_Hedge h) const
 Return the polygon to which the hedge belongs. More...
 
GA_Offset hedgePoly (GEO_Hedge h) const
 
GEO_Hedge polyHedge (GA_Offset poly) const
 
SYS_FORCE_INLINE bool isValidHedgeSrcVertex (GA_Offset vtx) const
 
SYS_FORCE_INLINE bool isValidHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE bool isValid (GEO_Hedge h) const
 
SYS_FORCE_INLINE bool isPrimary (GEO_Hedge h) const
 
SYS_FORCE_INLINE GA_Offset srcVertex (GEO_Hedge h) const
 Returns the source vertex of the hedge. More...
 
SYS_FORCE_INLINE GA_Offset dstVertex (GEO_Hedge h) const
 Returns the destination vertex of the hedge. More...
 
SYS_FORCE_INLINE GA_Offset preSrcVertex (GEO_Hedge h) const
 Returns the vertex preceding the source of the hedge in its polygon. More...
 
SYS_FORCE_INLINE GA_Offset postDstVertex (GEO_Hedge h) const
 Returns the vertex succeeding the destination of the hedge. More...
 
SYS_FORCE_INLINE GA_Offset srcPoint (GEO_Hedge h) const
 Returns the point to which the source vertex is wired. More...
 
SYS_FORCE_INLINE GA_Offset dstPoint (GEO_Hedge h) const
 Returns the point to which the destination vertex is wired. More...
 
SYS_FORCE_INLINE GA_Offset preSrcPoint (GEO_Hedge h) const
 
SYS_FORCE_INLINE GA_Offset postDstPoint (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge nextPrimitiveHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge lnext (GEO_Hedge h) const
 Quad-Edge/GQ alias for nextPrimitiveHedge(). More...
 
SYS_FORCE_INLINE GEO_Hedge prevPrimitiveHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge lprev (GEO_Hedge h) const
 Quad-Edge/GQ alias for prevPrimitiveHedge(). More...
 
SYS_FORCE_INLINE GEO_Hedge otherPrimitiveHedgeAtPoint (GEO_Hedge h, GA_Offset pt) const
 Returns the hedge other than the parameter hedge in its polygon that. More...
 
SYS_FORCE_INLINE GEO_Hedge nextEquivalentHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge sym (GEO_Hedge h) const
 Quad-Edge/GQ alias for nextEquivalentHedge(). More...
 
SYS_FORCE_INLINE GEO_Hedge primaryEquivalentHedge (GEO_Hedge h) const
 Returns the primary hedge equivalent to the argument hedge. More...
 
SYS_FORCE_INLINE GEO_Hedge primary (GEO_Hedge h) const
 Alias for primaryEquivalentHedge(). More...
 
SYS_FORCE_INLINE GEO_Hedge firstIncidentHedge (GA_Offset p) const
 
SYS_FORCE_INLINE GEO_Hedge nextIncidentHedge (GEO_Hedge h, GA_Offset p) const
 
SYS_FORCE_INLINE GEO_Hedge firstIncidentEdge (GA_Offset p) const
 
SYS_FORCE_INLINE GEO_Hedge nextIncidentEdge (GEO_Hedge h, GA_Offset p) const
 
SYS_FORCE_INLINE GEO_Hedge firstOutgoingHedge (GA_Offset p) const
 
SYS_FORCE_INLINE GEO_Hedge nextOutgoingHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge firstIncomingHedge (GA_Offset p) const
 
SYS_FORCE_INLINE GEO_Hedge nextIncomingHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge firstManifoldIncomingHedge (GEO_Hedge h) const
 Manifold Scan Methods: More...
 
SYS_FORCE_INLINE GEO_Hedge dfirst (GEO_Hedge h) const
 Quad-Edge/GQ alias: More...
 
SYS_FORCE_INLINE GEO_Hedge prevManifoldIncomingHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge dprev (GEO_Hedge h) const
 Quad-Edge/GQ alias: More...
 
SYS_FORCE_INLINE GEO_Hedge nextManifoldIncomingHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge dnext (GEO_Hedge h) const
 Quad-Edge/GQ alias: More...
 
SYS_FORCE_INLINE GEO_Hedge firstManifoldOutgoingHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge ofirst (GEO_Hedge h) const
 Quad-Edge/GQ alias: More...
 
SYS_FORCE_INLINE GEO_Hedge prevManifoldOutgoingHedge (GEO_Hedge h) const
 Returns the previous hedge with the same src as h in a counterclockwise. More...
 
SYS_FORCE_INLINE GEO_Hedge oprev (GEO_Hedge h) const
 Alias for prevManifoldOutgoingHedge, equivalent to lnext(sym()). More...
 
SYS_FORCE_INLINE GEO_Hedge nextManifoldOutgoingHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE GEO_Hedge onext (GEO_Hedge h) const
 Alias for nextManifoldOutgoingHedge, equivalent to sym(lprev()). More...
 
SYS_FORCE_INLINE bool isManifoldHedge (GEO_Hedge h, bool accept_bd=false) const
 
SYS_FORCE_INLINE bool isBoundaryHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE bool isBridgeHedge (GEO_Hedge h) const
 
SYS_FORCE_INLINE bool areOpposite (GEO_Hedge h1, GEO_Hedge h2) const
 
SYS_FORCE_INLINE bool areEquivalent (GEO_Hedge h1, GEO_Hedge h2) const
 Returns true if h1 and h2 are equivalent hedges. More...
 
SYS_FORCE_INLINE GA_Size numEquivalentHedges (GEO_Hedge h) const
 Returns the number of hedges in the equivalence class of h. More...
 
SYS_FORCE_INLINE GA_Size numIncidentEdges (GA_Offset pt) const
 
SYS_FORCE_INLINE GA_Size numIncidentHedges (GA_Offset pt) const
 Returns the number of distinct hedges incident to pt. More...
 
SYS_FORCE_INLINE GEO_Hedge findHedgeWithEndpoints (GA_Offset p0, GA_Offset p1) const
 Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE. More...
 
GEO_Hedge rotateForward (GEO_Hedge h)
 
GEO_Hedge rotateBackward (GEO_Hedge h)
 
bool isFlippable (GEO_Hedge h) const
 
GEO_Hedge flip (GEO_Hedge h)
 
GEO_Hedge unflip (GEO_Hedge h)
 
bool isContractible (GEO_Hedge h) const
 multiple components. More...
 
GA_Offset contract (GEO_Hedge h, bool on_dst=true, fpreal ratio=-1.0, bool check_contractible=true, bool internal=true, bool destroy_released_point=true)
 
GEO_Hedge split (GEO_Hedge h, fpreal ratio, bool and_equivalent=true, GA_Offset pt=GA_INVALID_OFFSET)
 
GEO_Hedge divide (GEO_Hedge h, fpreal ratio, bool and_equivalent=true, GA_Offset pt=GA_INVALID_OFFSET)
 
GEO_Hedge divide (GA_Offset poly, GEO_Hedge h_keep, GEO_Hedge h_drop)
 
GA_Offset split (GA_Offset poly, GA_Offset pt=GA_INVALID_OFFSET)
 
template<typename T = fpreal32>
exint triangulate (GA_Offset poly, UT_Vector3T< T > *sym_ctr=nullptr, GA_ROHandleT< UT_Vector3T< T > > pos_handle=GA_ROHandleT< UT_Vector3T< T > >(), GEO_Hedge start_hedge=GEO_INVALID_HEDGE, UT_Array< UT_Vector3T< T > > *pos3=nullptr, UT_Array< UT_Vector2T< T > > *pos2=nullptr, UT_Triangulate::WorkBuffer *wb=nullptr, UT_IntArray *tris=nullptr)
 Triangualtes a polygon. More...
 
template<typename S , typename T = fpreal32>
exint triangulate (const S &&polys, UT_Vector3T< T > *sym_ctr=nullptr, GA_ROHandleT< UT_Vector3T< T > > pos_handle=GA_ROHandleT< UT_Vector3T< T > >())
 
void deletePointStar (GA_Offset pt, bool cap_hole=true, GA_Offset cap_poly=GA_INVALID_OFFSET, bool destroy_pt=true)
 
bool dissolve (GEO_Hedge h)
 
void wireVertexPoint (GA_Offset vtx, GA_Offset pt, bool rewire_hedges=true)
 
GA_Offset appendPoly ()
 
SYS_FORCE_INLINE bool isValidPoly (GA_Offset poly) const
 
void destroyPoly (GA_Offset poly, bool and_pts=false)
 
GA_Offset appendVertex (GA_Offset poly, GA_Offset pt, bool relink_hedges=true)
 
GA_Offset insertVertex (GA_Offset poly, GA_Offset pt, GA_Offset before=GA_INVALID_OFFSET, bool relink_hedges=true)
 
GA_Offset stealVertex (GA_Offset poly, GA_Offset vtx, GA_Offset insert_before=GA_INVALID_OFFSET, bool relink_hedges=true)
 
int deleteVertex (GA_Offset vtx, bool relink_hedges=true)
 
int vertexCount (GA_Offset poly) const
 
GA_DetailgetDetail () const
 
bool softValidate () const
 
bool validate () const
 
SYS_FORCE_INLINE GA_Offset prevPrimVertex (GA_Offset v) const
 
SYS_FORCE_INLINE GA_Offset nextPrimVertex (GA_Offset v) const
 
SYS_FORCE_INLINE void getAdjacentPrimVertices (GA_Offset v, GA_Offset &vprev, GA_Offset &vnext) const
 
void dumpHedge (GA_Offset vtx)
 
void dumpHedge (GEO_Hedge h)
 
SYS_FORCE_INLINE GA_Offset polyFirst (GA_Offset poly) const
 
SYS_FORCE_INLINE GA_Offset polyNext (GA_Offset v) const
 
SYS_FORCE_INLINE GA_Offset polyPrev (GA_Offset v) const
 
UT_Vector3 calcBarycenter (GA_Offset poly) const
 
PolyRange polys (const GA_PrimitiveGroup *g=nullptr, bool complement=false) const
 
HedgeRange hedges (const GA_VertexGroup *g=nullptr) const
 
PrimaryHedgeRange primaryHedges (const GA_VertexGroup *g=nullptr) const
 
PolyCycle polyHedges (GA_Offset poly) const
 Returns the hedges around a polygon as a PolyCycle. More...
 

Detailed Description

Definition at line 161 of file GEO_PolyInterface.h.

Member Typedef Documentation

Constructor & Destructor Documentation

GEO_PolyInterface::GEO_PolyInterface ( GA_Detail gdp,
const GA_PrimitiveGroup polys = nullptr 
)
GEO_PolyInterface::~GEO_PolyInterface ( )

Member Function Documentation

GA_Offset GEO_PolyInterface::appendPoly ( )

Basic polygon manipulation methods. You should use these instead of those offered by GEO_PrimPoly while dealing with softened polys.

GA_Offset GEO_PolyInterface::appendVertex ( GA_Offset  poly,
GA_Offset  pt,
bool  relink_hedges = true 
)
SYS_FORCE_INLINE bool GEO_PolyInterface::areEquivalent ( GEO_Hedge  h1,
GEO_Hedge  h2 
) const
inline

Returns true if h1 and h2 are equivalent hedges.

Definition at line 533 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::areOpposite ( GEO_Hedge  h1,
GEO_Hedge  h2 
) const
inline

Returns true if h1 and h2 are equivalent hedges with opposite orientation.

Definition at line 528 of file GEO_PolyInterface.h.

UT_Vector3 GEO_PolyInterface::calcBarycenter ( GA_Offset  poly) const
GA_Offset GEO_PolyInterface::contract ( GEO_Hedge  h,
bool  on_dst = true,
fpreal  ratio = -1.0,
bool  check_contractible = true,
bool  internal = true,
bool  destroy_released_point = true 
)

Contracts h. on_dst, if true, causes the src point to move to the position of the dst point. Otherwise, the dst point is moved to the src point's position. ratio, if in [0.0 .. 1.0], places the point of contraction in a convex combination with biases ratio and 1.0 - ratio from src and dst (or the other way around if on_dst is false) respectively.

GA_Offset GEO_PolyInterface::copyPolys ( GA_Detail gdp,
GA_Attribute pt_offset_map_attr = nullptr,
const GA_PrimitiveGroup grp = nullptr,
bool  copy_excluded = false 
)

Copy current work set polygons into the given detail. The pt_offset_map_attr point attribute can determine the point offset in the target detail ino which each given point should be mapped. A value of -1 indicates that the point must be created. The attribute is non-const and is over-written at -1 entries with the offset of the created point in the given detail. If grp is given, only the polygons in (resp. out of) the given group are copied, when copy_excluded is false (resp. true).

void GEO_PolyInterface::deletePointStar ( GA_Offset  pt,
bool  cap_hole = true,
GA_Offset  cap_poly = GA_INVALID_OFFSET,
bool  destroy_pt = true 
)
int GEO_PolyInterface::deleteVertex ( GA_Offset  vtx,
bool  relink_hedges = true 
)
void GEO_PolyInterface::destroyPoly ( GA_Offset  poly,
bool  and_pts = false 
)
SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::dfirst ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias:

Definition at line 438 of file GEO_PolyInterface.h.

bool GEO_PolyInterface::dissolve ( GEO_Hedge  h)
GEO_Hedge GEO_PolyInterface::divide ( GEO_Hedge  h,
fpreal  ratio,
bool  and_equivalent = true,
GA_Offset  pt = GA_INVALID_OFFSET 
)

Inserts a point in the middle of a hedge and divides into two hedges.

ratio determines the position of the new point at which the hedge is split. and_equivalent if true also divides all other hedges equivalent to h at the same point. pt is an optional point offset assumed to be located in

GEO_Hedge GEO_PolyInterface::divide ( GA_Offset  poly,
GEO_Hedge  h_keep,
GEO_Hedge  h_drop 
)

Break a polygon into two polygons by dividing it along a diagonal. The hedges starting from h_keep and ending before h_drop are kept in the current polygon while the hedges starting at h_drop and ending before h_keep end up in the new polygon. The returned hedge will be one added to the original polygon corresponding to the cut diagonal. NB. h_keep and h_drop must belong to the same polygon and cannot be the same or consecutive hedges.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::dnext ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias:

Definition at line 464 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::dprev ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias:

Definition at line 451 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::dstPoint ( GEO_Hedge  h) const
inline

Returns the point to which the destination vertex is wired.

Definition at line 298 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::dstVertex ( GEO_Hedge  h) const
inline

Returns the destination vertex of the hedge.

Definition at line 278 of file GEO_PolyInterface.h.

void GEO_PolyInterface::dumpHedge ( GA_Offset  vtx)
void GEO_PolyInterface::dumpHedge ( GEO_Hedge  h)
inline

Definition at line 769 of file GEO_PolyInterface.h.

void GEO_PolyInterface::enablePointWrangling ( bool  enable)
inline

Temporarily enable or disable all wrangling of point/vertex/primitive attributes initiated by calling wranglePointAttributes(), etc.

Definition at line 225 of file GEO_PolyInterface.h.

void GEO_PolyInterface::enablePrimitiveWrangling ( bool  enable)
inline

Definition at line 231 of file GEO_PolyInterface.h.

void GEO_PolyInterface::enableVertexWrangling ( bool  enable)
inline

Definition at line 228 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::findHedgeWithEndpoints ( GA_Offset  p0,
GA_Offset  p1 
) const

Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE.

Definition at line 1260 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::firstIncidentEdge ( GA_Offset  p) const
inline

Similar to first/nextIncidentHedge but stops only at the primary hedge in each equivalence class of hedges involved.

Definition at line 391 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::firstIncidentHedge ( GA_Offset  p) const
inline

Arbitrarily-Ordered Scan Methods: These methods scan over all edge/hedges incident to a point in an arbitrary order. NB. This order may be different in different executions of the code or across different platforms. Returns a first incident hedge to a point. Together with nextIncidentHedge, one can enumerate circularly over all hedges incident to a point. A hedge is incident to a point if one of its endpoints is that point.

Definition at line 381 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::firstIncomingHedge ( GA_Offset  p) const
inline

Similar to first/nextIncidentHedge but using only incoming hedges. Note that nextOutgoingHedge does not need the parameter p anymore.

Definition at line 411 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::firstManifoldIncomingHedge ( GEO_Hedge  h) const

Manifold Scan Methods:

A "manifold scan" around a point moves from one incoming (resp outgoing hedge incident to a point to the next in counterclockwise order as long as the hedge in question is a manifold hedge (i.h. it is equivalent to exactly one other hedge oriented oppositely). Returns the first hedge with the same destination point as the argument hedge that is reachable from it through a counterclockwise manifold scan around the destination point. Returns the argument hedge itself if either: 1) it is already the first such hedge, or 2) its source is an interior point of a manifold, ie. a counterclockwise scan does a full circle.

Definition at line 1224 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::firstManifoldOutgoingHedge ( GEO_Hedge  h) const

Similar to firstManifoldIncomingHedge but finds the first hedge with the same src as h in a counterclockwise scan from h.

Definition at line 1242 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::firstOutgoingHedge ( GA_Offset  p) const
inline

Similar to first/nextIncidentHedge but using only outgoing hedges. Note that nextOutgoingHedge does not need the parameter p anymore.

Definition at line 401 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::flip ( GEO_Hedge  h)

Flip h (provided that h is shared between two triangles) and is flippable. Returns the resulting (flipped) hedge (equal to h) or GEO_INVALID_HEDGE if h is not flippable.

void GEO_PolyInterface::getAdjacentPrimVertices ( GA_Offset  v,
GA_Offset vprev,
GA_Offset vnext 
) const

Definition at line 1215 of file GEO_PolyInterface.h.

GA_Detail* GEO_PolyInterface::getDetail ( ) const
inline

Definition at line 753 of file GEO_PolyInterface.h.

void GEO_PolyInterface::hardenPolys ( )

hardenPolys converts the soft polygons used by GEO_PolyInterface into actual GEO_PrimPoly objects. You MUST harden your polygons before trying to access a GEO_PrimPoly object. Of course you can skip hardening the polygons, if you're working on a temporary detail which is going to be tossed out. In that case you would probably use copyPolys to write them into a different detail. The copied polys will be the usual polygons and will need no hardening.

GA_Offset GEO_PolyInterface::hedgePoly ( GEO_Hedge  h) const
inline

Definition at line 240 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Primitive* GEO_PolyInterface::hedgePrimitive ( GEO_Hedge  h) const
inline

Return the polygon to which the hedge belongs.

Definition at line 236 of file GEO_PolyInterface.h.

HedgeRange GEO_PolyInterface::hedges ( const GA_VertexGroup g = nullptr) const
GA_Offset GEO_PolyInterface::insertVertex ( GA_Offset  poly,
GA_Offset  pt,
GA_Offset  before = GA_INVALID_OFFSET,
bool  relink_hedges = true 
)
SYS_FORCE_INLINE bool GEO_PolyInterface::isBoundaryHedge ( GEO_Hedge  h) const
inline

Returns true if the hedge h is a boundary hedge, i.e. if its equivalence class is singleton.

Definition at line 515 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::isBridgeHedge ( GEO_Hedge  h) const
inline

Returns true if the hedge h is a bridge hedge, i.e. if is a manifold hedge and its other equivalent hedge belongs to the same primitive as h does.

Definition at line 522 of file GEO_PolyInterface.h.

bool GEO_PolyInterface::isContractible ( GEO_Hedge  h) const

multiple components.

Returns true if the hedge h is contractible, i.e. contracting h does not force a a non-trivial (separating) cycle to collapse. A separating cycle is a closed sequence of edges that if removed (together with their incident geometry elements) the number of connected components

bool GEO_PolyInterface::isFlippable ( GEO_Hedge  h) const

Returns true if h can be flipped without the result overlapping an existing hedge. In other words, h is flippable if its endpoints are not endpoints of an existing edge in the geometry before the flip that is not equivalent to h.

bool GEO_PolyInterface::isManifoldHedge ( GEO_Hedge  h,
bool  accept_bd = false 
) const

Returns true if the hedge h is a manifold hedge, if accept_bd is false, this means that the equivalence class of h consists of exactly two hedges oriented oppositely. If accept_bd is true, then the equivalence class of h can also consist of a single (boundary) half-edge.

Definition at line 1266 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::isPrimary ( GEO_Hedge  h) const
inline

returns true of h is the primary hedge in its equivalence class. Each equivalence class of hedges at any time has a unique primary hedge. This is used for example to enumerate over all edges in the detail (as opposed to over all hedges).

Definition at line 268 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::isValid ( GEO_Hedge  h) const
inline

Definition at line 260 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::isValidHedge ( GEO_Hedge  h) const
inline

Check whether a hedge is valid. A half-edge is valid if it is belongs to a closed polygon in the group on which the interface is constructed or is the result of the manipulation of such hedges.

Definition at line 256 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::isValidHedgeSrcVertex ( GA_Offset  vtx) const
inline

Definition at line 248 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE bool GEO_PolyInterface::isValidPoly ( GA_Offset  poly) const
inline

Definition at line 732 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::lnext ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias for nextPrimitiveHedge().

Definition at line 322 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::lprev ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias for prevPrimitiveHedge().

Definition at line 333 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::nextEquivalentHedge ( GEO_Hedge  h) const
inline

Returns the "next" equivalent hedge to h: two hedges are equivalent if either their source and destination points are the same or the source point of each is the destination point of the other. Calling nextEquivalentHedge() repeatedly returns back to the original hedge. Thus to check if hedge h is manifold hedge one can

Definition at line 353 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::nextIncidentEdge ( GEO_Hedge  h,
GA_Offset  p 
) const
inline

Definition at line 395 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::nextIncidentHedge ( GEO_Hedge  h,
GA_Offset  p 
) const
inline

Definition at line 385 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::nextIncomingHedge ( GEO_Hedge  h) const
inline

Definition at line 415 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::nextManifoldIncomingHedge ( GEO_Hedge  h) const

Returns the next hedge with the same dst as h in a counterclockwise manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.

NOTE: This is equivalent to dnext() operation in Quad-Edge terminology, which is also used in GQ.

Definition at line 1236 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::nextManifoldOutgoingHedge ( GEO_Hedge  h) const

Returns the next hedge with the same src as h in a counterclockwise manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.

NOTE: This is equivalent to onext() operation in Quad-Edge terminology, which is also used in GQ or equivalently sym(lprev()).

Definition at line 1248 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::nextOutgoingHedge ( GEO_Hedge  h) const
inline

Definition at line 405 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::nextPrimitiveHedge ( GEO_Hedge  h) const
inline

Returns the next hedge (hedge whose source is the destination of the parameter hedge) in its polygon.

Definition at line 317 of file GEO_PolyInterface.h.

GA_Offset GEO_PolyInterface::nextPrimVertex ( GA_Offset  v) const

Definition at line 1209 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Size GEO_PolyInterface::numEquivalentHedges ( GEO_Hedge  h) const
inline

Returns the number of hedges in the equivalence class of h.

Definition at line 538 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Size GEO_PolyInterface::numIncidentEdges ( GA_Offset  pt) const
inline

Returns the number if edges incident to a point (equivalent hedges count as 1).

Definition at line 544 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Size GEO_PolyInterface::numIncidentHedges ( GA_Offset  pt) const
inline

Returns the number of distinct hedges incident to pt.

Definition at line 549 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::ofirst ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias:

Definition at line 474 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::onext ( GEO_Hedge  h) const
inline

Alias for nextManifoldOutgoingHedge, equivalent to sym(lprev()).

Definition at line 500 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::oprev ( GEO_Hedge  h) const
inline

Alias for prevManifoldOutgoingHedge, equivalent to lnext(sym()).

Definition at line 487 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::otherPrimitiveHedgeAtPoint ( GEO_Hedge  h,
GA_Offset  pt 
) const

Returns the hedge other than the parameter hedge in its polygon that.

Definition at line 1272 of file GEO_PolyInterface.h.

GA_Offset GEO_PolyInterface::polyFirst ( GA_Offset  poly) const

Definition at line 1132 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::polyHedge ( GA_Offset  poly) const
inline

Definition at line 243 of file GEO_PolyInterface.h.

PolyCycle GEO_PolyInterface::polyHedges ( GA_Offset  poly) const
inline

Returns the hedges around a polygon as a PolyCycle.

Definition at line 851 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::polyNext ( GA_Offset  v) const
inline

Definition at line 784 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::polyPrev ( GA_Offset  v) const
inline

Definition at line 790 of file GEO_PolyInterface.h.

PolyRange GEO_PolyInterface::polys ( const GA_PrimitiveGroup g = nullptr,
bool  complement = false 
) const
SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::postDstPoint ( GEO_Hedge  h) const
inline

Returns the point to which the postDstVertex(h) is wired.

See Also
: postDstVertex()

Definition at line 310 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::postDstVertex ( GEO_Hedge  h) const
inline

Returns the vertex succeeding the destination of the hedge.

Definition at line 288 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::preSrcPoint ( GEO_Hedge  h) const
inline

Returns the point to which the preSrcVertex(h) is wired.

See Also
: preSrcVertex()

Definition at line 304 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::preSrcVertex ( GEO_Hedge  h) const
inline

Returns the vertex preceding the source of the hedge in its polygon.

Definition at line 283 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::prevManifoldIncomingHedge ( GEO_Hedge  h) const

Returns the previous hedge with the same dst as h in a counterclockwise manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.

NOTE: This is equivalent to dprev() operation in Quad-Edge terminology, which is also used in GQ.

Definition at line 1230 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::prevManifoldOutgoingHedge ( GEO_Hedge  h) const

Returns the previous hedge with the same src as h in a counterclockwise.

NOTE: This is equivalent to oprev() operation in Quad-Edge terminology, which is also used in GQ or equivalently lnext(sym()).

Definition at line 1254 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::prevPrimitiveHedge ( GEO_Hedge  h) const
inline

Returns the previous hedge (hedge whose destination is the source of the parameter hedge) in its polygon.

Definition at line 328 of file GEO_PolyInterface.h.

GA_Offset GEO_PolyInterface::prevPrimVertex ( GA_Offset  v) const

Definition at line 1203 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::primary ( GEO_Hedge  h) const
inline

Alias for primaryEquivalentHedge().

Definition at line 368 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::primaryEquivalentHedge ( GEO_Hedge  h) const
inline

Returns the primary hedge equivalent to the argument hedge.

Definition at line 363 of file GEO_PolyInterface.h.

PrimaryHedgeRange GEO_PolyInterface::primaryHedges ( const GA_VertexGroup g = nullptr) const
void GEO_PolyInterface::resetPointWrangling ( )
inline

Clear the list of wrangled point/vertex/primitive attributes.

Definition at line 213 of file GEO_PolyInterface.h.

void GEO_PolyInterface::resetPrimitiveWrangling ( )
inline

Definition at line 219 of file GEO_PolyInterface.h.

void GEO_PolyInterface::resetVertexWrangling ( )
inline

Definition at line 216 of file GEO_PolyInterface.h.

GEO_Hedge GEO_PolyInterface::rotateBackward ( GEO_Hedge  h)

Complete reverse of rotateForward (all the point, vertex, and primitive offsets are restored). When the incident primitives are triangles, rotating forward or backward result in the same edge but they are not exactly identical. In particular, two consecutive flips on the same edge will reverse the orientation of the edge.

GEO_Hedge GEO_PolyInterface::rotateForward ( GEO_Hedge  h)

Rotate h forward, assuming h is an interior manifold hedge (equivalent to exactly one other hedge f oppositely oriented. This is not checked and the topology may be corrupted if rotate is applied to non-manifold or boundary edges. Returns the resulting hedge which happens to be equal to h (The input hedge will be the hedge that rotates (same src vertex) and the same holds for the equivalent edge of h.

---—>---—> ---—>---—> ^ |^ | ^ /7| | || | | // | | h || | ===> | h // | | || | | // | | v| v | // v <---—<---— |L/<—<---—

Note that this operation is precisely an edge flip if the two primitives involved are triangles.

Note also that the half-edges associated with the flipped edge are NOT identified with those of any pre-existing edge with the same endpoints. This deviates from the convention taken by poly interface but is very useful when pinching of a surface is temporarily needed as is the case with many algorithms. Method isFlippable() can be used to determine such a scenario beforehand.

bool GEO_PolyInterface::softValidate ( ) const
GEO_Hedge GEO_PolyInterface::split ( GEO_Hedge  h,
fpreal  ratio,
bool  and_equivalent = true,
GA_Offset  pt = GA_INVALID_OFFSET 
)

Splits the hedge h and its incident polygon (assumed to be a triangle, although it doesn't fail if it isn't). ratio determines the position of the new point at which the hedge is split. and_equivalent if true also splits all other hedges equivalent to h at the same point. pt is an optional point offset assumed to be located in

GA_Offset GEO_PolyInterface::split ( GA_Offset  poly,
GA_Offset  pt = GA_INVALID_OFFSET 
)

Split a polygon at its barycenter, or a given point. If the point is not given, then the position of the created point is set to the barycenter of the polygon.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::srcPoint ( GEO_Hedge  h) const
inline

Returns the point to which the source vertex is wired.

Definition at line 293 of file GEO_PolyInterface.h.

SYS_FORCE_INLINE GA_Offset GEO_PolyInterface::srcVertex ( GEO_Hedge  h) const
inline

Returns the source vertex of the hedge.

Definition at line 273 of file GEO_PolyInterface.h.

GA_Offset GEO_PolyInterface::stealVertex ( GA_Offset  poly,
GA_Offset  vtx,
GA_Offset  insert_before = GA_INVALID_OFFSET,
bool  relink_hedges = true 
)
SYS_FORCE_INLINE GEO_Hedge GEO_PolyInterface::sym ( GEO_Hedge  h) const
inline

Quad-Edge/GQ alias for nextEquivalentHedge().

Definition at line 358 of file GEO_PolyInterface.h.

template<typename T = fpreal32>
exint GEO_PolyInterface::triangulate ( GA_Offset  poly,
UT_Vector3T< T > *  sym_ctr = nullptr,
GA_ROHandleT< UT_Vector3T< T > >  pos_handle = GA_ROHandleTUT_Vector3TT > >(),
GEO_Hedge  start_hedge = GEO_INVALID_HEDGE,
UT_Array< UT_Vector3T< T > > *  pos3 = nullptr,
UT_Array< UT_Vector2T< T > > *  pos2 = nullptr,
UT_Triangulate::WorkBuffer *  wb = nullptr,
UT_IntArray tris = nullptr 
)

Triangualtes a polygon.

template<typename S , typename T = fpreal32>
exint GEO_PolyInterface::triangulate ( const S &&  polys,
UT_Vector3T< T > *  sym_ctr = nullptr,
GA_ROHandleT< UT_Vector3T< T > >  pos_handle = GA_ROHandleTUT_Vector3TT > >() 
)
GEO_Hedge GEO_PolyInterface::unflip ( GEO_Hedge  h)

unflip is the reverse of a flip. Doing a flip followed by an unflip should result in the same mesh with the same vertex/point/primtive offsets and indices (but the vertices within primitives may shift).

bool GEO_PolyInterface::validate ( ) const
int GEO_PolyInterface::vertexCount ( GA_Offset  poly) const
void GEO_PolyInterface::wireVertexPoint ( GA_Offset  vtx,
GA_Offset  pt,
bool  rewire_hedges = true 
)
void GEO_PolyInterface::wranglePointAttribute ( GA_Attribute attrib)

Add the given point/vertex/primitive attribute or those passing the given filter to the list of attributes that are automatically interpolated during operations.

void GEO_PolyInterface::wranglePointAttribute ( const GA_AttributeFilter filter)
void GEO_PolyInterface::wranglePrimitiveAttribute ( GA_Attribute attrib)
void GEO_PolyInterface::wranglePrimitiveAttribute ( const GA_AttributeFilter filter)
void GEO_PolyInterface::wrangleVertexAttribute ( GA_Attribute attrib)
void GEO_PolyInterface::wrangleVertexAttribute ( const GA_AttributeFilter filter)

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