00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MITOPOLOGYIJ_H
00024 #define _MITOPOLOGYIJ_H
00025
00026 #include <MeshVizXLM/mesh/topology/MiTopology.h>
00027
00028 #include <Inventor/STL/sstream>
00029
00041 class MESHIVIZ_API MiTopologyIj : virtual public MiTopology
00042 {
00043 public:
00047 virtual size_t getNumCellsI() const = 0;
00048
00052 virtual size_t getNumCellsJ() const = 0;
00053
00060 virtual bool isDead(size_t SO_UNUSED_PARAM(i), size_t SO_UNUSED_PARAM(j)) const{ return false ;};
00061
00062 #if 1 SoDEPRECATED
00069 virtual std::string getCellName(size_t i, size_t j) const {
00070 std::ostringstream strstream;
00071 strstream << "(" << i << "," << j << ")" ;
00072 return strstream.str();
00073 }
00074 SoDEPRECATED
00081 virtual std::string getNodeName(size_t i, size_t j) const {
00082 std::ostringstream strstream;
00083 strstream << "(" << i << "," << j << ")" ;
00084 return strstream.str();
00085 }
00086 #endif
00088 private:protected:
00089
00092 virtual std::ostream& toStream(std::ostream& s) const
00093 {
00094 s << "#Mesh topology Ij" << std::endl;
00095 s << "#Num Cells I" << std::endl;
00096 s << getNumCellsI() << std::endl;
00097 s << "#Num Cells J" << std::endl;
00098 s << getNumCellsJ() << std::endl;
00099 s << "#Has Dead Cells" << std::endl;
00100 s << hasDeadCells() << std::endl;
00101 if (hasDeadCells())
00102 {
00103 s << "#Dead Cells:" << std::endl;
00104 for (size_t i=0; i<getNumCellsI(); i++)
00105 {
00106 for (size_t j=0; j<getNumCellsJ(); j++)
00107 {
00108 if (isDead(i,j))
00109 {
00110 s << "deadCell " << i << " " << j << std::endl;
00111 }
00112 }
00113 }
00114 }
00115
00116 return s;
00117 }
00118
00119 };
00120
00121
00122 #endif
00123
00124