0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IMeshTools / IMeshTools_MeshBuilder.hxx
CommitLineData
7bd071ed 1// Created on: 2016-04-07
2// Copyright (c) 2016 OPEN CASCADE SAS
3// Created by: Oleg AGASHIN
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _IMeshTools_MeshBuilder_HeaderFile
17#define _IMeshTools_MeshBuilder_HeaderFile
18
19#include <Message_Algorithm.hxx>
20#include <IMeshTools_Context.hxx>
21#include <Standard_Type.hxx>
22
23//! Builds mesh for each face of shape without triangulation.
24//! In case if some faces of shape have already been triangulated
25//! checks deflection of existing polygonal model and re-uses it
26//! if deflection satisfies the specified parameter. Otherwise
27//! nullifies existing triangulation and build triangulation anew.
28//!
29//! The following statuses are used:
30//! Message_Done1 - algorithm has finished without errors.
31//! Message_Fail1 - invalid context.
32//! Message_Fail2 - algorithm has faced unexpected error.
33//! Message_Fail3 - fail to discretize edges.
34//! Message_Fail4 - can't heal discrete model.
35//! Message_Fail5 - fail to pre-process model.
36//! Message_Fail6 - fail to discretize faces.
37//! Message_Fail7 - fail to post-process model.
38//! Message_Warn1 - shape contains no objects to mesh.
39class IMeshTools_MeshBuilder : public Message_Algorithm
40{
41public:
42
43 //! Constructor.
44 Standard_EXPORT IMeshTools_MeshBuilder();
45
46 //! Constructor.
47 Standard_EXPORT IMeshTools_MeshBuilder (const Handle (IMeshTools_Context)& theContext);
48
49 //! Destructor.
50 Standard_EXPORT virtual ~IMeshTools_MeshBuilder();
51
52 //! Sets context for algorithm.
53 inline void SetContext (const Handle (IMeshTools_Context)& theContext)
54 {
55 myContext = theContext;
56 }
57
58 //! Gets context of algorithm.
59 inline const Handle (IMeshTools_Context)& GetContext () const
60 {
61 return myContext;
62 }
63
64 //! Performs meshing ot the shape using current context.
65 Standard_EXPORT virtual void Perform ();
66
67 DEFINE_STANDARD_RTTI_INLINE(IMeshTools_MeshBuilder, Message_Algorithm)
68
69private:
70
71 Handle (IMeshTools_Context) myContext;
72};
73
74#endif