00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef COIN_SBBOX2F_H
00021
#define COIN_SBBOX2F_H
00022
00023
#include <Inventor/SbBasic.h>
00024
#include <Inventor/SbVec2f.h>
00025
00026 class COIN_DLL_API SbBox2f {
00027
public:
00028 SbBox2f(
void);
00029 SbBox2f(
float xmin,
float ymin,
float xmax,
float ymax);
00030 SbBox2f(
const SbVec2f & min,
const SbVec2f & max);
00031 ~SbBox2f(
void);
00032
00033
const SbVec2f & getMin(
void)
const;
00034
const SbVec2f & getMax(
void)
const;
00035
SbVec2f getCenter(
void)
const;
00036
void extendBy(
const SbVec2f & point);
00037
void extendBy(
const SbBox2f & box);
00038 SbBool intersect(
const SbVec2f & point)
const;
00039 SbBool intersect(
const SbBox2f & box)
const;
00040
SbVec2f getClosestPoint(
const SbVec2f & p)
const;
00041
void setBounds(
float xmin,
float ymin,
float xmax,
float ymax);
00042
void setBounds(
const SbVec2f & min,
const SbVec2f & max);
00043
void getBounds(
float & xmin,
float & ymin,
float & xmax,
float & ymax)
const;
00044
void getBounds(
SbVec2f & min,
SbVec2f & max)
const;
00045
void getOrigin(
float & x0,
float & y0)
const;
00046
void getSize(
float & w,
float & h)
const;
00047
float getAspectRatio(
void)
const;
00048
void makeEmpty(
void);
00049 SbBool isEmpty(
void)
const;
00050 SbBool hasArea(
void)
const;
00051
00052
friend COIN_DLL_API
int operator ==(
const SbBox2f & b1,
const SbBox2f & b2);
00053
friend COIN_DLL_API
int operator !=(
const SbBox2f & b1,
const SbBox2f & b2);
00054
00055
private:
00056
SbVec2f minpt, maxpt;
00057
00058
float width(
void)
const;
00059
float height(
void)
const;
00060 };
00061
00062 COIN_DLL_API
int operator ==(
const SbBox2f & b1,
const SbBox2f & b2);
00063 COIN_DLL_API
int operator !=(
const SbBox2f & b1,
const SbBox2f & b2);
00064
00065
#endif // !COIN_SBBOX2F_H