#include "VISU_ScalarBarActor.hxx"
#include "VISU_Actor.h"
-#include "VISU_Event.h"
+#include "SALOME_Event.hxx"
#include "QAD_Application.h"
#include "QAD_Desktop.h"
namespace VISU{
//===========================================================================
- template<class TObject, typename TResult = void>
- class TMemFunEvent: public SALOME_Event{
- public:
- typedef TResult (TObject::* TAction)();
- TMemFunEvent(TObject* theObject, TAction theAction):
- myObject(theObject),
- myAction(theAction)
- {}
- virtual bool Execute(){
- (myObject->*myAction)();
- return true;
- }
- private:
- TObject* myObject;
- TAction myAction;
- };
- typedef TMemFunEvent<QAD_StudyFrame> TFrameActionEvent;
-
+ typedef TVoidMemFunEvent<QAD_StudyFrame> TFrameActionEvent;
- template<class TObject, typename TArg, typename TStoreArg = TArg, typename TResult = void>
- class TMemFun1ArgEvent: public SALOME_Event{
- public:
- typedef TResult (TObject::* TAction)(TArg);
- TMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg):
- myObject(theObject),
- myAction(theAction),
- myArg(theArg)
- {}
- virtual bool Execute(){
- (myObject->*myAction)(myArg);
- return true;
- }
- private:
- TObject* myObject;
- TAction myAction;
- TStoreArg myArg;
- };
-
-
- template<class TObject, typename TArg, typename TArg1,
- typename TStoreArg = TArg, typename TStoreArg1 = TArg1,
- typename TResult = void>
- class TMemFun2ArgEvent: public SALOME_Event{
- public:
- typedef TResult (TObject::* TAction)(TArg,TArg1);
- TMemFun2ArgEvent(TObject* theObject, TAction theAction, TArg theArg, TArg1 theArg1):
- myObject(theObject),
- myAction(theAction),
- myArg(theArg),
- myArg1(theArg1)
- {}
- virtual bool Execute(){
- (myObject->*myAction)(myArg,myArg1);
- return true;
- }
- private:
- TObject* myObject;
- TAction myAction;
- TStoreArg myArg;
- TStoreArg1 myArg1;
- };
-
template<class TObject>
class TSetBackgroundEvent: public SALOME_Event{
TObject* myView;
void XYPlot_i::Update() {
- ProcessVoidEvent(new TMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::Repaint));
+ ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::Repaint));
}
void XYPlot_i::SetTitle(const char* theTitle){
- ProcessVoidEvent(new TMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
(myStudyFrame,&QAD_StudyFrame::setCaption,QString(theTitle)));
}
char* XYPlot_i::GetTitle() {
void XYPlot_i::SetSubTitle(const char* theTitle){
- ProcessVoidEvent(new TMemFun1ArgEvent<Plot2d_ViewFrame,const QString&,QString>
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<Plot2d_ViewFrame,const QString&,QString>
(myView,&Plot2d_ViewFrame::setTitle,QString(theTitle)));
}
char* XYPlot_i::GetSubTitle() {
void XYPlot_i::SetCurveType(VISU::XYPlot::CurveType theType){
- ProcessVoidEvent(new TMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
(myView,&Plot2d_ViewFrame::setCurveType,theType,true));
}
VISU::XYPlot::CurveType XYPlot_i::GetCurveType(){
void XYPlot_i::SetMarkerSize(CORBA::Long theSize){
- ProcessVoidEvent(new TMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
(myView,&Plot2d_ViewFrame::setMarkerSize,theSize,true));
}
CORBA::Long XYPlot_i::GetMarkerSize(){
void XYPlot_i::ShowLegend(CORBA::Boolean theShowing){
- ProcessVoidEvent(new TMemFun2ArgEvent<Plot2d_ViewFrame,bool,bool>
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,bool,bool>
(myView,&Plot2d_ViewFrame::showLegend,theShowing,true));
}
void XYPlot_i::EraseAll() {
- ProcessVoidEvent(new TMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::EraseAll));
+ ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::EraseAll));
}
void XYPlot_i::FitAll() {
- ProcessVoidEvent(new TMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::fitAll));
+ ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::fitAll));
}
void TableView_i::SetTitle(const char* theTitle){
- ProcessVoidEvent(new TMemFun1ArgEvent<SALOMEGUI_TableDlg,const QString&,QString>
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<SALOMEGUI_TableDlg,const QString&,QString>
(myView,&SALOMEGUI_TableDlg::setCaption,QString(theTitle)));
}
//-------------------- View interface --------------------
void View3D_i::SetTitle(const char* theTitle){
- ProcessVoidEvent(new TMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
(myStudyFrame,&QAD_StudyFrame::setTitle,QString(theTitle)));
}
char* View3D_i::GetTitle() {
//-------------------- View3D interface --------------------
void View3D_i::FitAll() {
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewFitAll));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewFitAll));
Update();
}
void View3D_i::SetView(VISU::View3D::ViewType theType) {
switch(theType){
case VISU::View3D::FRONT :
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewFront));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewFront));
break;
case VISU::View3D::BACK :
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewBack));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewBack));
break;
case VISU::View3D::LEFT :
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewLeft));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewLeft));
break;
case VISU::View3D::RIGHT :
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewRight));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewRight));
break;
case VISU::View3D::TOP :
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewTop));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewTop));
break;
case VISU::View3D::BOTTOM :
- ProcessVoidEvent(new TMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewBottom));
+ ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewBottom));
break;
}
Update();