SHAPER 9.16.0
FeaturesPlugin_MultiRotation.h
1// Copyright (C) 2017-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20// File: FeaturesPlugin_MultiRotation.h
21// Created: 30 Jan 2017
22// Author: Clarisse Genrault (CEA)
23
24#ifndef FEATURESPLUGIN_MULTIROTATION_H_
25#define FEATURESPLUGIN_MULTIROTATION_H_
26
27#include <FeaturesPlugin.h>
28
29#include <GeomAlgoAPI_Rotation.h>
30#include <GeomAlgoAPI_Translation.h>
31
32#include <ModelAPI_Feature.h>
33
41{
42 public:
44 inline static const std::string& ID()
45 {
46 static const std::string MY_MULTIROTATION_ID("AngularCopy");
47 return MY_MULTIROTATION_ID;
48 }
49
51 inline static const std::string& OBJECTS_LIST_ID()
52 {
53 static const std::string MY_OBJECTS_LIST_ID("main_objects");
54 return MY_OBJECTS_LIST_ID;
55 }
56
58 inline static const std::string& AXIS_ANGULAR_ID()
59 {
60 static const std::string MY_AXIS_ANGULAR_ID("axis_angular");
61 return MY_AXIS_ANGULAR_ID;
62 }
63
65 inline static const std::string& USE_ANGULAR_STEP_ID()
66 {
67 static const std::string MY_USE_ANGULAR_STEP_ID("use_step_angular");
68 return MY_USE_ANGULAR_STEP_ID;
69 }
70
72 inline static const std::string& STEP_ANGULAR_ID()
73 {
74 static const std::string MY_STEP_ANGULAR_ID("step_angular");
75 return MY_STEP_ANGULAR_ID;
76 }
77
79 inline static const std::string& NB_COPIES_ANGULAR_ID()
80 {
81 static const std::string MY_NB_COPIES_ANGULAR_ID("nb_angular");
82 return MY_NB_COPIES_ANGULAR_ID;
83 }
84
86 inline static const std::string& USE_RADIAL_DIR_ID()
87 {
88 static const std::string MY_USE_RADIAL_DIR_ID("use_radial_dir");
89 return MY_USE_RADIAL_DIR_ID;
90 }
91
93 inline static const std::string& STEP_RADIAL_ID()
94 {
95 static const std::string MY_STEP_RADIAL_ID("step_radial");
96 return MY_STEP_RADIAL_ID;
97 }
98
100 inline static const std::string& NB_COPIES_RADIAL_ID()
101 {
102 static const std::string MY_NB_COPIES_RADIAL_ID("nb_radial");
103 return MY_NB_COPIES_RADIAL_ID;
104 }
105
107 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
108 {
109 static std::string MY_KIND = FeaturesPlugin_MultiRotation::ID();
110 return MY_KIND;
111 }
112
114 FEATURESPLUGIN_EXPORT virtual void execute();
115
117 FEATURESPLUGIN_EXPORT virtual void initAttributes();
118
121
122private:
125 bool paramsOfRotation(std::shared_ptr<GeomAPI_Ax1>& theAxis, double& theAngle, int& theQuantity);
126
128 void performRotation1D();
129
130#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
132 void performRotation2D();
133
134 void loadNamingDS2(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
135 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
136 std::shared_ptr<GeomAPI_Shape> theBaseShape);
137
138 void loadNamingDS3(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
139 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
140 std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb);
141#endif
142};
143
144#endif // FEATURESPLUGIN_MULTIROTATION_H_
Feature that rotaes object around an axis an number of times.
Definition: FeaturesPlugin_MultiRotation.h:41
virtual FEATURESPLUGIN_EXPORT const std::string & getKind()
Definition: FeaturesPlugin_MultiRotation.h:107
static const std::string & NB_COPIES_ANGULAR_ID()
Attribute name of number of copies for angular.
Definition: FeaturesPlugin_MultiRotation.h:79
static const std::string & ID()
Multi-rotation kind.
Definition: FeaturesPlugin_MultiRotation.h:44
static const std::string & USE_ANGULAR_STEP_ID()
Attribute name for use angular step.
Definition: FeaturesPlugin_MultiRotation.h:65
static const std::string & STEP_RADIAL_ID()
Attribute name of radial step.
Definition: FeaturesPlugin_MultiRotation.h:93
static const std::string & NB_COPIES_RADIAL_ID()
Attribute name of number of copies for radial.
Definition: FeaturesPlugin_MultiRotation.h:100
virtual FEATURESPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: FeaturesPlugin_MultiRotation.cpp:60
static const std::string & OBJECTS_LIST_ID()
Attribute name of referenced objects.
Definition: FeaturesPlugin_MultiRotation.h:51
static const std::string & STEP_ANGULAR_ID()
Attribute name of step for the angular.
Definition: FeaturesPlugin_MultiRotation.h:72
virtual FEATURESPLUGIN_EXPORT void execute()
Performs the algorithm and stores results it in the data structure.
Definition: FeaturesPlugin_MultiRotation.cpp:92
static const std::string & USE_RADIAL_DIR_ID()
Attribute name for use radial dir.
Definition: FeaturesPlugin_MultiRotation.h:86
static const std::string & AXIS_ANGULAR_ID()
Attribute name of the angular direction.
Definition: FeaturesPlugin_MultiRotation.h:58
FeaturesPlugin_MultiRotation()
Use plugin manager for features creation.
Definition: FeaturesPlugin_MultiRotation.cpp:55
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41