Represents one edge of a triangle, as used by the EggMesher to discover connected triangles. More...
#include "eggMesherEdge.h"
Public Types | |
typedef plist< EggMesherStrip * > | Strips |
Public Member Functions | |
EggMesherEdge (int vi_a, int vi_b) | |
Defines an edge as a pair of vertices. More... | |
EggMesherEdge (const EggMesherEdge ©) | |
void | change_strip (EggMesherStrip *from, EggMesherStrip *to) |
Reparents the edge from strip "from" to strip "to". More... | |
EggMesherEdge * | common_ptr () |
Returns an arbitrary pointer that is used to represent both this edge and its opposite. More... | |
LVecBase3d | compute_box (const EggVertexPool *vertex_pool) const |
Returns a 3-component vector that represents the lengths of the sides of the smalled axis-aligned box that contains the edge. More... | |
double | compute_length (const EggVertexPool *vertex_pool) const |
Returns the length of the edge in model units. More... | |
bool | contains_vertex (int vi) const |
Returns true if the edge contains the indicated vertex index, false otherwise. More... | |
bool | matches (const EggMesherEdge &other) const |
Returns true if this edge represents the same line segment as the other edge, in either direction. More... | |
bool | operator != (const EggMesherEdge &other) const |
bool | operator< (const EggMesherEdge &other) const |
Defines an arbitrary ordering for edges, used for putting edges in a sorted container. More... | |
bool | operator== (const EggMesherEdge &other) const |
void | output (std::ostream &out) const |
Formats the edge for output in some sensible way. More... | |
void | remove (EggMesherStrip *strip) |
Removes an edge from a particular strip. More... | |
Public Attributes | |
EggMesherEdge * | _opposite |
Strips | _strips |
int | _vi_a |
int | _vi_b |
Represents one edge of a triangle, as used by the EggMesher to discover connected triangles.
The edge is actually represented as a pair of vertex indices into the same vertex pool.
Definition at line 29 of file eggMesherEdge.h.
|
inline |
Defines an edge as a pair of vertices.
The _opposite pointer should be filled in explicitly by the caller.
Definition at line 19 of file eggMesherEdge.I.
void EggMesherEdge::change_strip | ( | EggMesherStrip * | from, |
EggMesherStrip * | to | ||
) |
Reparents the edge from strip "from" to strip "to".
Definition at line 33 of file eggMesherEdge.cxx.
|
inline |
Returns an arbitrary pointer that is used to represent both this edge and its opposite.
this->common_ptr() is guaranteed to be the same as this->_opposite->common_ptr().
Definition at line 60 of file eggMesherEdge.I.
|
inline |
Returns a 3-component vector that represents the lengths of the sides of the smalled axis-aligned box that contains the edge.
That is, the projection the edge onto each axis.
Definition at line 108 of file eggMesherEdge.I.
References EggVertex::get_pos3(), and EggVertexPool::get_vertex().
|
inline |
Returns the length of the edge in model units.
Definition at line 96 of file eggMesherEdge.I.
References EggVertex::get_pos3(), and EggVertexPool::get_vertex().
Referenced by EggMesherStrip::pick_mate().
|
inline |
Returns true if the edge contains the indicated vertex index, false otherwise.
Definition at line 40 of file eggMesherEdge.I.
Referenced by EggMesherStrip::find_adjacent_edge(), and EggMesherStrip::find_opposite_edge().
|
inline |
Returns true if this edge represents the same line segment as the other edge, in either direction.
Definition at line 49 of file eggMesherEdge.I.
Referenced by EggMesherStrip::mate_strips().
|
inline |
Defines an arbitrary ordering for edges, used for putting edges in a sorted container.
Definition at line 85 of file eggMesherEdge.I.
void EggMesherEdge::output | ( | std::ostream & | out | ) | const |
Formats the edge for output in some sensible way.
Definition at line 55 of file eggMesherEdge.cxx.
void EggMesherEdge::remove | ( | EggMesherStrip * | strip | ) |
Removes an edge from a particular strip.
Definition at line 21 of file eggMesherEdge.cxx.