Panda3D
Loading...
Searching...
No Matches
lwoDiscontinuousVertexMap.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 lwoDiscontinuousVertexMap.h
10 * @author drose
11 * @date 2001-04-24
12 */
13
14#ifndef LWODISCONTINUOUSVERTEXMAP_H
15#define LWODISCONTINUOUSVERTEXMAP_H
16
17#include "pandatoolbase.h"
18
19#include "lwoChunk.h"
20
21#include "pta_stdfloat.h"
22#include "pmap.h"
23
24/**
25 * A mapping of floating-point values per integer index. The meaning of these
26 * values is determined by the mapping type code and/or its name.
27 */
29public:
30 bool has_value(int polygon_index, int vertex_index) const;
31 PTA_stdfloat get_value(int polygon_index, int vertex_index) const;
32
33 IffId _map_type;
34 int _dimension;
35 std::string _name;
36
37public:
38 virtual bool read_iff(IffInputFile *in, size_t stop_at);
39 virtual void write(std::ostream &out, int indent_level = 0) const;
40
41private:
43 typedef pmap<int, VMap> VMad;
44 VMad _vmad;
45
46public:
47 virtual TypeHandle get_type() const {
48 return get_class_type();
49 }
50 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
51 static TypeHandle get_class_type() {
52 return _type_handle;
53 }
54 static void init_type() {
55 LwoChunk::init_type();
56 register_type(_type_handle, "LwoDiscontinuousVertexMap",
57 LwoChunk::get_class_type());
58 }
59
60private:
61 static TypeHandle _type_handle;
62};
63
64#endif
A four-byte chunk ID appearing in an "IFF" file.
Definition iffId.h:26
A wrapper around an istream used for reading an IFF file.
A specialization of IffChunk for Lightwave Object files.
Definition lwoChunk.h:26
A mapping of floating-point values per integer index.
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
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.
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...
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
This is our own Panda specialization on the default STL map.
Definition pmap.h:49
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...