vtkHyperTreeGridRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkHyperTreeGridRepresentation_h
17 #define vtkHyperTreeGridRepresentation_h
18 
20 
21 #include "vtkNew.h" // for vtkNew
22 #include "vtkPVLODActor.h" // Upcast in vtkActor
23 #include "vtkProperty.h" // needed for VTK_POINTS etc.
24 #include "vtkRemotingViewsModule.h" // needed for exports
25 #include "vtkVector.h" // for vtkVector3d
26 
27 #include <string> // needed for std::string
28 #include <vector> // needed for std::vector
29 
30 class vtkDataObjectTree;
31 class vtkOpenGLHyperTreeGridMapper;
34 class vtkScalarsToColors;
35 class vtkTexture;
36 
37 class VTKREMOTINGVIEWS_EXPORT vtkHyperTreeGridRepresentation : public vtkPVDataRepresentation
38 {
39 
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
52  vtkInformation* outInfo) override;
53 
58  void SetVisibility(bool val) override;
59 
61 
65  vtkGetMacro(AdaptiveDecimation, bool);
66  vtkSetMacro(AdaptiveDecimation, bool);
67  vtkBooleanMacro(AdaptiveDecimation, bool);
69 
71 
81  vtkSetMacro(Ambient, double);
82  vtkSetMacro(Diffuse, double);
83  vtkSetMacro(Specular, double);
84  vtkGetMacro(Ambient, double);
85  vtkGetMacro(Diffuse, double);
86  vtkGetMacro(Specular, double);
88 
90  {
91  WIREFRAME = 1,
93  SURFACE_WITH_EDGES
94  };
95 
97 
101  vtkSetClampMacro(Representation, int, WIREFRAME, SURFACE_WITH_EDGES);
102  vtkGetMacro(Representation, int);
104 
109  virtual void SetRepresentation(const char*);
110 
114  vtkDataObject* GetRenderedDataObject(int port) override;
115 
119  void SetUseOutline(int);
120 
121  //***************************************************************************
123 
126  virtual void SetAmbientColor(double r, double g, double b);
127  virtual void SetBaseIOR(double val);
128  virtual void SetBaseColorTexture(vtkTexture* tex);
129  virtual void SetCoatIOR(double val);
130  virtual void SetCoatStrength(double val);
131  virtual void SetCoatRoughness(double val);
132  virtual void SetCoatColor(double a, double b, double c);
133  virtual void SetCoatNormalScale(double val);
134  virtual void SetColor(double r, double g, double b);
135  virtual void SetDiffuseColor(double r, double g, double b);
136  virtual void SetEdgeColor(double r, double g, double b);
137  virtual void SetEdgeTint(double r, double g, double b);
138  virtual void SetEmissiveFactor(double rval, double gval, double bval);
139  virtual void SetEmissiveTexture(vtkTexture* tex);
140  virtual void SetInteractiveSelectionColor(double r, double g, double b);
141  virtual void SetInterpolation(int val);
142  virtual void SetLineWidth(double val);
143  virtual void SetMaterial(std::string name);
144  virtual void SetMaterialTexture(vtkTexture* tex);
145  virtual void SetMetallic(double val);
146  virtual void SetNormalScale(double val);
147  virtual void SetNormalTexture(vtkTexture* tex);
148  virtual void SetOcclusionStrength(double val);
149  virtual void SetOpacity(double val);
150  virtual void SetPointSize(double val);
151  virtual void SetRenderLinesAsTubes(bool);
152  virtual void SetRenderPointsAsSpheres(bool);
153  virtual void SetRoughness(double val);
154  virtual void SetSpecularColor(double r, double g, double b);
155  virtual void SetSpecularPower(double val);
157 
158  //***************************************************************************
160 
163  virtual void SetFlipTextures(bool);
164  virtual void SetOrientation(double, double, double);
165  virtual void SetOrigin(double, double, double);
166  virtual void SetPickable(int val);
167  virtual void SetPosition(double, double, double);
168  virtual void SetScale(double, double, double);
169  virtual void SetTexture(vtkTexture*);
170  virtual void SetUserTransform(const double[16]);
172 
173  //***************************************************************************
175 
178  virtual void SetEnableScaling(int val);
179  virtual void SetScalingArrayName(const char* val);
180  virtual void SetScalingFunction(vtkPiecewiseFunction* pwf);
181  virtual void SetMaterial(const char* val);
182  virtual void SetLuminosity(double val);
184 
185  //***************************************************************************
187 
190  virtual void SetRepeatTextures(bool);
191  vtkGetMacro(RepeatTextures, bool);
192  virtual void SetInterpolateTextures(bool);
193  vtkGetMacro(InterpolateTextures, bool);
194  virtual void SetUseMipmapTextures(bool);
195  vtkGetMacro(UseMipmapTextures, bool);
197 
198  //***************************************************************************
200 
203  virtual void SetInterpolateScalarsBeforeMapping(int val);
204  virtual void SetLookupTable(vtkScalarsToColors* val);
206 
214  virtual void SetMapScalars(bool val);
215 
222  virtual void SetStatic(int val);
223 
227  virtual void SetSelection(vtkSelection* selection);
228 
232  vtkActor* GetActor() { return this->GetRenderedProp(); }
233 
241  const char* GetColorArrayName();
242 
244 
247  virtual void SetUseShaderReplacements(bool);
248  vtkGetMacro(UseShaderReplacements, bool);
250 
252 
255  void AddBlockSelector(const char* selector);
256  void RemoveAllBlockSelectors();
257  void SetBlockColor(const char* selector, double r, double g, double b);
258  void RemoveAllBlockColors();
259  void SetBlockOpacity(const char* selector, double opacity);
260  void RemoveAllBlockOpacities();
262 
269  virtual void SetShaderReplacements(const char*);
270 
271 protected:
273  ~vtkHyperTreeGridRepresentation() override;
274 
281  virtual void SetupDefaults();
282 
286  int FillInputPortInformation(int port, vtkInformation* info) override;
287 
299 
305  bool AddToView(vtkView* view) override;
306 
312  bool RemoveFromView(vtkView* view) override;
313 
317  void UpdateBlockVisibility(vtkDataObjectTree* dtree);
318 
322  virtual void UpdateColoringParameters();
323 
327  virtual vtkActor* GetRenderedProp() { return this->Actor; }
328 
332  void UpdateShaderReplacements();
333 
340  virtual bool NeedsOrderedCompositing();
341 
342  /*
343  * Fields
344  */
345 
346  // Specific to HTG mapper
348  bool AdaptiveDecimation = true;
349 
350  // Generic fields
353 
354  int Representation = SURFACE;
355  bool RepeatTextures = false;
356  bool InterpolateTextures = false;
357  bool UseMipmapTextures = false;
358  double Ambient = 0.0;
359  double Specular = 0.0;
360  double Diffuse = 1.0;
361  double VisibleDataBounds[6];
362  bool UseShaderReplacements = false;
364 
365 private:
366  std::vector<std::string> BlockSelectors;
367  std::vector<std::pair<std::string, vtkVector3d>> BlockColors;
368  std::vector<std::pair<std::string, double>> BlockOpacities;
369 
371  void operator=(const vtkHyperTreeGridRepresentation&) = delete;
372 };
373 
374 #endif
virtual vtkDataObject * GetRenderedDataObject(int vtkNotUsed(port))
Returns the data object that is rendered from the given input port.
vtkPVDataRepresentation adds some ParaView specific API to data representations.
bool AddToView(vtkView *view) override
Making these methods public.
info
Geometry filter that does outlines for volumes.
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
virtual int FillInputPortInformation(int port, vtkInformation *info)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
vtkNew< vtkOpenGLHyperTreeGridMapper > Mapper
bool RemoveFromView(vtkView *view) override
Making these methods public.
static vtkDataRepresentation * New()
vtkActor * GetActor()
Provides access to the actor used by this representation.
representation for showing vtkHyperTreeGrid with optimized memory usage.
void PrintSelf(ostream &os, vtkIndent indent) override
port
virtual vtkActor * GetRenderedProp()
Used in ConvertSelection to locate the prop used for actual rendering.