31#if !defined(LOOS_XPLOREDMWRITER_HPP)
32#define LOOS_XPLOREDMWRITER_HPP
36#include <DensityGrid.hpp>
37#include <SimpleMeta.hpp>
41 namespace DensityTools {
46 XEDMWriter(std::ostream& os) : i(0), mos(os), fmt(5)
51 void operator()(
const T d) {
65 mos << std::setw(8) << k << std::endl;
87 for (
int i=0; i<3; i++) {
88 mins[i] =
static_cast<int>(floor(gridmin[i] * delta[i]));
89 maxs[i] =
static_cast<int>(floor(gridmax[i] * delta[i]));
90 gridsize[i] = dims[i] / delta[i];
96 os << std::endl << std::setw(8) << meta.size() << std::endl;
97 for (SimpleMeta::iterator i = meta.
begin(); i != meta.end(); ++i)
98 os << *i << std::endl;
100 for (
int i=0; i<3; i++)
101 os << std::setw(8) << nas[i] << std::setw(8) << mins[i] << std::setw(8) << maxs[i];
105 fc.width(12).scientific();
108 os << fc(gridsize[0]) << fc(gridsize[1]) << fc(gridsize[2]) << fc(90.0) << fc(90.0) << fc(90.0) << std::endl;
112 XEDMWriter<T> writer(os);
117 for (
int k=0; k<dims[2]; k++) {
123 for (
int j=0; j<dims[1]; j++)
124 for (
int i=0; i<dims[0]; i++)
128 os << std::endl << std::endl;
Output formatter class, adapted from Stroustrup's book.
Definition Fmt.hpp:25
Fmt & right(void)
Align right.
Definition Fmt.cpp:25
Fmt & width(const uint)
Set the output field width.
Definition Fmt.cpp:18
Fmt & scientific(void)
Output in scientific format.
Definition Fmt.cpp:13
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3