00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: Cube.hpp,v 1.6 2006/10/01 23:25:58 delpinux Exp $ 00019 00020 #ifndef CUBE_HPP 00021 #define CUBE_HPP 00022 00023 #include <Shape.hpp> 00024 #include <Vertex.hpp> 00025 00033 class Cube 00034 : public Shape 00035 { 00036 private: 00037 const Vertex __lower; 00038 const Vertex __higher; 00040 protected: 00048 bool __inShape(const TinyVector<3, real_t>& x) const 00049 { 00050 return ((x[0] <= __higher.x()) and 00051 (x[1] <= __higher.y()) and 00052 (x[2] <= __higher.z()) and 00053 (x[0] >= __lower.x()) and 00054 (x[1] >= __lower.y()) and 00055 (x[2] >= __lower.z())); 00056 } 00057 00065 std::ostream& __put(std::ostream& os) const; 00066 00072 ReferenceCounting<Shape> __getCopy() const; 00073 00074 public: 00082 const real_t& lowerCorner(const size_t& i) const 00083 { 00084 return __lower[i]; 00085 } 00086 00094 const real_t& higherCorner(const size_t& i) const 00095 { 00096 return __higher[i]; 00097 } 00098 00105 Cube(const Vertex& a, 00106 const Vertex& b); 00107 00113 Cube(const Cube& C); 00114 00119 ~Cube() 00120 { 00121 ; 00122 } 00123 }; 00124 00125 #endif // CUBE_HPP
1.5.6