HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_HedgeInterface.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GEO_HedgeInterface.h ( GEO Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GEO_HedgeInterface__
12 #define __GEO_HedgeInterface__
13 
14 #include "GEO_Detail.h"
15 #include "GEO_Hedge.h"
16 #include <GA/GA_Primitive.h>
17 
18 class GEO_PrimPoly;
20 
21 ///
22 // GEO_DetachedHedgeInterface is a READ-ONLY half-edge interface and is
23 // built with the assumption that the detail on which it is based stays
24 // constant while the interface is in use. It only features those methods
25 // of GEO_HedgeInterface that do not modify the geometry. Compared to
26 // GEO_HedgeInterface, it has the following advantages:
27 //
28 // 1. It does not create additional topology attributes on the detail.
29 // 2. It stores primitive vertex order information internally and does
30 // not access primitives (after construction) and is therefore faster
31 // than GEO_HedgeInterface in about every operation it supports.
32 // 3. It can be constructed for a primitive group, as though other
33 // primitives do not exist.
34 //
35 // It is therefore a much much better idea to use detached interface to
36 // access a constant detail.
37 
39 {
40 public:
41 
42  /// If group prims is specified, all primitives in the group are ignored,
43  /// if exclude_prims is ture. Otherwise, all primitives outside the group
44  /// are ignore. In both cases, half-edges defined by vertices of the
45  /// ignored primitives are regarded as non-existent (invalid).
47  const GA_PrimitiveGroup *prims = NULL,
48  bool exclude_prims = true) :
49  myGdp(gdp)
50  {
51  buildHedgeTopologyLinks(prims, exclude_prims);
52  }
53 
55 
56  /// Return the polygon to which the hedge belongs.
57  /// NOTE: may need to modify this if other primitives support hedges.
59  { return static_cast<const GEO_Primitive *>(geo_hedge::hedgePrimitive(myGdp, e)); }
60 
62  { return geo_hedge::hedgePrimitiveOffset(myGdp, e); }
63 
64  /// Check whether a hedge is valid: a hedge is valid if
65  /// 1: its src vertex belongs to a primitive that supports hedges, and
66  /// 2: the primitive returns a valid *next boundary vertex* for its
67  /// dst vertex.
68  /// @see: GA_Topology.h
69  bool isValidHedge(GEO_Hedge e) const;
70 
71  /// returns true of e is the *primary* hedge in its equivalence class.
72  /// Each equivalnce class of hedges at any time has a unique primary hedge.
73  /// This is used for example to enumerate over all edges in the detail (as
74  /// opposed to over all hedges).
75  bool isPrimary(GEO_Hedge e) const;
76 
77  /// Returns the src vertex of the hedge
79  { return geo_hedge::srcVertex(e); }
80 
81  /// Returns the src vertex of a signed hedge
83  { return se.isPositive() ? srcVertex(se.hedge()) : dstVertex(se.hedge()); }
84 
85  /// Returns the dst vertex of the hedge
87  { return myPrimNextRef(geo_hedge::srcVertex(e)); }
88 
89  /// Returns the src vertex of a signed hedge
91  { return se.isPositive() ? dstVertex(se.hedge()) : srcVertex(se.hedge()); }
92 
93  /// Returns the vertex before the src vertex of the hedge in the poly
94  /// to which the hedge belongs
96  { return myPrimPrevRef(geo_hedge::srcVertex(e)); }
97 
98  /// Returns the vertex after the dst of the vertex of the hedge in the
99  /// poly to which the hedge belongs
101  {
102  GA_Offset next = myPrimNextRef(geo_hedge::srcVertex(e));
103  return GAisValid(next) ? myPrimNextRef(next) : GA_INVALID_OFFSET;
104  }
105 
106  /// Returns the point to which the src vertex is wired
108  { return myGdp->vertexPoint(srcVertex(e)); }
109 
110  /// Returns the src vertex of a signed hedge
112  { return se.isPositive() ? srcPoint(se.hedge()) : dstPoint(se.hedge()); }
113 
114  /// Returns the point to which the dst vertex is wired
116  { return myGdp->vertexPoint(dstVertex(e)); }
117 
118  /// Returns the src vertex of a signed hedge
120  { return se.isPositive() ? dstPoint(se.hedge()) : srcPoint(se.hedge()); }
121 
122  /// Returns the point to which the pre-src vertex is wired.
123  /// @see: preSrcVertex()
125  { return myGdp->vertexPoint(preSrcVertex(e)); }
126 
127  /// Returns the point to which the post-dst vertex is wired
128  /// @see: postDstVertex()
130  { return myGdp->vertexPoint(postDstVertex(e)); }
131 
132  /// Returns the next hedge (hedge with src equal to the dst of the
133  /// parameter hedge) in the polygon that contains the parameter hedge
135  { return GEO_Hedge(dstVertex(e)); }
136 
139  { return nextPrimitiveHedge(e); }
140 
141  /// Returns the previous hedge (hedge whose dst is the same as the src of
142  /// the parameter hedge) in the polygon that contains the parameter hedge.
144  { return GEO_Hedge(preSrcVertex(e)); }
145 
148  { return prevPrimitiveHedge(e); }
149 
150  /// Returns the "other" (than e) hedge in the polygon that has the pt as an
151  /// endpoint.
153  {
154  if (srcPoint(e) == pt)
155  return prevPrimitiveHedge(e);
156  if (dstPoint(e) == pt)
157  return nextPrimitiveHedge(e);
158  return GEO_INVALID_HEDGE;
159  }
160 
161  /// Returns the "next" equivalent hedge to e:
162  /// two hedges are equivalent if either their dsts and srcs are
163  /// respectively wired to the same points or if the dst of each is wired
164  /// to the same point as the src of the other. calling
165  /// nextEquivalentHedge() repeatedly returns back to the original hedge.
166  /// Thus to check if hedge e is manifold hedge one can check that:
167  /// nextEquivalentHedge(e) != e &&
168  /// nextEquivalentHedge(nextEquivalentHedge(e)) == e
169  GEO_Hedge nextEquivalentHedge(GEO_Hedge e) const;
170 
173  { return nextEquivalentHedge(e); }
174 
175  /// Returns a first incidentHedge to a point. Together with
176  /// nextIncidentHedge, one can enumerate circularly over all hedges
177  /// incident to a point.
180 
181  /// Similar to first/nextIncidentHedge but stops over only one of the
182  /// hedges (the primary) in each equivalence class of hedges incident to
183  /// the point.
185  { return geo_hedge::firstIncidentEdge(*this, pt); }
186 
188  { return geo_hedge::nextIncidentEdge(*this, e, pt); }
189 
190  /// Similar to first/nextIncidentHedge but using only outgoing hedges.
191  /// Note that nextOutgoingHedge does not need the parameter pt anymore.
193  { return geo_hedge::firstOutgoingHedge(*this, pt); }
194 
196  { return geo_hedge::nextOutgoingHedge(*this, e); }
197 
198  /// Similar to first/nextIncidentHedge but using only incoming hedges.
199  /// Note that nextOutgoingHedge does not need the parameter pt anymore.
202 
203  /// Manifold Scan Methods:
204 
205  /// A "manifold scan" around a point moves from one incoming (resp outgoing
206  /// hedge incident to a point to the next in counterclockwise order as
207  /// long as the hedge in question is a manifold hedge (i.e. it is
208  /// equivalent to exactly one other hedge oriented oppositely).
209 
210  /// Returns the first hedge with the same dst as e that is reachable
211  /// from e through a counterclockwise manifold scan around dst of e.
212  /// Returns e itself if either:
213  /// 1) e is already the first such hedge, or
214  /// 2) the src of e is an interior point of a manifold,
215  /// ie the counterclockwise scan reaches back at e.
217  { return geo_hedge::firstManifoldIncomingHedge(*this, e); }
218 
221  { return firstManifoldIncomingHedge(e); }
222  /// Returns the previous hedge with the same dst as e in a
223  /// counterclockwise manifold scan, returns GEO_INVALID_HEDGE if no
224  /// such hedge exists.
225  ///
226  /// NOTE: This is equivalent to dprev() operation in Quad-Edge
227  /// terminology, which is also used in GQ.
229  { return geo_hedge::prevManifoldIncomingHedge(*this, e); }
230 
233  { return prevManifoldIncomingHedge(e); }
234 
235  /// Returns the next hedge with the same dst as e in a counterclockwise
236  /// manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.
237  ///
238  /// NOTE: This is equivalent to dnext() operation in Quad-Edge
239  /// terminology, which is also used in GQ.
241  { return geo_hedge::nextManifoldIncomingHedge(*this, e); }
242 
245  { return nextManifoldIncomingHedge(e); }
246 
247  /// Similar to firstManifoldIncomingHedge but finds the first hedge with
248  /// the same src as e in a counterclockwise scan from e.
250  { return geo_hedge::firstManifoldOutgoingHedge(*this, e); }
251 
254  { return firstManifoldOutgoingHedge(e); }
255 
256  /// Returns the previous hedge with the same src as e in a counterclockwise
257  // manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.
258  ///
259  /// NOTE: This is equivalent to oprev() operation in Quad-Edge
260  /// terminology, which is also used in GQ.
262  { return geo_hedge::prevManifoldOutgoingHedge(*this, e); }
263 
266  { return prevManifoldOutgoingHedge(e); }
267 
268  /// Returns the next hedge with the same src as e in a counterclockwise
269  /// manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.
270  ///
271  /// NOTE: This is equivalent to onext() operation in Quad-Edge
272  /// terminology, which is also used in GQ.
274  { return geo_hedge::nextManifoldOutgoingHedge(*this, e); }
275 
278  { return nextManifoldOutgoingHedge(e); }
279 
280  /// Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE
282  { return geo_hedge::findHedgeWithEndpoints(*this, p0, p1); }
283 
284  /// Returns the primary hedge equivalent to the arguemtn hedge.
285  GEO_Hedge primaryEquivalentHedge(GEO_Hedge e) const;
288  { return primaryEquivalentHedge(e); }
289 
291  {
292  GEO_Hedge ep = primary(e.hedge());
293  return GEO_SHedge(ep, srcPoint(ep) == srcPoint(e) ? 1 : -1);
294  }
295 
296  /// Returns the length of the hedge e.
297  /// Note that it requires the endpoints of e to be determiend.
299  { return geo_hedge::length(*this, e); }
300 
301  /// Returns the positions of the source point of e
303  { return geo_hedge::srcPos3(myGdp, e); }
304 
305  /// Returns the positions of the destination point of e
307  { return geo_hedge::dstPos3(*this, e); }
308 
309  /// Returns the vector defined by the end-points of e
311  { return dstPos3(e) - srcPos3(e); }
312 
313  /// Returns the primitives angle at dst of the hedge.
314  /// NB. If the angle in question is reflex, then its 2*pi complement is
315  /// returned unless the normal of the primitive that contains e is
316  /// passed using the optional nml parameter.
318  { return geo_hedge::dstPrimitiveAngle(*this, e, nml); }
319 
320  /// Returns the primitives angle at src of the hedge
321  /// NB. If the angle in question is reflex, then its 2*pi complement is
322  /// returned unless the normal of the primitive that contains e is
323  /// passed using the optional nml parameter.
325  { return geo_hedge::srcPrimitiveAngle(*this, e, nml); }
326 
327  /// Returns the primitives angle at dst of the hedge
329  { return geo_hedge::dstPrimitiveAngleCos(*this, e); }
330 
331  /// Returns the primitives angle at src of the hedge
333  { return geo_hedge::srcPrimitiveAngleCos(*this, e); }
334 
335  /// Returns true if the hedge e is a manifold hedge, if accept_bd is
336  /// false, this means that the equivalence class of e consists of
337  /// exactly two hedges oriented oppositely. If accept_bd is true, then
338  /// the equivalence class of e can also consist of a single (boundary)
339  /// half-edge.
340  bool isManifoldHedge(GEO_Hedge e, bool accept_bd = false) const
341  { return geo_hedge::isManifoldHedge(*this, e, accept_bd); }
342 
343  /// Returns true if the hedge e is a boundary hedge, i.e. if its
344  /// equivalence class is singleton.
346  { return geo_hedge::isBoundaryHedge(*this, e); }
347 
348  /// Returns true if the hedge e is a bridge hedge, i.e. if is a
349  /// manifold hedge and its other equivalent hedge belongs to the
350  /// same primitive as e does.
351  bool isBridgeHedge(GEO_Hedge e) const
352  { return geo_hedge::isBridgeHedge(*this, e); }
353 
354  /// Returns true if e1 and e2 are equivalent hedges with opposite
355  /// orientation.
356  bool areOpposite(GEO_Hedge e1, GEO_Hedge e2) const
357  { return geo_hedge::areOpposite(*this, e1, e2); }
358 
359  bool areOpposite(GEO_SHedge e1, GEO_SHedge e2) const
360  { return areEquivalent(e1, -e2); }
361 
362  /// Returns true if e1 and e2 are equivalent hedges.
363  bool areEquivalent(GEO_Hedge e1, GEO_Hedge e2) const
364  { return geo_hedge::areEquivalent(*this, e1, e2); }
365 
366  /// Returns true if e1 and e2 are equivalent signed hedges.
368  { return primary(e1) == primary(e2); }
369 
370  /// Returns the number of hedges in the equivalence class of e.
372  { return geo_hedge::numEquivalentHedges(*this, e); }
373 
374  /// Returns the number if *edges* incident to a point (equivalent hedges
375  /// count as 1).
377  { return geo_hedge::numIncidentEdges(*this, pt); }
378 
379  /// Returns the number of distinct *hedges* incident to pt
381  { return geo_hedge::numIncidentHedges(*this, pt); }
382 
383  const
384  GA_Detail *getDetail() const { return myGdp; }
385 
387  GA_Offset prevPrimVertex(GA_Offset v) const;
388 
390  GA_Offset nextPrimVertex(GA_Offset v) const;
391 
393  void getAdjacentPrimVertices(GA_Offset v, GA_Offset &vprev,
394  GA_Offset &vnext) const;
395 
396 private:
397  void buildHedgeTopologyLinks(const GA_PrimitiveGroup *group = NULL,
398  bool exclude_prims = true);
399 
400  const GA_Detail *myGdp;
401  GA_OffsetArray myHedgeNextRef;
402  GA_OffsetArray myPrimPrevRef;
403  GA_OffsetArray myPrimNextRef;
404  UT_BitArray myPrimaryMask;
405 };
406 
407 /// GEO_HedgeInterface provides the interface to deal with a detail's
408 /// half-edges. Ultimately it's expected to replace GQ. By default the
409 /// constructor of the class adds two additional half-edge topology attributes
410 /// to the detail if they're not already present (unless the second parameter
411 /// is set to false, in which case all operations are handled without the
412 /// topology attributes and can therefore be much much slower). The
413 /// destructor of GEO_HedgeInterface removes these topology
414 /// attributes from detail if they were added by the constructor but leaves
415 /// them there if they already existed when the class was created.
416 ///
417 /// NOTE: The merge code for topology attributes is not tested and is quite
418 /// like to fail. It is therefore highly advisable to remove the topology
419 /// attributes when you're done with them and thereby prevent them from
420 /// being passed to details downstream.
421 
423 {
424 public:
425 
426  GEO_HedgeInterface(GA_Detail *gdp, bool use_hedge_topology = true);
428 
429  void destroyHedgeTopologyLinks();
430 
431  bool haveHedgeTopology() const
432  { return myHaveHedgeTopology; }
433 
434  /// If a wrangler cache is set, the operations involving hedges use it
435  /// to wrangle attributes. To stop wrangling, the method can be called
436  /// with NULL as parameter.
437 
439  { myWranglerCache = wc; }
440 
441  /// Return the polygon to which the hedge belongs.
442  /// NOTE: may need to modify this if other primitives support hedges.
444  { return static_cast<GEO_Primitive *>(geo_hedge::hedgePrimitive(myGdp, e)); }
445 
447  { return geo_hedge::hedgePrimitiveOffset(myGdp, e); }
448 
449  /// Check whether a hedge is valid: a hedge is valid if
450  /// 1: its src vertex belongs to a primitive that supports hedges, and
451  /// 2: the primitive returns a valid *next boundary vertex* for its dst
452  /// vertex.
453  ///
454  /// @see: GA_Topology.h
455  bool isValidHedge(GEO_Hedge &e) const;
456 
457  /// returns true of e is the *primary* hedge in its equivalence class.
458  /// Each equivalence class of hedges at any time has a unique primary
459  /// hedge. This is used for example to enumerate over all edges in the
460  /// detail (as opposed to over all hedges).
461  bool isPrimary(GEO_Hedge e) const;
462 
463  /// Returns the src vertex of the hedge
465  { return geo_hedge::srcVertex(e); }
466 
467  /// Returns the dst vertex of the hedge
469  { return geo_hedge::dstVertex(*this, e); }
470 
471  /// Returns the vertex before the src vertex of the hedge in the poly
472  /// to which the hedge belongs
474  { return geo_hedge::preSrcVertex(*this, e); }
475 
476  /// Returns the vertex after the dst of the vertex of the hedge in
477  /// the poly to which the hedge belongs
479  { return geo_hedge::postDstVertex(*this, e); }
480 
481  /// Returns the point to which the src vertex is wired
483  { return geo_hedge::srcPoint(myGdp, e); }
484 
485  /// Returns the point to which the dst vertex is wired
487  { return geo_hedge::dstPoint(*this, e); }
488 
489  /// Returns the point to which the pre-src vertex is wired.
490  /// @see: preSrcVertex()
492  { return geo_hedge::preSrcPoint(*this, e); }
493 
494  /// Returns the point to which the post-dst vertex is wired
495  /// @see: postDstVertex()
497  { return geo_hedge::postDstPoint(*this, e); }
498 
499  /// Returns the next hedge (hedge with src equal to the dst of the
500  /// parameter hedge) in the polygon that contains the parameter hedge
502  { return geo_hedge::nextPrimitiveHedge(*this, e); }
503 
506  { return nextPrimitiveHedge(e); }
507 
508  /// Returns the previous hedge (hedge whose dst is the same as the src
509  /// of the parameter hedge) in the polygon that contains the parameter
510  /// hedge.
512  { return geo_hedge::prevPrimitiveHedge(*this, e); }
513 
516  { return prevPrimitiveHedge(e); }
517 
518  /// Returns the "other" (than e) hedge in the polygon that has the
519  /// pt as an endpoint
521  { return geo_hedge::otherPrimitiveHedgeAtPoint(*this, e, pt); }
522 
523  /// Returns the "next" equivalent hedge to e:
524  /// two hedges are equivalent if either their dsts and srcs are
525  /// respectively wired to the same points or if the dst of each is
526  /// wired to the same point as the src of the other. calling
527  /// nextEquivalentHedge() repeatedly returns back to the original hedge.
528  /// Thus to check if hedge e is manifold hedge one can check that:
529  /// nextEquivalentHedge(e) != e &&
530  /// nextEquivalentHedge(nextEquivalentHedge(e)) == e
531  GEO_Hedge nextEquivalentHedge(GEO_Hedge e) const;
532 
535  { return nextEquivalentHedge(e); }
536 
537  /// Returns the primary hedge equivalent to the argument hedge.
538  GEO_Hedge primaryEquivalentHedge(GEO_Hedge e) const;
541  { return primaryEquivalentHedge(e); }
542 
543  /// Returns a first incidentHedge to a point. Together with
544  /// nextIncidentHedge, one can enumerate circularly over all hedges
545  /// incident to a point.
547  { return geo_hedge::firstIncidentHedge(*this, pt); }
548 
550  { return geo_hedge::nextIncidentHedge(*this, e, pt); }
551 
552  /// Similar to first/nextIncidentHedge but stops over only one of the
553  /// hedges in each equivalence class of hedges incident to the point
555  { return geo_hedge::firstIncidentEdge(*this, pt); }
556 
558  { return geo_hedge::nextIncidentEdge(*this, e, pt); }
559 
560  /// Similar to first/nextIncidentHedge but using only outgoing hedges.
561  /// Note that nextOutgoingHedge does not need the parameter pt anymore.
563  { return geo_hedge::firstOutgoingHedge(*this, pt); }
564 
566  { return geo_hedge::nextOutgoingHedge(*this, e); }
567 
568  /// Similar to first/nextIncidentHedge but using only incoming hedges.
569  /// Note that nextOutgoingHedge does not need the parameter pt anymore.
571  { return geo_hedge::firstIncomingHedge(*this, pt); }
572 
574  { return geo_hedge::nextIncomingHedge(*this, e); }
575 
576  /// Manifold Scan Methods:
577 
578  /// A "manifold scan" around a point moves from one incoming (resp outgoing
579  /// hedge incident to a point to the next in counterclockwise order as
580  /// long as the hedge in question is a manifold hedge (i.e. it is
581  /// equivalent to exactly one other hedge oriented oppositely).
582 
583  /// Returns the first hedge with the same dst as e that is reachable
584  /// from e through a counterclockwise manifold scan around dst of e.
585  /// Returns e itself if either:
586  /// 1) e is already the first such hedge, or
587  /// 2) the src of e is an interior point of a manifold,
588  /// ie the counterclockwise scan reaches back at e.
590  { return geo_hedge::firstManifoldIncomingHedge(*this, e); }
591 
594  { return firstManifoldIncomingHedge(e); }
595  /// Returns the previous hedge with the same dst as e in a
596  /// counterclockwise manifold scan, returns GEO_INVALID_HEDGE if no
597  /// such hedge exists.
598  ///
599  /// NOTE: This is equivalent to dprev() operation in Quad-Edge
600  /// terminology, which is also used in GQ.
602  { return geo_hedge::prevManifoldIncomingHedge(*this, e); }
603 
606  { return prevManifoldIncomingHedge(e); }
607 
608  /// Returns the next hedge with the same dst as e in a counterclockwise
609  /// manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.
610  ///
611  /// NOTE: This is equivalent to dnext() operation in Quad-Edge
612  /// terminology, which is also used in GQ.
614  { return geo_hedge::nextManifoldIncomingHedge(*this, e); }
615 
618  { return nextManifoldIncomingHedge(e); }
619 
620  /// Similar to firstManifoldIncomingHedge but finds the first hedge with
621  /// the same src as e in a counterclockwise scan from e.
623  { return geo_hedge::firstManifoldOutgoingHedge(*this, e); }
624 
627  { return firstManifoldOutgoingHedge(e); }
628 
629  /// Returns the previous hedge with the same src as e in a counterclockwise
630  // manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.
631  ///
632  /// NOTE: This is equivalent to oprev() operation in Quad-Edge
633  /// terminology, which is also used in GQ.
635  { return geo_hedge::prevManifoldOutgoingHedge(*this, e); }
636 
639  { return prevManifoldOutgoingHedge(e); }
640 
641  /// Returns the next hedge with the same src as e in a counterclockwise
642  /// manifold scan, returns GEO_INVALID_HEDGE if no such hedge exists.
643  ///
644  /// NOTE: This is equivalent to onext() operation in Quad-Edge
645  /// terminology, which is also used in GQ.
647  { return geo_hedge::nextManifoldOutgoingHedge(*this, e); }
648 
651  { return nextManifoldOutgoingHedge(e); }
652 
653  /// Returns the length of the hedge e.
654  /// Note that it requires the endpoints of e to be determined.
656  { return geo_hedge::length(*this, e); }
657 
658  /// Returns the positions of the source point of e
660  { return geo_hedge::srcPos3(myGdp, e); }
661 
662  /// Returns the positions of the destination point of e
664  { return geo_hedge::dstPos3(*this, e); }
665 
666  /// Returns the vector defined by the end-points of e
668  { return dstPos3(e) - srcPos3(e); }
669 
670  /// Returns the primitives angle at dst of the hedge
671  /// NB. If the angle in question is reflex, then its 2*pi complement is
672  /// returned unless the normal of the primitive that contains e is
673  /// passed using the optional nml parameter.
675  { return geo_hedge::dstPrimitiveAngle(*this, e, nml); }
676 
677  /// Returns the primitives angle at src of the hedge
678  /// NB. If the angle in question is reflex, then its 2*pi complement is
679  /// returned unless the normal of the primitive that contains e is
680  /// passed using the optional nml parameter.
682  { return geo_hedge::srcPrimitiveAngle(*this, e, nml); }
683 
684  /// Returns the primitives angle at dst of the hedge
686  { return geo_hedge::dstPrimitiveAngleCos(*this, e); }
687 
688  /// Returns the primitives angle at src of the hedge
690  { return geo_hedge::srcPrimitiveAngleCos(*this, e); }
691 
692  /// Returns true if the hedge e is a manifold hedge, if accept_bd is
693  /// false, this means that the equivalence class of e consists of
694  /// exactly two hedges oriented oppositely. If accept_bd is true, then
695  /// the equivalence class of e can also consist of a single (boundary)
696  /// half-edge.
697  bool isManifoldHedge(GEO_Hedge e, bool accept_bd = false) const
698  { return geo_hedge::isManifoldHedge(*this, e, accept_bd); }
699 
700  /// Returns true if the hedge e is a boundary hedge, i.e. if its
701  /// equivalence class is singleton.
703  { return geo_hedge::isBoundaryHedge(*this, e); }
704 
705  /// Returns true if the hedge e is a bridge hedge, i.e. if is a
706  /// manifold hedge and its other equivalent hedge belongs to the
707  /// same primitive as e does.
708  bool isBridgeHedge(GEO_Hedge e) const
709  { return geo_hedge::isBridgeHedge(*this, e); }
710 
711  /// Returns true if e1 and e2 are equivalent hedges with opposite
712  /// orientation.
713  bool areOpposite(GEO_Hedge e1, GEO_Hedge e2) const
714  { return geo_hedge::areOpposite(*this, e1, e2); }
715 
716  /// Returns true if e1 and e2 are equivalent hedges.
717  bool areEquivalent(GEO_Hedge e1, GEO_Hedge e2) const
718  { return geo_hedge::areEquivalent(*this, e1, e2); }
719 
720  /// Returns the number of hedges in the equivalence class of e.
722  { return geo_hedge::numEquivalentHedges(*this, e); }
723 
724  /// Returns the number if *edges* incident to a point (equivalent hedges
725  /// count as 1).
727  { return geo_hedge::numIncidentEdges(*this, pt); }
728 
729  /// Returns the number of distinct *hedges* incident to pt
731  { return geo_hedge::numIncidentHedges(*this, pt); }
732 
733  /// Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE
735  { return geo_hedge::findHedgeWithEndpoints(*this, p0, p1); }
736 
737  /// Returns the number of primitives that have pt as a vertex and support
738  /// hedges.
739  GA_Size numIncidentHedgeSupportingPrims(GA_Offset pt) const;
740 
741  // operations involving half-edges
742 
743  /// Rotate e forward, provided that e is a manifold hedge (equivalent
744  /// to exactly one other hedge f oppositely oriented. This is not checked
745  /// and the topology may be corrupted if rotate is applied to non-manifold
746  /// or boundary edges. Returns the resulting hedge which happens to be
747  /// equal to e (The input hedge will be the hedge that rotates (same src
748  /// vertex) and the same holds for the equivalent edge of e.
749  ///
750  /// ------>------> ------>------>
751  /// ^ |^ | ^ /7|
752  /// | || | | // |
753  /// | e || | ===> | e // |
754  /// | || | | // |
755  /// | v| v | // v
756  /// <------<------ |L/<---<------
757  ///
758  /// Note that this operation is precisely an edge flip if the two
759  /// primitives involved are triangles.
760 
761  GEO_Hedge rotateForward(GEO_Hedge e);
762 
763  /// Complete reverse of rotateForward (all the point, vertex, and
764  /// primitive offsets are restored). When the incident primitives are
765  /// triangles, rotating forward or backward result in the same edge but
766  /// they are not exactly identical. In particular, two consecutive flips
767  /// on the same edge will reverse the orientation of the edge.
768 
769  GEO_Hedge rotateBackward(GEO_Hedge e);
770 
771  /// Returns true if e can be flipped without the result overlapping an
772  /// existing hedge. In other words, e is flippable if its endpoints are
773  /// not endpoints of an existing edge in the geometry before the flip that
774  /// is not equivalent to e.
775 
776  bool isFlippable(GEO_Hedge e) const;
777 
778  /// Flip e (provided that e is shared between two triangles) and is
779  /// flippable. Returns the resulting (flipped) hedge (equal to e) or
780  /// GEO_INVALID_HEDGE if e is not flippable.
781 
782  GEO_Hedge flip(GEO_Hedge e);
783 
784  /// unflip is the reverse of a flip. Doing a flip followed by an unflip
785  /// should result in the same mesh with the same vertex/point/primtive
786  /// offsets and indices (but the vertices within primitives may shift).
787  GEO_Hedge unflip(GEO_Hedge e);
788 
789  /// Returns true if the hedge e is contractible, i.e. contracting e does
790  /// not force a a non-trivial (separating) cycle to collapse. A separating
791  /// cycle is a closed sequence of edges that if removed (together with
792  /// their incident geometry elements) the number of connected components
793  // increases. Contracting a non-contractible edge will split geometry into
794  /// multiple components.
795  bool isContractible(GEO_Hedge e) const;
796 
797  /// Contracts e.
798  /// @parameter on_dst, if true, causes the src point to move to the
799  /// position of the dst point. Otherwise, the dst point
800  /// is moved to the src point's position.
801  /// @parameter ratio, if not equal to 1.0, places the point of contraction
802  /// in a convex combination with biases ratio and
803  /// 1.0 - ratio from src and dst (or the other way around
804  /// if on_dst is false) respectively.
805  GA_Offset contract(GEO_Hedge e, bool on_dst = true, fpreal ratio = 1.0,
806  bool check_contractible = true);
807 
808 #if 0
809  GA_Offset contractNew(GEO_Hedge e, bool on_dst = true, fpreal ratio = 1.0);
810 #endif
811 
812  /// Splits the hedge e and its incident polygon (assumed to be a triangle,
813  /// although it doesn't fail if it isn't).
814  /// @parameter ratio determines the position of the new point at which the
815  /// hedge is split.
816  /// @parameter and_equivalent if true also splits all other hedges
817  /// equivalent to e at the same point.
818  /// @parameter poff is an optional point offset assumed to be located in
819  // the correct position (as given by ratio). This allows
820  // the caller to reuse points already created.
821  GEO_Hedge split(GEO_Hedge e, fpreal ratio, bool and_equivalent = true,
823 
824 
825  GEO_Hedge reversibleSplit(GEO_Hedge e, fpreal ratio,
826  bool and_equivalent = true,
828 
829 
830  /// Inserts a point in the middle of a hedge and divides into two hedges.
831  ///
832  /// @parameter ratio determines the position of the new point at which the
833  /// hedge is split.
834  /// @parameter and_equivalent if true also divides all other hedges
835  /// equivalent to e at the same point.
836  /// @parameter poff is an optional point offset assumed to be located in
837  // the correct position (as given by ratio). This allows
838  // the caller to reuse points already created.
839  GEO_Hedge divideHedge(GEO_Hedge e, fpreal ratio,
840  bool and_equivalent = true,
842 
843  /// Splits the primitive of a hedge into two primitives by cutting it
844  /// along a diagonal. The hedges starting from ekeep and ending
845  /// before edrop are kept in the current primitive while the edges
846  /// hedges starting at edrop and ending before ekeep end up in the
847  /// new primitive.
848  GEO_Hedge divideHedgePrimitive(GEO_Hedge ekeep, GEO_Hedge edrop);
849 
850  /// Subdivides the polygon of e at its barycenter or the supplied point
851  GA_Offset splitHedgePrimitive(GEO_Hedge e,
853 
854  // Deletes the *star* of a point. The star of a point in a polygonal
855  // complex consists of all edges and polygons incident to that point.
856  // So, deleting the star of an internal point on a manifold should leave
857  // a hole behind. If the patch_link is set to true, the hole is patched
858  // (if possible) with a new polygon. For this be possible the point *must*
859  // be an internal manifold point. If patching is possible then one of
860  // the polygons previously incident to pt can be specified as patch_prim
861  // to extend and become the patching polygon. If this polygon is not
862  // specified or is not actually incident to pt, then a new polygon will
863  // be created.
864  void deletePointStar(GA_Offset pt, bool patch_link = true,
865  GA_Offset patch_prim = GA_INVALID_OFFSET);
866 
867  GA_Detail *getDetail() const { return myGdp; }
868 
870  GA_Offset prevPrimVertex(GA_Offset v) const;
871 
873  GA_Offset nextPrimVertex(GA_Offset v) const;
874 
876  void getAdjacentPrimVertices(GA_Offset v, GA_Offset &vprev,
877  GA_Offset &vnext) const;
878 private:
879 
880  GA_Detail *myGdp;
881  GA_Topology &myTopology;
882  bool myKeepHedgeTopology;
883  bool myHaveHedgeTopology;
884  GA_ElementWranglerCache *myWranglerCache;
885 };
886 
887 
888 GA_Offset
890 {
891  GA_Offset vprev, vnext;
892  myGdp->getTopology().getAdjacentBoundaryVertices(v, vprev, vnext);
893  return vprev;
894 }
895 
896 
897 GA_Offset
899 {
900  GA_Offset vprev, vnext;
901  myGdp->getTopology().getAdjacentBoundaryVertices(v, vprev, vnext);
902  return vnext;
903 }
904 
905 void
907  GA_Offset &vnext) const
908 {
909  myGdp->getTopology().getAdjacentBoundaryVertices(v, vprev, vnext);
910 }
911 
912 GA_Offset
914 {
915  return myPrimPrevRef(v);
916 }
917 
918 
919 GA_Offset
921 {
922  return myPrimNextRef(v);
923 }
924 
925 void
927  GA_Offset &vprev,
928  GA_Offset &vnext) const
929 {
930  vprev = myPrimPrevRef(v);
931  vnext = myPrimNextRef(v);
932 }
933 
934 #endif
bool haveHedgeTopology() const
GA_Offset preSrcPoint(GEO_Hedge e) const
GEO_Hedge firstOutgoingHedge(T &iface, GA_Offset point)
Definition: GEO_Hedge.h:504
SYS_FORCE_INLINE GEO_Hedge nextPrimitiveHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:255
SYS_FORCE_INLINE GEO_Hedge dnext(GEO_Hedge e) const
GEO_Hedge firstManifoldIncomingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:687
UT_Vector3 hedgeVector(GEO_Hedge e) const
Returns the vector defined by the end-points of e.
SYS_FORCE_INLINE bool areOpposite(T &iface, GEO_Hedge e1, GEO_Hedge e2)
Definition: GEO_Hedge.h:364
SYS_FORCE_INLINE bool isManifoldHedge(T &iface, GEO_Hedge e, bool accept_bd)
Definition: GEO_Hedge.h:332
UT_Vector3 srcPos3(GEO_Hedge e) const
Returns the positions of the source point of e.
SYS_FORCE_INLINE GEO_Hedge sym(GEO_Hedge e) const
GEO_Hedge firstOutgoingHedge(GA_Offset pt) const
GA_Offset srcPoint(GEO_SHedge se) const
Returns the src vertex of a signed hedge.
GEO_Hedge prevManifoldIncomingHedge(GEO_Hedge e) const
SYS_FORCE_INLINE void getAdjacentPrimVertices(GA_Offset v, GA_Offset &vprev, GA_Offset &vnext) const
SYS_FORCE_INLINE GA_Offset preSrcPoint(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:239
SYS_FORCE_INLINE UT_Vector3 dstPos3(T &iface, GEO_Hedge h)
Definition: GEO_Hedge.h:743
GA_Offset dstPoint(GEO_SHedge se) const
Returns the src vertex of a signed hedge.
GEO_Hedge firstManifoldOutgoingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:672
GA_Offset srcVertex(GEO_Hedge e) const
Returns the src vertex of the hedge.
GEO_Hedge prevManifoldIncomingHedge(GEO_Hedge e) const
GEO_Hedge otherPrimitiveHedgeAtPoint(GEO_Hedge e, GA_Offset pt) const
SYS_FORCE_INLINE GEO_Hedge lnext(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge lnext(GEO_Hedge e) const
GA_Offset postDstPoint(GEO_Hedge e) const
GA_Offset postDstVertex(GEO_Hedge e) const
GA_Offset preSrcVertex(GEO_Hedge e) const
bool areEquivalent(GEO_Hedge e1, GEO_Hedge e2) const
Returns true if e1 and e2 are equivalent hedges.
const GLdouble * v
Definition: glcorearb.h:836
GEO_Primitive * hedgePrimitive(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge lprev(GEO_Hedge e) const
bool GAisValid(GA_Size v)
Definition: GA_Types.h:625
fpreal srcPrimitiveAngleCos(GEO_Hedge e) const
Returns the primitives angle at src of the hedge.
GA_Size numIncidentHedges(T &iface, GA_Offset point)
Definition: GEO_Hedge.h:839
GEO_Hedge nextOutgoingHedge(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge dprev(GEO_Hedge e) const
GA_Offset dstVertex(GEO_Hedge e) const
Returns the dst vertex of the hedge.
GEO_Hedge nextIncomingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:572
SYS_FORCE_INLINE bool isBoundaryHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:298
SYS_FORCE_INLINE fpreal dstPrimitiveAngleCos(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:790
GA_Offset srcVertex(GEO_Hedge)
Definition: GEO_Hedge.h:166
SYS_FORCE_INLINE GA_Offset srcPoint(const GA_Detail *gdp, GEO_Hedge e)
Definition: GEO_Hedge.h:173
SYS_FORCE_INLINE void getAdjacentPrimVertices(GA_Offset v, GA_Offset &vprev, GA_Offset &vnext) const
bool areOpposite(GEO_Hedge e1, GEO_Hedge e2) const
SYS_FORCE_INLINE GEO_Hedge onext(GEO_Hedge e) const
SYS_FORCE_INLINE UT_Vector3 srcPos3(const GA_Detail *gdp, GEO_Hedge h)
Definition: GEO_Hedge.h:735
void setWranglerCache(GA_ElementWranglerCache *wc)
bool areOpposite(GEO_Hedge e1, GEO_Hedge e2) const
GEO_Hedge nextManifoldOutgoingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:610
#define GEO_INVALID_HEDGE
An invalid hedge is sometimes returned if an operation is unsuccessful.
Definition: GEO_Hedge.h:32
GEO_Hedge nextIncidentEdge(T &iface, GEO_Hedge e, GA_Offset point)
Definition: GEO_Hedge.h:487
GA_Offset dstPoint(GEO_Hedge e) const
Returns the point to which the dst vertex is wired.
SYS_FORCE_INLINE GEO_Hedge onext(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge dfirst(GEO_Hedge e) const
SYS_FORCE_INLINE GA_Offset hedgePrimitiveOffset(const GA_Detail *gdp, GEO_Hedge e)
Definition: GEO_Hedge.h:180
UT_Vector3 hedgeVector(GEO_Hedge e) const
Returns the vector defined by the end-points of e.
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
GEO_Hedge prevManifoldOutgoingHedge(GEO_Hedge e) const
Returns the previous hedge with the same src as e in a counterclockwise.
GEO_Hedge nextManifoldIncomingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:657
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_Offset hedgePrimitiveOffset(GEO_Hedge e) const
bool isBoundaryHedge(GEO_Hedge e) const
UT_Vector3 dstPos3(GEO_Hedge e) const
Returns the positions of the destination point of e.
SYS_FORCE_INLINE GEO_Hedge dfirst(GEO_Hedge e) const
SYS_FORCE_INLINE GA_Offset dstVertex(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:202
GEO_Hedge firstManifoldIncomingHedge(GEO_Hedge e) const
Manifold Scan Methods:
GEO_DetachedHedgeInterface(const GA_Detail *gdp, const GA_PrimitiveGroup *prims=NULL, bool exclude_prims=true)
SYS_FORCE_INLINE fpreal srcPrimitiveAngleCos(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:780
SYS_FORCE_INLINE GEO_Hedge dnext(GEO_Hedge e) const
GA_Size GA_Offset
Definition: GA_Types.h:617
GEO_Hedge firstIncomingHedge(T &iface, GA_Offset point)
Definition: GEO_Hedge.h:553
GEO_Hedge findHedgeWithEndpoints(GA_Offset p0, GA_Offset p1) const
Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE.
GA_Size numIncidentHedges(GA_Offset pt) const
Returns the number of distinct hedges incident to pt.
GEO_Hedge firstIncidentEdge(T &iface, GA_Offset point)
Definition: GEO_Hedge.h:467
fpreal dstPrimitiveAngle(GEO_Hedge e, UT_Vector3 *nml=0) const
SYS_FORCE_INLINE GA_Offset postDstVertex(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:218
fpreal length(GEO_Hedge e) const
fpreal dstPrimitiveAngle(GEO_Hedge e, UT_Vector3 *nml=0) const
GEO_SHedge primary(GEO_SHedge e) const
SYS_FORCE_INLINE GA_Offset postDstPoint(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:247
GA_Offset srcPoint(GEO_Hedge e) const
Returns the point to which the src vertex is wired.
SYS_FORCE_INLINE fpreal dstPrimitiveAngle(T &iface, GEO_Hedge e, UT_Vector3 *nml)
Definition: GEO_Hedge.h:757
GEO_Hedge nextManifoldOutgoingHedge(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge ofirst(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge ofirst(GEO_Hedge e) const
SYS_FORCE_INLINE fpreal length(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:703
GA_Offset srcVertex(GEO_Hedge e) const
Returns the src vertex of the hedge.
GEO_Hedge encapsulates a half-edge (hedge) which is the restriction of.
Definition: GEO_Hedge.h:47
SYS_FORCE_INLINE GEO_Hedge oprev(GEO_Hedge e) const
bool isBridgeHedge(GEO_Hedge e) const
GA_Size numIncidentHedges(GA_Offset pt) const
Returns the number of distinct hedges incident to pt.
GEO_Hedge firstIncomingHedge(GA_Offset pt) const
bool isBoundaryHedge(GEO_Hedge e) const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool areOpposite(GEO_SHedge e1, GEO_SHedge e2) const
GEO_Hedge nextIncidentHedge(GEO_Hedge e, GA_Offset pt) const
bool isPositive() const
Definition: GEO_Hedge.h:94
GEO_Hedge firstManifoldOutgoingHedge(GEO_Hedge e) const
#define GEO_API
Definition: GEO_API.h:10
SYS_FORCE_INLINE GA_Offset preSrcVertex(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:210
SYS_FORCE_INLINE GA_Offset nextPrimVertex(GA_Offset v) const
GEO_Hedge nextManifoldOutgoingHedge(GEO_Hedge e) const
const GA_Detail * getDetail() const
GA_Offset hedgePrimitiveOffset(GEO_Hedge e) const
void getAdjacentBoundaryVertices(GA_Offset vtx, GA_Offset &prev_vtx, GA_Offset &next_vtx) const
bool isManifoldHedge(GEO_Hedge e, bool accept_bd=false) const
GEO_Hedge prevManifoldOutgoingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:626
SYS_FORCE_INLINE GA_Offset nextPrimVertex(GA_Offset v) const
fpreal length(GEO_Hedge e) const
GEO_Hedge nextPrimitiveHedge(GEO_Hedge e) const
GA_Offset dstPoint(GEO_Hedge e) const
Returns the point to which the dst vertex is wired.
GA_Offset postDstVertex(GEO_Hedge e) const
GEO_Hedge prevManifoldIncomingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:643
SYS_FORCE_INLINE GEO_Hedge primary(GEO_Hedge e) const
GEO_Hedge prevPrimitiveHedge(GEO_Hedge e) const
SYS_FORCE_INLINE GEO_Hedge sym(GEO_Hedge e) const
SYS_FORCE_INLINE GA_Offset dstPoint(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:231
SYS_FORCE_INLINE const GA_Primitive * hedgePrimitive(const GA_Detail *gdp, GEO_Hedge e)
Definition: GEO_Hedge.h:187
fpreal srcPrimitiveAngle(GEO_Hedge e, UT_Vector3 *nml=0) const
SYS_FORCE_INLINE GEO_Hedge lprev(GEO_Hedge e) const
GEO_Hedge otherPrimitiveHedgeAtPoint(GEO_Hedge e, GA_Offset pt) const
GA_Topology & getTopology()
Definition: GA_Detail.h:734
SYS_FORCE_INLINE GEO_Hedge primary(GEO_Hedge e) const
fpreal dstPrimitiveAngleCos(GEO_Hedge e) const
Returns the primitives angle at dst of the hedge.
GEO_Hedge firstIncidentEdge(GA_Offset pt) const
double fpreal
Definition: SYS_Types.h:270
GEO_Hedge firstIncidentHedge(GA_Offset pt) const
GEO_Hedge firstManifoldOutgoingHedge(GEO_Hedge e) const
GA_Detail * getDetail() const
GEO_Hedge nextOutgoingHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:519
SYS_FORCE_INLINE GEO_Hedge dprev(GEO_Hedge e) const
GEO_Hedge findHedgeWithEndpoints(T &iface, GA_Offset p0, GA_Offset p1)
Definition: GEO_Hedge.h:800
GEO_Hedge nextManifoldIncomingHedge(GEO_Hedge e) const
GEO_Hedge firstOutgoingHedge(GA_Offset pt) const
SYS_FORCE_INLINE bool areEquivalent(T &iface, GEO_Hedge e1, GEO_Hedge e2)
Definition: GEO_Hedge.h:287
GEO_Hedge nextIncidentEdge(GEO_Hedge e, GA_Offset pt) const
GEO_Hedge nextIncidentEdge(GEO_Hedge e, GA_Offset pt) const
GEO_Hedge firstIncidentEdge(GA_Offset pt) const
GA_Offset preSrcVertex(GEO_Hedge e) const
GA_Offset postDstPoint(GEO_Hedge e) const
fpreal srcPrimitiveAngleCos(GEO_Hedge e) const
Returns the primitives angle at src of the hedge.
bool isManifoldHedge(GEO_Hedge e, bool accept_bd=false) const
SYS_FORCE_INLINE GEO_Hedge otherPrimitiveHedgeAtPoint(T &iface, GEO_Hedge e, GA_Offset point)
Definition: GEO_Hedge.h:271
bool areEquivalent(GEO_SHedge e1, GEO_SHedge e2) const
Returns true if e1 and e2 are equivalent signed hedges.
bool isBridgeHedge(GEO_Hedge e) const
GEO_Hedge nextIncidentHedge(T &iface, GEO_Hedge e, GA_Offset pt)
Definition: GEO_Hedge.h:406
GEO_Hedge prevPrimitiveHedge(GEO_Hedge e) const
Container class for all geometry.
Definition: GA_Detail.h:95
GA_Offset srcVertex(GEO_SHedge se) const
Returns the src vertex of a signed hedge.
UT_Vector3 srcPos3(GEO_Hedge e) const
Returns the positions of the source point of e.
GEO_Hedge firstIncidentHedge(T &iface, GA_Offset pt)
Definition: GEO_Hedge.h:383
SYS_FORCE_INLINE GEO_Hedge hedge() const
Definition: GEO_Hedge.h:145
SYS_FORCE_INLINE GEO_Hedge prevPrimitiveHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:263
SYS_FORCE_INLINE GA_Offset prevPrimVertex(GA_Offset v) const
GA_Size numEquivalentHedges(GEO_Hedge e) const
Returns the number of hedges in the equivalence class of e.
fpreal srcPrimitiveAngle(GEO_Hedge e, UT_Vector3 *nml=0) const
GA_Size numIncidentEdges(T &iface, GA_Offset point)
Definition: GEO_Hedge.h:820
bool areEquivalent(GEO_Hedge e1, GEO_Hedge e2) const
Returns true if e1 and e2 are equivalent hedges.
SYS_FORCE_INLINE GA_Size numEquivalentHedges(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:348
GEO_Hedge nextOutgoingHedge(GEO_Hedge e) const
fpreal dstPrimitiveAngleCos(GEO_Hedge e) const
Returns the primitives angle at dst of the hedge.
GEO_Hedge prevManifoldOutgoingHedge(GEO_Hedge e) const
Returns the previous hedge with the same src as e in a counterclockwise.
GA_Offset preSrcPoint(GEO_Hedge e) const
GEO_Hedge findHedgeWithEndpoints(GA_Offset p0, GA_Offset p1) const
Find a hedge with the given endpoints or return GEO_INVLAID_HEDGE.
SYS_FORCE_INLINE GA_Offset prevPrimVertex(GA_Offset v) const
GA_Size numEquivalentHedges(GEO_Hedge e) const
Returns the number of hedges in the equivalence class of e.
bool isBridgeHedge(T &iface, GEO_Hedge e)
Definition: GEO_Hedge.h:305
GEO_Hedge nextIncomingHedge(GEO_Hedge e) const
SYS_FORCE_INLINE fpreal srcPrimitiveAngle(T &iface, GEO_Hedge e, UT_Vector3 *nml)
Definition: GEO_Hedge.h:750
GA_Size numIncidentEdges(GA_Offset pt) const
GA_Offset dstVertex(GEO_Hedge e) const
Returns the dst vertex of the hedge.
SYS_FORCE_INLINE GEO_Hedge oprev(GEO_Hedge e) const
GEO_Hedge nextPrimitiveHedge(GEO_Hedge e) const
UT_Vector3 dstPos3(GEO_Hedge e) const
Returns the positions of the destination point of e.
GEO_Hedge firstManifoldIncomingHedge(GEO_Hedge e) const
Manifold Scan Methods:
const GEO_Primitive * hedgePrimitive(GEO_Hedge e) const
GA_Offset srcPoint(GEO_Hedge e) const
Returns the point to which the src vertex is wired.
GA_Size numIncidentEdges(GA_Offset pt) const
GA_Offset dstVertex(GEO_SHedge se) const
Returns the src vertex of a signed hedge.
GEO_Hedge nextManifoldIncomingHedge(GEO_Hedge e) const