1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
27 \*---------------------------------------------------------------------------*/
29 #include "meshOctreeCube.H"
30 #include "triSurface.H"
31 #include "meshOctreeSlot.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 inline meshOctreeCube::meshOctreeCube()
40 meshOctreeCubeBasic(),
44 containedElementsLabel_(-1),
45 containedEdgesLabel_(-1)
48 inline const meshOctreeSlot* meshOctreeCube::slotPtr() const
50 return activeSlotPtr_;
53 inline bool meshOctreeCube::isLeaf() const
61 inline meshOctreeCube* meshOctreeCube::subCube(const label scI) const
63 return subCubesPtr_[scI];
66 inline label meshOctreeCube::cubeLabel() const
71 inline bool meshOctreeCube::hasContainedElements() const
73 if( containedElementsLabel_ == -1 )
79 inline label meshOctreeCube::containedElements() const
81 return containedElementsLabel_;
84 inline bool meshOctreeCube::hasContainedEdges() const
86 if( containedEdgesLabel_ == -1 )
92 inline label meshOctreeCube::containedEdges() const
94 return containedEdgesLabel_;
97 inline void meshOctreeCube::operator=(const meshOctreeCube& moc)
99 static_cast<meshOctreeCubeCoordinates&>(*this) = moc.coordinates();
100 activeSlotPtr_ = moc.activeSlotPtr_;
101 subCubesPtr_ = moc.subCubesPtr_;
102 cubeLabel_ = moc.cubeLabel_;
103 containedElementsLabel_ = moc.containedElementsLabel_;
104 containedEdgesLabel_ = moc.containedEdgesLabel_;
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 } // End namespace Foam
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //