]> Creatis software - creaContours.git/blob - bbtk/src/bbcreaContoursSetFileLocation.cxx
#3328 creaContours Feature New Normal - SetFileLocation box
[creaContours.git] / bbtk / src / bbcreaContoursSetFileLocation.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 "bbcreaContoursSetFileLocation.h"
5 #include "bbcreaContoursPackage.h"
6
7 #include "wxContourMainFrame.h"
8
9
10 namespace bbcreaContours
11 {
12
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetFileLocation)
14 BBTK_BLACK_BOX_IMPLEMENTATION(SetFileLocation,bbtk::AtomicBlackBox);
15 //===== 
16 // 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)
17 //===== 
18 void SetFileLocation::Process()
19 {
20
21 // THE MAIN PROCESSING METHOD BODY
22 //   Here we simply set the input 'In' value to the output 'Out'
23 //   And print out the output value
24 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
25 //    void bbSet{Input|Output}NAME(const TYPE&)
26 //    const TYPE& bbGet{Input|Output}NAME() const 
27 //    Where :
28 //    * NAME is the name of the input/output
29 //      (the one provided in the attribute 'name' of the tag 'input')
30 //    * TYPE is the C++ type of the input/output
31 //      (the one provided in the attribute 'type' of the tag 'input')
32
33 //    bbSetOutputOut( bbGetInputIn() );
34 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
35  
36 printf("EED SetFileLocation::Process Start  %s \n", bbGetInputFileLocation().c_str() );
37
38         if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true)
39         {
40                 wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
41         }else {
42                 wxContourMainFrame::getInstance()->onSave();
43                 wxContourMainFrame::getInstance()->deleteAllContours();
44                 wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
45         } // if FileLocaton
46
47         wxContourMainFrame::getInstance()->onLoad();
48         wxContourMainFrame::getInstance()->RefreshInterface();
49
50 printf("EED SetFileLocation::Process End\n");
51
52 }
53 //===== 
54 // 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)
55 //===== 
56 void SetFileLocation::bbUserSetDefaultValues()
57 {
58
59 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
60 //    Here we initialize the input 'In' to 0
61    bbSetInputFileLocation("");
62   
63 }
64 //===== 
65 // 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)
66 //===== 
67 void SetFileLocation::bbUserInitializeProcessing()
68 {
69
70 //  THE INITIALIZATION METHOD BODY :
71 //    Here does nothing 
72 //    but this is where you should allocate the internal/output pointers 
73 //    if any 
74
75   
76 }
77 //===== 
78 // 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)
79 //===== 
80 void SetFileLocation::bbUserFinalizeProcessing()
81 {
82
83 //  THE FINALIZATION METHOD BODY :
84 //    Here does nothing 
85 //    but this is where you should desallocate the internal/output pointers 
86 //    if any
87   
88 }
89 }
90 // EO namespace bbcreaContours
91
92