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 _STLIF_H_ 00012 #define _STLIF_H_ 00013 00014 #include <iostream> 00015 #include <fstream> 00016 using std::istream; 00017 using std::ifstream; 00018 00019 #include "MayDay.H" 00020 00021 #include "BaseIF.H" 00022 #include "STLExplorer.H" 00023 00024 #include "NamespaceHeader.H" 00025 00026 /// 00027 /** 00028 This implicit function reads an STL file and uses the polygonal information 00029 to provide edge intersections. As such, calling it's "value" function is 00030 an error. It is handled specially in "GeometryShop". 00031 */ 00032 class STLIF: public BaseIF 00033 { 00034 public: 00035 /// 00036 /** 00037 Type of data being read 00038 */ 00039 enum DataType 00040 { 00041 Invalid = -1, 00042 ASCII = 0, 00043 Binary , 00044 NUMDATATYPES 00045 }; 00046 00047 /// 00048 /** 00049 Constructor specifying filename (a_filename), the form of the data 00050 (a_dataType - ASCII or Binary), level set value (a_value), and whether 00051 inside the domain is where data is less than the level set value 00052 (a_inside). Data is read from the file named and a complete ASCII 00053 header (see above) is expected. 00054 */ 00055 STLIF(const char* const a_filename, 00056 const STLIF::DataType& a_dataType); 00057 00058 /// Copy constructor 00059 STLIF(const STLIF& a_inputIF); 00060 00061 /// Destructor 00062 virtual ~STLIF(); 00063 00064 /// 00065 /** 00066 For STLIF, calling this method is an error. 00067 */ 00068 virtual Real value(const RealVect& a_point) const; 00069 00070 virtual BaseIF* newImplicitFunction() const; 00071 00072 virtual STLExplorer* getExplorer() const; 00073 00074 protected: 00075 void makeExplorer(); 00076 00077 string m_filename; 00078 STLIF::DataType m_dataType; 00079 00080 STLExplorer* m_explorer; 00081 00082 private: 00083 STLIF() 00084 { 00085 MayDay::Abort("STLIF uses strong construction"); 00086 } 00087 00088 void operator=(const STLIF& a_inputIF) 00089 { 00090 MayDay::Abort("STLIF doesn't allow assignment"); 00091 } 00092 }; 00093 00094 #include "NamespaceFooter.H" 00095 #endif