Salome HOME
Use not only ModelAPI_Attribute* in INTERFACE_N
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 7 Jun 2016 10:48:02 +0000 (13:48 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:04 +0000 (14:41 +0300)
src/ConstructionAPI/ConstructionAPI_Point.h
src/ExchangeAPI/ExchangeAPI_Import.h
src/ExchangeAPI/ExchangeAPI_swig.h
src/ModelHighAPI/ModelHighAPI_Macro.h

index f1b8da8bc69e880d2d33a0022bace837d00a9555..d2af332986b9a2c43d25bee8ccd1fd9e702a7aef 100644 (file)
@@ -42,7 +42,8 @@ public:
   INTERFACE_3(ConstructionPlugin_Point::ID(),
               x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
               y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
   INTERFACE_3(ConstructionPlugin_Point::ID(),
               x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
               y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
-              z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */)
+              z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */
+  )
 
   /// Set point values
   CONSTRUCTIONAPI_EXPORT
 
   /// Set point values
   CONSTRUCTIONAPI_EXPORT
index 095172a18964edbcb61732e5d48f167dab00d9c9..015b374f39803d697851d154d83c6096528755d6 100644 (file)
@@ -36,7 +36,8 @@ public:
   virtual ~ExchangeAPI_Import();
 
   INTERFACE_1(ExchangePlugin_ImportFeature::ID(),
   virtual ~ExchangeAPI_Import();
 
   INTERFACE_1(ExchangePlugin_ImportFeature::ID(),
-              filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString, /** File path */)
+              filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString, /** File path */
+  )
 
   /// Set point values
   EXCHANGEAPI_EXPORT
 
   /// Set point values
   EXCHANGEAPI_EXPORT
index 80219bb7c286dd1d201d94463b7fa0aadf668b24..b830f5d7b8b534c90f1c3c561a954adceb34e640 100644 (file)
@@ -8,8 +8,8 @@
 #define SRC_EXCHANGEAPI_EXCHANGEAPI_SWIG_H_
 
   #include <ModelHighAPI_swig.h>
 #define SRC_EXCHANGEAPI_EXCHANGEAPI_SWIG_H_
 
   #include <ModelHighAPI_swig.h>
-  #include "ExchangeAPI.h"
 
 
+  #include "ExchangeAPI.h"
   #include "ExchangeAPI_Export.h"
   #include "ExchangeAPI_Import.h"
 
   #include "ExchangeAPI_Export.h"
   #include "ExchangeAPI_Import.h"
 
index a2ef23c6bc7de12167245e82d162be983556b7ac..4d2e9e5b91ccc38be53f69a7f4f790358c56597b 100644 (file)
@@ -8,21 +8,20 @@
 #define SRC_MODELHIGHAPI_MODELHIGHAPI_MACRO_H_
 
 //--------------------------------------------------------------------------------------
 #define SRC_MODELHIGHAPI_MODELHIGHAPI_MACRO_H_
 
 //--------------------------------------------------------------------------------------
+#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeDocRef.h>
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeIntArray.h>
+#include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_AttributeRefAttr.h>
+#include <ModelAPI_AttributeRefAttrList.h>
+#include <ModelAPI_AttributeReference.h>
+#include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Feature.h>
 
 #include <ModelAPI_Feature.h>
 
-//--------------------------------------------------------------------------------------
-// See ModelAPI_Feature functions
-#define FN_ModelAPI_AttributeBoolean boolean
-#define FN_ModelAPI_AttributeDocRef document
-#define FN_ModelAPI_AttributeDouble real
-#define FN_ModelAPI_AttributeInteger integer
-#define FN_ModelAPI_AttributeRefAttr refattr
-#define FN_ModelAPI_AttributeReference reference
-#define FN_ModelAPI_AttributeRefList reflist
-#define FN_ModelAPI_AttributeSelection selection
-#define FN_ModelAPI_AttributeSelectionList selectionList
-#define FN_ModelAPI_AttributeString string
-
 //--------------------------------------------------------------------------------------
 #define VAR_NAME(NAME) my##NAME
 
 //--------------------------------------------------------------------------------------
 #define VAR_NAME(NAME) my##NAME
 
@@ -38,7 +37,7 @@
 //--------------------------------------------------------------------------------------
 // Used in INTERFACE_N inside START_INIT/END_INIT for set variable with attribute received from feature
 #define SET_ATTRIBUTE(NAME, TYPE, ATT_NAME) \
 //--------------------------------------------------------------------------------------
 // Used in INTERFACE_N inside START_INIT/END_INIT for set variable with attribute received from feature
 #define SET_ATTRIBUTE(NAME, TYPE, ATT_NAME) \
-  VAR_NAME(NAME) = feature()->FN_##TYPE(ATT_NAME); \
+  VAR_NAME(NAME) = std::dynamic_pointer_cast<TYPE>(feature()->attribute(ATT_NAME)); \
   if (!VAR_NAME(NAME)) \
     return false;
 
   if (!VAR_NAME(NAME)) \
     return false;