1 // Created on: 2016-04-07
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 <IMeshTools_MeshBuilder.hxx>
17 #include <IMeshData_Face.hxx>
18 #include <OSD_Parallel.hxx>
20 //=======================================================================
21 // Function: Constructor
23 //=======================================================================
24 IMeshTools_MeshBuilder::IMeshTools_MeshBuilder ()
28 //=======================================================================
29 // Function: Constructor
31 //=======================================================================
32 IMeshTools_MeshBuilder::IMeshTools_MeshBuilder (
33 const Handle (IMeshTools_Context)& theContext)
34 : myContext(theContext)
38 //=======================================================================
39 // Function: Destructor
41 //=======================================================================
42 IMeshTools_MeshBuilder::~IMeshTools_MeshBuilder ()
46 //=======================================================================
49 //=======================================================================
50 void IMeshTools_MeshBuilder::Perform ()
54 const Handle (IMeshTools_Context)& aContext = GetContext ();
55 if (aContext.IsNull ())
57 SetStatus (Message_Fail1);
61 if (aContext->BuildModel ())
63 if (aContext->DiscretizeEdges ())
65 if (aContext->HealModel ())
67 if (aContext->PreProcessModel())
69 if (aContext->DiscretizeFaces())
71 if (aContext->PostProcessModel())
73 SetStatus(Message_Done1);
77 SetStatus(Message_Fail7);
82 SetStatus(Message_Fail6);
87 SetStatus(Message_Fail5);
92 SetStatus(Message_Fail4);
97 SetStatus (Message_Fail3);
102 const Handle (IMeshTools_ModelBuilder)& aModelBuilder =
103 aContext->GetModelBuilder ();
105 if (aModelBuilder.IsNull ())
107 SetStatus (Message_Fail1);
111 // Is null shape or another problem?
112 SetStatus (aModelBuilder->GetStatus ().IsSet (Message_Fail1) ?
113 Message_Warn1 : Message_Fail2);