VTK
dox/Common/DataModel/vtkQuadratureSchemeDefinition.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuadratureSchemeDefinition.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00034 #ifndef vtkQuadratureSchemeDefinition_h
00035 #define vtkQuadratureSchemeDefinition_h
00036 
00037 #include "vtkCommonDataModelModule.h" // For export macro
00038 #include "vtkObject.h"
00039 
00040 class vtkInformationQuadratureSchemeDefinitionVectorKey;
00041 class vtkInformationStringKey;
00042 class vtkXMLDataElement;
00043 
00044 class VTKCOMMONDATAMODEL_EXPORT vtkQuadratureSchemeDefinition : public vtkObject
00045 {
00046 public:
00047   // vtk stuff
00048   vtkTypeMacro(vtkQuadratureSchemeDefinition,vtkObject);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050   static vtkInformationQuadratureSchemeDefinitionVectorKey* DICTIONARY();
00051   static vtkInformationStringKey* QUADRATURE_OFFSET_ARRAY_NAME();
00052 
00055   static vtkQuadratureSchemeDefinition *New();
00056 
00058   int DeepCopy(const vtkQuadratureSchemeDefinition *other);
00059 
00062   int SaveState(vtkXMLDataElement *e);
00064   int RestoreState(vtkXMLDataElement *e);
00065 
00068   void Clear();
00069 
00071 
00072   void Initialize(int cellType,
00073                   int numberOfNodes,
00074                   int numberOfQuadraturePoints,
00075                   double *shapeFunctionWeights);
00077 
00078 
00079   void Initialize(int cellType,
00080                   int numberOfNodes,
00081                   int numberOfQuadraturePoints,
00082                   double *shapeFunctionWeights,
00083                   double *quadratureWeights);
00085 
00087   int GetCellType() const { return this->CellType; }
00089   int GetQuadratureKey() const { return this->QuadratureKey; }
00091   int GetNumberOfNodes() const { return this->NumberOfNodes; }
00093   int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; }
00097   const double *GetShapeFunctionWeights() const  { return this->ShapeFunctionWeights; }
00099 
00101   const double *GetShapeFunctionWeights(int quadraturePointId) const
00102   {
00103     int idx=quadraturePointId*this->NumberOfNodes;
00104     return this->ShapeFunctionWeights+idx;
00105   }
00107 
00108   const double *GetQuadratureWeights() const { return this->QuadratureWeights; }
00109 
00110 protected:
00111   vtkQuadratureSchemeDefinition();
00112   ~vtkQuadratureSchemeDefinition();
00113 private:
00116   void ReleaseResources();
00118   int SecureResources();
00121   void SetShapeFunctionWeights(const double *W);
00124   void SetQuadratureWeights(const double *W);
00125 
00126   //
00127   vtkQuadratureSchemeDefinition(const vtkQuadratureSchemeDefinition &); // Not implemented.
00128   void operator=(const vtkQuadratureSchemeDefinition &); // Not implemented.
00129   friend ostream &operator<<(ostream &s, const vtkQuadratureSchemeDefinition &d);
00130   friend istream &operator>>(istream &s, const vtkQuadratureSchemeDefinition &d);
00131   //
00132   int CellType;
00133   int QuadratureKey;
00134   int NumberOfNodes;
00135   int NumberOfQuadraturePoints;
00136   double *ShapeFunctionWeights;
00137   double *QuadratureWeights;
00138 };
00139 
00140 #endif
00141