vtkMimxModPointWidget.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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 #ifndef __vtkMimxModPointWidget_h
00078 #define __vtkMimxModPointWidget_h
00079
00080 #include "vtk3DWidget.h"
00081 #include "vtkCursor3D.h"
00082 #include "vtkMimxWidgetsWin32Header.h"
00083
00084
00085 class vtkActor;
00086 class vtkPolyDataMapper;
00087 class vtkCellPicker;
00088 class vtkPolyData;
00089 class vtkProperty;
00090
00091 class VTK_MIMXWIDGETS_EXPORT vtkMimxModPointWidget : public vtk3DWidget
00092 {
00093 public:
00094
00095
00096 static vtkMimxModPointWidget *New();
00097
00098 vtkTypeRevisionMacro(vtkMimxModPointWidget,vtk3DWidget);
00099 void PrintSelf(ostream& os, vtkIndent indent);
00100
00101
00102
00103 virtual void SetEnabled(int);
00104 virtual void PlaceWidget(double bounds[6]);
00105 void PlaceWidget()
00106 {this->Superclass::PlaceWidget();}
00107
00108 void PlaceWidget(double xmin, double xmax, double ymin, double ymax,
00109 double zmin, double zmax)
00110 {this->Superclass::PlaceWidget(xmin,xmax,ymin,ymax,zmin,zmax);}
00111
00112
00113
00114
00115 void GetPolyData(vtkPolyData *pd);
00116
00117
00118
00119
00120
00121 void SetPosition(double x, double y, double z)
00122 {this->Cursor3D->SetFocalPoint(x,y,z);}
00123
00124 void SetPosition(double x[3])
00125 {this->SetPosition(x[0],x[1],x[2]);}
00126
00127 double* GetPosition()
00128 {return this->Cursor3D->GetFocalPoint();}
00129
00130 void GetPosition(double xyz[3])
00131 {this->Cursor3D->GetFocalPoint(xyz);}
00132
00133
00134
00135 void SetOutline(int o)
00136 {this->Cursor3D->SetOutline(o);}
00137
00138 int GetOutline()
00139 {return this->Cursor3D->GetOutline();}
00140
00141 void OutlineOn()
00142 {this->Cursor3D->OutlineOn();}
00143
00144 void OutlineOff()
00145 {this->Cursor3D->OutlineOff();}
00146
00147
00148
00149 void SetXShadows(int o)
00150 {this->Cursor3D->SetXShadows(o);}
00151
00152 int GetXShadows()
00153 {return this->Cursor3D->GetXShadows();}
00154
00155 void XShadowsOn()
00156 {this->Cursor3D->XShadowsOn();}
00157
00158 void XShadowsOff()
00159 {this->Cursor3D->XShadowsOff();}
00160
00161
00162
00163
00164
00165 void SetYShadows(int o)
00166 {this->Cursor3D->SetYShadows(o);}
00167
00168 int GetYShadows()
00169 {return this->Cursor3D->GetYShadows();}
00170
00171 void YShadowsOn()
00172 {this->Cursor3D->YShadowsOn();}
00173
00174 void YShadowsOff()
00175 {this->Cursor3D->YShadowsOff();}
00176
00177
00178
00179
00180
00181 void SetZShadows(int o)
00182 {this->Cursor3D->SetZShadows(o);}
00183
00184 int GetZShadows()
00185 {return this->Cursor3D->GetZShadows();}
00186
00187 void ZShadowsOn()
00188 {this->Cursor3D->ZShadowsOn();}
00189
00190 void ZShadowsOff()
00191 {this->Cursor3D->ZShadowsOff();}
00192
00193
00194
00195
00196
00197
00198
00199 void SetTranslationMode(int mode)
00200 { this->Cursor3D->SetTranslationMode(mode); this->Cursor3D->Update(); }
00201
00202 int GetTranslationMode()
00203 { return this->Cursor3D->GetTranslationMode(); }
00204
00205 void TranslationModeOn()
00206 { this->SetTranslationMode(1); }
00207
00208 void TranslationModeOff()
00209 { this->SetTranslationMode(0); }
00210
00211
00212
00213
00214
00215 void AllOn()
00216 {
00217 this->OutlineOn();
00218 this->XShadowsOn();
00219 this->YShadowsOn();
00220 this->ZShadowsOn();
00221 }
00222
00223 void AllOff()
00224 {
00225 this->OutlineOff();
00226 this->XShadowsOff();
00227 this->YShadowsOff();
00228 this->ZShadowsOff();
00229 }
00230
00231
00232
00233
00234
00235
00236
00237 vtkGetObjectMacro(Property,vtkProperty);
00238 vtkGetObjectMacro(SelectedProperty,vtkProperty);
00239
00240
00241
00242
00243
00244
00245 vtkSetClampMacro(HotSpotSize,double,0.0,1.0);
00246 vtkGetMacro(HotSpotSize,double);
00247
00248 static void ProcessEvents(vtkObject* object,
00249 unsigned long event,
00250 void* clientdata,
00251 void* calldata);
00252
00253
00254
00255 protected:
00256 vtkMimxModPointWidget();
00257 ~vtkMimxModPointWidget();
00258
00259
00260
00261
00262 friend class vtkLineWidget;
00263 friend class vtkPolyDataWidget;
00264 friend class vtkUnstructuredGridWidget;
00265 int State;
00266 enum WidgetState
00267 {
00268 Start=0,
00269 Moving,
00270 Scaling,
00271 Translating,
00272 Outside
00273 };
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283 virtual void OnMouseMove();
00284 virtual void OnLeftButtonDown();
00285 virtual void OnLeftButtonUp();
00286 virtual void OnMiddleButtonDown();
00287 virtual void OnMiddleButtonUp();
00288 virtual void OnRightButtonDown();
00289 virtual void OnRightButtonUp();
00290
00291
00292 vtkActor *Actor;
00293 vtkPolyDataMapper *Mapper;
00294 vtkCursor3D *Cursor3D;
00295 void Highlight(int highlight);
00296
00297
00298 vtkCellPicker *CursorPicker;
00299
00300
00301 int ConstraintAxis;
00302 void Translate(double *p1, double *p2);
00303 void Scale(double *p1, double *p2, int X, int Y);
00304 void MoveFocus(double *p1, double *p2);
00305 int TranslationMode;
00306
00307
00308
00309 vtkProperty *Property;
00310 vtkProperty *SelectedProperty;
00311 void CreateDefaultProperties();
00312
00313
00314 double HotSpotSize;
00315 int DetermineConstraintAxis(int constraint, double *x);
00316 int WaitingForMotion;
00317 int WaitCount;
00318
00319
00320
00321 private:
00322 vtkMimxModPointWidget(const vtkMimxModPointWidget&);
00323 void operator=(const vtkMimxModPointWidget&);
00324
00325 };
00326 #endif
00327
00328