vtkPointGaussianRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkPointGaussianRepresentation_h
11 #define vtkPointGaussianRepresentation_h
12 
14 #include "vtkRemotingViewsModule.h" // needed for exports
15 #include "vtkSmartPointer.h" // needed for smart pointer
16 #include <string> // for std::string
17 #include <vector> // for std::vector
18 
19 class vtkActor;
20 class vtkDataObject;
23 class vtkScalarsToColors;
24 
26 {
27 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
33  vtkInformation* outInfo) override;
34 
38  void SetLookupTable(vtkScalarsToColors* lut);
39 
43  void SetVisibility(bool val) override;
44 
48  virtual void SetEmissive(bool val);
49 
54  virtual void SetMapScalars(int val);
55 
56  //***************************************************************************
57  // Forwarded to Actor.
58  virtual void SetOrientation(double, double, double);
59  virtual void SetOrigin(double, double, double);
60  virtual void SetPickable(int val);
61  virtual void SetPosition(double, double, double);
62  virtual void SetScale(double, double, double);
63 
64  //***************************************************************************
65  // Forwarded to Actor->GetProperty()
66  virtual void SetAmbientColor(double r, double g, double b);
67  virtual void SetDiffuseColor(double r, double g, double b);
68  virtual void SetEdgeColor(double r, double g, double b);
69  virtual void SetInterpolation(int val);
70  virtual void SetLineWidth(double val);
71  virtual void SetOpacity(double val);
72  virtual void SetPointSize(double val);
73  virtual void SetSpecularColor(double r, double g, double b);
74  virtual void SetSpecularPower(double val);
75 
80  virtual void SetSplatSize(double radius);
81 
86  {
87  GAUSSIAN_BLUR, // This is the default
88  SPHERE, // Points shaded to look (something) like a sphere lit from the view direction
89  BLACK_EDGED_CIRCLE, // Camera facing, flat circle, rimmed in black
90  PLAIN_CIRCLE, // Same as above, but without the black edge
91  TRIANGLE, // Camera facing, flat triangle
92  SQUARE_OUTLINE, // Camera facing, flat square, with empty center
93  CUSTOM, // Custom shader
94  NUMBER_OF_PRESETS // !!! THIS MUST ALWAYS BE THE LAST PRESET ENUM !!!
95  };
96 
100  void SelectShaderPreset(int preset);
101 
105  void SetCustomShader(const char* shaderString);
106 
110  void SetCustomTriangleScale(double scale);
111 
117  void SelectScaleArray(int, int, int, int, const char* name);
118 
122  void SelectScaleArrayComponent(int component);
123 
127  void SetUseScaleFunction(bool enable);
128 
135  void SetScaleTransferFunction(vtkPiecewiseFunction* pwf);
136 
141  void SetOpacityTransferFunction(vtkPiecewiseFunction* pwf);
142 
149  void SelectOpacityArray(int, int, int, int, const char* name);
150 
154  void SelectOpacityArrayComponent(int component);
155 
157 
162  void SetOpacityByArray(bool newVal);
163  vtkGetMacro(OpacityByArray, bool);
164  vtkBooleanMacro(OpacityByArray, bool);
166 
168 
172  void SetScaleByArray(bool newVal);
173  vtkGetMacro(ScaleByArray, bool);
174  vtkBooleanMacro(ScaleByArray, bool);
176 
177 protected:
179  ~vtkPointGaussianRepresentation() override;
180 
181  bool AddToView(vtkView* view) override;
182  bool RemoveFromView(vtkView* view) override;
183 
184  int FillInputPortInformation(int port, vtkInformation* info) override;
186 
187  void UpdateColoringParameters();
188  vtkSetStringMacro(LastScaleArray);
189  vtkSetStringMacro(LastOpacityArray);
190  void InitializeShaderPresets();
191  void UpdateMapperScaleFunction();
192 
197 
199 
203 
207 
209 
210  std::vector<std::string> PresetShaderStrings;
211  std::vector<float> PresetShaderScales;
212 
213 private:
215  void operator=(const vtkPointGaussianRepresentation&) = delete;
216 };
217 
218 #endif // vtkPointGaussianRepresentation_h
vtkSmartPointer< vtkDataObject > ProcessedData
#define VTKREMOTINGVIEWS_EXPORT
vtkPVDataRepresentation adds some ParaView specific API to data representations.
bool AddToView(vtkView *view) override
Making these methods public.
Representation for showing point data as sprites, including gaussian splats, spheres, or some custom shaded representation.
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)
ShaderPresets
An enum specifying some preset fragment shaders.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
vtkSmartPointer< vtkPointGaussianMapper > Mapper
bool RemoveFromView(vtkView *view) override
Making these methods public.
static vtkDataRepresentation * New()
vtkSmartPointer< vtkPiecewiseFunction > ScaleFunction
void PrintSelf(ostream &os, vtkIndent indent) override
std::vector< std::string > PresetShaderStrings