00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00063 #ifndef __vtkAxesActor_h
00064 #define __vtkAxesActor_h
00065
00066 #include "vtkProp3D.h"
00067
00068 class vtkActor;
00069 class vtkCaptionActor2D;
00070 class vtkConeSource;
00071 class vtkCylinderSource;
00072 class vtkLineSource;
00073 class vtkPolyData;
00074 class vtkPropCollection;
00075 class vtkProperty;
00076 class vtkRenderer;
00077 class vtkSphereSource;
00078
00079 class VTK_HYBRID_EXPORT vtkAxesActor : public vtkProp3D
00080 {
00081 public:
00082 static vtkAxesActor *New();
00083 vtkTypeRevisionMacro(vtkAxesActor,vtkProp3D);
00084 void PrintSelf(ostream& os, vtkIndent indent);
00085
00089 virtual void GetActors(vtkPropCollection *);
00090
00092
00093 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00094 virtual int RenderTranslucentGeometry(vtkViewport *viewport);
00095 virtual int RenderOverlay(vtkViewport *viewport);
00097
00099 void ShallowCopy(vtkProp *prop);
00100
00104 void ReleaseGraphicsResources(vtkWindow *);
00105
00107
00110 void GetBounds(double bounds[6]);
00111 double *GetBounds();
00113
00115 unsigned long int GetMTime();
00116
00121 virtual unsigned long GetRedrawMTime();
00122
00124
00125 void SetTotalLength( double v[3] )
00126 { this->SetTotalLength( v[0], v[1], v[2] ); }
00127 void SetTotalLength( double x, double y, double z );
00128 vtkGetVectorMacro( TotalLength, double, 3 );
00130
00132
00133 void SetNormalizedShaftLength( double v[3] )
00134 { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
00135 void SetNormalizedShaftLength( double x, double y, double z );
00136 vtkGetVectorMacro( NormalizedShaftLength, double, 3 );
00138
00140
00142 void SetNormalizedTipLength( double v[3] )
00143 { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
00144 void SetNormalizedTipLength( double x, double y, double z );
00145 vtkGetVectorMacro( NormalizedTipLength, double, 3 );
00147
00149
00151 void SetNormalizedLabelPosition( double v[3] )
00152 { this->SetNormalizedLabelPosition( v[0], v[1], v[2] ); }
00153 void SetNormalizedLabelPosition( double x, double y, double z );
00154 vtkGetVectorMacro( NormalizedLabelPosition, double, 3 );
00156
00158
00159 vtkSetClampMacro(ConeResolution, int, 3, 128);
00160 vtkGetMacro(ConeResolution, int);
00161 vtkSetClampMacro(SphereResolution, int, 3, 128);
00162 vtkGetMacro(SphereResolution, int);
00163 vtkSetClampMacro(CylinderResolution, int, 3, 128);
00164 vtkGetMacro(CylinderResolution, int);
00166
00168
00169 vtkSetClampMacro(ConeRadius, double, 0, VTK_LARGE_FLOAT);
00170 vtkGetMacro(ConeRadius, double);
00171 vtkSetClampMacro(SphereRadius, double, 0, VTK_LARGE_FLOAT);
00172 vtkGetMacro(SphereRadius, double);
00173 vtkSetClampMacro(CylinderRadius, double, 0, VTK_LARGE_FLOAT);
00174 vtkGetMacro(CylinderRadius, double);
00176
00178
00180 void SetShaftType( int type );
00181 void SetShaftTypeToCylinder()
00182 { this->SetShaftType( vtkAxesActor::CYLINDER_SHAFT ); }
00183 void SetShaftTypeToLine()
00184 { this->SetShaftType( vtkAxesActor::LINE_SHAFT ); }
00185 void SetShaftTypeToUserDefined()
00186 { this->SetShaftType( vtkAxesActor::USER_DEFINED_SHAFT ); }
00187 vtkGetMacro(ShaftType, int);
00189
00191
00192 void SetTipType( int type );
00193 void SetTipTypeToCone()
00194 { this->SetTipType( vtkAxesActor::CONE_TIP ); }
00195 void SetTipTypeToSphere()
00196 { this->SetTipType( vtkAxesActor::SPHERE_TIP ); }
00197 void SetTipTypeToUserDefined()
00198 { this->SetTipType( vtkAxesActor::USER_DEFINED_TIP ); }
00199 vtkGetMacro(TipType, int);
00201
00203
00204 void SetUserDefinedTip( vtkPolyData * );
00205 vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
00207
00209
00210 void SetUserDefinedShaft( vtkPolyData * );
00211 vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
00213
00215
00216 vtkProperty *GetXAxisTipProperty();
00217 vtkProperty *GetYAxisTipProperty();
00218 vtkProperty *GetZAxisTipProperty();
00220
00222
00223 vtkProperty *GetXAxisShaftProperty();
00224 vtkProperty *GetYAxisShaftProperty();
00225 vtkProperty *GetZAxisShaftProperty();
00227
00229
00231 vtkCaptionActor2D *GetXAxisCaptionActor2D()
00232 {return this->XAxisLabel;}
00233 vtkCaptionActor2D *GetYAxisCaptionActor2D()
00234 {return this->YAxisLabel;}
00235 vtkCaptionActor2D *GetZAxisCaptionActor2D()
00236 {return this->ZAxisLabel;}
00238
00240
00241 vtkSetStringMacro( XAxisLabelText );
00242 vtkGetStringMacro( XAxisLabelText );
00243 vtkSetStringMacro( YAxisLabelText );
00244 vtkGetStringMacro( YAxisLabelText );
00245 vtkSetStringMacro( ZAxisLabelText );
00246 vtkGetStringMacro( ZAxisLabelText );
00248
00250
00251 vtkSetMacro(AxisLabels, int);
00252 vtkGetMacro(AxisLabels, int);
00253 vtkBooleanMacro(AxisLabels, int);
00255
00256
00257 enum
00258 {
00259 CYLINDER_SHAFT,
00260 LINE_SHAFT,
00261 USER_DEFINED_SHAFT
00262 };
00263
00264 enum
00265 {
00266 CONE_TIP,
00267 SPHERE_TIP,
00268 USER_DEFINED_TIP
00269 };
00270
00271
00272 protected:
00273 vtkAxesActor();
00274 ~vtkAxesActor();
00275
00276 vtkCylinderSource *CylinderSource;
00277 vtkLineSource *LineSource;
00278 vtkConeSource *ConeSource;
00279 vtkSphereSource *SphereSource;
00280
00281 vtkActor *XAxisShaft;
00282 vtkActor *YAxisShaft;
00283 vtkActor *ZAxisShaft;
00284
00285 vtkActor *XAxisTip;
00286 vtkActor *YAxisTip;
00287 vtkActor *ZAxisTip;
00288
00289 void UpdateProps();
00290
00291 double TotalLength[3];
00292 double NormalizedShaftLength[3];
00293 double NormalizedTipLength[3];
00294 double NormalizedLabelPosition[3];
00295
00296 int ShaftType;
00297 int TipType;
00298
00299 vtkPolyData *UserDefinedTip;
00300 vtkPolyData *UserDefinedShaft;
00301
00302 char *XAxisLabelText;
00303 char *YAxisLabelText;
00304 char *ZAxisLabelText;
00305
00306 vtkCaptionActor2D *XAxisLabel;
00307 vtkCaptionActor2D *YAxisLabel;
00308 vtkCaptionActor2D *ZAxisLabel;
00309
00310 int AxisLabels;
00311
00312
00313 int ConeResolution;
00314 int SphereResolution;
00315 int CylinderResolution;
00316
00317 double ConeRadius;
00318 double SphereRadius;
00319 double CylinderRadius;
00320
00321 private:
00322 vtkAxesActor(const vtkAxesActor&);
00323 void operator=(const vtkAxesActor&);
00324 };
00325
00326 #endif
00327