00001
00002
00003
00004
00005
00006
00007 #ifndef _MBVERTEXHEXAHEDRONMESHIJK_H
00008 #define _MBVERTEXHEXAHEDRONMESHIJK_H
00009
00010 #ifdef _WIN32
00011 # pragma warning( push )
00012 # pragma warning(disable:4250)
00013 #endif
00014
00015 #include <MeshVizXLM/mesh/MiVolumeMeshVertexHexahedronIjk.h>
00016 #include <MeshVizXLM/mesh/MiVolumeMeshHexahedronIjk.h>
00017 #include <mesh/MbMeshIjk.h>
00018 #include <mesh/volumes/MbHexahedronMeshIjk.h>
00019 #include <geometry/MbGeometryHexahedronIjk.h>
00020 #include <MeshVizXLM/MbVec3.h>
00021
00022 #include <Inventor/STL/iostream>
00023
00057 template <typename _CoordT=MbVec3d, typename _ScalarT=double, typename _Vec3T=MbVec3d, MiMeshIjk::StorageLayout _LAYOUT = MiMeshIjk::LAYOUT_KJI>
00058 class MbVertexHexahedronMeshIjk : public MiVolumeMeshVertexHexahedronIjk,
00059 public MbMeshIjk<_ScalarT,_Vec3T,_LAYOUT>
00060 {
00061
00062 public:
00063 MbVertexHexahedronMeshIjk(const MbHexahedronMeshIjk<_CoordT,_ScalarT,_Vec3T,_LAYOUT>& indexedMesh) :
00064 m_topology(indexedMesh.getTopology()), m_geometry(indexedMesh)
00065 {
00066 for (size_t i = 0; i < indexedMesh.getNumScalarSetsIjk(); ++i)
00067 if (indexedMesh.getScalarSetIjk(i)->getBinding() == MiDataSet::PER_CELL)
00068 this->addScalarSetIjk(indexedMesh.getScalarSetIjk(i));
00069 for (size_t i = 0; i < indexedMesh.getNumVec3SetsIjk(); ++i)
00070 if (indexedMesh.getVec3SetIjk(i)->getBinding() == MiDataSet::PER_CELL)
00071 this->addVec3SetIjk(indexedMesh.getVec3SetIjk(i));
00072 }
00073
00074 const MiTopologyIjk& getTopology() const
00075 {
00076 return m_topology;
00077 }
00078
00079 const MiGeometryHexahedronIjk& getGeometry() const
00080 {
00081 return m_geometry;
00082 }
00083
00084 void touch()
00085 {
00086 m_geometry.touch();
00087 }
00088
00089 private:
00090 virtual std::ostream& toStream(std::ostream& s) const;
00091
00092 const MiTopologyIjk& m_topology;
00093 MbGeometryHexahedronIjk<_LAYOUT> m_geometry;
00094
00095 };
00096
00097
00098 template <typename _CoordT, typename _ScalarT, typename _Vec3T, MiMeshIjk::StorageLayout _LAYOUT>
00099 inline std::ostream&
00100 MbVertexHexahedronMeshIjk<_CoordT,_ScalarT,_Vec3T,_LAYOUT>::toStream(std::ostream& s) const
00101 {
00102 MiVolumeMeshVertexHexahedronIjk::toStream(s);
00103 MbMeshIjk<_ScalarT,_Vec3T,_LAYOUT>::toStream(s);
00104 return s;
00105 }
00106
00107 #ifdef _WIN32
00108 # pragma warning( pop )
00109 #endif
00110
00111 #endif
00112
00113
00114
00115
00116
00117
00118
00119