vtkFetchMIResourceUploadWidget.h
Go to the documentation of this file.00001 #ifndef __vtkFetchMIResourceUploadWidget_h
00002 #define __vtkFetchMIResourceUploadWidget_h
00003
00004
00005 #include "vtkFetchMIWin32Header.h"
00006 #include "vtkFetchMIMulticolumnWidget.h"
00007 #include "vtkFetchMILogic.h"
00008 #include <string>
00009
00010 class vtkKWPushButtonWithLabel;
00011 class vtkKWPushButton;
00012 class vtkKWMenuButton;
00013 class vtkFetchMIIcons;
00014 class vtkKWLabel;
00015 class vtkKWTopLevel;
00016 class vtkKWEntry;
00017
00018 class VTK_FETCHMI_EXPORT vtkFetchMIResourceUploadWidget : public vtkFetchMIMulticolumnWidget
00019 {
00020
00021 public:
00022 static vtkFetchMIResourceUploadWidget* New();
00023 vtkTypeRevisionMacro(vtkFetchMIResourceUploadWidget,vtkFetchMIMulticolumnWidget);
00024 void PrintSelf(ostream& os, vtkIndent indent);
00025
00026
00027
00028 vtkGetObjectMacro ( SelectAllButton, vtkKWPushButton);
00029 vtkGetObjectMacro ( DeselectAllButton, vtkKWPushButton);
00030 vtkGetObjectMacro ( UploadButton, vtkKWPushButton );
00031 vtkGetObjectMacro ( ApplyTagsButton, vtkKWPushButton );
00032 vtkGetObjectMacro ( RemoveTagsButton, vtkKWPushButton );
00033 vtkGetObjectMacro ( ShowTagsForAllButton, vtkKWPushButton );
00034 vtkGetObjectMacro ( FetchMIIcons, vtkFetchMIIcons );
00035 vtkGetObjectMacro ( Logic, vtkFetchMILogic );
00036 vtkSetObjectMacro ( Logic, vtkFetchMILogic );
00037 vtkGetObjectMacro ( CurrentTagLabel, vtkKWLabel );
00038 vtkGetObjectMacro (TaggingHelpButton, vtkKWPushButton );
00039 vtkGetObjectMacro (SelectTagMenuButton, vtkKWMenuButton );
00040
00041 vtkGetObjectMacro (NewTagWindow, vtkKWTopLevel );
00042 vtkGetObjectMacro (AddNewTagEntry, vtkKWEntry);
00043 vtkGetObjectMacro (AddNewTagButton, vtkKWPushButton);
00044 vtkGetObjectMacro (AddNewValueEntry, vtkKWEntry);
00045 vtkGetObjectMacro (AddNewValueButton, vtkKWPushButton);
00046 vtkGetObjectMacro (AddNewTagLabel, vtkKWLabel );
00047 vtkGetObjectMacro (CloseNewTagWindowButton, vtkKWPushButton);
00048
00049
00050
00051 vtkGetStringMacro (NewUserTag);
00052 vtkSetStringMacro (NewUserTag);
00053
00054
00055 vtkGetStringMacro (NewUserValue);
00056 vtkSetStringMacro (NewUserValue);
00057
00058 vtkGetStringMacro (TagToAddValuesTo);
00059 vtkSetStringMacro (TagToAddValuesTo);
00060
00061 vtkGetMacro ( FileNameColumn, int );
00062 vtkSetMacro ( FileNameColumn, int );
00063 vtkGetMacro ( NodeNameColumn, int );
00064 vtkSetMacro ( NodeNameColumn, int );
00065
00066 void RaiseTaggingHelpWindow();
00067 void HandleSceneRenaming( int row, int col, const char *newname);
00068 void HandleDataRenaming( int row, int col, const char *newname);
00069
00070 bool CheckRowFileFormatWithExtension( const char* extension, vtkStringArray* supportedFileFormats);
00071
00072
00073 virtual void AddNewItem ( const char *dataset, const char *dtype);
00074
00075 using vtkFetchMIMulticolumnWidget::AddNewItem;
00076
00077
00078
00079
00080 virtual void ProcessWidgetEvents ( vtkObject *caller, unsigned long event, void *callData );
00081
00082
00083
00084 virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData );
00085
00086
00087
00088 virtual void RemoveWidgetObservers ( );
00089
00090
00091 virtual void AddWidgetObservers ( );
00092
00093
00094
00095 virtual void AddMRMLObservers ( );
00096
00097
00098
00099 virtual void RemoveMRMLObservers ( );
00100
00101
00102
00103 virtual void SelectRow ( int i );
00104 virtual void DeselectRow ( int i );
00105 virtual void SelectAllItems();
00106 virtual void DeselectAllItems();
00107
00108
00109
00110
00111
00112 virtual void UpdateSelectedStorableNodes();
00113
00114
00115
00116 virtual int IsItemSelected(int i );
00117 virtual void DeleteSelectedItems();
00118 virtual int GetNumberOfSelectedItems();
00119 virtual int GetNumberOfItems();
00120 virtual const char *GetNthSelectedSlicerDataType(int n);
00121 virtual const char *GetNthSelectedDataTarget(int n);
00122 virtual const char *GetNthDataTarget(int n );
00123 virtual const char *GetNthSlicerDataType(int n);
00124 void ShowTagViewCallback( );
00125
00126 void ResetCurrentTagLabel ( );
00127
00128
00129
00130
00131 void SetCurrentTagAttribute(const char* att);
00132 const char *GetCurrentTagAttribute();
00133
00134
00135
00136
00137 void SetCurrentTagValue(const char* val);
00138 const char *GetCurrentTagValue ( );
00139
00140 void PopulateTagMenuButtonCallback ();
00141
00142 void DestroyNewTagWindow();
00143 void WithdrawNewTagWindow();
00144 void RaiseNewTagWindow( const char *att );
00145
00146
00147
00148
00149
00150
00151
00152
00153 void UpdateNewUserTag (const char *att, const char *val);
00154
00155 void ShowTagsForSelection();
00156 void SetStatusText(const char *txt);
00157
00158
00159 enum
00160 {
00161 TagSelectedDataEvent = 11000,
00162 RemoveTagSelectedDataEvent,
00163 ShowAllTagViewEvent,
00164 ShowSelectionTagViewEvent,
00165 UploadRequestedEvent,
00166 };
00167
00168 std::string CurrentTagAttribute;
00169 std::string CurrentTagValue;
00170
00171
00172
00173
00174 void RightClickListCallback(int row, int col, int x, int y);
00175
00176
00177 protected:
00178 vtkFetchMIResourceUploadWidget();
00179 virtual ~vtkFetchMIResourceUploadWidget();
00180
00181
00182 vtkKWPushButton *UploadButton;
00183 vtkKWPushButton *SelectAllButton;
00184 vtkKWPushButton *DeselectAllButton;
00185 vtkKWPushButton *ShowTagsForAllButton;
00186 vtkKWPushButton *ApplyTagsButton;
00187 vtkKWPushButton *RemoveTagsButton;
00188 vtkKWPushButton *TaggingHelpButton;
00189 vtkKWMenuButton *SelectTagMenuButton;
00190 vtkKWLabel *CurrentTagLabel;
00191 vtkFetchMIIcons *FetchMIIcons;
00192 vtkFetchMILogic *Logic;
00193
00194
00195 vtkKWTopLevel *NewTagWindow;
00196 vtkKWEntry *AddNewTagEntry;
00197 vtkKWLabel *AddNewTagLabel;
00198 vtkKWPushButton *AddNewTagButton;
00199 vtkKWEntry *AddNewValueEntry;
00200 vtkKWPushButton *AddNewValueButton;
00201 vtkKWPushButton *CloseNewTagWindowButton;
00202
00203 char *NewUserTag;
00204 char *NewUserValue;
00205 char *TagToAddValuesTo;
00206
00207 int FileNameColumn;
00208 int NodeNameColumn;
00209 int SceneRow;
00210
00211
00212
00213 virtual void CreateWidget();
00214
00215
00216
00217 void UpdateWidget();
00218
00219 void UpdateMRML();
00220
00221 vtkFetchMIResourceUploadWidget(const vtkFetchMIResourceUploadWidget&);
00222 void operator=(const vtkFetchMIResourceUploadWidget&);
00223 };
00224
00225 #endif
00226