SHAPER  9.12.0
SketchPlugin_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 SketchPlugin_Validators_H
21 #define SketchPlugin_Validators_H
22 
23 #include "SketchPlugin.h"
24 #include <ModelAPI_AttributeValidator.h>
25 #include <ModelAPI_FeatureValidator.h>
26 
34 {
35  public:
40  virtual bool isValid(const AttributePtr& theAttribute,
41  const std::list<std::string>& theArguments,
42  Events_InfoMessage& theError) const;
43 };
44 
52 {
53  public:
58  virtual bool isValid(const AttributePtr& theAttribute,
59  const std::list<std::string>& theArguments,
60  Events_InfoMessage& theError) const;
61 };
62 
70 {
71  public:
76  virtual bool isValid(const AttributePtr& theAttribute,
77  const std::list<std::string>& theArguments,
78  Events_InfoMessage& theError) const;
79 };
80 
81 
89 {
90  public:
95  virtual bool isValid(const AttributePtr& theAttribute,
96  const std::list<std::string>& theArguments,
97  Events_InfoMessage& theError) const;
98 };
99 
107 {
108  public:
113  virtual bool isValid(const AttributePtr& theAttribute,
114  const std::list<std::string>& theArguments,
115  Events_InfoMessage& theError) const;
116 };
117 
125 {
126  public:
131  virtual bool isValid(const AttributePtr& theAttribute,
132  const std::list<std::string>& theArguments,
133  Events_InfoMessage& theError) const;
134 };
135 
136 
144 {
145  public:
150  virtual bool isValid(const AttributePtr& theAttribute,
151  const std::list<std::string>& theArguments,
152  Events_InfoMessage& theError) const;
153 };
154 
155 
164 {
165  public:
170  virtual bool isValid(const AttributePtr& theAttribute,
171  const std::list<std::string>& theArguments,
172  Events_InfoMessage& theError) const;
173 };
174 
182 {
183  public:
188  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
189  const std::list<std::string>& theArguments,
190  Events_InfoMessage& theError) const;
191 
193  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
194 };
195 
203 {
204 public:
209  virtual bool isValid(const AttributePtr& theAttribute,
210  const std::list<std::string>& theArguments,
211  Events_InfoMessage& theError) const;
212 
218  static bool isValidVertex(const AttributePtr& theAttribute,
219  Events_InfoMessage& theError,
220  FeaturePtr& theEdge1,
221  FeaturePtr& theEdge2);
222 };
223 
224 
232 {
233  public:
238  virtual bool isValid(const AttributePtr& theAttribute,
239  const std::list<std::string>& theArguments,
240  Events_InfoMessage& theError) const;
241 };
242 
243 
251 {
252  public:
257  virtual bool isValid(const AttributePtr& theAttribute,
258  const std::list<std::string>& theArguments,
259  Events_InfoMessage& theError) const;
260 };
261 
269 {
270  public:
275  virtual bool isValid(const AttributePtr& theAttribute,
276  const std::list<std::string>& theArguments,
277  Events_InfoMessage& theError) const;
278 };
279 
280 
291 {
292  public:
297  virtual bool isValid(const AttributePtr& theAttribute,
298  const std::list<std::string>& theArguments,
299  Events_InfoMessage& theError) const;
300 };
301 
312 {
313  public:
318  virtual bool isValid(const AttributePtr& theAttribute,
319  const std::list<std::string>& theArguments,
320  Events_InfoMessage& theError) const;
321 };
322 
328 {
329  public:
334  virtual bool isValid(const AttributePtr& theAttribute,
335  const std::list<std::string>& theArguments,
336  Events_InfoMessage& theError) const;
337 };
338 
344 {
345  public:
350  virtual bool isValid(const AttributePtr& theAttribute,
351  const std::list<std::string>& theArguments,
352  Events_InfoMessage& theError) const;
353 };
354 
363 {
364  public:
369  virtual bool isValid(const AttributePtr& theAttribute,
370  const std::list<std::string>& theArguments,
371  Events_InfoMessage& theError) const;
372 };
373 
381 {
382  public:
387  virtual bool isValid(const AttributePtr& theAttribute,
388  const std::list<std::string>& theArguments,
389  Events_InfoMessage& theError) const;
390 };
391 
399 {
400  public:
405  virtual bool isValid(const AttributePtr& theAttribute,
406  const std::list<std::string>&,
407  Events_InfoMessage& theError) const;
408 };
409 
418 {
419  public:
424  virtual bool isValid(const AttributePtr& theAttribute,
425  const std::list<std::string>& theArguments,
426  Events_InfoMessage& theError) const;
427 
428 private:
430  bool arePointsNotOnLine(const FeaturePtr& theMacroFeature,
431  Events_InfoMessage& theError) const;
432 
435  bool arePointsNotSeparated(const FeaturePtr& theMacroFeature,
436  const std::list<std::string>& theArguments,
437  Events_InfoMessage& theError) const;
438 };
439 
447 {
448  public:
453  virtual bool isValid(const AttributePtr& theAttribute,
454  const std::list<std::string>& theArguments,
455  Events_InfoMessage& theError) const;
456 };
457 
465 {
466  public:
471  virtual bool isValid(const AttributePtr& theAttribute,
472  const std::list<std::string>& theArguments,
473  Events_InfoMessage& theError) const;
474 };
475 
485 {
486  public:
491  virtual bool isValid(const AttributePtr& theAttribute,
492  const std::list<std::string>& theArguments,
493  Events_InfoMessage& theError) const;
494 };
495 
502 {
503  public:
508  virtual bool isValid(const AttributePtr& theAttribute,
509  const std::list<std::string>& theArguments,
510  Events_InfoMessage& theError) const;
511 };
512 
518 {
519  public:
524  virtual bool isValid(const AttributePtr& theAttribute,
525  const std::list<std::string>& theArguments,
526  Events_InfoMessage& theError) const;
527 };
528 
534 {
539  virtual bool isValid(const AttributePtr& theAttribute,
540  const std::list<std::string>& theArguments,
541  Events_InfoMessage& theError) const;
542 };
543 
549 {
554  virtual bool isValid(const AttributePtr& theAttribute,
555  const std::list<std::string>& theArguments,
556  Events_InfoMessage& theError) const;
557 };
558 
564 {
565 public:
570  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
571  const std::list<std::string>& theArguments,
572  Events_InfoMessage& theError) const;
573 };
574 
575 #endif
An event message for sending a string message which has to be translated.
Definition: Events_InfoMessage.h:35
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
Validator for the end point of MacroArc feature.
Definition: SketchPlugin_Validators.h:465
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1725
Validator for the end point of MacroArc feature.
Definition: SketchPlugin_Validators.h:447
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1654
Validator for the point where the tangent arc is building.
Definition: SketchPlugin_Validators.h:251
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:909
Validator for the point where the transversal arc is building.
Definition: SketchPlugin_Validators.h:269
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:960
Validator for checking poles/weights of B-spline curve.
Definition: SketchPlugin_Validators.h:549
Validator for passed point of MacroCircle feature.
Definition: SketchPlugin_Validators.h:399
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1428
Validator for the coincidence constraint input.
Definition: SketchPlugin_Validators.h:144
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:451
Validator for the constraints which create features.
Definition: SketchPlugin_Validators.h:164
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:514
Validator for the selected vertices for the curve fitting feature.
Definition: SketchPlugin_Validators.h:564
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if number of selected points is greater than the minimal value
Definition: SketchPlugin_Validators.cpp:1983
Validator for attributes of a sketch feature.
Definition: SketchPlugin_Validators.h:381
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1395
Validator for attributes of a sketch feature.
Definition: SketchPlugin_Validators.h:363
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1336
Validator for the distance input.
Definition: SketchPlugin_Validators.h:34
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:97
Validator for the equal constraint input.
Definition: SketchPlugin_Validators.h:107
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:351
Validator for the point for fillet creation.
Definition: SketchPlugin_Validators.h:203
static bool isValidVertex(const AttributePtr &theAttribute, Events_InfoMessage &theError, FeaturePtr &theEdge1, FeaturePtr &theEdge2)
returns true if attribute is a good point for fillet
Definition: SketchPlugin_Validators.cpp:677
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:669
Validator for checking whether the feature has constraint.
Definition: SketchPlugin_Validators.h:485
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1785
Validator for the attribute to be intersected with the sketch plane.
Definition: SketchPlugin_Validators.h:328
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1004
Validator for the middle point constraint input.
Definition: SketchPlugin_Validators.h:232
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:861
Validator for the mirror constraint input.
Definition: SketchPlugin_Validators.h:125
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:411
Validator for checking whether the angle of MultiRotation is in range [0, 360].
Definition: SketchPlugin_Validators.h:534
Validator for the rigid constraint input.
Definition: SketchPlugin_Validators.h:89
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is not used in another rigid constraint
Definition: SketchPlugin_Validators.cpp:305
Validator for the perpendicular constraint input.
Definition: SketchPlugin_Validators.h:70
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:261
Validator for the attribute to be projected onto the sketch plane.
Definition: SketchPlugin_Validators.h:344
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1197
Validator checking that the replications features (Mirror, Multi-Rotation, Mutli-Translation) do not ...
Definition: SketchPlugin_Validators.h:502
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1828
Validator for checking whether the feature referred by attribute is a sketch feature.
Definition: SketchPlugin_Validators.h:518
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1884
Validator for the solver error.
Definition: SketchPlugin_Validators.h:182
virtual bool isValid(const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if there are no solver errors
Definition: SketchPlugin_Validators.cpp:587
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute)
Returns true if the attribute in feature is not obligatory for the feature execution.
Definition: SketchPlugin_Validators.cpp:602
Validator for the entity of the following type:
Definition: SketchPlugin_Validators.h:291
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1058
Validator for the tangent constraint input.
Definition: SketchPlugin_Validators.h:52
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:158
Validator for the third point of MacroCircle feature.
Definition: SketchPlugin_Validators.h:418
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1473
Validator for the entity of the following type:
Definition: SketchPlugin_Validators.h:312
virtual bool isValid(const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
returns true if attribute is valid
Definition: SketchPlugin_Validators.cpp:1136