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