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 
00054 #ifndef __vtkNormals_h
00055 #define __vtkNormals_h
00056 
00057 #include "vtkAttributeData.h"
00058 
00059 class vtkIdList;
00060 class vtkNormals;
00061 
00062 class VTK_EXPORT vtkNormals : public vtkAttributeData
00063 {
00064 public:
00065   static vtkNormals *New(int dataType);
00066   static vtkNormals *New();
00067 
00068   vtkTypeMacro(vtkNormals,vtkAttributeData);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072   vtkAttributeData *MakeObject()
00073     {return vtkNormals::New(this->GetDataType());}
00074   
00076   int GetNumberOfNormals() 
00077     {return this->Data->GetNumberOfTuples();}
00078 
00080   float *GetNormal(int id) 
00081     {return this->Data->GetTuple(id);}
00082   
00085   void GetNormal(int id, float n[3]) 
00086     {this->Data->GetTuple(id,n);}
00087   void GetNormal(int id, double n[3]) 
00088     {this->Data->GetTuple(id,n);}
00089   
00093   void SetNormal(int id, const float n[3]) 
00094     {this->Data->SetTuple(id,n);}
00095   void SetNormal(int id, const double n[3]) 
00096     {this->Data->SetTuple(id,n);}
00097   void SetNormal(int id, double nx, double ny, double nz);
00098 
00101   void InsertNormal(int id, const double n[3]) 
00102     {this->Data->InsertTuple(id,n);}
00103   void InsertNormal(int id, float n[3]) 
00104     {this->Data->InsertTuple(id,n);}
00105   void InsertNormal(int id, double nx, double ny, double nz);
00106 
00108   int InsertNextNormal(const float n[3]) 
00109     {return this->Data->InsertNextTuple(n);}
00110   int InsertNextNormal(const double n[3]) 
00111     {return this->Data->InsertNextTuple(n);}
00112   int InsertNextNormal(double nx, double ny, double nz);
00113 
00117   void SetNumberOfNormals(int number);
00118 
00120   void GetNormals(vtkIdList *ptId, vtkNormals *fn);
00121 
00122 #ifndef VTK_REMOVE_LEGACY_CODE
00123 
00124   void GetNormals(vtkIdList& ptId, vtkNormals& fn) 
00125     {VTK_LEGACY_METHOD(GetNormals,"3.2"); this->GetNormals(&ptId, &fn);}
00126 #endif
00127   
00128 protected:
00129   vtkNormals();
00130   ~vtkNormals() {};
00131   vtkNormals(const vtkNormals&) {};
00132   void operator=(const vtkNormals&) {};
00133   
00134 };
00135 
00136 
00137 inline void vtkNormals::SetNumberOfNormals(int number)
00138 {
00139   this->Data->SetNumberOfComponents(3);
00140   this->Data->SetNumberOfTuples(number);
00141 }
00142 
00143 inline void vtkNormals::SetNormal(int id, double nx, double ny, double nz)
00144 {
00145   double n[3];
00146   n[0] = nx;
00147   n[1] = ny;
00148   n[2] = nz;
00149   this->Data->SetTuple(id,n);
00150 }
00151 
00152 inline void vtkNormals::InsertNormal(int id, double nx, double ny, double nz)
00153 {
00154   double n[3];
00155 
00156   n[0] = nx;
00157   n[1] = ny;
00158   n[2] = nz;
00159   this->Data->InsertTuple(id,n);
00160 }
00161 
00162 inline int vtkNormals::InsertNextNormal(double nx, double ny, double nz)
00163 {
00164   double n[3];
00165 
00166   n[0] = nx;
00167   n[1] = ny;
00168   n[2] = nz;
00169   return this->Data->InsertNextTuple(n);
00170 }
00171 
00172 
00173 
00174 
00175 #include "vtkIdList.h"
00176 
00177 #endif