Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SbBox2f.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 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, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
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

Generated at Tue Mar 5 03:31:11 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001