Salome HOME
- clean programming code
authormpa <mpa@opencascade.com>
Thu, 5 Jun 2014 07:44:52 +0000 (11:44 +0400)
committermpa <mpa@opencascade.com>
Thu, 5 Jun 2014 07:44:52 +0000 (11:44 +0400)
- add signals for GEOMGUI-->DependecyTree cooperation
- begin of documentation

18 files changed:
doc/salome/gui/GEOM/images/pref15.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/pref_dep_tree.png [new file with mode: 0644]
doc/salome/gui/GEOM/input/geometry_preferences.doc
resources/SalomeApp.xml.in
src/CMakeLists.txt
src/DependencyTree/CMakeLists.txt
src/DependencyTree/DependencyTree_Object.cxx
src/DependencyTree/DependencyTree_Object.h
src/DependencyTree/DependencyTree_Selector.cxx
src/DependencyTree/DependencyTree_View.cxx
src/DependencyTree/DependencyTree_View.h
src/DependencyTree/DependencyTree_ViewModel.cxx
src/GEOMGUI/CMakeLists.txt
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI.h

old mode 100755 (executable)
new mode 100644 (file)
index c4b2cac..0fec280
Binary files a/doc/salome/gui/GEOM/images/pref15.png and b/doc/salome/gui/GEOM/images/pref15.png differ
diff --git a/doc/salome/gui/GEOM/images/pref_dep_tree.png b/doc/salome/gui/GEOM/images/pref_dep_tree.png
new file mode 100644 (file)
index 0000000..c021343
Binary files /dev/null and b/doc/salome/gui/GEOM/images/pref_dep_tree.png differ
index 6ad3270cb483362b36afccb84d5daeb712d4c277..f06e510bbe14f8586c35a463db07d22d92773c2f 100644 (file)
@@ -128,5 +128,34 @@ system immediately after the module activation.</li>
 </ul>
 </ul>
 
+Also you can set preferences for visualisation of <b>Dependency Tree</b> in 2D Viewer.
+
+\image html pref_dep_tree.png
+
+<ul>
+<li><b>General</b></li>
+<ul>
+<li><b>Hierarchy type</b> - allows to choose between display only ascendants tree,
+display only descendants tree or display both ascendants and descendants trees.</li>
+<li><b>Possibility to move nodes</b> - allows to customize the moving nodes by default.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Color</b></li>
+<ul>
+<li><b>Background color</b> - allows to select default background color.</li>
+<li><b>Default node color</b> - allows to select default node color.</li>
+<li><b>Main node color</b> - allows to select default main node color.</li>
+<li><b>Unpublished node color</b> - allows to select default node color
+for unpublished objects.</li>
+<li><b>Selected node color</b> - allows to select default selected node color.</li>
+<li><b>Default arrow color</b> - allows to select default arrow color.</li>
+<li><b>Highlighted arrow color</b> - allows to select default highlighted 
+arrow color.</li>
+<li><b>Selected arrow color</b> - allows to select default selected 
+arrow color.</li>
+</ul>
+</ul>
 
 */
index 465b04884fb8f27c942199ea9bdd8893ad0afd72..24a0f148d13b806b0af4d7f3a10ff26e4d5be8e4 100644 (file)
     <parameter name="measures_line_width" value="1" />
     <parameter name="iso_number_u"        value="0" />
     <parameter name="iso_number_v"        value="0" />
-    <parameter name="dependency_tree_hierarchy_type" value="0" />
-    <parameter name="dependency_tree_move_nodes"     value="true" />
-    <parameter name="dependency_tree_background_color" value="255, 255, 255" />
-    <parameter name="dependency_tree_node_color"     value="62, 180, 238" />
-    <parameter name="dependency_tree_main_node_color" value="238, 90, 125" />
-    <parameter name="dependency_tree_select_node_color" value="237, 243, 58" />
-    <parameter name="dependency_tree_arrow_color"    value="0, 0, 130" />
+    <parameter name="dependency_tree_hierarchy_type"        value="0" />
+    <parameter name="dependency_tree_move_nodes"            value="true" />
+    <parameter name="dependency_tree_background_color"      value="255, 255, 255" />
+    <parameter name="dependency_tree_node_color"            value="62, 180, 238" />
+    <parameter name="dependency_tree_main_node_color"       value="238, 90, 125" />
+    <parameter name="dependency_tree_unpublish_node_color"  value="255, 255, 255" />
+    <parameter name="dependency_tree_select_node_color"     value="237, 243, 58" />
+    <parameter name="dependency_tree_arrow_color"           value="0, 0, 130" />
     <parameter name="dependency_tree_highlight_arrow_color" value="0, 0, 255" />
-    <parameter name="dependency_tree_select_arrow_color" value="255, 0, 0" />
+    <parameter name="dependency_tree_select_arrow_color"    value="255, 0, 0" />
 
     <!-- Dimension presentation properties -->
     <parameter name="dimensions_color"          value="#ffffff" />
index 624c14bcc78b07175e86a9a5701b4fcfe4313c73..641853c220b7f97fb1da10a9c54cce72948d5e73 100755 (executable)
@@ -50,8 +50,8 @@ ENDIF()
 ##
 IF(SALOME_BUILD_GUI)
   SET(SUBDIRS_GUI
-    DependencyTree OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI
-    GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
+    OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI
+    GEOMBase DependencyTree GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
     EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
     RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI ImportExportGUI
     GEOM_SWIG_WITHIHM
index a3807832a017e0a4ed50e6347f433f13d941a50c..b57dce943666815c9f79b8f30b6b1d1e361d880d 100644 (file)
@@ -18,7 +18,6 @@
 #
 
 INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
 
 # --- options ---
 
@@ -26,47 +25,30 @@ INCLUDE(${QT_USE_FILE})
 INCLUDE_DIRECTORIES(
   ${QT_INCLUDES}
   ${GUI_INCLUDE_DIRS}
-  ${CAS_INCLUDE_DIRS}
-  ${OMNIORB_INCLUDE_DIR}
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_BINARY_DIR}
   ${PROJECT_SOURCE_DIR}/src/GEOMGUI
   ${PROJECT_SOURCE_DIR}/src/GEOMBase
-    ${PROJECT_SOURCE_DIR}/src/GEOM
-        ${PROJECT_SOURCE_DIR}/src/GEOMUtils
-    
-    
-      ${PROJECT_BINARY_DIR}/idl
-  ${PROJECT_BINARY_DIR}
+  ${PROJECT_SOURCE_DIR}/src/GEOM
   ${PROJECT_SOURCE_DIR}/src/OBJECT
-  ${PROJECT_SOURCE_DIR}/src/GEOMClient
-  ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMUtils
-  ${PROJECT_SOURCE_DIR}/src/DlgRef
-  ${PROJECT_BINARY_DIR}/src/DlgRef
-  
+  ${PROJECT_SOURCE_DIR}/src/GEOMClient
+  ${PROJECT_BINARY_DIR}/idl 
   )
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(
   ${QT_DEFINITIONS}
   ${GUI_DEFINITIONS}
-    ${CAS_DEFINITIONS}
-  ${OMNIORB_DEFINITIONS}
+  ${CAS_DEFINITIONS}
   )
 
 # libraries to link to
 SET(_link_LIBRARIES
   ${QT_LIBRARIES}
   ${GUI_SalomeApp}
-  ${GUI_suit}
-  ${GUI_qtx}
-  ${GUI_QxScene}
   ${GUI_GraphicsView}
-  ${GUI_SalomeObject}
-  GEOMUtils
-  ${KERNEL_SalomeDS}
-)
+  GEOM
+  GEOMBase
+  )
 
 # --- headers ---
 
@@ -80,7 +62,7 @@ SET(DependencyTree_HEADERS
 SET(_moc_HEADERS
   DependencyTree_View.h
   DependencyTree_ViewModel.h
-)
+  )
 
 # --- sources ---
 
@@ -88,13 +70,13 @@ SET(_moc_HEADERS
 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
 SET(DependencyTree_SOURCES
-  DependencyTree_View.cxx
-  DependencyTree_Object.cxx
   DependencyTree_Arrow.cxx
+  DependencyTree_Object.cxx
   DependencyTree_Selector.cxx
+  DependencyTree_View.cxx
   DependencyTree_ViewModel.cxx
   ${_moc_SOURCES}
-)
+  )
 
 # --- resources ---
 
@@ -103,7 +85,7 @@ SET(_res_files
   resources/DependencyTree_msg_en.ts     
   resources/DependencyTree_msg_fr.ts 
   resources/DependencyTree_msg_ja.ts          
-)
+  )
 
 # --- rules ---
 
index ebe0cfe90ccf44f856e12f937debe8ce8947f3e5..a25f4caa3d6d050a28751ff5445c2e9b94279af6 100644 (file)
@@ -22,7 +22,6 @@
 
 // GEOM includes
 #include <GeometryGUI.h>
-#include <GEOM_BaseObject.hxx>
 
 // GUI includes
 #include <SUIT_Session.h>
@@ -45,6 +44,7 @@ myIsMainObject( false )
   myColor = resMgr->colorValue( "Geometry", "dependency_tree_node_color", QColor( 62, 180, 238 ) );
   mySelectColor = resMgr->colorValue( "Geometry", "dependency_tree_select_node_color", QColor( 237, 243, 58 ) );
   myMainObjectColor = resMgr->colorValue( "Geometry", "dependency_tree_main_node_color", QColor( 238, 90, 125 ) );
+  myUnpublishObjectColor = resMgr->colorValue( "Geometry", "dependency_tree_unpublish_node_color", QColor( 255, 255, 255 ) );
 
   myPolygonItem = new QGraphicsPolygonItem();
   QPolygonF myPolygon;
@@ -52,8 +52,6 @@ myIsMainObject( false )
             << QPointF( -itemW, itemH )  << QPointF( -itemW, -itemH );
 
   myPolygonItem->setPolygon( myPolygon );
-  myPolygonItem->setBrush( myColor );
-  myPolygonItem->setPen( getPen( myColor ) );
 
   myTextItem = new QGraphicsSimpleTextItem();
   QFont textFont;
@@ -174,11 +172,12 @@ void DependencyTree_Object::updateName()
   if( studyEntry.isEmpty() ) {
        if( name.isEmpty() )
       name = "unpublished";
-    myColor = QColor( 255, 255, 255 );
-    myPolygonItem->setBrush( myColor );
-    myPolygonItem->setPen( getPen( myColor ) );
+    myColor = myUnpublishObjectColor;
   }
 
+  myPolygonItem->setBrush( myColor );
+  myPolygonItem->setPen( getPen( myColor ) );
+
   setName( name );
 
   myTextItem->setText( name );
@@ -204,7 +203,12 @@ void DependencyTree_Object::updateName()
 //=================================================================================
 void DependencyTree_Object::setColor( const QColor& theColor )
 {
-  myColor = theColor;
+  QString studyEntry = myGeomObject->GetStudyEntry();
+  if( studyEntry.isEmpty() )
+    myColor = myUnpublishObjectColor;
+  else
+    myColor = theColor;
+
 }
 
 //=================================================================================
@@ -225,6 +229,18 @@ void DependencyTree_Object::setMainObjectColor( const QColor& theColor )
   myMainObjectColor = theColor;
 }
 
+//=================================================================================
+// function : setUnpublishObjectColor()
+// purpose  : set color if current item is unpublished object
+//=================================================================================
+void DependencyTree_Object::setUnpublishObjectColor( const QColor& theColor )
+{
+  myUnpublishObjectColor = theColor;
+  QString studyEntry = myGeomObject->GetStudyEntry();
+  if( studyEntry.isEmpty() )
+    myColor = myUnpublishObjectColor;
+}
+
 //=================================================================================
 // function : setIsMainObject()
 // purpose  : set true if current item is main object of dependency tree
index 64be40adc8123bbed41e9a02924093d345a0e025..fae775edcff3765a2c4e820cc195ec6863ef60c9 100644 (file)
@@ -23,8 +23,8 @@
 #include <GraphicsView_Object.h>
 
 // GEOM includes
-#include <GeometryGUI.h>
-#include <GEOM_BaseObject.hxx>
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
 
 #include <QPen>
 
@@ -50,9 +50,10 @@ public:
 
   void                        updateName();
 
-  void                        setColor(const QColor& );
-  void                        setSelectColor(const QColor& );
-  void                        setMainObjectColor(const QColor& );
+  void                        setColor( const QColor& );
+  void                        setSelectColor( const QColor& );
+  void                        setMainObjectColor( const QColor& );
+  void                        setUnpublishObjectColor( const QColor& );
 
   void                        setIsMainObject( bool );
 
@@ -63,6 +64,7 @@ private:
   QColor                      myColor;
   QColor                      mySelectColor;
   QColor                      myMainObjectColor;
+  QColor                      myUnpublishObjectColor;
 
   QGraphicsPolygonItem*       myPolygonItem;
   QGraphicsSimpleTextItem*    myTextItem;
index 7d17d63c8d5c4895aec4364eb40e3408d05b529d..370e4511cabea1abb607b7d053064bce6d094cdf 100644 (file)
@@ -28,6 +28,7 @@
 
 //GEOM includes
 #include <GEOMBase.h>
+#include <GeometryGUI.h>
 
 DependencyTree_Selector::DependencyTree_Selector( DependencyTree_ViewModel* theModel, SUIT_SelectionMgr* theSelMgr )
 :LightApp_GVSelector( (GraphicsView_Viewer*)theModel, theSelMgr )
index e675dc410b9d4b8746ec6d4032f417020fe61cfe..42e8715e7801ee76824b815b87946f8fef002e6d 100644 (file)
@@ -117,8 +117,16 @@ void DependencyTree_View::init( GraphicsView_ViewFrame* theViewFrame )
   connect( myDisplayDescendants, SIGNAL( toggled( bool ) ), this, SLOT( onHierarchyType() ) );
   connect( updateButton, SIGNAL( clicked() ), this, SLOT( onUpdateModel() ) );
 
-  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+  GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+  if ( aGeomGUI ) {
+    connect( aGeomGUI, SIGNAL( SignalDependencyTreeParamChanged( const QString&, const QString& ) ),
+             this, SLOT( onPreferenceChanged( const QString&, const QString& ) ) );
+    connect( aGeomGUI, SIGNAL( SignalDependencyTreeRenameObject( const QString& ) ),
+             this, SLOT( onRenameObject( const QString& ) ) );
+  }
 
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   setPrefBackgroundColor( resMgr->colorValue( "Geometry", "dependency_tree_background_color", QColor( 255, 255, 255 ) ) );
   setNodesMovable( resMgr->booleanValue( "Geometry", "dependency_tree_move_nodes", true ) );
   setHierarchyType( resMgr->integerValue( "Geometry", "dependency_tree_hierarchy_type", 0 ) );
@@ -175,22 +183,6 @@ DependencyTree_Object* DependencyTree_View::getObjectByEntry( const std::string&
   return myTreeMap[ theEntry ];
 }
 
-//=================================================================================
-// function : updateObjectName()
-// purpose  : update object name, having edited it in Object Browser
-//=================================================================================
-bool DependencyTree_View::updateObjectName( const std::string& theEntry )
-{
-  bool res = false;
-  for( initSelected(); moreSelected(); nextSelected() ) {
-    if( DependencyTree_Object* aDepObject = dynamic_cast<DependencyTree_Object*>( selectedObject() ) ) {
-      aDepObject->updateName();
-      res = true;
-    }
-  }
-  return res;
-}
-
 //=================================================================================
 // function : setHierarchyType()
 // purpose  : set hierarchy type of dependency tree
@@ -267,6 +259,19 @@ void DependencyTree_View::setMainNodeColor( const QColor& theColor )
   }
 }
 
+//=================================================================================
+// function : setUnpublishNodeColor()
+// purpose  : set unpublished node color from preferences
+//=================================================================================
+void DependencyTree_View::setUnpublishNodeColor( const QColor& theColor )
+{
+  EntryObjectMap::const_iterator i;
+  for( i = myTreeMap.begin(); i != myTreeMap.end(); i++ ) {
+    DependencyTree_Object* object = myTreeMap[ i->first ];
+    object->setUnpublishObjectColor( theColor );
+  }
+}
+
 //=================================================================================
 // function : setSelectNodeColor()
 // purpose  : set selected node color from preferences
@@ -369,6 +374,66 @@ void DependencyTree_View::onHierarchyType()
   updateView();
 }
 
+//=================================================================================
+// function : onPreferencesChanged()
+// purpose  : slot for changing tree parameters from preferences
+//=================================================================================
+void DependencyTree_View::onPreferenceChanged( const QString& section, const QString& param )
+{
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+  if( param == QString("dependency_tree_hierarchy_type") ) {
+    int hierarchyType = resMgr->integerValue( section, param, 0);
+    setHierarchyType( hierarchyType );
+  }
+  else if(  param == QString("dependency_tree_move_nodes") ) {
+    bool isNodesMovable = resMgr->booleanValue( section, param, true);
+    setNodesMovable( isNodesMovable );
+  }
+  else if(  param == QString("dependency_tree_background_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 255, 255, 255 ) );
+    setPrefBackgroundColor( c );
+  }
+  else if(  param == QString("dependency_tree_node_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 62, 180, 238 ) );
+    setNodeColor( c );
+  }
+  else if(  param == QString("dependency_tree_main_node_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 238, 90, 125 ) );
+    setMainNodeColor( c );
+  }
+  else if(  param == QString("dependency_tree_unpublish_node_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 255, 255, 255 ) );
+    setUnpublishNodeColor( c );
+  }
+  else if(  param == QString("dependency_tree_select_node_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 237, 243, 58 ) );
+    setSelectNodeColor( c );
+  }
+  else if(  param == QString("dependency_tree_arrow_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 0, 0, 130 ) );
+    setArrowColor( c );
+  }
+  else if(  param == QString("dependency_tree_highlight_arrow_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 0, 0, 255 ) );
+    setHighlightArrowColor( c );
+  }
+  else if(  param == QString("dependency_tree_select_arrow_color") ) {
+    QColor c = resMgr->colorValue( section, param, QColor( 255, 0, 0 ) );
+    setSelectArrowColor( c );
+  }
+}
+
+//=================================================================================
+// function : onRenameObject()
+// purpose  : update object name, having edited it in Object Browser
+//=================================================================================
+void DependencyTree_View::onRenameObject( const QString& theEntry )
+{
+  DependencyTree_Object* object = getObjectByEntry( theEntry.toStdString() );
+  object->updateName();
+}
+
 //=================================================================================
 // function : parseTree()
 // purpose  : parse created model to initialize all nodes and arrows
index 94943ab7dac36f7620596696447e1619d8a2efe1..29d16bae50848f5fa5115e0f1dedd41c15b3fe09 100644 (file)
@@ -60,17 +60,6 @@ public:
   int                     getStudyId() const;
 
   DependencyTree_Object*  getObjectByEntry( const std::string& );
-  bool                    updateObjectName( const std::string& theEntry );
-
-  void                    setHierarchyType( const int );
-  void                    setNodesMovable( const bool );
-  void                    setPrefBackgroundColor( const QColor& );
-  void                    setNodeColor( const QColor& );
-  void                    setMainNodeColor( const QColor& );
-  void                    setSelectNodeColor( const QColor& );
-  void                    setArrowColor( const QColor& );
-  void                    setHighlightArrowColor( const QColor& );
-  void                    setSelectArrowColor( const QColor& );
 
 public slots:
 
@@ -81,6 +70,8 @@ private slots:
   void                    onUpdateModel();
   void                    onMoveNodes( bool );
   void                    onHierarchyType();
+  void                    onPreferenceChanged( const QString&, const QString& );
+  void                    onRenameObject( const QString& theEntry );
 
 private:
 
@@ -99,9 +90,20 @@ private:
   void                    updateView();
   void                    clearView( bool );
 
+  int                     checkMaxLevelsNumber();
+
   void                    getNewTreeModel( bool = true, bool = true );
 
-  int                     checkMaxLevelsNumber();
+  void                    setHierarchyType( const int );
+  void                    setNodesMovable( const bool );
+  void                    setPrefBackgroundColor( const QColor& );
+  void                    setNodeColor( const QColor& );
+  void                    setMainNodeColor( const QColor& );
+  void                    setUnpublishNodeColor( const QColor& );
+  void                    setSelectNodeColor( const QColor& );
+  void                    setArrowColor( const QColor& );
+  void                    setHighlightArrowColor( const QColor& );
+  void                    setSelectArrowColor( const QColor& );
 
   GEOMUtils::TreeModel    myTreeModel;
 
index bc62e35c67671b430d0f9a19f4629bb8c10d42f9..74bf9f2c419dd4d270f8edb6413eed695d39e7b3 100644 (file)
@@ -26,6 +26,7 @@
 #include <SalomeApp_Study.h>
 #include <LightApp_SelectionMgr.h>
 #include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
 #include <OCCViewer_ViewManager.h>
 
 // GEOM includes
index 9ac75127391f5fa7b996e5fad287881159041484..c5dc25f8a481b9ede31d8a151be6027d2015735e 100755 (executable)
@@ -39,7 +39,6 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GEOMClient
   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMUtils
-  ${PROJECT_SOURCE_DIR}/src/DependencyTree
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
@@ -59,7 +58,6 @@ SET(_link_LIBRARIES
   Material
   GEOMImpl
   GEOMUtils
-  DependencyTree
   ${KERNEL_SALOMELocalTrace}
   ${KERNEL_SalomeDS}
   ${KERNEL_SalomeDSClient}
index 5f45808a3958c94172ce770c39b32352dde626ee..6f21d29b1d1ec675d4eee5d161bb119313b4347e 100644 (file)
@@ -5068,13 +5068,17 @@ Please, select face, shell or solid and try again</translation>
         <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
         <translation>Main node color</translation>
     </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+        <translation>Unpublished node color</translation>
+    </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
         <translation>Selected node color</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
-        <translation>Arrow color</translation>
+        <translation>Default arrow color</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
index 7c7878d8604a85fcb3523ad0144ff2c912327026..1c3146a9af03920cf99f8d035c0706b836126099 100644 (file)
@@ -5028,6 +5028,66 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_PREVIEW</source>
         <translation>Prévisualiser</translation>
     </message>
+    <message>
+        <source>PREF_TAB_DEPENDENCY_VIEW</source>
+        <translation type="unfinished">Dependency Tree</translation>
+    </message>
+    <message>
+        <source>PREF_HIERARCHY_TYPE</source>
+        <translation type="unfinished">Hierarchy type</translation>
+    </message>
+    <message>
+        <source>MEN_ONLY_ASCENDANTS</source>
+        <translation type="unfinished">Display only ascendants tree</translation>
+    </message>
+    <message>
+        <source>MEN_ONLY_DESCENDANTS</source>
+        <translation type="unfinished">Display only descendants tree</translation>
+    </message>
+    <message>
+        <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+        <translation type="unfinished">Display both ascendants and descendants trees</translation>
+    </message>
+    <message>
+        <source>GEOM_MOVE_POSSIBILITY</source>
+        <translation type="unfinished">Possibility to move nodes</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+        <translation type="unfinished">Color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+        <translation type="unfinished">Background color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+        <translation type="unfinished">Default node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+        <translation type="unfinished">Main node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+        <translation type="unfinished">Unpublished node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+        <translation type="unfinished">Selected node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+        <translation type="unfinished">Arrow color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+        <translation type="unfinished">Highlighted arrow color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+        <translation type="unfinished">Selected arrow color</translation>
+    </message>
     <message>
         <source>GEOM_ALL_IMPORT_FILES</source>
         <translation>Tous les formats supportés ( %1 )</translation>
index ecad4cb1f49f3f80b22d38b6f9da2183769ca945..0609b2ae21a704176d126fe128aa365f1e6c2816 100644 (file)
       <source>GEOM_PREVIEW</source>
       <translation>プレビュー</translation>
     </message>
+    <message>
+        <source>PREF_TAB_DEPENDENCY_VIEW</source>
+        <translation type="unfinished">Dependency Tree</translation>
+    </message>
+    <message>
+        <source>PREF_HIERARCHY_TYPE</source>
+        <translation type="unfinished">Hierarchy type</translation>
+    </message>
+    <message>
+        <source>MEN_ONLY_ASCENDANTS</source>
+        <translation type="unfinished">Display only ascendants tree</translation>
+    </message>
+    <message>
+        <source>MEN_ONLY_DESCENDANTS</source>
+        <translation type="unfinished">Display only descendants tree</translation>
+    </message>
+    <message>
+        <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+        <translation type="unfinished">Display both ascendants and descendants trees</translation>
+    </message>
+    <message>
+        <source>GEOM_MOVE_POSSIBILITY</source>
+        <translation type="unfinished">Possibility to move nodes</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+        <translation type="unfinished">Color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+        <translation type="unfinished">Background color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+        <translation type="unfinished">Default node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+        <translation type="unfinished">Main node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+        <translation type="unfinished">Unpublished node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+        <translation type="unfinished">Selected node color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+        <translation type="unfinished">Arrow color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+        <translation type="unfinished">Highlighted arrow color</translation>
+    </message>
+    <message>
+        <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+        <translation type="unfinished">Selected arrow color</translation>
+    </message>
     <message>
       <source>GEOM_ALL_IMPORT_FILES</source>
       <translation>サポートされているすべての形式 (%1)</translation>
index 8fed3dfef05e952ba0a84b39e0e021ffbb7b5962..0da53dde9598571190cb5ffe0cd15115f2abe207 100644 (file)
 #include <LightApp_DataObject.h>
 #include <LightApp_Preferences.h>
 
-#include <GraphicsView_Viewer.h>
-#include <DependencyTree_View.h>
-#include <DependencyTree_ViewModel.h>
-
 #include <SALOME_LifeCycleCORBA.hxx>
 // #include <SALOME_ListIO.hxx>
 #include <SALOME_ListIteratorOfListIO.hxx>
@@ -2630,7 +2626,9 @@ void GeometryGUI::createPreferences()
 
   int DependencyViewId = addPreference( tr( "PREF_TAB_DEPENDENCY_VIEW" ) );
 
-  int hierarchy_type = addPreference( tr( "PREF_HIERARCHY_TYPE" ), DependencyViewId,
+  int treeGeneralGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), DependencyViewId );
+
+  int hierarchy_type = addPreference( tr( "PREF_HIERARCHY_TYPE" ), treeGeneralGroup,
                       LightApp_Preferences::Selector, "Geometry", "dependency_tree_hierarchy_type" );
 
   QStringList aHierarchyTypeList;
@@ -2646,7 +2644,7 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( hierarchy_type, "strings", aHierarchyTypeList );
   setPreferenceProperty( hierarchy_type, "indexes", aHierarchyTypeIndexesList );
 
-  addPreference( tr( "GEOM_MOVE_POSSIBILITY" ), DependencyViewId,
+  addPreference( tr( "GEOM_MOVE_POSSIBILITY" ), treeGeneralGroup,
                  LightApp_Preferences::Bool, "Geometry", "dependency_tree_move_nodes" );
 
   int treeColorGroup = addPreference( tr( "PREF_GROUP_DEPENDENCY_VIEW_COLOR" ), DependencyViewId );
@@ -2658,6 +2656,8 @@ void GeometryGUI::createPreferences()
                  LightApp_Preferences::Color, "Geometry", "dependency_tree_node_color" );
   addPreference( tr( "PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR"), treeColorGroup,
                  LightApp_Preferences::Color, "Geometry", "dependency_tree_main_node_color" );
+  addPreference( tr( "PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR"), treeColorGroup,
+                 LightApp_Preferences::Color, "Geometry", "dependency_tree_unpublish_node_color" );
   addPreference( tr( "PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR"), treeColorGroup,
                  LightApp_Preferences::Color, "Geometry", "dependency_tree_select_node_color" );
 
@@ -2742,54 +2742,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par
       aDisplayer.UpdateViewer();
     }
     else if ( param.startsWith( "dependency_tree") )
-    {
-      SalomeApp_Application* app = getApp();
-      if ( !app ) return;
-
-      SUIT_ViewManager *svm = app->getViewManager( GraphicsView_Viewer::Type(), false );
-      if( !svm ) return;
-
-      if( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
-        if( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) ) {
-          if( param == QString("dependency_tree_hierarchy_type") ) {
-            int hierarchyType = aResourceMgr->integerValue( section, param, 0);
-            view->setHierarchyType( hierarchyType );
-          }
-          else if(  param == QString("dependency_tree_move_nodes") ) {
-            bool isNodesMovable = aResourceMgr->booleanValue( section, param, true);
-            view->setNodesMovable( isNodesMovable );
-          }
-          else if(  param == QString("dependency_tree_background_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 255, 255, 255 ) );
-            view->setPrefBackgroundColor( c );
-          }
-          else if(  param == QString("dependency_tree_node_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 62, 180, 238 ) );
-            view->setNodeColor( c );
-          }
-          else if(  param == QString("dependency_tree_main_node_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 238, 90, 125 ) );
-            view->setMainNodeColor( c );
-          }
-          else if(  param == QString("dependency_tree_select_node_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 237, 243, 58 ) );
-            view->setSelectNodeColor( c );
-          }
-          else if(  param == QString("dependency_tree_arrow_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 0, 0, 130 ) );
-            view->setArrowColor( c );
-          }
-          else if(  param == QString("dependency_tree_highlight_arrow_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 0, 0, 255 ) );
-            view->setHighlightArrowColor( c );
-          }
-          else if(  param == QString("dependency_tree_select_arrow_color") ) {
-            QColor c = aResourceMgr->colorValue( section, param, QColor( 255, 0, 0 ) );
-            view->setSelectArrowColor( c );
-          }
-
-      }
-    }
+      emit SignalDependencyTreeParamChanged( section, param );
   }
 }
 
@@ -3343,11 +3296,7 @@ bool GeometryGUI::renameObject( const QString& entry, const QString& name)
       GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
       if (!CORBA::is_nil(anObj)) {
         anObj->SetName( name.toLatin1().data() );  // Rename the corresponding GEOM_Object
-        // rename the given object in the dependency tree
-        if ( SUIT_ViewManager *svm = app->getViewManager( GraphicsView_Viewer::Type(), false ) )
-          if ( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
-            if ( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) )
-              view->updateObjectName( anObj->GetEntry() );
+        emit SignalDependencyTreeRenameObject( anObj->GetEntry() );
       }
       result = true;
     }
index 4f28fc928da5adc72955c3bdfa9529c7a41a1511..f2f2ad8e5661fd7d67e5c372f34b4f0f406c1796 100644 (file)
@@ -182,6 +182,8 @@ signals :
   void                        SignalDeactivateActiveDialog();
   void                        SignalCloseAllDialogs();
   void                        SignalDefaultStepValueChanged( double newVal );
+  void                        SignalDependencyTreeParamChanged( const QString&, const QString& );
+  void                        SignalDependencyTreeRenameObject( const QString& );
 
 protected:
   virtual LightApp_Selection* createSelection() const;