From 7c2bbf7f7d60719a5c20f514c2cbef304b698e51 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 25 May 2001 04:01:34 +0000 Subject: [PATCH] making appropriate functions inline and non-inline --- panda/src/egg/eggGroup.I | 45 +++++++++++++++++++++++++++++++++++++ panda/src/egg/eggGroup.cxx | 37 ------------------------------ panda/src/egg/eggGroup.h | 6 ++--- panda/src/egg/eggVertex.I | 41 +++++++++++++++------------------ panda/src/egg/eggVertex.cxx | 22 ++++++++++++++++++ panda/src/egg/eggVertex.h | 4 ++-- 6 files changed, 90 insertions(+), 65 deletions(-) diff --git a/panda/src/egg/eggGroup.I b/panda/src/egg/eggGroup.I index 8e90689218..992071aae2 100644 --- a/panda/src/egg/eggGroup.I +++ b/panda/src/egg/eggGroup.I @@ -621,3 +621,48 @@ get_lod() const { } +//////////////////////////////////////////////////////////////////// +// Function: EggGroup::vref_begin +// Access: Public +// Description: Returns an iterator that can, in conjunction with +// vref_end(), be used to traverse the entire set of +// referenced vertices. Each iterator returns a +// pair. +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. +//////////////////////////////////////////////////////////////////// +INLINE EggGroup::VertexRef::const_iterator EggGroup:: +vref_begin() const { + return _vref.begin(); +} + +//////////////////////////////////////////////////////////////////// +// Function: EggGroup::vref_end +// Access: Public +// Description: Returns an iterator that can, in conjunction with +// vref_begin(), be used to traverse the entire set of +// referenced vertices. Each iterator returns a +// pair. +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. +//////////////////////////////////////////////////////////////////// +INLINE EggGroup::VertexRef::const_iterator EggGroup:: +vref_end() const { + return _vref.end(); +} + +//////////////////////////////////////////////////////////////////// +// Function: EggGrop::vref_size +// Access: Public +// Description: Returns the number of elements between vref_begin() +// and vref_end(). +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. +//////////////////////////////////////////////////////////////////// +INLINE EggGroup::VertexRef::size_type EggGroup:: +vref_size() const { + return _vref.size(); +} diff --git a/panda/src/egg/eggGroup.cxx b/panda/src/egg/eggGroup.cxx index 5d69fd5374..39d6b165ee 100644 --- a/panda/src/egg/eggGroup.cxx +++ b/panda/src/egg/eggGroup.cxx @@ -451,43 +451,6 @@ get_vertex_membership(const EggVertex *vert) const { } } -//////////////////////////////////////////////////////////////////// -// Function: EggGroup::vref_begin -// Access: Public -// Description: Returns an iterator that can, in conjunction with -// vref_end(), be used to traverse the entire set of -// referenced vertices. Each iterator returns a -// pair. -//////////////////////////////////////////////////////////////////// -EggGroup::VertexRef::const_iterator EggGroup:: -vref_begin() const { - return _vref.begin(); -} - -//////////////////////////////////////////////////////////////////// -// Function: EggGroup::vref_end -// Access: Public -// Description: Returns an iterator that can, in conjunction with -// vref_begin(), be used to traverse the entire set of -// referenced vertices. Each iterator returns a -// pair. -//////////////////////////////////////////////////////////////////// -EggGroup::VertexRef::const_iterator EggGroup:: -vref_end() const { - return _vref.end(); -} - -//////////////////////////////////////////////////////////////////// -// Function: EggGrop::vref_size -// Access: Public -// Description: Returns the number of elements between vref_begin() -// and vref_end(). -//////////////////////////////////////////////////////////////////// -EggGroup::VertexRef::size_type EggGroup:: -vref_size() const { - return _vref.size(); -} - #ifndef NDEBUG diff --git a/panda/src/egg/eggGroup.h b/panda/src/egg/eggGroup.h index ffb7444047..42183b10a2 100644 --- a/panda/src/egg/eggGroup.h +++ b/panda/src/egg/eggGroup.h @@ -167,9 +167,9 @@ public: void unref_all_vertices(); double get_vertex_membership(const EggVertex *vert) const; - VertexRef::const_iterator vref_begin() const; - VertexRef::const_iterator vref_end() const; - VertexRef::size_type vref_size() const; + INLINE VertexRef::const_iterator vref_begin() const; + INLINE VertexRef::const_iterator vref_end() const; + INLINE VertexRef::size_type vref_size() const; #ifndef NDEBUG void test_vref_integrity() const; diff --git a/panda/src/egg/eggVertex.I b/panda/src/egg/eggVertex.I index 2e2e162d34..4763f71965 100644 --- a/panda/src/egg/eggVertex.I +++ b/panda/src/egg/eggVertex.I @@ -170,6 +170,9 @@ get_index() const { // gref_end(), be used to traverse the entire set of // groups that reference this vertex. Each iterator // returns a pointer to a group. +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. //////////////////////////////////////////////////////////////////// INLINE EggVertex::GroupRef::const_iterator EggVertex:: gref_begin() const { @@ -183,6 +186,9 @@ gref_begin() const { // gref_begin(), be used to traverse the entire set of // groups that reference this vertex. Each iterator // returns a pointer to a group. +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. //////////////////////////////////////////////////////////////////// INLINE EggVertex::GroupRef::const_iterator EggVertex:: gref_end() const { @@ -194,6 +200,9 @@ gref_end() const { // Access: Public // Description: Returns the number of elements between gref_begin() // and gref_end(). +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. //////////////////////////////////////////////////////////////////// INLINE EggVertex::GroupRef::size_type EggVertex:: gref_size() const { @@ -201,17 +210,6 @@ gref_size() const { } -//////////////////////////////////////////////////////////////////// -// Function: EggVertex::has_gref -// Access: Public -// Description: Returns true if the indicated group references this -// vertex, false otherwise. -//////////////////////////////////////////////////////////////////// -INLINE bool EggVertex:: -has_gref(const EggGroup *group) const { - return _gref.count((EggGroup *)group) != 0; -} - //////////////////////////////////////////////////////////////////// // Function: EggVertex::pref_begin // Access: Public @@ -219,6 +217,9 @@ has_gref(const EggGroup *group) const { // pref_end(), be used to traverse the entire set of // primitives that reference this vertex. Each iterator // returns a pointer to a primitive. +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. //////////////////////////////////////////////////////////////////// INLINE EggVertex::PrimitiveRef::const_iterator EggVertex:: pref_begin() const { @@ -232,6 +233,9 @@ pref_begin() const { // pref_begin(), be used to traverse the entire set of // primitives that reference this vertex. Each iterator // returns a pointer to a primitive. +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. //////////////////////////////////////////////////////////////////// INLINE EggVertex::PrimitiveRef::const_iterator EggVertex:: pref_end() const { @@ -243,6 +247,9 @@ pref_end() const { // Access: Public // Description: Returns the number of elements between pref_begin() // and pref_end(). +// +// This interface is not safe to use outside of +// PANDAEGG.DLL. //////////////////////////////////////////////////////////////////// INLINE EggVertex::GroupRef::size_type EggVertex:: pref_size() const { @@ -250,18 +257,6 @@ pref_size() const { } -//////////////////////////////////////////////////////////////////// -// Function: EggVertex::has_pref -// Access: Public -// Description: Returns the number of times the vertex appears in the -// indicated primitive, or 0 if it does not appear. -//////////////////////////////////////////////////////////////////// -INLINE int EggVertex:: -has_pref(const EggPrimitive *prim) const { - return _pref.count((EggPrimitive *)prim); -} - - //////////////////////////////////////////////////////////////////// diff --git a/panda/src/egg/eggVertex.cxx b/panda/src/egg/eggVertex.cxx index a4b4a2d321..63c42ba179 100644 --- a/panda/src/egg/eggVertex.cxx +++ b/panda/src/egg/eggVertex.cxx @@ -275,6 +275,17 @@ transform(const LMatrix4d &mat) { } +//////////////////////////////////////////////////////////////////// +// Function: EggVertex::has_gref +// Access: Public +// Description: Returns true if the indicated group references this +// vertex, false otherwise. +//////////////////////////////////////////////////////////////////// +bool EggVertex:: +has_gref(const EggGroup *group) const { + return _gref.count((EggGroup *)group) != 0; +} + //////////////////////////////////////////////////////////////////// // Function: EggVertex::copy_grefs_from // Access: Public @@ -329,6 +340,17 @@ clear_grefs() { nassertv(_gref.empty()); } +//////////////////////////////////////////////////////////////////// +// Function: EggVertex::has_pref +// Access: Public +// Description: Returns the number of times the vertex appears in the +// indicated primitive, or 0 if it does not appear. +//////////////////////////////////////////////////////////////////// +int EggVertex:: +has_pref(const EggPrimitive *prim) const { + return _pref.count((EggPrimitive *)prim); +} + #ifndef NDEBUG //////////////////////////////////////////////////////////////////// diff --git a/panda/src/egg/eggVertex.h b/panda/src/egg/eggVertex.h index ef7482effc..96f3fc384c 100644 --- a/panda/src/egg/eggVertex.h +++ b/panda/src/egg/eggVertex.h @@ -71,7 +71,7 @@ public: INLINE GroupRef::const_iterator gref_begin() const; INLINE GroupRef::const_iterator gref_end() const; INLINE GroupRef::size_type gref_size() const; - INLINE bool has_gref(const EggGroup *group) const; + bool has_gref(const EggGroup *group) const; void copy_grefs_from(const EggVertex &other); void clear_grefs(); @@ -79,7 +79,7 @@ public: INLINE PrimitiveRef::const_iterator pref_begin() const; INLINE PrimitiveRef::const_iterator pref_end() const; INLINE PrimitiveRef::size_type pref_size() const; - INLINE int has_pref(const EggPrimitive *prim) const; + int has_pref(const EggPrimitive *prim) const; #ifndef NDEBUG void test_gref_integrity() const;