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 
26 #include <string> // needed for std::string
27 
28 class vtkDataObjectTree;
29 class vtkOpenGLHyperTreeGridMapper;
32 class vtkScalarsToColors;
33 class vtkTexture;
34 
36 {
37 
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
50  vtkInformation* outInfo) override;
51 
56  void SetVisibility(bool val) override;
57 
59 
63  vtkGetMacro(AdaptiveDecimation, bool);
64  vtkSetMacro(AdaptiveDecimation, bool);
65  vtkBooleanMacro(AdaptiveDecimation, bool);
67 
69 
79  vtkSetMacro(Ambient, double);
80  vtkSetMacro(Diffuse, double);
81  vtkSetMacro(Specular, double);
82  vtkGetMacro(Ambient, double);
83  vtkGetMacro(Diffuse, double);
84  vtkGetMacro(Specular, double);
86 
88  {
89  WIREFRAME = 1,
91  SURFACE_WITH_EDGES
92  };
93 
95 
99  vtkSetClampMacro(Representation, int, WIREFRAME, SURFACE_WITH_EDGES);
100  vtkGetMacro(Representation, int);
102 
107  virtual void SetRepresentation(const char*);
108 
112  vtkDataObject* GetRenderedDataObject(int port) override;
113 
117  void SetUseOutline(int);
118 
119  //***************************************************************************
121 
124  virtual void SetAmbientColor(double r, double g, double b);
125  virtual void SetBaseIOR(double val);
126  virtual void SetBaseColorTexture(vtkTexture* tex);
127  virtual void SetCoatIOR(double val);
128  virtual void SetCoatStrength(double val);
129  virtual void SetCoatRoughness(double val);
130  virtual void SetCoatColor(double a, double b, double c);
131  virtual void SetCoatNormalScale(double val);
132  virtual void SetColor(double r, double g, double b);
133  virtual void SetDiffuseColor(double r, double g, double b);
134  virtual void SetEdgeColor(double r, double g, double b);
135  virtual void SetEdgeTint(double r, double g, double b);
136  virtual void SetEmissiveFactor(double rval, double gval, double bval);
137  virtual void SetEmissiveTexture(vtkTexture* tex);
138  virtual void SetInteractiveSelectionColor(double r, double g, double b);
139  virtual void SetInterpolation(int val);
140  virtual void SetLineWidth(double val);
141  virtual void SetMaterial(std::string name);
142  virtual void SetMaterialTexture(vtkTexture* tex);
143  virtual void SetMetallic(double val);
144  virtual void SetNormalScale(double val);
145  virtual void SetNormalTexture(vtkTexture* tex);
146  virtual void SetOcclusionStrength(double val);
147  virtual void SetOpacity(double val);
148  virtual void SetPointSize(double val);
149  virtual void SetRenderLinesAsTubes(bool);
150  virtual void SetRenderPointsAsSpheres(bool);
151  virtual void SetRoughness(double val);
152  virtual void SetSpecularColor(double r, double g, double b);
153  virtual void SetSpecularPower(double val);
155 
156  //***************************************************************************
158 
161  virtual void SetFlipTextures(bool);
162  virtual void SetOrientation(double, double, double);
163  virtual void SetOrigin(double, double, double);
164  virtual void SetPickable(int val);
165  virtual void SetPosition(double, double, double);
166  virtual void SetScale(double, double, double);
167  virtual void SetTexture(vtkTexture*);
168  virtual void SetUserTransform(const double[16]);
170 
171  //***************************************************************************
173 
176  virtual void SetEnableScaling(int val);
177  virtual void SetScalingArrayName(const char* val);
178  virtual void SetScalingFunction(vtkPiecewiseFunction* pwf);
179  virtual void SetMaterial(const char* val);
180  virtual void SetLuminosity(double val);
182 
183  //***************************************************************************
185 
188  virtual void SetRepeatTextures(bool);
189  vtkGetMacro(RepeatTextures, bool);
190  virtual void SetInterpolateTextures(bool);
191  vtkGetMacro(InterpolateTextures, bool);
192  virtual void SetUseMipmapTextures(bool);
193  vtkGetMacro(UseMipmapTextures, bool);
195 
196  //***************************************************************************
198 
201  virtual void SetInterpolateScalarsBeforeMapping(int val);
202  virtual void SetLookupTable(vtkScalarsToColors* val);
204 
212  virtual void SetMapScalars(bool val);
213 
220  virtual void SetStatic(int val);
221 
225  virtual void SetSelection(vtkSelection* selection);
226 
230  vtkActor* GetActor() { return this->GetRenderedProp(); }
231 
239  const char* GetColorArrayName();
240 
242 
245  virtual void SetUseShaderReplacements(bool);
246  vtkGetMacro(UseShaderReplacements, bool);
248 
250 
253  void AddBlockSelector(const char* selector);
254  void RemoveAllBlockSelectors();
256 
263  virtual void SetShaderReplacements(const char*);
264 
265 protected:
267  ~vtkHyperTreeGridRepresentation() override;
268 
275  virtual void SetupDefaults();
276 
280  int FillInputPortInformation(int port, vtkInformation* info) override;
281 
293 
299  bool AddToView(vtkView* view) override;
300 
306  bool RemoveFromView(vtkView* view) override;
307 
311  void UpdateBlockVisibility(vtkDataObjectTree* dtree);
312 
316  virtual void UpdateColoringParameters();
317 
321  virtual vtkActor* GetRenderedProp() { return this->Actor; }
322 
326  void UpdateShaderReplacements();
327 
334  virtual bool NeedsOrderedCompositing();
335 
336  /*
337  * Fields
338  */
339 
340  // Specific to HTG mapper
342  bool AdaptiveDecimation = true;
343 
344  // Generic fields
347 
348  int Representation = SURFACE;
349 
350  bool RepeatTextures = false;
351  bool InterpolateTextures = false;
352  bool UseMipmapTextures = false;
353  double Ambient = 0.0;
354  double Specular = 0.0;
355  double Diffuse = 1.0;
356  double VisibleDataBounds[6];
357  bool UseShaderReplacements = false;
359  std::vector<std::string> BlockSelectors;
360 
361 private:
363  void operator=(const vtkHyperTreeGridRepresentation&) = delete;
364 };
365 
366 #endif
virtual vtkDataObject * GetRenderedDataObject(int vtkNotUsed(port))
Returns the data object that is rendered from the given input port.
#define VTKREMOTINGVIEWS_EXPORT
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.