00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MBPYRAMIDCELL_H
00024 #define _MBPYRAMIDCELL_H
00025
00026 #ifdef _WIN32
00027 #pragma warning(push)
00028 #pragma warning(disable:4250)
00029 #endif
00030
00031 #include <MeshVizXLM/extractors/MxPyramidCellExtract.h>
00032 #include <MeshVizXLM/mesh/cell/MiVolumeCell.h>
00033 #include <MbMeshVizImpl.h>
00034
00035 class PiMarchingCase;
00036
00070 class MbPyramidCell : virtual public MiVolumeCell
00071 {
00072 public:
00073
00077 MbPyramidCell(size_t n0, size_t n1, size_t n2, size_t n3, size_t n4);
00078
00082 double getVolume(const MiGeometryI* meshGeometry) const
00083 {
00084 return MxPyramidCellExtract::getVolume(*meshGeometry,this);
00085 }
00086
00090 virtual size_t getNumFacets() const { return 5; }
00091
00095 virtual size_t getNumEdges() const { return 8; }
00096
00100 virtual size_t getNumNodes() const { return 5; }
00101
00107 virtual size_t getNodeIndex(size_t nod) const
00108 {
00109 return m_nodeIds[nod];
00110 }
00111
00121 virtual size_t appendNodesIndexOfFacet (size_t facet, std::vector<size_t>& facetNodes) const;
00122
00123 virtual void getIsosurfTopology(unsigned char caseId, std::vector< std::pair<size_t,size_t> >& edgeList ) const
00124 {
00125 MxPyramidCellExtract::getIsosurfTopology(caseId, edgeList);
00126 }
00127
00128 virtual unsigned char getMarchingCaseId(std::vector<bool> &nodesSign, size_t beginNodeId=0) const;
00129
00130 virtual double getRelativeSize(const MiGeometryI* meshGeometry) const
00131 {
00132 return MxPyramidCellExtract::getLongestEdgeLength(*meshGeometry,this);
00133 }
00134
00135
00136 virtual bool isPointInsideCell(const MiGeometryI& meshGeometry, const MbVec3d &point, std::vector<double>& weights) const
00137 {
00138 return MxPyramidCellExtract::isPointInsideCell(meshGeometry,this,point,weights);
00139 }
00140
00141
00142 private:
00146 virtual std::ostream& toStream(std::ostream& s) const;
00147
00148 size_t m_nodeIds[5];
00149 static size_t s_facetNode[5][4];
00150 };
00151
00152
00153 inline
00154 MbPyramidCell::MbPyramidCell(size_t n0, size_t n1, size_t n2, size_t n3,
00155 size_t n4)
00156 {
00157 m_nodeIds[0] = n0;
00158 m_nodeIds[1] = n1;
00159 m_nodeIds[2] = n2;
00160 m_nodeIds[3] = n3;
00161 m_nodeIds[4] = n4;
00162 }
00163
00164
00165
00166
00167 inline std::ostream&
00168 MbPyramidCell::toStream(std::ostream& s) const
00169 {
00170 s << "MbPyramidCell (" <<
00171 m_nodeIds[0] << "," <<
00172 m_nodeIds[1] << "," <<
00173 m_nodeIds[2] << "," <<
00174 m_nodeIds[3] << "," <<
00175 m_nodeIds[4] <<
00176 ")";
00177 return s;
00178 }
00179
00180 #ifdef _WIN32
00181 #pragma warning(pop)
00182 #endif
00183
00184 #endif
00185
00186
00187