HDK
|
#include <GEO_HedgeInterface.h>
GEO_HedgeInterface provides the interface to deal with a detail's half-edges. Ultimately it's expected to replace GQ. By default the constructor of the class adds two additional half-edge topology attributes to the detail if they're not already present (unless the second parameter is set to false, in which case all operations are handled without the topology attributes and can therefore be much much slower). The destructor of GEO_HedgeInterface removes these topology attributes from detail if they were added by the constructor but leaves them there if they already existed when the class was created.
NOTE: The merge code for topology attributes is not tested and is quite like to fail. It is therefore highly advisable to remove the topology attributes when you're done with them and thereby prevent them from being passed to details downstream.
Definition at line 632 of file GEO_HedgeInterface.h.
GEO_HedgeInterface::GEO_HedgeInterface | ( | GA_Detail * | gdp, |
bool | use_hedge_topology = true |
||
) |
GEO_HedgeInterface::~GEO_HedgeInterface | ( | ) |
Returns true if e1 and e2 are equivalent hedges.
Definition at line 950 of file GEO_HedgeInterface.h.
Returns true if e1 and e2 are equivalent hedges with opposite orientation.
Definition at line 946 of file GEO_HedgeInterface.h.
GA_Offset GEO_HedgeInterface::contract | ( | GEO_Hedge | e, |
bool | on_dst = true , |
||
fpreal | ratio = 1.0 , |
||
bool | check_contractible = true |
||
) |
Contracts e. 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 not equal to 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.
void GEO_HedgeInterface::deletePointStar | ( | GA_Offset | pt, |
bool | patch_link = true , |
||
GA_Offset | patch_prim = GA_INVALID_OFFSET |
||
) |
void GEO_HedgeInterface::destroyHedgeTopologyLinks | ( | ) |
|
inline |
Definition at line 826 of file GEO_HedgeInterface.h.
GEO_Hedge GEO_HedgeInterface::divideHedge | ( | GEO_Hedge | e, |
fpreal | ratio, | ||
bool | and_equivalent = true , |
||
GA_Offset | poff = 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 e at the same point. poff is an optional point offset assumed to be located in
Splits the primitive of a hedge into two primitives by cutting it along a diagonal. The hedges starting from ekeep and ending before edrop are kept in the current primitive while the edges hedges starting at edrop and ending before ekeep end up in the new primitive.
|
inline |
Definition at line 850 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 838 of file GEO_HedgeInterface.h.
Returns the point to which the dst vertex is wired.
Definition at line 718 of file GEO_HedgeInterface.h.
|
inline |
Returns the positions of the destination point of e.
Definition at line 896 of file GEO_HedgeInterface.h.
|
inline |
Returns the primitives angle at dst of the hedge NB. If the angle in question is reflex, then its 2*pi complement is returned unless the normal of the primitive that contains e is passed using the optional nml parameter.
Definition at line 907 of file GEO_HedgeInterface.h.
Returns the primitives angle at dst of the hedge.
Definition at line 918 of file GEO_HedgeInterface.h.
Returns the dst vertex of the hedge.
Definition at line 700 of file GEO_HedgeInterface.h.
Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE.
Definition at line 967 of file GEO_HedgeInterface.h.
Similar to first/nextIncidentHedge but stops over only one of the hedges in each equivalence class of hedges incident to the point
Definition at line 787 of file GEO_HedgeInterface.h.
Returns a first incidentHedge to a point. Together with nextIncidentHedge, one can enumerate circularly over all hedges incident to a point.
Definition at line 779 of file GEO_HedgeInterface.h.
Similar to first/nextIncidentHedge but using only incoming hedges. Note that nextOutgoingHedge does not need the parameter pt anymore.
Definition at line 803 of file GEO_HedgeInterface.h.
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.e. it is equivalent to exactly one other hedge oriented oppositely). Returns the first hedge with the same dst as e that is reachable from e through a counterclockwise manifold scan around dst of e. Returns e itself if either: 1) e is already the first such hedge, or 2) the src of e is an interior point of a manifold, ie the counterclockwise scan reaches back at e.
Definition at line 822 of file GEO_HedgeInterface.h.
Similar to firstManifoldIncomingHedge but finds the first hedge with the same src as e in a counterclockwise scan from e.
Definition at line 855 of file GEO_HedgeInterface.h.
Similar to first/nextIncidentHedge but using only outgoing hedges. Note that nextOutgoingHedge does not need the parameter pt anymore.
Definition at line 795 of file GEO_HedgeInterface.h.
Flip e (provided that e is shared between two triangles) and is flippable. Returns the resulting (flipped) hedge (equal to e) or GEO_INVALID_HEDGE if e is not flippable.
|
inline |
Definition at line 1105 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 641 of file GEO_HedgeInterface.h.
|
inline |
Return the polygon to which the hedge belongs. NOTE: may need to modify this if other primitives support hedges.
Definition at line 653 of file GEO_HedgeInterface.h.
Definition at line 659 of file GEO_HedgeInterface.h.
|
inline |
Returns the vector defined by the end-points of e.
Definition at line 900 of file GEO_HedgeInterface.h.
|
inline |
Returns true if the hedge e is a boundary hedge, i.e. if its equivalence class is singleton.
Definition at line 935 of file GEO_HedgeInterface.h.
|
inline |
Returns true if the hedge e is a bridge hedge, i.e. if is a manifold hedge and its other equivalent hedge belongs to the same primitive as e does.
Definition at line 941 of file GEO_HedgeInterface.h.
bool GEO_HedgeInterface::isContractible | ( | GEO_Hedge | e | ) | const |
multiple components.
Returns true if the hedge e is contractible, i.e. contracting e 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_HedgeInterface::isFlippable | ( | GEO_Hedge | e | ) | const |
Returns true if e can be flipped without the result overlapping an existing hedge. In other words, e is flippable if its endpoints are not endpoints of an existing edge in the geometry before the flip that is not equivalent to e.
|
inline |
Returns true if the hedge e is a manifold hedge, if accept_bd is false, this means that the equivalence class of e consists of exactly two hedges oriented oppositely. If accept_bd is true, then the equivalence class of e can also consist of a single (boundary) half-edge.
Definition at line 930 of file GEO_HedgeInterface.h.
bool GEO_HedgeInterface::isPrimary | ( | GEO_Hedge | e | ) | const |
returns true of e 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).
bool GEO_HedgeInterface::isValidHedge | ( | GEO_Hedge & | e | ) | const |
Check whether a hedge is valid: a hedge is valid if 1: its src vertex belongs to a primitive that supports hedges, and 2: the primitive returns a valid next boundary vertex for its dst vertex.
Returns the length of the hedge e. Note that it requires the endpoints of e to be determined.
Definition at line 888 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 737 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 747 of file GEO_HedgeInterface.h.
Returns the "next" equivalent hedge to e: two hedges are equivalent if either their dsts and srcs are respectively wired to the same points or if the dst of each is wired to the same point as the src of the other. calling nextEquivalentHedge() repeatedly returns back to the original hedge. Thus to check if hedge e is manifold hedge one can check that: nextEquivalentHedge(e) != e && nextEquivalentHedge(nextEquivalentHedge(e)) == e
Definition at line 790 of file GEO_HedgeInterface.h.
Definition at line 782 of file GEO_HedgeInterface.h.
Definition at line 806 of file GEO_HedgeInterface.h.
Returns the next hedge with the same dst as e 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 846 of file GEO_HedgeInterface.h.
Returns the next hedge with the same src as e 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.
Definition at line 879 of file GEO_HedgeInterface.h.
Definition at line 798 of file GEO_HedgeInterface.h.
Returns the next hedge (hedge with src equal to the dst of the parameter hedge) in the polygon that contains the parameter hedge
Definition at line 733 of file GEO_HedgeInterface.h.
Returns the number of hedges in the equivalence class of e.
Definition at line 954 of file GEO_HedgeInterface.h.
Returns the number if edges incident to a point (equivalent hedges count as 1).
Definition at line 959 of file GEO_HedgeInterface.h.
Returns the number of distinct hedges incident to pt.
Definition at line 963 of file GEO_HedgeInterface.h.
Returns the number of primitives that have pt as a vertex and support hedges.
|
inline |
Definition at line 859 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 883 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 871 of file GEO_HedgeInterface.h.
Returns the "other" (than h) hedge in the polygon of h that has the pt as an endpoint.
Definition at line 752 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 685 of file GEO_HedgeInterface.h.
Definition at line 1135 of file GEO_HedgeInterface.h.
Definition at line 1143 of file GEO_HedgeInterface.h.
Definition at line 1126 of file GEO_HedgeInterface.h.
Returns the point to which the post-dst vertex is wired
Definition at line 728 of file GEO_HedgeInterface.h.
Returns the vertex after the dst of the vertex of the hedge in the poly to which the hedge belongs
Definition at line 710 of file GEO_HedgeInterface.h.
Returns the point to which the pre-src vertex is wired.
Definition at line 723 of file GEO_HedgeInterface.h.
Returns the vertex before the src vertex of the hedge in the poly to which the hedge belongs
Definition at line 705 of file GEO_HedgeInterface.h.
Returns the previous hedge with the same dst as e 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 834 of file GEO_HedgeInterface.h.
Returns the previous hedge with the same src as e in a counterclockwise.
NOTE: This is equivalent to oprev() operation in Quad-Edge terminology, which is also used in GQ.
Definition at line 867 of file GEO_HedgeInterface.h.
Returns the previous hedge (hedge whose dst is the same as the src of the parameter hedge) in the polygon that contains the parameter hedge.
Definition at line 743 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 773 of file GEO_HedgeInterface.h.
Returns the primary hedge equivalent to the argument hedge.
GEO_Hedge GEO_HedgeInterface::reversibleSplit | ( | GEO_Hedge | e, |
fpreal | ratio, | ||
bool | and_equivalent = true , |
||
GA_Offset | poff = GA_INVALID_OFFSET |
||
) |
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.
Rotate e forward, provided that e is a 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 e (The input hedge will be the hedge that rotates (same src vertex) and the same holds for the equivalent edge of e.
---—>---—> ---—>---—> ^ |^ | ^ /7| | || | | // | | e || | ===> | e // | | || | | // | | v| v | // v <---—<---— |L/<—<---—
Note that this operation is precisely an edge flip if the two primitives involved are triangles.
|
inline |
If a wrangler cache is set, the operations involving hedges use it to wrangle attributes. To stop wrangling, the method can be called with NULL as parameter.
Definition at line 648 of file GEO_HedgeInterface.h.
GEO_Hedge GEO_HedgeInterface::split | ( | GEO_Hedge | e, |
fpreal | ratio, | ||
bool | and_equivalent = true , |
||
GA_Offset | poff = GA_INVALID_OFFSET |
||
) |
Splits the hedge e 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 e at the same point. poff is an optional point offset assumed to be located in
GA_Offset GEO_HedgeInterface::splitHedgePrimitive | ( | GEO_Hedge | e, |
GA_Offset | pt = GA_INVALID_OFFSET |
||
) |
Subdivides the polygon of e at its barycenter or the supplied point.
Returns the point to which the src vertex is wired.
Definition at line 714 of file GEO_HedgeInterface.h.
|
inline |
Returns the positions of the source point of e.
Definition at line 892 of file GEO_HedgeInterface.h.
|
inline |
Returns the primitives angle at src of the hedge NB. If the angle in question is reflex, then its 2*pi complement is returned unless the normal of the primitive that contains e is passed using the optional nml parameter.
Definition at line 914 of file GEO_HedgeInterface.h.
Returns the primitives angle at src of the hedge.
Definition at line 922 of file GEO_HedgeInterface.h.
Returns the src vertex of the hedge.
Definition at line 696 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 766 of file GEO_HedgeInterface.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/primitive offsets and indices (but the vertices within primitives may shift).
|
inline |
Definition at line 671 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 675 of file GEO_HedgeInterface.h.
|
inline |
Definition at line 681 of file GEO_HedgeInterface.h.