VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPen.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 =========================================================================*/ 00015 00031 #ifndef vtkPen_h 00032 #define vtkPen_h 00033 00034 #include "vtkRenderingContext2DModule.h" // For export macro 00035 #include "vtkObject.h" 00036 #include "vtkColor.h" // Needed for vtkColor4ub 00037 00038 class VTKRENDERINGCONTEXT2D_EXPORT vtkPen : public vtkObject 00039 { 00040 public: 00041 vtkTypeMacro(vtkPen, vtkObject); 00042 virtual void PrintSelf(ostream &os, vtkIndent indent); 00043 00044 static vtkPen *New(); 00045 00046 //BTX 00048 00049 enum { 00050 NO_PEN, 00051 SOLID_LINE, 00052 DASH_LINE, 00053 DOT_LINE, 00054 DASH_DOT_LINE, 00055 DASH_DOT_DOT_LINE}; 00056 //ETX 00058 00061 void SetLineType(int type); 00062 00064 int GetLineType(); 00065 00068 void SetColorF(double color[3]); 00069 00072 void SetColorF(double r, double g, double b); 00073 00076 void SetColorF(double r, double g, double b, double a); 00077 00080 void SetOpacityF(double a); 00081 00084 void SetColor(unsigned char color[3]); 00085 00088 void SetColor(unsigned char r, unsigned char g, unsigned char b); 00089 00091 00093 void SetColor(unsigned char r, unsigned char g, unsigned char b, 00094 unsigned char a); 00095 void SetColor(const vtkColor4ub &color); 00097 00100 void SetOpacity(unsigned char a); 00101 00104 void GetColorF(double color[3]); 00105 00107 void GetColor(unsigned char color[3]); 00108 00110 vtkColor4ub GetColorObject(); 00111 00114 unsigned char GetOpacity(); 00115 00117 unsigned char * GetColor() { return this->Color; } 00118 00120 00121 vtkSetMacro(Width, float); 00122 vtkGetMacro(Width, float); 00124 00126 void DeepCopy(vtkPen *pen); 00127 00128 //BTX 00129 protected: 00130 vtkPen(); 00131 ~vtkPen(); 00132 00134 00135 unsigned char* Color; 00136 vtkColor4ub PenColor; 00138 00140 float Width; 00141 00143 int LineType; 00144 00145 private: 00146 vtkPen(const vtkPen &); // Not implemented. 00147 void operator=(const vtkPen &); // Not implemented. 00148 //ETX 00149 }; 00150 00151 #endif //vtkPen_h