OpenLexocad  27.0
SolidTool.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Topo/Shape.h>
4 #include <Topo/topo_defines.h>
5 
6 #include <set>
7 
8 namespace Topo
9 {
17 {
18 public:
19  SolidTool(void);
20  virtual ~SolidTool(void);
21 
23  // //
24  // --------------------- BEGIN API --------------------- //
25  // //
26  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
27  // //
29 
30  // Makes a solid from a model description and a vector of points
31  static pSolid makeSolid(const std::vector<int>& model,
32  const std::vector<Geom::Pnt>& vertices,
33  std::vector<std::vector<Geom::Pnt> >& defectPolygons);
34  // Makes a solid from a model description and a vector of points
35  static pSolid makeSolid_by_Face_stiching(const std::vector<int>& model,
36  const std::vector<Geom::Pnt>& vertices,
37  std::vector<std::vector<Geom::Pnt> >& defectPolygons);
39  static pSolid makeSolid(pConstShape shape);
41  static Geom::Pnt getCentre(pConstSolid solid);
42  // Makes a box
43  static pSolid makeBox(double length, double width, double height);
44  // Makes a shape of a 4-angle-roof
45  static pSolid
46  makeFourAngleRoof(double length, double width, double height, double leftSlope, double rightSlope, double leftHipSlope, double rightHipSlope);
47  // Makes a shape of a hip roof with wall
48  static pSolid makeHipRoofWithWall(double length, double width, double height, double wallHeight, double slope, double hipSlope, bool halfRoof);
49  // Makes a shape of roof and opening with beveled bottom and/or upper faces
50  static pSolid makeBeveledPlate(double length, double width, double height, int bottomType, int upperType, double slope, double angleRot);
51  // Makes shape of stairs ascending in U-shape
52  static pSolid makeStairsU(double length,
53  double width,
54  double height,
55  double stepWidth,
56  const std::vector<Geom::Pnt>& points,
57  const std::vector<double>& angles);
58  // Makes shape of stairs ascending in L-shape
59  static pSolid makeStairsL(double length,
60  double width,
61  double height,
62  double stepWidth,
63  const std::vector<Geom::Pnt>& points,
64  const std::vector<double>& angles);
65  // Makes shape of stairs ascending in I-shape
66  static pSolid makeStairsI(double length, double width, double height, double stepWidth, const std::vector<Geom::Pnt>& points);
67  // Makes shape of arch, intended in particular for windows
68  static pSolid makeWindowArch(double majorRadius, double minorRadius, double frameWidth, double sectorWidth, double depth, bool cutOut = true);
69 
71  // //
72  // ---------------------- END API ---------------------- //
73  // //
75 
76 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API
77  static void __setDefaultSolidTool__(Topo::SolidTool* tool) { _defaultTool = tool; }
80 
81 protected:
82  virtual pSolid _makeSolid(const std::vector<int>& model,
83  const std::vector<Geom::Pnt>& vertices,
84  std::vector<std::vector<Geom::Pnt> >& defectPolygons);
85  virtual pSolid _makeSolid_by_Face_stiching(const std::vector<int>& model,
86  const std::vector<Geom::Pnt>& vertices,
87  std::vector<std::vector<Geom::Pnt> >& defectPolygons);
88  virtual pSolid _makeSolid(pConstShape shape);
89  virtual Geom::Pnt _getCentre(pConstSolid solid);
90  virtual pSolid
91  _makeFourAngleRoof(double length, double width, double height, double leftSlope, double rightSlope, double leftHipSlope, double rightHipSlope);
92  virtual pSolid _makeHipRoofWithWall(double length, double width, double height, double wallHeight, double slope, double hipSlope, bool halfRoof);
93  virtual pSolid _makeBeveledPlate(double length, double width, double height, int bottomType, int upperType, double slope, double angleRot);
94  virtual pSolid _makeStairsU(double length,
95  double width,
96  double height,
97  double stepWidth,
98  const std::vector<Geom::Pnt>& points,
99  const std::vector<double>& angles);
100  virtual pSolid _makeStairsL(double length,
101  double width,
102  double height,
103  double stepWidth,
104  const std::vector<Geom::Pnt>& points,
105  const std::vector<double>& angles);
106  virtual pSolid _makeStairsI(double length, double width, double height, double stepWidth, const std::vector<Geom::Pnt>& points);
107  virtual pSolid _makeWindowArch(double majorRadius, double minorRadius, double frameWidth, double sectorWidth, double depth, bool cutOut);
108 
109  static Topo::SolidTool* _defaultTool;
111 #endif
112 };
113 
114 } // namespace Topo
std::shared_ptr< Topo::Solid const > pConstSolid
Definition: Shape.h:95
std::shared_ptr< Topo::Solid > pSolid
Definition: Shape.h:80
#define TOPO_EXPORT
Definition: topo_defines.h:8
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:42
Tools for creating, manipulating and querying Solids.
Definition: SolidTool.h:16
Definition: Variant.h:70
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:81