26 #ifndef MLN_WIN_CUBOID3D_HH
27 # define MLN_WIN_CUBOID3D_HH
33 # include <mln/core/internal/classical_window_base.hh>
34 # include <mln/core/alias/dpoint3d.hh>
40 mln_internal_add_classical_window_trait(cuboid3d);
80 struct cuboid3d :
public internal::classical_window_base< dpoint3d, cuboid3d >
95 unsigned depth()
const;
99 unsigned width()
const;
107 unsigned delta_()
const;
109 void print_(std::ostream& ostr)
const;
122 # ifndef MLN_INCLUDE_ONLY
130 mln_precondition(height % 2 == 1 && width % 2 == 1);
133 drow = static_cast<def::coord>(height / 2),
135 minus_dsli = static_cast<def::coord>(- dsli),
137 minus_dcol = static_cast<def::coord>(- dcol);
138 for (
def::coord sli = minus_dsli; sli <= dsli; ++sli)
139 for (
def::coord row = minus_drow; row <= drow; ++row)
140 for (
def::coord col = minus_dcol; col <= dcol; ++col)
169 return depth_ * width_ * height_;
174 cuboid3d::delta_()
const
176 if (depth_ > height_)
184 if (height_ > width_)
194 cuboid3d::print_(std::ostream& ostr)
const
196 ostr <<
"[cuboid3d: width=" << depth_
197 <<
", depth=" << width_
198 <<
", height=" << height_ <<
']';
201 # endif // ! MLN_INCLUDE_ONLY
208 #endif // ! MLN_WIN_CUBOID3D_HH