Panda3D
 All Classes Functions Variables Enumerations
xFileDataObjectDouble.h
1 // Filename: xFileDataObjectDouble.h
2 // Created by: drose (07Oct04)
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 XFILEDATAOBJECTDOUBLE_H
16 #define XFILEDATAOBJECTDOUBLE_H
17 
18 #include "pandatoolbase.h"
19 #include "xFileDataObject.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : XFileDataObjectDouble
23 // Description : An double-valued data element. This matches one
24 // double data member of a template, or a single
25 // element of an double array.
26 ////////////////////////////////////////////////////////////////////
28 public:
29  XFileDataObjectDouble(const XFileDataDef *data_def, double value);
30 
31  virtual void output_data(ostream &out) const;
32  virtual void write_data(ostream &out, int indent_level,
33  const char *separator) const;
34 
35 protected:
36  virtual void set_int_value(int int_value);
37  virtual void set_double_value(double double_value);
38 
39  virtual int get_int_value() const;
40  virtual double get_double_value() const;
41  virtual string get_string_value() const;
42 
43 private:
44  double _value;
45 
46 public:
47  static TypeHandle get_class_type() {
48  return _type_handle;
49  }
50  static void init_type() {
51  XFileDataObject::init_type();
52  register_type(_type_handle, "XFileDataObjectDouble",
53  XFileDataObject::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 #include "xFileDataObjectDouble.I"
65 
66 #endif
virtual void output_data(ostream &out) const
Writes a suitable representation of this node to an .x file in text mode.
virtual void write_data(ostream &out, int indent_level, const char *separator) const
Writes a suitable representation of this node to an .x file in text mode.
A definition of a single data element appearing within a template record.
Definition: xFileDataDef.h:35
An double-valued data element.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
The abstract base class for a number of different types of data elements that may be stored in the X ...