ParaView
vtkImageSliceRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkImageSliceRepresentation.h
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 =========================================================================*/
25 #ifndef vtkImageSliceRepresentation_h
26 #define vtkImageSliceRepresentation_h
27 
28 #include "vtkNew.h" // for vtkNew.
29 #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports
31 #include "vtkStructuredData.h" // for VTK_*_PLANE
32 
33 class vtkImageData;
35 class vtkPVCacheKeeper;
37 class vtkPVLODActor;
38 class vtkScalarsToColors;
39 
40 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkImageSliceRepresentation
42 {
43 public:
44  static vtkImageSliceRepresentation* New();
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
49 
53  virtual void SetInputArrayToProcess(
54  int idx, int port, int connection, int fieldAssociation, const char* name);
55  virtual void SetInputArrayToProcess(
56  int idx, int port, int connection, int fieldAssociation, int fieldAttributeType)
57  {
58  this->Superclass::SetInputArrayToProcess(
59  idx, port, connection, fieldAssociation, fieldAttributeType);
60  }
61  virtual void SetInputArrayToProcess(int idx, vtkInformation* info)
62  {
63  this->Superclass::SetInputArrayToProcess(idx, info);
64  }
65  virtual void SetInputArrayToProcess(int idx, int port, int connection,
66  const char* fieldAssociation, const char* attributeTypeorName)
67  {
68  this->Superclass::SetInputArrayToProcess(
69  idx, port, connection, fieldAssociation, attributeTypeorName);
70  }
72 
79  virtual int ProcessViewRequest(
80  vtkInformationRequestKey* request_type, vtkInformation* inInfo, vtkInformation* outInfo);
81 
88  virtual void MarkModified();
89 
95  virtual void SetVisibility(bool val);
96 
98 
101  virtual void SetSlice(unsigned int);
102  vtkGetMacro(Slice, unsigned int);
104 
105  enum
106  {
107  XY_PLANE = VTK_XY_PLANE,
108  YZ_PLANE = VTK_YZ_PLANE,
109  XZ_PLANE = VTK_XZ_PLANE
110  };
111 
113 
116  virtual void SetSliceMode(int);
117  vtkGetMacro(SliceMode, int);
119 
120  //---------------------------------------------------------------------------
121  // Forwarded to Actor.
122  void SetOrientation(double, double, double);
123  void SetOrigin(double, double, double);
124  void SetPickable(int val);
125  void SetPosition(double, double, double);
126  void SetScale(double, double, double);
127 
128  //---------------------------------------------------------------------------
129  // Forwarded to vtkProperty.
130  void SetOpacity(double val);
131 
132  //---------------------------------------------------------------------------
133  // Forwarded to vtkPVImageSliceMapper.
134  void SetLookupTable(vtkScalarsToColors* val);
135  void SetMapScalars(int val);
136  void SetUseXYPlane(int val);
137 
141  vtkPVLODActor* GetActor() { return this->Actor; }
142 
144 
147  void SetAmbient(double ambient);
148  void SetDiffuse(double diffuse);
149  void SetSpecular(double specular);
150  void SetSpecularPower(double val);
151  void SetSpecularColor(double r, double g, double b);
153 
154 protected:
157 
161  void UpdateSliceData(vtkInformationVector**);
162 
166  virtual int FillInputPortInformation(int port, vtkInformation* info);
167 
178  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
179 
185  virtual bool AddToView(vtkView* view);
186 
192  virtual bool RemoveFromView(vtkView* view);
193 
197  virtual bool IsCached(double cache_key);
198 
200  unsigned int Slice;
201 
205  vtkImageData* SliceData;
206 
207  // meta-data about the input image to pass on to render view for hints
208  // when redistributing data.
209  vtkNew<vtkPExtentTranslator> PExtentTranslator;
210  int WholeExtent[6];
211 
212 private:
213  vtkImageSliceRepresentation(const vtkImageSliceRepresentation&) VTK_DELETE_FUNCTION;
214  void operator=(const vtkImageSliceRepresentation&) VTK_DELETE_FUNCTION;
215 };
216 
217 #endif
void PrintSelf(ostream &os, vtkIndent indent)
virtual void SetInputArrayToProcess(int idx, int port, int connection, const char *fieldAssociation, const char *attributeTypeorName)
Set the input data arrays that this algorithm will process.
vtkPVDataRepresentation adds some ParaView specific API to data representations.
virtual bool IsCached(double cache_key)
Subclasses should override this method when they support caching to indicate if the particular key is...
virtual void SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, int fieldAttributeType)
Set the input data arrays that this algorithm will process.
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
virtual bool AddToView(vtkView *view)
Making these methods public.
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
Mapper for vtkImageData that renders the image using a texture applied to a quad. ...
extent translator that collects information about extents from multiple processes in parallel...
representation for showing slices from a vtkImageData.
virtual void MarkModified()
This is one of the most important functions.
virtual bool RemoveFromView(vtkView *view)
Making these methods public.
manages data cache for flip book animations.
an actor that supports multiple levels of detail
Definition: vtkPVLODActor.h:37
virtual void SetInputArrayToProcess(int idx, vtkInformation *info)
Set the input data arrays that this algorithm will process.
vtkPVLODActor * GetActor()
Provides access to the actor used by this representation.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Overridden to invoke vtkCommand::UpdateDataEvent.
vtkNew< vtkPExtentTranslator > PExtentTranslator