00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00053 #ifndef __vtkAxesActor_h
00054 #define __vtkAxesActor_h
00055
00056 #include "vtkProp3D.h"
00057
00058 class vtkActor;
00059 class vtkCaptionActor2D;
00060 class vtkConeSource;
00061 class vtkCylinderSource;
00062 class vtkLineSource;
00063 class vtkPolyData;
00064 class vtkPropCollection;
00065 class vtkProperty;
00066 class vtkRenderer;
00067 class vtkSphereSource;
00068
00069 class VTK_HYBRID_EXPORT vtkAxesActor : public vtkProp3D
00070 {
00071 public:
00072 static vtkAxesActor *New();
00073 vtkTypeMacro(vtkAxesActor,vtkProp3D);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00079 virtual void GetActors(vtkPropCollection *);
00080
00082
00083 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00084 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
00085 virtual int RenderOverlay(vtkViewport *viewport);
00087
00089 virtual int HasTranslucentPolygonalGeometry();
00090
00092 void ShallowCopy(vtkProp *prop);
00093
00097 void ReleaseGraphicsResources(vtkWindow *);
00098
00100
00103 void GetBounds(double bounds[6]);
00104 double *GetBounds();
00106
00108 unsigned long int GetMTime();
00109
00114 virtual unsigned long GetRedrawMTime();
00115
00117
00118 void SetTotalLength( double v[3] )
00119 { this->SetTotalLength( v[0], v[1], v[2] ); }
00120 void SetTotalLength( double x, double y, double z );
00121 vtkGetVectorMacro( TotalLength, double, 3 );
00123
00125
00126 void SetNormalizedShaftLength( double v[3] )
00127 { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
00128 void SetNormalizedShaftLength( double x, double y, double z );
00129 vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
00131
00133
00135 void SetNormalizedTipLength( double v[3] )
00136 { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
00137 void SetNormalizedTipLength( double x, double y, double z );
00138 vtkGetVectorMacro( NormalizedTipLength, double, 3 );
00140
00142
00144 void SetNormalizedLabelPosition( double v[3] )
00145 { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
00146 void SetNormalizedLabelPosition( double x, double y, double z );
00147 vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
00149
00151
00152 vtkSetClampMacro(ConeResolution, int, 3, 128);
00153 vtkGetMacro(ConeResolution, int);
00154 vtkSetClampMacro(SphereResolution, int, 3, 128);
00155 vtkGetMacro(SphereResolution, int);
00156 vtkSetClampMacro(CylinderResolution, int, 3, 128);
00157 vtkGetMacro(CylinderResolution, int);
00159
00161
00162 vtkSetClampMacro(ConeRadius, double, 0, VTK_LARGE_FLOAT);
00163 vtkGetMacro(ConeRadius, double);
00164 vtkSetClampMacro(SphereRadius, double, 0, VTK_LARGE_FLOAT);
00165 vtkGetMacro(SphereRadius, double);
00166 vtkSetClampMacro(CylinderRadius, double, 0, VTK_LARGE_FLOAT);
00167 vtkGetMacro(CylinderRadius, double);
00169
00171
00173 void SetShaftType( int type );
00174 void SetShaftTypeToCylinder()
00175 { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
00176 void SetShaftTypeToLine()
00177 { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
00178 void SetShaftTypeToUserDefined()
00179 { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
00180 vtkGetMacro(ShaftType, int);
00182
00184
00185 void SetTipType( int type );
00186 void SetTipTypeToCone()
00187 { this->SetTipType( vtkAxesActor::CONE_TIP ); }
00188 void SetTipTypeToSphere()
00189 { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
00190 void SetTipTypeToUserDefined()
00191 { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
00192 vtkGetMacro(TipType, int);
00194
00196
00197 void SetUserDefinedTip( vtkPolyData * );
00198 vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
00200
00202
00203 void SetUserDefinedShaft( vtkPolyData * );
00204 vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
00206
00208
00209 vtkProperty *GetXAxisTipProperty();
00210 vtkProperty *GetYAxisTipProperty();
00211 vtkProperty *GetZAxisTipProperty();
00213
00215
00216 vtkProperty *GetXAxisShaftProperty();
00217 vtkProperty *GetYAxisShaftProperty();
00218 vtkProperty *GetZAxisShaftProperty();
00220
00222
00224 vtkCaptionActor2D *GetXAxisCaptionActor2D()
00225 {return this->XAxisLabel;}
00226 vtkCaptionActor2D *GetYAxisCaptionActor2D()
00227 {return this->YAxisLabel;}
00228 vtkCaptionActor2D *GetZAxisCaptionActor2D()
00229 {return this->ZAxisLabel;}
00231
00233
00234 vtkSetStringMacro( XAxisLabelText );
00235 vtkGetStringMacro( XAxisLabelText );
00236 vtkSetStringMacro( YAxisLabelText );
00237 vtkGetStringMacro( YAxisLabelText );
00238 vtkSetStringMacro( ZAxisLabelText );
00239 vtkGetStringMacro( ZAxisLabelText );
00241
00243
00244 vtkSetMacro(AxisLabels, int);
00245 vtkGetMacro(AxisLabels, int);
00246 vtkBooleanMacro(AxisLabels, int);
00248
00249
00250 enum
00251 {
00252 CYLINDER_SHAFT,
00253 LINE_SHAFT,
00254 USER_DEFINED_SHAFT
00255 };
00256
00257 enum
00258 {
00259 CONE_TIP,
00260 SPHERE_TIP,
00261 USER_DEFINED_TIP
00262 };
00263
00264
00265 protected:
00266 vtkAxesActor();
00267 ~vtkAxesActor();
00268
00269 vtkCylinderSource *CylinderSource;
00270 vtkLineSource *LineSource;
00271 vtkConeSource *ConeSource;
00272 vtkSphereSource *SphereSource;
00273
00274 vtkActor *XAxisShaft;
00275 vtkActor *YAxisShaft;
00276 vtkActor *ZAxisShaft;
00277
00278 vtkActor *XAxisTip;
00279 vtkActor *YAxisTip;
00280 vtkActor *ZAxisTip;
00281
00282 void UpdateProps();
00283
00284 double TotalLength[3];
00285 double NormalizedShaftLength[3];
00286 double NormalizedTipLength[3];
00287 double NormalizedLabelPosition[3];
00288
00289 int ShaftType;
00290 int TipType;
00291
00292 vtkPolyData *UserDefinedTip;
00293 vtkPolyData *UserDefinedShaft;
00294
00295 char *XAxisLabelText;
00296 char *YAxisLabelText;
00297 char *ZAxisLabelText;
00298
00299 vtkCaptionActor2D *XAxisLabel;
00300 vtkCaptionActor2D *YAxisLabel;
00301 vtkCaptionActor2D *ZAxisLabel;
00302
00303 int AxisLabels;
00304
00305
00306 int ConeResolution;
00307 int SphereResolution;
00308 int CylinderResolution;
00309
00310 double ConeRadius;
00311 double SphereRadius;
00312 double CylinderRadius;
00313
00314 private:
00315 vtkAxesActor(const vtkAxesActor&);
00316 void operator=(const vtkAxesActor&);
00317 };
00318
00319 #endif
00320