VTK
dox/Common/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 "vtkObject.h"
00038 
00039 class vtkInformationQuadratureSchemeDefinitionVectorKey;
00040 class vtkInformationStringKey;
00041 class vtkXMLDataElement;
00042 
00043 class VTK_COMMON_EXPORT vtkQuadratureSchemeDefinition : public vtkObject
00044 {
00045 public:
00046   // vtk stuff
00047   vtkTypeMacro(vtkQuadratureSchemeDefinition,vtkObject);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049   static vtkInformationQuadratureSchemeDefinitionVectorKey* DICTIONARY();
00050   static vtkInformationStringKey* QUADRATURE_OFFSET_ARRAY_NAME();
00051 
00054   static vtkQuadratureSchemeDefinition *New();
00055 
00057   int DeepCopy(const vtkQuadratureSchemeDefinition *other);
00058 
00061   int SaveState(vtkXMLDataElement *e);
00063   int RestoreState(vtkXMLDataElement *e);
00064 
00067   void Clear();
00068 
00070 
00071   void Initialize(int cellType,
00072                   int numberOfNodes,
00073                   int numberOfQuadraturePoints,
00074                   double *shapeFunctionWeights);
00076 
00077 
00078   void Initialize(int cellType,
00079                   int numberOfNodes,
00080                   int numberOfQuadraturePoints,
00081                   double *shapeFunctionWeights,
00082                   double *quadratureWeights);
00084 
00086   int GetCellType() const { return this->CellType; }
00088   int GetQuadratureKey() const { return this->QuadratureKey; }
00090   int GetNumberOfNodes() const { return this->NumberOfNodes; }
00092   int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; }
00096   const double *GetShapeFunctionWeights() const  { return this->ShapeFunctionWeights; }
00098 
00100   const double *GetShapeFunctionWeights(int quadraturePointId) const
00101   {
00102     int idx=quadraturePointId*this->NumberOfNodes;
00103     return this->ShapeFunctionWeights+idx;
00104   }
00106 
00107   const double *GetQuadratureWeights() const { return this->QuadratureWeights; }
00108 
00109 protected:
00110   vtkQuadratureSchemeDefinition();
00111   ~vtkQuadratureSchemeDefinition();
00112 private:
00115   void ReleaseResources();
00117   int SecureResources();
00120   void SetShapeFunctionWeights(const double *W);
00123   void SetQuadratureWeights(const double *W);
00124 
00125   //
00126   vtkQuadratureSchemeDefinition(const vtkQuadratureSchemeDefinition &); // Not implemented.
00127   void operator=(const vtkQuadratureSchemeDefinition &); // Not implemented.
00128   friend ostream &operator<<(ostream &s, const vtkQuadratureSchemeDefinition &d);
00129   friend istream &operator>>(istream &s, const vtkQuadratureSchemeDefinition &d);
00130   //
00131   int CellType;
00132   int QuadratureKey;
00133   int NumberOfNodes;
00134   int NumberOfQuadraturePoints;
00135   double *ShapeFunctionWeights;
00136   double *QuadratureWeights;
00137 };
00138 
00139 #endif
00140