From: sbh Date: Wed, 11 Mar 2015 17:26:26 +0000 (+0300) Subject: Axis creation on cylindrical face stub X-Git-Tag: V_1.1.0~142 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa32d461a6e60409d2473ebffa0e255c860589ab;p=modules%2Fshaper.git Axis creation on cylindrical face stub --- diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp index 7678b51a4..8e90fae27 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp @@ -16,6 +16,10 @@ #include #include +#ifdef _DEBUG +#include +#endif + using namespace std; ConstructionPlugin_Axis::ConstructionPlugin_Axis() @@ -34,7 +38,7 @@ void ConstructionPlugin_Axis::initAttributes() ModelAPI_AttributeSelection::type()); } -void ConstructionPlugin_Axis::execute() +void ConstructionPlugin_Axis::createAxisByTwoPoints() { AttributeSelectionPtr aRef1 = data()->selection(ConstructionPlugin_Axis::POINT_FIRST()); AttributeSelectionPtr aRef2 = data()->selection(ConstructionPlugin_Axis::POINT_SECOND()); @@ -55,6 +59,21 @@ void ConstructionPlugin_Axis::execute() } } +void ConstructionPlugin_Axis::execute() +{ + AttributePtr anAttr = data()->attribute(ConstructionPlugin_Axis::METHOD()); + AttributeStringPtr aMethodTypeAttr = + std::dynamic_pointer_cast(anAttr); + std::string aMethodType = aMethodTypeAttr->value(); + if (aMethodType == "AxisByPointsCase") { + createAxisByTwoPoints(); + } else if (aMethodType == "AxisByCylindricalFaceCase") { + #ifdef _DEBUG + std::cout << "ConstructionPlugin_Axis::execute: " << "AxisByCylindricalFaceCase is not supported yet." << std::endl; + #endif + } +} + bool ConstructionPlugin_Axis::customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, std::shared_ptr theDefaultPrs) { diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.h b/src/ConstructionPlugin/ConstructionPlugin_Axis.h index b92e0842c..cbf40fce7 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.h +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.h @@ -75,6 +75,9 @@ class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomP /// Customize presentation of the feature virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, std::shared_ptr theDefaultPrs); + + protected: + void createAxisByTwoPoints(); };