]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Put groups to the separated plugin: Collection
authormpv <mpv@opencascade.com>
Fri, 11 Nov 2016 15:15:36 +0000 (18:15 +0300)
committermpv <mpv@opencascade.com>
Fri, 11 Nov 2016 15:15:36 +0000 (18:15 +0300)
64 files changed:
CMakeCommon/Common.cmake
CMakeLists.txt
src/CollectionAPI/CMakeLists.txt [new file with mode: 0644]
src/CollectionAPI/CollectionAPI.h [new file with mode: 0644]
src/CollectionAPI/CollectionAPI.i [new file with mode: 0644]
src/CollectionAPI/CollectionAPI_Group.cpp [new file with mode: 0644]
src/CollectionAPI/CollectionAPI_Group.h [new file with mode: 0644]
src/CollectionPlugin/CMakeLists.txt [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin.h [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin_Group.cpp [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin_Group.h [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin_Plugin.cpp [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin_Plugin.h [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin_msg_en.ts [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroup.py [new file with mode: 0644]
src/CollectionPlugin/group_widget.xml [new file with mode: 0644]
src/CollectionPlugin/icons/shape_group.png [new file with mode: 0644]
src/CollectionPlugin/plugin-Collection.xml [new file with mode: 0644]
src/Config/plugins.xml.in
src/ConstructionPlugin/ConstructionPlugin_Axis.cpp
src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp
src/Events/CMakeLists.txt
src/Events/Events_Loop.cpp
src/ExchangePlugin/ExchangePlugin_Plugin.cpp
src/FeaturesAPI/CMakeLists.txt
src/FeaturesAPI/FeaturesAPI.i
src/FeaturesAPI/FeaturesAPI_Group.cpp [deleted file]
src/FeaturesAPI/FeaturesAPI_Group.h [deleted file]
src/FeaturesAPI/FeaturesAPI_swig.h
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_Group.cpp [deleted file]
src/FeaturesPlugin/FeaturesPlugin_Group.h [deleted file]
src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
src/FeaturesPlugin/FeaturesPlugin_Recover.cpp
src/FeaturesPlugin/FeaturesPlugin_msg_en.ts
src/FeaturesPlugin/group_widget.xml [deleted file]
src/FeaturesPlugin/icons/shape_group.png [deleted file]
src/FeaturesPlugin/plugin-Features.xml
src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp
src/GeomAPI/GeomAPI_Pln.cpp
src/GeomData/GeomData_Dir.cpp
src/Model/Model_Application.cpp
src/Model/Model_AttributeBoolean.cpp
src/Model/Model_AttributeDocRef.cpp
src/Model/Model_AttributeRefAttr.cpp
src/Model/Model_AttributeRefAttrList.cpp
src/Model/Model_AttributeRefList.cpp
src/Model/Model_AttributeReference.cpp
src/Model/Model_AttributeSelection.cpp
src/Model/Model_AttributeSelectionList.cpp
src/Model/Model_Session.cpp
src/Model/Model_Update.cpp
src/ModelAPI/ModelAPI_Session.cpp
src/PartSetPlugin/PartSetPlugin_Duplicate.cpp
src/PartSetPlugin/PartSetPlugin_Part.cpp
src/PartSetPlugin/PartSetPlugin_Plugin.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Plugin.cpp
src/PythonAPI/model/__init__.py
src/PythonAPI/model/collection/__init__.py [new file with mode: 0644]
src/PythonAPI/model/features/__init__.py
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Point.cpp
src/SketchPlugin/SketchPlugin_Sketch.cpp

index 009277a68ead31ae6cbc7ccfa3ff64f051d87f52..580e914709d95986e035e036ac698b64e9a1419d 100644 (file)
@@ -13,3 +13,28 @@ IF(WIN32)
   ## Specific definitions: EHsc to avoid exceptions-linkage unresolved symbols
   ADD_DEFINITIONS(-DWIN32 -D_WINDOWS /EHsc)
 ENDIF(WIN32)
+
+IF(UNIX)
+  IF(CMAKE_COMPILER_IS_GNUCC)
+    #C++11 is not supported on some platforms, disable it
+    MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+
+    #Supporting test coverage checks (gcov) in the DEBUG mode
+    IF(USE_TEST_COVERAGE)
+      INCLUDE(CodeCoverage)
+      MESSAGE(STATUS "Setting flags for gcov support the gcc...")
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
+      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
+      SET(CMAKE_SHARED_LINKER_FLAGS "-lgcov")
+
+      SETUP_TARGET_FOR_COVERAGE(test_coverage  # Name for custom target.
+                                ctest          # Name of the test driver executable that runs the tests.
+                                coverage)      # Name of output directory.
+    ENDIF(USE_TEST_COVERAGE)
+
+    #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -E")
+    MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
+    MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
+  ENDIF(CMAKE_COMPILER_IS_GNUCC)
+ENDIF(UNIX)
index ba85cc20032602343e0e084862bd08926d4ba8f3..7a2007df6ca4a1d75586ddd62baa9c0d6d8a47e9 100644 (file)
@@ -26,31 +26,6 @@ ENDIF()
 # It could be called only once
 FIND_PACKAGE(LibXml2 REQUIRED)
 
-IF(UNIX)
-  IF(CMAKE_COMPILER_IS_GNUCC)
-    #C++11 is not supported on some platforms, disable it
-    MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-
-    #Supporting test coverage checks (gcov) in the DEBUG mode
-    IF(USE_TEST_COVERAGE)
-      INCLUDE(CodeCoverage)
-      MESSAGE(STATUS "Setting flags for gcov support the gcc...")
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
-      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
-      SET(CMAKE_SHARED_LINKER_FLAGS "-lgcov")
-
-      SETUP_TARGET_FOR_COVERAGE(test_coverage  # Name for custom target.
-                                ctest          # Name of the test driver executable that runs the tests.
-                                coverage)      # Name of output directory.
-    ENDIF(USE_TEST_COVERAGE)
-
-    #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -E")
-    MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
-    MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
-  ENDIF(CMAKE_COMPILER_IS_GNUCC)
-ENDIF(UNIX)
-
 IF(${HAVE_SALOME})
     SET(SHAPER_INSTALL_ADDONS bin/salome CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_BIN lib/salome CACHE INTERNAL "" FORCE)
@@ -63,6 +38,8 @@ IF(${HAVE_SALOME})
     SET(SHAPER_INSTALL_XML_RESOURCES share/salome/resources/shaper CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_GUI_DOC share/doc/salome/gui/SHAPER CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_TUI_DOC share/doc/salome/tui/SHAPER CACHE INTERNAL "" FORCE)
+    # without SALOME there is another kind of documentation, separated one
+    ADD_SUBDIRECTORY (doc)
 ELSE(${HAVE_SALOME})
     SET(SHAPER_INSTALL_ADDONS addons CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_BIN bin CACHE INTERNAL "" FORCE)
@@ -77,9 +54,6 @@ ELSE(${HAVE_SALOME})
     SET(SHAPER_INSTALL_TUI_DOC doc CACHE INTERNAL "" FORCE)
 ENDIF(${HAVE_SALOME})
 
-#IF(CMAKE_BUILD_TYPE MATCHES Release)
-ADD_SUBDIRECTORY (doc)
-#ENDIF(CMAKE_BUILD_TYPE MATCHES Release)
 ADD_SUBDIRECTORY (src/Config)
 ADD_SUBDIRECTORY (src/Events)
 ADD_SUBDIRECTORY (src/Model)
@@ -96,6 +70,7 @@ ADD_SUBDIRECTORY (src/ConstructionPlugin)
 ADD_SUBDIRECTORY (src/BuildPlugin)
 ADD_SUBDIRECTORY (src/PrimitivesPlugin)
 ADD_SUBDIRECTORY (src/FeaturesPlugin)
+ADD_SUBDIRECTORY (src/CollectionPlugin)
 ADD_SUBDIRECTORY (src/SamplePanelPlugin)
 ADD_SUBDIRECTORY (src/SketcherPrs)
 ADD_SUBDIRECTORY (src/SketchPlugin)
@@ -117,6 +92,7 @@ ADD_SUBDIRECTORY (src/ConnectorAPI)
 ADD_SUBDIRECTORY (src/ConstructionAPI)
 ADD_SUBDIRECTORY (src/ExchangeAPI)
 ADD_SUBDIRECTORY (src/FeaturesAPI)
+ADD_SUBDIRECTORY (src/CollectionAPI)
 ADD_SUBDIRECTORY (src/ParametersAPI)
 ADD_SUBDIRECTORY (src/PartSetAPI)
 ADD_SUBDIRECTORY (src/PrimitivesAPI)
diff --git a/src/CollectionAPI/CMakeLists.txt b/src/CollectionAPI/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9d43f61
--- /dev/null
@@ -0,0 +1,66 @@
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+  CollectionAPI.h
+  CollectionAPI_Group.h
+)
+
+SET(PROJECT_SOURCES
+  CollectionAPI_Group.cpp
+)
+
+SET(PROJECT_LIBRARIES
+  ModelAPI
+  ModelHighAPI
+)
+
+INCLUDE_DIRECTORIES(
+  ${PROJECT_SOURCE_DIR}/src/Events
+  ${PROJECT_SOURCE_DIR}/src/ModelAPI
+  ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
+)
+
+# Plugin headers dependency
+INCLUDE_DIRECTORIES(
+  ${PROJECT_SOURCE_DIR}/src/GeomAPI
+  ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
+  ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
+  ${PROJECT_SOURCE_DIR}/src/CollectionPlugin
+)
+
+ADD_DEFINITIONS(-DCOLLECTIONAPI_EXPORTS)
+ADD_LIBRARY(CollectionAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(CollectionAPI ${PROJECT_LIBRARIES})
+
+# SWIG wrapper
+
+INCLUDE(PythonAPI)
+
+SET_SOURCE_FILES_PROPERTIES(CollectionAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(CollectionAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+
+SET(SWIG_LINK_LIBRARIES
+  CollectionAPI
+  ModelHighAPI
+  ModelAPI
+  ${PYTHON_LIBRARIES}
+)
+
+SET(SWIG_MODULE_CollectionAPI_EXTRA_DEPS ${SWIG_MODULE_CollectionAPI_EXTRA_DEPS}
+  ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
+  doxyhelp.i
+  ${PROJECT_HEADERS}
+)
+
+SWIG_ADD_MODULE(CollectionAPI python CollectionAPI.i ${PROJECT_HEADERS})
+SWIG_LINK_LIBRARIES(CollectionAPI ${SWIG_LINK_LIBRARIES})
+
+IF(WIN32)
+  SET_TARGET_PROPERTIES(_CollectionAPI PROPERTIES DEBUG_OUTPUT_NAME _CollectionAPI_d)
+ENDIF(WIN32)
+
+INSTALL(TARGETS _CollectionAPI DESTINATION ${SHAPER_INSTALL_SWIG})
+INSTALL(TARGETS CollectionAPI DESTINATION ${SHAPER_INSTALL_BIN})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CollectionAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
diff --git a/src/CollectionAPI/CollectionAPI.h b/src/CollectionAPI/CollectionAPI.h
new file mode 100644 (file)
index 0000000..2b5ff74
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef COLLECTIONAPI_H
+#define COLLECTIONAPI_H
+
+#if defined COLLECTIONAPI_EXPORTS
+#if defined WIN32
+#define COLLECTIONAPI_EXPORT __declspec( dllexport )
+#else
+#define COLLECTIONAPI_EXPORT
+#endif
+#else
+#if defined WIN32
+#define COLLECTIONAPI_EXPORT __declspec( dllimport )
+#else
+#define COLLECTIONAPI_EXPORT
+#endif
+#endif
+
+#endif
diff --git a/src/CollectionAPI/CollectionAPI.i b/src/CollectionAPI/CollectionAPI.i
new file mode 100644 (file)
index 0000000..0fbf143
--- /dev/null
@@ -0,0 +1,33 @@
+/* CollectionAPI.i */
+
+%module CollectionAPI
+
+%{
+#ifndef CollectionAPI_swig_H_
+#define CollectionAPI_swig_H_
+
+  #include <ModelHighAPI_swig.h>
+
+  #include "CollectionAPI.h"
+  #include "CollectionAPI_Group.h"
+
+#endif // CollectionAPI_swig_H_
+%}
+
+%include "doxyhelp.i"
+
+// import other modules
+%import "ModelHighAPI.i"
+
+// to avoid error on this
+#define COLLECTIONAPI_EXPORT
+
+// standard definitions
+%include "typemaps.i"
+%include "std_shared_ptr.i"
+
+// shared pointers
+%shared_ptr(CollectionAPI_Group)
+
+// all supported interfaces
+%include "CollectionAPI_Group.h"
diff --git a/src/CollectionAPI/CollectionAPI_Group.cpp b/src/CollectionAPI/CollectionAPI_Group.cpp
new file mode 100644 (file)
index 0000000..9d9e720
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionAPI_Group.cpp
+// Created:     07 June 2016
+// Author:      Dmitry Bobylev
+
+#include "CollectionAPI_Group.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Integer.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+CollectionAPI_Group::CollectionAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+CollectionAPI_Group::CollectionAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                     const std::list<ModelHighAPI_Selection>& theGroupList)
+: ModelHighAPI_Interface(theFeature)
+{
+  if(initialize()) {
+    setGroupList(theGroupList);
+  }
+}
+
+//==================================================================================================
+CollectionAPI_Group::~CollectionAPI_Group()
+{
+
+}
+
+//==================================================================================================
+void CollectionAPI_Group::setGroupList(const std::list<ModelHighAPI_Selection>& theGroupList)
+{
+  fillAttribute(theGroupList, mygroupList);
+
+  execute();
+}
+
+//==================================================================================================
+void CollectionAPI_Group::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  const std::string& aDocName = theDumper.name(aBase->document());
+
+  AttributeSelectionListPtr anAttrList = aBase->selectionList(CollectionPlugin_Group::LIST_ID());
+
+  theDumper << aBase << " = model.addGroup(" << aDocName << ", " << anAttrList << ")" << std::endl;
+}
+
+//==================================================================================================
+GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
+                  const std::list<ModelHighAPI_Selection>& theGroupList)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(CollectionAPI_Group::ID());
+  return GroupPtr(new CollectionAPI_Group(aFeature, theGroupList));
+}
diff --git a/src/CollectionAPI/CollectionAPI_Group.h b/src/CollectionAPI/CollectionAPI_Group.h
new file mode 100644 (file)
index 0000000..0aeaa8b
--- /dev/null
@@ -0,0 +1,61 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionAPI_Group.h
+// Created:     07 June 2016
+// Author:      Dmitry Bobylev
+
+#ifndef CollectionAPI_Group_H_
+#define CollectionAPI_Group_H_
+
+#include "CollectionAPI.h"
+
+#include <CollectionPlugin_Group.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Dumper;
+class ModelHighAPI_Selection;
+
+/// \class CollectionAPI_Group
+/// \ingroup CPPHighAPI
+/// \brief Interface for Group feature.
+class CollectionAPI_Group: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  COLLECTIONAPI_EXPORT
+  explicit CollectionAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  COLLECTIONAPI_EXPORT
+  CollectionAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                    const std::list<ModelHighAPI_Selection>& theGroupList);
+
+  /// Destructor.
+  COLLECTIONAPI_EXPORT
+  virtual ~CollectionAPI_Group();
+
+  INTERFACE_1(CollectionPlugin_Group::ID(),
+              groupList, CollectionPlugin_Group::LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Group list*/)
+
+  /// Set main objects.
+  COLLECTIONAPI_EXPORT
+  void setGroupList(const std::list<ModelHighAPI_Selection>& theGroupList);
+
+  /// Dump wrapped feature
+  COLLECTIONAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Group object.
+typedef std::shared_ptr<CollectionAPI_Group> GroupPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Group feature.
+COLLECTIONAPI_EXPORT
+GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
+                  const std::list<ModelHighAPI_Selection>& theGroupList);
+
+#endif // CollectionAPI_Group_H_
diff --git a/src/CollectionPlugin/CMakeLists.txt b/src/CollectionPlugin/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c9acd7d
--- /dev/null
@@ -0,0 +1,56 @@
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+INCLUDE(Common)
+INCLUDE(UnitTest)
+
+SET(PROJECT_HEADERS
+    CollectionPlugin.h
+    CollectionPlugin_Plugin.h
+    CollectionPlugin_Group.h
+)
+
+SET(PROJECT_SOURCES
+    CollectionPlugin_Plugin.cpp
+    CollectionPlugin_Group.cpp
+)
+
+SET(XML_RESOURCES
+  plugin-Collection.xml
+  group_widget.xml
+)
+
+SET(TEXT_RESOURCES
+    CollectionPlugin_msg_en.ts
+)
+
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
+
+
+INCLUDE_DIRECTORIES(
+  ../ModelAPI
+  ../GeomAPI
+  ../GeomAlgoAPI
+  ../GeomValidators
+  ../Events
+)
+
+SET(PROJECT_LIBRARIES
+    Events
+    ModelAPI
+    GeomAPI
+    GeomAlgoAPI
+    GeomValidators
+)
+
+ADD_DEFINITIONS(-DCOLLECTIONPLUGIN_EXPORTS)
+ADD_LIBRARY(CollectionPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
+TARGET_LINK_LIBRARIES(CollectionPlugin ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS CollectionPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
+INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
+INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Collection)
+INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
+
+ADD_UNIT_TESTS(
+               TestGroup.py
+)
diff --git a/src/CollectionPlugin/CollectionPlugin.h b/src/CollectionPlugin/CollectionPlugin.h
new file mode 100644 (file)
index 0000000..61e4d71
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+#ifndef COLLECTIONPLUGIN_H
+#define COLLECTIONPLUGIN_H
+
+#if defined COLLECTIONPLUGIN_EXPORTS
+#if defined WIN32
+#define COLLECTIONPLUGIN_EXPORT              __declspec( dllexport )
+#else
+#define COLLECTIONPLUGIN_EXPORT
+#endif
+#else
+#if defined WIN32
+#define COLLECTIONPLUGIN_EXPORT              __declspec( dllimport )
+#else
+#define COLLECTIONPLUGIN_EXPORT
+#endif
+#endif
+
+#endif
diff --git a/src/CollectionPlugin/CollectionPlugin_Group.cpp b/src/CollectionPlugin/CollectionPlugin_Group.cpp
new file mode 100644 (file)
index 0000000..c62b7d0
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionPlugin_Group.cpp
+// Created:     08 Oct 2014
+// Author:      Sergey BELASH
+
+#include "CollectionPlugin_Group.h"
+
+#include <ModelAPI_Data.h>
+#include <ModelAPI_Document.h>
+#include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_AttributeString.h>
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_ResultGroup.h>
+
+CollectionPlugin_Group::CollectionPlugin_Group()
+{
+}
+
+void CollectionPlugin_Group::initAttributes()
+{
+  //data()->addAttribute(CollectionPlugin_Group::NAME_ID(), ModelAPI_AttributeString::typeId());
+  data()->addAttribute(CollectionPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+}
+
+void CollectionPlugin_Group::execute()
+{
+  if (results().empty() || firstResult()->isDisabled()) { // just create result if not exists
+    ResultPtr aGroup = document()->createGroup(data());
+    setResult(aGroup);
+  }
+}
diff --git a/src/CollectionPlugin/CollectionPlugin_Group.h b/src/CollectionPlugin/CollectionPlugin_Group.h
new file mode 100644 (file)
index 0000000..b569ebf
--- /dev/null
@@ -0,0 +1,58 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionPlugin_Group.h
+// Created:     08 Oct 2014
+// Author:      Sergey BELASH
+
+#ifndef COLLECTIONPLUGIN_GROUP_H_
+#define COLLECTIONPLUGIN_GROUP_H_
+
+#include "CollectionPlugin.h"
+#include <ModelAPI_Feature.h>
+#include <GeomAPI_Shape.h>
+
+/**\class CollectionPlugin_Group
+ * \ingroup Plugins
+ * \brief Feature for selection of sub-shapes of some shapes.
+ *
+ * All selected sub-shapes must be of equal type (vertex, edge, face, etc) but may
+ * be selected on different objects.
+ */
+class CollectionPlugin_Group : public ModelAPI_Feature
+{
+ public:
+  /// Extrusion kind
+  inline static const std::string& ID()
+  {
+    static const std::string MY_GROUP_ID("Group");
+    return MY_GROUP_ID;
+  }
+  /// attribute name of selected entities list
+  inline static const std::string& LIST_ID()
+  {
+    static const std::string MY_GROUP_LIST_ID("group_list");
+    return MY_GROUP_LIST_ID;
+  }
+
+  /// Returns the kind of a feature
+  COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = CollectionPlugin_Group::ID();
+    return MY_KIND;
+  }
+
+  /// Creates a new part document if needed
+  COLLECTIONPLUGIN_EXPORT virtual void execute();
+
+  /// Request for initialization of data model of the feature: adding all attributes
+  COLLECTIONPLUGIN_EXPORT virtual void initAttributes();
+
+  /// Result of groups is created on the fly and don't stored to the document
+  COLLECTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return true;}
+
+  /// Use plugin manager for features creation
+  CollectionPlugin_Group();
+
+};
+
+#endif
diff --git a/src/CollectionPlugin/CollectionPlugin_Plugin.cpp b/src/CollectionPlugin/CollectionPlugin_Plugin.cpp
new file mode 100644 (file)
index 0000000..87c0dda
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+#include <CollectionPlugin_Plugin.h>
+
+#include <CollectionPlugin_Group.h>
+#include <ModelAPI_Session.h>
+
+#include <string>
+#include <memory>
+
+// the only created instance of this plugin
+static CollectionPlugin_Plugin* MY_COLLECTION_INSTANCE = new CollectionPlugin_Plugin();
+
+CollectionPlugin_Plugin::CollectionPlugin_Plugin()
+{
+  SessionPtr aMgr = ModelAPI_Session::get();
+  // register this plugin
+  ModelAPI_Session::get()->registerPlugin(this);
+}
+
+FeaturePtr CollectionPlugin_Plugin::createFeature(std::string theFeatureID)
+{
+  if (theFeatureID == CollectionPlugin_Group::ID()) {
+    return FeaturePtr(new CollectionPlugin_Group);
+  }
+
+  // feature of such kind is not found
+  return FeaturePtr();
+}
diff --git a/src/CollectionPlugin/CollectionPlugin_Plugin.h b/src/CollectionPlugin/CollectionPlugin_Plugin.h
new file mode 100644 (file)
index 0000000..383fe59
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionPlugin_Plugin.hxx
+// Created:     07 July 2014
+// Author:      Vitaly SMETANNIKOV
+
+#ifndef CollectionPlugin_Plugin_H_
+#define CollectionPlugin_Plugin_H_
+
+#include "CollectionPlugin.h"
+#include <ModelAPI_Plugin.h>
+#include <ModelAPI_Feature.h>
+
+/**\class CollectionPlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class for management the 3D features as plugin.
+ */
+class COLLECTIONPLUGIN_EXPORT CollectionPlugin_Plugin : public ModelAPI_Plugin
+{
+ public:
+  /// Creates the feature object of this plugin by the feature string ID
+  virtual FeaturePtr createFeature(std::string theFeatureID);
+
+ public:
+  /// Default constructor
+  CollectionPlugin_Plugin();
+};
+
+#endif
diff --git a/src/CollectionPlugin/CollectionPlugin_msg_en.ts b/src/CollectionPlugin/CollectionPlugin_msg_en.ts
new file mode 100644 (file)
index 0000000..4e73b5b
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+
+  <context>
+    <name>Group</name>
+    <message>
+      <source>group_list - GeomValidators_BodyShapes: Error: Context is empty.</source>
+      <translation>Selected object has empty context.</translation>
+    </message>
+    <message>
+      <source>group_list - GeomValidators_BodyShapes: Error: Result construction selected.</source>
+      <translation>Constructions not allowed for selection.</translation>
+    </message>
+    <message>
+      <source>group_list - GeomValidators_BodyShapes: Error: Attribute \"%1\" does not supported by this validator.</source>
+      <translation>Attribute "%1" does not supported by "GeomValidators_BodyShapes" validator.</translation>
+    </message>
+    
+    <message>
+      <source>Model_FeatureValidator: Attribute "group_list" is not initialized.</source>
+      <translation>Objects not selected.</translation>
+    </message>
+  </context>
+
+</TS>
diff --git a/src/CollectionPlugin/Test/TestGroup.py b/src/CollectionPlugin/Test/TestGroup.py
new file mode 100644 (file)
index 0000000..139d412
--- /dev/null
@@ -0,0 +1,247 @@
+"""
+      TestBoolean.py
+      Unit test of FeaturesPlugin_Group class
+
+      class FeaturesPlugin_Group
+        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::typeId());
+"""
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+# Create a part for extrusions & boolean
+aSession.startOperation()
+aPartFeature = aSession.moduleDocument().addFeature("Part")
+aSession.finishOperation()
+aPart = aSession.activeDocument()
+#=========================================================================
+# Create a sketch with triangle and extrude it
+#=========================================================================
+aSession.startOperation()
+aTriangleSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aSketchLineA = aTriangleSketchFeature.addFeature("SketchLine")
+aSketchLineB = aTriangleSketchFeature.addFeature("SketchLine")
+aSketchLineC = aTriangleSketchFeature.addFeature("SketchLine")
+aLineAStartPoint = geomDataAPI_Point2D(aSketchLineA.attribute("StartPoint"))
+aLineAEndPoint = geomDataAPI_Point2D(aSketchLineA.attribute("EndPoint"))
+aLineBStartPoint = geomDataAPI_Point2D(aSketchLineB.attribute("StartPoint"))
+aLineBEndPoint = geomDataAPI_Point2D(aSketchLineB.attribute("EndPoint"))
+aLineCStartPoint = geomDataAPI_Point2D(aSketchLineC.attribute("StartPoint"))
+aLineCEndPoint = geomDataAPI_Point2D(aSketchLineC.attribute("EndPoint"))
+aLineAStartPoint.setValue(-100., 0.)
+aLineAEndPoint.setValue(100., 0.)
+aLineBStartPoint.setValue(100., 0.)
+aLineBEndPoint.setValue(0., 173.2)
+aLineCStartPoint.setValue(0., 173.2)
+aLineCEndPoint.setValue(-100., 0.)
+aSession.finishOperation()
+# Build sketch faces
+aSession.startOperation()
+aSketchResult = aTriangleSketchFeature.firstResult()
+aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
+origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin")).pnt()
+dirX = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX")).dir()
+norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm")).dir()
+aSketchFaces = ShapeList()
+GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aSketchEdges, aSketchFaces)
+# Create extrusion on them
+anExtrusionFt = aPart.addFeature("Extrusion")
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[0])
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(50)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+anExtrusionBody = modelAPI_ResultBody(anExtrusionFt.firstResult())
+#=========================================================================
+# Create group of vertex
+#=========================================================================
+aSession.startOperation()
+aGroupFeature = aSession.activeDocument().addFeature("Group")
+aSelectionListAttr = aGroupFeature.selectionList("group_list")
+aSelectionListAttr.setSelectionType("vertex")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
+aSession.finishOperation()
+#=========================================================================
+# Check results
+#=========================================================================
+assert(aSelectionListAttr.size() == 6)
+aGroupResult = aGroupFeature.firstResult()
+assert(aGroupResult)
+#=========================================================================
+# Create group of edges
+#=========================================================================
+aSession.startOperation()
+aGroupFeature = aSession.activeDocument().addFeature("Group")
+aSelectionListAttr = aGroupFeature.selectionList("group_list")
+aSelectionListAttr.setSelectionType("edge")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1_1")
+aSession.finishOperation()
+#=========================================================================
+# Check results
+#=========================================================================
+assert(aSelectionListAttr.size() == 9)
+aGroupResult = aGroupFeature.firstResult()
+assert(aGroupResult)
+#=========================================================================
+# Create group of faces
+#=========================================================================
+aSession.startOperation()
+aGroupFeature = aSession.activeDocument().addFeature("Group")
+aSelectionListAttr = aGroupFeature.selectionList("group_list")
+aSelectionListAttr.setSelectionType("face")
+aShapeExplorer = GeomAPI_ShapeExplorer(anExtrusionBody.shape(), GeomAPI_Shape.FACE)
+while aShapeExplorer.more():
+  aSelectionListAttr.append(anExtrusionBody, aShapeExplorer.current())
+  aShapeExplorer.next();
+aSession.finishOperation()
+#=========================================================================
+# Check results
+#=========================================================================
+assert(aSelectionListAttr.size() == 5)
+aGroupResult = aGroupFeature.firstResult()
+assert(aGroupResult)
+#=========================================================================
+# Create group of solids
+#=========================================================================
+aSession.startOperation()
+aGroupFeature = aSession.activeDocument().addFeature("Group")
+aSelectionListAttr = aGroupFeature.selectionList("group_list")
+aSelectionListAttr.setSelectionType("face")
+aSelectionListAttr.append(anExtrusionBody, None)
+aSession.finishOperation()
+#=========================================================================
+# Check results
+#=========================================================================
+assert(aSelectionListAttr.size() == 1)
+aGroupResult = aGroupFeature.firstResult()
+assert(aGroupResult)
+
+#=========================================================================
+# Create group of face
+#=========================================================================
+aSession.startOperation()
+aGroupFeature = aSession.activeDocument().addFeature("Group")
+aSelectionListAttr = aGroupFeature.selectionList("group_list")
+aSelectionListAttr.setSelectionType("face")
+aSelectionListAttr.append("Extrusion_1_1/To_Face_1_1")
+aSession.finishOperation()
+#=========================================================================
+# Check results
+#=========================================================================
+assert(aSelectionListAttr.size() == 1)
+aGroupResult = aGroupFeature.firstResult()
+assert(aGroupResult)
+
+#=========================================================================
+# Create a sketch circle to extrude
+#=========================================================================
+aSession.startOperation()
+aCircleSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+# Create circle
+aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
+anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
+aCircleRadius = aSketchCircle.real("CircleRadius")
+anCircleCentr.setValue(0., 57.74)
+aCircleRadius.setValue(50.)
+aSession.finishOperation()
+#=========================================================================
+# Make extrusion on circle
+#=========================================================================
+# Build shape from sketcher results
+aCircleSketchResult = aCircleSketchFeature.firstResult()
+aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
+origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
+dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
+norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
+aCircleSketchFaces = ShapeList()
+GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
+assert(len(aCircleSketchFaces) > 0)
+assert(aCircleSketchFaces[0] is not None)
+# Create extrusion
+aSession.startOperation()
+anExtrusionFt = aPart.addFeature("Extrusion")
+assert (anExtrusionFt.getKind() == "Extrusion")
+# selection type FACE=4
+anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchFaces[0])
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(50)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+aCylinderBody = modelAPI_ResultBody(anExtrusionFt.firstResult())
+
+#=========================================================================
+# Create a cut
+#=========================================================================
+aSession.startOperation()
+aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt.selectionList("main_objects").append(anExtrusionBody, None)
+aBooleanFt.selectionList("tool_objects").append(aCylinderBody, None)
+aBooleanTypeCut = 0
+aBooleanFt.integer("bool_type").setValue(aBooleanTypeCut)
+aBooleanFt.execute()
+aSession.finishOperation()
+
+#=========================================================================
+# Move group feature
+#=========================================================================
+aSession.startOperation()
+aPart.moveFeature(aGroupFeature, aBooleanFt)
+aSession.finishOperation()
+
+#=========================================================================
+# Check results
+#=========================================================================
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(aGroupFeature))
+assert(aSelectionListAttr.size() == 1)
+assert(len(aGroupFeature.results()) > 0)
+aGroupResult = aGroupFeature.firstResult()
+assert(aGroupResult)
+assert(aGroupResult.shape())
+#=========================================================================
+# End of test
+#=========================================================================
+
+import model
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/group_widget.xml b/src/CollectionPlugin/group_widget.xml
new file mode 100644 (file)
index 0000000..6192e98
--- /dev/null
@@ -0,0 +1,11 @@
+<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+<source>
+  <multi_selector id="group_list"
+    tooltip="Select a set of objects"
+    type_choice="Vertices Edges Faces Solids"
+    use_choice="true"
+    clear_in_neutral_point="false">
+    <validator id="GeomValidators_BodyShapes"/>
+  </multi_selector>
+</source>
\ No newline at end of file
diff --git a/src/CollectionPlugin/icons/shape_group.png b/src/CollectionPlugin/icons/shape_group.png
new file mode 100644 (file)
index 0000000..a00d1a2
Binary files /dev/null and b/src/CollectionPlugin/icons/shape_group.png differ
diff --git a/src/CollectionPlugin/plugin-Collection.xml b/src/CollectionPlugin/plugin-Collection.xml
new file mode 100644 (file)
index 0000000..09bc12b
--- /dev/null
@@ -0,0 +1,14 @@
+<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+<plugin>
+  <workbench id="Features" document="Part">
+    <group id="Collections">
+      <feature id="Group"
+        title="Group"
+        tooltip="Create named collection of geometry entities"
+        icon="icons/Collection/shape_group.png">
+        <source path="group_widget.xml"/>
+      </feature>
+    </group>
+  </workbench>
+</plugin>
index 54a02fdfff5ad7250333d99de8e67ce114eaee3e..9f654a7b0ba6fe66f9094a3a5ba8f5308fd3110f 100644 (file)
@@ -9,6 +9,7 @@
   <plugin library="BuildPlugin" configuration="plugin-Build.xml"/>
   <plugin library="PrimitivesPlugin" configuration="plugin-Primitives.xml"/>
   <plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
+  <plugin library="CollectionPlugin" configuration="plugin-Collection.xml"/>
   <plugin library="ExchangePlugin" configuration="plugin-Exchange.xml"/>
   <plugin script="addons_Features" configuration="addons_Features.xml"/>
   <plugin script="ConnectorPlugin" configuration="plugin-Connector.xml" dependency="Geometry"/>
index 2f504c2c5191e30d674372c54a0d70ac5f2eabf7..13e7e956269153dae1dc1b6963af6a46d88db7c5 100644 (file)
@@ -31,8 +31,6 @@
 #include <iostream>
 #endif
 
-using namespace std;
-
 static const double defaultAxisSize = 100;
 
 ConstructionPlugin_Axis::ConstructionPlugin_Axis()
index 40c016f503f7ef4ef101183ba8a0b5eb341f7389..4c20ecd892370b5306082d94e9935b1e38f8d735 100644 (file)
@@ -11,8 +11,6 @@
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Document.h>
 
-using namespace std;
-
 // the only created instance of this plugin
 static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin();
 
@@ -42,7 +40,7 @@ ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
                                    Config_Prop::Color, ConstructionPlugin_Plane::DEFAULT_COLOR());
 }
 
-FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr ConstructionPlugin_Plugin::createFeature(std::string theFeatureID)
 {
   if (theFeatureID == ConstructionPlugin_Point::ID()) {
     return FeaturePtr(new ConstructionPlugin_Point);
index 5982c15de2d533f490583cab92b85e71c90b60e7..a51b4ecbdde713d6efa756af1a98044337e4549c 100644 (file)
@@ -12,7 +12,7 @@ SET(PROJECT_HEADERS
     Events_Listener.h
     Events_Loop.h
     Events_LongOp.h
-       Events_InfoMessage.h
+    Events_InfoMessage.h
 )
 
 SET(PROJECT_SOURCES
@@ -21,7 +21,7 @@ SET(PROJECT_SOURCES
     Events_Listener.cpp
     Events_Loop.cpp
     Events_LongOp.cpp
-       Events_InfoMessage.cpp
+    Events_InfoMessage.cpp
 )
 
 ADD_DEFINITIONS(-DEVENTS_EXPORTS)
index eaaf57be809fbd0af2ed9812dd79848bd603ceef..cd2e65f92608a33f7c370116a1efd20e88f3dcec 100644 (file)
@@ -10,8 +10,6 @@
 #include <string>
 #include <cstring>
 
-using namespace std;
-
 Events_Loop* Events_Loop::loop()
 {
   // initialized on initialization of the application
@@ -22,10 +20,10 @@ Events_Loop* Events_Loop::loop()
 Events_ID Events_Loop::eventByName(const char* theName)
 {
   ///! All events created in this session, uniquely identified by the text and char pointer
-  static map<string, char*> CREATED_EVENTS;
+  static std::map<std::string, char*> CREATED_EVENTS;
   char* aResult;
-  string aName(theName);
-  map<string, char*>::iterator aFound = CREATED_EVENTS.find(aName);
+  std::string aName(theName);
+  std::map<std::string, char*>::iterator aFound = CREATED_EVENTS.find(aName);
   if (aFound == CREATED_EVENTS.end()) {  //not created yet
 #ifdef WIN32
     aResult = _strdup(theName);  // copy to make unique internal pointer
@@ -42,7 +40,8 @@ Events_ID Events_Loop::eventByName(const char* theName)
 void Events_Loop::sendProcessEvent(const std::shared_ptr<Events_Message>& theMessage,
   std::list<Events_Listener*>& theListeners, const bool theFlushedNow)
 {
-  for (list<Events_Listener*>::iterator aL = theListeners.begin(); aL != theListeners.end(); aL++) {
+  std::list<Events_Listener*>::iterator aL = theListeners.begin();
+  for (; aL != theListeners.end(); aL++) {
     if (theFlushedNow && (*aL)->groupMessages()) {
       (*aL)->groupWhileFlush(theMessage);
     } else {
@@ -75,10 +74,10 @@ void Events_Loop::send(const std::shared_ptr<Events_Message>& theMessage, bool i
     }
   }
   // send
-  map<char*, map<void*, list<Events_Listener*> > >::iterator aFindID = myListeners.find(
-      theMessage->eventID().eventText());
+  std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID = 
+    myListeners.find(theMessage->eventID().eventText());
   if (aFindID != myListeners.end()) {
-    map<void*, list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(
+    std::map<void*, std::list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(
         theMessage->sender());
     if (aFindSender != aFindID->second.end()) {
       sendProcessEvent(theMessage, aFindSender->second, isFlushedNow && isGroup);
@@ -99,21 +98,22 @@ void Events_Loop::registerListener(Events_Listener* theListener, const Events_ID
     myImmediateListeners[theID.eventText()] = theListener;
     return;
   }
-  map<char*, map<void*, list<Events_Listener*> > >::iterator aFindID = myListeners.find(
-      theID.eventText());
+  std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID = 
+    myListeners.find(theID.eventText());
   if (aFindID == myListeners.end()) {  // create container associated with ID
-    myListeners[theID.eventText()] = map<void*, list<Events_Listener*> >();
+    myListeners[theID.eventText()] = std::map<void*, std::list<Events_Listener*> >();
     aFindID = myListeners.find(theID.eventText());
   }
 
-  map<void*, list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(theSender);
+  std::map<void*, std::list<Events_Listener*> >::iterator aFindSender = 
+    aFindID->second.find(theSender);
   if (aFindSender == aFindID->second.end()) {  // create container associated with sender
-    aFindID->second[theSender] = list<Events_Listener*>();
+    aFindID->second[theSender] = std::list<Events_Listener*>();
     aFindSender = aFindID->second.find(theSender);
   }
   // check that listener was not registered wit hsuch parameters before
-  list<Events_Listener*>& aListeners = aFindSender->second;
-  for (list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
+  std::list<Events_Listener*>& aListeners = aFindSender->second;
+  for (std::list<Events_Listener*>::iterator aL = aListeners.begin(); aL != aListeners.end(); aL++)
     if (*aL == theListener)
       return;  // avoid duplicates
 
@@ -191,12 +191,13 @@ void Events_Loop::flush(const Events_ID& theID)
       }
     }
     // send accumulated messages to "groupListeners"
-    map<char*, map<void*, list<Events_Listener*> > >::iterator aFindID = myListeners.find(
-      theID.eventText());
+    std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID = 
+      myListeners.find(theID.eventText());
     if (aFindID != myListeners.end()) {
-      map<void*, list<Events_Listener*> >::iterator aFindSender = aFindID->second.begin();
+      std::map<void*, std::list<Events_Listener*> >::iterator aFindSender =
+        aFindID->second.begin();
       for(; aFindSender != aFindID->second.end(); aFindSender++) {
-        list<Events_Listener*>::iterator aListener = aFindSender->second.begin();
+        std::list<Events_Listener*>::iterator aListener = aFindSender->second.begin();
         for(; aListener != aFindSender->second.end(); aListener++) {
           if ((*aListener)->groupMessages()) {
             (*aListener)->flushGrouped(theID);
index af30181453b3be8b09cf07992c475931c73ed6f2..08dcb202b1051b9fff7a333998b481ebe51c9d47 100644 (file)
@@ -17,8 +17,6 @@
 
 #include <memory>
 
-using namespace std;
-
 // the only created instance of this plugin
 static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
 
@@ -34,7 +32,7 @@ ExchangePlugin_Plugin::ExchangePlugin_Plugin()
                               new ExchangePlugin_ExportFormatValidator);
 }
 
-FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr ExchangePlugin_Plugin::createFeature(std::string theFeatureID)
 {
   if (theFeatureID == ExchangePlugin_ImportFeature::ID()) {
     return FeaturePtr(new ExchangePlugin_ImportFeature);
index 70ea1166d1cc9a8d8dd4b2569cd17d97da963e8a..3f4e5fe9a4e25d0cb2a5f411041f3397df3bf037 100644 (file)
@@ -7,7 +7,6 @@ SET(PROJECT_HEADERS
   FeaturesAPI_Boolean.h
   FeaturesAPI_Extrusion.h
   FeaturesAPI_ExtrusionBoolean.h
-  FeaturesAPI_Group.h
   FeaturesAPI_Intersection.h
   FeaturesAPI_Partition.h
   FeaturesAPI_Pipe.h
@@ -25,7 +24,6 @@ SET(PROJECT_SOURCES
   FeaturesAPI_Boolean.cpp
   FeaturesAPI_Extrusion.cpp
   FeaturesAPI_ExtrusionBoolean.cpp
-  FeaturesAPI_Group.cpp
   FeaturesAPI_Intersection.cpp
   FeaturesAPI_Partition.cpp
   FeaturesAPI_Pipe.cpp
@@ -58,8 +56,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/FeaturesPlugin
 )
 
-#TODO(spo): is ${CAS_DEFINITIONS} necessary?
-ADD_DEFINITIONS(-DFEATURESAPI_EXPORTS ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(-DFEATURESAPI_EXPORTS)
 ADD_LIBRARY(FeaturesAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 TARGET_LINK_LIBRARIES(FeaturesAPI ${PROJECT_LIBRARIES})
 
@@ -70,7 +67,6 @@ INCLUDE(PythonAPI)
 SET_SOURCE_FILES_PROPERTIES(FeaturesAPI.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(FeaturesAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 
-#TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
 SET(SWIG_LINK_LIBRARIES
   FeaturesAPI
   ModelHighAPI
@@ -94,11 +90,3 @@ ENDIF(WIN32)
 INSTALL(TARGETS _FeaturesAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS FeaturesAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/FeaturesAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
-
-# Tests
-INCLUDE(UnitTest)
-
-ADD_UNIT_TESTS(
-)
-
-# ADD_SUBDIRECTORY (Test)
index cc7cbdd54b18dc6d4553d9855ce800624bbb91e9..7a8a5562830680fe0cf3b024cef1ae291c65fa59 100644 (file)
@@ -24,7 +24,6 @@
 %shared_ptr(FeaturesAPI_ExtrusionBoolean)
 %shared_ptr(FeaturesAPI_ExtrusionCut)
 %shared_ptr(FeaturesAPI_ExtrusionFuse)
-%shared_ptr(FeaturesAPI_Group)
 %shared_ptr(FeaturesAPI_Intersection)
 %shared_ptr(FeaturesAPI_Partition)
 %shared_ptr(FeaturesAPI_Pipe)
@@ -43,7 +42,6 @@
 %include "FeaturesAPI_Boolean.h"
 %include "FeaturesAPI_Extrusion.h"
 %include "FeaturesAPI_ExtrusionBoolean.h"
-%include "FeaturesAPI_Group.h"
 %include "FeaturesAPI_Intersection.h"
 %include "FeaturesAPI_Partition.h"
 %include "FeaturesAPI_Pipe.h"
diff --git a/src/FeaturesAPI/FeaturesAPI_Group.cpp b/src/FeaturesAPI/FeaturesAPI_Group.cpp
deleted file mode 100644 (file)
index d12e73f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        FeaturesAPI_Group.cpp
-// Created:     07 June 2016
-// Author:      Dmitry Bobylev
-
-#include "FeaturesAPI_Group.h"
-
-#include <ModelHighAPI_Dumper.h>
-#include <ModelHighAPI_Integer.h>
-#include <ModelHighAPI_Selection.h>
-#include <ModelHighAPI_Tools.h>
-
-//==================================================================================================
-FeaturesAPI_Group::FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature)
-: ModelHighAPI_Interface(theFeature)
-{
-  initialize();
-}
-
-//==================================================================================================
-FeaturesAPI_Group::FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                     const std::list<ModelHighAPI_Selection>& theGroupList)
-: ModelHighAPI_Interface(theFeature)
-{
-  if(initialize()) {
-    setGroupList(theGroupList);
-  }
-}
-
-//==================================================================================================
-FeaturesAPI_Group::~FeaturesAPI_Group()
-{
-
-}
-
-//==================================================================================================
-void FeaturesAPI_Group::setGroupList(const std::list<ModelHighAPI_Selection>& theGroupList)
-{
-  fillAttribute(theGroupList, mygroupList);
-
-  execute();
-}
-
-//==================================================================================================
-void FeaturesAPI_Group::dump(ModelHighAPI_Dumper& theDumper) const
-{
-  FeaturePtr aBase = feature();
-  const std::string& aDocName = theDumper.name(aBase->document());
-
-  AttributeSelectionListPtr anAttrList = aBase->selectionList(FeaturesPlugin_Group::LIST_ID());
-
-  theDumper << aBase << " = model.addGroup(" << aDocName << ", " << anAttrList << ")" << std::endl;
-}
-
-//==================================================================================================
-GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
-                  const std::list<ModelHighAPI_Selection>& theGroupList)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Group::ID());
-  return GroupPtr(new FeaturesAPI_Group(aFeature, theGroupList));
-}
diff --git a/src/FeaturesAPI/FeaturesAPI_Group.h b/src/FeaturesAPI/FeaturesAPI_Group.h
deleted file mode 100644 (file)
index f4d2dd1..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        FeaturesAPI_Group.h
-// Created:     07 June 2016
-// Author:      Dmitry Bobylev
-
-#ifndef FeaturesAPI_Group_H_
-#define FeaturesAPI_Group_H_
-
-#include "FeaturesAPI.h"
-
-#include <FeaturesPlugin_Group.h>
-
-#include <ModelHighAPI_Interface.h>
-#include <ModelHighAPI_Macro.h>
-
-class ModelHighAPI_Dumper;
-class ModelHighAPI_Selection;
-
-/// \class FeaturesAPI_Group
-/// \ingroup CPPHighAPI
-/// \brief Interface for Group feature.
-class FeaturesAPI_Group: public ModelHighAPI_Interface
-{
-public:
-  /// Constructor without values.
-  FEATURESAPI_EXPORT
-  explicit FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature);
-
-  /// Constructor with values.
-  FEATURESAPI_EXPORT
-  FeaturesAPI_Group(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                    const std::list<ModelHighAPI_Selection>& theGroupList);
-
-  /// Destructor.
-  FEATURESAPI_EXPORT
-  virtual ~FeaturesAPI_Group();
-
-  INTERFACE_1(FeaturesPlugin_Group::ID(),
-              groupList, FeaturesPlugin_Group::LIST_ID(),
-              ModelAPI_AttributeSelectionList, /** Group list*/)
-
-  /// Set main objects.
-  FEATURESAPI_EXPORT
-  void setGroupList(const std::list<ModelHighAPI_Selection>& theGroupList);
-
-  /// Dump wrapped feature
-  FEATURESAPI_EXPORT
-  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
-};
-
-/// Pointer on Group object.
-typedef std::shared_ptr<FeaturesAPI_Group> GroupPtr;
-
-/// \ingroup CPPHighAPI
-/// \brief Create Group feature.
-FEATURESAPI_EXPORT
-GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
-                  const std::list<ModelHighAPI_Selection>& theGroupList);
-
-#endif // FeaturesAPI_Group_H_
index 8fff1a42b580a2d93da1a5053a3182f02861aa75..6e25cbad6b230c1b3784b2509d9a6db48494a104 100644 (file)
@@ -13,7 +13,6 @@
   #include "FeaturesAPI_Boolean.h"
   #include "FeaturesAPI_Extrusion.h"
   #include "FeaturesAPI_ExtrusionBoolean.h"
-  #include "FeaturesAPI_Group.h"
   #include "FeaturesAPI_Intersection.h"
   #include "FeaturesAPI_Partition.h"
   #include "FeaturesAPI_Pipe.h"
index 61eddab92624b71461d38670fe47ae8a9c6f3efb..34a303c083e3104bdc1070899506c509935c1ed8 100644 (file)
@@ -12,7 +12,6 @@ SET(PROJECT_HEADERS
     FeaturesPlugin_Rotation.h
     FeaturesPlugin_Translation.h
     FeaturesPlugin_Boolean.h
-    FeaturesPlugin_Group.h
     FeaturesPlugin_Intersection.h
     FeaturesPlugin_Partition.h
     FeaturesPlugin_Pipe.h
@@ -39,7 +38,6 @@ SET(PROJECT_SOURCES
     FeaturesPlugin_Rotation.cpp
     FeaturesPlugin_Translation.cpp
     FeaturesPlugin_Boolean.cpp
-    FeaturesPlugin_Group.cpp
     FeaturesPlugin_Intersection.cpp
     FeaturesPlugin_Partition.cpp
     FeaturesPlugin_Pipe.cpp
@@ -69,7 +67,6 @@ SET(XML_RESOURCES
   rotation_widget.xml
   translation_widget.xml
   boolean_widget.xml
-  group_widget.xml
   recover_widget.xml
   partition_widget.xml
   placement_widget.xml
@@ -128,7 +125,6 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanFill.py
                TestMultiBoolean.py
                TestSerialBoolean.py
-               TestGroup.py
                TestIntersection.py
                TestUnion.py
                TestRemoveSubShapes.py
diff --git a/src/FeaturesPlugin/FeaturesPlugin_Group.cpp b/src/FeaturesPlugin/FeaturesPlugin_Group.cpp
deleted file mode 100644 (file)
index 182a1d7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        FeaturesPlugin_Group.cpp
-// Created:     08 Oct 2014
-// Author:      Sergey BELASH
-
-#include "FeaturesPlugin_Group.h"
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeInteger.h>
-#include <ModelAPI_AttributeString.h>
-#include <ModelAPI_AttributeSelectionList.h>
-#include <ModelAPI_ResultGroup.h>
-
-
-using namespace std;
-
-FeaturesPlugin_Group::FeaturesPlugin_Group()
-{
-}
-
-void FeaturesPlugin_Group::initAttributes()
-{
-  //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::typeId());
-  data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
-}
-
-void FeaturesPlugin_Group::execute()
-{
-  if (results().empty() || firstResult()->isDisabled()) { // just create result if not exists
-    ResultPtr aGroup = document()->createGroup(data());
-    setResult(aGroup);
-  }
-}
diff --git a/src/FeaturesPlugin/FeaturesPlugin_Group.h b/src/FeaturesPlugin/FeaturesPlugin_Group.h
deleted file mode 100644 (file)
index 50f8233..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        FeaturesPlugin_Group.h
-// Created:     08 Oct 2014
-// Author:      Sergey BELASH
-
-#ifndef FEATURESPLUGIN_GROUP_H_
-#define FEATURESPLUGIN_GROUP_H_
-
-#include "FeaturesPlugin.h"
-#include <ModelAPI_Feature.h>
-#include <GeomAPI_Shape.h>
-
-/**\class FeaturesPlugin_Group
- * \ingroup Plugins
- * \brief Feature for selection of sub-shapes of some shapes.
- *
- * All selected sub-shapes must be of equal type (vertex, edge, face, etc) but may
- * be selected on different objects.
- */
-class FeaturesPlugin_Group : public ModelAPI_Feature
-{
- public:
-  /// Extrusion kind
-  inline static const std::string& ID()
-  {
-    static const std::string MY_GROUP_ID("Group");
-    return MY_GROUP_ID;
-  }
-  /// attribute name of selected entities list
-  inline static const std::string& LIST_ID()
-  {
-    static const std::string MY_GROUP_LIST_ID("group_list");
-    return MY_GROUP_LIST_ID;
-  }
-
-  /// Returns the kind of a feature
-  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
-  {
-    static std::string MY_KIND = FeaturesPlugin_Group::ID();
-    return MY_KIND;
-  }
-
-  /// Creates a new part document if needed
-  FEATURESPLUGIN_EXPORT virtual void execute();
-
-  /// Request for initialization of data model of the feature: adding all attributes
-  FEATURESPLUGIN_EXPORT virtual void initAttributes();
-
-  /// Result of groups is created on the fly and don't stored to the document
-  FEATURESPLUGIN_EXPORT virtual bool isPersistentResult() {return true;}
-
-  /// Use plugin manager for features creation
-  FeaturesPlugin_Group();
-
-};
-
-#endif
index c4049c0e25dd22ac3ace535c54f5041f7c1e9a50..a602a866f13ed57947021155a9d7ec7851a31922 100644 (file)
@@ -6,7 +6,6 @@
 #include <FeaturesPlugin_Extrusion.h>
 #include <FeaturesPlugin_ExtrusionCut.h>
 #include <FeaturesPlugin_ExtrusionFuse.h>
-#include <FeaturesPlugin_Group.h>
 #include <FeaturesPlugin_Intersection.h>
 #include <FeaturesPlugin_Translation.h>
 #include <FeaturesPlugin_Partition.h>
@@ -28,8 +27,6 @@
 
 #include <memory>
 
-using namespace std;
-
 // the only created instance of this plugin
 static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin();
 
@@ -68,7 +65,7 @@ FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
   ModelAPI_Session::get()->registerPlugin(this);
 }
 
-FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID)
 {
   if (theFeatureID == FeaturesPlugin_Extrusion::ID()) {
     return FeaturePtr(new FeaturesPlugin_Extrusion);
@@ -80,8 +77,6 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
     return FeaturePtr(new FeaturesPlugin_Translation);
   } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
     return FeaturePtr(new FeaturesPlugin_Boolean);
-  } else if (theFeatureID == FeaturesPlugin_Group::ID()) {
-    return FeaturePtr(new FeaturesPlugin_Group);
   } else if (theFeatureID == FeaturesPlugin_Intersection::ID()) {
     return FeaturePtr(new FeaturesPlugin_Intersection);
   } else if (theFeatureID == FeaturesPlugin_Partition::ID()) {
index 59a2526ca7b1c359250c4ba782151abf9ec607cf..e521c3a296f4fb00d9a6fc1817c385df66313446 100644 (file)
@@ -16,8 +16,6 @@
 #include <ModelAPI_Result.h>
 #include <ModelAPI_Tools.h>
 
-using namespace std;
-
 FeaturesPlugin_Recover::FeaturesPlugin_Recover()
 {
 }
index fc2a2a3ca34e226c8887e3aafc23c45a6b3fd212..eaf0e9ff7ce8f49f9e09c4c440951fae1b470090 100644 (file)
     </message>
   </context>
   
-  <context>
-    <name>Group</name>
-    <message>
-      <source>group_list - GeomValidators_BodyShapes: Error: Context is empty.</source>
-      <translation>Selected object has empty context.</translation>
-    </message>
-    <message>
-      <source>group_list - GeomValidators_BodyShapes: Error: Result construction selected.</source>
-      <translation>Constructions not allowed for selection.</translation>
-    </message>
-    <message>
-      <source>group_list - GeomValidators_BodyShapes: Error: Attribute \"%1\" does not supported by this validator.</source>
-      <translation>Attribute "%1" does not supported by "GeomValidators_BodyShapes" validator.</translation>
-    </message>
-    
-    <message>
-      <source>Model_FeatureValidator: Attribute "group_list" is not initialized.</source>
-      <translation>Objects not selected.</translation>
-    </message>
-  </context>
-
   <context>
     <name>Union</name>
     <message>
diff --git a/src/FeaturesPlugin/group_widget.xml b/src/FeaturesPlugin/group_widget.xml
deleted file mode 100644 (file)
index 6192e98..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-<source>
-  <multi_selector id="group_list"
-    tooltip="Select a set of objects"
-    type_choice="Vertices Edges Faces Solids"
-    use_choice="true"
-    clear_in_neutral_point="false">
-    <validator id="GeomValidators_BodyShapes"/>
-  </multi_selector>
-</source>
\ No newline at end of file
diff --git a/src/FeaturesPlugin/icons/shape_group.png b/src/FeaturesPlugin/icons/shape_group.png
deleted file mode 100644 (file)
index a00d1a2..0000000
Binary files a/src/FeaturesPlugin/icons/shape_group.png and /dev/null differ
index cd08911d61c63b139e11dea127117ad2ef9b3eb1..b7f98d6ae3ef6c3663daf4d45b790f020a153988 100644 (file)
       </feature>
     </group>
     <group id="Collections">
-      <feature id="Group"
-        title="Group"
-        tooltip="Create named collection of geometry entities"
-        icon="icons/Features/shape_group.png">
-        <source path="group_widget.xml"/>
-      </feature>
       <feature id="Recover"
         title="Recover"
         tooltip="Visualize concealed objects"
index e71acbbe0b25b137b21f35e7565ab311671d0f19..977616ffa8e298a298f35e5434163dda278ec77c 100644 (file)
@@ -9,8 +9,6 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
 #include <TopoDS_Shape.hxx>
-using namespace std;
-
 
 GeomAPI_DataMapOfShapeShape::GeomAPI_DataMapOfShapeShape()
 : GeomAPI_Interface(new TopTools_DataMapOfShapeShape){}
index ba5960e876fc082a2aab11ca7674b4c4cb816804..3f3e44a7ef54ce62e958db08f71f20627ca677fc 100644 (file)
@@ -15,8 +15,6 @@
 
 #include <IntAna_QuadQuadGeo.hxx>
 
-using namespace std;
-
 GeomAPI_Pln::GeomAPI_Pln(const std::shared_ptr<GeomAPI_Ax3>& theAxis)
 : GeomAPI_Interface(new gp_Ax3(theAxis->impl<gp_Ax3>()))
 {
index 477a89c2079691ee5196b6a9142306fa3e814f96..b1378d1710ac1a5839ffe32fc38dc45567151dcd 100644 (file)
@@ -11,8 +11,6 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
 
-using namespace std;
-
 void GeomData_Dir::setValue(const double theX, const double theY, const double theZ)
 {
   if (!myIsInitialized || myCoords->Value(0) != theX || myCoords->Value(1) != theY
index 87b6894d3a75915d4be505f40e1227c7246a6242..2879897154ad7f740725afb1aaa6849cb2679054 100644 (file)
@@ -19,8 +19,6 @@ static bool FirstCall = true;
 IMPLEMENT_STANDARD_HANDLE(Model_Application, TDocStd_Application)
 IMPLEMENT_STANDARD_RTTIEXT(Model_Application, TDocStd_Application)
 
-using namespace std;
-
 static Handle_Model_Application TheApplication = new Model_Application;
 
 //=======================================================================
index d576a8870be398222cdac5052fae5879695467c9..f7111f127c63aaabd88ce7b50576a2def0851ec7 100644 (file)
@@ -8,8 +8,6 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
 
-using namespace std;
-
 void Model_AttributeBoolean::setValue(bool theValue)
 {
   Standard_Boolean aValue = theValue ? Standard_True : Standard_False;
index a2aef9d7d2c5f20327ac6b6bc536816269485eea..30d978752c718fc361d5c10e64a927f58d271518 100644 (file)
@@ -9,8 +9,6 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
 
-using namespace std;
-
 void Model_AttributeDocRef::setValue(std::shared_ptr<ModelAPI_Document> theDoc)
 {
   if (myID->Get() != theDoc->id()) {
index 6456b68a8bd1b2fc98a3164beca9a2bdb6c5d0ea..034620126a2020a307538db37c3225f105d2dcf2 100644 (file)
@@ -10,8 +10,6 @@
 #include "Model_Objects.h"
 #include <ModelAPI_Feature.h>
 
-using namespace std;
-
 bool Model_AttributeRefAttr::isObject()
 {
   return myID->Get().Length() == 0;
@@ -21,7 +19,7 @@ void Model_AttributeRefAttr::setAttr(std::shared_ptr<ModelAPI_Attribute> theAttr
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(
       theAttr->owner()->data());
-  string anID = aData->id(theAttr);
+  std::string anID = aData->id(theAttr);
   if (myIsInitialized && object() == theAttr->owner() && myID->Get().IsEqual(anID.c_str()))
     return;  // nothing is changed
   REMOVE_BACK_REF(theAttr->owner());
index 7da878e8714f88b34137a0c10cfa7b4a96131b3c..d743f05aa560e43a737d4c24c119edcc719c6514 100755 (executable)
@@ -12,8 +12,6 @@
 #include <TDF_ListIteratorOfLabelList.hxx>
 #include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
 
-using namespace std;
-
 void Model_AttributeRefAttrList::append(ObjectPtr theObject)
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(theObject->data());
index 388c4dfd589a4516888f3b5d4805077add926c20..7179ef11f0846249f8e2aaebd122664688794222 100644 (file)
@@ -13,8 +13,6 @@
 #include <TDF_Tool.hxx>
 #include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
 
-using namespace std;
-
 void Model_AttributeRefList::append(ObjectPtr theObject)
 {
   if (owner()->document() == theObject->document()) {
@@ -163,7 +161,7 @@ ObjectPtr Model_AttributeRefList::iteratedObject(TDF_ListIteratorOfLabelList& th
   return anObj;
 }
 
-list<ObjectPtr> Model_AttributeRefList::list()
+std::list<ObjectPtr> Model_AttributeRefList::list()
 {
   std::list<ObjectPtr> aResult;
   std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
index 4d08bb209ab5c5bc9547a2900915792bce476091..55c645b45f31db3a0999531c536a4d14f44a3614 100644 (file)
@@ -16,8 +16,6 @@
 #include <TDataStd_AsciiString.hxx>
 #include <TDF_Tool.hxx>
 
-using namespace std;
-
 void Model_AttributeReference::setValue(ObjectPtr theObject)
 {
   // now allow to deselect in this attribute: extrusion from/to
index 3dadaf30bd061459bafc4cadc5b4dc0468ad8754..2fdb15e68f33190b8d7acffba3a228b221be5f6c 100644 (file)
@@ -61,7 +61,6 @@
 #include <TopoDS_Iterator.hxx>
 #include <BRep_Builder.hxx>
 
-using namespace std;
 //#define DEB_NAMING 1
 #ifdef DEB_NAMING
 #include <BRepTools.hxx>
@@ -230,8 +229,8 @@ std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::value()
           if (selectionLabel().FindAttribute(TDataStd_Name::GetID(), aName)) {
             std::string aSubShapeName(TCollection_AsciiString(aName->Get()).ToCString());
             std::size_t aPartEnd = aSubShapeName.find('/');
-            if (aPartEnd != string::npos && aPartEnd != aSubShapeName.rfind('/')) {
-              string aNameInPart = aSubShapeName.substr(aPartEnd + 1);
+            if (aPartEnd != std::string::npos && aPartEnd != aSubShapeName.rfind('/')) {
+              std::string aNameInPart = aSubShapeName.substr(aPartEnd + 1);
               int anIndex;
               std::string aType; // to reuse already existing selection the type is not needed
               return aPart->shapeInPart(aNameInPart, aType, anIndex);
@@ -957,12 +956,12 @@ void Model_AttributeSelection::selectSubShape(
 
   // check this is Part-name: 2 delimiters in the name
   std::size_t aPartEnd = theSubShapeName.find('/');
-  if (aPartEnd != string::npos && aPartEnd != theSubShapeName.rfind('/')) {
+  if (aPartEnd != std::string::npos && aPartEnd != theSubShapeName.rfind('/')) {
     std::string aPartName = theSubShapeName.substr(0, aPartEnd);
     ObjectPtr aFound = owner()->document()->objectByName(ModelAPI_ResultPart::group(), aPartName);
     if (aFound.get()) { // found such part, so asking it for the name
       ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aFound);
-      string aNameInPart = theSubShapeName.substr(aPartEnd + 1);
+      std::string aNameInPart = theSubShapeName.substr(aPartEnd + 1);
       int anIndex;
       std::shared_ptr<GeomAPI_Shape> aSelected = aPart->shapeInPart(aNameInPart, theType, anIndex);
       if (aSelected.get()) {
index aa9ff1cc08ea092e2434733f1bc08d13c6ab79b8..a6d25f7ad727fa7122b4ab756809b4c1e2d6a730 100644 (file)
@@ -22,8 +22,6 @@
 #include <TNaming_Iterator.hxx>
 #include <NCollection_List.hxx>
 
-using namespace std;
-
 void Model_AttributeSelectionList::append(
     const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
     const bool theTemporarily)
index 75cb32ee044bc5eb327ba56372f7ce2dff19de79..790664f053816e88baefb94ce0ebd6a3160890f8 100644 (file)
@@ -29,8 +29,6 @@
 #include <TDF_RelocationTable.hxx>
 #include <TDF_ClosureTool.hxx>
 
-using namespace std;
-
 static Model_Session* myImpl = new Model_Session();
 
 // t oredirect all calls to the root document
@@ -144,7 +142,7 @@ std::list<std::string> Model_Session::redoList()
   return ROOT_DOC->redoList();
 }
 
-FeaturePtr Model_Session::createFeature(string theFeatureID, Model_Document* theDocOwner)
+FeaturePtr Model_Session::createFeature(std::string theFeatureID, Model_Document* theDocOwner)
 {
   if (this != myImpl) {
     return myImpl->createFeature(theFeatureID, theDocOwner);
@@ -292,10 +290,10 @@ void Model_Session::setActiveDocument(
 
 std::list<std::shared_ptr<ModelAPI_Document> > Model_Session::allOpenedDocuments()
 {
-  list<std::shared_ptr<ModelAPI_Document> > aResult;
+  std::list<std::shared_ptr<ModelAPI_Document> > aResult;
   aResult.push_back(moduleDocument());
   // add subs recursively
-  list<std::shared_ptr<ModelAPI_Document> >::iterator aDoc = aResult.begin();
+  std::list<std::shared_ptr<ModelAPI_Document> >::iterator aDoc = aResult.begin();
   for(; aDoc != aResult.end(); aDoc++) {
     DocumentPtr anAPIDoc = *aDoc;
     std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(anAPIDoc);
index 31160251c373016b8fc36c3fd2f4f36f59ae7448..6efd1b1a7578d4c1d84830531e8fcfa06c156d63 100755 (executable)
@@ -31,8 +31,6 @@
 #include <Events_InfoMessage.h>
 #include <Config_PropManager.h>
 
-using namespace std;
-
 Model_Update MY_UPDATER_INSTANCE;  /// the only one instance initialized on load of the library
 //#define DEB_UPDATE
 
@@ -719,9 +717,9 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
     }
   }
   // update the selection attributes if any
-  list<AttributePtr> aRefs =
+  std::list<AttributePtr> aRefs =
     theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId());
-  list<AttributePtr>::iterator aRefsIter = aRefs.begin();
+  std::list<AttributePtr>::iterator aRefsIter = aRefs.begin();
   for (; aRefsIter != aRefs.end(); aRefsIter++) {
     std::shared_ptr<ModelAPI_AttributeSelection> aSel =
       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*aRefsIter);
@@ -900,9 +898,9 @@ void Model_Update::updateSelection(const std::set<std::shared_ptr<ModelAPI_Objec
 {
   std::set<std::shared_ptr<ModelAPI_Object> >::iterator anObj = theObjects.begin();
   for(; anObj != theObjects.end(); anObj++) {
-    list<AttributePtr> aRefs =
+    std::list<AttributePtr> aRefs =
       (*anObj)->data()->attributes(ModelAPI_AttributeSelection::typeId());
-    list<AttributePtr>::iterator aRefsIter = aRefs.begin();
+    std::list<AttributePtr>::iterator aRefsIter = aRefs.begin();
     for (; aRefsIter != aRefs.end(); aRefsIter++) {
       std::shared_ptr<Model_AttributeSelection> aSel =
         std::dynamic_pointer_cast<Model_AttributeSelection>(*aRefsIter);
index 11f3df4c2c55e59316b766a4222ff377f68a0bad..fba142217242795d627b5727602fdcd30e076a0e 100644 (file)
@@ -37,8 +37,6 @@
 #include <dlfcn.h>
 #endif
 
-using namespace std;
-
 #ifdef _DEBUG
 #include <iostream>
 #endif
index 7b3e303d7e9738a94e5d6a467ca71dac4933c272..4e900e8c492c2b50fb599f441793ac33ac1a1569 100644 (file)
@@ -13,8 +13,6 @@
 #include <ModelAPI_ResultPart.h>
 #include <ModelAPI_Session.h>
 
-using namespace std;
-
 void PartSetPlugin_Duplicate::execute()
 {
   std::shared_ptr<ModelAPI_Session> aPManager = ModelAPI_Session::get();
index c40a0eadf3d87fec1a2374001f2e0762cba98d77..9c358dd7f2211a941863660d64204c6a9d6129f2 100644 (file)
@@ -12,8 +12,6 @@
 #include <ModelAPI_ResultPart.h>
 #include <ModelAPI_Events.h>
 
-using namespace std;
-
 PartSetPlugin_Part::PartSetPlugin_Part()
 {
 }
index f892c57a7f5a6d04675df7d135b32facc2ad95ad..9794e3a389b5c193fc5310a537a9d1d17f106789 100644 (file)
@@ -14,8 +14,6 @@
 #include <iostream>
 #endif
 
-using namespace std;
-
 // the only created instance of this plugin
 static PartSetPlugin_Plugin* MY_PARTSET_INSTANCE = new PartSetPlugin_Plugin();
 
@@ -25,7 +23,7 @@ PartSetPlugin_Plugin::PartSetPlugin_Plugin()
   ModelAPI_Session::get()->registerPlugin(this);
 }
 
-FeaturePtr PartSetPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr PartSetPlugin_Plugin::createFeature(std::string theFeatureID)
 {
   if (theFeatureID == PartSetPlugin_Part::ID()) {
     return FeaturePtr(new PartSetPlugin_Part);
index b4281ea41e4a3fe7eb45461b39bf38327267ec42..bf3e1716c034b8933e2c194c13d556d16debc16e 100644 (file)
@@ -7,17 +7,12 @@
 #include <PrimitivesPlugin_Plugin.h>
 
 #include <PrimitivesPlugin_Box.h>
-
 #include <ModelAPI_Session.h>
 
 #include <string>
-
 #include <memory>
-
 #include <iostream>
 
-using namespace std;
-
 // the only created instance of this plugin
 static PrimitivesPlugin_Plugin* MY_PRIMITIVES_INSTANCE = new PrimitivesPlugin_Plugin();
 
@@ -27,7 +22,7 @@ PrimitivesPlugin_Plugin::PrimitivesPlugin_Plugin()
   ModelAPI_Session::get()->registerPlugin(this);
 }
 
-FeaturePtr PrimitivesPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr PrimitivesPlugin_Plugin::createFeature(std::string theFeatureID)
 {
   if (theFeatureID == PrimitivesPlugin_Box::ID()) {
     return FeaturePtr(new PrimitivesPlugin_Box);
index fc24671cd8fb42eaf4e30429ee10d085ef583f28..4330709c2e978c5c70604895bfe7148729ce35e9 100644 (file)
@@ -19,6 +19,7 @@ from connection import *
 from construction import *
 from exchange import *
 from features import *
+from collection import *
 from parameter import *
 from partset import *
 from primitives import *
diff --git a/src/PythonAPI/model/collection/__init__.py b/src/PythonAPI/model/collection/__init__.py
new file mode 100644 (file)
index 0000000..4189aac
--- /dev/null
@@ -0,0 +1,4 @@
+"""Package for Collection plugin for the Parametric Geometry API of the Modeler.
+"""
+
+from CollectionAPI import addGroup
index f0b31740715257ac1a46573634ed93d2027910fc..90c7d95fc7e295212f07735d5363f6131b02c466 100644 (file)
@@ -7,4 +7,4 @@ from FeaturesAPI import addRevolution, addRevolutionCut, addRevolutionFuse
 from FeaturesAPI import addPipe
 from FeaturesAPI import addCut, addFuse, addCommon, addSmash, addFill
 from FeaturesAPI import addIntersection, addPartition, addUnion, addRemoveSubShapes
-from FeaturesAPI import addGroup, addRecover
+from FeaturesAPI import addRecover
index 553d1f2e0d29d50acfb5aee37888ce32348b8c33..10e1ed235e937aa2d04f45d5b2aa19cb2e6d0d3b 100644 (file)
@@ -21,8 +21,6 @@
 #include <GeomAlgoAPI_EdgeBuilder.h>
 #include <GeomDataAPI_Point2D.h>
 
-using namespace std;
-
 SketchPlugin_Line::SketchPlugin_Line()
     : SketchPlugin_SketchEntity()
 {}
index e69e107b39101fdc42adce4d24f72b63a2ab17d7..2c6c5772f67edf621366f20934e11c54f6418396 100644 (file)
@@ -48,8 +48,6 @@
 
 //#define SET_PLANES_COLOR_IN_PREFERENCES
 
-using namespace std;
-
 // the only created instance of this plugin
 static SketchPlugin_Plugin* MY_SKETCH_INSTANCE = new SketchPlugin_Plugin();
 
@@ -122,7 +120,7 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
 #endif
 }
 
-FeaturePtr SketchPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr SketchPlugin_Plugin::createFeature(std::string theFeatureID)
 {
   if (theFeatureID == SketchPlugin_Sketch::ID()) {
     return FeaturePtr(new SketchPlugin_Sketch);
index 94027d674ba042a4e6379b4da8f826f5df96b86f..2bfe7e60a4863c52cedf3ed8ceb3c1ad681bbfb6 100644 (file)
@@ -18,8 +18,6 @@
 #include <GeomDataAPI_Point2D.h>
 #include <GeomAlgoAPI_PointBuilder.h>
 
-using namespace std;
-
 SketchPlugin_Point::SketchPlugin_Point()
     : SketchPlugin_SketchEntity()
 {
index ca60111969f1ee5646b8cf1599b42e5353ba0a61..4de9585ee05cc0d914186d692e08254624155f13 100755 (executable)
@@ -39,8 +39,6 @@
 #include <math.h>
 #include <vector>
 
-using namespace std;
-
 SketchPlugin_Sketch::SketchPlugin_Sketch()
 {
 }