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 =========================================================================*/
00036 #ifndef __vtkDistanceRepresentation2D_h
00037 #define __vtkDistanceRepresentation2D_h
00038 
00039 #include "vtkDistanceRepresentation.h"
00040 
00041 class vtkAxisActor2D;
00042 class vtkProperty2D;
00043 
00044 
00045 class VTK_WIDGETS_EXPORT vtkDistanceRepresentation2D : public vtkDistanceRepresentation
00046 {
00047 public:
00049   static vtkDistanceRepresentation2D *New();
00050 
00052 
00053   vtkTypeMacro(vtkDistanceRepresentation2D,vtkDistanceRepresentation);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00059   virtual double GetDistance()
00060     {return this->Distance;}
00062 
00064 
00067   double* GetPoint1WorldPosition();
00068   double* GetPoint2WorldPosition();
00069   void GetPoint1WorldPosition(double pos[3]);
00070   void GetPoint2WorldPosition(double pos[3]);
00071   void SetPoint1WorldPosition(double pos[3]);
00072   void SetPoint2WorldPosition(double pos[3]);
00074 
00075   void SetPoint1DisplayPosition(double pos[3]);
00076   void SetPoint2DisplayPosition(double pos[3]);
00077   void GetPoint1DisplayPosition(double pos[3]);
00078   void GetPoint2DisplayPosition(double pos[3]);
00079 
00081 
00084   vtkAxisActor2D *GetAxis();
00085   vtkProperty2D  *GetAxisProperty();
00087 
00089   virtual void BuildRepresentation();
00090 
00092 
00093   virtual void ReleaseGraphicsResources(vtkWindow *w);
00094   virtual int RenderOverlay(vtkViewport *viewport);
00095   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00097 
00098 protected:
00099   vtkDistanceRepresentation2D();
00100   ~vtkDistanceRepresentation2D();
00101 
00102   // Add a line to the mix
00103   vtkAxisActor2D *AxisActor;
00104   vtkProperty2D  *AxisProperty;
00105 
00106   // The distance between the two points
00107   double Distance;
00108 
00109 private:
00110   vtkDistanceRepresentation2D(const vtkDistanceRepresentation2D&);  //Not implemented
00111   void operator=(const vtkDistanceRepresentation2D&);  //Not implemented
00112 };
00113 
00114 #endif