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
00026 #ifndef __vtkKWEPaintbrushSelectionRepresentation_h
00027 #define __vtkKWEPaintbrushSelectionRepresentation_h
00028
00029 #include "VTKEdgeConfigure.h"
00030 #include "vtkWidgetRepresentation.h"
00031 #include <vtkstd/vector>
00032
00033 class vtkKWEPaintbrushDrawing;
00034 class vtkPointPlacer;
00035 class vtkKWEPaintbrushSketch;
00036 class vtkKWEPaintbrushSelectionWidget;
00037
00038 class VTKEdge_WIDGETS_EXPORT vtkKWEPaintbrushSelectionRepresentation
00039 : public vtkWidgetRepresentation
00040 {
00041
00042 friend class vtkKWEPaintbrushSelectionWidget;
00043
00044 public:
00046
00047 vtkTypeRevisionMacro( vtkKWEPaintbrushSelectionRepresentation,
00048 vtkWidgetRepresentation);
00049 void PrintSelf(ostream& os, vtkIndent indent);
00051
00052
00053 enum
00054 {
00055 PaintbrushRequestSketchSelect,
00056 PaintbrushSketchSelect,
00057 PaintbrushSketchUnselect,
00058 PaintbrushRequestSketchMerge,
00059 PaintbrushSketchMerge,
00060 PaintbrushDisabled,
00061 None
00062 };
00063
00064
00066 virtual int ComputeInteractionState(int X, int Y, int modifier=0);
00067
00069
00070 virtual void SetPaintbrushDrawing( vtkKWEPaintbrushDrawing * );
00071 vtkGetObjectMacro( PaintbrushDrawing, vtkKWEPaintbrushDrawing );
00073
00074
00075
00076
00077
00078
00079
00080 void SetPointPlacer( vtkPointPlacer * );
00081 vtkGetObjectMacro( PointPlacer, vtkPointPlacer );
00082
00083
00084
00085 virtual void DeepCopy(vtkWidgetRepresentation *);
00086
00088
00089 virtual int DisplayPositionIsInside( vtkKWEPaintbrushSketch *s,
00090 double displayPos[2]);
00092
00094
00095 virtual int WorldPositionIsInside( vtkKWEPaintbrushSketch *s,
00096 double worldPos[3]);
00098
00107 vtkGetObjectMacro( SelectedSketch, vtkKWEPaintbrushSketch );
00109
00111 virtual void AddSketchToSelection( vtkKWEPaintbrushSketch * );
00112
00114 virtual void RemoveSketchFromSelection( vtkKWEPaintbrushSketch * );
00115
00117 virtual int DeleteSelectedSketches();
00118
00120
00121 virtual void SelectAllSketches();
00122 virtual void UnSelectAllSketches();
00124
00125
00127
00128 const vtkstd::vector< vtkKWEPaintbrushSketch * > & GetSelectedSketches()
00129 { return this->SelectedSketches; }
00130
00132
00134
00138 virtual int MergeSelectedSketches( vtkKWEPaintbrushSketch *mergedSketch = NULL,
00139 int removeSketches = 1 );
00141
00142 protected:
00143 vtkKWEPaintbrushSelectionRepresentation();
00144 ~vtkKWEPaintbrushSelectionRepresentation();
00145
00147
00148 vtkSetMacro( InteractionState, int );
00150
00152 virtual int DragAndDropMerge();
00153
00154 vtkKWEPaintbrushDrawing *PaintbrushDrawing;
00155
00158 vtkPointPlacer * PointPlacer;
00159
00161 int LastDisplayPosition[2];
00162
00164 vtkKWEPaintbrushSketch * SelectedSketch;
00165
00167
00168 typedef vtkstd::vector< vtkKWEPaintbrushSketch * > SelectedSketchesType;
00169 SelectedSketchesType SelectedSketches;
00170 int PrevInteractionState;
00171 double DragBeginPoint[3], DragEndPoint[3];
00172 vtkKWEPaintbrushSketch * DragAndDropDestination;
00174
00175 private:
00176 vtkKWEPaintbrushSelectionRepresentation(const vtkKWEPaintbrushSelectionRepresentation&);
00177 void operator=(const vtkKWEPaintbrushSelectionRepresentation&);
00178 };
00179
00180 #endif
00181