1 // Created on: 2016-04-19
2 // Copyright (c) 2016 OPEN CASCADE SAS
3 // Created by: Oleg AGASHIN
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <BRepMesh_DelaunayBaseMeshAlgo.hxx>
17 #include <BRepMesh_MeshTool.hxx>
18 #include <BRepMesh_Delaun.hxx>
20 //=======================================================================
21 // Function: Constructor
23 //=======================================================================
24 BRepMesh_DelaunayBaseMeshAlgo::BRepMesh_DelaunayBaseMeshAlgo()
28 //=======================================================================
29 // Function: Destructor
31 //=======================================================================
32 BRepMesh_DelaunayBaseMeshAlgo::~BRepMesh_DelaunayBaseMeshAlgo()
36 //=======================================================================
37 //function : generateMesh
39 //=======================================================================
40 void BRepMesh_DelaunayBaseMeshAlgo::generateMesh()
42 const Handle(BRepMesh_DataStructureOfDelaun)& aStructure = getStructure();
43 const Handle(VectorOfPnt)& aNodesMap = getNodesMap();
45 IMeshData::VectorOfInteger aVerticesOrder(aNodesMap->Size(), getAllocator());
46 for (Standard_Integer i = 1; i <= aNodesMap->Size(); ++i)
48 aVerticesOrder.Append(i);
51 std::pair<Standard_Integer, Standard_Integer> aCellsCount = getCellsCount (aVerticesOrder.Size ());
52 BRepMesh_Delaun aMesher(aStructure, aVerticesOrder, aCellsCount.first, aCellsCount.second);
53 BRepMesh_MeshTool aCleaner(aStructure);
54 aCleaner.EraseFreeLinks();
56 postProcessMesh(aMesher);