VTK
dox/Interaction/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 "vtkInteractionWidgetsModule.h" // For export macro
00040 #include "vtkDistanceRepresentation.h"
00041 
00042 class vtkAxisActor2D;
00043 class vtkProperty2D;
00044 
00045 
00046 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation2D : public vtkDistanceRepresentation
00047 {
00048 public:
00050   static vtkDistanceRepresentation2D *New();
00051 
00053 
00054   vtkTypeMacro(vtkDistanceRepresentation2D,vtkDistanceRepresentation);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00060   virtual double GetDistance()
00061     {return this->Distance;}
00063 
00065 
00068   double* GetPoint1WorldPosition();
00069   double* GetPoint2WorldPosition();
00070   void GetPoint1WorldPosition(double pos[3]);
00071   void GetPoint2WorldPosition(double pos[3]);
00072   void SetPoint1WorldPosition(double pos[3]);
00073   void SetPoint2WorldPosition(double pos[3]);
00075 
00076   void SetPoint1DisplayPosition(double pos[3]);
00077   void SetPoint2DisplayPosition(double pos[3]);
00078   void GetPoint1DisplayPosition(double pos[3]);
00079   void GetPoint2DisplayPosition(double pos[3]);
00080 
00082 
00085   vtkAxisActor2D *GetAxis();
00086   vtkProperty2D  *GetAxisProperty();
00088 
00090   virtual void BuildRepresentation();
00091 
00093 
00094   virtual void ReleaseGraphicsResources(vtkWindow *w);
00095   virtual int RenderOverlay(vtkViewport *viewport);
00096   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00098 
00099 protected:
00100   vtkDistanceRepresentation2D();
00101   ~vtkDistanceRepresentation2D();
00102 
00103   // Add a line to the mix
00104   vtkAxisActor2D *AxisActor;
00105   vtkProperty2D  *AxisProperty;
00106 
00107   // The distance between the two points
00108   double Distance;
00109 
00110 private:
00111   vtkDistanceRepresentation2D(const vtkDistanceRepresentation2D&);  //Not implemented
00112   void operator=(const vtkDistanceRepresentation2D&);  //Not implemented
00113 };
00114 
00115 #endif