From: spo Date: Tue, 7 Jun 2016 08:51:37 +0000 (+0300) Subject: Add INRERFACE_1 and small code improvements X-Git-Tag: V_2.4.0~91^2~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cf0b0e0454067c408f1b7830b6b0ae2d1f85241f;p=modules%2Fshaper.git Add INRERFACE_1 and small code improvements --- diff --git a/src/ConstructionAPI/CMakeLists.txt b/src/ConstructionAPI/CMakeLists.txt index 04785d559..c5ff9c9d3 100644 --- a/src/ConstructionAPI/CMakeLists.txt +++ b/src/ConstructionAPI/CMakeLists.txt @@ -26,6 +26,7 @@ INCLUDE_DIRECTORIES( # Plugin headers dependency INCLUDE_DIRECTORIES( + # TODO(spo): modify ConstructionPlugin headers to remove dependency on GeomAPI headers ${PROJECT_SOURCE_DIR}/src/GeomAPI ${PROJECT_SOURCE_DIR}/src/ConstructionPlugin ) diff --git a/src/ModelHighAPI/ModelHighAPI_Double.h b/src/ModelHighAPI/ModelHighAPI_Double.h index 8dc3906d0..5fefb890f 100644 --- a/src/ModelHighAPI/ModelHighAPI_Double.h +++ b/src/ModelHighAPI/ModelHighAPI_Double.h @@ -25,16 +25,21 @@ class ModelHighAPI_Double { public: /// Constructor for double - MODELHIGHAPI_EXPORT ModelHighAPI_Double(double theValue = 0.); + MODELHIGHAPI_EXPORT + ModelHighAPI_Double(double theValue = 0.); /// Constructor for std::string - MODELHIGHAPI_EXPORT ModelHighAPI_Double(const std::string & theValue); + MODELHIGHAPI_EXPORT + ModelHighAPI_Double(const std::string & theValue); /// Constructor for char * - MODELHIGHAPI_EXPORT ModelHighAPI_Double(const char * theValue); + MODELHIGHAPI_EXPORT + ModelHighAPI_Double(const char * theValue); /// Destructor - MODELHIGHAPI_EXPORT virtual ~ModelHighAPI_Double(); + MODELHIGHAPI_EXPORT + virtual ~ModelHighAPI_Double(); /// Fill attribute values - MODELHIGHAPI_EXPORT virtual void fillAttribute(std::shared_ptr & theAttribute) const; + MODELHIGHAPI_EXPORT + virtual void fillAttribute(std::shared_ptr & theAttribute) const; private: boost::variant myValue; diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.h b/src/ModelHighAPI/ModelHighAPI_Interface.h index 037b25c5b..862068844 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.h +++ b/src/ModelHighAPI/ModelHighAPI_Interface.h @@ -23,21 +23,27 @@ class ModelHighAPI_Interface { public: /// Constructor - MODELHIGHAPI_EXPORT explicit ModelHighAPI_Interface(const std::shared_ptr & theFeature); + MODELHIGHAPI_EXPORT + explicit ModelHighAPI_Interface(const std::shared_ptr & theFeature); /// Destructor - MODELHIGHAPI_EXPORT virtual ~ModelHighAPI_Interface(); + MODELHIGHAPI_EXPORT + virtual ~ModelHighAPI_Interface(); /// Return ModelAPI_Feature - MODELHIGHAPI_EXPORT std::shared_ptr feature() const; + MODELHIGHAPI_EXPORT + std::shared_ptr feature() const; /// Shortcut for feature()->getKind() - MODELHIGHAPI_EXPORT const std::string& getKind(); + MODELHIGHAPI_EXPORT + const std::string& getKind(); /// Shortcut for feature()->execute() - MODELHIGHAPI_EXPORT void execute(); + MODELHIGHAPI_EXPORT + void execute(); /// Throw exception to event loop - MODELHIGHAPI_EXPORT void throwException(const std::string & theDescription); + MODELHIGHAPI_EXPORT + void throwException(const std::string & theDescription); protected: std::shared_ptr myFeature; diff --git a/src/ModelHighAPI/ModelHighAPI_Macro.h b/src/ModelHighAPI/ModelHighAPI_Macro.h index a00b07526..2c20bfa4f 100644 --- a/src/ModelHighAPI/ModelHighAPI_Macro.h +++ b/src/ModelHighAPI/ModelHighAPI_Macro.h @@ -64,6 +64,18 @@ } +//-------------------------------------------------------------------------------------- +#define INTERFACE_1(KIND, \ + N_0, AN_0, T_0, C_0) \ + public: \ + INTERFACE_COMMON(KIND) \ + DEFINE_ATTRIBUTE(N_0, T_0, C_0) \ + protected: \ + START_INIT() \ + SET_ATTRIBUTE(N_0, T_0, AN_0) \ + END_INIT() \ + public: + //-------------------------------------------------------------------------------------- #define INTERFACE_2(KIND, \ N_0, AN_0, T_0, C_0, \