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