1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Revolution.h
4 // Created: 12 May 2015
5 // Author: Dmitry Bobylev
7 #ifndef GeomAlgoAPI_Revolution_H_
8 #define GeomAlgoAPI_Revolution_H_
10 #include "GeomAlgoAPI.h"
12 #include "GeomAlgoAPI_MakeSweep.h"
14 #include <GeomAPI_Ax1.h>
16 /// \class GeomAlgoAPI_Revolution
18 /// \brief Allows to create the revolution based on a given face, angles and bounding planes.
19 /// \n Note that only the planar faces are allowed as bounding faces and resulting
20 /// revolution will be bounded by the infinite planes taken from the faces.
21 /// \n If the bounding plane was specified with the angle then this plane will be rotated around
22 /// the axis to the value of the angle.
23 /// \n Note that algorithm return only one solid object. So in case when after cutting with bounding
24 /// planes algorithm got more than one solid it will return the closest to the center of mass of
26 class GeomAlgoAPI_Revolution : public GeomAlgoAPI_MakeSweep
29 /// \brief Creates revolution for the given shape.
30 /// \param[in] theBaseShape face for revolution.
31 /// \param[in] theAxis axis for revolution.
32 /// \param[in] theToAngle to angle.
33 /// \param[in] theFromAngle from angle.
34 GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr theBaseShape,
35 const std::shared_ptr<GeomAPI_Ax1> theAxis,
36 const double theToAngle,
37 const double theFromAngle);
39 /// \brief Creates revolution for the given shape.
40 /// \param[in] theBaseShape face for revolution.
41 /// \param[in] theAxis axis for revolution.
42 /// \param[in] theToShape to bounding shape. Can be empty. In this case offset will be applied to the basis.
43 /// \param[in] theToAngle to angle.
44 /// \param[in] theFromShape from bounding shape. Can be empty. In this case offset will be applied to the basis.
45 /// \param[in] theFromAngle from angle.
46 GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr theBaseShape,
47 const std::shared_ptr<GeomAPI_Ax1> theAxis,
48 const GeomShapePtr theToShape,
49 const double theToAngle,
50 const GeomShapePtr theFromShape,
51 const double theFromAngle);
54 /// Builds resulting shape.
55 void build(const GeomShapePtr& theBaseShape,
56 const std::shared_ptr<GeomAPI_Ax1>& theAxis,
57 const GeomShapePtr& theToShape,
58 const double theToAngle,
59 const GeomShapePtr& theFromShape,
60 const double theFromAngle);