diff --git a/panda/src/builder/mesherFanMaker.I b/panda/src/builder/mesherFanMaker.I index 5499145c62..6877539d8c 100644 --- a/panda/src/builder/mesherFanMaker.I +++ b/panda/src/builder/mesherFanMaker.I @@ -24,9 +24,62 @@ #include +//////////////////////////////////////////////////////////////////// +// Function: MesherFanMaker::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +MesherFanMaker:: +MesherFanMaker(const Vertex *vertex, Strip *tri, Mesher *mesher) { + _vertex = vertex; + const Edge *edge = tri->find_opposite_edge(vertex); + if (edge != (const Edge *)NULL) { + _edges.push_back(edge); + } + _strips.push_back(tri); + _planar = tri->_planar; + _mesher = mesher; + _bucket = _mesher->_bucket; +} + +//////////////////////////////////////////////////////////////////// +// Function: MesherFanMaker::Copy Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +MesherFanMaker:: +MesherFanMaker(const MesherFanMaker ©) : + _vertex(copy._vertex), + _edges(copy._edges), + _strips(copy._strips), + _planar(copy._planar), + _bucket(copy._bucket), + _mesher(copy._mesher) +{ +} + +//////////////////////////////////////////////////////////////////// +// Function: MesherFanMaker::Copy Assignment Operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +void MesherFanMaker:: +operator = (const MesherFanMaker ©) { + _vertex = copy._vertex; + _edges = copy._edges; + _strips = copy._strips; + _planar = copy._planar; + _bucket = copy._bucket; + _mesher = copy._mesher; +} + template INLINE bool MesherFanMaker:: operator < (const MesherFanMaker &other) const { + nassertr(!_edges.empty() && !other._edges.empty(), false); return _edges.front() < other._edges.front(); } @@ -68,20 +121,6 @@ is_coplanar_with(const MesherFanMaker &other) const { _bucket->_coplanar_threshold); } -template -MesherFanMaker:: -MesherFanMaker(const Vertex *vertex, Strip *tri, Mesher *mesher) { - _vertex = vertex; - const Edge *edge = tri->find_opposite_edge(vertex); - if (edge != (const Edge *)NULL) { - _edges.push_back(edge); - } - _strips.push_back(tri); - _planar = tri->_planar; - _mesher = mesher; - _bucket = _mesher->_bucket; -} - template bool MesherFanMaker:: join(MesherFanMaker &other) { diff --git a/panda/src/builder/mesherFanMaker.h b/panda/src/builder/mesherFanMaker.h index 88b360f4a7..24ce6c4618 100644 --- a/panda/src/builder/mesherFanMaker.h +++ b/panda/src/builder/mesherFanMaker.h @@ -52,6 +52,8 @@ public: MesherFanMaker() {} MesherFanMaker(const Vertex *vertex, Strip *tri, Mesher *mesher); + MesherFanMaker(const MesherFanMaker ©); + void operator = (const MesherFanMaker ©); INLINE bool operator < (const MesherFanMaker &other) const; INLINE bool operator != (const MesherFanMaker &other) const; diff --git a/panda/src/builder/mesherTempl.I b/panda/src/builder/mesherTempl.I index 60ebd9b4b0..36df13d974 100644 --- a/panda/src/builder/mesherTempl.I +++ b/panda/src/builder/mesherTempl.I @@ -534,7 +534,10 @@ find_fans() { ++si) { Strip *strip = *si; if (strip->_type == BPT_tri) { - fans.push_back(FanMaker(&v, strip, this)); + FanMaker fan(&v, strip, this); + if (!fan._edges.empty()) { + fans.push_back(fan); + } } } }