From 53ad97caf19acc787fd7353f894e2304280de195 Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 7 Jun 2016 13:26:44 +0300 Subject: [PATCH] Use full attribute type name in INTERFACE_N --- src/ConstructionAPI/ConstructionAPI_Plane.h | 14 ++++++------ src/ConstructionAPI/ConstructionAPI_Point.h | 6 +++--- src/ExchangeAPI/CMakeLists.txt | 2 +- src/ExchangeAPI/ExchangeAPI_Export.cpp | 3 +-- src/ExchangeAPI/ExchangeAPI_Export.h | 6 +++--- src/ExchangeAPI/ExchangeAPI_Import.cpp | 5 +---- src/ExchangeAPI/ExchangeAPI_Import.h | 4 ++-- src/ModelHighAPI/ModelHighAPI_Interface.h | 2 +- src/ModelHighAPI/ModelHighAPI_Macro.h | 24 ++++++++++----------- 9 files changed, 31 insertions(+), 35 deletions(-) diff --git a/src/ConstructionAPI/ConstructionAPI_Plane.h b/src/ConstructionAPI/ConstructionAPI_Plane.h index b1dbfcc70..75936094e 100644 --- a/src/ConstructionAPI/ConstructionAPI_Plane.h +++ b/src/ConstructionAPI/ConstructionAPI_Plane.h @@ -45,13 +45,13 @@ public: virtual ~ConstructionAPI_Plane(); INTERFACE_7(ConstructionPlugin_Plane::ID(), - creationMethod, ConstructionPlugin_Plane::METHOD(), String, /** Creation method */, - face, ConstructionPlugin_Plane::FACE(), Selection, /** Plane face */, - distance, ConstructionPlugin_Plane::DISTANCE(), Double, /** Distance */, - A, ConstructionPlugin_Plane::A(), Double, /** Parameter A for general equation */, - B, ConstructionPlugin_Plane::B(), Double, /** Parameter B for general equation */, - C, ConstructionPlugin_Plane::C(), Double, /** Parameter C for general equation */, - D, ConstructionPlugin_Plane::D(), Double, /** Parameter D for general equation */ + creationMethod, ConstructionPlugin_Plane::METHOD(), ModelAPI_AttributeString, /** Creation method */, + face, ConstructionPlugin_Plane::FACE(), ModelAPI_AttributeSelection, /** Plane face */, + distance, ConstructionPlugin_Plane::DISTANCE(), ModelAPI_AttributeDouble, /** Distance */, + A, ConstructionPlugin_Plane::A(), ModelAPI_AttributeDouble, /** Parameter A for general equation */, + B, ConstructionPlugin_Plane::B(), ModelAPI_AttributeDouble, /** Parameter B for general equation */, + C, ConstructionPlugin_Plane::C(), ModelAPI_AttributeDouble, /** Parameter C for general equation */, + D, ConstructionPlugin_Plane::D(), ModelAPI_AttributeDouble, /** Parameter D for general equation */ ) /// Set face and distance diff --git a/src/ConstructionAPI/ConstructionAPI_Point.h b/src/ConstructionAPI/ConstructionAPI_Point.h index f1c67a347..f1b8da8bc 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.h +++ b/src/ConstructionAPI/ConstructionAPI_Point.h @@ -40,9 +40,9 @@ public: virtual ~ConstructionAPI_Point(); INTERFACE_3(ConstructionPlugin_Point::ID(), - x, ConstructionPlugin_Point::X(), Double, /** X attribute */, - y, ConstructionPlugin_Point::Y(), Double, /** Y attribute */, - z, ConstructionPlugin_Point::Z(), Double, /** Z attribute */) + x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */, + y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */, + z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */) /// Set point values CONSTRUCTIONAPI_EXPORT diff --git a/src/ExchangeAPI/CMakeLists.txt b/src/ExchangeAPI/CMakeLists.txt index 12279e3c6..b520552f5 100644 --- a/src/ExchangeAPI/CMakeLists.txt +++ b/src/ExchangeAPI/CMakeLists.txt @@ -32,7 +32,7 @@ INCLUDE_DIRECTORIES( ) #TODO(spo): is ${CAS_DEFINITIONS} necessary? -ADD_DEFINITIONS(-DCONSTRUCTIONAPI_EXPORTS ${CAS_DEFINITIONS}) +ADD_DEFINITIONS(-DEXCHANGEAPI_EXPORTS ${CAS_DEFINITIONS}) ADD_LIBRARY(ExchangeAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS}) TARGET_LINK_LIBRARIES(ExchangeAPI ${PROJECT_LIBRARIES}) diff --git a/src/ExchangeAPI/ExchangeAPI_Export.cpp b/src/ExchangeAPI/ExchangeAPI_Export.cpp index ace1fe58d..263f14d89 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Export.cpp @@ -6,8 +6,7 @@ //-------------------------------------------------------------------------------------- #include "ExchangeAPI_Export.h" - -#include +//-------------------------------------------------------------------------------------- #include //-------------------------------------------------------------------------------------- ExchangeAPI_Export::ExchangeAPI_Export( diff --git a/src/ExchangeAPI/ExchangeAPI_Export.h b/src/ExchangeAPI/ExchangeAPI_Export.h index 02429cc81..bb336c94c 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.h +++ b/src/ExchangeAPI/ExchangeAPI_Export.h @@ -41,9 +41,9 @@ public: virtual ~ExchangeAPI_Export(); INTERFACE_3(ExchangePlugin_ExportFeature::ID(), - filePath, ExchangePlugin_ExportFeature::FILE_PATH_ID(), String, /** File path */, - fileFormat, ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), String, /** File format */, - selectionList, ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), SelectionList, /** Selection list */ + filePath, ExchangePlugin_ExportFeature::FILE_PATH_ID(), ModelAPI_AttributeString, /** File path */, + fileFormat, ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString, /** File format */, + selectionList, ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), ModelAPI_AttributeSelectionList, /** Selection list */ ) /// Set file path (without execute) diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index 6cc2c169f..fe1bf0bf0 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -6,10 +6,7 @@ //-------------------------------------------------------------------------------------- #include "ExchangeAPI_Import.h" - -#include -#include - +//-------------------------------------------------------------------------------------- #include //-------------------------------------------------------------------------------------- ExchangeAPI_Import::ExchangeAPI_Import( diff --git a/src/ExchangeAPI/ExchangeAPI_Import.h b/src/ExchangeAPI/ExchangeAPI_Import.h index 0d9900d6e..095172a18 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.h +++ b/src/ExchangeAPI/ExchangeAPI_Import.h @@ -36,14 +36,14 @@ public: virtual ~ExchangeAPI_Import(); INTERFACE_1(ExchangePlugin_ImportFeature::ID(), - filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), String, /** File path */) + filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString, /** File path */) /// Set point values EXCHANGEAPI_EXPORT void setFilePath(const std::string & theFilePath); }; -//! Importer on Import object +//! Pointer on Import object typedef std::shared_ptr ImportPtr; /**\ingroup CPPHighAPI diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.h b/src/ModelHighAPI/ModelHighAPI_Interface.h index 862068844..c9719f41a 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.h +++ b/src/ModelHighAPI/ModelHighAPI_Interface.h @@ -51,4 +51,4 @@ protected: //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- -#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */ +#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */ diff --git a/src/ModelHighAPI/ModelHighAPI_Macro.h b/src/ModelHighAPI/ModelHighAPI_Macro.h index 2c20bfa4f..a2ef23c6b 100644 --- a/src/ModelHighAPI/ModelHighAPI_Macro.h +++ b/src/ModelHighAPI/ModelHighAPI_Macro.h @@ -12,16 +12,16 @@ //-------------------------------------------------------------------------------------- // See ModelAPI_Feature functions -#define FN_Boolean boolean -#define FN_DocRef document -#define FN_Double real -#define FN_Integer integer -#define FN_RefAttr refattr -#define FN_Reference reference -#define FN_RefList reflist -#define FN_Selection selection -#define FN_SelectionList selectionList -#define FN_String string +#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 @@ -30,9 +30,9 @@ // Used in INTERFACE_N for create variable and getter #define DEFINE_ATTRIBUTE(NAME, TYPE, COMMENT) \ COMMENT \ - std::shared_ptr NAME() const { return VAR_NAME(NAME); } \ + std::shared_ptr NAME() const { return VAR_NAME(NAME); } \ protected: \ - std::shared_ptr VAR_NAME(NAME); \ + std::shared_ptr VAR_NAME(NAME); \ public: //-------------------------------------------------------------------------------------- -- 2.39.2