Panda3D
Public Types | Public Member Functions | Public Attributes | List of all members
EggMesherEdge Class Reference

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 &copy)
 
void change_strip (EggMesherStrip *from, EggMesherStrip *to)
 Reparents the edge from strip "from" to strip "to". More...
 
EggMesherEdgecommon_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
 

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

Constructor & Destructor Documentation

◆ EggMesherEdge()

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

Member Function Documentation

◆ change_strip()

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.

◆ common_ptr()

EggMesherEdge * EggMesherEdge::common_ptr ( )
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.

◆ compute_box()

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

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

◆ compute_length()

double EggMesherEdge::compute_length ( const EggVertexPool vertex_pool) const
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().

◆ contains_vertex()

bool EggMesherEdge::contains_vertex ( int  vi) const
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().

◆ matches()

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

Referenced by EggMesherStrip::mate_strips().

◆ operator<()

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

◆ output()

void EggMesherEdge::output ( std::ostream &  out) const

Formats the edge for output in some sensible way.

Definition at line 55 of file eggMesherEdge.cxx.

◆ remove()

void EggMesherEdge::remove ( EggMesherStrip strip)

Removes an edge from a particular strip.

Definition at line 21 of file eggMesherEdge.cxx.


The documentation for this class was generated from the following files: