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