1 #ifndef COIN_SBBOX2I32_H 2 #define COIN_SBBOX2I32_H 27 #include <Inventor/SbVec2i32.h> 28 #include <Inventor/SbVec2f.h> 37 SbBox2i32(int32_t xmin, int32_t ymin, int32_t xmax, int32_t ymax)
38 : minpt(xmin, ymin), maxpt(xmax, ymax) { }
40 : minpt(minpoint), maxpt(maxpoint) { }
46 { minpt.setValue(xmin, ymin); maxpt.setValue(xmax, ymax);
return *
this; }
48 { minpt = minpoint; maxpt = maxpoint;
return *
this; }
53 void getBounds(int32_t & xmin, int32_t & ymin, int32_t & xmax, int32_t & ymax)
const 54 { minpt.getValue(xmin, ymin); maxpt.getValue(xmax, ymax); }
56 { minpoint = minpt; maxpoint = maxpt; }
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 SbVec2i32 & point)
const;
70 SbBool intersect(
const SbBox2i32 & box)
const;
73 void getOrigin(int32_t & originX, int32_t & originY)
const 74 { minpt.getValue(originX, originY); }
75 void getSize(int32_t & sizeX, int32_t & sizeY)
const 76 {
if (isEmpty()) { sizeX = sizeY = 0; }
77 else { sizeX = maxpt[0] - minpt[0]; sizeY = maxpt[1] - minpt[1]; } }
79 { SbDividerChk(
"SbBox2i32::getAspectRatio()", maxpt[1] - minpt[1]);
80 return float(maxpt[0] - minpt[0]) / float(maxpt[1] - minpt[1]); }
95 #endif // !COIN_SBBOX2I32_H The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SbBox2i32(int32_t xmin, int32_t ymin, int32_t xmax, int32_t ymax)
Definition: SbBox2i32.h:37
SbBox2i32(const SbBox2f &box)
Definition: SbBox2i32.h:42
The SbBox2d class is a 2 dimensional box with double precision corner coordinates.This box class is used by many other classes in Coin for data exchange and storage. It provides two box corners with double precision coordinates, which is among other things useful for representing screen or canvas dimensions in normalized coordinates.
Definition: SbBox2d.h:33
SbBool hasArea(void) const
Definition: SbBox2i32.h:67
SbBox2i32(const SbVec2i32 &minpoint, const SbVec2i32 &maxpoint)
Definition: SbBox2i32.h:39
SbVec2i32 & getMin(void)
Definition: SbBox2i32.h:59
SbBox2i32(void)
Definition: SbBox2i32.h:36
SbBox2i32 & setBounds(int32_t xmin, int32_t ymin, int32_t xmax, int32_t ymax)
Definition: SbBox2i32.h:45
SbBox2i32(const SbBox2d &box)
Definition: SbBox2i32.h:43
const SbVec2i32 & getMax(void) const
Definition: SbBox2i32.h:60
const SbVec2i32 & getMin(void) const
Definition: SbBox2i32.h:58
void getBounds(int32_t &xmin, int32_t &ymin, int32_t &xmax, int32_t &ymax) const
Definition: SbBox2i32.h:53
The SbBox2s class is a 2 dimensional box with short integer coordinates.This box class is used by oth...
Definition: SbBox2s.h:34
void getSize(int32_t &sizeX, int32_t &sizeY) const
Definition: SbBox2i32.h:75
void getBounds(SbVec2i32 &minpoint, SbVec2i32 &maxpoint) const
Definition: SbBox2i32.h:55
SbBox2i32(const SbBox2s &box)
Definition: SbBox2i32.h:41
SbBox2i32 & setBounds(const SbVec2i32 &minpoint, const SbVec2i32 &maxpoint)
Definition: SbBox2i32.h:47
The SbBox2f class is a 2 dimensional box with floating point corner coordinates.This box class is use...
Definition: SbBox2f.h:33
SbVec2f getCenter(void) const
Definition: SbBox2i32.h:72
The SbVec2i32 class is a 2 dimensional vector with 32-bit integer coordinates.
Definition: SbVec2i32.h:39
The SbBox2i32 class is a 2 dimensional box with int32_t coordinates.This box class is used by other c...
Definition: SbBox2i32.h:34
void getOrigin(int32_t &originX, int32_t &originY) const
Definition: SbBox2i32.h:73
SbVec2i32 & getMax(void)
Definition: SbBox2i32.h:61
SbBool isEmpty(void) const
Definition: SbBox2i32.h:66
float getAspectRatio(void) const
Definition: SbBox2i32.h:78