Panda3D
 All Classes Functions Variables Enumerations
lwoTags.h
00001 // Filename: lwoTags.h
00002 // Created by:  drose (24Apr01)
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 LWOTAGS_H
00016 #define LWOTAGS_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "lwoChunk.h"
00021 
00022 #include "luse.h"
00023 #include "vector_string.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : LwoTags
00027 // Description : An array of tag strings that will be referenced by
00028 //               later chunks.
00029 //
00030 //               This also serves as an array of surface names to be
00031 //               referenced by a later LwoPolygons chunk, in 5.x LWOB
00032 //               files.  The chunk id can be used to differentiate the
00033 //               meaning (TAGS vs. SRFS).
00034 ////////////////////////////////////////////////////////////////////
00035 class LwoTags : public LwoChunk {
00036 public:
00037   int get_num_tags() const;
00038   string get_tag(int n) const;
00039 
00040 public:
00041   virtual bool read_iff(IffInputFile *in, size_t stop_at);
00042   virtual void write(ostream &out, int indent_level = 0) const;
00043 
00044 private:
00045   typedef vector_string Tags;
00046   Tags _tags;
00047 
00048 public:
00049   virtual TypeHandle get_type() const {
00050     return get_class_type();
00051   }
00052   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00053   static TypeHandle get_class_type() {
00054     return _type_handle;
00055   }
00056   static void init_type() {
00057     LwoChunk::init_type();
00058     register_type(_type_handle, "LwoTags",
00059                   LwoChunk::get_class_type());
00060   }
00061 
00062 private:
00063   static TypeHandle _type_handle;
00064 };
00065 
00066 #endif
00067 
00068 
 All Classes Functions Variables Enumerations