This class is used by EggMesher::find_fans() to attempt to make an EggTriangleFan out of the polygons connected to the indicated vertex. More...
#include "eggMesherFanMaker.h"
Public Types | |
typedef plist< const EggMesherEdge * > | Edges |
typedef plist< EggMesherStrip * > | Strips |
Public Member Functions | |
EggMesherFanMaker (int vertex, EggMesherStrip *tri, EggMesher *mesher) | |
EggMesherFanMaker (const EggMesherFanMaker ©) | |
int | build (EggGroupNode *unrolled_tris) |
Begins the fanning process. More... | |
double | compute_angle () const |
Returns the overall angle subtended by the fan, from the leading edge to the trailing edge, in degrees. More... | |
bool | is_coplanar_with (const EggMesherFanMaker &other) const |
Returns true if the strip and the other strip are coplanar. More... | |
bool | is_empty () const |
Returns true if the fan maker has no edges, false otherwise. More... | |
bool | is_valid () const |
Returns true if the fan maker has enough edges to define at least one fan, false otherwise. More... | |
bool | join (EggMesherFanMaker &other) |
Attempts to connect two fans end-to-end. More... | |
bool | operator != (const EggMesherFanMaker &other) const |
Provides a unique ordering between different fan makers based on the leading edge. More... | |
bool | operator< (const EggMesherFanMaker &other) const |
Provides a unique ordering between different fan makers based on the leading edge. More... | |
void | operator= (const EggMesherFanMaker ©) |
bool | operator== (const EggMesherFanMaker &other) const |
Provides a unique ordering between different fan makers based on the leading edge. More... | |
void | output (std::ostream &out) const |
int | unroll (Strips::iterator strip_begin, Strips::iterator strip_end, Edges::iterator edge_begin, Edges::iterator edge_end, EggGroupNode *unrolled_tris) |
Unrolls a planar subset of the current working fan, defined by the given iterators, into a series of triangles that zig-zag back and forth for better tristripping properties. More... | |
Public Attributes | |
Edges | _edges |
EggMesher * | _mesher |
bool | _planar |
Strips | _strips |
int | _vertex |
This class is used by EggMesher::find_fans() to attempt to make an EggTriangleFan out of the polygons connected to the indicated vertex.
Definition at line 34 of file eggMesherFanMaker.h.
int EggMesherFanMaker::build | ( | EggGroupNode * | unrolled_tris | ) |
Begins the fanning process.
Searches for triangles and connects them into a fan.
In certain cases, if egg_unroll_fans is enabled, the resulting fan may be retesselated into a series of zig-zag triangles, which are stored in unrolled_tris. Otherwise, an EggMesherStrip (representing the fan) is created and added to the mesher.
The return value is (loosely) the number of primitives created.
Definition at line 148 of file eggMesherFanMaker.cxx.
double EggMesherFanMaker::compute_angle | ( | ) | const |
Returns the overall angle subtended by the fan, from the leading edge to the trailing edge, in degrees.
Definition at line 112 of file eggMesherFanMaker.cxx.
|
inline |
Returns true if the strip and the other strip are coplanar.
Definition at line 63 of file eggMesherFanMaker.I.
|
inline |
Returns true if the fan maker has no edges, false otherwise.
Definition at line 46 of file eggMesherFanMaker.I.
|
inline |
Returns true if the fan maker has enough edges to define at least one fan, false otherwise.
Definition at line 55 of file eggMesherFanMaker.I.
bool EggMesherFanMaker::join | ( | EggMesherFanMaker & | other | ) |
Attempts to connect two fans end-to-end.
They must both share the same common vertex and a common edge.
The return value is true if the fans were successfully joined, or false if they could not be.
Definition at line 68 of file eggMesherFanMaker.cxx.
|
inline |
Provides a unique ordering between different fan makers based on the leading edge.
Definition at line 29 of file eggMesherFanMaker.I.
References operator==().
|
inline |
Provides a unique ordering between different fan makers based on the leading edge.
Definition at line 19 of file eggMesherFanMaker.I.
|
inline |
Provides a unique ordering between different fan makers based on the leading edge.
Definition at line 38 of file eggMesherFanMaker.I.
Referenced by operator !=().
int EggMesherFanMaker::unroll | ( | Strips::iterator | strip_begin, |
Strips::iterator | strip_end, | ||
Edges::iterator | edge_begin, | ||
Edges::iterator | edge_end, | ||
EggGroupNode * | unrolled_tris | ||
) |
Unrolls a planar subset of the current working fan, defined by the given iterators, into a series of triangles that zig-zag back and forth for better tristripping properties.
The new triangles are added to unrolled_tris; the return value is 1 if successful, or 0 otherwise.
Definition at line 259 of file eggMesherFanMaker.cxx.