Panda3D
Public Types | Public Member Functions | Public Attributes
EggMesherEdge Class Reference

Represents one edge of a triangle, as used by the EggMesher to discover connected triangles. More...

#include "eggMesherEdge.h"

List of all members.

Public Types

typedef plist< EggMesherStrip * > Strips

Public Member Functions

 EggMesherEdge (int vi_a, int vi_b)
 Defines an edge as a pair of vertices.
 EggMesherEdge (const EggMesherEdge &copy)
void change_strip (EggMesherStrip *from, EggMesherStrip *to)
 Reparents the edge from strip "from" to strip "to".
EggMesherEdgecommon_ptr ()
 Returns an arbitrary pointer that is used to represent both this edge and its opposite.
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.
double compute_length (const EggVertexPool *vertex_pool) const
 Returns the length of the edge in model units.
bool contains_vertex (int vi) const
 Returns true if the edge contains the indicated vertex index, false otherwise.
bool matches (const EggMesherEdge &other) const
 Returns true if this edge represents the same line segment as the other edge, in either direction.
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.
bool operator== (const EggMesherEdge &other) const
void output (ostream &out) const
 Formats the edge for output in some sensible way.
void remove (EggMesherStrip *strip)
 Removes an edge from a particular strip.

Public Attributes

EggMesherEdge_opposite
Strips _strips
int _vi_a
int _vi_b

Detailed Description

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 32 of file eggMesherEdge.h.


Constructor & Destructor Documentation

EggMesherEdge::EggMesherEdge ( int  vi_a,
int  vi_b 
) [inline]

Defines an edge as a pair of vertices.

The _opposite pointer should be filled in explicitly by the caller.

Definition at line 23 of file eggMesherEdge.I.


Member Function Documentation

Reparents the edge from strip "from" to strip "to".

Definition at line 38 of file eggMesherEdge.cxx.

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 73 of file eggMesherEdge.I.

LVecBase3d EggMesherEdge::compute_box ( const EggVertexPool vertex_pool) const [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 132 of file eggMesherEdge.I.

References EggVertex::get_pos3(), and EggVertexPool::get_vertex().

double EggMesherEdge::compute_length ( const EggVertexPool vertex_pool) const [inline]

Returns the length of the edge in model units.

Definition at line 117 of file eggMesherEdge.I.

References EggVertex::get_pos3(), EggVertexPool::get_vertex(), and LVecBase3d::length().

Referenced by EggMesherStrip::pick_mate().

bool EggMesherEdge::contains_vertex ( int  vi) const [inline]

Returns true if the edge contains the indicated vertex index, false otherwise.

Definition at line 48 of file eggMesherEdge.I.

Referenced by EggMesherStrip::find_adjacent_edge(), EggMesherStrip::find_opposite_edge(), and EggMesherStrip::mate_pieces().

bool EggMesherEdge::matches ( const EggMesherEdge other) const [inline]

Returns true if this edge represents the same line segment as the other edge, in either direction.

Definition at line 59 of file eggMesherEdge.I.

Referenced by EggMesherStrip::mate_strips().

bool EggMesherEdge::operator< ( const EggMesherEdge other) const [inline]

Defines an arbitrary ordering for edges, used for putting edges in a sorted container.

Definition at line 104 of file eggMesherEdge.I.

void EggMesherEdge::output ( ostream &  out) const

Formats the edge for output in some sensible way.

Definition at line 62 of file eggMesherEdge.cxx.

Removes an edge from a particular strip.

Definition at line 24 of file eggMesherEdge.cxx.

Referenced by EggMesherStrip::mate_pieces().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations