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 
25 class VTKREMOTINGVIEWS_EXPORT vtkPointGaussianRepresentation : public vtkPVDataRepresentation
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
vtkPointGaussianRepresentation::SPHERE
@ SPHERE
Definition: vtkPointGaussianRepresentation.h:88
vtkDataRepresentation::New
static vtkDataRepresentation * New()
vtkPointGaussianMapper
vtkPointGaussianRepresentation::LastScaleArray
char * LastScaleArray
Definition: vtkPointGaussianRepresentation.h:201
vtkPVDataRepresentation.h
vtkPointGaussianRepresentation::LastOpacityArrayComponent
int LastOpacityArrayComponent
Definition: vtkPointGaussianRepresentation.h:206
vtkInformationVector
vtkPointGaussianRepresentation::LastScaleArrayComponent
int LastScaleArrayComponent
Definition: vtkPointGaussianRepresentation.h:202
vtkPointGaussianRepresentation::OpacityByArray
bool OpacityByArray
Definition: vtkPointGaussianRepresentation.h:204
vtkPointGaussianRepresentation
Definition: vtkPointGaussianRepresentation.h:25
vtkPVDataRepresentation::AddToView
bool AddToView(vtkView *view) override
Making these methods public.
vtkPointGaussianRepresentation::ScaleByArray
bool ScaleByArray
Definition: vtkPointGaussianRepresentation.h:200
vtkPointGaussianRepresentation::ShaderPresets
ShaderPresets
An enum specifying some preset fragment shaders.
Definition: vtkPointGaussianRepresentation.h:85
vtkSmartPointer< vtkActor >
vtkPointGaussianRepresentation::LastOpacityArray
char * LastOpacityArray
Definition: vtkPointGaussianRepresentation.h:205
vtkPointGaussianRepresentation::Mapper
vtkSmartPointer< vtkPointGaussianMapper > Mapper
Definition: vtkPointGaussianRepresentation.h:194
vtkPVDataRepresentation::SetVisibility
virtual void SetVisibility(bool val)
Get/Set the visibility for this representation.
Definition: vtkPVDataRepresentation.h:89
vtkPointGaussianRepresentation::ProcessedData
vtkSmartPointer< vtkDataObject > ProcessedData
Definition: vtkPointGaussianRepresentation.h:195
vtkPointGaussianRepresentation::PresetShaderScales
std::vector< float > PresetShaderScales
Definition: vtkPointGaussianRepresentation.h:211
vtkPointGaussianRepresentation::Actor
vtkSmartPointer< vtkActor > Actor
Definition: vtkPointGaussianRepresentation.h:193
vtkPointGaussianRepresentation::CUSTOM
@ CUSTOM
Definition: vtkPointGaussianRepresentation.h:93
vtkPVDataRepresentation::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Overridden to invoke vtkCommand::UpdateDataEvent.
vtkPVDataRepresentation::RemoveFromView
bool RemoveFromView(vtkView *view) override
Making these methods public.
vtkPassInputTypeAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkPointGaussianRepresentation::UseScaleFunction
bool UseScaleFunction
Definition: vtkPointGaussianRepresentation.h:208
vtkActor
vtkView
vtkIndent
vtkPVDataRepresentation::ProcessViewRequest
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
vtkPointGaussianRepresentation::GAUSSIAN_BLUR
@ GAUSSIAN_BLUR
Definition: vtkPointGaussianRepresentation.h:87
vtkSmartPointer.h
vtkInformationRequestKey
vtkScalarsToColors
vtkPiecewiseFunction
vtkInformation
vtkPointGaussianRepresentation::SQUARE_OUTLINE
@ SQUARE_OUTLINE
Definition: vtkPointGaussianRepresentation.h:92
vtkPointGaussianRepresentation::PresetShaderStrings
std::vector< std::string > PresetShaderStrings
Definition: vtkPointGaussianRepresentation.h:210
vtkPVDataRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkPointGaussianRepresentation::SelectedPreset
int SelectedPreset
Definition: vtkPointGaussianRepresentation.h:198
vtkPointGaussianRepresentation::TRIANGLE
@ TRIANGLE
Definition: vtkPointGaussianRepresentation.h:91
vtkPVDataRepresentation
Definition: vtkPVDataRepresentation.h:23
vtkDataObject
vtkPointGaussianRepresentation::PLAIN_CIRCLE
@ PLAIN_CIRCLE
Definition: vtkPointGaussianRepresentation.h:90
vtkPointGaussianRepresentation::ScaleFunction
vtkSmartPointer< vtkPiecewiseFunction > ScaleFunction
Definition: vtkPointGaussianRepresentation.h:196
vtkPointGaussianRepresentation::BLACK_EDGED_CIRCLE
@ BLACK_EDGED_CIRCLE
Definition: vtkPointGaussianRepresentation.h:89