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

Servers/Filters/vtkPVCompositeUtilities.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkPVCompositeUtilities.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
00026 #ifndef __vtkPVCompositeUtilities_h
00027 #define __vtkPVCompositeUtilities_h
00028 
00029 #include "vtkObject.h"
00030 
00031 class vtkCollection;
00032 class vtkDataArray;
00033 class vtkUnsignedCharArray;
00034 class vtkFloatArray;
00035 class vtkPVCompositeBuffer;
00036 class vtkMultiProcessController;
00037 
00038 class VTK_EXPORT vtkPVCompositeUtilities : public vtkObject
00039 {
00040 public:
00041   static vtkPVCompositeUtilities *New();
00042   vtkTypeRevisionMacro(vtkPVCompositeUtilities,vtkObject);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00046 
00048   vtkFloatArray *NewFloatArray(int numTuples, int numComponents);
00049   vtkUnsignedCharArray *NewUnsignedCharArray(int numTuples, 
00050                                              int numComponents);
00052 
00054   vtkPVCompositeBuffer* NewCompositeBuffer(int numPixels);
00055 
00057 
00058   vtkPVCompositeBuffer* NewCompositeBuffer(
00059                                      vtkUnsignedCharArray* pData,
00060                                      vtkFloatArray* zData);
00062 
00064 
00065   static void SendBuffer(vtkMultiProcessController* controller,
00066                     vtkPVCompositeBuffer* buf, int otherProc, int tag); 
00068 
00070 
00072   vtkPVCompositeBuffer* ReceiveNewBuffer(vtkMultiProcessController* controller,
00073                                          int otherProc, int tag);
00075 
00077 
00079   static void Compress(vtkFloatArray *zIn, vtkUnsignedCharArray *pIn,
00080                        vtkPVCompositeBuffer* outBuf);
00082 
00085   static int GetCompressedLength(vtkFloatArray* zIn);
00086 
00087   static void Uncompress(vtkPVCompositeBuffer* inBuf,
00088                          vtkUnsignedCharArray *pOut);
00089 
00091 
00093   static int GetCompositedLength(vtkPVCompositeBuffer* b1,
00094                                  vtkPVCompositeBuffer* b2);
00096 
00097   static void CompositeImagePair(vtkPVCompositeBuffer* inBuf1,
00098                                  vtkPVCompositeBuffer* inBuf2,
00099                                  vtkPVCompositeBuffer* outBuf);
00100 
00101   static void MagnifyBuffer(vtkDataArray* in, vtkDataArray* out, 
00102                             int inWinSize[2], int factor);
00103 
00105 
00107   vtkSetMacro(MaximumMemoryUsage, unsigned long);
00108   vtkGetMacro(MaximumMemoryUsage, unsigned long);
00110 
00112   unsigned long GetTotalMemoryUsage();
00113 
00114 protected:
00115   vtkPVCompositeUtilities();
00116   ~vtkPVCompositeUtilities();
00117   
00118   vtkCollection* FloatArrayCollection;
00119   vtkCollection* UnsignedCharArrayCollection;
00120 
00121   unsigned long MaximumMemoryUsage;
00122   unsigned long FloatMemoryUsage;
00123   unsigned long UnsignedCharMemoryUsage;
00124 
00125   // Returns memory freed up in kB.
00126   int RemoveOldestUnused(vtkCollection* arrayCollection);
00127 
00128 private:
00129   vtkPVCompositeUtilities(const vtkPVCompositeUtilities&); // Not implemented
00130   void operator=(const vtkPVCompositeUtilities&); // Not implemented
00131 };
00132 
00133 #endif

Generated on Tue May 30 12:31:46 2006 for ParaView by doxygen 1.3.5