Panda3D
Loading...
Searching...
No Matches
eggMorph.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 eggMorph.h
10 * @author drose
11 * @date 1999-01-29
12 */
13
14#ifndef EGGMORPH_H
15#define EGGMORPH_H
16
17#include "pandabase.h"
18
19#include "namable.h"
20#include "luse.h"
21#include "pset.h"
22
23/**
24 * A single <Dxyz> or <Duv> or some such entry. This simply contains the
25 * morph name and the offset value. The class EggMorph is actually a template
26 * class on the type of value that is being offset; the specific kinds of
27 * morphs are instantiated from this below.
28 */
29template<class Parameter>
30class EggMorph : public Namable {
31public:
32 INLINE EggMorph(const std::string &name, const Parameter &offset);
33 INLINE void set_offset(const Parameter &offset);
34 INLINE const Parameter &get_offset() const;
35
36 INLINE bool operator < (const EggMorph<Parameter> &other) const;
37 INLINE bool operator == (const EggMorph<Parameter> &other) const;
38 INLINE bool operator != (const EggMorph<Parameter> &other) const;
39
40 INLINE int compare_to(const EggMorph<Parameter> &other, double threshold) const;
41
42 INLINE void output(std::ostream &out, const std::string &tag,
43 int num_dimensions) const;
44
45private:
46 Parameter _offset;
47};
48
49// I'd love to export these, but it produces a strange linker issue with Mac
50// OS X's version of GCC. We'll do it only on Windows, then.
51#ifdef _MSC_VER
52EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EGG, EXPTP_PANDA_EGG, EggMorph<LVector3d>);
53EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EGG, EXPTP_PANDA_EGG, EggMorph<LVector4>);
54#endif
55
60
61#include "eggMorph.I"
62
63#endif
A single <Dxyz> or <Duv> or some such entry.
Definition eggMorph.h:30
int compare_to(const EggMorph< Parameter > &other, double threshold) const
compare_to() compares a different space than the operator methods, which only check the name.
Definition eggMorph.I:79
A base class for all things which can have a name.
Definition namable.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.