ParaView
vtkGeometryRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkGeometryRepresentation.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 =========================================================================*/
28 #ifndef vtkGeometryRepresentation_h
29 #define vtkGeometryRepresentation_h
30 
31 #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports
33 #include "vtkProperty.h" // needed for VTK_POINTS etc.
34 
35 class vtkCompositeDataDisplayAttributes;
36 class vtkCompositePolyDataMapper2;
37 class vtkMapper;
38 class vtkPiecewiseFunction;
39 class vtkPVCacheKeeper;
41 class vtkPVLODActor;
42 class vtkQuadricClustering;
43 class vtkScalarsToColors;
44 class vtkTexture;
45 
46 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkGeometryRepresentation
48 {
49 public:
50  static vtkGeometryRepresentation* New();
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
60  virtual int ProcessViewRequest(
61  vtkInformationRequestKey* request_type, vtkInformation* inInfo, vtkInformation* outInfo);
62 
69  virtual void MarkModified();
70 
75  virtual void SetVisibility(bool val);
76 
78 
82  void SetBlockColorsDistinctValues(int distinctValues);
83  int GetBlockColorsDistinctValues();
85 
89  virtual void SetSuppressLOD(bool suppress) { this->SuppressLOD = suppress; }
90 
92 
99  vtkSetMacro(Ambient, double);
100  vtkSetMacro(Diffuse, double);
101  vtkSetMacro(Specular, double);
102  vtkGetMacro(Ambient, double);
103  vtkGetMacro(Diffuse, double);
104  vtkGetMacro(Specular, double);
106 
108  {
109  POINTS = VTK_POINTS,
110  WIREFRAME = VTK_WIREFRAME,
111  SURFACE = VTK_SURFACE,
112  SURFACE_WITH_EDGES = 3
113  };
114 
116 
120  vtkSetClampMacro(Representation, int, POINTS, SURFACE_WITH_EDGES);
121  vtkGetMacro(Representation, int);
123 
128  virtual void SetRepresentation(const char*);
129 
133  virtual vtkDataObject* GetRenderedDataObject(int port);
134 
139  static bool DoRequestGhostCells(vtkInformation* information);
140 
142 
147  vtkSetMacro(RequestGhostCellsIfNeeded, bool);
148  vtkGetMacro(RequestGhostCellsIfNeeded, bool);
149  vtkBooleanMacro(RequestGhostCellsIfNeeded, bool);
151 
152  //***************************************************************************
153  // Forwarded to vtkPVGeometryFilter
154  virtual void SetUseOutline(int);
155  void SetTriangulate(int);
156  void SetNonlinearSubdivisionLevel(int);
157 
158  //***************************************************************************
159  // Forwarded to vtkProperty.
160  virtual void SetAmbientColor(double r, double g, double b);
161  virtual void SetColor(double r, double g, double b);
162  virtual void SetDiffuseColor(double r, double g, double b);
163  virtual void SetEdgeColor(double r, double g, double b);
164  virtual void SetInterpolation(int val);
165  virtual void SetLineWidth(double val);
166  virtual void SetOpacity(double val);
167  virtual void SetPointSize(double val);
168  virtual void SetSpecularColor(double r, double g, double b);
169  virtual void SetSpecularPower(double val);
170 
171  //***************************************************************************
172  // Forwarded to Actor.
173  virtual void SetOrientation(double, double, double);
174  virtual void SetOrigin(double, double, double);
175  virtual void SetPickable(int val);
176  virtual void SetPosition(double, double, double);
177  virtual void SetScale(double, double, double);
178  virtual void SetTexture(vtkTexture*);
179  virtual void SetUserTransform(const double[16]);
180 
181  //***************************************************************************
182  // Forwarded to Mapper and LODMapper.
183  virtual void SetInterpolateScalarsBeforeMapping(int val);
184  virtual void SetLookupTable(vtkScalarsToColors* val);
186 
193  virtual void SetMapScalars(int val);
194  virtual void SetStatic(int val);
196 
200  vtkPVLODActor* GetActor() { return this->GetRenderedProp(); }
201 
203 
206  virtual void SetBlockVisibility(unsigned int index, bool visible);
207  virtual bool GetBlockVisibility(unsigned int index) const;
208  virtual void RemoveBlockVisibility(unsigned int index, bool = true);
209  virtual void RemoveBlockVisibilities();
211 
213 
216  virtual void SetBlockColor(unsigned int index, double r, double g, double b);
217  virtual void SetBlockColor(unsigned int index, double* color);
218  virtual double* GetBlockColor(unsigned int index);
219  virtual void RemoveBlockColor(unsigned int index);
220  virtual void RemoveBlockColors();
222 
224 
227  virtual void SetBlockOpacity(unsigned int index, double opacity);
228  virtual void SetBlockOpacity(unsigned int index, double* opacity);
229  virtual double GetBlockOpacity(unsigned int index);
230  virtual void RemoveBlockOpacity(unsigned int index);
231  virtual void RemoveBlockOpacities();
233 
237  const char* GetColorArrayName();
238 
246  static bool GetBounds(
247  vtkDataObject* dataObject, double bounds[6], vtkCompositeDataDisplayAttributes* cdAttributes);
248 
250 
254  virtual void SetEnableScaling(int v);
255  virtual void SetScalingArrayName(const char*);
256  virtual void SetScalingFunction(vtkPiecewiseFunction* pwf);
258 
260 
266  vtkSetMacro(UseDataPartitions, bool);
267  vtkGetMacro(UseDataPartitions, bool);
269 
270 protected:
273 
280  virtual void SetupDefaults();
281 
285  virtual int FillInputPortInformation(int port, vtkInformation* info);
286 
297  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
298 
302  virtual int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
303  vtkInformationVector* outputVector);
304 
308  VTK_LEGACY(virtual bool GenerateMetaData(vtkInformation*, vtkInformation*));
309 
315  virtual bool AddToView(vtkView* view);
316 
322  virtual bool RemoveFromView(vtkView* view);
323 
327  virtual void UpdateColoringParameters();
328 
332  virtual vtkPVLODActor* GetRenderedProp() { return this->Actor; }
333 
337  virtual bool IsCached(double cache_key);
338 
339  vtkAlgorithm* GeometryFilter;
340  vtkAlgorithm* MultiBlockMaker;
342  vtkQuadricClustering* Decimator;
344 
345  vtkMapper* Mapper;
346  vtkMapper* LODMapper;
348  vtkProperty* Property;
349 
350  double Ambient;
351  double Specular;
352  double Diffuse;
356  double DataBounds[6];
357 
358  vtkPiecewiseFunction* PWF;
359 
361 
362 private:
363  vtkGeometryRepresentation(const vtkGeometryRepresentation&) VTK_DELETE_FUNCTION;
364  void operator=(const vtkGeometryRepresentation&) VTK_DELETE_FUNCTION;
365 
367  char* DebugString;
368  vtkSetStringMacro(DebugString);
369 };
370 
371 #endif
virtual vtkDataObject * GetRenderedDataObject(int vtkNotUsed(port))
Returns the data object that is rendered from the given input port.
void PrintSelf(ostream &os, vtkIndent indent)
virtual vtkPVLODActor * GetRenderedProp()
Used in ConvertSelection to locate the prop used for actual rendering.
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...
vtkPVLODActor * GetActor()
Provides access to the actor used by this representation.
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Geometry filter that does outlines for volumes.
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
virtual bool AddToView(vtkView *view)
Making these methods public.
representation for showing any datasets as external shell of polygons.
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
vtkPVGeometryFilter * LODOutlineFilter
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
vtkSelectionRepresentation is a representation to show the extracted cells.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Overridden to invoke vtkCommand::UpdateDataEvent.
virtual void SetSuppressLOD(bool suppress)
Enable/Disable LOD;.