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 #ifndef searchableSphere_H
00036 #define searchableSphere_H
00037 
00038 #include <meshTools/treeBoundBox.H>
00039 #include "searchableSurface.H"
00040 
00041 
00042 
00043 namespace Foam
00044 {
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 class searchableSphere
00053 :
00054     public searchableSurface
00055 {
00056 private:
00057 
00058     
00059 
00060         
00061         const point centre_;
00062 
00063         
00064         const scalar radius_;
00065 
00066         
00067         mutable wordList regions_;
00068 
00069 
00070     
00071 
00072         
00073         pointIndexHit findNearest
00074         (
00075             const point& sample,
00076             const scalar nearestDistSqr
00077         ) const;
00078 
00079         
00080         void findLineAll
00081         (
00082             const point& start,
00083             const point& end,
00084             pointIndexHit& near,
00085             pointIndexHit& far
00086         ) const;
00087 
00088 
00089         
00090         searchableSphere(const searchableSphere&);
00091 
00092         
00093         void operator=(const searchableSphere&);
00094 
00095 
00096 public:
00097 
00098     
00099     TypeName("searchableSphere");
00100 
00101 
00102     
00103 
00104         
00105         searchableSphere(const IOobject& io, const point&, const scalar radius);
00106 
00107         
00108         searchableSphere
00109         (
00110             const IOobject& io,
00111             const dictionary& dict
00112         );
00113 
00114     
00115 
00116         virtual ~searchableSphere();
00117 
00118 
00119     
00120 
00121         virtual const wordList& regions() const;
00122 
00123         
00124         virtual bool hasVolumeType() const
00125         {
00126             return true;
00127         }
00128 
00129         
00130         virtual label size() const
00131         {
00132             return 1;
00133         }
00134 
00135         
00136         
00137         virtual pointField coordinates() const
00138         {
00139             return pointField(1, centre_);
00140         }
00141 
00142 
00143         
00144 
00145             virtual void findNearest
00146             (
00147                 const pointField& sample,
00148                 const scalarField& nearestDistSqr,
00149                 List<pointIndexHit>&
00150             ) const;
00151 
00152             virtual void findLine
00153             (
00154                 const pointField& start,
00155                 const pointField& end,
00156                 List<pointIndexHit>&
00157             ) const;
00158 
00159             virtual void findLineAny
00160             (
00161                 const pointField& start,
00162                 const pointField& end,
00163                 List<pointIndexHit>&
00164             ) const;
00165 
00166             
00167             virtual void findLineAll
00168             (
00169                 const pointField& start,
00170                 const pointField& end,
00171                 List<List<pointIndexHit> >&
00172             ) const;
00173 
00174             
00175             virtual void getRegion
00176             (
00177                 const List<pointIndexHit>&,
00178                 labelList& region
00179             ) const;
00180 
00181             
00182             virtual void getNormal
00183             (
00184                 const List<pointIndexHit>&,
00185                 vectorField& normal
00186             ) const;
00187 
00188             
00189             
00190             virtual void getVolumeType
00191             (
00192                 const pointField&,
00193                 List<volumeType>&
00194             ) const;
00195 
00196 
00197         
00198 
00199             bool writeData(Ostream&) const
00200             {
00201                 notImplemented("searchableSphere::writeData(Ostream&) const");
00202                 return false;
00203             }
00204 
00205 };
00206 
00207 
00208 
00209 
00210 } 
00211 
00212 
00213 
00214 #endif
00215 
00216