Przeglądaj źródła

add has_primitives

David Rose 22 lat temu
rodzic
commit
6d6241be32

+ 51 - 30
panda/src/egg/eggGroupNode.cxx

@@ -41,7 +41,7 @@ TypeHandle EggGroupNode::_type_handle;
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::Copy constructor
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::
@@ -54,7 +54,7 @@ EggGroupNode(const EggGroupNode &copy) : EggNode(copy) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::Copy assignment operator
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode &EggGroupNode::
@@ -69,7 +69,7 @@ operator =(const EggGroupNode &copy) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::Destructor
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::
@@ -79,7 +79,7 @@ EggGroupNode::
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::write
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Writes the group and all of its children to the
 //               indicated output stream in Egg format.
 ////////////////////////////////////////////////////////////////////
@@ -110,7 +110,7 @@ write(ostream &out, int indent_level) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::begin
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::iterator EggGroupNode::
@@ -120,7 +120,7 @@ begin() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::end
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::iterator EggGroupNode::
@@ -130,7 +130,7 @@ end() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::rbegin
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::reverse_iterator EggGroupNode::
@@ -140,7 +140,7 @@ rbegin() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::rend
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::reverse_iterator EggGroupNode::
@@ -150,7 +150,7 @@ rend() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::insert
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::iterator EggGroupNode::
@@ -161,7 +161,7 @@ insert(iterator position, PT(EggNode) x) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::erase
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::iterator EggGroupNode::
@@ -172,7 +172,7 @@ erase(iterator position) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::erase
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::iterator EggGroupNode::
@@ -187,7 +187,7 @@ erase(iterator first, iterator last) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::replace
-//       Access: Public
+//       Access: Published
 //  Description: Replaces the node at the indicated position with
 //               the indicated node.  It is an error to call this
 //               with an invalid position iterator (e.g. end()).
@@ -203,7 +203,7 @@ replace(iterator position, PT(EggNode) x) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::empty
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 bool EggGroupNode::
@@ -213,7 +213,7 @@ empty() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::size
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 EggGroupNode::size_type EggGroupNode::
@@ -223,7 +223,7 @@ size() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::clear
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 void EggGroupNode::
@@ -233,7 +233,7 @@ clear() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::get_first_child
-//       Access: Public
+//       Access: Published
 //  Description: Returns the first child in the group's list of
 //               children, or NULL if the list of children is empty.
 //               Can be used with get_next_child() to return the
@@ -250,7 +250,7 @@ get_first_child() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::get_next_child
-//       Access: Public
+//       Access: Published
 //  Description: Returns the next child in the group's list of
 //               children since the last call to get_first_child() or
 //               get_next_child(), or NULL if the last child has been
@@ -273,7 +273,7 @@ get_next_child() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::add_child
-//       Access: Public
+//       Access: Published
 //  Description: Adds the indicated child to the group and returns it.
 //               If the child node is already a child of some other
 //               node, removes it first.
@@ -291,7 +291,7 @@ add_child(EggNode *node) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::remove_child
-//       Access: Public
+//       Access: Published
 //  Description: Removes the indicated child node from the group and
 //               returns it.  If the child was not already in the
 //               group, does nothing and returns NULL.
@@ -312,7 +312,7 @@ remove_child(EggNode *node) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::steal_children
-//       Access: Public
+//       Access: Published
 //  Description: Moves all the children from the other node to this
 //               one.  This is especially useful because the group
 //               node copy assignment operator does not copy children.
@@ -332,7 +332,7 @@ steal_children(EggGroupNode &other) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::find_child
-//       Access: Public
+//       Access: Published
 //  Description: Returns the child of this node whose name is the
 //               indicated string, or NULL if there is no child of
 //               this node by that name.  Does not search recursively.
@@ -352,7 +352,7 @@ find_child(const string &name) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::resolve_filenames
-//       Access: Public
+//       Access: Published
 //  Description: Walks the tree and attempts to resolve any filenames
 //               encountered.  This looks up filenames in the search
 //               path, etc.  It does not automatically search the
@@ -391,7 +391,7 @@ resolve_filenames(const DSearchPath &searchpath) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::force_filenames
-//       Access: Public
+//       Access: Published
 //  Description: Similar to resolve_filenames, but each non-absolute
 //               filename encountered is arbitrarily taken to be in
 //               the indicated directory, whether or not the so-named
@@ -433,7 +433,7 @@ force_filenames(const Filename &directory) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::reverse_vertex_ordering
-//       Access: Public
+//       Access: Published
 //  Description: Reverses the vertex ordering of all polygons defined
 //               at this node and below.  Does not change the surface
 //               normals, if any.
@@ -457,7 +457,7 @@ reverse_vertex_ordering() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::recompute_vertex_normals
-//       Access: Public
+//       Access: Published
 //  Description: Recomputes all the vertex normals for polygon
 //               geometry at this group node and below so that they
 //               accurately reflect the vertex positions.  A shared
@@ -531,7 +531,7 @@ recompute_vertex_normals(double threshold, CoordinateSystem cs) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::recompute_polygon_normals
-//       Access: Public
+//       Access: Published
 //  Description: Recomputes all the polygon normals for polygon
 //               geometry at this group node and below so that they
 //               accurately reflect the vertex positions.  Normals are
@@ -593,7 +593,7 @@ recompute_polygon_normals(CoordinateSystem cs) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::strip_normals
-//       Access: Public
+//       Access: Published
 //  Description: Removes all normals from primitives, and the vertices
 //               they reference, at this node and below.
 //
@@ -636,7 +636,7 @@ strip_normals() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::triangulate_polygons
-//       Access: Public
+//       Access: Published
 //  Description: Replace all higher-order polygons at this point in
 //               the scene graph and below with triangles.  Returns
 //               the total number of new triangles produced, less
@@ -675,7 +675,7 @@ triangulate_polygons(bool convex_also) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::remove_unused_vertices
-//       Access: Public
+//       Access: Published
 //  Description: Removes all vertices from VertexPools within this
 //               group or below that are not referenced by at least
 //               one primitive.  Also renumbers all vertices after the
@@ -723,7 +723,7 @@ remove_unused_vertices() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::remove_invalid_primitives
-//       Access: Public
+//       Access: Published
 //  Description: Removes primitives at this level and below which
 //               appear to be degenerate; e.g. polygons with fewer
 //               than 3 vertices, etc.  Returns the number of
@@ -757,6 +757,27 @@ remove_invalid_primitives() {
   return num_removed;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: EggGroupNode::has_primitives
+//       Access: Published, Virtual
+//  Description: Returns true if there are any primitives
+//               (e.g. polygons) defined within this group or below,
+//               false otherwise.
+////////////////////////////////////////////////////////////////////
+bool EggGroupNode::
+has_primitives() const {
+  Children::const_iterator ci;
+  for (ci = _children.begin();
+       ci != _children.end();
+       ++ci) {
+    if ((*ci)->has_primitives()) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: EggGroupNode::update_under
 //       Access: Protected, Virtual

+ 1 - 0
panda/src/egg/eggGroupNode.h

@@ -132,6 +132,7 @@ PUBLISHED:
 
   int remove_unused_vertices();
   int remove_invalid_primitives();
+  virtual bool has_primitives() const;
 
 protected:
   virtual void update_under(int depth_offset);

+ 12 - 0
panda/src/egg/eggNode.cxx

@@ -311,6 +311,18 @@ void EggNode::
 adjust_under() {
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: EggNode::has_primitives
+//       Access: Protected, Virtual
+//  Description: Returns true if there are any primitives
+//               (e.g. polygons) defined within this group or below,
+//               false otherwise.
+////////////////////////////////////////////////////////////////////
+bool EggNode::
+has_primitives() const {
+  return false;
+}
+
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggNode::r_transform

+ 1 - 0
panda/src/egg/eggNode.h

@@ -100,6 +100,7 @@ protected:
 
   virtual void update_under(int depth_offset);
   virtual void adjust_under();
+  virtual bool has_primitives() const;
 
   virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
                            CoordinateSystem to_cs);

+ 19 - 20
panda/src/egg/eggPrimitive.I

@@ -16,11 +16,10 @@
 //
 ////////////////////////////////////////////////////////////////////
 
-#include <algorithm>
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::Constructor
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE EggPrimitive::
@@ -30,7 +29,7 @@ EggPrimitive(const string &name): EggNode(name) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::Copy constructor
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE EggPrimitive::
@@ -46,7 +45,7 @@ EggPrimitive(const EggPrimitive &copy) :
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::Copy assignment operator
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE EggPrimitive &EggPrimitive::
@@ -62,7 +61,7 @@ operator = (const EggPrimitive &copy) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::Destructor
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE EggPrimitive::
@@ -72,7 +71,7 @@ INLINE EggPrimitive::
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::set_texture
-//       Access: Public
+//       Access: Published
 //  Description: Applies the indicated texture to the primitive.
 ////////////////////////////////////////////////////////////////////
 INLINE void EggPrimitive::
@@ -82,7 +81,7 @@ set_texture(EggTexture *texture) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::clear_texture
-//       Access: Public
+//       Access: Published
 //  Description: Removes any texturing from the primitive.
 ////////////////////////////////////////////////////////////////////
 INLINE void EggPrimitive::
@@ -92,7 +91,7 @@ clear_texture() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::get_texture
-//       Access: Public
+//       Access: Published
 //  Description: Returns a pointer to the applied texture, or NULL if
 //               there is no texture applied.
 ////////////////////////////////////////////////////////////////////
@@ -104,7 +103,7 @@ get_texture() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::has_texture
-//       Access: Public
+//       Access: Published
 //  Description: Returns true if the primitive is textured (and
 //               get_texture() will return a real pointer), false
 //               otherwise (and get_texture() will return NULL).
@@ -116,7 +115,7 @@ has_texture() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::set_material
-//       Access: Public
+//       Access: Published
 //  Description: Applies the indicated material to the primitive.
 ////////////////////////////////////////////////////////////////////
 INLINE void EggPrimitive::
@@ -126,7 +125,7 @@ set_material(EggMaterial *material) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::clear_material
-//       Access: Public
+//       Access: Published
 //  Description: Removes any material from the primitive.
 ////////////////////////////////////////////////////////////////////
 INLINE void EggPrimitive::
@@ -136,7 +135,7 @@ clear_material() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::get_material
-//       Access: Public
+//       Access: Published
 //  Description: Returns a pointer to the applied material, or NULL if
 //               there is no material applied.
 ////////////////////////////////////////////////////////////////////
@@ -148,7 +147,7 @@ get_material() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::has_material
-//       Access: Public
+//       Access: Published
 //  Description: Returns true if the primitive is materiald (and
 //               get_material() will return a real pointer), false
 //               otherwise (and get_material() will return NULL).
@@ -161,7 +160,7 @@ has_material() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::set_bface_flag
-//       Access: Public
+//       Access: Published
 //  Description: Sets the backfacing flag of the polygon.  If this is
 //               true, the polygon will be rendered so that both faces
 //               are visible; if it is false, only the front face of
@@ -175,7 +174,7 @@ set_bface_flag(bool flag) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::get_bface_flag
-//       Access: Public
+//       Access: Published
 //  Description: Retrieves the backfacing flag of the polygon.  See
 //               set_bface_flag().
 ////////////////////////////////////////////////////////////////////
@@ -305,7 +304,7 @@ replace(iterator position, EggVertex *x) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::clear
-//       Access: Public
+//       Access: Published
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE void EggPrimitive::
@@ -315,7 +314,7 @@ clear() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::get_num_vertices
-//       Access: Public
+//       Access: Published
 //  Description: 
 ////////////////////////////////////////////////////////////////////
 INLINE int EggPrimitive::
@@ -325,7 +324,7 @@ get_num_vertices() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::set_vertex
-//       Access: Public
+//       Access: Published
 //  Description: Replaces a particular vertex based on its index
 //               number in the list of vertices.  This is just a
 //               convenience function for people who don't want to
@@ -339,7 +338,7 @@ set_vertex(int index, EggVertex *vertex) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::get_vertex
-//       Access: Public
+//       Access: Published
 //  Description: Returns a particular index based on its index number.
 ////////////////////////////////////////////////////////////////////
 INLINE EggVertex *EggPrimitive::
@@ -351,7 +350,7 @@ get_vertex(int index) const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::get_pool
-//       Access: Public
+//       Access: Published
 //  Description: Returns the vertex pool associated with the vertices
 //               of the primitive, or NULL if the primitive has no
 //               vertices.

+ 29 - 17
panda/src/egg/eggPrimitive.cxx

@@ -30,7 +30,7 @@ TypeHandle EggPrimitive::_type_handle;
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::determine_alpha_mode
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Walks back up the hierarchy, looking for an EggPrimitive
 //               or EggPrimitive or some such object at this level or
 //               above this primitive that has an alpha_mode other than
@@ -54,7 +54,7 @@ determine_alpha_mode() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::determine_depth_write_mode
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Walks back up the hierarchy, looking for an EggGroup
 //               or EggPrimitive or some such object at this level or
 //               above this node that has a depth_write_mode other than
@@ -79,7 +79,7 @@ determine_depth_write_mode() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::determine_depth_test_mode
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Walks back up the hierarchy, looking for an EggGroup
 //               or EggPrimitive or some such object at this level or
 //               above this node that has a depth_test_mode other than
@@ -104,7 +104,7 @@ determine_depth_test_mode() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::determine_visibility_mode
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Walks back up the hierarchy, looking for an EggGroup
 //               or EggPrimitive or some such object at this level or
 //               above this node that has a visibility_mode other than
@@ -129,7 +129,7 @@ determine_visibility_mode() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::determine_draw_order
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Walks back up the hierarchy, looking for an EggPrimitive
 //               or EggPrimitive or some such object at this level or
 //               above this primitive that has a draw_order specified.
@@ -153,7 +153,7 @@ determine_draw_order() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::determine_bin
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Walks back up the hierarchy, looking for an EggPrimitive
 //               or EggPrimitive or some such object at this level or
 //               above this primitive that has a bin specified.  Returns a
@@ -177,7 +177,7 @@ determine_bin() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::copy_attributes
-//       Access: Public
+//       Access: Published
 //  Description: Copies the rendering attributes from the indicated
 //               primitive.
 ////////////////////////////////////////////////////////////////////
@@ -191,7 +191,7 @@ copy_attributes(const EggPrimitive &other) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::has_vertex_normal
-//       Access: Public
+//       Access: Published
 //  Description: Returns true if any vertex on the primitive has a
 //               specific normal set, false otherwise.
 ////////////////////////////////////////////////////////////////////
@@ -208,7 +208,7 @@ has_vertex_normal() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::has_vertex_color
-//       Access: Public
+//       Access: Published
 //  Description: Returns true if any vertex on the primitive has a
 //               specific color set, false otherwise.
 ////////////////////////////////////////////////////////////////////
@@ -225,7 +225,7 @@ has_vertex_color() const {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::reverse_vertex_ordering
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Reverses the ordering of the vertices in this
 //               primitive, if appropriate, in order to change the
 //               direction the polygon appears to be facing.  Does not
@@ -241,7 +241,7 @@ reverse_vertex_ordering() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::cleanup
-//       Access: Public, Virtual
+//       Access: Published, Virtual
 //  Description: Cleans up modeling errors in whatever context this
 //               makes sense.  For instance, for a polygon, this calls
 //               remove_doubled_verts(true).  For a point, it calls
@@ -255,7 +255,7 @@ cleanup() {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::remove_doubled_verts
-//       Access: Public
+//       Access: Published
 //  Description: Certain kinds of primitives, particularly polygons,
 //               don't like to have the same vertex repeated
 //               consecutively.  Unfortunately, some modeling programs
@@ -305,7 +305,7 @@ remove_doubled_verts(bool closed) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::remove_nonunique_verts
-//       Access: Public
+//       Access: Published
 //  Description: Removes any multiple appearances of the same vertex
 //               from the primitive.  This primarily makes sense for a
 //               point primitive, which is really a collection of
@@ -332,6 +332,18 @@ remove_nonunique_verts() {
   _vertices.swap(new_vertices);
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: EggPrimitive::has_primitives
+//       Access: Published, Virtual
+//  Description: Returns true if there are any primitives
+//               (e.g. polygons) defined within this group or below,
+//               false otherwise.
+////////////////////////////////////////////////////////////////////
+bool EggPrimitive::
+has_primitives() const {
+  return true;
+}
+
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::erase
@@ -355,7 +367,7 @@ erase(iterator first, iterator last) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::add_vertex
-//       Access: Public
+//       Access: Published
 //  Description: Adds the indicated vertex to the end of the
 //               primitive's list of vertices, and returns it.
 ////////////////////////////////////////////////////////////////////
@@ -372,7 +384,7 @@ add_vertex(EggVertex *vertex) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::remove_vertex
-//       Access: Public
+//       Access: Published
 //  Description: Removes the indicated vertex from the
 //               primitive and returns it.  If the vertex was not
 //               already in the primitive, does nothing and returns
@@ -398,7 +410,7 @@ remove_vertex(EggVertex *vertex) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::copy_vertices
-//       Access: Public
+//       Access: Published
 //  Description: Replaces the current primitive's list of vertices
 //               with a copy of the list of vertices on the other
 //               primitive.
@@ -421,7 +433,7 @@ copy_vertices(const EggPrimitive &other) {
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPrimitive::test_vref_integrity
-//       Access: Public
+//       Access: Published
 //  Description: Verifies that each vertex in the primitive exists and
 //               that it knows it is referenced by the primitive.
 ////////////////////////////////////////////////////////////////////

+ 3 - 0
panda/src/egg/eggPrimitive.h

@@ -34,6 +34,8 @@
 #include "pointerTo.h"
 #include "pvector.h"
 
+#include <algorithm>
+
 class EggVertexPool;
 
 ////////////////////////////////////////////////////////////////////
@@ -98,6 +100,7 @@ PUBLISHED:
 
   void remove_doubled_verts(bool closed);
   void remove_nonunique_verts();
+  virtual bool has_primitives() const;
 
 
   // The EggPrimitive itself appears to be an STL container of