Panda3D

lwoTags.h
Go to the documentation of this file.
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 lwoTags.h
10 * @author drose
11 * @date 2001-04-24
12 */
13
14 #ifndef LWOTAGS_H
15 #define LWOTAGS_H
16
17 #include "pandatoolbase.h"
18
19 #include "lwoChunk.h"
20
21 #include "luse.h"
22 #include "vector_string.h"
23
24 /**
25 * An array of tag strings that will be referenced by later chunks.
26 *
27 * This also serves as an array of surface names to be referenced by a later
28 * LwoPolygons chunk, in 5.x LWOB files. The chunk id can be used to
29 * differentiate the meaning (TAGS vs. SRFS).
30 */
31 class LwoTags : public LwoChunk {
32 public:
33 int get_num_tags() const;
34 std::string get_tag(int n) const;
35
36 public:
37 virtual bool read_iff(IffInputFile *in, size_t stop_at);
38 virtual void write(std::ostream &out, int indent_level = 0) const;
39
40 private:
41 typedef vector_string Tags;
42 Tags _tags;
43
44 public:
45 virtual TypeHandle get_type() const {
46 return get_class_type();
47 }
48 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
49 static TypeHandle get_class_type() {
50 return _type_handle;
51 }
52 static void init_type() {
53 LwoChunk::init_type();
54 register_type(_type_handle, "LwoTags",
55 LwoChunk::get_class_type());
56 }
57
58 private:
59 static TypeHandle _type_handle;
60 };
61
62 #endif
IffInputFile
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:30
LwoChunk
A specialization of IffChunk for Lightwave Object files.
Definition: lwoChunk.h:26
LwoTags
An array of tag strings that will be referenced by later chunks.
Definition: lwoTags.h:31
LwoTags::get_num_tags
int get_num_tags() const
Returns the number of tags of this group.
Definition: lwoTags.cxx:26
LwoTags::get_tag
std::string get_tag(int n) const
Returns the nth tag of this group.
Definition: lwoTags.cxx:34
LwoTags::read_iff
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:46
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
luse.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lwoChunk.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
vector_string.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.