lwoLayer.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file lwoLayer.h
  10. * @author drose
  11. * @date 2001-04-24
  12. */
  13. #ifndef LWOLAYER_H
  14. #define LWOLAYER_H
  15. #include "pandatoolbase.h"
  16. #include "lwoChunk.h"
  17. #include "luse.h"
  18. /**
  19. * Signals the start of a new layer. All the data chunks which follow will be
  20. * included in this layer until another layer chunk is encountered. If data
  21. * is encountered before a layer chunk, it goes into an arbitrary layer.
  22. */
  23. class LwoLayer : public LwoChunk {
  24. public:
  25. void make_generic();
  26. enum Flags {
  27. F_hidden = 0x0001
  28. };
  29. int _number;
  30. int _flags;
  31. LPoint3 _pivot;
  32. std::string _name;
  33. int _parent;
  34. public:
  35. virtual bool read_iff(IffInputFile *in, size_t stop_at);
  36. virtual void write(std::ostream &out, int indent_level = 0) const;
  37. public:
  38. virtual TypeHandle get_type() const {
  39. return get_class_type();
  40. }
  41. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  42. static TypeHandle get_class_type() {
  43. return _type_handle;
  44. }
  45. static void init_type() {
  46. LwoChunk::init_type();
  47. register_type(_type_handle, "LwoLayer",
  48. LwoChunk::get_class_type());
  49. }
  50. private:
  51. static TypeHandle _type_handle;
  52. };
  53. #endif