Panda3D
 All Classes Functions Variables Enumerations
lwoDiscontinuousVertexMap.h
1 // Filename: lwoDiscontinuousVertexMap.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 LWODISCONTINUOUSVERTEXMAP_H
16 #define LWODISCONTINUOUSVERTEXMAP_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoChunk.h"
21 
22 #include "pta_stdfloat.h"
23 #include "pmap.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : LwoDiscontinuousVertexMap
27 // Description : A mapping of floating-point values per integer index.
28 // The meaning of these values is determined by the
29 // mapping type code and/or its name.
30 ////////////////////////////////////////////////////////////////////
32 public:
33  bool has_value(int polygon_index, int vertex_index) const;
34  PTA_stdfloat get_value(int polygon_index, int vertex_index) const;
35 
36  IffId _map_type;
37  int _dimension;
38  string _name;
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:
46  typedef pmap<int, VMap> VMad;
47  VMad _vmad;
48 
49 public:
50  virtual TypeHandle get_type() const {
51  return get_class_type();
52  }
53  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
54  static TypeHandle get_class_type() {
55  return _type_handle;
56  }
57  static void init_type() {
58  LwoChunk::init_type();
59  register_type(_type_handle, "LwoDiscontinuousVertexMap",
60  LwoChunk::get_class_type());
61  }
62 
63 private:
64  static TypeHandle _type_handle;
65 };
66 
67 #endif
68 
69 
PTA_stdfloat get_value(int polygon_index, int vertex_index) const
Returns the mapping value associated with the given index, or an empty PTA_stdfloat if there is no ma...
bool has_value(int polygon_index, int vertex_index) const
Returns true if the map has a value associated with the given index, false otherwise.
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
A specialization of IffChunk for Lightwave Object files.
Definition: lwoChunk.h:29
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A four-byte chunk ID appearing in an &quot;IFF&quot; file.
Definition: iffId.h:29
A mapping of floating-point values per integer index.