00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MITOPOLOGYIJK_H
00024 #define _MITOPOLOGYIJK_H
00025
00026 #include <MeshVizXLM/mesh/topology/MiTopology.h>
00027
00028 #include <Inventor/STL/sstream>
00029
00030
00042 class MESHIVIZ_API MiTopologyIjk : virtual public MiTopology
00043 {
00044 public:
00045
00049 virtual size_t getNumCellsI() const = 0;
00050
00054 virtual size_t getNumCellsJ() const = 0;
00055
00059 virtual size_t getNumCellsK() const = 0;
00060
00067 virtual bool isDead(size_t SO_UNUSED_PARAM(i), size_t SO_UNUSED_PARAM(j), size_t SO_UNUSED_PARAM(k)) const { return false; }
00068
00069 #if 1 SoDEPRECATED
00076 virtual std::string getCellName(size_t i, size_t j, size_t k) const
00077 {
00078 std::ostringstream strstream;
00079 strstream << "(" << i << "," << j << "," << k << ")" ;
00080 return strstream.str();
00081 }
00082 SoDEPRECATED
00089 virtual std::string getNodeName(size_t i, size_t j, size_t k) const
00090 {
00091 std::ostringstream strstream;
00092 strstream << "(" << i << "," << j << "," << k << ")" ;
00093 return strstream.str();
00094 }
00095 #endif
00097 private:protected:
00098
00101 virtual std::ostream& toStream(std::ostream& s) const
00102 {
00103 s << "#mesh topology Ijk" << std::endl;
00104 s << "#numCellsI" << std::endl;
00105 s << getNumCellsI() << std::endl;
00106 s << "#numCellsJ" << std::endl;
00107 s << getNumCellsJ() << std::endl;
00108 s << "#numCellsK" << std::endl;
00109 s << getNumCellsK() << std::endl;
00110 s << "#hasDeadCells" << std::endl;
00111 s << hasDeadCells() << std::endl;
00112 if (hasDeadCells())
00113 {
00114 s << "#deadCells:" << std::endl;
00115 for (size_t i=0; i<getNumCellsI(); i++)
00116 {
00117 for (size_t j=0; j<getNumCellsJ(); j++)
00118 {
00119 for (size_t k=0; k<getNumCellsK(); k++)
00120 {
00121 if (isDead(i,j,k))
00122 {
00123 s << "#deadCell(" << i << "," << j << "," << k << ")" << std::endl;
00124 }
00125 }
00126 }
00127 }
00128 }
00129 return s;
00130 }
00131
00132 };
00133
00134
00135 #endif
00136
00137
00138