]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager.cxx
Clean code
[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     mBox->bbSetOutputAllPolyDatas( GetAllPolyDatas() );
24     mBox->bbSetOutputMeshSelection( GetCurrentMesh() );
25     if(signalBox==true)
26     {
27                 mBox->bbSignalOutputModification();
28     }
29 }
30
31
32 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MeshManager)
33 BBTK_BLACK_BOX_IMPLEMENTATION(MeshManager,bbtk::AtomicBlackBox);
34 //===== 
35 // 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)
36 //===== 
37 void MeshManager::Process()
38 {
39 // THE MAIN PROCESSING METHOD BODY
40 //   Here we simply set the input 'In' value to the output 'Out'
41 //   And print out the output value
42 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
43 //    void bbSet{Input|Output}NAME(const TYPE&)
44 //    const TYPE& bbGet{Input|Output}NAME() const 
45 //    Where :
46 //    * NAME is the name of the input/output
47 //      (the one provided in the attribute 'name' of the tag 'input')
48 //    * TYPE is the C++ type of the input/output
49 //      (the one provided in the attribute 'type' of the tag 'input')
50 //    bbSetOutputOut( bbGetInputIn() );
51 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
52     
53     if (meshManagerModel_Box==NULL)
54     {
55         meshManagerModel_Box = new MeshManagerModel_Box(this);
56                 if(bbGetInputMemoryMode() == false){
57                         meshManagerModel_Box->MeshMemoryModeOff();
58                         meshManagerModel_Box->AddMeshes_( bbGetInputMeshVector() );
59                         meshManagerModel_Box->AddMesh_( bbGetInputMesh() );
60                         meshManagerModel_Box->ResetHistory();
61                 } else {
62                         meshManagerModel_Box->MeshMemoryModeOn();
63                         meshManagerModel_Box->SetHistory(50);
64                         meshManagerModel_Box->AddMesh_( bbGetInputMesh() );
65                         meshManagerModel_Box->SaveMemoryMode();
66                 }
67         //meshManagerModel_Box->SetMeshBase( bbGetInputMesh() );
68         meshManagerModel_Box->RefreshOutputs(false);
69         bbSetOutputMeshManagerModel( meshManagerModel_Box );
70     } // if meshManagerModel_Box
71 }
72
73 //===== 
74 // 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)
75 //===== 
76 void MeshManager::bbUserSetDefaultValues()
77 {
78 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
79 //    Here we initialize the input 'In' to 0
80 //   bbSetInputIn(0);
81     meshManagerModel_Box = NULL;
82     bbSetInputMesh(NULL);
83 }
84
85 //===== 
86 // 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)
87 //===== 
88 void MeshManager::bbUserInitializeProcessing()
89 {
90 //  THE INITIALIZATION METHOD BODY :
91 //    Here does nothing 
92 //    but this is where you should allocate the internal/output pointers 
93 //    if any
94 }
95
96 //===== 
97 // 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)
98 //===== 
99 void MeshManager::bbUserFinalizeProcessing()
100 {
101 //  THE FINALIZATION METHOD BODY :
102 //    Here does nothing 
103 //    but this is where you should desallocate the internal/output pointers 
104 //    if any
105 }
106
107 } // EO namespace bbcreaVtk
108
109