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 
32 #include "vtkProperty.h" // needed for VTK_POINTS etc.
33 #include "vtkRemotingViewsModule.h" // needed for exports
34 #include "vtkVector.h" // for vtkVector.
35 
36 #include <set> // needed for std::set
37 #include <string> // needed for std::string
38 #include <unordered_map> // needed for std::unordered_map
39 
42 class vtkMapper;
45 class vtkPVLODActor;
46 class vtkScalarsToColors;
47 class vtkTexture;
48 
50 {
51 // This is defined to either vtkQuadricClustering or vtkmLevelOfDetail in the
52 // implementation file:
54 }
55 
57 {
58 
59 public:
60  static vtkGeometryRepresentation* New();
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
70  int ProcessViewRequest(vtkInformationRequestKey* request_type, vtkInformation* inInfo,
71  vtkInformation* outInfo) override;
72 
77  void SetVisibility(bool val) override;
78 
80 
84  void SetBlockColorsDistinctValues(int distinctValues);
85  int GetBlockColorsDistinctValues();
87 
91  virtual void SetSuppressLOD(bool suppress) { this->SuppressLOD = suppress; }
92 
94 
101  vtkSetMacro(Ambient, double);
102  vtkSetMacro(Diffuse, double);
103  vtkSetMacro(Specular, double);
104  vtkGetMacro(Ambient, double);
105  vtkGetMacro(Diffuse, double);
106  vtkGetMacro(Specular, double);
108 
110  {
111  POINTS = VTK_POINTS,
112  WIREFRAME = VTK_WIREFRAME,
113  SURFACE = VTK_SURFACE,
114  SURFACE_WITH_EDGES = 3
115  };
116 
118 
122  void SetCoordinateShiftScaleMethod(int val);
123  int GetCoordinateShiftScaleMethod();
125 
127 
131  vtkSetClampMacro(Representation, int, POINTS, SURFACE_WITH_EDGES);
132  vtkGetMacro(Representation, int);
134 
139  virtual void SetRepresentation(const char*);
140 
144  vtkDataObject* GetRenderedDataObject(int port) override;
145 
147 
152  vtkSetMacro(RequestGhostCellsIfNeeded, bool);
153  vtkGetMacro(RequestGhostCellsIfNeeded, bool);
154  vtkBooleanMacro(RequestGhostCellsIfNeeded, bool);
156 
161  virtual void SetNormalArray(const char* val);
162 
167  virtual void SetTCoordArray(const char* val);
168 
173  virtual void SetTangentArray(const char* val);
174 
175  //***************************************************************************
176  // Forwarded to vtkPVGeometryFilter
177  virtual void SetUseOutline(int);
178  void SetTriangulate(int);
179  void SetNonlinearSubdivisionLevel(int);
180  virtual void SetGenerateFeatureEdges(bool);
181 
182  //***************************************************************************
183  // Forwarded to vtkProperty.
184  virtual void SetAmbientColor(double r, double g, double b);
185  virtual void SetColor(double r, double g, double b);
186  virtual void SetDiffuseColor(double r, double g, double b);
187  virtual void SetEdgeColor(double r, double g, double b);
188  virtual void SetInteractiveSelectionColor(double r, double g, double b);
189  virtual void SetInterpolation(int val);
190  virtual void SetLineWidth(double val);
191  virtual void SetOpacity(double val);
192  virtual void SetPointSize(double val);
193  virtual void SetSpecularColor(double r, double g, double b);
194  virtual void SetSpecularPower(double val);
195  virtual void SetLuminosity(double val);
196  virtual void SetRenderPointsAsSpheres(bool);
197  virtual void SetRenderLinesAsTubes(bool);
198  virtual void SetRoughness(double val);
199  virtual void SetMetallic(double val);
200  virtual void SetEdgeTint(double r, double g, double b);
201  virtual void SetAnisotropy(double val);
202  virtual void SetAnisotropyRotation(double val);
203  virtual void SetBaseIOR(double val);
204  virtual void SetCoatIOR(double val);
205  virtual void SetCoatStrength(double val);
206  virtual void SetCoatRoughness(double val);
207  virtual void SetCoatNormalScale(double val);
208  virtual void SetCoatColor(double r, double g, double b);
209  virtual void SetBaseColorTexture(vtkTexture* tex);
210  virtual void SetMaterialTexture(vtkTexture* tex);
211  virtual void SetAnisotropyTexture(vtkTexture* tex);
212  virtual void SetNormalTexture(vtkTexture* tex);
213  virtual void SetCoatNormalTexture(vtkTexture* tex);
214  virtual void SetEmissiveTexture(vtkTexture* tex);
215  virtual void SetNormalScale(double val);
216  virtual void SetOcclusionStrength(double val);
217  virtual void SetEmissiveFactor(double rval, double gval, double bval);
218  virtual void SetShowTexturesOnBackface(bool);
219 
220  //***************************************************************************
221  // Forwarded to Actor.
222  virtual void SetOrientation(double, double, double);
223  virtual void SetOrigin(double, double, double);
224  virtual void SetPickable(int val);
225  virtual void SetPosition(double, double, double);
226  virtual void SetScale(double, double, double);
227  virtual void SetTexture(vtkTexture*);
228  virtual void SetUserTransform(const double[16]);
229  virtual void SetFlipTextures(bool);
230 
231  //***************************************************************************
232  // Forwarded to all textures
233  virtual void SetRepeatTextures(bool);
234  vtkGetMacro(RepeatTextures, bool);
235  virtual void SetInterpolateTextures(bool);
236  vtkGetMacro(InterpolateTextures, bool);
237  virtual void SetUseMipmapTextures(bool);
238  vtkGetMacro(UseMipmapTextures, bool);
239 
240  //***************************************************************************
241  // Forwarded to Mapper and LODMapper.
242  virtual void SetInterpolateScalarsBeforeMapping(int val);
243  virtual void SetLookupTable(vtkScalarsToColors* val);
244  virtual void SetSeamlessU(bool);
245  virtual void SetSeamlessV(bool);
247 
254  virtual void SetMapScalars(int val);
255  virtual void SetStatic(int val);
257 
261  virtual void SetSelection(vtkSelection* selection);
262 
266  vtkPVLODActor* GetActor() { return this->GetRenderedProp(); }
267 
269 
278  void SetActiveAssembly(const char*){};
280 
282 
285  void AddBlockSelector(const char*);
286  void RemoveAllBlockSelectors();
288 
290 
293  void SetBlockColor(const char*, double, double, double);
294  void RemoveAllBlockColors();
296 
298 
301  void SetBlockOpacity(const char*, double);
302  void RemoveAllBlockOpacities();
304 
308  const char* GetColorArrayName();
309 
317  static bool GetBounds(
318  vtkDataObject* dataObject, double bounds[6], vtkCompositeDataDisplayAttributes* cdAttributes);
319 
321 
325  virtual void SetEnableScaling(int v);
326  virtual void SetScalingArrayName(const char*);
327  virtual void SetScalingFunction(vtkPiecewiseFunction* pwf);
329 
333  virtual void SetMaterial(const char*);
334 
336 
342  vtkSetMacro(UseDataPartitions, bool);
343  vtkGetMacro(UseDataPartitions, bool);
345 
347 
350  virtual void SetUseShaderReplacements(bool);
351  vtkGetMacro(UseShaderReplacements, bool);
353 
359  virtual void SetShaderReplacements(const char*);
360 
365  void SetArrayIdNames(const char* pointArray, const char* cellArray) override;
366 
367 protected:
369  ~vtkGeometryRepresentation() override;
370 
377  virtual void SetupDefaults();
378 
382  int FillInputPortInformation(int port, vtkInformation* info) override;
383 
394  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
395 
399  int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
400  vtkInformationVector* outputVector) override;
401 
407  bool AddToView(vtkView* view) override;
408 
414  bool RemoveFromView(vtkView* view) override;
415 
419  virtual void UpdateColoringParameters();
420 
424  virtual vtkPVLODActor* GetRenderedProp() { return this->Actor; }
425 
426  // Progress Callback
427  void HandleGeometryRepresentationProgress(vtkObject* caller, unsigned long, void*);
428 
436  void PopulateBlockAttributes(vtkCompositeDataDisplayAttributes* attrs, vtkDataObject* data) const;
437 
442  void ComputeVisibleDataBounds();
443 
447  void UpdateShaderReplacements();
448 
455  virtual bool NeedsOrderedCompositing();
456 
460  virtual void SetPointArrayToProcess(int p, const char* val);
461 
466 
471 
475  double Ambient;
476  double Specular;
477  double Diffuse;
481  double VisibleDataBounds[6];
482 
484 
486 
488 
491 
492  bool BlockAttrChanged = false;
494  bool UpdateBlockAttrLOD = false;
495 
496  std::set<std::string> BlockSelectors;
497  std::unordered_map<std::string, double> BlockOpacities;
498  std::unordered_map<std::string, vtkVector3d> BlockColors;
499 
500 private:
502  void operator=(const vtkGeometryRepresentation&) = delete;
503 };
504 
505 #endif
vtkGeometryRepresentation_detail::DecimationFilterType * Decimator
data
std::unordered_map< std::string, vtkVector3d > BlockColors
void SetActiveAssembly(const char *)
Get/Set the name of the assembly to use for mapping block visibilities, colors and opacities...
virtual vtkPVLODActor * GetRenderedProp()
Used in ConvertSelection to locate the prop used for actual rendering.
#define VTKREMOTINGVIEWS_EXPORT
vtkPVDataRepresentation adds some ParaView specific API to data representations.
#define VTK_SURFACE
std::unordered_map< std::string, double > BlockOpacities
vtkPVLODActor * GetActor()
Provides access to the actor used by this representation.
info
Geometry filter that does outlines for volumes.
representation for showing any datasets as external shell of polygons.
vtkPVGeometryFilter * LODOutlineFilter
std::set< std::string > BlockSelectors
#define VTK_POINTS
an actor that supports multiple levels of detail
Definition: vtkPVLODActor.h:37
port
#define VTK_WIREFRAME
virtual void SetSuppressLOD(bool suppress)
Enable/Disable LOD;.