Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 #ifndef MeshedSurfaceProxy_H
00038 #define MeshedSurfaceProxy_H
00039 
00040 #include <OpenFOAM/pointField.H>
00041 #include <OpenFOAM/face.H>
00042 #include <OpenFOAM/triFace.H>
00043 
00044 #include <surfMesh/surfZoneList.H>
00045 #include <surfMesh/surfaceFormatsCore.H>
00046 #include <OpenFOAM/runTimeSelectionTables.H>
00047 #include <OpenFOAM/memberFunctionSelectionTables.H>
00048 #include <OpenFOAM/HashSet.H>
00049 
00050 
00051 
00052 namespace Foam
00053 {
00054 
00055 
00056 
00057 template<class Face> class MeshedSurface;
00058 
00059 
00060 
00061 
00062 
00063 template<class Face>
00064 class MeshedSurfaceProxy
00065 :
00066     public fileFormats::surfaceFormatsCore
00067 {
00068     
00069 
00070         const pointField& points_;
00071 
00072         const List<Face>& faces_;
00073 
00074         const List<surfZone>& zones_;
00075 
00076         const List<label>& faceMap_;
00077 
00078 
00079 public:
00080 
00081     
00082 
00083         
00084         ClassName("MeshedSurfaceProxy");
00085 
00086         
00087         static wordHashSet writeTypes();
00088 
00089         
00090         static bool canWriteType(const word& ext, const bool verbose=false);
00091 
00092 
00093     
00094 
00095         
00096         MeshedSurfaceProxy
00097         (
00098             const pointField&,
00099             const List<Face>&,
00100             const List<surfZone>& = List<surfZone>(),
00101             const List<label>& faceMap = List<label>()
00102         );
00103 
00104 
00105     
00106 
00107         virtual ~MeshedSurfaceProxy();
00108 
00109 
00110     
00111 
00112         declareMemberFunctionSelectionTable
00113         (
00114             void,
00115             MeshedSurfaceProxy,
00116             write,
00117             fileExtension,
00118             (
00119                 const fileName& name,
00120                 const MeshedSurfaceProxy<Face>& surf
00121             ),
00122             (name, surf)
00123         );
00124 
00125         
00126         static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
00127 
00128 
00129     
00130 
00131         
00132 
00133             
00134             inline const pointField& points() const
00135             {
00136                 return points_;
00137             }
00138 
00139             
00140             inline const List<Face>& faces() const
00141             {
00142                 return faces_;
00143             }
00144 
00145             
00146             
00147             
00148             inline const List<surfZone>& surfZones() const
00149             {
00150                 return zones_;
00151             }
00152 
00153             
00154             inline const List<label>& faceMap() const
00155             {
00156                 return faceMap_;
00157             }
00158 
00159             
00160             inline bool useFaceMap() const
00161             {
00162                 return faceMap_.size() == faces_.size();
00163             }
00164 
00165         
00166 
00167             
00168             virtual void write(const fileName& name) const
00169             {
00170                 write(name, *this);
00171             }
00172 
00173             
00174             virtual void write(const Time&, const word& surfName = "") const;
00175 };
00176 
00177 
00178 
00179 
00180 } 
00181 
00182 
00183 
00184 #ifdef NoRepository
00185 #   include "MeshedSurfaceProxy.C"
00186 #endif
00187 
00188 
00189 
00190 #endif
00191 
00192