OpenLexocad  27.1
MeshBuilder.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Topo/Shape.h>
4 #include <topo_defines.h>
5 
6 namespace Mesher
7 {
8 class TriangulatedFace;
9 }
10 
11 namespace Core
12 {
13 class CoreDocument;
14 class DocObject;
15 } // namespace Core
16 
17 namespace Topo
18 {
19 class LX_TOPO_EXPORT MeshBuilder
20 {
21 public:
23  static Core::DocObject* makeBox(Core::CoreDocument* doc, double length, double width, double height);
25  static Core::DocObject* importInventor(Core::CoreDocument* doc, const std::string& filename);
27  static Core::DocObject* makePolygonMesh(Core::CoreDocument* doc, const std::vector<int>& model, const std::vector<Base::Pnt>& points);
29  static Core::DocObject* makePolygonMesh(Core::CoreDocument* doc, pConstMesh mesh);
32  static void makePolygonMeshDelaunay(const std::vector<Base::Pnt>& boundaryPoints, std::vector<int>& outputModel);
35  static Core::DocObject* makePolygonMeshDelaunay(Core::CoreDocument* doc, const std::vector<Base::Pnt>& boundaryPoints);
36 
38  static void __setMeshBuilder__(App::MeshBuilder* builder) { _meshBuilder = builder; }
39 
41  static pMesh makeBox(double length, double width, double height);
43  static pMesh makeMesh(const std::vector<Mesher::TriangulatedFace>& faces);
44 
45 protected:
46  virtual Core::DocObject* _makeBox(Core::CoreDocument* doc, double length, double width, double height);
47  virtual Core::DocObject* _importInventor(Core::CoreDocument* doc, const std::string& filename);
48  virtual Core::DocObject* _makePolygonMesh(Core::CoreDocument* doc, const std::vector<int>& model, const std::vector<Base::Pnt>& points);
49  virtual Core::DocObject* _makePolygonMesh(Core::CoreDocument* doc, pConstMesh mesh);
50  virtual void _makePolygonMeshDelaunay(const std::vector<Base::Pnt>& boundaryPoints, std::vector<int>& outputModel);
51  virtual Core::DocObject* _makePolygonMeshDelaunay(Core::CoreDocument* doc, const std::vector<Base::Pnt>& boundaryPoints);
52  virtual pMesh _makeBox(double length, double width, double height);
53  virtual pMesh _makeMesh(const std::vector<Mesher::TriangulatedFace>& faces);
54 
55 private:
56  static App::MeshBuilder* _meshBuilder;
57 };
58 
59 } // namespace Topo
CoreDocument()
Definition: CoreDocument.h:210
static void __setMeshBuilder__(App::MeshBuilder *builder)
Sets the Builder. For internal use only.
Definition: MeshBuilder.h:38
Core::PropertyText filename
Definition: CoreDocument.h:176
Definition: Base.h:12
std::shared_ptr< Topo::MeshShape > pMesh
Definition: Shape.h:77
Definition: Variant.h:55
std::shared_ptr< Topo::MeshShape const > pConstMesh
Definition: Shape.h:92
Definition: MeshBuilder.h:19
Definition: DocObject.h:51