VTK
dox/Widgets/vtkDistanceRepresentation2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkDistanceRepresentation2D.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00033 #ifndef __vtkDistanceRepresentation2D_h
00034 #define __vtkDistanceRepresentation2D_h
00035 
00036 #include "vtkDistanceRepresentation.h"
00037 
00038 class vtkAxisActor2D;
00039 class vtkProperty2D;
00040 
00041 
00042 class VTK_WIDGETS_EXPORT vtkDistanceRepresentation2D : public vtkDistanceRepresentation
00043 {
00044 public:
00046   static vtkDistanceRepresentation2D *New();
00047 
00049 
00050   vtkTypeMacro(vtkDistanceRepresentation2D,vtkDistanceRepresentation);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055 
00056   virtual double GetDistance()
00057     {return this->Distance;}
00059 
00061 
00064   double* GetPoint1WorldPosition();
00065   double* GetPoint2WorldPosition();
00066   void GetPoint1WorldPosition(double pos[3]);
00067   void GetPoint2WorldPosition(double pos[3]);
00068   void SetPoint1WorldPosition(double pos[3]);
00069   void SetPoint2WorldPosition(double pos[3]);
00071 
00072   void SetPoint1DisplayPosition(double pos[3]);
00073   void SetPoint2DisplayPosition(double pos[3]);
00074   void GetPoint1DisplayPosition(double pos[3]);
00075   void GetPoint2DisplayPosition(double pos[3]);
00076 
00078 
00081   vtkAxisActor2D *GetAxis();
00082   vtkProperty2D  *GetAxisProperty();
00084 
00086   virtual void BuildRepresentation();
00087 
00089 
00090   virtual void ReleaseGraphicsResources(vtkWindow *w);
00091   virtual int RenderOverlay(vtkViewport *viewport);
00092   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00094 
00095 protected:
00096   vtkDistanceRepresentation2D();
00097   ~vtkDistanceRepresentation2D();
00098 
00099   // Add a line to the mix
00100   vtkAxisActor2D *AxisActor;
00101   vtkProperty2D  *AxisProperty;
00102 
00103   // The distance between the two points
00104   double Distance;
00105 
00106 private:
00107   vtkDistanceRepresentation2D(const vtkDistanceRepresentation2D&);  //Not implemented
00108   void operator=(const vtkDistanceRepresentation2D&);  //Not implemented
00109 };
00110 
00111 #endif