]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom
authornds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 07:54:24 +0000 (11:54 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 07:54:24 +0000 (11:54 +0400)
45 files changed:
CMakeLists.txt
src/Config/CMakeLists.txt
src/Config/Config.h [deleted file]
src/Config/Config_Common.h
src/Config/Config_FeatureMessage.h
src/Config/Config_FeatureReader.h
src/Config/Config_ModuleReader.h
src/Config/Config_PointerMessage.h
src/Config/Config_WidgetAPI.cpp
src/Config/Config_WidgetAPI.h
src/Config/Config_WidgetReader.h
src/Config/Config_XMLReader.h
src/Config/Config_def.h [new file with mode: 0644]
src/ConstructionPlugin/CMakeLists.txt
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/ConstructionPlugin/extrusion_widget.xml
src/GeomAPI/CMakeLists.txt
src/GeomAlgoAPI/CMakeLists.txt
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp [new file with mode: 0644]
src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h [new file with mode: 0644]
src/GeomData/CMakeLists.txt
src/Model/CMakeLists.txt
src/Model/Model_AttributeBoolean.cpp
src/Model/Model_Data.cpp
src/Model/Model_Data.h
src/ModelAPI/ModelAPI_Data.h
src/ModelAPI/ModelAPI_Feature.h
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_IWorkshop.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_SelectorWidget.cpp [new file with mode: 0644]
src/ModuleBase/ModuleBase_SelectorWidget.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_WidgetFactory.cpp
src/ModuleBase/ModuleBase_WidgetFactory.h
src/NewGeom/CMakeLists.txt
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_Module.cpp
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_ModuleConnector.cpp [new file with mode: 0644]
src/XGUI/XGUI_ModuleConnector.h [new file with mode: 0644]
src/XGUI/XGUI_ObjectsBrowser.cpp
src/XGUI/XGUI_ObjectsBrowser.h
src/XGUI/XGUI_ViewerProxy.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index bef4cdee832db553cbc8fc76202f5bfcf6f52b3b..4f70d821c7df0d7b6820462f9f0bcc72fad7611a 100644 (file)
@@ -10,6 +10,7 @@ INCLUDE(FindBoost)
 INCLUDE(FindPython)
 INCLUDE(FindSalome)
 INCLUDE(FindSolveSpace)
+INCLUDE(FindCAS)
 
 IF(UNIX)
     IF(CMAKE_COMPILER_IS_GNUCC)
index 2e954c8a844614d3ec2cf3c5b288c6a9a874876e..ebb5efb695ee3c638bf152f765af59f9ee65c266 100644 (file)
@@ -4,7 +4,7 @@ INCLUDE(XMLProcessing)
 INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events) 
 
 SET(PROJECT_HEADERS
-  Config.h
+  Config_def.h
   Config_FeatureMessage.h
   Config_XMLReader.h
   Config_ModuleReader.h
diff --git a/src/Config/Config.h b/src/Config/Config.h
deleted file mode 100644 (file)
index 587ac53..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#if defined CONFIG_EXPORTS
-#if defined WIN32
-#define CONFIG_EXPORT              __declspec( dllexport )
-#else
-#define CONFIG_EXPORT
-#endif
-#else
-#if defined WIN32
-#define CONFIG_EXPORT              __declspec( dllimport )
-#else
-#define CONFIG_EXPORT
-#endif
-#endif
-
-#endif //CONFIG_H
index 40051dc2ac209f5d0389d4fe5f712cc5eb8017de..2a579b91e126403d14d7f74cc698988be479a285 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef Config_Common_H_
 #define Config_Common_H_
 
-#include "Config.h"
+#include "Config_def.h"
 
 #include <string>
 #include <stdarg.h>
index 9328e0690775df4e1fb7bdc44ba625477bb3a846..2613c992636fef61ddaeade5dafdb19730a76638 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CONFIG_MESSAGE_H\r
 #define CONFIG_MESSAGE_H\r
 \r
-#include <Config.h>\r
+#include <Config_def.h>\r
 #include <Events_Message.h>\r
 \r
 #include <string>\r
index 1add8438d464da227b792435783df3907af2ce2c..468cb9911165f8c09faa902d6d0b55c23f317b53 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef CONFIG_FEATUREREADER_H_
 #define CONFIG_FEATUREREADER_H_
 
-#include <Config.h>
+#include <Config_def.h>
 #include <Config_XMLReader.h>
 
 #include <string>
index a4afba3c242dd20be7eeb39a99f3b7325253f79f..3bd5d39f3f75c8289f5566e5fc44ec8bfc1e553f 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef CONFIG_MODULEREADER_H_
 #define CONFIG_MODULEREADER_H_
 
-#include <Config.h>
+#include <Config_def.h>
 #include <Config_XMLReader.h>
 
 #include <map>
index f108d3edeaa50bc7ad81f1071026fd6f5825484f..0e3c726caa094e05e0392032a357952e35b2fafb 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef PARTSET_MESSAGE_H_
 #define PARTSET_MESSAGE_H_
 
-#include <Config.h>
+#include <Config_def.h>
 #include <Events_Message.h>
 
 /*
index 9a77d778ac0825da41131e6ffc65a2ef0ea3c88c..2fdad673519fcd7f1be6fc49cdbadad3062ffb67 100644 (file)
@@ -61,7 +61,7 @@ bool Config_WidgetAPI::toParentWidget()
   return myCurrentNode != NULL;
 }
 
-std::string Config_WidgetAPI::widgetType()
+std::string Config_WidgetAPI::widgetType() const
 {
   std::string result = "";
   if(myCurrentNode) {
@@ -70,19 +70,19 @@ std::string Config_WidgetAPI::widgetType()
   return result;
 }
 
-bool Config_WidgetAPI::isContainerWidget()
+bool Config_WidgetAPI::isContainerWidget() const
 {
   return isNode(myCurrentNode, WDG_GROUP, WDG_CHECK_GROUP,
                                NULL);
 }
 
-bool Config_WidgetAPI::isPagedWidget()
+bool Config_WidgetAPI::isPagedWidget() const
 {
   return isNode(myCurrentNode, WDG_TOOLBOX, WDG_SWITCH,
                                NULL);
 }
 
-std::string Config_WidgetAPI::getProperty(const char* thePropName)
+std::string Config_WidgetAPI::getProperty(const char* thePropName) const
 {
   std::string result = "";
   char* aPropChars = (char*) xmlGetProp(myCurrentNode, BAD_CAST thePropName);
@@ -92,22 +92,22 @@ std::string Config_WidgetAPI::getProperty(const char* thePropName)
   return result;
 }
 
-std::string Config_WidgetAPI::widgetId()
+std::string Config_WidgetAPI::widgetId() const
 {
   return getProperty("id");
 }
 
-std::string Config_WidgetAPI::widgetTooltip()
+std::string Config_WidgetAPI::widgetTooltip() const
 {
   return getProperty("tooltip");
 }
 
-std::string Config_WidgetAPI::widgetIcon()
+std::string Config_WidgetAPI::widgetIcon() const
 {
   return getProperty("icon");
 }
 
-std::string Config_WidgetAPI::widgetLabel()
+std::string Config_WidgetAPI::widgetLabel() const
 {
   return getProperty("label");
 }
index 4030ff257a204b12e70af6d7c14cdbd6f4677f10..190ccfc7fafd450dcd7ea1ea931414cf43b35455 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef CONFIG_WIDGETAPI_H_
 #define CONFIG_WIDGETAPI_H_
 
-#include <Config.h>
+#include <Config_def.h>
 
 #include <cstdarg>
 #include <string>
@@ -36,16 +36,16 @@ public:
   bool toChildWidget();
   bool toParentWidget();
 
-  std::string widgetType();
-  bool isContainerWidget();
-  bool isPagedWidget();
+  std::string widgetType() const;
+  bool isContainerWidget() const;
+  bool isPagedWidget() const;
 
-  std::string widgetId();
-  std::string widgetIcon();
-  std::string widgetLabel();
-  std::string widgetTooltip();
+  std::string widgetId() const;
+  std::string widgetIcon() const;
+  std::string widgetLabel() const;
+  std::string widgetTooltip() const;
 
-  std::string getProperty(const char* thePropName);
+  std::string getProperty(const char* thePropName) const;
 
 private:
   xmlDocPtr myDoc;
index cfc1519a56b62fcc46eafeaeb39e489d3fba599d..96f35ac19a062a46a70075bab2150b115c9a2b1f 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef CONFIG_WIDGETREADER_H_
 #define CONFIG_WIDGETREADER_H_
 
-#include <Config.h>
+#include <Config_def.h>
 #include <Config_XMLReader.h>
 
 #include <map>
index bcd8ddfdf4bfe5d27bdd6305060a40298cb714eb..8915147e9eb5c8b88a550d642e38ec2d6728bd65 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef CONFIG_XMLREADER_H_
 #define CONFIG_XMLREADER_H_
 
-#include <Config.h>
+#include <Config_def.h>
 
 #include <cstdarg>
 #include <string>
diff --git a/src/Config/Config_def.h b/src/Config/Config_def.h
new file mode 100644 (file)
index 0000000..587ac53
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#if defined CONFIG_EXPORTS
+#if defined WIN32
+#define CONFIG_EXPORT              __declspec( dllexport )
+#else
+#define CONFIG_EXPORT
+#endif
+#else
+#if defined WIN32
+#define CONFIG_EXPORT              __declspec( dllimport )
+#else
+#define CONFIG_EXPORT
+#endif
+#endif
+
+#endif //CONFIG_H
index ab34919147ff1251a53a238fd62bec0a005e75ec..dc32be9876c22203738ac932552f1a2d68671448 100644 (file)
@@ -15,10 +15,12 @@ SET(PROJECT_SOURCES
 
 ADD_DEFINITIONS(-DCONSTRUCTIONPLUGIN_EXPORTS ${BOOST_DEFINITIONS})
 ADD_LIBRARY(ConstructionPlugin SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-TARGET_LINK_LIBRARIES(ConstructionPlugin ${PROJECT_LIBRARIES} ModelAPI)
+TARGET_LINK_LIBRARIES(ConstructionPlugin ${PROJECT_LIBRARIES} ModelAPI GeomAPI GeomAlgoAPI)
 
 INCLUDE_DIRECTORIES(
   ../ModelAPI
+  ../GeomAPI
+  ../GeomAlgoAPI
 )
 
 SET(XML_RESOURCES
index ea613603b9d3a3417b05e78da8bdeb6841ad5db6..aaa697dd5684f8c58d26b222f5e798a932ce3357 100644 (file)
@@ -7,6 +7,8 @@
 #include "ModelAPI_Document.h"
 #include "ModelAPI_Data.h"
 #include "ModelAPI_AttributeDouble.h"
+#include <GeomAlgoAPI_PointBuilder.h>
+#include <GeomAPI_Pnt.h>
 
 using namespace std;
 
@@ -21,11 +23,10 @@ void ConstructionPlugin_Point::initAttributes()
   data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::type());
 }
 
-// this is for debug only
-#include <iostream>
 void ConstructionPlugin_Point::execute() 
 {
-  // TODO: create a real shape for the point using OCC layer
-  cout<<"X="<<data()->real(POINT_ATTR_X)->value()<<" Y="<<data()->real(POINT_ATTR_Y)->value()
-      <<" Z="<<data()->real(POINT_ATTR_Z)->value()<<endl;
+  boost::shared_ptr<GeomAPI_Pnt> aPnt(new GeomAPI_Pnt(
+    data()->real(POINT_ATTR_X)->value(), data()->real(POINT_ATTR_Y)->value(), data()->real(POINT_ATTR_Z)->value()));
+
+  data()->store(GeomAlgoAPI_PointBuilder::point(aPnt));
 }
index 52cf8622f8c4081aa7491443e8f4b6ca79f586ed..ed08edc353d3fadd680241539de7b81603ae7ca2 100644 (file)
@@ -3,6 +3,7 @@
     label="Select a face" 
     icon=":icons/sketch.png" 
     tooltip="Select a face for extrusion"
+       activate="true"
   />
   <doublevalue id="extrusion_size" label="Size" min="0" step="1.0" default="10" icon=":icons/dimension_v.png" tooltip="Set size of extrusion"/>
   <boolvalue id="extrusion_reverse" label="Reverse" default="false" tooltip="Reverse default direction"/>
index ad741d302d83c67fe65adae20fc93ff949e96e45..2a2f3ed40e5ffe4ac1b7ef99880054a9a1a4e1a2 100644 (file)
@@ -1,5 +1,4 @@
 FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(FindCAS)
 
 INCLUDE(${SWIG_USE_FILE})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
index 509c7fd9e0bc5ab7b01c1f3dc608e14e237709ab..181bf09de2c37299ac71e89a35429ae18e2794a9 100644 (file)
@@ -1,5 +1,4 @@
 FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(FindCAS)
 
 INCLUDE(${SWIG_USE_FILE})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
@@ -9,12 +8,14 @@ SET(PROJECT_HEADERS
     GeomAlgoAPI_CompoundBuilder.h
     GeomAlgoAPI_FaceBuilder.h
     GeomAlgoAPI_EdgeBuilder.h
+    GeomAlgoAPI_PointBuilder.h
 )
 
 SET(PROJECT_SOURCES
     GeomAlgoAPI_CompoundBuilder.cpp
     GeomAlgoAPI_FaceBuilder.cpp
     GeomAlgoAPI_EdgeBuilder.cpp
+    GeomAlgoAPI_PointBuilder.cpp
 )
 
 ADD_DEFINITIONS(-DGEOMALGOAPI_EXPORTS ${CAS_DEFINITIONS})
index 99a815f744a870d1b0d90f71dd916ad3b3d7f167..c43f350dc4bdb9e9d3471ae71ea82d293bd9cdb4 100644 (file)
@@ -4,6 +4,8 @@
   #include "memory"
   #include "GeomAlgoAPI.h"
   #include "GeomAlgoAPI_FaceBuilder.h"
+  #include "GeomAlgoAPI_EdgeBuilder.h"
+  #include "GeomAlgoAPI_PointBuilder.h"
 %}
 
 // to avoid error on this
@@ -17,3 +19,5 @@
 
 // all supported interfaces
 %include "GeomAlgoAPI_FaceBuilder.h"
+%include "GeomAlgoAPI_EdgeBuilder.h"
+%include "GeomAlgoAPI_PointBuilder.h"
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp
new file mode 100644 (file)
index 0000000..d12bd6a
--- /dev/null
@@ -0,0 +1,22 @@
+// File:        GeomAlgoAPI_PointBuilder.cpp
+// Created:     02 Jun 2014
+// Author:      Mikhail PONIKAROV
+
+
+
+#include <GeomAlgoAPI_PointBuilder.h>
+#include <GeomAPI_Pnt.h>
+#include <GeomAPI_Shape.h>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <TopoDS_Vertex.hxx>
+
+boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_PointBuilder::point(
+    boost::shared_ptr<GeomAPI_Pnt> thePoint)
+{
+  const gp_Pnt& aPnt = thePoint->impl<gp_Pnt>();
+  BRepBuilderAPI_MakeVertex aMaker(aPnt);
+  TopoDS_Vertex aVertex = aMaker.Vertex();
+  boost::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
+  aRes->setImpl(new TopoDS_Shape(aVertex));
+  return aRes;
+}
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h
new file mode 100644 (file)
index 0000000..2715062
--- /dev/null
@@ -0,0 +1,27 @@
+// File:        GeomAlgoAPI_PointBuilder.h
+// Created:     02 Jun 2014
+// Author:      Mikhail PONIKAROV
+
+#ifndef GeomAlgoAPI_PointBuilder_HeaderFile
+#define GeomAlgoAPI_PointBuilder_HeaderFile
+
+#include <GeomAlgoAPI.h>
+#include <boost/shared_ptr.hpp>
+
+class GeomAPI_Shape;
+class GeomAPI_Pnt;
+
+/**\class GeomAlgoAPI_PointBuilder
+ * \ingroup DataAlgo
+ * \brief Allows to create face-shapes by different parameters
+ */
+
+class GEOMALGOAPI_EXPORT GeomAlgoAPI_PointBuilder
+{
+public:
+  /// Creates linear edge by two points
+  static boost::shared_ptr<GeomAPI_Shape> point(
+    boost::shared_ptr<GeomAPI_Pnt> thePoint);
+};
+
+#endif
index b69c280d060d7ae678882a7c9307b80589227e8b..a1e450c6ecdf9034de10fcc4910fb24cfebf88ae 100644 (file)
@@ -1,5 +1,4 @@
 INCLUDE(Common)
-INCLUDE(FindCAS)
 
 SET(PROJECT_HEADERS
     GeomData.h
index 9da38b914c666e7dcd6563552f3372e5647f91d3..bb12daaadbd2e87fb940b2bef2dc57f9049816b3 100644 (file)
@@ -1,5 +1,4 @@
 INCLUDE(Common)
-INCLUDE(FindCAS)
 
 SET(PROJECT_HEADERS
     Model.h
@@ -36,7 +35,9 @@ SET(PROJECT_LIBRARIES
     Events 
     Config 
     GeomData
+    GeomAPI
     ${CAS_OCAF}
+    ${CAS_TKCAF}
 )
 
 
@@ -51,6 +52,7 @@ INCLUDE_DIRECTORIES(
   ../Config
   ../GeomData
   ../GeomDataAPI
+  ../GeomAPI
   ${CAS_INCLUDE_DIRS}
 )
 
index d3c0d6bc5aa9f5950f229b09bbc9d5a06549d53b..5472dadf255f13feac8b09704726979751f0d191 100644 (file)
@@ -10,8 +10,9 @@ using namespace std;
 
 void Model_AttributeBoolean::setValue(bool theValue)
 {
-  if (myBool->Get() != theValue) {
-    myBool->Set(theValue? 1 : 0);
+  Standard_Boolean aValue = theValue ? Standard_True : Standard_False;
+  if (myBool->Get() != aValue) {
+    myBool->Set(aValue);
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
     Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
@@ -20,7 +21,7 @@ void Model_AttributeBoolean::setValue(bool theValue)
 
 bool Model_AttributeBoolean::value()
 {
-  return (myBool->Get() == 1)? true : false;
+  return myBool->Get() == Standard_True;
 }
 
 Model_AttributeBoolean::Model_AttributeBoolean(TDF_Label& theLabel)
index f794bda07c143f0936ff573d656542285969b459..ee81944226cff7f0e24914eb285d56973459cabc 100644 (file)
@@ -188,3 +188,34 @@ bool Model_Data::isValid()
 {
   return !myLab.IsNull() && myLab.HasAttribute();
 }
+
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TopoDS_Shape.hxx>
+#include <GeomAPI_Shape.h>
+
+void Model_Data::store(const boost::shared_ptr<GeomAPI_Shape>& theShape)
+{
+  // the simplest way is to keep this attribute here, on Data
+  // TODO: add naming structure in separated document for shape storage
+  TNaming_Builder aBuilder(myLab);
+  if (!theShape) return; // bad shape
+  TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
+  if (aShape.IsNull()) return; // null shape inside
+
+  aBuilder.Generated(aShape);
+}
+
+boost::shared_ptr<GeomAPI_Shape> Model_Data::shape()
+{
+  Handle(TNaming_NamedShape) aName;
+  if (myLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
+    TopoDS_Shape aShape = aName->Get();
+    if (!aShape.IsNull()) {
+      boost::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
+      aRes->setImpl(new TopoDS_Shape(aShape));
+      return aRes;
+    }
+  }
+  return boost::shared_ptr<GeomAPI_Shape>();
+}
index 03ff0c54eddc44dd8fec9cf433b9cfa307edb9b5..deb7239a583913e9bb0dafdfd422ed0031a89518 100644 (file)
@@ -68,6 +68,11 @@ public:
   /// Returns true if it is correctly connected t othe data model
   MODEL_EXPORT virtual bool isValid();
 
+  /// Stores the shape (called by the execution method).
+  MODEL_EXPORT virtual void store(const boost::shared_ptr<GeomAPI_Shape>& theShape);
+  /// Returns the shape-result produced by this feature
+  MODEL_EXPORT virtual boost::shared_ptr<GeomAPI_Shape> shape();
+
   /// Initializes object by the attributes: must be called just after the object is created
   /// for each attribute of the object
   /// \param theID identifier of the attribute that can be referenced by this ID later
index f8dd2289673e932f53d9d01a26df8e5acee9c17b..3bae7c023be864d8134b40e4b08206a8567ddb5e 100644 (file)
@@ -16,6 +16,7 @@ class ModelAPI_AttributeRefAttr;
 class ModelAPI_AttributeRefList;
 class ModelAPI_Document;
 class ModelAPI_Attribute;
+class GeomAPI_Shape;
 
 /**\class ModelAPI_Data
  * \ingroup DataModel
@@ -55,6 +56,11 @@ public:
   /// Returns true if it is correctly connected t othe data model
   virtual bool isValid() = 0;
 
+  /// Stores the shape (called by the execution method).
+  virtual void store(const boost::shared_ptr<GeomAPI_Shape>& theShape) = 0;
+  /// Returns the shape-result produced by this feature
+  virtual boost::shared_ptr<GeomAPI_Shape> shape() = 0;
+
   /// Initializes object by the attributes: must be called just after the object is created
   /// for each attribute of the object
   /// \param theID identifier of the attribute that can be referenced by this ID later
index bd726461ff4194ecec2da0f35d4c5d65e63e80aa..6d7955f4b1dee713b9149faa581656770c1f5155 100644 (file)
@@ -58,7 +58,7 @@ public:
 
   /// Returns true if feature refers to the same model data instance
   MODELAPI_EXPORT virtual bool isSame(const boost::shared_ptr<ModelAPI_Feature>& theFeature)
-  {return true;}
+  {return theFeature.get() == this;}
 
   /// To virtually destroy the fields of successors
   virtual ~ModelAPI_Feature() {}
index 82f7214d88e005c820d1fda431e71c81f9b8eb81..6b1f3d6772d125e96c31800c3dbb7633f92d92a4 100644 (file)
@@ -11,6 +11,8 @@ SET(PROJECT_HEADERS
        ModuleBase_WidgetPoint2D.h
        ModuleBase_WidgetSwitch.h
        ModuleBase_MetaWidget.h
+    ModuleBase_SelectorWidget.h
+    ModuleBase_IWorkshop.h
 )
 
 SET(PROJECT_SOURCES
@@ -21,12 +23,15 @@ SET(PROJECT_SOURCES
        ModuleBase_WidgetPoint2D.cpp
        ModuleBase_WidgetSwitch.cpp
        ModuleBase_MetaWidget.cpp
+    ModuleBase_SelectorWidget.cpp
 )
 
 SET(PROJECT_LIBRARIES
     Config
     ModelAPI
     ${QT_LIBRARIES}
+       ${CAS_VIEWER}
+       ${CAS_KERNEL}
 )
 
 SET(PROJECT_AUTOMOC 
@@ -40,14 +45,15 @@ SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESO
 #SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
 
 INCLUDE_DIRECTORIES(
-    ${PROJECT_SOURCE_DIR}/src/Config
+    ${CAS_INCLUDE_DIRS}
+    ${CMAKE_SOURCE_DIR}/src/Config
     ${CMAKE_SOURCE_DIR}/src/Events
     ${CMAKE_SOURCE_DIR}/src/Model
     ${CMAKE_SOURCE_DIR}/src/ModelAPI
     ${CMAKE_SOURCE_DIR}/src/GeomDataAPI
 )
 
-ADD_DEFINITIONS(-DMODULEBASE_EXPORTS)
+ADD_DEFINITIONS(-DMODULEBASE_EXPORTS ${CAS_DEFINITIONS})
 ADD_LIBRARY(ModuleBase SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 TARGET_LINK_LIBRARIES(ModuleBase ${PROJECT_LIBRARIES})
 
diff --git a/src/ModuleBase/ModuleBase_IWorkshop.h b/src/ModuleBase/ModuleBase_IWorkshop.h
new file mode 100644 (file)
index 0000000..d9dcf54
--- /dev/null
@@ -0,0 +1,37 @@
+// File:        ModuleBase_IWorkshop.h
+// Created:     2 June 2014
+// Author:      Vitaly Smetannikov
+
+#ifndef ModuleBase_IWorkshop_H
+#define ModuleBase_IWorkshop_H
+
+#include "ModuleBase.h"
+
+#include <ModelAPI_Feature.h>
+
+#include <AIS_InteractiveContext.hxx>
+
+#include <QObject>
+
+/**
+* Class which provides access to Workshop object serveces
+*/
+class MODULEBASE_EXPORT ModuleBase_IWorkshop: public QObject
+{
+Q_OBJECT
+public:
+  ModuleBase_IWorkshop(QObject* theParent):QObject(theParent) {}
+
+  virtual ~ModuleBase_IWorkshop() {};
+
+  //! Returns AIS_InteractiveContext from current OCCViewer
+  virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
+
+  //! Returns list of currently selected data objects
+  virtual QList<FeaturePtr> selectedFeatures() const = 0; 
+
+signals:
+  void selectionChanged();
+};
+
+#endif
\ No newline at end of file
diff --git a/src/ModuleBase/ModuleBase_SelectorWidget.cpp b/src/ModuleBase/ModuleBase_SelectorWidget.cpp
new file mode 100644 (file)
index 0000000..f47911d
--- /dev/null
@@ -0,0 +1,186 @@
+// File:        ModuleBase_SelectorWidget.h
+// Created:     2 June 2014
+// Author:      Vitaly Smetannikov
+
+
+#include "ModuleBase_SelectorWidget.h"
+#include "ModuleBase_IWorkshop.h"
+
+#include <ModelAPI_Data.h>
+#include <ModelAPI_Object.h>
+#include <ModelAPI_AttributeReference.h>
+#include <Config_WidgetAPI.h>
+
+#include <QWidget>
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QToolButton>
+#include <QString>
+#include <QEvent>
+
+
+ModuleBase_SelectorWidget::ModuleBase_SelectorWidget(QWidget* theParent, 
+                                                     ModuleBase_IWorkshop* theWorkshop, 
+                                                     const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent), myWorkshop(theWorkshop), myActivateOnStart(false)
+{
+  myFeatureAttributeID = theData->widgetId();
+
+  myContainer = new QWidget(theParent);
+  QHBoxLayout* aLayout = new QHBoxLayout(myContainer);
+
+  aLayout->setContentsMargins(0, 0, 0, 0);
+  QString aLabelText = QString::fromStdString(theData->widgetLabel());
+  QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
+  myLabel = new QLabel(aLabelText, myContainer);
+  myLabel->setPixmap(QPixmap(aLabelIcon));
+
+  aLayout->addWidget(myLabel);
+
+  QString aToolTip = QString::fromStdString(theData->widgetTooltip());
+  myTextLine = new QLineEdit(myContainer);
+  myTextLine->setReadOnly(true);
+  myTextLine->setToolTip(aToolTip);
+  myTextLine->installEventFilter(this);
+
+  aLayout->addWidget(myTextLine);
+
+  myActivateBtn = new QToolButton(myContainer);
+  myActivateBtn->setIcon(QIcon(":icons/hand_point.png"));
+  myActivateBtn->setCheckable(true);
+  myActivateBtn->setToolTip(tr("Activate/Deactivate selection"));
+  connect(myActivateBtn, SIGNAL(toggled(bool)), this, SLOT(activateSelection(bool)));
+
+  aLayout->addWidget(myActivateBtn);
+
+  QString aActivateTxt = QString::fromStdString(theData->getProperty("activate"));
+  if (!aActivateTxt.isNull()) {
+    myActivateOnStart = (aActivateTxt == "true");
+  }
+}
+
+//********************************************************************
+ModuleBase_SelectorWidget::~ModuleBase_SelectorWidget()
+{
+}
+
+//********************************************************************
+bool ModuleBase_SelectorWidget::storeValue(FeaturePtr theFeature)
+{
+  DataPtr aData = theFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeReference> aRef = 
+    boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(aData->attribute(myFeatureAttributeID));
+
+  aRef->setFeature(mySelectedFeature);
+
+  return true;
+}
+
+//********************************************************************
+bool ModuleBase_SelectorWidget::restoreValue(FeaturePtr theFeature)
+{
+  DataPtr aData = theFeature->data();
+  boost::shared_ptr<ModelAPI_AttributeReference> aRef = 
+    boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(aData->attribute(myFeatureAttributeID));
+
+  mySelectedFeature = aRef->value();
+  updateSelectionName(); 
+  return true;
+}
+
+//********************************************************************
+bool ModuleBase_SelectorWidget::canFocusTo(const std::string& theAttributeName)
+{
+  return false;
+}
+
+//********************************************************************
+void ModuleBase_SelectorWidget::focusTo()
+{
+}
+
+//********************************************************************
+QList<QWidget*> ModuleBase_SelectorWidget::getControls() const
+{
+  QList<QWidget*> aControls;
+  aControls.append(myLabel);
+  aControls.append(myTextLine);
+  aControls.append(myActivateBtn);
+  return aControls;
+}
+
+//********************************************************************
+void ModuleBase_SelectorWidget::onSelectionChanged()
+{
+  QList<FeaturePtr> aFeatures = myWorkshop->selectedFeatures();
+  if (aFeatures.size() > 0) {
+    FeaturePtr aFeature = aFeatures.first();
+    if ((!mySelectedFeature) && (!aFeature))
+      return;
+    if (mySelectedFeature && aFeature && mySelectedFeature->isSame(aFeature))
+      return;
+
+    // TODO: Check that the selection corresponds to selection type
+    mySelectedFeature = aFeature;
+    if (mySelectedFeature) {
+      updateSelectionName();
+      activateSelection(false);
+    } else {
+      myTextLine->setText("");
+    }
+    emit valuesChanged();
+  }
+}
+
+//********************************************************************
+void ModuleBase_SelectorWidget::updateSelectionName()
+{
+  if (mySelectedFeature) {
+    std::string aName;
+    if (mySelectedFeature->data())
+      aName = mySelectedFeature->data()->getName();
+    else 
+      aName = boost::dynamic_pointer_cast<ModelAPI_Object>(mySelectedFeature)->getName();
+    myTextLine->setText(QString::fromStdString(aName));
+  } else 
+    myTextLine->setText("");
+}
+
+//********************************************************************
+bool ModuleBase_SelectorWidget::eventFilter(QObject* theObj, QEvent* theEvent)
+{
+  if (theObj == myTextLine) {
+    if (theEvent->type() == QEvent::Polish) {
+      activateSelection(myActivateOnStart);
+      onSelectionChanged();
+    }
+  }
+  return ModuleBase_ModelWidget::eventFilter(theObj, theEvent);
+}
+
+//********************************************************************
+void ModuleBase_SelectorWidget::enableOthersControls(bool toEnable)
+{
+  QWidget* aParent = myContainer->parentWidget();
+  QList<QWidget*> aChldList = aParent->findChildren<QWidget*>();
+  foreach(QWidget* aWgt, aChldList) {
+    if ((aWgt != myLabel) && (aWgt != myActivateBtn) && (aWgt != myTextLine) && (aWgt != myContainer))
+      aWgt->setEnabled(toEnable);
+  }
+}
+
+//********************************************************************
+void ModuleBase_SelectorWidget::activateSelection(bool toActivate)
+{
+  enableOthersControls(!toActivate);
+  myTextLine->setEnabled(toActivate);
+
+  if (toActivate)
+    connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
+  else
+    disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
+
+  myActivateBtn->setDown(toActivate);
+}
\ No newline at end of file
diff --git a/src/ModuleBase/ModuleBase_SelectorWidget.h b/src/ModuleBase/ModuleBase_SelectorWidget.h
new file mode 100644 (file)
index 0000000..61d71c4
--- /dev/null
@@ -0,0 +1,86 @@
+// File:        ModuleBase_SelectorWidget.h
+// Created:     2 June 2014
+// Author:      Vitaly Smetannikov
+
+#ifndef ModuleBase_SelectorWidget_H
+#define ModuleBase_SelectorWidget_H
+
+#include "ModuleBase.h"
+#include "ModuleBase_ModelWidget.h"
+
+#include <ModelAPI_Feature.h>
+
+
+class Config_WidgetAPI;
+class QWidget;
+class QLabel;
+class QLineEdit;
+class QToolButton;
+class ModuleBase_IWorkshop;
+
+class MODULEBASE_EXPORT ModuleBase_SelectorWidget: public ModuleBase_ModelWidget
+{
+  Q_OBJECT
+public:
+  ModuleBase_SelectorWidget(QWidget* theParent, 
+                            ModuleBase_IWorkshop* theWorkshop, 
+                            const Config_WidgetAPI* theData);
+
+  virtual ~ModuleBase_SelectorWidget();
+
+  /// Saves the internal parameters to the given feature
+  /// \param theFeature a model feature to be changed
+  virtual bool storeValue(FeaturePtr theFeature);
+
+  virtual bool restoreValue(FeaturePtr theFeature);
+
+  /// Returns whether the widget can accept focus, or if it corresponds to the given attribute
+  /// \param theAttribute name
+  virtual bool canFocusTo(const std::string& theAttributeName);
+
+  /// Set focus to the current widget if it corresponds to the given attribute
+  virtual void focusTo();
+
+  /// Returns the internal parent wiget control, that can be shown anywhere
+  /// \returns the widget
+  QWidget* getControl() const { return myContainer; }
+
+  /// Returns list of widget controls
+  /// \return a control list
+  virtual QList<QWidget*> getControls() const;
+
+  void setActivationOnStart(bool toActivate) { myActivateOnStart = toActivate; }
+  bool activateOnStart() const { return myActivateOnStart; }
+
+  FeaturePtr selectedFeature() const { return mySelectedFeature; }
+
+public slots:
+
+  /// Activate or deactivate selection
+  void activateSelection(bool toActivate);
+
+protected:
+  bool eventFilter(QObject* theObj, QEvent* theEvent);
+
+private slots:
+  void onSelectionChanged();
+
+private:
+  void enableOthersControls(bool toEnable);
+  void updateSelectionName();
+
+  std::string myFeatureAttributeID;
+
+  QWidget*     myContainer;
+  QLabel*      myLabel;
+  QLineEdit*   myTextLine;
+  QToolButton* myActivateBtn;
+
+  ModuleBase_IWorkshop* myWorkshop;
+
+  bool myActivateOnStart;
+
+  FeaturePtr mySelectedFeature;
+};
+
+#endif
\ No newline at end of file
index 1ef8c83d8bedc66cea3b12e801dd69b0ee4d303c..ecfe258e6646956c15f132d5ddb9f6a5a6b0fdcc 100644 (file)
@@ -12,6 +12,7 @@
 #include <ModuleBase_OperationDescription.h>
 #include <ModuleBase_WidgetPoint2D.h>
 #include <ModuleBase_WidgetSwitch.h>
+#include <ModuleBase_SelectorWidget.h>
 
 #include <Config_Keywords.h>
 #include <Config_WidgetAPI.h>
@@ -25,8 +26,6 @@
 #include <QPixmap>
 #include <QGroupBox>
 #include <QToolBox>
-#include <QLineEdit>
-#include <QToolButton>
 #include <QCheckBox>
 
 #ifdef _DEBUG
@@ -36,8 +35,8 @@
 #include <cfloat>
 #include <climits>
 
-ModuleBase_WidgetFactory::ModuleBase_WidgetFactory(ModuleBase_Operation* theOperation)
- : myOperation(theOperation)
+ModuleBase_WidgetFactory::ModuleBase_WidgetFactory(ModuleBase_Operation* theOperation, ModuleBase_IWorkshop* theWorkshop)
+ : myOperation(theOperation), myWorkshop(theWorkshop)
 {
   QString aXml = myOperation->getDescription()->xmlRepresentation();
   myWidgetApi = new Config_WidgetAPI(aXml.toStdString());
@@ -229,29 +228,12 @@ QString ModuleBase_WidgetFactory::qs(const std::string& theStdString) const
 
 QWidget* ModuleBase_WidgetFactory::selectorControl(QWidget* theParent)
 {
-  QWidget* aRes = new QWidget();
-  QHBoxLayout* aLayout = new QHBoxLayout(aRes);
+  ModuleBase_SelectorWidget* aSelector = new ModuleBase_SelectorWidget(theParent, myWorkshop, myWidgetApi);
+  
+  QObject::connect(aSelector, SIGNAL(valuesChanged()),  myOperation, SLOT(storeCustomValue()));
 
-  aLayout->setContentsMargins(0, 0, 0, 0);
-  QString aLabelText = qs(myWidgetApi->widgetLabel());
-  QString aLabelIcon = qs(myWidgetApi->widgetIcon());
-  QLabel* aLabel = new QLabel(aLabelText, aRes);
-  aLabel->setPixmap(QPixmap(aLabelIcon));
-
-  aLayout->addWidget(aLabel);
-
-  QLineEdit* aTextLine = new QLineEdit(aRes);
-  aTextLine->setReadOnly(true);
-
-  aLayout->addWidget(aTextLine);
-
-  QToolButton* aActivateBtn = new QToolButton(aRes);
-  aActivateBtn->setIcon(QIcon(":icons/hand_point.png"));
-  aActivateBtn->setCheckable(true);
-
-  aLayout->addWidget(aActivateBtn);
-
-  return aRes;
+  myModelWidgets.append(aSelector);
+  return aSelector->getControl();
 }
 
 
index f0303cdae36e66a47d336cb935514118650a8054..5dd799d62c706a0f71748dd60d573bc2a9b23a07 100644 (file)
@@ -8,8 +8,8 @@
 #ifndef ModuleBase_WidgetFactory_H_
 #define ModuleBase_WidgetFactory_H_
 
-#include <ModuleBase.h>
-#include <ModuleBase_ModelWidget.h>
+#include "ModuleBase.h"
+#include "ModuleBase_ModelWidget.h"
 
 #include <QString>
 #include <QList>
@@ -18,11 +18,12 @@ class QObject;
 class QWidget;
 class Config_WidgetAPI;
 class ModuleBase_Operation;
+class ModuleBase_IWorkshop;
 
 class MODULEBASE_EXPORT ModuleBase_WidgetFactory
 {
 public:
-  ModuleBase_WidgetFactory(ModuleBase_Operation*);
+  ModuleBase_WidgetFactory(ModuleBase_Operation* theOperation, ModuleBase_IWorkshop* theWorkshop);
   virtual ~ModuleBase_WidgetFactory();
 
   void createWidget(QWidget* theParent);
@@ -48,6 +49,7 @@ protected:
 private:
   Config_WidgetAPI* myWidgetApi;
   ModuleBase_Operation*   myOperation;
+  ModuleBase_IWorkshop*   myWorkshop;
 
   QList<ModuleBase_ModelWidget*> myModelWidgets;
 };
index 4eee4a29489646d15093f9cb1d10080fd7d9b488..27b7c58f481c9ea961947fc3c0af63b6386d2290 100644 (file)
@@ -1,6 +1,4 @@
 
-INCLUDE(FindCAS)
-
 SET(CMAKE_AUTOMOC ON)
 
 SET(PROJECT_HEADERS
index 2644f2a861d55eb186ead9b2f1414ac078f970f5..b0006fe5ccc13f9d9ae885c5a4fa09a20b8ae721 100644 (file)
@@ -1,5 +1,4 @@
 INCLUDE(Common)
-INCLUDE(FindCAS)
 
 SET(CMAKE_AUTOMOC ON)
 
index 8965d350e5d01e70147b10c8f00d9882a537b937..79edcc6a1c598e0d8786581ad2c9de181f87a037 100644 (file)
@@ -317,7 +317,7 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI
   std::string aDescription = aWdgReader.featureDescription(aStdCmdId);
 
   // create the operation
-  ModuleBase_Operation* anOperation;
+  ModuleBase_Operation* anOperation = 0;
   if (theCmdId == PartSet_OperationSketch::Type()) {
     anOperation = new PartSet_OperationSketch(theCmdId.c_str(), this);
   }
index ea9af50b6bfd6138eea9e3575a077cf30d68ead6..c23054513853535c1e67e5273de6241612a07da0 100644 (file)
@@ -1,4 +1,3 @@
-INCLUDE(FindCAS)
 
 SET(CMAKE_AUTOMOC ON)
 
@@ -33,6 +32,7 @@ SET(PROJECT_HEADERS
     XGUI_ViewerPrs.h
     XGUI_PropertyPanel.h
     XGUI_ContextMenuMgr.h
+    XGUI_ModuleConnector.h
 )
 
 SET(PROJECT_AUTOMOC 
@@ -64,6 +64,7 @@ SET(PROJECT_SOURCES
     XGUI_ViewerPrs.cpp
     XGUI_PropertyPanel.cpp
     XGUI_ContextMenuMgr.cpp
+    XGUI_ModuleConnector.cpp
 )
 
 SET(PROJECT_RESOURCES 
diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp
new file mode 100644 (file)
index 0000000..542eca0
--- /dev/null
@@ -0,0 +1,33 @@
+// File:        XGUI_ModuleConnector.cpp
+// Created:     3 June 2014
+// Author:      Vitaly Smetannikov
+
+
+#include "XGUI_ModuleConnector.h"
+#include "XGUI_Workshop.h"
+#include "XGUI_ViewerProxy.h"
+#include "XGUI_SelectionMgr.h"
+
+
+
+XGUI_ModuleConnector::XGUI_ModuleConnector(XGUI_Workshop* theWorkshop) 
+: ModuleBase_IWorkshop(theWorkshop), myWorkshop(theWorkshop)
+{
+  XGUI_SelectionMgr* aSelector = myWorkshop->selector();
+  connect(aSelector, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
+}
+
+XGUI_ModuleConnector::~XGUI_ModuleConnector()
+{
+}
+
+Handle(AIS_InteractiveContext) XGUI_ModuleConnector::AISContext() const
+{
+  return myWorkshop->viewer()->AISContext();
+}
+
+
+QFeatureList XGUI_ModuleConnector::selectedFeatures() const
+{
+  return myWorkshop->selector()->selectedFeatures();
+}
\ No newline at end of file
diff --git a/src/XGUI/XGUI_ModuleConnector.h b/src/XGUI/XGUI_ModuleConnector.h
new file mode 100644 (file)
index 0000000..04d7b3e
--- /dev/null
@@ -0,0 +1,38 @@
+// File:        XGUI_ModuleConnector.h
+// Created:     3 June 2014
+// Author:      Vitaly Smetannikov
+
+#ifndef XGUI_ModuleConnector_H
+#define XGUI_ModuleConnector_H
+
+
+#include "XGUI.h"
+#include "XGUI_Constants.h"
+
+#include <ModuleBase_IWorkshop.h>
+
+class Handle_AIS_InteractiveContext;
+class XGUI_Workshop;
+
+/**
+* Implementation of IWorkshop interface which provides access to Workshop sevices at module level
+*/
+class XGUI_EXPORT XGUI_ModuleConnector: public ModuleBase_IWorkshop
+{
+  Q_OBJECT
+public:
+  XGUI_ModuleConnector(XGUI_Workshop* theWorkshop);
+
+  virtual ~XGUI_ModuleConnector();
+
+  //! Returns AIS_InteractiveContext from current OCCViewer
+  virtual Handle(AIS_InteractiveContext) AISContext() const;
+
+  //! Returns list of currently selected data objects
+  QFeatureList selectedFeatures() const; 
+
+private:
+  XGUI_Workshop* myWorkshop;
+};
+
+#endif
\ No newline at end of file
index 125e1aaf4bc17cd6d52adda9f90296f88e671bb0..818e72210722732ae689684011070b0aa99dd668 100644 (file)
@@ -146,7 +146,7 @@ XGUI_ObjectsBrowser::XGUI_ObjectsBrowser(QWidget* theParent)
   aLabelWgt->setFrameShape(myTreeView->frameShape());
   aLabelWgt->setFrameShadow(myTreeView->frameShadow());
 
-  connect(myTreeView, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
+  connect(myTreeView, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
   connect(myTreeView, SIGNAL(activePartChanged(FeaturePtr)), this, SLOT(onActivePartChanged(FeaturePtr)));
   connect(myTreeView, SIGNAL(activePartChanged(FeaturePtr)), this, SIGNAL(activePartChanged(FeaturePtr)));
 
@@ -315,4 +315,11 @@ void XGUI_ObjectsBrowser::onEditItem()
       myActiveDocLbl->setProperty("OldText", myActiveDocLbl->text());
     }
   }
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::onSelectionChanged()
+{
+  myFeaturesList = myTreeView->selectedFeatures();
+  emit selectionChanged();
 }
\ No newline at end of file
index b8e275ae688e3d6f7478bc832ef244377a4eea38..8e4842df549e707f5bc29bc81f0bef552d023925 100644 (file)
@@ -96,6 +96,8 @@ private slots:
   //! Called on Edit command request
   void onEditItem();
 
+  void onSelectionChanged();
+
 private:
   void closeDocNameEditing(bool toSave);
 
index 1f7f63344662da2dfef8de75ebc948c303a4e4fc..dfd632bdab9699a1497f78fcdca15e941d36f6c7 100644 (file)
@@ -64,4 +64,4 @@ private:
   XGUI_Workshop* myWorkshop;
 };
 
-#endif
\ No newline at end of file
+#endif
index 980b8c8e0f28243771c285ceab2c4f9e74a423d9..dfe77c6f82b30f1fe13b7c77b18b15ceece383dd 100644 (file)
@@ -20,6 +20,7 @@
 #include "XGUI_ViewerProxy.h"
 #include "XGUI_PropertyPanel.h"
 #include "XGUI_ContextMenuMgr.h"
+#include "XGUI_ModuleConnector.h"
 
 #include <Model_Events.h>
 #include <ModelAPI_PluginManager.h>
@@ -91,6 +92,8 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
           this, SLOT(onContextMenuCommand(const QString&, bool)));
 
   myViewerProxy = new XGUI_ViewerProxy(this);
+  
+  myModuleConnector = new XGUI_ModuleConnector(this);
 
   connect(myOperationMgr, SIGNAL(operationStarted()), SLOT(onOperationStarted()));
   connect(myOperationMgr, SIGNAL(operationResumed()), SLOT(onOperationStarted()));
@@ -289,7 +292,7 @@ void XGUI_Workshop::onOperationStarted()
 
     showPropertyPanel();
 
-    ModuleBase_WidgetFactory aFactory = ModuleBase_WidgetFactory(aOperation);
+    ModuleBase_WidgetFactory aFactory = ModuleBase_WidgetFactory(aOperation, myModuleConnector);
     QWidget* aContent = myPropertyPanel->contentWidget();
     qDeleteAll(aContent->children());
     aFactory.createWidget(aContent);
index d7ace358b60068eb67234ed7c51be05957cf4d79..dad0857074b93a92e6e91d51226012ecf5e5e4ea 100644 (file)
@@ -25,6 +25,7 @@ class XGUI_SalomeViewer;
 class XGUI_ViewerProxy;
 class XGUI_PropertyPanel;
 class XGUI_ContextMenuMgr;
+class XGUI_ModuleConnector;
 
 class ModuleBase_Operation;
 
@@ -174,6 +175,7 @@ private:
   XGUI_ErrorDialog* myErrorDlg;
   XGUI_ViewerProxy* myViewerProxy;
   XGUI_ContextMenuMgr* myContextMenuMgr;
+  XGUI_ModuleConnector* myModuleConnector;
 
   QString myCurrentDir;
   static QMap<QString, QString> myIcons;