diff --git a/panda/src/builder/builderAttribTempl.I b/panda/src/builder/builderAttribTempl.I index 5800ef5d33..d9679c3eaf 100644 --- a/panda/src/builder/builderAttribTempl.I +++ b/panda/src/builder/builderAttribTempl.I @@ -202,6 +202,21 @@ operator == (const BuilderAttribTempl &other) const { return true; } +//////////////////////////////////////////////////////////////////// +// Function: BuilderAttribTempl::operator != +// Access: Public +// Description: Assigns an ordering to the vertices. This is used by +// the Mesher to group identical vertices. This assumes +// that all vertices in the locus of consideration will +// share the same state: with or without normals, +// texcoords, etc. +//////////////////////////////////////////////////////////////////// +template +INLINE bool BuilderAttribTempl:: +operator != (const BuilderAttribTempl &other) const { + return !operator == (other); +} + //////////////////////////////////////////////////////////////////// // Function: BuilderAttribTempl::operator < // Access: Public diff --git a/panda/src/builder/builderAttribTempl.h b/panda/src/builder/builderAttribTempl.h index f19932922b..adeea043e3 100644 --- a/panda/src/builder/builderAttribTempl.h +++ b/panda/src/builder/builderAttribTempl.h @@ -47,6 +47,7 @@ public: INLINE BuilderAttribTempl &set_pixel_size(float s); INLINE bool operator == (const BuilderAttribTempl &other) const; + INLINE bool operator != (const BuilderAttribTempl &other) const; INLINE bool operator < (const BuilderAttribTempl &other) const; INLINE ostream &output(ostream &out) const; diff --git a/panda/src/builder/builderBucketNode.I b/panda/src/builder/builderBucketNode.I index 7ab9334ec1..e7f84600c7 100644 --- a/panda/src/builder/builderBucketNode.I +++ b/panda/src/builder/builderBucketNode.I @@ -90,3 +90,13 @@ operator == (const BuilderBucketNode &other) const { return !((*_bucket) < (*other._bucket) || (*other._bucket) < (*_bucket)); } + +//////////////////////////////////////////////////////////////////// +// Function: BuilderBucketNode::Nonequivalence operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool BuilderBucketNode:: +operator != (const BuilderBucketNode &other) const { + return !operator == (other); +} diff --git a/panda/src/builder/builderBucketNode.h b/panda/src/builder/builderBucketNode.h index dd88f0b454..ca177a0269 100644 --- a/panda/src/builder/builderBucketNode.h +++ b/panda/src/builder/builderBucketNode.h @@ -41,6 +41,7 @@ public: INLINE bool operator < (const BuilderBucketNode &other) const; INLINE bool operator == (const BuilderBucketNode &other) const; + INLINE bool operator != (const BuilderBucketNode &other) const; int build(GeomNode *geom_node) const; diff --git a/panda/src/builder/builderTypes.h b/panda/src/builder/builderTypes.h index da2c53b560..55b1174f5b 100644 --- a/panda/src/builder/builderTypes.h +++ b/panda/src/builder/builderTypes.h @@ -53,6 +53,9 @@ public: bool operator == (const BuilderTC &other) const { return _v.almost_equal(other._v, nearly_zero); } + bool operator != (const BuilderTC &other) const { + return !operator == (other); + } // The < operator is simply for ordering vectors in a sorted // container; it has no useful mathematical meaning. @@ -88,6 +91,9 @@ public: bool operator == (const BuilderV &other) const { return _v.almost_equal(other._v, nearly_zero); } + bool operator != (const BuilderV &other) const { + return !operator == (other); + } bool operator < (const BuilderV &other) const { return (_v.compare_to(other._v) < 0); } @@ -120,6 +126,9 @@ public: bool operator == (const BuilderN &other) const { return _v.almost_equal(other._v, nearly_zero); } + bool operator != (const BuilderN &other) const { + return !operator == (other); + } bool operator < (const BuilderN &other) const { return (_v.compare_to(other._v) < 0); } @@ -149,12 +158,12 @@ public: _v = copy._v; return *this; } - bool operator != (const BuilderC &other) const { - return !(*this == other); - } bool operator == (const BuilderC &other) const { return _v.almost_equal(other._v, nearly_zero); } + bool operator != (const BuilderC &other) const { + return !(*this == other); + } bool operator < (const BuilderC &other) const { return (_v.compare_to(other._v) < 0); } diff --git a/panda/src/builder/builderVertexTempl.I b/panda/src/builder/builderVertexTempl.I index 2ecea213c0..de98ca7e33 100644 --- a/panda/src/builder/builderVertexTempl.I +++ b/panda/src/builder/builderVertexTempl.I @@ -235,6 +235,21 @@ operator == (const BuilderVertexTempl &other) const { return BuilderAttribTempl::operator == (other); } +//////////////////////////////////////////////////////////////////// +// Function: BuilderVertexTempl::operator != +// Access: Public +// Description: Assigns an ordering to the vertices. This is used by +// the Mesher to group identical vertices. This assumes +// that all vertices in the locus of consideration will +// share the same state: with or without normals, +// texcoords, etc. +//////////////////////////////////////////////////////////////////// +template +INLINE bool BuilderVertexTempl:: +operator != (const BuilderVertexTempl &other) const { + return !operator == (other); +} + //////////////////////////////////////////////////////////////////// // Function: BuilderVertexTempl::operator < // Access: Public diff --git a/panda/src/builder/builderVertexTempl.h b/panda/src/builder/builderVertexTempl.h index 36d3676b70..687741aecc 100644 --- a/panda/src/builder/builderVertexTempl.h +++ b/panda/src/builder/builderVertexTempl.h @@ -52,6 +52,7 @@ public: INLINE BuilderVertexTempl &set_pixel_size(float s); bool operator == (const BuilderVertexTempl &other) const; + INLINE bool operator != (const BuilderVertexTempl &other) const; bool operator < (const BuilderVertexTempl &other) const; ostream &output(ostream &out) const; diff --git a/panda/src/builder/mesherEdge.I b/panda/src/builder/mesherEdge.I index 2e1cc41490..9a3745abdd 100644 --- a/panda/src/builder/mesherEdge.I +++ b/panda/src/builder/mesherEdge.I @@ -47,6 +47,12 @@ operator == (const MesherEdge &other) const { return _a == other._a && _b == other._b; } +template +INLINE bool MesherEdge:: +operator != (const MesherEdge &other) const { + return !operator == (other); +} + template INLINE bool MesherEdge:: operator < (const MesherEdge &other) const { diff --git a/panda/src/builder/mesherEdge.h b/panda/src/builder/mesherEdge.h index b444e0016e..f6ff909089 100644 --- a/panda/src/builder/mesherEdge.h +++ b/panda/src/builder/mesherEdge.h @@ -37,6 +37,7 @@ public: INLINE MesherEdge *common_ptr(); INLINE bool operator == (const MesherEdge &other) const; + INLINE bool operator != (const MesherEdge &other) const; INLINE bool operator < (const MesherEdge &other) const; INLINE float compute_length(const BuilderBucket &bucket) const; diff --git a/panda/src/builder/mesherFanMaker.I b/panda/src/builder/mesherFanMaker.I index 4efe72feda..617ef2cb54 100644 --- a/panda/src/builder/mesherFanMaker.I +++ b/panda/src/builder/mesherFanMaker.I @@ -16,6 +16,11 @@ operator < (const MesherFanMaker &other) const { return _edges.front() < other._edges.front(); } +template +INLINE bool MesherFanMaker:: +operator != (const MesherFanMaker &other) const { + return !operator == (other); +} template INLINE bool MesherFanMaker:: diff --git a/panda/src/builder/mesherFanMaker.h b/panda/src/builder/mesherFanMaker.h index 6da683fd2e..4aabdbb46f 100644 --- a/panda/src/builder/mesherFanMaker.h +++ b/panda/src/builder/mesherFanMaker.h @@ -39,6 +39,7 @@ public: MesherFanMaker(const Vertex *vertex, Strip *tri, Mesher *mesher); INLINE bool operator < (const MesherFanMaker &other) const; + INLINE bool operator != (const MesherFanMaker &other) const; INLINE bool operator == (const MesherFanMaker &other) const; INLINE bool is_empty() const; diff --git a/panda/src/builder/mesherStrip.I b/panda/src/builder/mesherStrip.I index c32c66f083..b4b4760659 100644 --- a/panda/src/builder/mesherStrip.I +++ b/panda/src/builder/mesherStrip.I @@ -149,6 +149,17 @@ operator == (const MesherStrip &other) const { return this == &other; } +//////////////////////////////////////////////////////////////////// +// Function: MesherStrip::operator != +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +INLINE bool MesherStrip:: +operator != (const MesherStrip &other) const { + return !operator == (other); +} + //////////////////////////////////////////////////////////////////// // Function: MesherStrip::Constructor // Access: Public diff --git a/panda/src/builder/mesherStrip.h b/panda/src/builder/mesherStrip.h index 36a3ce5213..ba81d21d21 100644 --- a/panda/src/builder/mesherStrip.h +++ b/panda/src/builder/mesherStrip.h @@ -93,6 +93,7 @@ public: // ptr equality INLINE bool operator == (const MesherStrip &other) const; + INLINE bool operator != (const MesherStrip &other) const; bool pick_mate(const MesherStrip &a_strip, const MesherStrip &b_strip, const Edge &a_edge, const Edge &b_edge, diff --git a/panda/src/egg/eggMorph.I b/panda/src/egg/eggMorph.I index d158c1c044..c63e0e6491 100644 --- a/panda/src/egg/eggMorph.I +++ b/panda/src/egg/eggMorph.I @@ -64,6 +64,17 @@ operator == (const EggMorph &other) const { return get_name() == other.get_name(); } +//////////////////////////////////////////////////////////////////// +// Function: EggMorph::Inequality operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +template +INLINE bool EggMorph:: +operator != (const EggMorph &other) const { + return !operator == (other); +} + //////////////////////////////////////////////////////////////////// // Function: EggMorphVertex output operator diff --git a/panda/src/egg/eggMorph.h b/panda/src/egg/eggMorph.h index 33ae065b73..8e14dc881f 100644 --- a/panda/src/egg/eggMorph.h +++ b/panda/src/egg/eggMorph.h @@ -29,6 +29,7 @@ public: INLINE bool operator < (const EggMorph &other) const; INLINE bool operator == (const EggMorph &other) const; + INLINE bool operator != (const EggMorph &other) const; private: Parameter _offset;