00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkArrayExtents.h,v $ 00005 00006 ------------------------------------------------------------------------- 00007 Copyright 2008 Sandia Corporation. 00008 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00009 the U.S. Government retains certain rights in this software. 00010 ------------------------------------------------------------------------- 00011 00012 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00013 All rights reserved. 00014 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00015 00016 This software is distributed WITHOUT ANY WARRANTY; without even 00017 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00018 PURPOSE. See the above copyright notice for more information. 00019 00020 =========================================================================*/ 00021 00053 #ifndef __vtkArrayExtents_h 00054 #define __vtkArrayExtents_h 00055 00056 #include "vtkSystemIncludes.h" 00057 #include <vtksys/stl/vector> 00058 00059 class vtkArrayCoordinates; 00060 00061 class VTK_COMMON_EXPORT vtkArrayExtents 00062 { 00063 public: 00065 vtkArrayExtents(); 00066 00068 explicit vtkArrayExtents(vtkIdType i); 00069 00071 vtkArrayExtents(vtkIdType i, vtkIdType j); 00072 00074 vtkArrayExtents(vtkIdType i, vtkIdType j, vtkIdType k); 00075 00077 static const vtkArrayExtents Uniform(vtkIdType n, vtkIdType m); 00078 00081 void Append(vtkIdType extent); 00082 00084 vtkIdType GetDimensions() const; 00085 00089 vtkIdType GetSize() const; 00090 00095 void SetDimensions(vtkIdType dimensions); 00096 00098 vtkIdType& operator[](vtkIdType i); 00099 00101 const vtkIdType& operator[](vtkIdType i) const; 00102 00104 bool operator==(const vtkArrayExtents& rhs) const; 00105 00107 bool operator!=(const vtkArrayExtents& rhs) const; 00108 00114 bool Contains(const vtkArrayCoordinates& coordinates) const; 00115 00116 VTK_COMMON_EXPORT friend ostream& operator<<( 00117 ostream& stream, const vtkArrayExtents& rhs); 00118 00119 private: 00120 vtkstd::vector<vtkIdType> Storage; 00121 }; 00122 00123 #endif 00124