]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager_tool.cxx
MeshManager
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkMeshManager_tool.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_tool.h"
5 #include "bbcreaVtkPackage.h"
6 namespace bbcreaVtk
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MeshManager_tool)
10 BBTK_BLACK_BOX_IMPLEMENTATION(MeshManager_tool,bbtk::AtomicBlackBox);
11 //===== 
12 // 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)
13 //===== 
14 void MeshManager_tool::Process()
15 {
16 // THE MAIN PROCESSING METHOD BODY
17 //   Here we simply set the input 'In' value to the output 'Out'
18 //   And print out the output value
19 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
20 //    void bbSet{Input|Output}NAME(const TYPE&)
21 //    const TYPE& bbGet{Input|Output}NAME() const 
22 //    Where :
23 //    * NAME is the name of the input/output
24 //      (the one provided in the attribute 'name' of the tag 'input')
25 //    * TYPE is the C++ type of the input/output
26 //      (the one provided in the attribute 'type' of the tag 'input')
27 //    bbSetOutputOut( bbGetInputIn() );
28 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
29     
30     printf("EED MeshManager_tool::Process start this=%p\n", this);
31     
32     if (bbGetInputMeshManagerModel()!=NULL)
33     {
34         if (bbGetInputTool()==10) // Undo
35         {
36             printf("EED Warning!   MeshManager_tool Undo   Not implemented.\n");
37         } // if Tool 10 Undo
38         
39         if (bbGetInputTool()==20) // Redo
40         {
41             printf("EED Warning!   MeshManager_tool Redo   Not implemented.\n");
42         } // if Tool 20 Redo
43
44         if (bbGetInputTool()==30)  // Set
45         {
46             printf("EED    MeshManager_tool::Process Set\n");
47             if (bbGetInputMesh()!=NULL){
48                 vtkPoints   *points = bbGetInputMesh()->GetPoints();
49                 if (points!=NULL)
50                 {
51                     bbGetInputMeshManagerModel()->SetMeshBase( bbGetInputMesh() );
52                 } // if points!=NULL
53             } // Mesh!=NULL
54         } // if Tool 30 Set
55
56         if (bbGetInputTool()==35)  // Set memory mode
57         {
58             printf("EED    MeshManager_tool::Process Set memory mode\n");
59 //            if (bbGetInputMesh()!=NULL){
60 //                vtkPoints   *points = bbGetInputMesh()->GetPoints();
61 //                if (points!=NULL)
62 //                {
63                     bbGetInputMeshManagerModel()->SetMeshMemoryMode( bbGetInputMesh() );
64 //                } // if points!=NULL
65 //            } // Mesh!=NULL
66         } // if Tool 35 Set memory mode
67
68         
69         if (bbGetInputTool()==40) // Reset
70         {
71             printf("EED Warning!   MeshManager_tool Reset   Not implemented.\n");
72         } // if Tool 40 Reset
73         
74
75         
76     } else {
77         printf("EED Warning! MeshManager_tool : MeshManagerModel not defined. \n");
78     }// if MeshManagerModel != NULL
79 }
80
81 //===== 
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)
83 //===== 
84 void MeshManager_tool::bbUserSetDefaultValues()
85 {
86 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
87 //    Here we initialize the input 'In' to 0
88    bbSetInputTool(0);
89    bbSetInputMesh(NULL);
90    bbSetInputMeshManagerModel(NULL);
91 }
92
93 //===== 
94 // 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 //===== 
96 void MeshManager_tool::bbUserInitializeProcessing()
97 {
98 //  THE INITIALIZATION METHOD BODY :
99 //    Here does nothing 
100 //    but this is where you should allocate the internal/output pointers 
101 //    if any
102 }
103 //===== 
104 // 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)
105 //===== 
106 void MeshManager_tool::bbUserFinalizeProcessing()
107 {
108 //  THE FINALIZATION METHOD BODY :
109 //    Here does nothing 
110 //    but this is where you should desallocate the internal/output pointers 
111 //    if any
112 }
113
114 } // EO namespace bbcreaVtk
115
116