vtkMimxExtractFaceWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   MIMX Meshing Toolkit
00004 Module:    $RCSfile: vtkMimxExtractFaceWidget.h,v $
00005 Language:  C++
00006 
00007 Date:      $Date: 2008/07/06 20:30:13 $
00008 Version:   $Revision: 1.12 $
00009 
00010 
00011  Musculoskeletal Imaging, Modelling and Experimentation (MIMX)
00012  Center for Computer Aided Design
00013  The University of Iowa
00014  Iowa City, IA 52242
00015  http://www.ccad.uiowa.edu/mimx/
00016  
00017 Copyright (c) The University of Iowa. All rights reserved.
00018 See MIMXCopyright.txt or http://www.ccad.uiowa.edu/mimx/Copyright.htm for details.
00019 
00020 This software is distributed WITHOUT ANY WARRANTY; without even 
00021 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00022 PURPOSE.  See the above copyright notices for more information.
00023 
00024 =========================================================================*/
00025 // .NAME vtkMimxExtractFaceWidget - a widget to manipulate 3D parallelopipeds
00026 
00027 #ifndef __vtkMimxExtractFaceWidget_h
00028 #define __vtkMimxExtractFaceWidget_h
00029 
00030 #include "vtkAbstractWidget.h"
00031 #include "vtkUnstructuredGrid.h"
00032 #include "vtkActor.h"
00033 #include "vtkMimxWidgetsWin32Header.h"
00034 
00035 
00036 class vtkActor;
00037 class vtkCellPicker;
00038 class vtkCollection;
00039 class vtkPoints;
00040 class vtkUnstructuredGrid;
00041 class vtkDataSetMapper;
00042 class vtkPolyData;
00043 class vtkPolyDataMapper;
00044 class vtkProp;
00045 class vtkProperty;
00046 class vtkActorCollection;
00047 class vtkIdList;
00048 class vtkGeometryFilter;
00049 
00050 class VTK_MIMXWIDGETS_EXPORT vtkMimxExtractFaceWidget : public vtkAbstractWidget
00051 {
00052  public:
00053   // Description:
00054   // Instantiate the object.
00055   static vtkMimxExtractFaceWidget *New();
00056 
00057   vtkTypeRevisionMacro(vtkMimxExtractFaceWidget,vtkAbstractWidget);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00059 
00060   // Description:
00061   // Override the superclass method. This is a composite widget, (it internally
00062   // consists of handle widgets). We will override the superclass method, so
00063   // that we can pass the enabled state to the internal widgets as well.
00064   virtual void SetEnabled(int);
00065 
00066   virtual void SetInput(vtkDataSet*);
00067   void CreateDefaultRepresentation(){}
00068 
00069   //  vtkGetMacro(FacePoints, vtkIdList*);
00070   vtkSetObjectMacro(CompleteUGrid, vtkUnstructuredGrid);
00071   vtkSetObjectMacro(InputActor, vtkActor);
00072 
00073   vtkGetObjectMacro(PickedCellList, vtkIdList);
00074   vtkGetObjectMacro(PickedFaceList, vtkIdList);
00075   vtkGetObjectMacro(CompletePickedCellList, vtkIdList);
00076   vtkGetObjectMacro(CompletePickedFaceList, vtkIdList);
00077 
00078   void RemoveHighlightedFaces(vtkMimxExtractFaceWidget *Self);
00079  protected:
00080   vtkMimxExtractFaceWidget();
00081   ~vtkMimxExtractFaceWidget();
00082 
00083   vtkUnstructuredGrid *UGrid;
00084   //BTX - manage the state of the widget
00085  
00086   //BTX - manage the state of the widget
00087   int State;
00088   enum WidgetEventIds 
00089   {
00090           Start = 0,
00091           LeftMouseButtonDown,
00092           LeftMouseButtonUp,
00093           Outside,
00094           ShiftLeftMouseButtonDown,
00095           ShiftLeftMouseButtonUp,
00096           RightMouseButtonDown,
00097           RightMouseButtonUp
00098   };
00099 
00100   enum WidgetState
00101   {
00102           StartWidget = 0,
00103           PickMultipleFace
00104   };
00105   //ETX
00106 
00107   void ExtractFace();
00108   void Initialize();
00109 
00110   static void ShiftLeftButtonDownCallback                       (vtkAbstractWidget* );
00111   static void ShiftLeftButtonUpCallback            (vtkAbstractWidget* );
00112   static void LeftButtonDownCallback                    (vtkAbstractWidget* );
00113   static void LeftButtonUpCallback            (vtkAbstractWidget* );
00114   static void RightButtonDownCallback                   (vtkAbstractWidget* );
00115   static void RightButtonUpCallback            (vtkAbstractWidget* );
00116 
00117   // the hexahedron (6 faces)
00118   vtkActor          *FaceActor;
00119   vtkActor                      *InputActor;
00120   vtkPolyDataMapper *FaceMapper;
00121   vtkPolyData       *FacePolyData;
00122   vtkActor          *SelectedFaceActor;
00123   vtkPolyDataMapper *SelectedFaceMapper;
00124   vtkCellPicker *FacePicker;
00125 
00126   vtkActorCollection *FaceGeometry;
00127   vtkActorCollection *InteriorFaceGeometry;
00128   vtkUnstructuredGrid *CompleteUGrid;
00129   vtkIdList *PickedCellList;
00130   vtkIdList *PickedFaceList;
00131   vtkIdList *CompletePickedCellList;
00132   vtkIdList *CompletePickedFaceList;
00133   vtkIdList *SurfaceCellList;
00134   vtkGeometryFilter *GeometryFilter;
00135   int GetInputPickedCellAndFace(int PickedFace, int &CellFace);
00136   int GetInputPickedCompleteFace(
00137           int CellNum, int CellFace, int &CompleteCell, int &CompleteFace);
00138   double LastPickPosition[3];
00139   void ShowInteriorHighlightedFaces();
00140   void HideInteriorHighlightedFaces();
00141   void DeleteInteriorHighlightedFaces();
00142   void ComputeInteriorHighlightedFaces();
00143 private:
00144   vtkMimxExtractFaceWidget(const vtkMimxExtractFaceWidget&);  //Not implemented
00145   void operator=(const vtkMimxExtractFaceWidget&);  //Not implemented
00146 };
00147 
00148 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1