VTK
vtkQuadratureSchemeDefinition.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadratureSchemeDefinition.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef vtkQuadratureSchemeDefinition_h
35 #define vtkQuadratureSchemeDefinition_h
36 
37 #include "vtkObject.h"
38 
41 class vtkXMLDataElement;
42 
44 {
45 public:
46  // vtk stuff
48  void PrintSelf(ostream& os, vtkIndent indent);
50  static vtkInformationStringKey* QUADRATURE_OFFSET_ARRAY_NAME();
51 
55 
57  int DeepCopy(const vtkQuadratureSchemeDefinition *other);
58 
61  int SaveState(vtkXMLDataElement *e);
63  int RestoreState(vtkXMLDataElement *e);
64 
67  void Clear();
68 
70 
71  void Initialize(int cellType,
72  int numberOfNodes,
73  int numberOfQuadraturePoints,
74  double *shapeFunctionWeights);
76 
77 
78  void Initialize(int cellType,
79  int numberOfNodes,
80  int numberOfQuadraturePoints,
81  double *shapeFunctionWeights,
82  double *quadratureWeights);
84 
86  int GetCellType() const { return this->CellType; }
88  int GetQuadratureKey() const { return this->QuadratureKey; }
90  int GetNumberOfNodes() const { return this->NumberOfNodes; }
92  int GetNumberOfQuadraturePoints() const { return this->NumberOfQuadraturePoints; }
96  const double *GetShapeFunctionWeights() const { return this->ShapeFunctionWeights; }
98 
100  const double *GetShapeFunctionWeights(int quadraturePointId) const
101  {
102  int idx=quadraturePointId*this->NumberOfNodes;
103  return this->ShapeFunctionWeights+idx;
104  }
106 
107  const double *GetQuadratureWeights() const { return this->QuadratureWeights; }
108 
109 protected:
112 private:
115  void ReleaseResources();
117  int SecureResources();
120  void SetShapeFunctionWeights(const double *W);
123  void SetQuadratureWeights(const double *W);
124 
125  //
127  void operator=(const vtkQuadratureSchemeDefinition &); // Not implemented.
128  friend ostream &operator<<(ostream &s, const vtkQuadratureSchemeDefinition &d);
129  friend istream &operator>>(istream &s, const vtkQuadratureSchemeDefinition &d);
130  //
131  int CellType;
132  int QuadratureKey;
133  int NumberOfNodes;
134  int NumberOfQuadraturePoints;
135  double *ShapeFunctionWeights;
136  double *QuadratureWeights;
137 };
138 
139 #endif
140