Salome HOME
Implementation of the Feature Validator
[modules/shaper.git] / src / Model / Model_FeatureValidator.cpp
1 // File:        Model_FeatureValidator.cpp
2 // Created:     8 Jul 2014
3 // Author:      Vitaly SMETANNIKOV
4
5 #include <Model_FeatureValidator.h>
6 #include <ModelAPI_Attribute.h>
7 #include <ModelAPI_Data.h>
8 #include <ModelAPI_Feature.h>
9 #include <ModelAPI_Object.h>
10
11 #include <list>
12 #include <boost/shared_ptr.hpp>
13
14 bool Model_FeatureValidator::isValid(const boost::shared_ptr<ModelAPI_Feature>& theFeature
15                                      /*, const std::string theAttr*/
16                                      /*, std::list<std::string> theArguments*/) const
17 {
18   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
19   if(!aData->isValid())
20     return false;
21   const std::string kAllTypes = "";
22   std::list<AttributePtr> aLtAttributes = aData->attributes(kAllTypes);
23   std::list<AttributePtr>::iterator it = aLtAttributes.begin();
24   for( ; it != aLtAttributes.end(); it++) {
25     if(!(*it)->isInitialized()) return false;
26   }
27   return true;
28 }