Panda3D
 All Classes Functions Variables Enumerations
partSubset.h
00001 // Filename: partSubset.h
00002 // Created by:  drose (19Jan06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PARTSUBSET_H
00016 #define PARTSUBSET_H
00017 
00018 #include "pandabase.h"
00019 #include "globPattern.h"
00020 
00021 ////////////////////////////////////////////////////////////////////
00022 //       Class : PartSubset
00023 // Description : This class is used to define a subset of part names
00024 //               to apply to the PartBundle::bind_anim() operation.
00025 //               Only those part names within the subset will be
00026 //               included in the bind.
00027 ////////////////////////////////////////////////////////////////////
00028 class EXPCL_PANDA_CHAN PartSubset {
00029 PUBLISHED:
00030   PartSubset();
00031   PartSubset(const PartSubset &copy);
00032   void operator = (const PartSubset &copy);
00033 
00034   void add_include_joint(const GlobPattern &name);
00035   void add_exclude_joint(const GlobPattern &name);
00036 
00037   void append(const PartSubset &other);
00038 
00039   void output(ostream &out) const;
00040 
00041   bool is_include_empty() const;
00042   bool matches_include(const string &joint_name) const;
00043   bool matches_exclude(const string &joint_name) const;
00044 
00045 private:
00046   typedef pvector<GlobPattern> Joints;
00047   Joints _include_joints;
00048   Joints _exclude_joints;
00049 };
00050 
00051 INLINE ostream &operator << (ostream &out, const PartSubset &subset) {
00052   subset.output(out);
00053   return out;
00054 }
00055 
00056 #include "partSubset.I"
00057 
00058 #endif
00059 
 All Classes Functions Variables Enumerations