00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MBVOLUMEGEOMETRYRECTILINEAR_H
00024 #define _MBVOLUMEGEOMETRYRECTILINEAR_H
00025
00026 #ifdef _WIN32
00027 #pragma warning(push)
00028 #pragma warning(disable:4250)
00029 #pragma warning(disable:4251)
00030 #endif
00031
00032 #include <MeshVizXLM/mesh/geometry/MiVolumeGeometryRectilinear.h>
00033 #include <geometry/MbGeometry.h>
00034
00035 #include <Inventor/STL/vector>
00036 #include <Inventor/STL/algorithm>
00037
00047 template <typename _T=double>
00048 class MbVolumeGeometryRectilinear : public MiVolumeGeometryRectilinear, public MbGeometry
00049 {
00050 public:
00052 template <typename _NodeIdIter>
00053 MbVolumeGeometryRectilinear(_NodeIdIter xBegin,_NodeIdIter xEnd,
00054 _NodeIdIter yBegin,_NodeIdIter yEnd,_NodeIdIter zBegin,_NodeIdIter zEnd)
00055 {
00056 m_x.assign(xBegin,xEnd);
00057 m_y.assign(yBegin,yEnd);
00058 m_z.assign(zBegin,zEnd);
00059 m_min.setValue(*std::min_element(xBegin,xEnd),
00060 *std::min_element(yBegin,yEnd),
00061 *std::min_element(zBegin,zEnd));
00062 m_max.setValue(*std::max_element(xBegin,xEnd),
00063 *std::max_element(yBegin,yEnd),
00064 *std::max_element(zBegin,zEnd));
00065 }
00066
00070 virtual double getX(size_t i) const { return m_x[i]; }
00074 virtual double getY(size_t j) const { return m_y[j]; }
00078 virtual double getZ(size_t k) const { return m_z[k]; }
00079
00083 MbVec3d getMin() const { return (MbVec3d) m_min;}
00087 MbVec3d getMax() const { return (MbVec3d) m_max;}
00088
00089 private:
00090 std::vector<_T> m_x;
00091 std::vector<_T> m_y;
00092 std::vector<_T> m_z;
00093 MbVec3<_T> m_min;
00094 MbVec3<_T> m_max;
00095
00096 };
00097
00098 #ifdef _WIN32
00099 #pragma warning(pop)
00100 #endif
00101
00102 #endif
00103
00104
00105