Panda3D
Loading...
Searching...
No Matches
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 (const EggMesherEdge &copy)
 
 EggMesherEdge (int vi_a, int vi_b)
 Defines an edge as a pair of vertices.
 
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 (std::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 29 of file eggMesherEdge.h.

Member Typedef Documentation

◆ Strips

Definition at line 54 of file eggMesherEdge.h.

Constructor & Destructor Documentation

◆ EggMesherEdge() [1/2]

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

◆ EggMesherEdge() [2/2]

EggMesherEdge::EggMesherEdge ( const EggMesherEdge & copy)
inline

Definition at line 26 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 32 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 59 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 107 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 95 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 39 of file eggMesherEdge.I.

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

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

Referenced by EggMesherStrip::mate_strips().

◆ operator!=()

bool EggMesherEdge::operator!= ( const EggMesherEdge & other) const
inline

Definition at line 75 of file eggMesherEdge.I.

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

◆ operator==()

bool EggMesherEdge::operator== ( const EggMesherEdge & other) const
inline

Definition at line 67 of file eggMesherEdge.I.

◆ output()

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

Formats the edge for output in some sensible way.

Definition at line 54 of file eggMesherEdge.cxx.

◆ remove()

void EggMesherEdge::remove ( EggMesherStrip * strip)

Removes an edge from a particular strip.

Definition at line 20 of file eggMesherEdge.cxx.

Referenced by EggMesherStrip::mate_pieces().

Member Data Documentation

◆ _opposite

EggMesherEdge* EggMesherEdge::_opposite

Definition at line 56 of file eggMesherEdge.h.

◆ _strips

Strips EggMesherEdge::_strips

Definition at line 55 of file eggMesherEdge.h.

◆ _vi_a

int EggMesherEdge::_vi_a

Definition at line 52 of file eggMesherEdge.h.

◆ _vi_b

int EggMesherEdge::_vi_b

Definition at line 52 of file eggMesherEdge.h.


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