00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00064 #ifndef __vtkProperty_h
00065 #define __vtkProperty_h
00066
00067 #include "vtkRender.h"
00068 #include "vtkObject.h"
00069 #include "vtkStructuredPoints.h"
00070
00071 class vtkRenderer;
00072 class vtkActor;
00073
00074 class VTK_RENDERING_EXPORT vtkProperty : public vtkObject
00075 {
00076 public:
00077 vtkTypeMacro(vtkProperty,vtkObject);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00085 static vtkProperty *New();
00086
00088 void DeepCopy(vtkProperty *p);
00089
00095 virtual void Render(vtkActor *,vtkRenderer *) {};
00096
00102 virtual void BackfaceRender(vtkActor *,vtkRenderer *) {};
00103
00105
00106 vtkSetClampMacro(Interpolation,int,VTK_FLAT,VTK_PHONG);
00107 vtkGetMacro(Interpolation,int);
00108 void SetInterpolationToFlat() {this->SetInterpolation(VTK_FLAT);};
00109 void SetInterpolationToGouraud() {this->SetInterpolation(VTK_GOURAUD);};
00110 void SetInterpolationToPhong() {this->SetInterpolation(VTK_PHONG);};
00111 char *GetInterpolationAsString();
00113
00115
00116 vtkSetClampMacro(Representation,int,VTK_POINTS,VTK_SURFACE);
00117 vtkGetMacro(Representation,int);
00118 void SetRepresentationToPoints() {this->SetRepresentation(VTK_POINTS);};
00119 void SetRepresentationToWireframe() {
00120 this->SetRepresentation(VTK_WIREFRAME);};
00121 void SetRepresentationToSurface() {this->SetRepresentation(VTK_SURFACE);};
00122 char *GetRepresentationAsString();
00124
00126
00129 void SetColor(float r,float g,float b);
00130 void SetColor(float a[3]) { this->SetColor(a[0], a[1], a[2]); };
00131 float *GetColor();
00132 void GetColor(float rgb[3]);
00134
00136
00137 vtkSetClampMacro(Ambient,float,0.0,1.0);
00138 vtkGetMacro(Ambient,float);
00140
00142
00143 vtkSetClampMacro(Diffuse,float,0.0,1.0);
00144 vtkGetMacro(Diffuse,float);
00146
00148
00149 vtkSetClampMacro(Specular,float,0.0,1.0);
00150 vtkGetMacro(Specular,float);
00152
00154
00155 vtkSetClampMacro(SpecularPower,float,0.0,100.0);
00156 vtkGetMacro(SpecularPower,float);
00158
00160
00162 vtkSetClampMacro(Opacity,float,0.0,1.0);
00163 vtkGetMacro(Opacity,float);
00165
00167
00171 vtkSetVector3Macro(AmbientColor,float);
00172 vtkGetVectorMacro(AmbientColor,float,3);
00174
00176
00177 vtkSetVector3Macro(DiffuseColor,float);
00178 vtkGetVectorMacro(DiffuseColor,float,3);
00180
00182
00183 vtkSetVector3Macro(SpecularColor,float);
00184 vtkGetVectorMacro(SpecularColor,float,3);
00186
00188
00191 vtkGetMacro(EdgeVisibility,int);
00192 vtkSetMacro(EdgeVisibility,int);
00193 vtkBooleanMacro(EdgeVisibility,int);
00195
00197
00198 vtkSetVector3Macro(EdgeColor,float);
00199 vtkGetVectorMacro(EdgeColor,float,3);
00201
00203
00205 vtkSetClampMacro(LineWidth,float,0,VTK_LARGE_FLOAT);
00206 vtkGetMacro(LineWidth,float);
00208
00210
00213 vtkSetMacro(LineStipplePattern,int);
00214 vtkGetMacro(LineStipplePattern,int);
00216
00218
00221 vtkSetClampMacro(LineStippleRepeatFactor,int,1,VTK_LARGE_INTEGER);
00222 vtkGetMacro(LineStippleRepeatFactor,int);
00224
00226
00228 vtkSetClampMacro(PointSize,float,0,VTK_LARGE_FLOAT);
00229 vtkGetMacro(PointSize,float);
00231
00233
00236 vtkGetMacro(BackfaceCulling,int);
00237 vtkSetMacro(BackfaceCulling,int);
00238 vtkBooleanMacro(BackfaceCulling,int);
00240
00242
00245 vtkGetMacro(FrontfaceCulling,int);
00246 vtkSetMacro(FrontfaceCulling,int);
00247 vtkBooleanMacro(FrontfaceCulling,int);
00249
00250 protected:
00251 vtkProperty();
00252 ~vtkProperty() {};
00253
00254 float Color[3];
00255 float AmbientColor[3];
00256 float DiffuseColor[3];
00257 float SpecularColor[3];
00258 float EdgeColor[3];
00259 float Ambient;
00260 float Diffuse;
00261 float Specular;
00262 float SpecularPower;
00263 float Opacity;
00264 float PointSize;
00265 float LineWidth;
00266 int LineStipplePattern;
00267 int LineStippleRepeatFactor;
00268 int Interpolation;
00269 int Representation;
00270 int EdgeVisibility;
00271 int BackfaceCulling;
00272 int FrontfaceCulling;
00273 private:
00274 vtkProperty(const vtkProperty&);
00275 void operator=(const vtkProperty&);
00276 };
00277
00279 inline char *vtkProperty::GetInterpolationAsString(void)
00280 {
00281 if ( this->Interpolation == VTK_FLAT )
00282 {
00283 return (char *)"Flat";
00284 }
00285 else if ( this->Interpolation == VTK_GOURAUD )
00286 {
00287 return (char *)"Gouraud";
00288 }
00289 else
00290 {
00291 return (char *)"Phong";
00292 }
00293 }
00294
00295
00297 inline char *vtkProperty::GetRepresentationAsString(void)
00298 {
00299 if ( this->Representation == VTK_POINTS )
00300 {
00301 return (char *)"Points";
00302 }
00303 else if ( this->Representation == VTK_WIREFRAME )
00304 {
00305 return (char *)"Wireframe";
00306 }
00307 else
00308 {
00309 return (char *)"Surface";
00310 }
00311 }
00312
00313
00314
00315 #endif