mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 13:40:32 +05:00
Additional changes for the Point 2 of the "20948: EDF 1468 SMESH: Histogram of the quality controls" issue.
This commit is contained in:
parent
ddc98ff4c0
commit
1758d524e7
@ -533,6 +533,13 @@ SMESH_ActorDef::~SMESH_ActorDef()
|
|||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
|
if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
|
||||||
|
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
if(my2dHistogram) {
|
||||||
|
SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
|
||||||
|
delete my2dHistogram;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// caught by SMESHGUI::ProcessEvents() static method
|
// caught by SMESHGUI::ProcessEvents() static method
|
||||||
this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
|
this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
|
||||||
|
|
||||||
@ -617,10 +624,6 @@ SMESH_ActorDef::~SMESH_ActorDef()
|
|||||||
myImplicitBoolean->Delete();
|
myImplicitBoolean->Delete();
|
||||||
|
|
||||||
myTimeStamp->Delete();
|
myTimeStamp->Delete();
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
|
||||||
if(my2dHistogram)
|
|
||||||
delete my2dHistogram;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1344,6 +1347,10 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
|
|||||||
if(myIsCellsLabeled)
|
if(myIsCellsLabeled)
|
||||||
myCellsLabels->VisibilityOn();
|
myCellsLabels->VisibilityOn();
|
||||||
}
|
}
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
else
|
||||||
|
SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
|
||||||
|
#endif
|
||||||
UpdateHighlight();
|
UpdateHighlight();
|
||||||
Modified();
|
Modified();
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,19 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "SMESH_ActorUtils.h"
|
#include "SMESH_ActorUtils.h"
|
||||||
|
#include "SMESH_Actor.h"
|
||||||
|
|
||||||
#include "SUIT_Tools.h"
|
#include "SUIT_Tools.h"
|
||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include "SUIT_ResourceMgr.h"
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
#include <SPlot2d_ViewModel.h>
|
||||||
|
#include <SPlot2d_Histogram.h>
|
||||||
|
#include <Plot2d_ViewManager.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
@ -126,4 +135,49 @@ namespace SMESH
|
|||||||
g = ig / 255.;
|
g = ig / 255.;
|
||||||
b = ib / 255.;
|
b = ib / 255.;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
//=======================================================================
|
||||||
|
/**
|
||||||
|
Get histogram from the input actor
|
||||||
|
Repaint/Remove the histogram in/from each opened Plot2D Viewer
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
void ProcessIn2DViewers( SMESH_Actor *theActor, Viewer2dActionType aType ) {
|
||||||
|
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
|
||||||
|
|
||||||
|
if(!anApp || !theActor)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SPlot2d_Histogram* aHistogram = 0;
|
||||||
|
|
||||||
|
if(theActor->GetPlot2Histogram())
|
||||||
|
if(aType == UpdateIn2dViewer)
|
||||||
|
aHistogram = theActor->UpdatePlot2Histogram();
|
||||||
|
else
|
||||||
|
aHistogram = theActor->GetPlot2Histogram();
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
ViewManagerList aViewManagerList;
|
||||||
|
anApp->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
|
||||||
|
|
||||||
|
aType = aHistogram->getPointList().empty() ? RemoveFrom2dViewer : aType;
|
||||||
|
|
||||||
|
SUIT_ViewManager* aViewManager;
|
||||||
|
foreach( aViewManager, aViewManagerList ) {
|
||||||
|
if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
|
||||||
|
if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel())) {
|
||||||
|
if (Plot2d_ViewFrame* aViewFrame = aViewer->getActiveViewFrame()) {
|
||||||
|
if(aType == UpdateIn2dViewer )
|
||||||
|
aViewFrame->displayObject(aHistogram, true);
|
||||||
|
else if (aType == RemoveFrom2dViewer)
|
||||||
|
aViewFrame->eraseObject(aHistogram, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif //DISABLE_PLOT2DVIEWER
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
class vtkUnstructuredGrid;
|
class vtkUnstructuredGrid;
|
||||||
|
class SMESH_Actor;
|
||||||
|
|
||||||
namespace SMESH
|
namespace SMESH
|
||||||
{
|
{
|
||||||
@ -71,6 +72,17 @@ SMESHOBJECT_EXPORT
|
|||||||
WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid,
|
WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid,
|
||||||
const char* theFileName);
|
const char* theFileName);
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
|
||||||
|
typedef enum {UpdateIn2dViewer = 0, RemoveFrom2dViewer } Viewer2dActionType;
|
||||||
|
|
||||||
|
SMESHOBJECT_EXPORT
|
||||||
|
void ProcessIn2DViewers( SMESH_Actor* theActor, Viewer2dActionType = UpdateIn2dViewer );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -89,6 +89,7 @@
|
|||||||
#include <SMESH_Client.hxx>
|
#include <SMESH_Client.hxx>
|
||||||
#include <SMESH_Actor.h>
|
#include <SMESH_Actor.h>
|
||||||
#include <SMESH_ScalarBarActor.h>
|
#include <SMESH_ScalarBarActor.h>
|
||||||
|
#include <SMESH_ActorUtils.h>
|
||||||
#include <SMESH_TypeFilter.hxx>
|
#include <SMESH_TypeFilter.hxx>
|
||||||
#include "SMESH_ControlsDef.hxx"
|
#include "SMESH_ControlsDef.hxx"
|
||||||
|
|
||||||
@ -1407,7 +1408,12 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
|
||||||
SUIT_ViewManager* vm = anApp->activeViewManager();
|
|
||||||
|
ViewManagerList aViewMenegers = anApp->viewManagers();
|
||||||
|
ViewManagerList::const_iterator it = aViewMenegers.begin();
|
||||||
|
for( ; it != aViewMenegers.end(); it++) {
|
||||||
|
|
||||||
|
SUIT_ViewManager* vm = *it;
|
||||||
int nbSf = vm ? vm->getViewsCount() : 0;
|
int nbSf = vm ? vm->getViewsCount() : 0;
|
||||||
|
|
||||||
SALOME_ListIteratorOfListIO It(selected);
|
SALOME_ListIteratorOfListIO It(selected);
|
||||||
@ -1494,6 +1500,8 @@
|
|||||||
} /* listSO back loop */
|
} /* listSO back loop */
|
||||||
} /* IObject->hasEntry() */
|
} /* IObject->hasEntry() */
|
||||||
} /* more/next */
|
} /* more/next */
|
||||||
|
} /* aViewMenegers list loop */
|
||||||
|
|
||||||
aStudyBuilder->CommitCommand();
|
aStudyBuilder->CommitCommand();
|
||||||
|
|
||||||
/* Clear any previous selection */
|
/* Clear any previous selection */
|
||||||
@ -4132,6 +4140,16 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
|
|||||||
updateObjBrowser(); // objects can be removed
|
updateObjBrowser(); // objects can be removed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get all view currently opened in the study and connect their signals to
|
||||||
|
// the corresponding slots of the class.
|
||||||
|
SUIT_Desktop* aDesk = study->application()->desktop();
|
||||||
|
if ( aDesk ) {
|
||||||
|
QList<SUIT_ViewWindow*> wndList = aDesk->windows();
|
||||||
|
SUIT_ViewWindow* wnd;
|
||||||
|
foreach ( wnd, wndList )
|
||||||
|
connectView( wnd );
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4228,8 +4246,15 @@ void SMESHGUI::viewManagers( QStringList& list ) const
|
|||||||
|
|
||||||
void SMESHGUI::onViewManagerActivated( SUIT_ViewManager* mgr )
|
void SMESHGUI::onViewManagerActivated( SUIT_ViewManager* mgr )
|
||||||
{
|
{
|
||||||
if ( dynamic_cast<SVTK_ViewManager*>( mgr ) )
|
if ( dynamic_cast<SVTK_ViewManager*>( mgr ) ) {
|
||||||
SMESH::UpdateSelectionProp( this );
|
SMESH::UpdateSelectionProp( this );
|
||||||
|
|
||||||
|
QVector<SUIT_ViewWindow*> aViews = mgr->getViews();
|
||||||
|
for(int i = 0; i < aViews.count() ; i++){
|
||||||
|
SUIT_ViewWindow *sf = aViews[i];
|
||||||
|
connectView( sf );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
|
void SMESHGUI::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
|
||||||
@ -5677,3 +5702,34 @@ void SMESHGUI::onHypothesisEdit( int result )
|
|||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
updateObjBrowser( true );
|
updateObjBrowser( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Signal handler closing(SUIT_ViewWindow*) of a view
|
||||||
|
\param pview view being closed
|
||||||
|
*/
|
||||||
|
void SMESHGUI::onViewClosed( SUIT_ViewWindow* pview ) {
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
//Crear all Plot2d Viewers if need.
|
||||||
|
SMESH::ClearPlot2Viewers(pview);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Connects or disconnects signals about activating and cloning view on the module slots
|
||||||
|
\param pview view which is connected/disconnected
|
||||||
|
*/
|
||||||
|
void SMESHGUI::connectView( const SUIT_ViewWindow* pview ) {
|
||||||
|
if(!pview)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SUIT_ViewManager* viewMgr = pview->getViewManager();
|
||||||
|
if ( viewMgr ) {
|
||||||
|
disconnect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
|
||||||
|
this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
|
||||||
|
|
||||||
|
connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
|
||||||
|
this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -152,6 +152,8 @@ public slots:
|
|||||||
virtual bool deactivateModule( SUIT_Study* );
|
virtual bool deactivateModule( SUIT_Study* );
|
||||||
virtual bool activateModule( SUIT_Study* );
|
virtual bool activateModule( SUIT_Study* );
|
||||||
virtual void studyClosed( SUIT_Study* );
|
virtual void studyClosed( SUIT_Study* );
|
||||||
|
void onViewClosed( SUIT_ViewWindow* );
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void OnGUIEvent();
|
void OnGUIEvent();
|
||||||
@ -197,6 +199,9 @@ private:
|
|||||||
const int pId,
|
const int pId,
|
||||||
const QString& param );
|
const QString& param );
|
||||||
|
|
||||||
|
void connectView( const SUIT_ViewWindow* );
|
||||||
|
|
||||||
|
|
||||||
private :
|
private :
|
||||||
static SMESH::SMESH_Gen_var myComponentSMESH;
|
static SMESH::SMESH_Gen_var myComponentSMESH;
|
||||||
QDialog* myActiveDialogBox;
|
QDialog* myActiveDialogBox;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "SMESHGUI_Utils.h"
|
#include "SMESHGUI_Utils.h"
|
||||||
|
|
||||||
#include <SMESH_Actor.h>
|
#include <SMESH_Actor.h>
|
||||||
|
#include <SMESH_ActorUtils.h>
|
||||||
#include <SMESH_ScalarBarActor.h>
|
#include <SMESH_ScalarBarActor.h>
|
||||||
#include <SMESH_ControlsDef.hxx>
|
#include <SMESH_ControlsDef.hxx>
|
||||||
|
|
||||||
|
@ -57,12 +57,6 @@
|
|||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
|
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
|
||||||
#include <SPlot2d_ViewModel.h>
|
|
||||||
#include <SPlot2d_Histogram.h>
|
|
||||||
#include <Plot2d_ViewManager.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// SALOME KERNEL includes
|
// SALOME KERNEL includes
|
||||||
#include <utilities.h>
|
#include <utilities.h>
|
||||||
|
|
||||||
@ -659,9 +653,6 @@ namespace SMESH
|
|||||||
VISUAL_OBJ_CONT.erase(aKey);
|
VISUAL_OBJ_CONT.erase(aKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
|
||||||
ProcessIn2DViewers(theActor,RemoveFrom2dViewer);
|
|
||||||
#endif
|
|
||||||
theActor->Delete();
|
theActor->Delete();
|
||||||
vtkWnd->Repaint();
|
vtkWnd->Repaint();
|
||||||
}
|
}
|
||||||
@ -1315,42 +1306,29 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
//=======================================================================
|
//================================================================================
|
||||||
/**
|
/*!
|
||||||
Get histogram from the input actor
|
* \brief Find all SMESH_Actor's in the View Window.
|
||||||
Repaint/Remove the histogram in/from each opened Plot2D Viewer
|
* If actor constains Plot2d_Histogram object remove it from each Plot2d Viewer.
|
||||||
*/
|
*/
|
||||||
//=======================================================================
|
//================================================================================
|
||||||
void ProcessIn2DViewers( SMESH_Actor *theActor, Viewer2dActionType aType ) {
|
|
||||||
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
|
|
||||||
|
|
||||||
if(!anApp || !theActor)
|
void ClearPlot2Viewers( SUIT_ViewWindow* theWindow ) {
|
||||||
return;
|
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
|
||||||
|
vtkRenderer *aRenderer = aViewWindow->getRenderer();
|
||||||
SPlot2d_Histogram* aHistogram = 0;
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
if(theActor->GetPlot2Histogram())
|
vtkActorCollection *aCollection = aCopy.GetActors();
|
||||||
aHistogram = theActor->UpdatePlot2Histogram();
|
aCollection->InitTraversal();
|
||||||
else
|
while(vtkActor *anAct = aCollection->GetNextActor()){
|
||||||
return;
|
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
|
||||||
|
if(anActor->hasIO() && anActor->GetPlot2Histogram() ){
|
||||||
ViewManagerList aViewManagerList;
|
ProcessIn2DViewers(anActor,RemoveFrom2dViewer);
|
||||||
anApp->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
|
|
||||||
|
|
||||||
aType = aHistogram->getPointList().empty() ? RemoveFrom2dViewer : aType;
|
|
||||||
|
|
||||||
SUIT_ViewManager* aViewManager;
|
|
||||||
foreach( aViewManager, aViewManagerList ) {
|
|
||||||
if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
|
|
||||||
if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel())) {
|
|
||||||
if (Plot2d_ViewFrame* aViewFrame = aViewer->getActiveViewFrame()) {
|
|
||||||
if(aType == UpdateIn2dViewer )
|
|
||||||
aViewFrame->displayObject(aHistogram, true);
|
|
||||||
else if (aType == RemoveFrom2dViewer)
|
|
||||||
aViewFrame->eraseObject(aHistogram, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //DISABLE_PLOT2DVIEWER
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end of namespace SMESH
|
} // end of namespace SMESH
|
||||||
|
@ -40,11 +40,6 @@
|
|||||||
#include <SALOME_InteractiveObject.hxx>
|
#include <SALOME_InteractiveObject.hxx>
|
||||||
#include <VTKViewer_Filter.h>
|
#include <VTKViewer_Filter.h>
|
||||||
|
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
|
||||||
class SPlot2d_Histogram;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
class TColStd_IndexedMapOfInteger;
|
class TColStd_IndexedMapOfInteger;
|
||||||
|
|
||||||
class SALOMEDSClient_Study;
|
class SALOMEDSClient_Study;
|
||||||
@ -196,6 +191,11 @@ SMESHGUI_EXPORT
|
|||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
void SetControlsPrecision( const long );
|
void SetControlsPrecision( const long );
|
||||||
|
|
||||||
|
#ifndef DISABLE_PLOT2DVIEWER
|
||||||
|
SMESHGUI_EXPORT
|
||||||
|
void ClearPlot2Viewers( SUIT_ViewWindow* theWindow );
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
SMESHGUI_EXPORT
|
SMESHGUI_EXPORT
|
||||||
bool ComputeClippingPlaneParameters( std::list<vtkActor*> theActorList,
|
bool ComputeClippingPlaneParameters( std::list<vtkActor*> theActorList,
|
||||||
@ -203,16 +203,6 @@ SMESHGUI_EXPORT
|
|||||||
vtkFloatingPointType theDist,
|
vtkFloatingPointType theDist,
|
||||||
vtkFloatingPointType theBounds[6],
|
vtkFloatingPointType theBounds[6],
|
||||||
vtkFloatingPointType theOrigin[3] );
|
vtkFloatingPointType theOrigin[3] );
|
||||||
|
|
||||||
#ifndef DISABLE_PLOT2DVIEWER
|
|
||||||
|
|
||||||
typedef enum {UpdateIn2dViewer = 0, RemoveFrom2dViewer } Viewer2dActionType;
|
|
||||||
|
|
||||||
SMESHGUI_EXPORT
|
|
||||||
void ProcessIn2DViewers( SMESH_Actor* theActor, Viewer2dActionType = UpdateIn2dViewer );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_VTKUTILS_H
|
#endif // SMESHGUI_VTKUTILS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user