- clean programming code

- add signals for GEOMGUI-->DependecyTree cooperation
- begin of documentation
This commit is contained in:
mpa 2014-06-05 11:44:52 +04:00
parent 633e63eb2e
commit 6076f118e7
18 changed files with 315 additions and 143 deletions

BIN
doc/salome/gui/GEOM/images/pref15.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View 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>
*/

View File

@ -73,6 +73,7 @@
<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" />

View File

@ -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

View File

@ -18,7 +18,6 @@
#
INCLUDE(UseQt4Ext)
INCLUDE(${QT_USE_FILE})
# --- options ---
@ -26,25 +25,13 @@ 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/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
@ -52,21 +39,16 @@ ADD_DEFINITIONS(
${QT_DEFINITIONS}
${GUI_DEFINITIONS}
${CAS_DEFINITIONS}
${OMNIORB_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 ---

View 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,10 +172,11 @@ void DependencyTree_Object::updateName()
if( studyEntry.isEmpty() ) {
if( name.isEmpty() )
name = "unpublished";
myColor = QColor( 255, 255, 255 );
myColor = myUnpublishObjectColor;
}
myPolygonItem->setBrush( myColor );
myPolygonItem->setPen( getPen( myColor ) );
}
setName( name );
@ -204,7 +203,12 @@ void DependencyTree_Object::updateName()
//=================================================================================
void DependencyTree_Object::setColor( const QColor& 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

View 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;

View 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 )

View 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

View 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;

View 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

View File

@ -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}

View 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>

View 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>

View File

@ -5003,6 +5003,66 @@
<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>

View File

@ -75,10 +75,6 @@
#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;
}

View 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;