Salome HOME
21680: EDF 2288 SMESH: creation of 0D elements from other elements
[modules/smesh.git] / src / SMESHUtils / SMESH_OctreeNode.hxx
index e8f5beac29f098511debcdf56aebce8e72b3e11b..eea34d11f8ea462f40d521c6150013066d978f16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -30,6 +30,7 @@
 #ifndef _SMESH_OCTREENODE_HXX_
 #define _SMESH_OCTREENODE_HXX_
 
+#include "SMESH_Utils.hxx"
 #include "SMESH_Octree.hxx"
 #include <gp_Pnt.hxx>
 #include "SMDS_MeshNode.hxx"
@@ -48,7 +49,7 @@ typedef SMDS_Iterator<SMESH_OctreeNode*>              SMESH_OctreeNodeIterator;
 typedef boost::shared_ptr<SMESH_OctreeNodeIterator>   SMESH_OctreeNodeIteratorPtr;
 typedef std::set< const SMDS_MeshNode*, TIDCompare >  TIDSortedNodeSet;
 
-class SMESH_OctreeNode : public SMESH_Octree {
+class SMESHUtils_EXPORT SMESH_OctreeNode : public SMESH_Octree {
 
 public:
 
@@ -108,7 +109,16 @@ public:
 
 protected:
 
-  SMESH_OctreeNode (int maxNbNodes );
+  struct Limit : public SMESH_TreeLimit
+  {
+    int myMaxNbNodes;
+    Limit(int maxLevel, double minSize, int maxNbNodes)
+      :SMESH_TreeLimit(maxLevel, minSize), myMaxNbNodes(maxNbNodes) {}
+  };
+
+  int                   getMaxNbNodes() const;
+
+  SMESH_OctreeNode();
 
   // Compute the bounding box of the whole set of nodes myNodes
   virtual Bnd_B3d*      buildRootBox();
@@ -117,7 +127,7 @@ protected:
   virtual void          buildChildrenData();
 
   // Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren()
-  virtual SMESH_Octree* allocateOctreeChild() const;
+  virtual SMESH_Octree* newChild() const;
 
   // Return in result a list of nodes closed to Node and remove it from SetOfNodes
   void                  FindCoincidentNodes( const SMDS_MeshNode *            Node,
@@ -125,9 +135,6 @@ protected:
                                              std::list<const SMDS_MeshNode*>* Result,
                                              const double                     precision);
 
-  // The max number of nodes a leaf box can contain
-  int                myMaxNbNodes;
-
   // The set of nodes inside the box of the Octree (Empty if Octree is not a leaf)
   TIDSortedNodeSet   myNodes;