]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager.cxx
#3507 Undo and Redo Meshes
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkMeshManager.cxx
1 //===== 
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)
3 //===== 
4 #include "bbcreaVtkMeshManager.h"
5 #include "bbcreaVtkPackage.h"
6 namespace bbcreaVtk
7 {
8
9 MeshManagerModel_Box::MeshManagerModel_Box( MeshManager *box )
10 {
11     mBox=box;
12 }
13
14 MeshManagerModel_Box::~MeshManagerModel_Box( )
15 {
16 }
17
18 void MeshManagerModel_Box::RefreshOutputs(bool signalBox)
19 {
20     mBox->bbSetOutputMeshBase( GetMeshBase() );
21     mBox->bbSetOutputMeshTemp( GetMeshTemp() );
22     mBox->bbSetOutputMeshNames( GetMeshNames() );
23     if(signalBox==true){
24                 mBox->bbSignalOutputModification();
25     }
26 }
27
28
29 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MeshManager)
30 BBTK_BLACK_BOX_IMPLEMENTATION(MeshManager,bbtk::AtomicBlackBox);
31 //===== 
32 // 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)
33 //===== 
34 void MeshManager::Process()
35 {
36 // THE MAIN PROCESSING METHOD BODY
37 //   Here we simply set the input 'In' value to the output 'Out'
38 //   And print out the output value
39 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
40 //    void bbSet{Input|Output}NAME(const TYPE&)
41 //    const TYPE& bbGet{Input|Output}NAME() const 
42 //    Where :
43 //    * NAME is the name of the input/output
44 //      (the one provided in the attribute 'name' of the tag 'input')
45 //    * TYPE is the C++ type of the input/output
46 //      (the one provided in the attribute 'type' of the tag 'input')
47 //    bbSetOutputOut( bbGetInputIn() );
48 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
49     
50     if (meshManagerModel_Box==NULL)
51     {
52         meshManagerModel_Box = new MeshManagerModel_Box(this);
53
54         meshManagerModel_Box->AddMeshes_( bbGetInputMeshVector() );
55
56                 meshManagerModel_Box->AddMesh_( bbGetInputMesh() );
57                 
58                 meshManagerModel_Box->ResetHistory();
59         //meshManagerModel_Box->SetMeshBase( bbGetInputMesh() );
60         meshManagerModel_Box->RefreshOutputs(false);
61         bbSetOutputMeshManagerModel( meshManagerModel_Box );
62     } // if meshManagerModel_Box
63 }
64
65 //===== 
66 // 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)
67 //===== 
68 void MeshManager::bbUserSetDefaultValues()
69 {
70 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
71 //    Here we initialize the input 'In' to 0
72 //   bbSetInputIn(0);
73     meshManagerModel_Box = NULL;
74     bbSetInputMesh(NULL);
75 }
76
77 //===== 
78 // 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)
79 //===== 
80 void MeshManager::bbUserInitializeProcessing()
81 {
82 //  THE INITIALIZATION METHOD BODY :
83 //    Here does nothing 
84 //    but this is where you should allocate the internal/output pointers 
85 //    if any
86 }
87
88 //===== 
89 // 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)
90 //===== 
91 void MeshManager::bbUserFinalizeProcessing()
92 {
93 //  THE FINALIZATION METHOD BODY :
94 //    Here does nothing 
95 //    but this is where you should desallocate the internal/output pointers 
96 //    if any
97 }
98
99 } // EO namespace bbcreaVtk
100
101