00001 #ifndef X3DTK_MESH_STATSCALCULATOR_H 00002 #define X3DTK_MESH_STATSCALCULATOR_H 00003 00004 #include "MESH_StatsCalculatorStateVariables.h" 00005 #include "X3DOnePassProcessor.h" 00006 #include "MESH_SceneGraphTypes.h" 00007 #include "DFSGraphTraversal.h" 00008 #include "MESH_StatsCalculatorCoreVisitor.h" 00009 #include "MESH_Mesh.h" 00010 #include "MESH_MeshData.h" 00011 00012 namespace X3DTK { 00013 namespace MESH { 00014 00026 template<class MData, class VData, class EData, class FData, bool RW> 00027 class TemplateStatsCalculator : public X3DOnePassProcessor 00028 { 00029 public: 00031 TemplateStatsCalculator(); 00033 virtual ~TemplateStatsCalculator(); 00034 00036 void calculate(X3DNode *N); 00037 00039 inline unsigned int getModelFaces() const; 00041 inline unsigned int getModelVertices() const; 00043 inline unsigned int getModelEdges() const; 00044 00046 inline unsigned int getFacesOf(SFNode N) const; 00048 inline unsigned int getVerticesOf(SFNode N) const; 00050 inline unsigned int getEdgesOf(SFNode N) const; 00052 const SFMatrix34f &getMatrixOf(SFNode N); 00053 00055 inline const TemplateMeshInfo<MData, VData, EData, FData, RW> &getModelMeshInfo() const; 00057 inline const std::list<std::pair<SFNode, TemplateMeshInfo<MData, VData, EData, FData, RW> > > &getMeshInfoList() const; 00059 inline const TemplateVertexInfo<MData, VData, EData, FData, RW> &getModelVertexInfo() const; 00061 inline const std::list<std::pair<SFNode, TemplateVertexInfo<MData, VData, EData, FData, RW> > > &getVertexInfoList() const; 00062 00064 void setSelectedNodes(const MFNode &selectedNodes); 00066 MFNode getSelectedNodes() const; 00067 }; 00068 00070 typedef TemplateStatsCalculator<MeshData, VertexData, EdgeData, FaceData, true> StatsCalculator; 00071 00072 } 00073 } 00074 00075 #include "MESH_StatsCalculator.inl" 00076 00077 #endif 00078