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
00060 #ifndef __vtkProperty_h
00061 #define __vtkProperty_h
00062
00063 #include "vtkRender.h"
00064 #include "vtkObject.h"
00065 #include "vtkStructuredPoints.h"
00066
00067 class vtkRenderer;
00068 class vtkActor;
00069
00070 class VTK_EXPORT vtkProperty : public vtkObject
00071 {
00072 public:
00073 vtkTypeMacro(vtkProperty,vtkObject);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00081 static vtkProperty *New();
00082
00084 void DeepCopy(vtkProperty *p);
00085
00091 virtual void Render(vtkActor *,vtkRenderer *) {};
00092
00098 virtual void BackfaceRender(vtkActor *,vtkRenderer *) {};
00099
00101 vtkSetClampMacro(Interpolation,int,VTK_FLAT,VTK_PHONG);
00102 vtkGetMacro(Interpolation,int);
00103 void SetInterpolationToFlat() {this->SetInterpolation(VTK_FLAT);};
00104 void SetInterpolationToGouraud() {this->SetInterpolation(VTK_GOURAUD);};
00105 void SetInterpolationToPhong() {this->SetInterpolation(VTK_PHONG);};
00106 char *GetInterpolationAsString();
00107
00109 vtkSetClampMacro(Representation,int,VTK_POINTS,VTK_SURFACE);
00110 vtkGetMacro(Representation,int);
00111 void SetRepresentationToPoints() {this->SetRepresentation(VTK_POINTS);};
00112 void SetRepresentationToWireframe() {
00113 this->SetRepresentation(VTK_WIREFRAME);};
00114 void SetRepresentationToSurface() {this->SetRepresentation(VTK_SURFACE);};
00115 char *GetRepresentationAsString();
00116
00120 void SetColor(float r,float g,float b);
00121 void SetColor(float a[3]) { this->SetColor(a[0], a[1], a[2]); };
00122 float *GetColor();
00123 void GetColor(float rgb[3]);
00124
00126 vtkSetClampMacro(Ambient,float,0.0,1.0);
00127 vtkGetMacro(Ambient,float);
00128
00130 vtkSetClampMacro(Diffuse,float,0.0,1.0);
00131 vtkGetMacro(Diffuse,float);
00132
00134 vtkSetClampMacro(Specular,float,0.0,1.0);
00135 vtkGetMacro(Specular,float);
00136
00138 vtkSetClampMacro(SpecularPower,float,0.0,100.0);
00139 vtkGetMacro(SpecularPower,float);
00140
00143 vtkSetClampMacro(Opacity,float,0.0,1.0);
00144 vtkGetMacro(Opacity,float);
00145
00150 vtkSetVector3Macro(AmbientColor,float);
00151 vtkGetVectorMacro(AmbientColor,float,3);
00152
00154 vtkSetVector3Macro(DiffuseColor,float);
00155 vtkGetVectorMacro(DiffuseColor,float,3);
00156
00158 vtkSetVector3Macro(SpecularColor,float);
00159 vtkGetVectorMacro(SpecularColor,float,3);
00160
00164 vtkGetMacro(EdgeVisibility,int);
00165 vtkSetMacro(EdgeVisibility,int);
00166 vtkBooleanMacro(EdgeVisibility,int);
00167
00169 vtkSetVector3Macro(EdgeColor,float);
00170 vtkGetVectorMacro(EdgeColor,float,3);
00171
00174 vtkSetClampMacro(LineWidth,float,0,VTK_LARGE_FLOAT);
00175 vtkGetMacro(LineWidth,float);
00176
00179 vtkSetClampMacro(PointSize,float,0,VTK_LARGE_FLOAT);
00180 vtkGetMacro(PointSize,float);
00181
00185 vtkGetMacro(BackfaceCulling,int);
00186 vtkSetMacro(BackfaceCulling,int);
00187 vtkBooleanMacro(BackfaceCulling,int);
00188
00192 vtkGetMacro(FrontfaceCulling,int);
00193 vtkSetMacro(FrontfaceCulling,int);
00194 vtkBooleanMacro(FrontfaceCulling,int);
00195
00196 protected:
00197 vtkProperty();
00198 ~vtkProperty() {};
00199 vtkProperty(const vtkProperty&) {};
00200 void operator=(const vtkProperty&) {};
00201
00202 float Color[3];
00203 float AmbientColor[3];
00204 float DiffuseColor[3];
00205 float SpecularColor[3];
00206 float EdgeColor[3];
00207 float Ambient;
00208 float Diffuse;
00209 float Specular;
00210 float SpecularPower;
00211 float Opacity;
00212 float PointSize;
00213 float LineWidth;
00214 int Interpolation;
00215 int Representation;
00216 int EdgeVisibility;
00217 int BackfaceCulling;
00218 int FrontfaceCulling;
00219 };
00220
00222 inline char *vtkProperty::GetInterpolationAsString(void)
00223 {
00224 if ( this->Interpolation == VTK_FLAT )
00225 {
00226 return (char *)"Flat";
00227 }
00228 else if ( this->Interpolation == VTK_GOURAUD )
00229 {
00230 return (char *)"Gouraud";
00231 }
00232 else
00233 {
00234 return (char *)"Phong";
00235 }
00236 }
00237
00238
00240 inline char *vtkProperty::GetRepresentationAsString(void)
00241 {
00242 if ( this->Representation == VTK_POINTS )
00243 {
00244 return (char *)"Points";
00245 }
00246 else if ( this->Representation == VTK_WIREFRAME )
00247 {
00248 return (char *)"Wireframe";
00249 }
00250 else
00251 {
00252 return (char *)"Surface";
00253 }
00254 }
00255
00256
00257
00258 #endif