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: Information.cpp,v 1.6 2007/05/20 23:02:48 delpinux Exp $ 00019 00020 #include <Information.hpp> 00021 00022 #include <Mesh.hpp> 00023 #include <UnknownListExpression.hpp> 00024 #include <Scene.hpp> 00025 00026 ConstReferenceCounting<Mesh> Information:: 00027 getMesh() 00028 { 00029 ASSERT(not __mesh.empty()); 00030 return __mesh.top(); 00031 } 00032 00033 void Information:: 00034 setMesh(ConstReferenceCounting<Mesh> mesh) 00035 { 00036 __mesh.push(mesh); 00037 } 00038 00039 void Information:: 00040 unsetMesh() 00041 { 00042 __mesh.pop(); 00043 } 00044 00045 bool Information:: 00046 usesMesh() const 00047 { 00048 return not __mesh.empty(); 00049 } 00050 00051 ConstReferenceCounting<Scene> Information:: 00052 getScene() 00053 { 00054 return __scene; 00055 } 00056 00057 void Information:: 00058 setScene(ConstReferenceCounting<Scene> scene) 00059 { 00060 __scene = scene; 00061 } 00062 00063 bool Information:: 00064 usesScene() const 00065 { 00066 return __scene != 0; 00067 } 00068 00069 void Information:: 00070 unsetScene() 00071 { 00072 __scene = 0; 00073 } 00074 00075 ReferenceCounting<UnknownListExpression> Information:: 00076 getUnknownList() 00077 { 00078 return __unknownListExpression; 00079 } 00080 00081 void Information:: 00082 setUnknownList(ReferenceCounting<UnknownListExpression> u) 00083 { 00084 __unknownListExpression = u; 00085 } 00086 00087 bool Information:: 00088 usesUnknownList() const 00089 { 00090 return __unknownListExpression != 0; 00091 } 00092 00093 00094 void Information:: 00095 unsetUnknownList() 00096 { 00097 __unknownListExpression = 0; 00098 } 00099 00100 00101 const bool& Information:: 00102 coarseMesh() const 00103 { 00104 return __coarseMesh; 00105 } 00106 00107 00108 void Information:: 00109 setCoarseMesh(const bool& coarse) 00110 { 00111 __coarseMesh = coarse; 00112 } 00113 00114 Information:: 00115 Information() 00116 : __scene(0), 00117 __unknownListExpression(0), 00118 __coarseMesh(true) 00119 { 00120 ; 00121 } 00122 00123 Information:: 00124 Information(const Information& I) 00125 : __mesh(I.__mesh), 00126 __scene(I.__scene), 00127 __unknownListExpression(I.__unknownListExpression), 00128 __coarseMesh(I.__coarseMesh) 00129 { 00130 ; 00131 } 00132 00133 Information:: 00134 ~Information() 00135 { 00136 ; 00137 } 00138
1.5.6