VTK
dox/Common/DataModel/vtkImplicitSum.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImplicitSum.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 =========================================================================*/
00031 #ifndef __vtkImplicitSum_h
00032 #define __vtkImplicitSum_h
00033 
00034 #include "vtkCommonDataModelModule.h" // For export macro
00035 #include "vtkImplicitFunction.h"
00036 
00037 class vtkDoubleArray;
00038 class vtkImplicitFunctionCollection;
00039 
00040 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitSum : public vtkImplicitFunction
00041 {
00042 public:
00043   static vtkImplicitSum *New();
00044 
00045   vtkTypeMacro(vtkImplicitSum,vtkImplicitFunction);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00050   double EvaluateFunction(double x[3]);
00051   double EvaluateFunction(double x, double y, double z)
00052     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
00054 
00057   void EvaluateGradient(double x[3], double g[3]);
00058 
00060   unsigned long GetMTime();
00061 
00064   void AddFunction(vtkImplicitFunction *in, double weight);
00065 
00068   void AddFunction(vtkImplicitFunction *in) { this->AddFunction(in, 1.0); }
00069 
00071   void RemoveAllFunctions();
00072 
00074   void SetFunctionWeight(vtkImplicitFunction *f, double weight);
00075 
00077 
00082   vtkSetMacro(NormalizeByWeight, int);
00083   vtkGetMacro(NormalizeByWeight, int);
00084   vtkBooleanMacro(NormalizeByWeight, int);
00086 
00087 protected:
00088   vtkImplicitSum();
00089   ~vtkImplicitSum();
00090 
00091   vtkImplicitFunctionCollection *FunctionList;
00092   vtkDoubleArray *Weights;
00093   double TotalWeight;
00094 
00095   void CalculateTotalWeight(void);
00096   int NormalizeByWeight;
00097 
00098 private:
00099   vtkImplicitSum(const vtkImplicitSum&);  // Not implemented.
00100   void operator=(const vtkImplicitSum&);  // Not implemented.
00101 };
00102 
00103 #endif