vtkMimxExtractFaceWidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
00054
00055 static vtkMimxExtractFaceWidget *New();
00056
00057 vtkTypeRevisionMacro(vtkMimxExtractFaceWidget,vtkAbstractWidget);
00058 void PrintSelf(ostream& os, vtkIndent indent);
00059
00060
00061
00062
00063
00064 virtual void SetEnabled(int);
00065
00066 virtual void SetInput(vtkDataSet*);
00067 void CreateDefaultRepresentation(){}
00068
00069
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
00085
00086
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
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
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&);
00145 void operator=(const vtkMimxExtractFaceWidget&);
00146 };
00147
00148 #endif