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

SbBox3f.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_SBBOX3F_H 00021 #define COIN_SBBOX3F_H 00022 00023 #include <stdio.h> 00024 00025 #include <Inventor/SbVec3f.h> 00026 00027 class SbMatrix; 00028 00029 class COIN_DLL_API SbBox3f { 00030 public: 00031 SbBox3f(void); 00032 SbBox3f(const float minx, const float miny, const float minz, 00033 const float maxx, const float maxy, const float maxz); 00034 SbBox3f(const SbVec3f & min, const SbVec3f & max); 00035 ~SbBox3f(); 00036 00037 const SbVec3f & getMin(void) const; 00038 const SbVec3f & getMax(void) const; 00039 SbVec3f & getMin(void); 00040 SbVec3f & getMax(void); 00041 00042 SbVec3f getCenter(void) const; 00043 00044 void extendBy(const SbVec3f & point); 00045 void extendBy(const SbBox3f & box); 00046 00047 SbBool intersect(const SbVec3f & point) const; 00048 SbBool intersect(const SbBox3f & box) const; 00049 00050 void setBounds(const float minx, const float miny, const float minz, 00051 const float maxx, const float maxy, const float maxz); 00052 void setBounds(const SbVec3f & min, const SbVec3f & max); 00053 void getBounds(float & minx, float & miny, float & minz, 00054 float & maxx, float & maxy, float & maxz) const; 00055 void getBounds(SbVec3f & min, SbVec3f & max) const; 00056 00057 void getOrigin(float & x0, float & y0, float & z0) const; 00058 void getSize(float & dx, float & dy, float & dz) const; 00059 00060 void makeEmpty(void); 00061 SbBool isEmpty(void) const; 00062 SbBool hasVolume(void) const; 00063 00064 void getSpan(const SbVec3f & dir, float & dmin, float & dmax) const; 00065 void transform(const SbMatrix & matrix); 00066 float getVolume(void) const; 00067 00068 SbBool outside(const SbMatrix & mvp, int & cullbits) const; 00069 SbVec3f getClosestPoint(const SbVec3f & point) const; 00070 00071 friend COIN_DLL_API int operator ==(const SbBox3f & b1, const SbBox3f & b2); 00072 friend COIN_DLL_API int operator !=(const SbBox3f & b1, const SbBox3f & b2); 00073 00074 void print(FILE * file) const; 00075 00076 private: 00077 SbVec3f min, max; 00078 }; 00079 00080 COIN_DLL_API int operator ==(const SbBox3f & b1, const SbBox3f & b2); 00081 COIN_DLL_API int operator !=(const SbBox3f & b1, const SbBox3f & b2); 00082 00083 #endif // !COIN_SBBOX3F_H

Generated on Tue Jul 27 23:53:00 2004 for Coin by doxygen 1.3.7