Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

SbBox2s.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2003 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SBBOX2S_H
00021 #define COIN_SBBOX2S_H
00022 
00023 #include <Inventor/SbBasic.h>
00024 #include <Inventor/SbVec2s.h>
00025 
00026 class COIN_DLL_API SbBox2s {
00027 public:
00028   SbBox2s(void);
00029   SbBox2s(short xmin, short ymin, short xmax, short ymax);
00030   SbBox2s(const SbVec2s & boxmin, const SbVec2s & boxmax);
00031   ~SbBox2s(void);
00032 
00033   const SbVec2s & getMin(void) const;
00034   const SbVec2s & getMax(void) const;
00035   void extendBy(const SbVec2s & point);
00036   void extendBy(const SbBox2s & box);
00037   SbBool intersect(const SbVec2s & point) const;
00038   SbBool intersect(const SbBox2s & box) const;
00039   void setBounds(short xmin, short ymin, short xmax, short ymax);
00040   void setBounds(const SbVec2s & boxmin, const SbVec2s & boxmax);
00041   void getBounds(short & xmin, short & ymin, short & xmax, short & ymax) const;
00042   void getBounds(SbVec2s & boxmin, SbVec2s & boxmax) const;
00043   void getOrigin(short & originX, short & originY) const;
00044   void getSize(short & sizeX, short & sizeY) const;
00045   float getAspectRatio(void) const;
00046   void makeEmpty(void);
00047   friend COIN_DLL_API int operator ==(const SbBox2s & b1, const SbBox2s & b2);
00048   friend COIN_DLL_API int operator !=(const SbBox2s & b1, const SbBox2s & b2);
00049 
00050 private:
00051   SbVec2s minpt, maxpt;
00052 
00053   short width(void) const;
00054   short height(void) const;
00055   SbBool hasArea(void) const;
00056 };
00057 
00058 COIN_DLL_API int operator ==(const SbBox2s & b1, const SbBox2s & b2);
00059 COIN_DLL_API int operator !=(const SbBox2s & b1, const SbBox2s & b2);
00060 
00061 #endif // !COIN_SBBOX2S_H

Generated on Sat Sep 3 09:49:28 2005 for Coin by  doxygen 1.4.4