Panda3D
eggPoint.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 eggPoint.h
10  * @author drose
11  * @date 1999-12-15
12  */
13 
14 #ifndef EGGPOINT_H
15 #define EGGPOINT_H
16 
17 #include "pandabase.h"
18 
19 #include "eggPrimitive.h"
20 
21 /**
22  * A single point, or a collection of points as defined by a single
23  * <PointLight> entry.
24  */
25 class EXPCL_PANDA_EGG EggPoint : public EggPrimitive {
26 PUBLISHED:
27  INLINE explicit EggPoint(const std::string &name = "");
28  INLINE EggPoint(const EggPoint &copy);
29  INLINE EggPoint &operator = (const EggPoint &copy);
30 
31  virtual EggPoint *make_copy() const override;
32 
33  INLINE bool has_thick() const;
34  INLINE double get_thick() const;
35  INLINE void set_thick(double thick);
36  INLINE void clear_thick();
37 
38  INLINE bool has_perspective() const;
39  INLINE bool get_perspective() const;
40  INLINE void set_perspective(bool perspective);
41  INLINE void clear_perspective();
42 
43  virtual bool cleanup() override;
44 
45  virtual void write(std::ostream &out, int indent_level) const override;
46 
47 private:
48  enum Flags {
49  F_has_thick = 0x0001,
50  F_perspective = 0x0002,
51  F_has_perspective = 0x0004,
52  };
53 
54  int _flags;
55  double _thick;
56 
57 public:
58 
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62  static void init_type() {
63  EggPrimitive::init_type();
64  register_type(_type_handle, "EggPoint",
65  EggPrimitive::get_class_type());
66  }
67  virtual TypeHandle get_type() const override {
68  return get_class_type();
69  }
70  virtual TypeHandle force_init_type() override {
71  init_type();
72  return get_class_type();
73  }
74 
75 private:
76  static TypeHandle _type_handle;
77 
78 };
79 
80 #include "eggPoint.I"
81 
82 #endif
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
Definition: eggPrimitive.h:47
virtual bool cleanup()
Cleans up modeling errors in whatever context this makes sense.
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single point, or a collection of points as defined by a single <PointLight> entry.
Definition: eggPoint.h:25
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81