Panda3D
finiteBoundingVolume.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 finiteBoundingVolume.h
10  * @author drose
11  * @date 1999-10-02
12  */
13 
14 #ifndef FINITEBOUNDINGVOLUME_H
15 #define FINITEBOUNDINGVOLUME_H
16 
17 #include "pandabase.h"
18 
20 
21 
22 /**
23  * A special kind of GeometricBoundingVolume that is known to be finite. It
24  * is possible to query this kind of volume for its minimum and maximum
25  * extents.
26  */
27 class EXPCL_PANDA_MATHUTIL FiniteBoundingVolume : public GeometricBoundingVolume {
28 PUBLISHED:
29  virtual LPoint3 get_min() const=0;
30  virtual LPoint3 get_max() const=0;
31  virtual PN_stdfloat get_volume() const;
32 
33  MAKE_PROPERTY(min, get_min);
34  MAKE_PROPERTY(max, get_max);
35  MAKE_PROPERTY(volume, get_volume);
36 
37 public:
38  virtual const FiniteBoundingVolume *as_finite_bounding_volume() const;
39 
40 protected:
41  virtual bool around_lines(const BoundingVolume **first,
42  const BoundingVolume **last);
43  virtual bool around_planes(const BoundingVolume **first,
44  const BoundingVolume **last);
45 
46 public:
47  static TypeHandle get_class_type() {
48  return _type_handle;
49  }
50  static void init_type() {
51  GeometricBoundingVolume::init_type();
52  register_type(_type_handle, "FiniteBoundingVolume",
53  GeometricBoundingVolume::get_class_type());
54  }
55  virtual TypeHandle get_type() const {
56  return get_class_type();
57  }
58  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
59 
60 private:
61  static TypeHandle _type_handle;
62 };
63 
64 #endif
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
virtual const FiniteBoundingVolume * as_finite_bounding_volume() const
Virtual downcast method.
A special kind of GeometricBoundingVolume that is known to be finite.
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
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(),...
Definition: register_type.I:22