]> SALOME platform Git repositories - modules/smesh.git/blob - src/OBJECT/SMESH_vtkPVUpdateSuppressor.h
Salome HOME
PR: SMDS refactoring in progress
[modules/smesh.git] / src / OBJECT / SMESH_vtkPVUpdateSuppressor.h
1 /*=========================================================================
2
3   Program:   ParaView
4   Module:    $RCSfile$
5
6   Copyright (c) Kitware, Inc.
7   All rights reserved.
8   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
15 // .NAME vtkPVUpdateSuppressor - prevents propagation of update
16 // .SECTION Description 
17 // vtkPVUpdateSuppressor now uses the vtkProcessModule singleton to set up the
18 // default values for UpdateNumberOfPieces and UpdatePiece, so we no longer have
19 // to set the default values (in most cases).
20 // .SECTION See Also
21 // vtkPVCacheKeeper vtkUpdateSuppressorPipeline
22
23 #ifndef __vtkPVUpdateSuppressor_h
24 #define __vtkPVUpdateSuppressor_h
25
26 #include "vtkDataObjectAlgorithm.h"
27
28 class VTK_EXPORT vtkPVUpdateSuppressor : public vtkDataObjectAlgorithm
29 {
30 public:
31   vtkTypeRevisionMacro(vtkPVUpdateSuppressor,vtkDataObjectAlgorithm);
32   void PrintSelf(ostream& os, vtkIndent indent);
33
34   // Description:
35   // Construct with user-specified implicit function.
36   static vtkPVUpdateSuppressor *New();
37
38   // Description:
39   // Force update on the input.
40   virtual void ForceUpdate();
41
42   // Description:
43   // Set number of pieces and piece on the data.
44   // This causes the filter to ingore the request from the output.
45   // It is here because the user may not have celled update on the output
46   // before calling force update (it is an easy fix).
47   vtkSetMacro(UpdatePiece, int);
48   vtkGetMacro(UpdatePiece, int);
49   vtkSetMacro(UpdateNumberOfPieces, int);
50   vtkGetMacro(UpdateNumberOfPieces, int);
51
52   // Description:
53   // Get/Set if the update suppressor is enabled. If the update suppressor 
54   // is not enabled, it won't supress any updates. Enabled by default.
55   void SetEnabled(int);
56   vtkGetMacro(Enabled, int);
57
58   // Description:
59   // Get/Set the update time that is sent up the pipeline.
60   void SetUpdateTime(double utime);
61   vtkGetMacro(UpdateTime, double);
62
63 protected:
64   vtkPVUpdateSuppressor();
65   ~vtkPVUpdateSuppressor();
66
67   int RequestDataObject(vtkInformation* request, vtkInformationVector **inputVector,
68     vtkInformationVector *outputVector);
69   int RequestData(vtkInformation* request, vtkInformationVector **inputVector,
70     vtkInformationVector *outputVector);
71
72   int UpdatePiece;
73   int UpdateNumberOfPieces;
74   double UpdateTime;
75
76   bool UpdateTimeInitialized;
77
78   int Enabled;
79
80   vtkTimeStamp PipelineUpdateTime;
81
82
83   // Create a default executive.
84   virtual vtkExecutive* CreateDefaultExecutive();
85
86 private:
87   vtkPVUpdateSuppressor(const vtkPVUpdateSuppressor&);  // Not implemented.
88   void operator=(const vtkPVUpdateSuppressor&);  // Not implemented.
89 };
90
91 #endif