61 Frame2D(T width=0, T height=0) : width(this->next()), height(this->next()){
62 this->set(width, height?height:width);
65 Frame2D(
const Frame2D<T> & geometry) : width(this->next()), height(this->next()) {
66 this->set(geometry.width, geometry.height);
71 this->set(geometry.width, geometry.height);
88 this->set(geometry.width, geometry.height);
96 Frame2D & operator=(
const T2 & frame){
116 void setArea(T w, T h){
135 T getHeight()
const {
146 return (width==0) || (height==0);
228 Box(coord_t x=0, coord_t y=0, coord_t width=0, coord_t height=0) :
241 this->setLocation(undefined, undefined);
245 void expand(coord_t x, coord_t y){
264 void expandHorz(
const Box & box){
266 expandHorz(box.x + box.width);
271 void expandVert(
const Box & box){
273 expandVert(box.y + box.height);
276 void expandHorz(coord_t x){
278 if (!isUndefined(this->x)){
279 const coord_t xMax = std::max(x, this->x + this->width);
280 this->x = std::min(this->x, x);
281 this->width = xMax - this->x;
289 void expandVert(coord_t y){
291 if (!isUndefined(this->y)){
292 const coord_t yMax = std::max(y, this->y + this->height);
293 this->y = std::min(this->y, y);
294 this->height = yMax - this->y;
321 bool isDefined()
const {
322 return isDefined(this->x) && isDefined(this->y) && isDefined(this->width) && isDefined(this->height);
327 bool isDefined(coord_t coord){
328 return !std::isnan(coord);
332 bool isUndefined(coord_t coord){
333 return std::isnan(coord);