1 // Copyright (c) 2013 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _BRepMesh_DiscretRoot_HeaderFile
15 #define _BRepMesh_DiscretRoot_HeaderFile
17 #include <Standard.hxx>
18 #include <Standard_Type.hxx>
19 #include <TopoDS_Shape.hxx>
20 #include <Standard_Transient.hxx>
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
29 Standard_EXPORT virtual ~BRepMesh_DiscretRoot();
31 //! Setup linear deflection.
32 inline void SetDeflection(const Standard_Real theDeflection)
34 myDeflection = theDeflection;
37 //! Returns linear deflection.
38 inline Standard_Real Deflection() const
43 //! Setup angular deflection.
44 inline void SetAngle(const Standard_Real theAngle)
49 //! Returns angular deflection.
50 inline Standard_Real Angle() const
55 //! Set the shape to triangulate.
56 inline void SetShape(const TopoDS_Shape& theShape)
61 inline const TopoDS_Shape& Shape() const
66 //! Returns true if triangualtion was performed and has success.
67 inline Standard_Boolean IsDone() const
72 //! Compute triangulation for set shape.
73 Standard_EXPORT virtual void Perform() = 0;
76 DEFINE_STANDARD_RTTI(BRepMesh_DiscretRoot, Standard_Transient)
81 Standard_EXPORT BRepMesh_DiscretRoot();
86 myIsDone = Standard_True;
89 //! Clears IsDone flag.
90 inline void setNotDone()
92 myIsDone = Standard_False;
95 Standard_EXPORT virtual void init();
97 Standard_Real myDeflection;
98 Standard_Real myAngle;
100 Standard_Boolean myIsDone;
103 DEFINE_STANDARD_HANDLE(BRepMesh_DiscretRoot, Standard_Transient)