27#include <Inventor/SbVec2s.h>
28#include <Inventor/SbVec2f.h>
38 : minpt(
xmin, ymin), maxpt(
xmax, ymax) { }
46 { minpt.setValue(
xmin, ymin); maxpt.setValue(
xmax, ymax);
return *
this; }
54 { minpt.getValue(
xmin, ymin); maxpt.getValue(
xmax, ymax); }
59 SbVec2s & getMin(
void) {
return minpt; }
61 SbVec2s & getMax(
void) {
return maxpt; }
63 void extendBy(
const SbVec2s & point);
66 SbBool isEmpty(
void)
const {
return (maxpt[0] < minpt[0]); }
67 SbBool hasArea(
void)
const {
return ((maxpt[0] > minpt[0]) && (maxpt[1] > minpt[1])); }
69 SbBool intersect(
const SbVec2s & point)
const;
72 SbVec2f getCenter(
void)
const {
return SbVec2f((minpt[0] + maxpt[0]) * 0.5f, (minpt[1] + maxpt[1]) * 0.5f); }
77 else {
sizeX = maxpt[0] - minpt[0];
sizeY = maxpt[1] - minpt[1]; } }
79 { SbDividerChk(
"SbBox2s::getAspectRatio()", maxpt[1] - minpt[1]);
80 return (
float(maxpt[0] - minpt[0]) /
float(maxpt[1] - minpt[1])); }
88 return ((
b1.getMin() ==
b2.getMin()) && (
b1.getMax() ==
b2.getMax()));
The SbBox2d class is a 2 dimensional box with double precision corner coordinates.
Definition SbBox2d.h:33
The SbBox2f class is a 2 dimensional box with floating point corner coordinates.
Definition SbBox2f.h:33
The SbBox2s class is a 2 dimensional box with short integer coordinates.
Definition SbBox2s.h:34
SbBox2s & setBounds(short xmin, short ymin, short xmax, short ymax)
Definition SbBox2s.h:45
const SbVec2s & getMin(void) const
Definition SbBox2s.h:58
float getAspectRatio(void) const
Definition SbBox2s.h:78
void getBounds(short &xmin, short &ymin, short &xmax, short &ymax) const
Definition SbBox2s.h:53
const SbVec2s & getMax(void) const
Definition SbBox2s.h:60
void getOrigin(short &originX, short &originY) const
Definition SbBox2s.h:73
SbBox2s(void)
Definition SbBox2s.h:36
void getSize(short &sizeX, short &sizeY) const
Definition SbBox2s.h:75
SbBox2s(const SbVec2s &minpoint, const SbVec2s &maxpoint)
Definition SbBox2s.h:39
void getBounds(SbVec2s &minpoint, SbVec2s &maxpoint) const
Definition SbBox2s.h:55
SbBox2s(short xmin, short ymin, short xmax, short ymax)
Definition SbBox2s.h:37
SbBox2s & setBounds(const SbVec2s &minpoint, const SbVec2s &maxpoint)
Definition SbBox2s.h:47
The SbList class is a template container class for lists.
Definition SbList.h:61
SbList(const int sizehint=DEFAULTSIZE)
Definition SbList.h:69
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:39
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:41