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 #ifndef treeDataCell_H
00037 #define treeDataCell_H
00038 
00039 #include <meshTools/treeBoundBoxList.H>
00040 
00041 
00042 
00043 namespace Foam
00044 {
00045 
00046 
00047 class primitiveMesh;
00048 template<class Type> class indexedOctree;
00049 
00050 
00051 
00052 
00053 
00054 class treeDataCell
00055 {
00056     
00057 
00058         const primitiveMesh& mesh_;
00059 
00060         
00061         const labelList cellLabels_;
00062 
00063         
00064         const bool cacheBb_;
00065 
00066         
00067         treeBoundBoxList bbs_;
00068 
00069 
00070     
00071 
00072         
00073         treeBoundBox calcCellBb(const label cellI) const;
00074 
00075 public:
00076 
00077     
00078     ClassName("treeDataCell");
00079 
00080 
00081     
00082 
00083         
00084         treeDataCell
00085         (
00086             const bool cacheBb,
00087             const primitiveMesh&,
00088             const labelList&
00089         );
00090 
00091         
00092         treeDataCell(const bool cacheBb, const primitiveMesh&);
00093 
00094 
00095     
00096 
00097         
00098 
00099             const labelList& cellLabels() const
00100             {
00101                 return cellLabels_;
00102             }
00103 
00104             const primitiveMesh& mesh() const
00105             {
00106                 return mesh_;
00107             }
00108 
00109 
00110             label size() const
00111             {
00112                 return cellLabels_.size();
00113             }
00114 
00115             
00116             
00117             pointField points() const;
00118 
00119 
00120         
00121 
00122             
00123             
00124             label getVolumeType
00125             (
00126                 const indexedOctree<treeDataCell>&,
00127                 const point&
00128             ) const
00129             {
00130                 notImplemented
00131                 (
00132                     "treeDataCell::getVolumeType"
00133                     "(const indexedOctree<treeDataCell>&, const point&)"
00134                 );
00135                 return -1;
00136             }
00137 
00138             
00139             bool overlaps
00140             (
00141                 const label index,
00142                 const treeBoundBox& sampleBb
00143             ) const;
00144 
00145             
00146             
00147             void findNearest
00148             (
00149                 const labelList& indices,
00150                 const point& sample,
00151 
00152                 scalar& nearestDistSqr,
00153                 label& nearestIndex,
00154                 point& nearestPoint
00155             ) const;
00156 
00157             
00158             
00159             void findNearest
00160             (
00161                 const labelList& indices,
00162                 const linePointRef& ln,
00163 
00164                 treeBoundBox& tightest,
00165                 label& minIndex,
00166                 point& linePoint,
00167                 point& nearestPoint
00168             ) const
00169             {
00170                 notImplemented
00171                 (
00172                     "treeDataCell::findNearest"
00173                     "(const labelList&, const linePointRef&, ..)"
00174                 );
00175             }
00176 
00177             
00178             
00179             bool intersects
00180             (
00181                 const label index,
00182                 const point& start,
00183                 const point& end,
00184                 point& result
00185             ) const;
00186 
00187 };
00188 
00189 
00190 
00191 
00192 } 
00193 
00194 
00195 
00196 
00197 #endif
00198 
00199