Chombo + EB + MF  3.2
STLAsciiReader.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _STLASCIIREADER_H_
12 #define _STLASCIIREADER_H_
13 
14 #include <iostream>
15 #include <string>
16 using namespace std;
17 
18 #include "MayDay.H"
19 
20 #include "STLReader.H"
21 #include "STLMesh.H"
22 //#include "STLExplorer.H" // for comparators
23 
24 #include "NamespaceHeader.H"
25 
26 /*
27  * Reads ascii STL files and generates a mesh
28  * see http://www.cplusplus.com/doc/tutorial/files/
29  */
30 
32 {
33 public:
34  /// Constructor - read from standard input
36 
37  /// Constructor - read from file name
38  STLAsciiReader(const string& a_filename);
39 
40  /// Destructor
41  ~STLAsciiReader();
42 
43  /// Return header information
44  string* GetHeader() const;
45 
46  /// Return number of elements
47  void GetNtri(int& a_ntri) const;
48 
49  /// Return whether number of elements from header matches file
50  void GetNtriMatch(bool& a_ntriMatch) const;
51 
52  /// Return pointer to the mesh
53  RefCountedPtr<STLMesh> GetMesh() const;
54 
55 protected:
56  void ReadData(istream& a_file,
57  const int offset);
58 
59  string* m_header; // header info
60  int m_ntri; // number of triangles read in
61  bool m_ntriMatch; // true if m_ntri equals the number of triangles declared in the header
62 
63  // actual data - shared by all copies
64  RefCountedPtr<STLMesh> m_stlmesh; // pointer to the mesh
65 
66 private:
67  void operator=(const STLAsciiReader& a_inputReader)
68  {
69  MayDay::Abort("STLAsciiReader doesn't allow assignment");
70  }
71 };
72 
73 #include "NamespaceFooter.H"
74 #endif
Definition: STLAsciiReader.H:31
RefCountedPtr< STLMesh > m_stlmesh
Definition: STLAsciiReader.H:64
int m_ntri
Definition: STLAsciiReader.H:60
Definition: IntVect.H:719
Definition: STLReader.H:26
void operator=(const STLAsciiReader &a_inputReader)
Definition: STLAsciiReader.H:67
string * m_header
Definition: STLAsciiReader.H:59
bool m_ntriMatch
Definition: STLAsciiReader.H:61
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).