X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Point.cpp;h=400824b7d4b78157c4615492d9fc37f6faca007a;hb=481c77d3cff0c7580fca0967926d2378120f6a98;hp=60b0af1c56b534fc677a4a609792c0215c320876;hpb=d510d0e837e0b87878e2a3922927733b65390c4a;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index 60b0af1c5..400824b7d 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -73,10 +73,9 @@ void ConstructionPlugin_Point::initAttributes() data()->addAttribute(RATIO(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(REVERSE(), ModelAPI_AttributeBoolean::typeId()); - data()->addAttribute(POINT_TO_PROJECT_ON_EDGE(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(POINT_TO_PROJECT(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(PROJECTION_TYPE(), ModelAPI_AttributeString::typeId()); data()->addAttribute(EDGE_FOR_POINT_PROJECTION(), ModelAPI_AttributeSelection::typeId()); - - data()->addAttribute(POINT_TO_PROJECT_ON_FACE(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(FACE_FOR_POINT_PROJECTION(), ModelAPI_AttributeSelection::typeId()); } @@ -93,10 +92,12 @@ void ConstructionPlugin_Point::execute() aShape = createByXYZ(); } else if(aCreationMethod == CREATION_METHOD_BY_DISTANCE_ON_EDGE()) { aShape = createByDistanceOnEdge(); - } else if(aCreationMethod == CREATION_METHOD_BY_PROJECTION_ON_EDGE()) { - aShape = createByProjectionOnEdge(); - } else if(aCreationMethod == CREATION_METHOD_BY_PROJECTION_ON_FACE()) { - aShape = createByProjectionOnFace(); + } else if(aCreationMethod == CREATION_METHOD_BY_PROJECTION()) { + if (string(PROJECTION_TYPE())->value() == PROJECTION_TYPE_ON_EDGE()) { + aShape = createByProjectionOnEdge(); + } else { + aShape = createByProjectionOnFace(); + } } /* else if(aCreationMethod == CREATION_METHOD_BY_LINES_INTERSECTION()) { aShape = createByLinesIntersection(); } */ else if(aCreationMethod == CREATION_METHOD_BY_LINE_AND_PLANE_INTERSECTION()) { @@ -178,7 +179,7 @@ std::shared_ptr ConstructionPlugin_Point::createByDistanceOnEdge std::shared_ptr ConstructionPlugin_Point::createByProjectionOnEdge() { // Get point. - AttributeSelectionPtr aPointSelection = selection(POINT_TO_PROJECT_ON_EDGE()); + AttributeSelectionPtr aPointSelection = selection(POINT_TO_PROJECT()); GeomShapePtr aPointShape = aPointSelection->value(); if (!aPointShape.get()) { aPointShape = aPointSelection->context()->shape(); @@ -200,7 +201,7 @@ std::shared_ptr ConstructionPlugin_Point::createByProjectionOnEd std::shared_ptr ConstructionPlugin_Point::createByProjectionOnFace() { // Get point. - AttributeSelectionPtr aPointSelection = selection(POINT_TO_PROJECT_ON_FACE()); + AttributeSelectionPtr aPointSelection = selection(POINT_TO_PROJECT()); GeomShapePtr aPointShape = aPointSelection->value(); if(!aPointShape.get()) { aPointShape = aPointSelection->context()->shape();