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 
00038 
00039 
00040 
00041 
00042 
00043 #ifndef surfaceLocation_H
00044 #define surfaceLocation_H
00045 
00046 #include <meshTools/pointIndexHit.H>
00047 #include <OpenFOAM/triPointRef.H>
00048 #include <OpenFOAM/InfoProxy.H>
00049 
00050 
00051 
00052 namespace Foam
00053 {
00054 
00055 
00056 class triSurface;
00057 
00058 
00059 
00060 
00061 
00062 class surfaceLocation
00063 :
00064     public pointIndexHit
00065 {
00066     
00067 
00068         triPointRef::proxType elementType_;
00069 
00070         label triangle_;
00071 
00072 public:
00073 
00074 
00075     
00076 
00077         
00078         surfaceLocation()
00079         :
00080             pointIndexHit(),
00081             elementType_(triPointRef::NONE),
00082             triangle_(-1)
00083         {}
00084 
00085         
00086         surfaceLocation
00087         (   
00088             const pointIndexHit& pih,
00089             const triPointRef::proxType elementType,
00090             const label triangle
00091         )
00092         :
00093             pointIndexHit(pih),
00094             elementType_(elementType),
00095             triangle_(triangle)
00096         {}
00097 
00098         
00099         surfaceLocation(Istream& is)
00100         :
00101             pointIndexHit(is),
00102             elementType_(triPointRef::proxType(readLabel(is))),
00103             triangle_(readLabel(is))
00104         {}
00105 
00106 
00107     
00108 
00109         triPointRef::proxType& elementType()
00110         {
00111             return elementType_;
00112         }
00113         
00114         triPointRef::proxType elementType() const
00115         {
00116             return elementType_;
00117         }
00118 
00119         label& triangle()
00120         {
00121             return triangle_;
00122         }
00123         
00124         label triangle() const
00125         {
00126             return triangle_;
00127         }
00128 
00129         
00130         vector normal(const triSurface& s) const;
00131 
00132         
00133         
00134         InfoProxy<surfaceLocation> info() const
00135         {
00136             return *this;
00137         }
00138 
00139         
00140         void write(Ostream& os, const triSurface& s) const;
00141 
00142 
00143     
00144 
00145         friend Istream& operator>>(Istream& is, surfaceLocation& sl);
00146 
00147         friend Ostream& operator<<(Ostream& os, const surfaceLocation& sl);
00148 
00149         friend Ostream& operator<<
00150         (
00151             Ostream&,
00152             const InfoProxy<surfaceLocation>& 
00153         );
00154 };
00155 
00156 
00157 
00158 
00159 } 
00160 
00161 
00162 
00163 #endif
00164 
00165