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