00001 //============================================================================= 00002 // This file is part of VTKEdge. See vtkedge.org for more information. 00003 // 00004 // Copyright (c) 2010 Kitware, Inc. 00005 // 00006 // VTKEdge may be used under the terms of the BSD License 00007 // Please see the file Copyright.txt in the root directory of 00008 // VTKEdge for further information. 00009 // 00010 // Alternatively, you may see: 00011 // 00012 // http://www.vtkedge.org/vtkedge/project/license.html 00013 // 00014 // 00015 // For custom extensions, consulting services, or training for 00016 // this or any other Kitware supported open source project, please 00017 // contact Kitware at sales@kitware.com. 00018 // 00019 // 00020 //============================================================================= 00021 00032 #ifndef __vtkKWEPaintbrushAnnotationRepresentation_h 00033 #define __vtkKWEPaintbrushAnnotationRepresentation_h 00034 00035 #include "VTKEdgeConfigure.h" // needed for export symbols directives 00036 #include "vtkWidgetRepresentation.h" 00037 #include <vtksys/stl/string> 00038 00039 class vtkTimeStamp; 00040 class vtkKWEPaintbrushRepresentation; 00041 class vtkActor2D; 00042 class vtkTextMapper; 00043 class vtkTextProperty; 00044 00045 class VTKEdge_WIDGETS_EXPORT vtkKWEPaintbrushAnnotationRepresentation : public vtkWidgetRepresentation 00046 { 00047 //BTX 00048 friend class vtkKWEPaintbrushRepresentation; 00049 //ETX 00050 public: 00052 static vtkKWEPaintbrushAnnotationRepresentation *New(); 00053 00055 00056 vtkTypeRevisionMacro(vtkKWEPaintbrushAnnotationRepresentation,vtkWidgetRepresentation); 00057 void PrintSelf(ostream& os, vtkIndent indent); 00059 00061 virtual void BuildRepresentation(); 00062 00064 00065 virtual void ReleaseGraphicsResources(vtkWindow *w); 00066 virtual int RenderOverlay(vtkViewport *viewport); 00067 virtual int RenderOpaqueGeometry(vtkViewport *viewport); 00069 00070 #if VTKEdge_VTK_VERSION_DATE > 20070305 00071 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); 00072 virtual int HasTranslucentPolygonalGeometry(); 00073 #else 00074 // Legacy method to support VTK source versions prior to 2007/03/05 00075 virtual int RenderTranslucentGeometry(vtkViewport *viewport); 00076 #endif 00077 00079 virtual void SetVisibility(int); 00080 00082 00086 vtkSetVector2Macro( AnnotationPosition, double ); 00087 vtkGetVector2Macro( AnnotationPosition, double ); 00089 00091 00093 vtkSetStringMacro( Annotation ); 00094 vtkGetStringMacro( Annotation ); 00096 00098 00099 vtkGetObjectMacro( TextProperty, vtkTextProperty ); 00101 00102 protected: 00103 vtkKWEPaintbrushAnnotationRepresentation(); 00104 ~vtkKWEPaintbrushAnnotationRepresentation(); 00105 00106 vtkTimeStamp *BuildTime; 00107 vtkActor2D *TextActor; 00108 vtkTextProperty *TextProperty; 00109 vtkTextMapper *TextMapper; 00110 char *Annotation; 00111 vtkKWEPaintbrushRepresentation *PaintbrushRepresentation; 00112 vtksys_stl::string LastDisplayedAnnotation; 00113 int LastDisplayPosition[2]; 00114 double AnnotationPosition[2]; 00115 00116 private: 00117 vtkKWEPaintbrushAnnotationRepresentation(const vtkKWEPaintbrushAnnotationRepresentation&); //Not implemented 00118 void operator=(const vtkKWEPaintbrushAnnotationRepresentation&); //Not implemented 00119 }; 00120 00121 #endif 00122
1.7.1