Salome HOME
7cf005d96cc3cfb2aa1b9c88d5dea37b4ab9ac3a
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Validators.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Validators.cpp
4 // Created:     22 March 2016
5 // Author:      Dmitry Bobylev
6
7 #include "FeaturesPlugin_Validators.h"
8
9 #include <ModelAPI_Attribute.h>
10 #include <ModelAPI_AttributeInteger.h>
11 #include <ModelAPI_AttributeSelectionList.h>
12 #include <ModelAPI_AttributeString.h>
13 #include <ModelAPI_AttributeReference.h>
14 #include <ModelAPI_Feature.h>
15 #include <ModelAPI_ResultConstruction.h>
16
17 #include <Events_Error.h>
18
19 #include <GeomValidators_BodyShapes.h>
20 #include <GeomValidators_FeatureKind.h>
21 #include <GeomValidators_ShapeType.h>
22
23 #include <GeomAPI_DataMapOfShapeShape.h>
24 #include <GeomAPI_PlanarEdges.h>
25 #include <GeomAPI_ShapeExplorer.h>
26 #include <GeomAPI_ShapeIterator.h>
27
28 #include <GeomAlgoAPI_ShapeBuilder.h>
29 #include <GeomAlgoAPI_ShapeTools.h>
30 #include <GeomAlgoAPI_WireBuilder.h>
31
32 //==================================================================================================
33 bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute,
34                                                const std::list<std::string>& theArguments,
35                                                std::string& theError) const
36 {
37   AttributeSelectionPtr aPathAttrSelection = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
38   if(!aPathAttrSelection.get()) {
39     theError = "Error: This validator can only work with path selector in \"Pipe\" feature.";
40     return false;
41   }
42
43   GeomShapePtr aPathShape = aPathAttrSelection->value();
44   ResultPtr aContext = aPathAttrSelection->context();
45   if(!aContext.get()) {
46     theError = "Error: Empty context.";
47     return false;
48   }
49   GeomShapePtr aContextShape = aContext->shape();
50   if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && !aPathShape->isEqual(aContextShape)) {
51     theError = "Error: Local selection of wires not allowed.";
52     return false;
53   }
54
55   return true;
56 }
57
58 //==================================================================================================
59 bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
60                                                     const std::list<std::string>& theArguments,
61                                                     std::string& theError) const
62 {
63   static const std::string aCreationMethodID = "creation_method";
64   static const std::string aBaseObjectsID = "base_objects";
65   static const std::string aLocationsID = "locations_objects";
66
67   if(theFeature->getKind() != "Pipe") {
68     theError = "Error: Feature \"" + theFeature->getKind() + "\" does not supported by this validator.";
69     return false;
70   }
71
72   AttributeStringPtr aCreationMethodAttr = theFeature->string(aCreationMethodID);
73   if(!aCreationMethodAttr.get()) {
74     theError = "Error: Could not get \"" + aCreationMethodID + "\" attribute.";
75     return false;
76   }
77
78   if(aCreationMethodAttr->value() != "locations") {
79     return true;
80   }
81
82   AttributeSelectionListPtr aBaseObjectsSelectionList = theFeature->selectionList(aBaseObjectsID);
83   if(!aBaseObjectsSelectionList.get()) {
84     theError = "Error: Could not get \"" + aBaseObjectsID + "\" attribute.";
85     return false;
86   }
87
88   AttributeSelectionListPtr aLocationsSelectionList = theFeature->selectionList(aLocationsID);
89   if(!aLocationsSelectionList.get()) {
90     theError = "Error: Could not get \"" + aBaseObjectsID + "\" attribute.";
91     return false;
92   }
93
94   if(aLocationsSelectionList->size() > 0 && aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) {
95     theError = "Error: Number of locations should be the same as base objects.";
96     return false;
97   }
98
99   return true;
100 }
101
102 //==================================================================================================
103 bool FeaturesPlugin_ValidatorPipeLocations::isNotObligatory(std::string theFeature, std::string theAttribute)
104 {
105   return false;
106 }
107
108 //==================================================================================================
109 bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theAttribute,
110                                                         const std::list<std::string>& theArguments,
111                                                         std::string& theError) const
112 {
113   if(theArguments.empty()) {
114     theError = "Error: Validator parameters is empty.";
115     return false;
116   }
117
118   // Checking attribute.
119   if(!isValidAttribute(theAttribute, theArguments, theError)) {
120     if(theError.empty()) {
121       theError = "Error: Attribute contains unacceptable shape.";
122     }
123     return false;
124   }
125
126   std::set<ResultConstructionPtr> aSelectedSketches;
127   std::set<ResultConstructionPtr> aSelectedSketchesFromObjects;
128   GeomAPI_DataMapOfShapeShape aSelectedWiresFromObjects;
129   std::string anAttributeType = theAttribute->attributeType();
130   if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
131     AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
132     for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
133       AttributeSelectionPtr aSelectionAttr = aListAttr->value(anIndex);
134       ResultConstructionPtr aContext = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aSelectionAttr->context());
135       if(!aContext.get()) {
136         // It is not a result construction, continue.
137         continue;
138       }
139
140       GeomShapePtr aShape = aSelectionAttr->value();
141       GeomShapePtr aContextShape = aContext->shape();
142       if(!aShape.get()) {
143         // Whole sketch selected.
144         if(aSelectedSketchesFromObjects.find(aContext) != aSelectedSketchesFromObjects.cend()) {
145           theError = "Error: Object from this sketch is already selected. Sketch is not allowed for selection.";
146           return false;
147         }
148
149         aSelectedSketches.insert(aContext);
150       } else {
151         // Object from sketch selected.
152         if(aSelectedSketches.find(aContext) != aSelectedSketches.cend()) {
153           theError = "Error: Whole sketch with this object is already selected. Don't allow to select this object.";
154           return false;
155         }
156
157         for(GeomAPI_ShapeExplorer anExp(aShape, GeomAPI_Shape::WIRE); anExp.more(); anExp.next()) {
158           GeomShapePtr aWire = anExp.current();
159           if(aWire->orientation() != GeomAPI_Shape::FORWARD) {
160             theError = "Error: Wire with wrong orientation selected.";
161             return false;
162           }
163
164           if(aSelectedWiresFromObjects.isBound(aWire)) {
165             theError = "Error: Objects with such wire already selected. Don't allow to select this object.";
166             return false;
167           }
168
169           aSelectedWiresFromObjects.bind(aWire, aWire);
170           aSelectedSketchesFromObjects.insert(aContext);
171         }
172       }
173     }
174   }
175
176   return true;
177 }
178
179 //==================================================================================================
180 bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const AttributePtr& theAttribute,
181                                                                  const std::list<std::string>& theArguments,
182                                                                  std::string& theError) const
183 {
184   if(!theAttribute.get()) {
185     theError = "Error: Empty attribute.";
186     return false;
187   }
188
189   std::string anAttributeType = theAttribute->attributeType();
190   if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
191     AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
192     for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
193       // If at least one attribute is invalid, the result is false.
194       if(!isValidAttribute(aListAttr->value(anIndex), theArguments, theError)) {
195         return false;
196       }
197     }
198   } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) {
199     // Getting context.
200     AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
201     ResultPtr aContext = anAttr->context();
202     if(!aContext.get()) {
203       theError = "Error: Attribute have empty context.";
204       return false;
205     }
206
207     GeomShapePtr aShape = anAttr->value();
208     GeomShapePtr aContextShape = aContext->shape();
209     if(!aShape.get()) {
210       aShape = aContextShape;
211     }
212     if(!aShape.get()) {
213       theError = "Error: Empty shape selected";
214       return false;
215     }
216
217     ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
218     if(aConstruction.get()) {
219       // Construciotn selected. Check that is is not infinite.
220       if(aConstruction->isInfinite()) {
221         theError = "Error: Infinite constructions is not allowed as base.";
222         return false;
223       }
224
225       if(aShape->isEqual(aContextShape)) {
226         // Whole construction selected. Check that it have faces.
227         if(aConstruction->facesNum() > 0) {
228           return true;
229         }
230       } else {
231         // Shape on construction selected. Check that it is a face or wire.
232         if(aShape->shapeType() == GeomAPI_Shape::WIRE || aShape->shapeType() == GeomAPI_Shape::FACE) {
233           return true;
234         }
235       }
236
237       return false;
238     }
239
240     if(!aShape->isEqual(aContextShape)) {
241       // Local selection on body does not allowed.
242       theError = "Error: Selected shape is in the local selection. Only global selection is allowed.";
243       return false;
244     }
245
246     // Check that object is a shape with allowed type.
247     GeomValidators_ShapeType aShapeTypeValidator;
248     if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) {
249       theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or wires on sketch, "
250                  "whole sketch(if it has at least one face), and whole objects with shape types: ";
251       std::list<std::string>::const_iterator anIt = theArguments.cbegin();
252       theError += *anIt;
253       for(++anIt; anIt != theArguments.cend(); ++anIt) {
254         theError += ", " + *anIt;
255       }
256       return false;
257     }
258
259   } else {
260     theError = "Error: Attribute \"" + anAttributeType + "\" does not supported by this validator.";
261     return false;
262   }
263
264   return true;
265 }
266
267 //==================================================================================================
268 bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theAttribute,
269                                                         const std::list<std::string>& theArguments,
270                                                         std::string& theError) const
271 {
272   if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) {
273     theError = "Error: The attribute with the " + theAttribute->attributeType() + " type is not processed";
274     return false;
275   }
276   if (theArguments.size() != 2) {
277     theError = "Error: Wrong parameters in XML definition for " + theAttribute->attributeType() + " type";
278     return false;
279   }
280   // first argument is for the base attribute, second - for skipping feature kind
281   std::list<std::string>::const_iterator anIt = theArguments.begin();
282   std::string aBaseAttributeId = *anIt;
283   FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
284   AttributePtr aBaseAttribute = aFeature->attribute(aBaseAttributeId);
285   if (!aBaseAttribute.get()) {
286     theError = "Wrong parameters in XML definition for " + theAttribute->attributeType() + " type";
287     return false;
288   }
289   if (aBaseAttribute->isInitialized()) // when base list of composite feature is already filled,
290     // this validator is not necessary anymore
291     return true;
292
293   anIt++;
294   std::string aFeatureAttributeKind = *anIt;
295   GeomValidators_FeatureKind* aValidator = new GeomValidators_FeatureKind();
296   // check whether the selection is on the sketch
297   std::list<std::string> anArguments;
298   anArguments.push_back(aFeatureAttributeKind);
299
300   bool aFeatureKind = aValidator->isValid(theAttribute, theArguments, theError);
301   bool aPlanarFace = false;
302   // check if selection has Face selected
303   GeomValidators_ShapeType* aShapeType = new GeomValidators_ShapeType();
304   anArguments.clear();
305   anArguments.push_back("face");
306   aPlanarFace = aShapeType->isValid(theAttribute, anArguments, theError);
307
308   bool aValid = !aFeatureKind && aPlanarFace;
309   return aValid;
310 }
311
312 //==================================================================================================
313 bool FeaturesPlugin_ValidatorCanBeEmpty::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
314                                                  const std::list<std::string>& theArguments,
315                                                  std::string& theError) const
316 {
317   if(theArguments.size() != 2) {
318     theError = "Error: Validator should be used with 2 parameters for extrusion.";
319     return false;
320   }
321
322   std::list<std::string>::const_iterator anArgsIt = theArguments.begin(), aLast = theArguments.end();
323
324   AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt);
325   ++anArgsIt;
326
327   if(isShapesCanBeEmpty(aCheckAttribute, theError)) {
328     return true;
329   }
330
331   AttributeSelectionPtr aSelAttr = theFeature->selection(*anArgsIt);
332   if(!aSelAttr.get()) {
333     theError = "Error: Could not get selection attribute \"" + *anArgsIt + "\".";
334     return false;
335   }
336
337   GeomShapePtr aShape = aSelAttr->value();
338   if(!aShape.get()) {
339     ResultPtr aContext = aSelAttr->context();
340     if(!aContext.get()) {
341       theError = "Error: Base objects list contains vertex or edge, so attribute \"" + *anArgsIt
342                + "\" can not be used with default value. Select direction for extrusion.";
343       return false;
344     }
345
346     aShape = aContext->shape();
347   }
348
349   if(!aShape.get()) {
350     theError = "Error: Base objects list contains vertex or edge, so attribute \"" + *anArgsIt
351               + "\" can not be used with default value. Select direction for extrusion.";
352     return false;
353   }
354
355   return true;
356 }
357
358 //==================================================================================================
359 bool FeaturesPlugin_ValidatorCanBeEmpty::isNotObligatory(std::string theFeature, std::string theAttribute)
360 {
361   return false;
362 }
363
364 //==================================================================================================
365 bool FeaturesPlugin_ValidatorCanBeEmpty::isShapesCanBeEmpty(const AttributePtr& theAttribute,
366                                                             std::string& theError) const
367 {
368   if(!theAttribute.get()) {
369     return true;
370   }
371
372   std::string anAttributeType = theAttribute->attributeType();
373   if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
374     AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
375     for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
376       // If at least one attribute is invalid, the result is false.
377       if(!isShapesCanBeEmpty(aListAttr->value(anIndex), theError)) {
378         return false;
379       }
380     }
381   } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) {
382     // Getting context.
383     AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
384     ResultPtr aContext = anAttr->context();
385     if(!aContext.get()) {
386       return false;
387     }
388
389     GeomShapePtr aShape = anAttr->value();
390     GeomShapePtr aContextShape = aContext->shape();
391     if(!aShape.get()) {
392       aShape = aContextShape;
393     }
394     if(!aShape.get()) {
395       return false;
396     }
397
398     if(aShape->shapeType() == GeomAPI_Shape::VERTEX ||
399        aShape->shapeType() == GeomAPI_Shape::EDGE ||
400        !aShape->isPlanar()) {
401       return false;
402     }
403   } else {
404     return false;
405   }
406
407   return true;
408 }
409
410 //==================================================================================================
411 bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAttribute,
412                                                        const std::list<std::string>& theArguments,
413                                                        std::string& theError) const
414 {
415   AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
416   if(!anAttrSelectionList.get()) {
417     theError = "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
418     return false;
419   }
420   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
421   int anOperationType = aFeature->integer("bool_type")->value();
422
423   for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
424     AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
425     if(!anAttrSelection.get()) {
426       theError = "Error: Empty attribute selection.";
427       return false;
428     }
429     ResultPtr aContext = anAttrSelection->context();
430     if(!aContext.get()) {
431       theError = "Error: Empty selection context.";
432       return false;
433     }
434     ResultConstructionPtr aResultConstruction =
435       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
436     if(aResultConstruction.get()) {
437       theError = "Error: Result construction not allowed for selection.";
438       return false;
439     }
440     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
441     if(!aShape.get()) {
442       aShape = aContext->shape();
443     }
444     if(!aShape.get()) {
445       theError = "Error: Empty shape.";
446       return false;
447     }
448     int aShapeType = aShape->shapeType();
449     if(anOperationType == 1) {
450       // Fuse operation. Allow to select edges, faces and solids.
451       if(aShapeType != GeomAPI_Shape::EDGE &&
452          aShapeType != GeomAPI_Shape::FACE &&
453          aShapeType != GeomAPI_Shape::SOLID &&
454          aShapeType != GeomAPI_Shape::COMPSOLID &&
455          aShapeType != GeomAPI_Shape::COMPOUND) {
456         theError = "Error: Selected shape has the wrong type.";
457         return false;
458       }
459     } else {
460       if(aShapeType != GeomAPI_Shape::SOLID &&
461          aShapeType != GeomAPI_Shape::COMPSOLID &&
462          aShapeType != GeomAPI_Shape::COMPOUND) {
463         theError = "Error: Selected shape has the wrong type.";
464         return false;
465       }
466     }
467   }
468
469   return true;
470 }
471
472 //==================================================================================================
473 bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& theAttribute,
474                                                          const std::list<std::string>& theArguments,
475                                                          std::string& theError) const
476 {
477   AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
478   if(!anAttrSelectionList.get()) {
479     theError = "Error: This validator can only work with selection list in \"Partition\" feature.";
480     return false;
481   }
482
483   for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
484     AttributeSelectionPtr aSelectAttr = anAttrSelectionList->value(anIndex);
485
486     //GeomValidators_BodyShapes aBodyValidator;
487     //if(aBodyValidator.isValid(aSelectAttr, theArguments, theError)) {
488     //  continue;
489     //}
490
491     GeomValidators_FeatureKind aFeatureKindValidator;
492     if(aFeatureKindValidator.isValid(aSelectAttr, theArguments, theError)) {
493       continue;
494     }
495
496     ResultPtr aContext = aSelectAttr->context();
497     ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
498     if(aResultConstruction.get()) {
499
500     }
501
502     theError = "Error: Only body shapes and construction planes are allowed for selection.";
503     return false;
504   }
505
506   return true;
507 }
508
509 //==================================================================================================
510 bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePtr& theAttribute,
511                                                                const std::list<std::string>& theArguments,
512                                                                std::string& theError) const
513 {
514   AttributeSelectionListPtr aSubShapesAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
515   if(!aSubShapesAttrList.get()) {
516     theError = "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature.";
517     return false;
518   }
519
520   static const std::string aBaseShapeID = "base_shape";
521   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
522   AttributeSelectionPtr aShapeAttrSelection = aFeature->selection(aBaseShapeID);
523
524   if(!aShapeAttrSelection.get()) {
525     theError = "Error: Could not get \"" + aBaseShapeID + "\" attribute.";
526     return false;
527   }
528
529   GeomShapePtr aBaseShape = aShapeAttrSelection->value();
530   ResultPtr aContext = aShapeAttrSelection->context();
531   if(!aContext.get()) {
532     theError = "Error: Empty context.";
533     return false;
534   }
535   if(!aBaseShape.get()) {
536     aBaseShape = aContext->shape();
537   }
538   if(!aBaseShape.get()) {
539     theError = "Error: Empty base shape.";
540     return false;
541   }
542
543   for(int anIndex = 0; anIndex < aSubShapesAttrList->size(); ++anIndex) {
544     bool isSameFound = false;
545     AttributeSelectionPtr anAttrSelectionInList = aSubShapesAttrList->value(anIndex);
546     GeomShapePtr aShapeToAdd = anAttrSelectionInList->value();
547     for(GeomAPI_ShapeIterator anIt(aBaseShape); anIt.more(); anIt.next()) {
548       if(anIt.current()->isEqual(aShapeToAdd)) {
549         isSameFound = true;
550         break;
551       }
552     }
553     if(!isSameFound) {
554       theError = "Error: Only sub-shapes of selected shape is allowed for selection.";
555       return false;
556     }
557   }
558
559   return true;
560 }
561
562 //==================================================================================================
563 bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
564                                                             const std::list<std::string>& theArguments,
565                                                             std::string& theError) const
566 {
567   static const std::string aBaseShapeID = "base_shape";
568   static const std::string aSubShapesID = "subshapes";
569
570   if(theFeature->getKind() != "Remove_SubShapes") {
571     theError = "Error: Feature \"" + theFeature->getKind() + "\" does not supported by this validator.";
572     return false;
573   }
574
575   AttributeSelectionPtr aShapeAttrSelection = theFeature->selection(aBaseShapeID);
576   if(!aShapeAttrSelection.get()) {
577     theError = "Error: Could not get \"" + aBaseShapeID + "\" attribute.";
578     return false;
579   }
580
581   AttributeSelectionListPtr aSubShapesAttrList = theFeature->selectionList(aSubShapesID);
582   if(!aSubShapesAttrList.get()) {
583     theError = "Error: Could not get \"" + aSubShapesID + "\" attribute.";
584     return false;
585   }
586
587   // Copy base shape.
588   GeomShapePtr aBaseShape = aShapeAttrSelection->value();
589   if(!aBaseShape.get()) {
590     return false;
591   }
592   GeomShapePtr aResultShape = aBaseShape->emptyCopied();
593
594   // Copy sub-shapes from list to new shape.
595   for(int anIndex = 0; anIndex < aSubShapesAttrList->size(); ++anIndex) {
596     AttributeSelectionPtr anAttrSelectionInList = aSubShapesAttrList->value(anIndex);
597     GeomShapePtr aShapeToAdd = anAttrSelectionInList->value();
598     GeomAlgoAPI_ShapeBuilder::add(aResultShape, aShapeToAdd);
599   }
600
601   // Check new shape.
602   if(!GeomAlgoAPI_ShapeTools::isShapeValid(aResultShape)) {
603     theError = "Error: Resulting shape is not valid.";
604     return false;
605   }
606
607   return true;
608 }
609
610 //==================================================================================================
611 bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isNotObligatory(std::string theFeature,
612                                                                     std::string theAttribute)
613 {
614   return false;
615 }