vtkKWMimxGroupBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   MIMX Meshing Toolkit
00004 Module:    $RCSfile: vtkKWMimxGroupBase.h,v $
00005 Language:  C++
00006 Date:      $Date: 2008/10/17 03:37:39 $
00007 Version:   $Revision: 1.15.4.1 $
00008 
00009  Musculoskeletal Imaging, Modelling and Experimentation (MIMX)
00010  Center for Computer Aided Design
00011  The University of Iowa
00012  Iowa City, IA 52242
00013  http://www.ccad.uiowa.edu/mimx/
00014  
00015 Copyright (c) The University of Iowa. All rights reserved.
00016 See MIMXCopyright.txt or http://www.ccad.uiowa.edu/mimx/Copyright.htm for details.
00017 
00018 This software is distributed WITHOUT ANY WARRANTY; without even 
00019 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00020 PURPOSE.  See the above copyright notices for more information.
00021 
00022 =========================================================================*/
00023 // .NAME vtkKWMimxGroupBase - Base class for all the GUI used
00024 // .SECTION Description
00025 // The class contains two push buttons for Apply and Cancel and a Frame 
00026 // which houses all the GUI.
00027 //
00028 // .SECTION To Be Done
00029 // Should also incorporate combobox widget which is used for selection of an
00030 // object and is common in all the derived classes. Should also include
00031 // UpdateObjectLists function common in all the derived classes.
00032 
00033 #ifndef __vtkKWMimxGroupBase_h
00034 #define __vtkKWMimxGroupBase_h
00035 
00036 /* VTK Headers */
00037 #include "vtkCommand.h"
00038 
00039 
00040 /* KWWidget Headers */
00041 #include "vtkKWCompositeWidget.h"
00042 
00043 #include "vtkKWMimxMainWindow.h"
00044 #include "vtkKWMimxViewProperties.h"
00045 #include "vtkKWMimxMainMenuGroup.h"
00046 #include "vtkKWMimxViewProperties.h"
00047 #include "vtkKWComboBox.h"
00048 #include "vtkLinkedListWrapper.h"
00049 #include "vtkLinkedListWrapperTree.h"
00050 #include "vtkBuildingBlockWin32Header.h"
00051 
00052 class vtkKWFrame;
00053 class vtkKWPushButton;
00054 class vtkLinkedListWrapper;
00055 class vtkLinkedListWrapperTree;
00056 class vtkKWMimxMainMenuGroup;
00057 
00058 //-----------------------------------------------------------------------------
00059 class VTK_BUILDINGBLOCK_EXPORT vtkKWMimxGroupBase : public vtkKWCompositeWidget
00060 {
00061 public:
00062   static vtkKWMimxGroupBase* New();
00063   vtkTypeRevisionMacro(vtkKWMimxGroupBase,vtkKWCompositeWidget);
00064   void PrintSelf(ostream& os, vtkIndent indent);
00065   virtual void Update();
00066   virtual void UpdateEnableState();
00067 
00068   // Description:
00069   // Set all the list  and window access
00070   vtkSetObjectMacro(SurfaceList, vtkLinkedListWrapper);
00071   vtkSetObjectMacro(BBoxList, vtkLinkedListWrapper);
00072   vtkSetObjectMacro(FEMeshList, vtkLinkedListWrapper);
00073   vtkGetObjectMacro(MimxMainWindow, vtkKWMimxMainWindow);
00074   vtkSetObjectMacro(MimxMainWindow, vtkKWMimxMainWindow);
00075   vtkGetObjectMacro(MainFrame, vtkKWFrame);
00076   vtkSetObjectMacro(ViewProperties, vtkKWMimxViewProperties);
00077   vtkSetObjectMacro(MenuGroup, vtkKWMimxMainMenuGroup);
00078   vtkSetObjectMacro(ImageList, vtkLinkedListWrapper);
00079   vtkGetObjectMacro(ImageList, vtkLinkedListWrapper);
00080   vtkSetObjectMacro(DoUndoTree, vtkLinkedListWrapperTree);
00081 
00082   // Description:
00083   // This is used to count the number of objects generated from a
00084   // particular type of operation. Initially it was assumed that each group
00085   // had only one object creation operation. With the changes made, the group
00086   // can have more than one operation.
00087   vtkSetMacro(Count, int);
00088   void AddMeshToDisplay(vtkUnstructuredGrid *ugrid, const char *namePrefix, 
00089               const char *FoundationName, const char *elementSetName);
00090   void AddSurfaceToDisplay(vtkPolyData *surface, const char *namePrefix, 
00091               const char *foundationName);
00092   void AddBuildingBlockToDisplay(vtkUnstructuredGrid *ugrid, const char *namePrefix, 
00093               const char *foundationName);
00094   int UpdateBuildingBlockComboBox(vtkKWComboBox *combobox);
00095   int UpdateMeshComboBox(vtkKWComboBox *combobox);
00096   int UpdateSurfaceComboBox(vtkKWComboBox *combobox);
00097   int UpdateImageComboBox(vtkKWComboBox *combobox);
00098   
00099   // added for slicer integration, treat images as first class objects and read from MRML tree
00100   void AddImageToDisplay(vtkImageData *surface,
00101             const char *namePrefix, const char *foundationName);
00102 
00103   // version that accepts a transform matrix to orient the images to RAS for Slicer
00104   void AddImageToDisplay(vtkImageData *surface,
00105             const char *namePrefix, const char *foundationName, vtkMatrix4x4 *matrix, double origin[3], double spacing[3]);
00106 
00107   int CancelStatus;
00108 
00109 protected:
00110         vtkKWMimxGroupBase();
00111         virtual ~vtkKWMimxGroupBase();
00112         virtual void CreateWidget();
00113   vtkLinkedListWrapper *SurfaceList;
00114   vtkLinkedListWrapper *BBoxList;
00115   vtkLinkedListWrapper *FEMeshList;
00116   vtkLinkedListWrapper *ImageList;
00117   vtkKWPushButton *ApplyButton;
00118   vtkKWPushButton *CancelButton;
00119   vtkKWFrame *MainFrame;
00120 
00121   vtkKWMimxMainWindow *MimxMainWindow;
00122   vtkKWMimxViewProperties *ViewProperties;
00123   vtkLinkedListWrapperTree *DoUndoTree;
00124   vtkKWMimxMainMenuGroup *MenuGroup;
00125   vtkIdType Count;  // to keep track of number of objects created during runtime 
00126   char objectSelectionPrevious[256];
00127 
00128 private:
00129   vtkKWMimxGroupBase(const vtkKWMimxGroupBase&); // Not implemented
00130   void operator=(const vtkKWMimxGroupBase&); // Not implemented
00131  };
00132 
00133 #endif
00134 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1