fc9b36d6 |
1 | // Copyright (c) 2013 OPEN CASCADE SAS |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
14 | #ifndef _BRepMesh_DiscretRoot_HeaderFile |
15 | #define _BRepMesh_DiscretRoot_HeaderFile |
16 | |
17 | #include <Standard.hxx> |
ec357c5c |
18 | #include <Standard_Type.hxx> |
fc9b36d6 |
19 | #include <TopoDS_Shape.hxx> |
20 | #include <Standard_Transient.hxx> |
21 | |
22 | //! This is a common interface for meshing algorithms |
23 | //! instantiated by Mesh Factory and implemented by plugins. |
24 | class BRepMesh_DiscretRoot : public Standard_Transient |
25 | { |
26 | public: |
27 | |
28 | //! Destructor |
29 | Standard_EXPORT virtual ~BRepMesh_DiscretRoot(); |
30 | |
fc9b36d6 |
31 | //! Set the shape to triangulate. |
32 | inline void SetShape(const TopoDS_Shape& theShape) |
33 | { |
34 | myShape = theShape; |
35 | } |
36 | |
37 | inline const TopoDS_Shape& Shape() const |
38 | { |
39 | return myShape; |
40 | } |
41 | |
42 | //! Returns true if triangualtion was performed and has success. |
43 | inline Standard_Boolean IsDone() const |
44 | { |
45 | return myIsDone; |
46 | } |
47 | |
48 | //! Compute triangulation for set shape. |
49 | Standard_EXPORT virtual void Perform() = 0; |
50 | |
51 | |
92efcf78 |
52 | DEFINE_STANDARD_RTTIEXT(BRepMesh_DiscretRoot,Standard_Transient) |
fc9b36d6 |
53 | |
54 | protected: |
55 | |
56 | //! Constructor |
57 | Standard_EXPORT BRepMesh_DiscretRoot(); |
58 | |
59 | //! Sets IsDone flag. |
60 | inline void setDone() |
61 | { |
62 | myIsDone = Standard_True; |
63 | } |
64 | |
65 | //! Clears IsDone flag. |
66 | inline void setNotDone() |
67 | { |
68 | myIsDone = Standard_False; |
69 | } |
70 | |
71 | Standard_EXPORT virtual void init(); |
72 | |
fc9b36d6 |
73 | TopoDS_Shape myShape; |
74 | Standard_Boolean myIsDone; |
75 | }; |
76 | |
77 | DEFINE_STANDARD_HANDLE(BRepMesh_DiscretRoot, Standard_Transient) |
78 | |
79 | #endif |