]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add INRERFACE_1 and small code improvements
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 7 Jun 2016 08:51:37 +0000 (11:51 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:03 +0000 (14:41 +0300)
src/ConstructionAPI/CMakeLists.txt
src/ModelHighAPI/ModelHighAPI_Double.h
src/ModelHighAPI/ModelHighAPI_Interface.h
src/ModelHighAPI/ModelHighAPI_Macro.h

index 04785d5592b10788542627a6c89e5e849be433a2..c5ff9c9d3647164ad1334e678332ee561cbefce0 100644 (file)
@@ -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
 )
index 8dc3906d05ce1ef33aa97e52232dedf4543e5ed8..5fefb890fd3ee06bee9a6614e56e61b4efc93e70 100644 (file)
@@ -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<ModelAPI_AttributeDouble> & theAttribute) const;
+  MODELHIGHAPI_EXPORT
+  virtual void fillAttribute(std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const;
 
 private:
   boost::variant<double, std::string> myValue;
index 037b25c5b13ff2ae1777e304201e58bff37399a0..86206884434f166ff3c87315f590273da02ffdb0 100644 (file)
@@ -23,21 +23,27 @@ class ModelHighAPI_Interface
 {
 public:
   /// Constructor
-  MODELHIGHAPI_EXPORT explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+  MODELHIGHAPI_EXPORT
+  explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
   /// Destructor
-  MODELHIGHAPI_EXPORT virtual ~ModelHighAPI_Interface();
+  MODELHIGHAPI_EXPORT
+  virtual ~ModelHighAPI_Interface();
 
   /// Return ModelAPI_Feature
-  MODELHIGHAPI_EXPORT std::shared_ptr<ModelAPI_Feature> feature() const;
+  MODELHIGHAPI_EXPORT
+  std::shared_ptr<ModelAPI_Feature> 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<ModelAPI_Feature> myFeature;
index a00b0752688b46adca4ee141d4802ac5ee798394..2c20bfa4ffb9452a090a356581e4410534b91519 100644 (file)
   }
 
 
+//--------------------------------------------------------------------------------------
+#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, \