63 Frame2D(T width=0, T height=0) : width(this->next()), height(this->next()){
64 this->set(width, height?height:width);
67 Frame2D(
const Frame2D<T> & geometry) : width(this->next()), height(this->next()) {
68 this->set(geometry.width, geometry.height);
73 this->set(geometry.width, geometry.height);
90 this->set(geometry.width, geometry.height);
98 Frame2D & operator=(
const T2 & frame){
118 void setArea(T w, T h){
137 T getHeight()
const {
148 return (width==0) || (height==0);
230 Box(coord_t x=0, coord_t y=0, coord_t width=0, coord_t height=0) :
243 this->setLocation(undefined, undefined);
247 void expand(coord_t x, coord_t y){
266 void expandHorz(
const Box & box){
268 expandHorz(box.x + box.width);
273 void expandVert(
const Box & box){
275 expandVert(box.y + box.height);
278 void expandHorz(coord_t x){
280 if (!isUndefined(this->x)){
281 const coord_t xMax = std::max(x, this->x + this->width);
282 this->x = std::min(this->x, x);
283 this->width = xMax - this->x;
291 void expandVert(coord_t y){
293 if (!isUndefined(this->y)){
294 const coord_t yMax = std::max(y, this->y + this->height);
295 this->y = std::min(this->y, y);
296 this->height = yMax - this->y;
323 bool isDefined()
const {
324 return isDefined(this->x) && isDefined(this->y) && isDefined(this->width) && isDefined(this->height);
329 bool isDefined(coord_t coord){
330 return !std::isnan(coord);
334 bool isUndefined(coord_t coord){
335 return std::isnan(coord);