summaryrefslogtreecommitdiff
path: root/inc/BRepMesh_DiscretFactory.hxx
blob: 9a5cdc345604a8fe21fe0927692595fbb936ccb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _BRepMesh_DiscretFactory_HeaderFile
#define _BRepMesh_DiscretFactory_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _BRepMesh_PluginEntryType_HeaderFile
#include <BRepMesh_PluginEntryType.hxx>
#endif
#ifndef _BRepMesh_FactoryError_HeaderFile
#include <BRepMesh_FactoryError.hxx>
#endif
#ifndef _TColStd_MapOfAsciiString_HeaderFile
#include <TColStd_MapOfAsciiString.hxx>
#endif
#ifndef _TCollection_AsciiString_HeaderFile
#include <TCollection_AsciiString.hxx>
#endif
#ifndef _Plugin_MapOfFunctions_HeaderFile
#include <Plugin_MapOfFunctions.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_BRepMesh_DiscretRoot_HeaderFile
#include <Handle_BRepMesh_DiscretRoot.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class TColStd_MapOfAsciiString;
class TCollection_AsciiString;
class BRepMesh_DiscretRoot;
class TopoDS_Shape;



//! This class intended to setup / retrieve default triangulation algorithm. <br>
//! Use BRepMesh_DiscretFactory::Get() static method to retrieve global Factory instance. <br>
//! Use BRepMesh_DiscretFactory::Discret() method to retrieve meshing tool. <br>
class BRepMesh_DiscretFactory  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
//! Returns the global factory instance. <br>
  Standard_EXPORT   static  BRepMesh_DiscretFactory& Get() ;
  
//! Returns the list of registered meshing algorithms. <br>
  Standard_EXPORT    const TColStd_MapOfAsciiString& Names() const;
  
//! Setup meshing algorithm by name. <br>
//! Returns true if requested tool is available. <br>
//! On fail Factory will continue to use previous algo. <br>
  Standard_EXPORT     Standard_Boolean SetDefaultName(const TCollection_AsciiString& theName) ;
  
//! Returns name for current meshing algorithm. <br>
  Standard_EXPORT    const TCollection_AsciiString& DefaultName() const;
  
//! Advanced function. Changes function name to retrieve from plugin. <br>
//! Returns true if requested tool is available. <br>
//! On fail Factory will continue to use previous algo. <br>
  Standard_EXPORT     Standard_Boolean SetFunctionName(const TCollection_AsciiString& theFuncName) ;
  
//! Setup meshing algorithm that should be created by this Factory. <br>
//! Returns true if requested tool is available. <br>
//! On fail Factory will continue to use previous algo. <br>
//! Call ::ErrorStatus() method to retrieve fault reason. <br>
  Standard_EXPORT     Standard_Boolean SetDefault(const TCollection_AsciiString& theName,const TCollection_AsciiString& theFuncName = "DISCRETALGO") ;
  
//! Returns function name that should be exported by plugin. <br>
  Standard_EXPORT    const TCollection_AsciiString& FunctionName() const;
  
//! Returns triangulation algorithm instance. <br>
  Standard_EXPORT     Handle_BRepMesh_DiscretRoot Discret(const TopoDS_Shape& theShape,const Standard_Real theDeflection,const Standard_Real theAngle) ;
  
//! Returns error status for last meshing algorithm switch. <br>
  Standard_EXPORT     BRepMesh_FactoryError ErrorStatus() const;





protected:

  
  Standard_EXPORT   BRepMesh_DiscretFactory();
Standard_EXPORT virtual ~BRepMesh_DiscretFactory();
  
  Standard_EXPORT     void Clear() ;


BRepMesh_PluginEntryType myPluginEntry;
BRepMesh_FactoryError myErrorStatus;
TColStd_MapOfAsciiString myNames;
TCollection_AsciiString myDefaultName;
TCollection_AsciiString myFunctionName;
Plugin_MapOfFunctions myFactoryMethods;


private:





};





// other Inline functions and methods (like "C++: function call" methods)


#endif