00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00031 #ifndef __vtkDistanceRepresentation3D_h
00032 #define __vtkDistanceRepresentation3D_h
00033
00034 #include "vtkDistanceRepresentation.h"
00035
00036 class vtkPoints;
00037 class vtkPolyData;
00038 class vtkPolyDataMapper;
00039 class vtkActor;
00040 class vtkVectorText;
00041 class vtkFollower;
00042 class vtkBox;
00043 class vtkCylinderSource;
00044 class vtkGlyph3D;
00045 class vtkDoubleArray;
00046 class vtkTransformPolyDataFilter;
00047 class vtkProperty;
00048
00049
00050 class VTK_WIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
00051 {
00052 public:
00054 static vtkDistanceRepresentation3D *New();
00055
00057
00058 vtkTypeMacro(vtkDistanceRepresentation3D,vtkDistanceRepresentation);
00059 void PrintSelf(ostream& os, vtkIndent indent);
00061
00063
00064 virtual double GetDistance()
00065 {return this->Distance;}
00067
00069
00071 void SetGlyphScale(double scale);
00072 vtkGetMacro(GlyphScale, double);
00074
00076 virtual vtkProperty *GetLineProperty();
00077
00079
00081 void SetLabelPosition(double labelPosition);
00082 vtkGetMacro(LabelPosition, double);
00084
00086
00087 vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_LARGE_INTEGER);
00088 vtkGetMacro(MaximumNumberOfRulerTicks, int);
00090
00092
00094 vtkGetObjectMacro(GlyphActor, vtkActor);
00096
00098
00100 vtkGetObjectMacro(LabelActor, vtkFollower);
00102
00104
00107 double* GetPoint1WorldPosition();
00108 double* GetPoint2WorldPosition();
00109 void GetPoint1WorldPosition(double pos[3]);
00110 void GetPoint2WorldPosition(double pos[3]);
00111 void SetPoint1WorldPosition(double pos[3]);
00112 void SetPoint2WorldPosition(double pos[3]);
00114
00115 void SetPoint1DisplayPosition(double pos[3]);
00116 void SetPoint2DisplayPosition(double pos[3]);
00117 void GetPoint1DisplayPosition(double pos[3]);
00118 void GetPoint2DisplayPosition(double pos[3]);
00119
00121
00122 virtual void BuildRepresentation();
00123 virtual double *GetBounds();
00125
00127
00128 virtual void ReleaseGraphicsResources(vtkWindow *w);
00129 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00130 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
00132
00134
00136 void SetLabelScale(double x, double y, double z)
00137 {
00138 double scale[3];
00139 scale[0] = x;
00140 scale[1] = y;
00141 scale[2] = z;
00142 this->SetLabelScale(scale);
00143 }
00144 virtual void SetLabelScale( double scale[3] );
00145 virtual double * GetLabelScale();
00147
00149 virtual vtkProperty *GetLabelProperty();
00150
00151 protected:
00152 vtkDistanceRepresentation3D();
00153 ~vtkDistanceRepresentation3D();
00154
00155
00156 vtkPoints *LinePoints;
00157 vtkPolyData *LinePolyData;
00158 vtkPolyDataMapper *LineMapper;
00159 vtkActor *LineActor;
00160
00161
00162 vtkVectorText *LabelText;
00163 vtkPolyDataMapper *LabelMapper;
00164 vtkFollower *LabelActor;
00165
00166
00167 bool LabelScaleSpecified;
00168
00169
00170 vtkPoints *GlyphPoints;
00171 vtkDoubleArray *GlyphVectors;
00172 vtkPolyData *GlyphPolyData;
00173 vtkCylinderSource *GlyphCylinder;
00174 vtkTransformPolyDataFilter *GlyphXForm;
00175 vtkGlyph3D *Glyph3D;
00176 vtkPolyDataMapper *GlyphMapper;
00177 vtkActor *GlyphActor;
00178
00179
00180 double GlyphScale;
00181 bool GlyphScaleSpecified;
00182
00183
00184 double Distance;
00185
00186
00187 vtkBox *BoundingBox;
00188
00189
00190 int MaximumNumberOfRulerTicks;
00191
00192
00193 double LabelPosition;
00194
00195 private:
00196 vtkDistanceRepresentation3D(const vtkDistanceRepresentation3D&);
00197 void operator=(const vtkDistanceRepresentation3D&);
00198
00199
00200 void UpdateLabelPosition();
00201 };
00202
00203 #endif