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)
4 #include "bbcreaVtkMeshManager_tool.h"
5 #include "bbcreaVtkPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MeshManager_tool)
10 BBTK_BLACK_BOX_IMPLEMENTATION(MeshManager_tool,bbtk::AtomicBlackBox);
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)
14 void MeshManager_tool::Process()
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
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;
30 if (bbGetInputMeshManagerModel()!=NULL)
32 if (bbGetInputTool()==10) // Undo
34 bbGetInputMeshManagerModel()->Undo();
35 bbSetOutputOut(bbGetInputMeshManagerModel()->GetReferencePoint());
38 if (bbGetInputTool()==20) // Redo
40 bbGetInputMeshManagerModel()->Redo();
41 bbSetOutputOut(bbGetInputMeshManagerModel()->GetReferencePoint());
44 if (bbGetInputTool()==30) // Set
46 if (bbGetInputMesh()!=NULL){
47 vtkPoints *points = bbGetInputMesh()->GetPoints();
50 bbGetInputMeshManagerModel()->SetMeshBase( bbGetInputMesh() );
55 if (bbGetInputTool()==35) // Set memory mode
57 bbGetInputMeshManagerModel()->SetMeshMemoryMode( bbGetInputMesh() );
58 } // if Tool 35 Set memory mode
59 if(bbGetInputTool() == 37) // Save State Memory Mode
61 if(bbGetInputDoubleParams().size() == 5){
62 std::vector<double> point = {bbGetInputDoubleParams()[0], bbGetInputDoubleParams()[1], bbGetInputDoubleParams()[2]};
63 bbGetInputMeshManagerModel()->SetReferencePoint(point);
64 bbGetInputMeshManagerModel()->SaveMemoryMode();
67 if (bbGetInputTool()==32) // Copy and Set
69 bbGetInputMeshManagerModel()->CopySetMeshBase( bbGetInputMesh() );
70 } // if Tool 35 Set memory mode
73 if (bbGetInputTool()==40) // ResetMeshTemp
75 bbGetInputMeshManagerModel()->ResetMeshTemp();
78 if(bbGetInputTool() == 50) // Set Array of Meshes
80 if(bbGetInputMeshes().size() > 1)
82 bbGetInputMeshManagerModel()->ReplaceMesh(bbGetInputMeshes());
85 if(bbGetInputTool() == 60) // Select Mesh by Name
87 if(!bbGetInputStringParam().empty())
89 bbGetInputMeshManagerModel()->SelectMeshByName(bbGetInputStringParam());
92 if(bbGetInputTool() == 70) // Delete Current Mesh
94 bbGetInputMeshManagerModel()->DeleteCurrentMesh();
97 printf("EED Warning! MeshManager_tool : MeshManagerModel not defined. \n");
98 }// if MeshManagerModel != NULL
102 // 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)
104 void MeshManager_tool::bbUserSetDefaultValues()
106 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
107 // Here we initialize the input 'In' to 0
109 bbSetInputMesh(NULL);
110 bbSetInputMeshManagerModel(NULL);
114 // 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)
116 void MeshManager_tool::bbUserInitializeProcessing()
118 // THE INITIALIZATION METHOD BODY :
120 // but this is where you should allocate the internal/output pointers
124 // 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)
126 void MeshManager_tool::bbUserFinalizeProcessing()
128 // THE FINALIZATION METHOD BODY :
130 // but this is where you should desallocate the internal/output pointers
134 } // EO namespace bbcreaVtk