textureCollection.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Filename: textureCollection.h
  2. // Created by: drose (16Mar02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef TEXTURECOLLECTION_H
  19. #define TEXTURECOLLECTION_H
  20. #include "pandabase.h"
  21. #include "pointerToArray.h"
  22. #include "texture.h"
  23. ////////////////////////////////////////////////////////////////////
  24. // Class : TextureCollection
  25. // Description :
  26. ////////////////////////////////////////////////////////////////////
  27. class EXPCL_PANDA TextureCollection {
  28. PUBLISHED:
  29. TextureCollection();
  30. TextureCollection(const TextureCollection &copy);
  31. void operator = (const TextureCollection &copy);
  32. INLINE ~TextureCollection();
  33. void add_texture(Texture *node_texture);
  34. bool remove_texture(Texture *node_texture);
  35. void add_textures_from(const TextureCollection &other);
  36. void remove_textures_from(const TextureCollection &other);
  37. void remove_duplicate_textures();
  38. bool has_texture(Texture *texture) const;
  39. void clear();
  40. Texture *find_texture(const string &name) const;
  41. int get_num_textures() const;
  42. Texture *get_texture(int index) const;
  43. Texture *operator [] (int index) const;
  44. void output(ostream &out) const;
  45. void write(ostream &out, int indent_level = 0) const;
  46. private:
  47. typedef PTA(PT(Texture)) Textures;
  48. Textures _textures;
  49. };
  50. INLINE ostream &operator << (ostream &out, const TextureCollection &col) {
  51. col.output(out);
  52. return out;
  53. }
  54. #include "textureCollection.I"
  55. #endif