X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ChannelOp.cxx;h=e820deb641e97d42beba677505cbd82b080385ca;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=4078af047d4ddd77aeeff284df7a183f56883768;hpb=ffb8db1342d5e9eaed69dc15dd51eacfd77da0bd;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index 4078af04..e820deb6 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -23,6 +23,7 @@ #include "HYDROGUI_ChannelOp.h" #include "HYDROGUI_DataModel.h" +#include #include "HYDROGUI_ChannelDlg.h" #include "HYDROGUI_Module.h" #include "HYDROGUI_Shape.h" @@ -143,7 +144,8 @@ HYDROGUI_InputPanel* HYDROGUI_ChannelOp::createInputPanel() const } bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags, - QString& theErrorMsg ) + QString& theErrorMsg, + QStringList& theBrowseObjectsEntries ) { HYDROGUI_ChannelDlg* aPanel = ::qobject_cast( inputPanel() ); if ( !aPanel ) @@ -156,7 +158,7 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags, return false; } - if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) ) + if ( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) ) { // check that there are no other objects with the same name in the document Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName ); @@ -203,7 +205,11 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags, erasePreview(); if( !myIsEdit ) + { module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), myEditedObject, true ); + QString anEntry = HYDROGUI_DataObject::dataObjectEntry( myEditedObject ); + theBrowseObjectsEntries.append( anEntry ); + } module()->setIsToUpdate( myEditedObject ); @@ -256,7 +262,20 @@ void HYDROGUI_ChannelOp::onCreatePreview() { Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext(); if ( !aCtx.IsNull() ) + { myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() ); + + QColor aFillingColor = getDefaultFillingColor(); + QColor aBorderColor = getDefaultBorderColor(); + if ( !myEditedObject.IsNull() ) + { + aFillingColor = myEditedObject->GetFillingColor(); + aBorderColor = myEditedObject->GetBorderColor(); + } + + myPreviewPrs->setFillingColor( aFillingColor, false, false ); + myPreviewPrs->setBorderColor( aBorderColor, false, false ); + } } } @@ -270,23 +289,12 @@ void HYDROGUI_ChannelOp::onCreatePreview() HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) ); HYDROData_Channel::PrsDefinition aPrsDef; - if ( !HYDROData_Channel::CreatePresentaions( aGuideLine, aProfile, aPrsDef ) ) + if ( !HYDROData_Channel::CreatePresentations( aGuideLine, aProfile, aPrsDef ) ) { erasePreview(); return; } - QColor aFillingColor = getDefaultFillingColor(); - QColor aBorderColor = getDefaultBorderColor(); - if ( !myEditedObject.IsNull() ) - { - aFillingColor = myEditedObject->GetFillingColor(); - aBorderColor = myEditedObject->GetBorderColor(); - } - - myPreviewPrs->setFillingColor( aFillingColor, false, false ); - myPreviewPrs->setBorderColor( aBorderColor, false, false ); - myPreviewPrs->setShape( aPrsDef.myPrs2D ); }