Panda3D
lerpblend.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 lerpblend.h
10  * @author frang
11  * @date 2000-05-30
12  */
13 
14 #ifndef __LERPBLEND_H__
15 #define __LERPBLEND_H__
16 
17 #include "directbase.h"
18 #include "typedReferenceCount.h"
19 
20 class EXPCL_DIRECT_INTERVAL LerpBlendType : public TypedReferenceCount {
21 PUBLISHED:
22  LerpBlendType() {}
23  virtual ~LerpBlendType();
24  virtual PN_stdfloat operator()(PN_stdfloat) = 0;
25 
26 public:
28  LerpBlendType& operator=(const LerpBlendType&);
29 public:
30  // now for typehandle stuff
31  static TypeHandle get_class_type() {
32  return _type_handle;
33  }
34  static void init_type() {
35  TypedReferenceCount::init_type();
36  register_type(_type_handle, "LerpBlendType",
37  TypedReferenceCount::get_class_type());
38  }
39  virtual TypeHandle get_type() const {
40  return get_class_type();
41  }
42  virtual TypeHandle force_init_type() {
43  init_type();
44  return get_class_type();
45  }
46 private:
47  static TypeHandle _type_handle;
48 };
49 
50 class EXPCL_DIRECT_INTERVAL EaseInBlendType : public LerpBlendType {
51 PUBLISHED:
52  EaseInBlendType() {}
53  virtual ~EaseInBlendType();
54  virtual PN_stdfloat operator()(PN_stdfloat);
55 
56 public:
58  EaseInBlendType& operator=(const EaseInBlendType&);
59 public:
60  // now for typehandle stuff
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64  static void init_type() {
65  TypedReferenceCount::init_type();
66  register_type(_type_handle, "EaseInBlendType",
67  LerpBlendType::get_class_type());
68  }
69  virtual TypeHandle get_type() const {
70  return get_class_type();
71  }
72  virtual TypeHandle force_init_type() {
73  init_type();
74  return get_class_type();
75  }
76 private:
77  static TypeHandle _type_handle;
78 };
79 
80 class EXPCL_DIRECT_INTERVAL EaseOutBlendType : public LerpBlendType {
81 PUBLISHED:
82  EaseOutBlendType() {}
83  virtual ~EaseOutBlendType();
84  virtual PN_stdfloat operator()(PN_stdfloat);
85 
86 public:
88  EaseOutBlendType& operator=(const EaseOutBlendType&);
89 public:
90  // now for typehandle stuff
91  static TypeHandle get_class_type() {
92  return _type_handle;
93  }
94  static void init_type() {
95  TypedReferenceCount::init_type();
96  register_type(_type_handle, "EaseOutBlendType",
97  LerpBlendType::get_class_type());
98  }
99  virtual TypeHandle get_type() const {
100  return get_class_type();
101  }
102  virtual TypeHandle force_init_type() {
103  init_type();
104  return get_class_type();
105  }
106 private:
107  static TypeHandle _type_handle;
108 };
109 
110 class EXPCL_DIRECT_INTERVAL EaseInOutBlendType : public LerpBlendType {
111 PUBLISHED:
112  EaseInOutBlendType() {}
113  virtual ~EaseInOutBlendType();
114  virtual PN_stdfloat operator()(PN_stdfloat);
115 public:
117  EaseInOutBlendType& operator=(const EaseInOutBlendType&);
118 public:
119  // now for typehandle stuff
120  static TypeHandle get_class_type() {
121  return _type_handle;
122  }
123  static void init_type() {
124  TypedReferenceCount::init_type();
125  register_type(_type_handle, "EaseInOutBlendType",
126  LerpBlendType::get_class_type());
127  }
128  virtual TypeHandle get_type() const {
129  return get_class_type();
130  }
131  virtual TypeHandle force_init_type() {
132  init_type();
133  return get_class_type();
134  }
135 private:
136  static TypeHandle _type_handle;
137 };
138 
139 class EXPCL_DIRECT_INTERVAL NoBlendType : public LerpBlendType {
140 PUBLISHED:
141  NoBlendType() {}
142  virtual ~NoBlendType();
143  virtual PN_stdfloat operator()(PN_stdfloat);
144 public:
145  NoBlendType(const NoBlendType&);
146  NoBlendType& operator=(const NoBlendType&);
147 public:
148  // now for typehandle stuff
149  static TypeHandle get_class_type() {
150  return _type_handle;
151  }
152  static void init_type() {
153  TypedReferenceCount::init_type();
154  register_type(_type_handle, "NoBlendType",
155  LerpBlendType::get_class_type());
156  }
157  virtual TypeHandle get_type() const {
158  return get_class_type();
159  }
160  virtual TypeHandle force_init_type() {
161  init_type();
162  return get_class_type();
163  }
164 private:
165  static TypeHandle _type_handle;
166 };
167 
168 #endif /* __LERPBLEND_H__ */
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
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.