Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

common/vtkTCoords.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTCoords.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00056 #ifndef __vtkTCoords_h
00057 #define __vtkTCoords_h
00058 
00059 #include "vtkAttributeData.h"
00060 
00061 class vtkIdList;
00062 class vtkTCoords;
00063 
00064 class VTK_EXPORT vtkTCoords : public vtkAttributeData
00065 {
00066 public:
00067   static vtkTCoords *New(int dataType, int dim=2);
00068   static vtkTCoords *New();
00069 
00070 
00071   vtkTypeMacro(vtkTCoords,vtkAttributeData);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00076   void SetData(vtkDataArray *);
00077 
00079   vtkAttributeData *MakeObject();
00080  
00082   int GetNumberOfTCoords() {return this->Data->GetNumberOfTuples();};
00083 
00086   float *GetTCoord(int id){return this->Data->GetTuple(id);};
00087 
00090   void GetTCoord(int id, float tc[3]) { this->Data->GetTuple(id,tc);};
00091 
00094   void SetNumberOfTCoords(int number) {this->Data->SetNumberOfTuples(number);};
00095 
00099   void SetTCoord(int id, const float tc[3]) {this->Data->SetTuple(id,tc);};
00100   void SetTCoord(int id, float r, float s, float t);
00101 
00104   void InsertTCoord(int id, const float tc[3]) 
00105     {this->Data->InsertTuple(id,tc);};
00106 
00108   void InsertTCoord(int id, float tx, float ty, float tz);
00109 
00112   int InsertNextTCoord(const float tc[3]) 
00113     {return this->Data->InsertNextTuple(tc);}
00114   int InsertNextTCoord(float tx, float ty, float tz);
00115 
00117   void SetNumberOfComponents(int num);
00118   int GetNumberOfComponents() 
00119     {return this->Data->GetNumberOfComponents();}
00120 
00122   void GetTCoords(vtkIdList *ptId, vtkTCoords *fv);
00123 
00124 #ifndef VTK_REMOVE_LEGACY_CODE
00125 
00126   void GetTCoords(vtkIdList& ptId, vtkTCoords& fv) 
00127     {VTK_LEGACY_METHOD(GetTCoords,"3.2"); this->GetTCoords(&ptId, &fv);}
00128 #endif
00129   
00130 protected:
00131   vtkTCoords();
00132   ~vtkTCoords() {};
00133   vtkTCoords(const vtkTCoords&) {};
00134   void operator=(const vtkTCoords&) {};
00135   
00136 };
00137 
00138 inline vtkAttributeData *vtkTCoords::MakeObject()
00139 {
00140   return vtkTCoords::New(this->GetDataType(), this->GetNumberOfComponents());
00141 }
00142 
00143 inline void vtkTCoords::SetNumberOfComponents(int num)
00144 {
00145   num = (num < 1 ? 1 : (num > 3 ? 3 : num));
00146   this->Data->SetNumberOfComponents(num);
00147 }
00148 
00149 inline void vtkTCoords::SetTCoord(int id, float tx, float ty, float tz)
00150 {
00151   float tc[3];
00152   tc[0] = tx;
00153   tc[1] = ty;
00154   tc[2] = tz;
00155   this->Data->SetTuple(id,tc);
00156 }
00157 
00158 inline void vtkTCoords::InsertTCoord(int id, float tx, float ty, float tz)
00159 {
00160   float tc[3];
00161 
00162   tc[0] = tx;
00163   tc[1] = ty;
00164   tc[2] = tz;
00165   this->Data->InsertTuple(id,tc);
00166 }
00167 
00168 inline int vtkTCoords::InsertNextTCoord(float tx, float ty, float tz)
00169 {
00170   float tc[3];
00171 
00172   tc[0] = tx;
00173   tc[1] = ty;
00174   tc[2] = tz;
00175   return this->Data->InsertNextTuple(tc);
00176 }
00177 
00178 
00179 // These include files are placed here so that if TCoords.h is included 
00180 // all other classes necessary for compilation are also included. 
00181 #include "vtkIdList.h"
00182 
00183 #endif

Generated on Wed Nov 21 12:26:54 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001