From 8babac25037f2666dcb422dd68a66dd2ed1383d8 Mon Sep 17 00:00:00 2001 From: sbh Date: Tue, 17 Feb 2015 16:49:40 +0300 Subject: [PATCH] Resolve batch runtime errors on debian squeeze --- doc/first_feature_help.doc | 4 +-- src/Config/Config_ModuleReader.cpp | 1 + .../ConstructionPlugin_Axis.cpp | 4 +-- .../ConstructionPlugin_Plane.cpp | 4 +-- .../ConstructionPlugin_Point.cpp | 6 ++-- .../ExchangePlugin_ImportFeature.cpp | 2 +- src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp | 6 ++-- .../FeaturesPlugin_Extrusion.cpp | 6 ++-- src/FeaturesPlugin/FeaturesPlugin_Group.cpp | 4 +-- .../FeaturesPlugin_Placement.cpp | 4 +-- src/FeaturesPlugin/Test/TestBoolean.py | 6 ++-- src/FeaturesPlugin/Test/TestExtrusion.py | 6 ++-- src/FeaturesPlugin/Test/TestGroup.py | 2 +- src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h | 5 ++- src/GeomData/CMakeLists.txt | 1 + src/GeomDataAPI/CMakeLists.txt | 26 +++++++++++--- src/GeomDataAPI/GeomDataAPI_Dir.cpp | 22 ++++++++++++ src/GeomDataAPI/GeomDataAPI_Dir.h | 12 +++---- src/GeomDataAPI/GeomDataAPI_Point.cpp | 20 +++++++++++ src/GeomDataAPI/GeomDataAPI_Point.h | 12 +++---- src/GeomDataAPI/GeomDataAPI_Point2D.cpp | 26 ++++++++++++++ src/GeomDataAPI/GeomDataAPI_Point2D.h | 20 ++++------- src/GeomDataAPI/Test/TestConstants.py | 6 ++-- src/Model/Model_Data.cpp | 36 +++++++++---------- src/Model/Model_ResultPart.cpp | 2 +- src/Model/Model_Update.cpp | 4 +-- src/ModelAPI/ModelAPI_AttributeBoolean.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeBoolean.h | 2 +- src/ModelAPI/ModelAPI_AttributeDocRef.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeDocRef.h | 2 +- src/ModelAPI/ModelAPI_AttributeDouble.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeDouble.h | 2 +- src/ModelAPI/ModelAPI_AttributeInteger.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeInteger.h | 2 +- src/ModelAPI/ModelAPI_AttributeRefAttr.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeRefAttr.h | 2 +- src/ModelAPI/ModelAPI_AttributeRefList.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeRefList.h | 2 +- src/ModelAPI/ModelAPI_AttributeReference.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeReference.h | 2 +- src/ModelAPI/ModelAPI_AttributeSelection.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeSelection.h | 2 +- .../ModelAPI_AttributeSelectionList.cpp | 2 +- .../ModelAPI_AttributeSelectionList.h | 2 +- src/ModelAPI/ModelAPI_AttributeString.cpp | 2 +- src/ModelAPI/ModelAPI_AttributeString.h | 2 +- src/ModelAPI/ModelAPI_ShapeValidator.cpp | 2 +- src/ModelAPI/Test/TestConstants.py | 10 +++--- src/PartSet/CMakeLists.txt | 1 + src/PartSet/PartSet_Tools.cpp | 8 ++--- src/PartSet/PartSet_Validators.cpp | 6 ++-- src/SketchPlugin/CMakeLists.txt | 1 + src/SketchPlugin/SketchPlugin_Arc.cpp | 8 ++--- src/SketchPlugin/SketchPlugin_Circle.cpp | 6 ++-- .../SketchPlugin_ConstraintCoincidence.cpp | 4 +-- .../SketchPlugin_ConstraintDistance.cpp | 8 ++--- .../SketchPlugin_ConstraintLength.cpp | 6 ++-- .../SketchPlugin_ConstraintParallel.cpp | 6 ++-- .../SketchPlugin_ConstraintPerpendicular.cpp | 4 +-- .../SketchPlugin_ConstraintRadius.cpp | 6 ++-- .../SketchPlugin_ConstraintRigid.cpp | 2 +- src/SketchPlugin/SketchPlugin_Line.cpp | 6 ++-- src/SketchPlugin/SketchPlugin_Point.cpp | 4 +-- src/SketchPlugin/SketchPlugin_Sketch.cpp | 12 +++---- src/SketchPlugin/SketchPlugin_Validators.cpp | 6 ++-- .../Test/TestConstraintConcidence.py | 4 +-- .../Test/TestConstraintDistance.py | 8 ++--- src/SketchPlugin/Test/TestConstraintLength.py | 6 ++-- .../Test/TestConstraintParallel.py | 6 ++-- .../Test/TestConstraintPerpendicular.py | 6 ++-- src/SketchPlugin/Test/TestConstraintRadius.py | 6 ++-- src/SketchPlugin/Test/TestConstraintRigid.py | 2 +- src/SketchPlugin/Test/TestSketchArcCircle.py | 14 ++++---- src/SketchSolver/SketchSolver_Constraint.cpp | 4 +-- 74 files changed, 262 insertions(+), 187 deletions(-) create mode 100644 src/GeomDataAPI/GeomDataAPI_Dir.cpp create mode 100644 src/GeomDataAPI/GeomDataAPI_Point.cpp create mode 100644 src/GeomDataAPI/GeomDataAPI_Point2D.cpp diff --git a/doc/first_feature_help.doc b/doc/first_feature_help.doc index c40f79d60..fc7f1f9eb 100644 --- a/doc/first_feature_help.doc +++ b/doc/first_feature_help.doc @@ -118,13 +118,13 @@ And like a plugin implements a functionality to create 'feature' objects by stri \code void ConstructionPlugin_Point::initAttributes() { - data()->addAttribute("DoubleCounterData", ModelAPI_AttributeDouble::type()); + data()->addAttribute("DoubleCounterData", ModelAPI_AttributeDouble::typeId()); } \endcode Python: \code def initAttributes(self): - self.data().addAttribute("DoubleCounterData", ModelAPI.ModelAPI_AttributeDouble.type()) + self.data().addAttribute("DoubleCounterData", ModelAPI.ModelAPI_AttributeDouble.typeId()) \endcode As you may notice, this method defines that feature has a widget with "DoubleCounterData" id, which has Double type. Therefore, if your feature uses, in example, three widgets, the `initAttributes()` method should 'init' three attributes. \n diff --git a/src/Config/Config_ModuleReader.cpp b/src/Config/Config_ModuleReader.cpp index 6acffa268..74ab76696 100644 --- a/src/Config/Config_ModuleReader.cpp +++ b/src/Config/Config_ModuleReader.cpp @@ -194,6 +194,7 @@ void Config_ModuleReader::loadLibrary(const std::string& theLibName) #ifndef WIN32 anErrorMsg += ": " + std::string(dlerror()); #endif + std::cerr << anErrorMsg << std::endl; Events_Error::send(anErrorMsg); } } diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp index f0e45a5bf..78de925dc 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp @@ -23,8 +23,8 @@ ConstructionPlugin_Axis::ConstructionPlugin_Axis() void ConstructionPlugin_Axis::initAttributes() { - data()->addAttribute(POINT_ATTR_FIRST, ModelAPI_AttributeSelection::type()); - data()->addAttribute(POINT_ATTR_SECOND, ModelAPI_AttributeSelection::type()); + data()->addAttribute(POINT_ATTR_FIRST, ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(POINT_ATTR_SECOND, ModelAPI_AttributeSelection::typeId()); } void ConstructionPlugin_Axis::execute() diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 547540243..07d3d24bc 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp @@ -22,8 +22,8 @@ ConstructionPlugin_Plane::ConstructionPlugin_Plane() void ConstructionPlugin_Plane::initAttributes() { - data()->addAttribute(FACE_ATTR, ModelAPI_AttributeSelection::type()); - data()->addAttribute(DISTANCE_ATTR, ModelAPI_AttributeDouble::type()); + data()->addAttribute(FACE_ATTR, ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(DISTANCE_ATTR, ModelAPI_AttributeDouble::typeId()); } void ConstructionPlugin_Plane::execute() diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index 9539004b7..7a9d66b2d 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -21,9 +21,9 @@ ConstructionPlugin_Point::ConstructionPlugin_Point() void ConstructionPlugin_Point::initAttributes() { - data()->addAttribute(POINT_ATTR_X, ModelAPI_AttributeDouble::type()); - data()->addAttribute(POINT_ATTR_Y, ModelAPI_AttributeDouble::type()); - data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::type()); + data()->addAttribute(POINT_ATTR_X, ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(POINT_ATTR_Y, ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::typeId()); } void ConstructionPlugin_Point::execute() diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 85a025f68..7a32e8510 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -52,7 +52,7 @@ const std::string& ExchangePlugin_ImportFeature::getKind() */ void ExchangePlugin_ImportFeature::initAttributes() { - data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::type()); + data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId()); } /* diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index 779baa1f1..2932d5e5c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -23,9 +23,9 @@ FeaturesPlugin_Boolean::FeaturesPlugin_Boolean() void FeaturesPlugin_Boolean::initAttributes() { - data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::type()); - data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::type()); - data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::type()); + data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId()); + data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::typeId()); + data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::typeId()); } std::shared_ptr FeaturesPlugin_Boolean::getShape(const std::string& theAttrName) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 265ba6576..042ee8e21 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -27,9 +27,9 @@ FeaturesPlugin_Extrusion::FeaturesPlugin_Extrusion() void FeaturesPlugin_Extrusion::initAttributes() { - data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::type()); - data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::type()); + data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId()); } void FeaturesPlugin_Extrusion::execute() diff --git a/src/FeaturesPlugin/FeaturesPlugin_Group.cpp b/src/FeaturesPlugin/FeaturesPlugin_Group.cpp index 4708c6fc0..98c6266ef 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Group.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Group.cpp @@ -22,8 +22,8 @@ FeaturesPlugin_Group::FeaturesPlugin_Group() void FeaturesPlugin_Group::initAttributes() { - //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::type()); - data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type()); + //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); } void FeaturesPlugin_Group::execute() diff --git a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp index 44ad7523e..ae772bd44 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp @@ -24,8 +24,8 @@ FeaturesPlugin_Placement::FeaturesPlugin_Placement() void FeaturesPlugin_Placement::initAttributes() { - data()->addAttribute(FeaturesPlugin_Placement::BASE_FACE_ID(), ModelAPI_AttributeSelection::type()); - data()->addAttribute(FeaturesPlugin_Placement::ATTRACT_FACE_ID(), ModelAPI_AttributeSelection::type()); + data()->addAttribute(FeaturesPlugin_Placement::BASE_FACE_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FeaturesPlugin_Placement::ATTRACT_FACE_ID(), ModelAPI_AttributeSelection::typeId()); } void FeaturesPlugin_Placement::execute() diff --git a/src/FeaturesPlugin/Test/TestBoolean.py b/src/FeaturesPlugin/Test/TestBoolean.py index 94aa22e8e..ab00fa3f4 100644 --- a/src/FeaturesPlugin/Test/TestBoolean.py +++ b/src/FeaturesPlugin/Test/TestBoolean.py @@ -8,9 +8,9 @@ static const std::string MY_TOOL_ID("tool_object"); static const std::string MY_TYPE_ID("bool_type"); - data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::type()); - data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::type()); - data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::type()); + data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::typeId()); + data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::typeId()); + data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId()); """ #========================================================================= # Initialization of the test diff --git a/src/FeaturesPlugin/Test/TestExtrusion.py b/src/FeaturesPlugin/Test/TestExtrusion.py index 2d6cc6a5e..9edca8a3b 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion.py +++ b/src/FeaturesPlugin/Test/TestExtrusion.py @@ -8,9 +8,9 @@ static const std::string MY_SIZE_ID("extrusion_size"); static const std::string MY_REVERSE_ID("extrusion_reverse"); - data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::type()); - data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::type()); + data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId()); """ #========================================================================= # Initialization of the test diff --git a/src/FeaturesPlugin/Test/TestGroup.py b/src/FeaturesPlugin/Test/TestGroup.py index bb446e26c..e888ff654 100644 --- a/src/FeaturesPlugin/Test/TestGroup.py +++ b/src/FeaturesPlugin/Test/TestGroup.py @@ -6,7 +6,7 @@ static const std::string MY_GROUP_ID("Group"); static const std::string MY_GROUP_LIST_ID("group_list"); - data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type()); + data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); """ #========================================================================= # Initialization of the test diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h index a8a5659de..9ca251863 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h @@ -8,9 +8,12 @@ #define GeomAlgoAPI_Boolean_H_ #include -#include #include + +#include +#include #include + #include /**\class GeomAlgoAPI_Boolean diff --git a/src/GeomData/CMakeLists.txt b/src/GeomData/CMakeLists.txt index 0469a36ea..16a1329d7 100644 --- a/src/GeomData/CMakeLists.txt +++ b/src/GeomData/CMakeLists.txt @@ -16,6 +16,7 @@ SET(PROJECT_SOURCES ) SET(PROJECT_LIBRARIES + GeomDataAPI ModelAPI GeomAPI Events diff --git a/src/GeomDataAPI/CMakeLists.txt b/src/GeomDataAPI/CMakeLists.txt index 1f8880b75..581fef7d8 100644 --- a/src/GeomDataAPI/CMakeLists.txt +++ b/src/GeomDataAPI/CMakeLists.txt @@ -12,21 +12,36 @@ SET(PROJECT_HEADERS GeomDataAPI_Point2D.h ) -SET(CMAKE_SWIG_FLAGS "-Wall") +SET(PROJECT_SOURCES + GeomDataAPI_Point.cpp + GeomDataAPI_Dir.cpp + GeomDataAPI_Point2D.cpp +) -SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET(PROJECT_LIBRARIES + ModelAPI +) -INCLUDE_DIRECTORIES( +INCLUDE_DIRECTORIES( ../ModelAPI ) +ADD_DEFINITIONS(-DGEOMDATAAPI_EXPORTS) +ADD_LIBRARY(GeomDataAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS}) +SET_TARGET_PROPERTIES(GeomDataAPI PROPERTIES LINKER_LANGUAGE CXX) +TARGET_LINK_LIBRARIES(GeomDataAPI ${PROJECT_LIBRARIES}) + +SET(CMAKE_SWIG_FLAGS "-Wall") + +SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow") + SET(SWIG_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/GeomDataAPI.py ) SET(SWIG_LINK_LIBRARIES - ModelAPI + GeomDataAPI ${PYTHON_LIBRARIES} ) @@ -38,6 +53,7 @@ IF(WIN32) ENDIF(WIN32) INSTALL(TARGETS _GeomDataAPI DESTINATION swig) +INSTALL(TARGETS GeomDataAPI DESTINATION swig) INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION swig) ADD_UNIT_TESTS(TestConstants.py) diff --git a/src/GeomDataAPI/GeomDataAPI_Dir.cpp b/src/GeomDataAPI/GeomDataAPI_Dir.cpp new file mode 100644 index 000000000..cfb37d6af --- /dev/null +++ b/src/GeomDataAPI/GeomDataAPI_Dir.cpp @@ -0,0 +1,22 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: GeomDataAPI_Dir.cpp +// Created: 24 Apr 2014 +// Author: Mikhail PONIKAROV + + +#include + +std::string GeomDataAPI_Dir::attributeType() +{ + return typeId(); +} + +GeomDataAPI_Dir::GeomDataAPI_Dir() +{ +} + +GeomDataAPI_Dir::~GeomDataAPI_Dir() +{ + +} diff --git a/src/GeomDataAPI/GeomDataAPI_Dir.h b/src/GeomDataAPI/GeomDataAPI_Dir.h index 968edb232..85a3cc031 100644 --- a/src/GeomDataAPI/GeomDataAPI_Dir.h +++ b/src/GeomDataAPI/GeomDataAPI_Dir.h @@ -35,22 +35,18 @@ class GeomDataAPI_Dir : public ModelAPI_Attribute virtual std::shared_ptr dir() = 0; /// Returns the type of this class of attributes - static inline std::string type() + static std::string typeId() { return std::string("Dir"); } /// Returns the type of this class of attributes, not static method - virtual std::string attributeType() - { - return type(); - } + GEOMDATAAPI_EXPORT virtual std::string attributeType(); protected: /// Objects are created for features automatically - GeomDataAPI_Dir() - { - } + GEOMDATAAPI_EXPORT GeomDataAPI_Dir(); + GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Dir(); }; #endif diff --git a/src/GeomDataAPI/GeomDataAPI_Point.cpp b/src/GeomDataAPI/GeomDataAPI_Point.cpp new file mode 100644 index 000000000..a5874ba48 --- /dev/null +++ b/src/GeomDataAPI/GeomDataAPI_Point.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: GeomDataAPI_Point.cpp +// Created: 24 Apr 2014 +// Author: Mikhail PONIKAROV + +#include + +std::string GeomDataAPI_Point::attributeType() +{ + return typeId(); +} + +GeomDataAPI_Point::GeomDataAPI_Point() +{ +} + +GeomDataAPI_Point::~GeomDataAPI_Point() +{ +} diff --git a/src/GeomDataAPI/GeomDataAPI_Point.h b/src/GeomDataAPI/GeomDataAPI_Point.h index 9209e5210..245f9b0f8 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point.h +++ b/src/GeomDataAPI/GeomDataAPI_Point.h @@ -35,22 +35,18 @@ class GeomDataAPI_Point : public ModelAPI_Attribute virtual std::shared_ptr pnt() = 0; /// Returns the type of this class of attributes - static inline std::string type() + static std::string typeId() { return std::string("Point"); } /// Returns the type of this class of attributes, not static method - virtual std::string attributeType() - { - return type(); - } + GEOMDATAAPI_EXPORT virtual std::string attributeType(); protected: /// Objects are created for features automatically - GeomDataAPI_Point() - { - } + GEOMDATAAPI_EXPORT GeomDataAPI_Point(); + GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point(); }; #endif diff --git a/src/GeomDataAPI/GeomDataAPI_Point2D.cpp b/src/GeomDataAPI/GeomDataAPI_Point2D.cpp new file mode 100644 index 000000000..dd8b39ec5 --- /dev/null +++ b/src/GeomDataAPI/GeomDataAPI_Point2D.cpp @@ -0,0 +1,26 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: GeomDataAPI_Point2D.cpp +// Created: 24 Apr 2014 +// Author: Mikhail PONIKAROV + + +#include + +void GeomDataAPI_Point2D::move(const double theDeltaX, const double theDeltaY) +{ + setValue(x() + theDeltaX, y() + theDeltaY); +} + +std::string GeomDataAPI_Point2D::attributeType() +{ + return typeId(); +} + +GeomDataAPI_Point2D::GeomDataAPI_Point2D() +{ +} + +GeomDataAPI_Point2D::~GeomDataAPI_Point2D() +{ +} diff --git a/src/GeomDataAPI/GeomDataAPI_Point2D.h b/src/GeomDataAPI/GeomDataAPI_Point2D.h index 83acc0b57..3c67bec90 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point2D.h +++ b/src/GeomDataAPI/GeomDataAPI_Point2D.h @@ -7,7 +7,7 @@ #ifndef GeomDataAPI_Point2D_H_ #define GeomDataAPI_Point2D_H_ -#include "GeomDataAPI.h" +#include #include class GeomAPI_Pnt2d; @@ -33,29 +33,21 @@ class GeomDataAPI_Point2D : public ModelAPI_Attribute virtual std::shared_ptr pnt() = 0; /// Appends the delta values to point - void move(const double theDeltaX, const double theDeltaY) - { - setValue(x() + theDeltaX, y() + theDeltaY); - } - + GEOMDATAAPI_EXPORT void move(const double theDeltaX, const double theDeltaY); /// Returns the type of this class of attributes - static inline std::string type() + static std::string typeId() { return std::string("Point2D"); } /// Returns the type of this class of attributes, not static method - virtual std::string attributeType() - { - return type(); - } + GEOMDATAAPI_EXPORT virtual std::string attributeType(); protected: /// Objects are created for features automatically - GeomDataAPI_Point2D() - { - } + GEOMDATAAPI_EXPORT GeomDataAPI_Point2D(); + GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point2D(); }; #endif diff --git a/src/GeomDataAPI/Test/TestConstants.py b/src/GeomDataAPI/Test/TestConstants.py index bb6bc044a..2af03aba1 100644 --- a/src/GeomDataAPI/Test/TestConstants.py +++ b/src/GeomDataAPI/Test/TestConstants.py @@ -2,6 +2,6 @@ # Test GeomDataAPI static methods #=============================================================================== from GeomDataAPI import * -assert (GeomDataAPI_Point.type() == "Point") -assert (GeomDataAPI_Dir.type() == "Dir") -assert (GeomDataAPI_Point2D.type() == "Point2D") \ No newline at end of file +assert (GeomDataAPI_Point.typeId() == "Point") +assert (GeomDataAPI_Dir.typeId() == "Dir") +assert (GeomDataAPI_Point2D.typeId() == "Point2D") \ No newline at end of file diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index e13eaa406..f280f8fc6 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -70,33 +70,33 @@ void Model_Data::addAttribute(const std::string& theID, const std::string theAtt { TDF_Label anAttrLab = myLab.FindChild(myAttrs.size() + 1); ModelAPI_Attribute* anAttr = 0; - if (theAttrType == ModelAPI_AttributeDocRef::type()) { + if (theAttrType == ModelAPI_AttributeDocRef::typeId()) { anAttr = new Model_AttributeDocRef(anAttrLab); - } else if (theAttrType == Model_AttributeInteger::type()) { + } else if (theAttrType == Model_AttributeInteger::typeId()) { anAttr = new Model_AttributeInteger(anAttrLab); - } else if (theAttrType == ModelAPI_AttributeDouble::type()) { + } else if (theAttrType == ModelAPI_AttributeDouble::typeId()) { anAttr = new Model_AttributeDouble(anAttrLab); - } else if (theAttrType == Model_AttributeBoolean::type()) { + } else if (theAttrType == Model_AttributeBoolean::typeId()) { anAttr = new Model_AttributeBoolean(anAttrLab); - } else if (theAttrType == Model_AttributeString::type()) { + } else if (theAttrType == Model_AttributeString::typeId()) { anAttr = new Model_AttributeString(anAttrLab); - } else if (theAttrType == ModelAPI_AttributeReference::type()) { + } else if (theAttrType == ModelAPI_AttributeReference::typeId()) { anAttr = new Model_AttributeReference(anAttrLab); - } else if (theAttrType == ModelAPI_AttributeSelection::type()) { + } else if (theAttrType == ModelAPI_AttributeSelection::typeId()) { anAttr = new Model_AttributeSelection(anAttrLab); - } else if (theAttrType == ModelAPI_AttributeSelectionList::type()) { + } else if (theAttrType == ModelAPI_AttributeSelectionList::typeId()) { anAttr = new Model_AttributeSelectionList(anAttrLab); - } else if (theAttrType == ModelAPI_AttributeRefAttr::type()) { + } else if (theAttrType == ModelAPI_AttributeRefAttr::typeId()) { anAttr = new Model_AttributeRefAttr(anAttrLab); - } else if (theAttrType == ModelAPI_AttributeRefList::type()) { + } else if (theAttrType == ModelAPI_AttributeRefList::typeId()) { anAttr = new Model_AttributeRefList(anAttrLab); } // create also GeomData attributes here because only here the OCAF strucure is known - else if (theAttrType == GeomData_Point::type()) { + else if (theAttrType == GeomData_Point::typeId()) { anAttr = new GeomData_Point(anAttrLab); - } else if (theAttrType == GeomData_Dir::type()) { + } else if (theAttrType == GeomData_Dir::typeId()) { anAttr = new GeomData_Dir(anAttrLab); - } else if (theAttrType == GeomData_Point2D::type()) { + } else if (theAttrType == GeomData_Point2D::typeId()) { anAttr = new GeomData_Point2D(anAttrLab); } if (anAttr) { @@ -268,21 +268,21 @@ void Model_Data::referencesToObjects( std::list aReferenced; // not inside of cycle to avoid excess memory menagement for(; anAttr != myAttrs.end(); anAttr++) { std::string aType = anAttr->second->attributeType(); - if (aType == ModelAPI_AttributeReference::type()) { // reference to object + if (aType == ModelAPI_AttributeReference::typeId()) { // reference to object std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeReference>(anAttr->second); aReferenced.push_back(aRef->value()); - } else if (aType == ModelAPI_AttributeRefAttr::type()) { // reference to attribute or object + } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { // reference to attribute or object std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(anAttr->second); aReferenced.push_back(aRef->isObject() ? aRef->object() : aRef->attr()->owner()); - } else if (aType == ModelAPI_AttributeRefList::type()) { // list of references + } else if (aType == ModelAPI_AttributeRefList::typeId()) { // list of references aReferenced = std::dynamic_pointer_cast(anAttr->second)->list(); - } else if (aType == ModelAPI_AttributeSelection::type()) { // selection attribute + } else if (aType == ModelAPI_AttributeSelection::typeId()) { // selection attribute std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeSelection>(anAttr->second); aReferenced.push_back(aRef->context()); - } else if (aType == ModelAPI_AttributeSelectionList::type()) { // list of selection attributes + } else if (aType == ModelAPI_AttributeSelectionList::typeId()) { // list of selection attributes std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeSelectionList>(anAttr->second); for(int a = aRef->size() - 1; a >= 0; a--) { diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 0392787f3..a54ca6709 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -28,7 +28,7 @@ void Model_ResultPart::setData(std::shared_ptr theData) { ModelAPI_Result::setData(theData); if (theData) { - data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::type()); + data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId()); } } diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index d6f02c5f7..dd2b02b4c 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -250,7 +250,7 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) //std::cout<<"Execute feature "<getKind()< aRefs = - theFeature->data()->attributes(ModelAPI_AttributeSelection::type()); + theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); list::iterator aRefsIter = aRefs.begin(); for (; aRefsIter != aRefs.end(); aRefsIter++) { std::shared_ptr aSel = @@ -260,7 +260,7 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) aState = ModelAPI_StateInvalidArgument; } } - aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelectionList::type()); + aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelectionList::typeId()); for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) { std::shared_ptr aSel = std::dynamic_pointer_cast(*aRefsIter); diff --git a/src/ModelAPI/ModelAPI_AttributeBoolean.cpp b/src/ModelAPI/ModelAPI_AttributeBoolean.cpp index 722c14fcd..5f0eb921b 100644 --- a/src/ModelAPI/ModelAPI_AttributeBoolean.cpp +++ b/src/ModelAPI/ModelAPI_AttributeBoolean.cpp @@ -8,7 +8,7 @@ std::string ModelAPI_AttributeBoolean::attributeType() { - return type(); + return typeId(); } /// To virtually destroy the fields of successors diff --git a/src/ModelAPI/ModelAPI_AttributeBoolean.h b/src/ModelAPI/ModelAPI_AttributeBoolean.h index 122ffa70f..661a8ffea 100644 --- a/src/ModelAPI/ModelAPI_AttributeBoolean.h +++ b/src/ModelAPI/ModelAPI_AttributeBoolean.h @@ -24,7 +24,7 @@ class ModelAPI_AttributeBoolean : public ModelAPI_Attribute MODELAPI_EXPORT virtual bool value() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "Boolean"; } diff --git a/src/ModelAPI/ModelAPI_AttributeDocRef.cpp b/src/ModelAPI/ModelAPI_AttributeDocRef.cpp index 69563831a..bf71a4726 100644 --- a/src/ModelAPI/ModelAPI_AttributeDocRef.cpp +++ b/src/ModelAPI/ModelAPI_AttributeDocRef.cpp @@ -8,7 +8,7 @@ std::string ModelAPI_AttributeDocRef::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeDocRef::~ModelAPI_AttributeDocRef() diff --git a/src/ModelAPI/ModelAPI_AttributeDocRef.h b/src/ModelAPI/ModelAPI_AttributeDocRef.h index b1149c7f3..0772c9fc3 100644 --- a/src/ModelAPI/ModelAPI_AttributeDocRef.h +++ b/src/ModelAPI/ModelAPI_AttributeDocRef.h @@ -25,7 +25,7 @@ class ModelAPI_AttributeDocRef : public ModelAPI_Attribute MODELAPI_EXPORT virtual std::shared_ptr value() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "DocRef"; } diff --git a/src/ModelAPI/ModelAPI_AttributeDouble.cpp b/src/ModelAPI/ModelAPI_AttributeDouble.cpp index 7847dfabd..3aa85ae70 100644 --- a/src/ModelAPI/ModelAPI_AttributeDouble.cpp +++ b/src/ModelAPI/ModelAPI_AttributeDouble.cpp @@ -8,7 +8,7 @@ std::string ModelAPI_AttributeDouble::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeDouble::~ModelAPI_AttributeDouble() diff --git a/src/ModelAPI/ModelAPI_AttributeDouble.h b/src/ModelAPI/ModelAPI_AttributeDouble.h index 498b40509..291bc1883 100644 --- a/src/ModelAPI/ModelAPI_AttributeDouble.h +++ b/src/ModelAPI/ModelAPI_AttributeDouble.h @@ -24,7 +24,7 @@ class ModelAPI_AttributeDouble : public ModelAPI_Attribute MODELAPI_EXPORT virtual double value() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "Double"; } diff --git a/src/ModelAPI/ModelAPI_AttributeInteger.cpp b/src/ModelAPI/ModelAPI_AttributeInteger.cpp index afb2376a9..94849fb13 100644 --- a/src/ModelAPI/ModelAPI_AttributeInteger.cpp +++ b/src/ModelAPI/ModelAPI_AttributeInteger.cpp @@ -9,7 +9,7 @@ std::string ModelAPI_AttributeInteger::attributeType() { - return type(); + return typeId(); } /// To virtually destroy the fields of successors diff --git a/src/ModelAPI/ModelAPI_AttributeInteger.h b/src/ModelAPI/ModelAPI_AttributeInteger.h index c1bc9e6af..e683166d3 100644 --- a/src/ModelAPI/ModelAPI_AttributeInteger.h +++ b/src/ModelAPI/ModelAPI_AttributeInteger.h @@ -28,7 +28,7 @@ class ModelAPI_AttributeInteger : public ModelAPI_Attribute MODELAPI_EXPORT virtual int value() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "Integer"; } diff --git a/src/ModelAPI/ModelAPI_AttributeRefAttr.cpp b/src/ModelAPI/ModelAPI_AttributeRefAttr.cpp index 35bd2d74d..523f28982 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefAttr.cpp +++ b/src/ModelAPI/ModelAPI_AttributeRefAttr.cpp @@ -10,7 +10,7 @@ std::string ModelAPI_AttributeRefAttr::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeRefAttr::~ModelAPI_AttributeRefAttr() diff --git a/src/ModelAPI/ModelAPI_AttributeRefAttr.h b/src/ModelAPI/ModelAPI_AttributeRefAttr.h index bd4c7c4f4..2d2580ab7 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefAttr.h +++ b/src/ModelAPI/ModelAPI_AttributeRefAttr.h @@ -35,7 +35,7 @@ class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute MODELAPI_EXPORT virtual ObjectPtr object() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "RefAttr"; } diff --git a/src/ModelAPI/ModelAPI_AttributeRefList.cpp b/src/ModelAPI/ModelAPI_AttributeRefList.cpp index ded44b22c..eaedcc074 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefList.cpp +++ b/src/ModelAPI/ModelAPI_AttributeRefList.cpp @@ -9,7 +9,7 @@ std::string ModelAPI_AttributeRefList::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeRefList::~ModelAPI_AttributeRefList() diff --git a/src/ModelAPI/ModelAPI_AttributeRefList.h b/src/ModelAPI/ModelAPI_AttributeRefList.h index 9384d2855..12235c5b8 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefList.h +++ b/src/ModelAPI/ModelAPI_AttributeRefList.h @@ -20,7 +20,7 @@ class ModelAPI_AttributeRefList : public ModelAPI_Attribute { public: /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "RefList"; } diff --git a/src/ModelAPI/ModelAPI_AttributeReference.cpp b/src/ModelAPI/ModelAPI_AttributeReference.cpp index 4c1360820..1eb90580f 100644 --- a/src/ModelAPI/ModelAPI_AttributeReference.cpp +++ b/src/ModelAPI/ModelAPI_AttributeReference.cpp @@ -8,7 +8,7 @@ std::string ModelAPI_AttributeReference::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeReference::~ModelAPI_AttributeReference() diff --git a/src/ModelAPI/ModelAPI_AttributeReference.h b/src/ModelAPI/ModelAPI_AttributeReference.h index c90d78fe7..948debd23 100644 --- a/src/ModelAPI/ModelAPI_AttributeReference.h +++ b/src/ModelAPI/ModelAPI_AttributeReference.h @@ -25,7 +25,7 @@ class ModelAPI_AttributeReference : public ModelAPI_Attribute MODELAPI_EXPORT virtual ObjectPtr value() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "Reference"; } diff --git a/src/ModelAPI/ModelAPI_AttributeSelection.cpp b/src/ModelAPI/ModelAPI_AttributeSelection.cpp index e5accc0ca..455e63224 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelection.cpp +++ b/src/ModelAPI/ModelAPI_AttributeSelection.cpp @@ -10,7 +10,7 @@ std::string ModelAPI_AttributeSelection::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeSelection::~ModelAPI_AttributeSelection() diff --git a/src/ModelAPI/ModelAPI_AttributeSelection.h b/src/ModelAPI/ModelAPI_AttributeSelection.h index b2986b3bb..495da4180 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelection.h +++ b/src/ModelAPI/ModelAPI_AttributeSelection.h @@ -33,7 +33,7 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute virtual bool update() = 0; /// Returns the type of this class of attributes - static std::string type() + static std::string typeId() { return "Selection"; } diff --git a/src/ModelAPI/ModelAPI_AttributeSelectionList.cpp b/src/ModelAPI/ModelAPI_AttributeSelectionList.cpp index e88f4c7a8..a3b06f3ee 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelectionList.cpp +++ b/src/ModelAPI/ModelAPI_AttributeSelectionList.cpp @@ -9,7 +9,7 @@ std::string ModelAPI_AttributeSelectionList::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeSelectionList::~ModelAPI_AttributeSelectionList() diff --git a/src/ModelAPI/ModelAPI_AttributeSelectionList.h b/src/ModelAPI/ModelAPI_AttributeSelectionList.h index cc8077e32..f440dcb92 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelectionList.h +++ b/src/ModelAPI/ModelAPI_AttributeSelectionList.h @@ -45,7 +45,7 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute virtual void clear() = 0; /// Returns the type of this class of attributes - static std::string type() + static std::string typeId() { return "SelectionList"; } diff --git a/src/ModelAPI/ModelAPI_AttributeString.cpp b/src/ModelAPI/ModelAPI_AttributeString.cpp index 19df8f5dd..3c647633b 100644 --- a/src/ModelAPI/ModelAPI_AttributeString.cpp +++ b/src/ModelAPI/ModelAPI_AttributeString.cpp @@ -9,7 +9,7 @@ std::string ModelAPI_AttributeString::attributeType() { - return type(); + return typeId(); } ModelAPI_AttributeString::~ModelAPI_AttributeString() diff --git a/src/ModelAPI/ModelAPI_AttributeString.h b/src/ModelAPI/ModelAPI_AttributeString.h index 26f4b4e8a..b3e0ad0e2 100644 --- a/src/ModelAPI/ModelAPI_AttributeString.h +++ b/src/ModelAPI/ModelAPI_AttributeString.h @@ -26,7 +26,7 @@ class ModelAPI_AttributeString : public ModelAPI_Attribute MODELAPI_EXPORT virtual std::string value() = 0; /// Returns the type of this class of attributes - MODELAPI_EXPORT static std::string type() + MODELAPI_EXPORT static std::string typeId() { return "String"; } diff --git a/src/ModelAPI/ModelAPI_ShapeValidator.cpp b/src/ModelAPI/ModelAPI_ShapeValidator.cpp index b451ed1bb..8de8d2767 100644 --- a/src/ModelAPI/ModelAPI_ShapeValidator.cpp +++ b/src/ModelAPI/ModelAPI_ShapeValidator.cpp @@ -16,7 +16,7 @@ bool ModelAPI_ShapeValidator::isValid(const FeaturePtr& theFeature, std::string aCurrentAttributeId = theAttribute->id(); // get all feature attributes std::list anAttrs = - theFeature->data()->attributes(ModelAPI_AttributeSelection::type()); + theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); if (anAttrs.size() > 0 && theShape.get() != NULL) { std::list::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { diff --git a/src/ModelAPI/Test/TestConstants.py b/src/ModelAPI/Test/TestConstants.py index fd851f310..c15375d72 100644 --- a/src/ModelAPI/Test/TestConstants.py +++ b/src/ModelAPI/Test/TestConstants.py @@ -3,8 +3,8 @@ #=============================================================================== from ModelAPI import * assert (ModelAPI_Feature.group() == "Features") -assert (ModelAPI_AttributeDocRef.type() == "DocRef") -assert (ModelAPI_AttributeDouble.type() == "Double") -assert (ModelAPI_AttributeReference.type() == "Reference") -assert (ModelAPI_AttributeRefAttr.type() == "RefAttr") -assert (ModelAPI_AttributeRefList.type() == "RefList") \ No newline at end of file +assert (ModelAPI_AttributeDocRef.typeId() == "DocRef") +assert (ModelAPI_AttributeDouble.typeId() == "Double") +assert (ModelAPI_AttributeReference.typeId() == "Reference") +assert (ModelAPI_AttributeRefAttr.typeId() == "RefAttr") +assert (ModelAPI_AttributeRefList.typeId() == "RefList") \ No newline at end of file diff --git a/src/PartSet/CMakeLists.txt b/src/PartSet/CMakeLists.txt index 8c0eff955..f919c05fd 100644 --- a/src/PartSet/CMakeLists.txt +++ b/src/PartSet/CMakeLists.txt @@ -42,6 +42,7 @@ SET(PROJECT_LIBRARIES ModuleBase Config GeomAPI + GeomDataAPI ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_SHAPE} diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 0b07da7e7..9157938f1 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -220,7 +220,7 @@ std::shared_ptr PartSet_Tools::getFeaturePoint(FeaturePtr t std::shared_ptr aClickedPoint = std::shared_ptr( new GeomAPI_Pnt2d(theX, theY)); std::list > anAttiributes = - theFeature->data()->attributes(GeomDataAPI_Point2D::type()); + theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list >::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); std::shared_ptr aFPoint; @@ -319,7 +319,7 @@ std::shared_ptr PartSet_Tools:: for (int i = 0; i < theSketch->numberOfSubs(); i++) { FeaturePtr aFeature = theSketch->subFeature(i); if (!theIgnore.contains(aFeature)) { - anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::type()); + anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list >::const_iterator anIt; for (anIt = anAttiributes.cbegin(); anIt != anAttiributes.cend(); ++anIt) { @@ -362,7 +362,7 @@ void PartSet_Tools::setConstraints(CompositeFeaturePtr theSketch, FeaturePtr the for (; anIt != aLast; anIt++) { FeaturePtr aFeature = std::dynamic_pointer_cast(*anIt); // find the given point in the feature attributes - anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::type()); + anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list >::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); std::shared_ptr aFPoint; @@ -626,7 +626,7 @@ AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, // find the given point in the feature attributes std::list anAttiributes = - aFeature->data()->attributes(GeomDataAPI_Point2D::type()); + aFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); for (; anIt != aLast && !anAttribute; anIt++) { diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index 278c3e637..30d95d472 100644 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -116,7 +116,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature, { // Check RefAttr attributes std::list > anAttrs = - theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); + theFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); if (anAttrs.size() > 0) { std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { @@ -130,7 +130,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature, } } // Check selection attributes - anAttrs = theFeature->data()->attributes(ModelAPI_AttributeSelection::type()); + anAttrs = theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); if (anAttrs.size() > 0) { std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { @@ -144,7 +144,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature, } } // Check selection attributes - anAttrs = theFeature->data()->attributes(ModelAPI_AttributeReference::type()); + anAttrs = theFeature->data()->attributes(ModelAPI_AttributeReference::typeId()); if (anAttrs.size() > 0) { std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { diff --git a/src/SketchPlugin/CMakeLists.txt b/src/SketchPlugin/CMakeLists.txt index d801aabac..9d14f6b4c 100644 --- a/src/SketchPlugin/CMakeLists.txt +++ b/src/SketchPlugin/CMakeLists.txt @@ -50,6 +50,7 @@ SET(PROJECT_LIBRARIES GeomAPI GeomAlgoAPI ModelAPI + GeomDataAPI ${CAS_KERNEL} ${CAS_SHAPE} ) diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index deb2b2fae..629505797 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -31,10 +31,10 @@ SketchPlugin_Arc::SketchPlugin_Arc() void SketchPlugin_Arc::initAttributes() { - data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(START_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(END_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type()); + data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(START_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(END_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID()); } diff --git a/src/SketchPlugin/SketchPlugin_Circle.cpp b/src/SketchPlugin/SketchPlugin_Circle.cpp index e880df9af..c92948bd2 100644 --- a/src/SketchPlugin/SketchPlugin_Circle.cpp +++ b/src/SketchPlugin/SketchPlugin_Circle.cpp @@ -28,9 +28,9 @@ SketchPlugin_Circle::SketchPlugin_Circle() void SketchPlugin_Circle::initAttributes() { - data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(RADIUS_ID(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type()); + data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(RADIUS_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID()); } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp b/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp index 15f6d1ccc..02cf66ca0 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp @@ -16,8 +16,8 @@ SketchPlugin_ConstraintCoincidence::SketchPlugin_ConstraintCoincidence() void SketchPlugin_ConstraintCoincidence::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); } void SketchPlugin_ConstraintCoincidence::execute() diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index bdd410ec0..38d4db89e 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -25,10 +25,10 @@ SketchPlugin_ConstraintDistance::SketchPlugin_ConstraintDistance() //************************************************************************************* void SketchPlugin_ConstraintDistance::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); } //************************************************************************************* diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index 224ea32b5..eb66e1d6b 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -26,9 +26,9 @@ SketchPlugin_ConstraintLength::SketchPlugin_ConstraintLength() void SketchPlugin_ConstraintLength::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); } void SketchPlugin_ConstraintLength::execute() diff --git a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp index 6997f4f0a..f22260247 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp @@ -25,9 +25,9 @@ SketchPlugin_ConstraintParallel::SketchPlugin_ConstraintParallel() void SketchPlugin_ConstraintParallel::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); } void SketchPlugin_ConstraintParallel::execute() diff --git a/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp b/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp index c63555da5..6137a1e23 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp @@ -25,8 +25,8 @@ SketchPlugin_ConstraintPerpendicular::SketchPlugin_ConstraintPerpendicular() void SketchPlugin_ConstraintPerpendicular::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); } void SketchPlugin_ConstraintPerpendicular::execute() diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index 135b6bbdb..5ee8ea893 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -29,9 +29,9 @@ SketchPlugin_ConstraintRadius::SketchPlugin_ConstraintRadius() void SketchPlugin_ConstraintRadius::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); + data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); } void SketchPlugin_ConstraintRadius::execute() diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp index 5a7b9d5f9..a9d7fda02 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp @@ -18,7 +18,7 @@ SketchPlugin_ConstraintRigid::SketchPlugin_ConstraintRigid() void SketchPlugin_ConstraintRigid::initAttributes() { - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); } void SketchPlugin_ConstraintRigid::execute() diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 429f7e132..2525b642e 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -27,9 +27,9 @@ SketchPlugin_Line::SketchPlugin_Line() void SketchPlugin_Line::initAttributes() { - data()->addAttribute(START_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(END_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type()); + data()->addAttribute(START_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(END_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID()); } diff --git a/src/SketchPlugin/SketchPlugin_Point.cpp b/src/SketchPlugin/SketchPlugin_Point.cpp index 3fd71b560..cb2cad6de 100644 --- a/src/SketchPlugin/SketchPlugin_Point.cpp +++ b/src/SketchPlugin/SketchPlugin_Point.cpp @@ -26,8 +26,8 @@ SketchPlugin_Point::SketchPlugin_Point() void SketchPlugin_Point::initAttributes() { - data()->addAttribute(SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type()); + data()->addAttribute(SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID()); } diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index 8e9644e45..b85b3d209 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -43,13 +43,13 @@ SketchPlugin_Sketch::SketchPlugin_Sketch() void SketchPlugin_Sketch::initAttributes() { - data()->addAttribute(SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point::type()); - data()->addAttribute(SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir::type()); - data()->addAttribute(SketchPlugin_Sketch::DIRY_ID(), GeomDataAPI_Dir::type()); - data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::type()); - data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::type()); + data()->addAttribute(SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point::typeId()); + data()->addAttribute(SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir::typeId()); + data()->addAttribute(SketchPlugin_Sketch::DIRY_ID(), GeomDataAPI_Dir::typeId()); + data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::typeId()); + data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::typeId()); // the selected face, base for the sketcher plane, not obligatory - data()->addAttribute(SketchPlugin_Feature::EXTERNAL_ID(), ModelAPI_AttributeSelection::type()); + data()->addAttribute(SketchPlugin_Feature::EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory( getKind(), SketchPlugin_Feature::EXTERNAL_ID()); } diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 29bdf3c27..abef5066c 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -62,7 +62,7 @@ bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeatur const ObjectPtr& theObject) const { std::list > anAttrs = - theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); + theFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { if (*anAttr) { @@ -86,7 +86,7 @@ bool SketchPlugin_DifferentObjectsValidator::isValid( const FeaturePtr aFeature = std::dynamic_pointer_cast(anObj); std::list > anAttrs = - aFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); + aFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { if (*anAttr && *anAttr != theAttribute) { @@ -105,7 +105,7 @@ bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeatur const std::list& theArguments, const AttributePtr& theAttribute) const { std::list > anAttrs = - theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); + theFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { if (*anAttr) { diff --git a/src/SketchPlugin/Test/TestConstraintConcidence.py b/src/SketchPlugin/Test/TestConstraintConcidence.py index 772c94b96..5256acb2d 100644 --- a/src/SketchPlugin/Test/TestConstraintConcidence.py +++ b/src/SketchPlugin/Test/TestConstraintConcidence.py @@ -12,8 +12,8 @@ SketchPlugin_ConstraintCoincidence static const std::string MY_CONSTRAINT_COINCIDENCE_ID("SketchConstraintCoincidence"); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); """ from GeomDataAPI import * diff --git a/src/SketchPlugin/Test/TestConstraintDistance.py b/src/SketchPlugin/Test/TestConstraintDistance.py index 4c50263b2..f57728799 100644 --- a/src/SketchPlugin/Test/TestConstraintDistance.py +++ b/src/SketchPlugin/Test/TestConstraintDistance.py @@ -12,10 +12,10 @@ SketchPlugin_ConstraintDistance static const std::string MY_CONSTRAINT_DISTANCE_ID("SketchConstraintDistance"); - data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); """ diff --git a/src/SketchPlugin/Test/TestConstraintLength.py b/src/SketchPlugin/Test/TestConstraintLength.py index 48acf2c6b..12915b42e 100644 --- a/src/SketchPlugin/Test/TestConstraintLength.py +++ b/src/SketchPlugin/Test/TestConstraintLength.py @@ -4,9 +4,9 @@ SketchPlugin_ConstraintLength static const std::string MY_CONSTRAINT_LENGTH_ID("SketchConstraintLength"); - data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); """ from GeomDataAPI import * diff --git a/src/SketchPlugin/Test/TestConstraintParallel.py b/src/SketchPlugin/Test/TestConstraintParallel.py index 052e9272a..ce2dcea47 100644 --- a/src/SketchPlugin/Test/TestConstraintParallel.py +++ b/src/SketchPlugin/Test/TestConstraintParallel.py @@ -4,9 +4,9 @@ SketchPlugin_ConstraintParallel static const std::string MY_CONSTRAINT_PARALLEL_ID("SketchConstraintParallel"); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); """ from GeomDataAPI import * diff --git a/src/SketchPlugin/Test/TestConstraintPerpendicular.py b/src/SketchPlugin/Test/TestConstraintPerpendicular.py index 2f9c6bf06..435b7d8c4 100644 --- a/src/SketchPlugin/Test/TestConstraintPerpendicular.py +++ b/src/SketchPlugin/Test/TestConstraintPerpendicular.py @@ -12,9 +12,9 @@ SketchPlugin_ConstraintPerpendicular static const std::string MY_CONSTRAINT_PERPENDICULAR_ID("SketchConstraintPerpendicular"); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); """ from GeomDataAPI import * from ModelAPI import * diff --git a/src/SketchPlugin/Test/TestConstraintRadius.py b/src/SketchPlugin/Test/TestConstraintRadius.py index cc71a412f..8adb6082d 100644 --- a/src/SketchPlugin/Test/TestConstraintRadius.py +++ b/src/SketchPlugin/Test/TestConstraintRadius.py @@ -12,9 +12,9 @@ SketchPlugin_ConstraintRadius static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius"); - data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); + data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); """ from GeomDataAPI import * diff --git a/src/SketchPlugin/Test/TestConstraintRigid.py b/src/SketchPlugin/Test/TestConstraintRigid.py index 9f6eaf31a..47dfadf51 100644 --- a/src/SketchPlugin/Test/TestConstraintRigid.py +++ b/src/SketchPlugin/Test/TestConstraintRigid.py @@ -12,7 +12,7 @@ SketchPlugin_ConstraintRigid static const std::string MY_CONSTRAINT_RIGID_ID("SketchConstraintRigid"); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); """ from GeomDataAPI import * diff --git a/src/SketchPlugin/Test/TestSketchArcCircle.py b/src/SketchPlugin/Test/TestSketchArcCircle.py index c59725e21..9835bf2cc 100644 --- a/src/SketchPlugin/Test/TestSketchArcCircle.py +++ b/src/SketchPlugin/Test/TestSketchArcCircle.py @@ -5,15 +5,15 @@ static const std::string MY_CENTER_ID = "ArcCenter"; static const std::string MY_START_ID = "ArcStartPoint"; static const std::string MY_END_ID = "ArcEndPoint"; - data()->addAttribute(SketchPlugin_Arc::CENTER_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Arc::START_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Arc::END_ID(), GeomDataAPI_Point2D::type()); + data()->addAttribute(SketchPlugin_Arc::CENTER_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Arc::START_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Arc::END_ID(), GeomDataAPI_Point2D::typeId()); static const std::string MY_CIRCLE_ID("SketchCircle"); static const std::string MY_CIRCLE_CENTER_ID("CircleCenter"); static const std::string MY_CIRCLE_RADIUS_ID("CircleRadius"); - data()->addAttribute(SketchPlugin_Circle::CENTER_ID(), GeomDataAPI_Point2D::type()); - data()->addAttribute(SketchPlugin_Circle::RADIUS_ID(), ModelAPI_AttributeDouble::type()); + data()->addAttribute(SketchPlugin_Circle::CENTER_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(SketchPlugin_Circle::RADIUS_ID(), ModelAPI_AttributeDouble::typeId()); """ #========================================================================= @@ -139,8 +139,8 @@ assert (anCircleCentr.y() == 0) assert (not anCircleCentr.isInitialized()) aCircleRadius = aSketchCircle.real("CircleRadius") assert (type(aCircleRadius) == ModelAPI_AttributeDouble) -# ModelAPI_AttributeDouble.type() is checked in ModelAPI_TestConstants -assert (aCircleRadius.attributeType() == ModelAPI_AttributeDouble.type()) +# ModelAPI_AttributeDouble.typeId() is checked in ModelAPI_TestConstants +assert (aCircleRadius.attributeType() == ModelAPI_AttributeDouble.typeId()) assert (aCircleRadius.value() == 0) anCircleCentr.setValue(-25., -25) aCircleRadius.setValue(25.) diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index 61a42b64c..79d47ccf0 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -231,9 +231,9 @@ AttrType typeOfAttribute(std::shared_ptr theAttribute) } else { if (anAttrRef->attr().get() != NULL) { const std::string aType = anAttrRef->attr()->attributeType(); - if (aType == GeomDataAPI_Point2D::type()) + if (aType == GeomDataAPI_Point2D::typeId()) return POINT2D; - if (aType == GeomDataAPI_Point2D::type()) + if (aType == GeomDataAPI_Point2D::typeId()) return POINT2D; } } -- 2.30.2