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 namespace Foam
00033 {
00034
00035
00036
00037 template <class Type>
00038 inline label treeNode<Type>::getVolType(const label octant) const
00039 {
00040 return (volType_ >> 2*octant) & 0x3;
00041 }
00042
00043
00044
00045
00046 template <class Type>
00047 inline const point& treeNode<Type>::mid() const
00048 {
00049 return mid_;
00050 }
00051
00052 template <class Type>
00053 inline treeElem<Type>* const* treeNode<Type>::subNodes() const
00054 {
00055 return subNodes_;
00056 }
00057
00058
00059 template <class Type>
00060 inline label treeNode<Type>::isNode(const label octant) const
00061 {
00062 return subNodeTypes_ & (0x1 << octant);
00063 }
00064
00065
00066 template <class Type>
00067 inline treeNode<Type>* treeNode<Type>::getNodePtr(const label octant) const
00068 {
00069 # ifdef FULLDEBUG
00070 if (!isNode(octant))
00071 {
00072 FatalErrorIn("treeNode::getNodePtr(const label)")
00073 << "not a treeNode"
00074 << abort(FatalError);
00075 }
00076 # endif
00077
00078 return static_cast<treeNode<Type>*>(subNodes_[octant]);
00079 }
00080
00081
00082
00083 template <class Type>
00084 inline treeLeaf<Type>* treeNode<Type>::getLeafPtr(const label octant) const
00085 {
00086 # ifdef FULLDEBUG
00087 if (isNode(octant))
00088 {
00089 FatalErrorIn("treeNode::getLeafPtr(const label)")
00090 << "not a treeLeaf"
00091 << abort(FatalError);
00092 }
00093 # endif
00094
00095 return static_cast<treeLeaf<Type>*>(subNodes_[octant]);
00096 }
00097
00098
00099
00100 }
00101
00102