2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbcreaMaracasVisuManualPaint_UndoRedo.h"
5 #include "bbcreaMaracasVisuPackage.h"
7 #include <wxMPRBaseData.h>
9 namespace bbcreaMaracasVisu
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ManualPaint_UndoRedo)
13 BBTK_BLACK_BOX_IMPLEMENTATION(ManualPaint_UndoRedo,bbtk::AtomicBlackBox);
15 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
17 void ManualPaint_UndoRedo::Process()
20 // THE MAIN PROCESSING METHOD BODY
21 // Here we simply set the input 'In' value to the output 'Out'
22 // And print out the output value
23 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
24 // void bbSet{Input|Output}NAME(const TYPE&)
25 // const TYPE& bbGet{Input|Output}NAME() const
27 // * NAME is the name of the input/output
28 // (the one provided in the attribute 'name' of the tag 'input')
29 // * TYPE is the C++ type of the input/output
30 // (the one provided in the attribute 'type' of the tag 'input')
31 // bbSetOutputOut( bbGetInputIn() );
32 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
34 if (bbGetInputManualpaintmodel()!=NULL)
36 if ( bbGetInputType()==1 )
38 bbGetInputManualpaintmodel()->Undo();
40 if ( bbGetInputType()==2 )
42 bbGetInputManualpaintmodel()->Redo();
46 if (bbGetInputwxvtkbaseview()!=NULL)
49 vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxvtkbaseview()->GetVtkBaseData());
50 vtkmprbasedata->SetX( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointX() );
51 vtkmprbasedata->SetY( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointY() );
52 vtkmprbasedata->SetZ( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointZ() );
53 wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
54 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
55 #if wxMAJOR_VERSION <= 2
56 bbGetInputwxvtkbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent( newevent );
58 bbGetInputwxvtkbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent( newevent );
60 } // if bbGetInputwxvtkbaseview()
63 } // if bbGetInputManualpaintmodel()
70 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
72 void ManualPaint_UndoRedo::bbUserSetDefaultValues()
74 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
75 // Here we initialize the input 'In' to 0
77 bbSetInputManualpaintmodel(NULL);
78 bbSetInputwxvtkbaseview(NULL);
82 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
84 void ManualPaint_UndoRedo::bbUserInitializeProcessing()
86 // THE INITIALIZATION METHOD BODY :
88 // but this is where you should allocate the internal/output pointers
93 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
95 void ManualPaint_UndoRedo::bbUserFinalizeProcessing()
97 // THE FINALIZATION METHOD BODY :
99 // but this is where you should desallocate the internal/output pointers
103 } // EO namespace bbcreaMaracasVisu