15 #include "xFileDataObjectDouble.h" 16 #include "string_utils.h" 19 TypeHandle XFileDataObjectDouble::_type_handle;
26 XFileDataObjectDouble::
27 XFileDataObjectDouble(
const XFileDataDef *data_def,
double value) :
41 out << get_string_value();
51 write_data(ostream &out,
int indent_level,
const char *separator)
const {
52 indent(out, indent_level)
53 << get_string_value() << separator <<
"\n";
62 void XFileDataObjectDouble::
63 set_int_value(
int int_value) {
64 _value = (double)int_value;
73 void XFileDataObjectDouble::
74 set_double_value(
double double_value) {
75 _value = double_value;
84 int XFileDataObjectDouble::
85 get_int_value()
const {
95 double XFileDataObjectDouble::
96 get_double_value()
const {
106 string XFileDataObjectDouble::
107 get_string_value()
const {
112 sprintf(buffer,
"%f", _value);
A definition of a single data element appearing within a template record.
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.
virtual void output_data(ostream &out) const
Writes a suitable representation of this node to an .x file in text mode.
TypeHandle is the identifier used to differentiate C++ class types.
The abstract base class for a number of different types of data elements that may be stored in the X ...