From: asl Date: Mon, 17 Aug 2015 09:28:15 +0000 (+0300) Subject: Issue #532: validator is added to xml; new type "plane" is treated X-Git-Tag: V_1.4.0_beta4~371 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b8f35d5dcad613d27e85ce11f6ff56a884e34609;p=modules%2Fshaper.git Issue #532: validator is added to xml; new type "plane" is treated --- diff --git a/src/FeaturesPlugin/partition_widget.xml b/src/FeaturesPlugin/partition_widget.xml index 10671d60d..e46121048 100755 --- a/src/FeaturesPlugin/partition_widget.xml +++ b/src/FeaturesPlugin/partition_widget.xml @@ -18,5 +18,6 @@ type_choice="Faces" concealment="true" > + diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index cefd7a592..97ad58028 100644 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -32,6 +33,7 @@ GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const MyShapeTypes["circle"] = Circle; MyShapeTypes["face"] = Face; MyShapeTypes["solid"] = Solid; + MyShapeTypes["plane"] = Plane; } std::string aType = std::string(theType.c_str()); if (MyShapeTypes.find(aType) != MyShapeTypes.end()) @@ -123,6 +125,13 @@ bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject, if (theObject.get() != NULL) { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); ResultPtr aResult = std::dynamic_pointer_cast(theObject); + if( theShapeType==Plane ) + { + ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(theObject); + const std::string& aKind = aFeature->getKind(); + return aResult.get() != NULL && aKind == "Plane"; + } + if (aResult.get() != NULL) { GeomShapePtr aShape = aResult->shape(); aValid = isValidShape(aShape, theShapeType); diff --git a/src/GeomValidators/GeomValidators_ShapeType.h b/src/GeomValidators/GeomValidators_ShapeType.h index daefb1e22..5d30779b1 100644 --- a/src/GeomValidators/GeomValidators_ShapeType.h +++ b/src/GeomValidators/GeomValidators_ShapeType.h @@ -34,6 +34,7 @@ class GeomValidators_ShapeType : public ModelAPI_AttributeValidator Face, Solid, Compound, + Plane, AnyShape };