Panda3D
lwoPoints.h
1 // Filename: lwoPoints.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 LWOPOINTS_H
16 #define LWOPOINTS_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoChunk.h"
21 
22 #include "luse.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : LwoPoints
26 // Description : An array of points that will be referenced by later
27 // chunks.
28 ////////////////////////////////////////////////////////////////////
29 class LwoPoints : public LwoChunk {
30 public:
31  int get_num_points() const;
32  const LPoint3 &get_point(int n) const;
33 
34 public:
35  virtual bool read_iff(IffInputFile *in, size_t stop_at);
36  virtual void write(ostream &out, int indent_level = 0) const;
37 
38 private:
39  typedef pvector<LPoint3> Points;
40  Points _points;
41 
42 public:
43  virtual TypeHandle get_type() const {
44  return get_class_type();
45  }
46  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
47  static TypeHandle get_class_type() {
48  return _type_handle;
49  }
50  static void init_type() {
51  LwoChunk::init_type();
52  register_type(_type_handle, "LwoPoints",
53  LwoChunk::get_class_type());
54  }
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #endif
61 
62 
int get_num_points() const
Returns the number of points of this group.
Definition: lwoPoints.cxx:29
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
const LPoint3 & get_point(int n) const
Returns the nth point of this group.
Definition: lwoPoints.cxx:39
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: lwoPoints.cxx:55
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
An array of points that will be referenced by later chunks.
Definition: lwoPoints.h:29