SHAPER  9.12.0
FeaturesPlugin_Validators.h
1 // Copyright (C) 2014-2023 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 #ifndef FeaturesPlugin_Validators_H_
21 #define FeaturesPlugin_Validators_H_
22 
23 #include <ModelAPI_AttributeValidator.h>
24 #include <ModelAPI_FeatureValidator.h>
25 
30 {
31 public:
36  virtual bool isValid(const AttributePtr& theAttribute,
37  const std::list<std::string>& theArguments,
38  Events_InfoMessage& theError) const;
39 };
40 
45 {
46 public:
51  virtual bool isValid(const AttributePtr& theAttribute,
52  const std::list<std::string>& theArguments,
53  Events_InfoMessage& theError) const;
54 };
55 
60 {
61  public:
66  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
67  const std::list<std::string>& theArguments,
68  Events_InfoMessage& theError) const;
69 };
70 
75 {
76  public:
81  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
82  const std::list<std::string>& theArguments,
83  Events_InfoMessage& theError) const;
84 };
85 
91 {
92 public:
97  virtual bool isValid(const AttributePtr& theAttribute,
98  const std::list<std::string>& theArguments,
99  Events_InfoMessage& theError) const;
100 
101 private:
102  bool isValidAttribute(const AttributePtr& theAttribute,
103  const std::list<std::string>& theArguments,
104  Events_InfoMessage& theError) const;
105 };
106 
113 {
114  public:
119  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
120  const std::list<std::string>& theArguments,
121  Events_InfoMessage& theError) const;
122 };
123 
128 {
129 public:
134  virtual bool isValid(const AttributePtr& theAttribute,
135  const std::list<std::string>& theArguments,
136  Events_InfoMessage& theError) const;
137 };
138 
144 {
145 public:
150  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
151  const std::list<std::string>& theArguments,
152  Events_InfoMessage& theError) const;
153 
154 private:
155  bool isShapesCanBeEmpty(const AttributePtr& theAttribute,
156  Events_InfoMessage& theError) const;
157 };
158 
163 {
164 public:
169  virtual bool isValid(const AttributePtr& theAttribute,
170  const std::list<std::string>& theArguments,
171  Events_InfoMessage& theError) const;
172 };
173 
178 {
179 public:
185  virtual bool isValid(const AttributePtr& theAttribute,
186  const std::list<std::string>& theArguments,
187  Events_InfoMessage& theError) const;
188 };
189 
194 {
195 public:
201  virtual bool isValid(const AttributePtr& theAttribute,
202  const std::list<std::string>& theArguments,
203  Events_InfoMessage& theError) const;
204 };
205 
210 {
211 public:
217  virtual bool isValid(const AttributePtr& theAttribute,
218  const std::list<std::string>& theArguments,
219  Events_InfoMessage& theError) const;
220 };
221 
226 {
227 public:
233  virtual bool isValid(const AttributePtr& theAttribute,
234  const std::list<std::string>& theArguments,
235  Events_InfoMessage& theError) const;
236 };
237 
242 {
243 public:
249  virtual bool isValid(const AttributePtr& theAttribute,
250  const std::list<std::string>& theArguments,
251  Events_InfoMessage& theError) const;
252 };
253 
258 {
259  public:
264  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
265  const std::list<std::string>& theArguments,
266  Events_InfoMessage& theError) const;
267 };
268 
273 {
274 public:
280  virtual bool isValid(const AttributePtr& theAttribute,
281  const std::list<std::string>& theArguments,
282  Events_InfoMessage& theError) const;
283 };
284 
289 {
290  public:
295  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
296  const std::list<std::string>& theArguments,
297  Events_InfoMessage& theError) const;
298 };
299 
304 {
305  public:
310  virtual bool isValid(const AttributePtr& theAttribute,
311  const std::list<std::string>& theArguments,
312  Events_InfoMessage& theError) const;
313 };
314 
319 {
320 public:
325  virtual bool isValid(const AttributePtr& theAttribute,
326  const std::list<std::string>& theArguments,
327  Events_InfoMessage& theError) const;
328 };
329 
335 {
336 public:
343  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
344  const std::list<std::string>& theArguments,
345  Events_InfoMessage& theError) const;
346 
348  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
349 };
350 
355 {
356 public:
361  virtual bool isValid(const AttributePtr& theAttribute,
362  const std::list<std::string>& theArguments,
363  Events_InfoMessage& theError) const;
364 };
365 
370 {
371 public:
376  virtual bool isValid(const AttributePtr& theAttribute,
377  const std::list<std::string>& theArguments,
378  Events_InfoMessage& theError) const;
379 };
380 
385 {
386 public:
391  virtual bool isValid(const AttributePtr& theAttribute,
392  const std::list<std::string>& theArguments,
393  Events_InfoMessage& theError) const;
394 };
395 
401 {
402 public:
409  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
410  const std::list<std::string>& theArguments,
411  Events_InfoMessage& theError) const;
412 
414  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
415 };
416 
421 {
422 public:
427  virtual bool isValid(const AttributePtr& theAttribute,
428  const std::list<std::string>& theArguments,
429  Events_InfoMessage& theError) const;
430 };
431 
437 {
438 public:
445  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
446  const std::list<std::string>& theArguments,
447  Events_InfoMessage& theError) const;
448 
450  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
451 };
452 
457 {
458 public:
464  virtual bool isValid(const AttributePtr& theAttribute,
465  const std::list<std::string>& theArguments,
466  Events_InfoMessage& theError) const;
467 };
468 
473 {
474 public:
480  virtual bool isValid(const AttributePtr& theAttribute,
481  const std::list<std::string>& theArguments,
482  Events_InfoMessage& theError) const;
483 };
484 
489 {
490 public:
496  virtual bool isValid(const AttributePtr& theAttribute,
497  const std::list<std::string>& theArguments,
498  Events_InfoMessage& theError) const;
499 };
500 
501 #endif
An event message for sending a string message which has to be translated.
Definition: Events_InfoMessage.h:35
Verifies the selected object for intersection feature.
Definition: FeaturesPlugin_Validators.h:370
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1722
Validator for the base objects for generation.
Definition: FeaturesPlugin_Validators.h:113
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:374
A validator for selection base for generation.
Definition: FeaturesPlugin_Validators.h:91
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:283
Validates that boolean operation have enough arguments.
Definition: FeaturesPlugin_Validators.h:335
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Returns true if feature and/or attributes are valid.
Definition: FeaturesPlugin_Validators.cpp:1468
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute)
Definition: FeaturesPlugin_Validators.cpp:1562
Validates that boolean operation have enough arguments.
Definition: FeaturesPlugin_Validators.h:437
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Returns true if feature and/or attributes are valid.
Definition: FeaturesPlugin_Validators.cpp:2000
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute)
Definition: FeaturesPlugin_Validators.cpp:2046
Verifies the selected object for boolean common feature.
Definition: FeaturesPlugin_Validators.h:421
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1940
Validates that boolean operation have enough arguments.
Definition: FeaturesPlugin_Validators.h:401
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute)
Definition: FeaturesPlugin_Validators.cpp:1926
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Returns true if feature and/or attributes are valid.
Definition: FeaturesPlugin_Validators.cpp:1848
Verifies the selected object for boolean fuse feature.
Definition: FeaturesPlugin_Validators.h:385
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1794
Validates selection for boolean operation.
Definition: FeaturesPlugin_Validators.h:178
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:874
Verifies the selected object for boolean smash feature.
Definition: FeaturesPlugin_Validators.h:355
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1575
Verifies the selected object is circular edge or cylindrical face.
Definition: FeaturesPlugin_Validators.h:319
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1450
A validator for selection at composite feature start.
Definition: FeaturesPlugin_Validators.h:128
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:578
Validator for the "Recover" feature.
Definition: FeaturesPlugin_Validators.h:304
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1403
Validates selection for fillet operation.
Definition: FeaturesPlugin_Validators.h:457
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:2055
A validator for extrusion from/to face attribute.
Definition: FeaturesPlugin_Validators.h:163
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:781
A validator for extrusion direction attribute.
Definition: FeaturesPlugin_Validators.h:144
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:627
Validates selection for 1d-fillet operation.
Definition: FeaturesPlugin_Validators.h:210
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1032
Validates selection for fillet operation.
Definition: FeaturesPlugin_Validators.h:194
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:965
Validates selection for glue faces operation.
Definition: FeaturesPlugin_Validators.h:489
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:2154
Validator for the same type of shape.
Definition: FeaturesPlugin_Validators.h:75
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:232
Validates selection for partition.
Definition: FeaturesPlugin_Validators.h:226
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1119
Validator for the pipe locations.
Definition: FeaturesPlugin_Validators.h:60
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:181
A validator for selection pipe locations.
Definition: FeaturesPlugin_Validators.h:45
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:104
A validator for selection pipe path.
Definition: FeaturesPlugin_Validators.h:30
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:74
Validator for the Remove Sub-Shapes feature.
Definition: FeaturesPlugin_Validators.h:258
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1241
Validates selection for "Remove Sub-Shapes" feature.
Definition: FeaturesPlugin_Validators.h:242
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1179
Validates selection for sewing operation.
Definition: FeaturesPlugin_Validators.h:473
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:2102
Validator for the "Union" feature.
Definition: FeaturesPlugin_Validators.h:289
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1353
Validates selection for "Union" feature.
Definition: FeaturesPlugin_Validators.h:273
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
Definition: FeaturesPlugin_Validators.cpp:1302
Generic validator for any attribute of a feature.
Definition: ModelAPI_AttributeValidator.h:31
The geneneric validator for the whole feature.
Definition: ModelAPI_FeatureValidator.h:35