![]() |
http://www.sim.no http://www.coin3d.org |
00001 #ifndef COIN_SBXFBOX3D_H 00002 #define COIN_SBXFBOX3D_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * ("GPL") version 2 as published by the Free Software Foundation. 00012 * See the file LICENSE.GPL at the root directory of this source 00013 * distribution for additional information about the GNU GPL. 00014 * 00015 * For using Coin with software that can not be combined with the GNU 00016 * GPL, and for taking advantage of the additional benefits of our 00017 * support services, please contact Systems in Motion about acquiring 00018 * a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/SbBox3d.h> 00028 #include <Inventor/SbDPMatrix.h> 00029 00030 class COIN_DLL_API SbXfBox3d : public SbBox3d { 00031 typedef SbBox3d inherited; 00032 00033 public: 00034 SbXfBox3d(void); 00035 SbXfBox3d(const SbVec3d & boxmin, const SbVec3d & boxmax); 00036 SbXfBox3d(const SbBox3d & box); 00037 00038 void setTransform(const SbDPMatrix & matrix); 00039 00040 const SbDPMatrix & getTransform(void) const { return matrix; } 00041 const SbDPMatrix & getInverse(void) const; 00042 SbVec3d getCenter(void) const; 00043 00044 void extendBy(const SbVec3d & pt); 00045 void extendBy(const SbBox3d & bb); 00046 void extendBy(const SbXfBox3d & bb); 00047 SbBool intersect(const SbVec3d & pt) const; 00048 SbBool intersect(const SbBox3d & bb) const; 00049 SbBool intersect(const SbXfBox3d & bb) const; 00050 SbBox3d project(void) const; 00051 void getSpan(const SbVec3d & direction, double & dMin, double & dMax) const; 00052 00053 // Must override the transform() method from SbBox3f, as the box and 00054 // the transform matrix are supposed to be kept separate in 00055 // SbXfBox3f. --mortene 00056 void transform(const SbDPMatrix & matrix); 00057 00058 // Overridden from SbBox3d 00059 double getVolume(void) const; 00060 00061 private: 00062 // These are incorrect for SbXfBox3d. Privatize/hide them. 00063 using SbBox3d::getMin; 00064 using SbBox3d::getMax; 00065 00066 void calcInverse(void) const; 00067 void makeInvInvalid(void); 00068 00069 SbDPMatrix matrix; 00070 mutable SbDPMatrix invertedmatrix; // lazy cache 00071 00072 }; // SbXfBox3d 00073 00074 COIN_DLL_API int operator == (const SbXfBox3d & b1, const SbXfBox3d & b2); 00075 COIN_DLL_API int operator != (const SbXfBox3d & b1, const SbXfBox3d & b2); 00076 00077 #endif // !COIN_SBXFBOX3D_H
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Feb 23 16:33:11 2009 for Coin by Doxygen. 1.5.8