34 double minimum,
double maximum ) :
35 NodeImpl( destImageFile ), value_( value ), precision_( precision ), minimum_( minimum ), maximum_( maximum )
44 if ( minimum_ < E57_FLOAT_MIN )
46 minimum_ = E57_FLOAT_MIN;
48 if ( maximum_ > E57_FLOAT_MAX )
50 maximum_ = E57_FLOAT_MAX;
74 std::shared_ptr<FloatNodeImpl> fi( std::static_pointer_cast<FloatNodeImpl>( ni ) );
77 if ( precision_ != fi->precision_ )
83 if ( minimum_ != fi->minimum_ )
89 if ( maximum_ != fi->maximum_ )
139 pathNames.find(
pathName() ) == pathNames.end() )
146 const char *forcedFieldName )
151 if ( forcedFieldName !=
nullptr )
153 fieldName = forcedFieldName;
160 cf <<
space( indent ) <<
"<" << fieldName <<
" type=\"Float\"";
163 cf <<
" precision=\"single\"";
166 if ( minimum_ > E57_FLOAT_MIN )
168 cf <<
" minimum=\"" <<
static_cast<float>( minimum_ ) <<
"\"";
170 if ( maximum_ < E57_FLOAT_MAX )
172 cf <<
" maximum=\"" <<
static_cast<float>( maximum_ ) <<
"\"";
178 cf <<
">" <<
static_cast<float>( value_ ) <<
"</" << fieldName <<
">\n";
190 if ( minimum_ > E57_DOUBLE_MIN )
192 cf <<
" minimum=\"" << minimum_ <<
"\"";
194 if ( maximum_ < E57_DOUBLE_MAX )
196 cf <<
" maximum=\"" << maximum_ <<
"\"";
202 cf <<
">" << value_ <<
"</" << fieldName <<
">\n";
215 os <<
space( indent ) <<
"type: Float"
218 os <<
space( indent ) <<
"precision: ";
229 const std::streamsize oldPrecision = os.precision();
230 const std::ios_base::fmtflags oldFlags = os.flags();
232 os <<
space( indent ) << std::scientific << std::setprecision( 17 ) <<
"value: " << value_ <<
std::endl;
237 os.precision( oldPrecision );
238 os.flags( oldFlags );
void checkLeavesInSet(const StringSet &pathNames, NodeImplSharedPtr origin) override
bool isTypeEquivalent(NodeImplSharedPtr ni) override
NodeType type() const override
FloatPrecision precision() const
FloatNodeImpl(ImageFileImplWeakPtr destImageFile, double value=0, FloatPrecision precision=E57_DOUBLE, double minimum=E57_DOUBLE_MIN, double maximum=E57_DOUBLE_MAX)
void dump(int indent=0, std::ostream &os=std::cout) const override
bool isDefined(const ustring &pathName) override
void writeXml(ImageFileImplSharedPtr imf, CheckedFile &cf, int indent, const char *forcedFieldName=nullptr) override
ustring relativePathName(const NodeImplSharedPtr &origin, ustring childPathName=ustring()) const
void checkImageFileOpen(const char *srcFileName, int srcLineNumber, const char *srcFunctionName) const
virtual void dump(int indent=0, std::ostream &os=std::cout) const
QTextStream & endl(QTextStream &stream)
std::shared_ptr< class NodeImpl > NodeImplSharedPtr
std::weak_ptr< class ImageFileImpl > ImageFileImplWeakPtr
std::shared_ptr< class ImageFileImpl > ImageFileImplSharedPtr
FloatPrecision
The IEEE floating point number precisions supported.
@ E57_SINGLE
32 bit IEEE floating point number format
@ E57_ERROR_VALUE_OUT_OF_BOUNDS
element value out of min/max bounds
@ E57_ERROR_NO_BUFFER_FOR_ELEMENT
std::string ustring
UTF-8 encodeded Unicode string.
std::set< std::string > StringSet
@ E57_FLOAT
FloatNode class.
std::string toString(T x)
std::string space(size_t n)