vtkHyperTreeGridRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkHyperTreeGridRepresentation_h
19 #define vtkHyperTreeGridRepresentation_h
20 
22 
23 #include "vtkNew.h" // for vtkNew
24 #include "vtkPVLODActor.h" // Upcast in vtkActor
25 #include "vtkProperty.h" // needed for VTK_POINTS etc.
26 #include "vtkRemotingViewsModule.h" // needed for exports
27 
28 #include <string> // needed for std::string
29 
30 class vtkOpenGLHyperTreeGridMapper;
33 class vtkScalarsToColors;
34 class vtkTexture;
35 
37 {
38 
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
51  vtkInformation* outInfo) override;
52 
57  void SetVisibility(bool val) override;
58 
60 
64  vtkGetMacro(AdaptiveDecimation, bool);
65  vtkSetMacro(AdaptiveDecimation, bool);
66  vtkBooleanMacro(AdaptiveDecimation, bool);
68 
70 
80  vtkSetMacro(Ambient, double);
81  vtkSetMacro(Diffuse, double);
82  vtkSetMacro(Specular, double);
83  vtkGetMacro(Ambient, double);
84  vtkGetMacro(Diffuse, double);
85  vtkGetMacro(Specular, double);
87 
89  {
90  WIREFRAME = 1,
92  SURFACE_WITH_EDGES
93  };
94 
96 
100  vtkSetClampMacro(Representation, int, WIREFRAME, SURFACE_WITH_EDGES);
101  vtkGetMacro(Representation, int);
103 
108  virtual void SetRepresentation(const char*);
109 
113  vtkDataObject* GetRenderedDataObject(int port) override;
114 
118  void SetUseOutline(int);
119 
120  //***************************************************************************
122 
125  virtual void SetAmbientColor(double r, double g, double b);
126  virtual void SetBaseIOR(double val);
127  virtual void SetBaseColorTexture(vtkTexture* tex);
128  virtual void SetCoatIOR(double val);
129  virtual void SetCoatStrength(double val);
130  virtual void SetCoatRoughness(double val);
131  virtual void SetCoatColor(double a, double b, double c);
132  virtual void SetCoatNormalScale(double val);
133  virtual void SetColor(double r, double g, double b);
134  virtual void SetDiffuseColor(double r, double g, double b);
135  virtual void SetEdgeColor(double r, double g, double b);
136  virtual void SetEdgeTint(double r, double g, double b);
137  virtual void SetEmissiveFactor(double rval, double gval, double bval);
138  virtual void SetEmissiveTexture(vtkTexture* tex);
139  virtual void SetInteractiveSelectionColor(double r, double g, double b);
140  virtual void SetInterpolation(int val);
141  virtual void SetLineWidth(double val);
142  virtual void SetMaterial(std::string name);
143  virtual void SetMaterialTexture(vtkTexture* tex);
144  virtual void SetMetallic(double val);
145  virtual void SetNormalScale(double val);
146  virtual void SetNormalTexture(vtkTexture* tex);
147  virtual void SetOcclusionStrength(double val);
148  virtual void SetOpacity(double val);
149  virtual void SetPointSize(double val);
150  virtual void SetRenderLinesAsTubes(bool);
151  virtual void SetRenderPointsAsSpheres(bool);
152  virtual void SetRoughness(double val);
153  virtual void SetSpecularColor(double r, double g, double b);
154  virtual void SetSpecularPower(double val);
156 
157  //***************************************************************************
159 
162  virtual void SetFlipTextures(bool);
163  virtual void SetOrientation(double, double, double);
164  virtual void SetOrigin(double, double, double);
165  virtual void SetPickable(int val);
166  virtual void SetPosition(double, double, double);
167  virtual void SetScale(double, double, double);
168  virtual void SetTexture(vtkTexture*);
169  virtual void SetUserTransform(const double[16]);
171 
172  //***************************************************************************
174 
177  virtual void SetEnableScaling(int val);
178  virtual void SetScalingArrayName(const char* val);
179  virtual void SetScalingFunction(vtkPiecewiseFunction* pwf);
180  virtual void SetMaterial(const char* val);
181  virtual void SetLuminosity(double val);
183 
184  //***************************************************************************
186 
189  virtual void SetRepeatTextures(bool);
190  vtkGetMacro(RepeatTextures, bool);
191  virtual void SetInterpolateTextures(bool);
192  vtkGetMacro(InterpolateTextures, bool);
193  virtual void SetUseMipmapTextures(bool);
194  vtkGetMacro(UseMipmapTextures, bool);
196 
197  //***************************************************************************
199 
202  virtual void SetInterpolateScalarsBeforeMapping(int val);
203  virtual void SetLookupTable(vtkScalarsToColors* val);
205 
213  virtual void SetMapScalars(bool val);
214 
221  virtual void SetStatic(int val);
222 
226  virtual void SetSelection(vtkSelection* selection);
227 
231  vtkActor* GetActor() { return this->GetRenderedProp(); }
232 
240  const char* GetColorArrayName();
241 
243 
246  virtual void SetUseShaderReplacements(bool);
247  vtkGetMacro(UseShaderReplacements, bool);
249 
256  virtual void SetShaderReplacements(const char*);
257 
258 protected:
260  ~vtkHyperTreeGridRepresentation() override;
261 
268  virtual void SetupDefaults();
269 
273  int FillInputPortInformation(int port, vtkInformation* info) override;
274 
286 
292  bool AddToView(vtkView* view) override;
293 
299  bool RemoveFromView(vtkView* view) override;
300 
304  virtual void UpdateColoringParameters();
305 
309  virtual vtkActor* GetRenderedProp() { return this->Actor; }
310 
314  void UpdateShaderReplacements();
315 
322  virtual bool NeedsOrderedCompositing();
323 
324  /*
325  * Fields
326  */
327 
328  // Specific to HTG mapper
330  bool AdaptiveDecimation = true;
331 
332  // Generic fields
335 
336  int Representation = SURFACE;
337 
338  bool RepeatTextures = false;
339  bool InterpolateTextures = false;
340  bool UseMipmapTextures = false;
341  double Ambient = 0.0;
342  double Specular = 0.0;
343  double Diffuse = 1.0;
344  double VisibleDataBounds[6];
345  bool UseShaderReplacements = false;
347 
348 private:
350  void operator=(const vtkHyperTreeGridRepresentation&) = delete;
351 };
352 
353 #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 as with optimized rendering for 2D datasets.
void PrintSelf(ostream &os, vtkIndent indent) override
port
virtual vtkActor * GetRenderedProp()
Used in ConvertSelection to locate the prop used for actual rendering.