Graphics/vtkArrayCalculator.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Graphics/vtkArrayCalculator.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkArrayCalculator.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00049 #ifndef __vtkArrayCalculator_h
    00050 #define __vtkArrayCalculator_h
    00051
    00052 #include "vtkDataSetToDataSetFilter.h"
    00053
    00054 class vtkFunctionParser;
    00055
    00056 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
    00057 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
    00058 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
    00059
    00060 class VTK_GRAPHICS_EXPORT vtkArrayCalculator : public vtkDataSetToDataSetFilter
    00061 {
    00062 public:
    00063   vtkTypeRevisionMacro(vtkArrayCalculator,vtkDataSetToDataSetFilter);
    00064   void PrintSelf(ostream& os, vtkIndent indent);
    00065
    00066   static vtkArrayCalculator *New();
    00067
    00069
    00070   void SetFunction(const char* function);
    00071   vtkGetStringMacro(Function);
    00073
    00075
    00080   void AddScalarArrayName(const char* arrayName, int component = 0);
    00081   void AddVectorArrayName(const char* arrayName, int component0 = 0,
    00082                           int component1 = 1, int component2 = 2);
    00084
    00086
    00088   void AddScalarVariable(const char* variableName, const char* arrayName,
    00089                          int component = 0);
    00090   void AddVectorVariable(const char* variableName, const char* arrayName,
    00091                          int component0 = 0, int component1 = 1,
    00092                          int component2 = 2);
    00094
    00096
    00100   void SetResultArrayName(const char* name);
    00101   vtkGetStringMacro(ResultArrayName);
    00103
    00105
    00110   vtkSetMacro(AttributeMode,int);
    00111   vtkGetMacro(AttributeMode,int);
    00112   void SetAttributeModeToDefault()
    00113     {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
    00114   void SetAttributeModeToUsePointData()
    00115     {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
    00116   void SetAttributeModeToUseCellData()
    00117     {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
    00118   const char *GetAttributeModeAsString();
    00120
    00122   void RemoveAllVariables();
    00123
    00125
    00126   char** GetScalarArrayNames() { return this->ScalarArrayNames; }
    00127   char* GetScalarArrayName(int i);
    00128   char** GetVectorArrayNames() { return this->VectorArrayNames; }
    00129   char* GetVectorArrayName(int i);
    00130   char** GetScalarVariableNames() { return this->ScalarVariableNames; }
    00131   char* GetScalarVariableName(int i);
    00132   char** GetVectorVariableNames() { return this->VectorVariableNames; }
    00133   char* GetVectorVariableName(int i);
    00134   int* GetSelectedScalarComponents() { return this->SelectedScalarComponents; }
    00135   int GetSelectedScalarComponent(int i);
    00136   int** GetSelectedVectorComponents() { return this->SelectedVectorComponents;}
    00137   int* GetSelectedVectorComponents(int i);
    00138   vtkGetMacro(NumberOfScalarArrays, int);
    00139   vtkGetMacro(NumberOfVectorArrays, int);
    00141
    00142 protected:
    00143   vtkArrayCalculator();
    00144   ~vtkArrayCalculator();
    00145
    00146   void Execute();
    00147
    00148   char* Function;
    00149   char* ResultArrayName;
    00150   char** ScalarArrayNames;
    00151   char** VectorArrayNames;
    00152   char** ScalarVariableNames;
    00153   char** VectorVariableNames;
    00154   int NumberOfScalarArrays;
    00155   int NumberOfVectorArrays;
    00156   int AttributeMode;
    00157   int* SelectedScalarComponents;
    00158   int** SelectedVectorComponents;
    00159   vtkFunctionParser* FunctionParser;
    00160 private:
    00161   vtkArrayCalculator(const vtkArrayCalculator&);  // Not implemented.
    00162   void operator=(const vtkArrayCalculator&);  // Not implemented.
    00163 };
    00164
    00165 #endif