Panda3D
 All Classes Functions Variables Enumerations
lwoTags.h
1 // Filename: lwoTags.h
2 // Created by: drose (24Apr01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef LWOTAGS_H
16 #define LWOTAGS_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoChunk.h"
21 
22 #include "luse.h"
23 #include "vector_string.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : LwoTags
27 // Description : An array of tag strings that will be referenced by
28 // later chunks.
29 //
30 // This also serves as an array of surface names to be
31 // referenced by a later LwoPolygons chunk, in 5.x LWOB
32 // files. The chunk id can be used to differentiate the
33 // meaning (TAGS vs. SRFS).
34 ////////////////////////////////////////////////////////////////////
35 class LwoTags : public LwoChunk {
36 public:
37  int get_num_tags() const;
38  string get_tag(int n) const;
39 
40 public:
41  virtual bool read_iff(IffInputFile *in, size_t stop_at);
42  virtual void write(ostream &out, int indent_level = 0) const;
43 
44 private:
45  typedef vector_string Tags;
46  Tags _tags;
47 
48 public:
49  virtual TypeHandle get_type() const {
50  return get_class_type();
51  }
52  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  LwoChunk::init_type();
58  register_type(_type_handle, "LwoTags",
59  LwoChunk::get_class_type());
60  }
61 
62 private:
63  static TypeHandle _type_handle;
64 };
65 
66 #endif
67 
68 
An array of tag strings that will be referenced by later chunks.
Definition: lwoTags.h:35
int get_num_tags() const
Returns the number of tags of this group.
Definition: lwoTags.cxx:29
A specialization of IffChunk for Lightwave Object files.
Definition: lwoChunk.h:29
string get_tag(int n) const
Returns the nth tag of this group.
Definition: lwoTags.cxx:39
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
Definition: lwoTags.cxx:55
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85