]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager.cxx
3fa8d4b50775e338915f2a6b09029889c9ab355d
[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         //meshManagerModel_Box->SetMeshBase( bbGetInputMesh() );
58         meshManagerModel_Box->RefreshOutputs(false);
59         bbSetOutputMeshManagerModel( meshManagerModel_Box );
60     } // if meshManagerModel_Box
61 }
62
63 //===== 
64 // 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)
65 //===== 
66 void MeshManager::bbUserSetDefaultValues()
67 {
68 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
69 //    Here we initialize the input 'In' to 0
70 //   bbSetInputIn(0);
71     meshManagerModel_Box = NULL;
72     bbSetInputMesh(NULL);
73 }
74
75 //===== 
76 // 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)
77 //===== 
78 void MeshManager::bbUserInitializeProcessing()
79 {
80 //  THE INITIALIZATION METHOD BODY :
81 //    Here does nothing 
82 //    but this is where you should allocate the internal/output pointers 
83 //    if any
84 }
85
86 //===== 
87 // 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)
88 //===== 
89 void MeshManager::bbUserFinalizeProcessing()
90 {
91 //  THE FINALIZATION METHOD BODY :
92 //    Here does nothing 
93 //    but this is where you should desallocate the internal/output pointers 
94 //    if any
95 }
96
97 } // EO namespace bbcreaVtk
98
99