00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _STLREADER_H_ 00012 #define _STLREADER_H_ 00013 00014 #include <iostream> 00015 #include <fstream> 00016 using std::istream; 00017 using std::ifstream; 00018 00019 #include "MayDay.H" 00020 #include "RefCountedPtr.H" 00021 00022 #include "STLMesh.H" 00023 00024 #include "NamespaceHeader.H" 00025 00026 class STLReader 00027 { 00028 public: 00029 /// Constructor - read from standard input 00030 STLReader() {} 00031 00032 /// Destructor 00033 virtual ~STLReader() {} 00034 00035 /// Return header information 00036 virtual string* GetHeader() const = 0; 00037 00038 /// Return number of elements 00039 virtual void GetNtri(int& a_ntri) const = 0; 00040 00041 /// Return whether number of elements from header matches file 00042 virtual void GetNtriMatch(bool& a_ntriMatch) const = 0; 00043 00044 /// Return pointer to the mesh 00045 virtual RefCountedPtr<STLMesh> GetMesh() const = 0; 00046 00047 protected: 00048 virtual void ReadData(istream& a_file, 00049 const int offset) = 0; 00050 00051 int m_ntri; // number of triangles read in 00052 bool m_ntriMatch; // true if m_ntri equals the number of triangles declared in the header 00053 00054 // actual data - shared by all copies 00055 RefCountedPtr<STLMesh> m_stlmesh; // pointer to the mesh 00056 00057 private: 00058 void operator=(const STLReader& a_inputReader) 00059 { 00060 MayDay::Abort("STLReader doesn't allow assignment"); 00061 } 00062 }; 00063 00064 #include "NamespaceFooter.H" 00065 #endif