vtkPointGaussianRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPointGaussianRepresentation.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef vtkPointGaussianRepresentation_h
23 #define vtkPointGaussianRepresentation_h
24 
26 #include "vtkRemotingViewsModule.h" // needed for exports
27 #include "vtkSmartPointer.h" // needed for smart pointer
28 #include <string> // for std::string
29 #include <vector> // for std::vector
30 
31 class vtkActor;
32 class vtkDataObject;
35 class vtkScalarsToColors;
36 
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45  vtkInformation* outInfo) override;
46 
50  void SetLookupTable(vtkScalarsToColors* lut);
51 
55  void SetVisibility(bool val) override;
56 
60  virtual void SetEmissive(bool val);
61 
66  virtual void SetMapScalars(int val);
67 
68  //***************************************************************************
69  // Forwarded to Actor.
70  virtual void SetOrientation(double, double, double);
71  virtual void SetOrigin(double, double, double);
72  virtual void SetPickable(int val);
73  virtual void SetPosition(double, double, double);
74  virtual void SetScale(double, double, double);
75 
76  //***************************************************************************
77  // Forwarded to Actor->GetProperty()
78  virtual void SetAmbientColor(double r, double g, double b);
79  virtual void SetDiffuseColor(double r, double g, double b);
80  virtual void SetEdgeColor(double r, double g, double b);
81  virtual void SetInterpolation(int val);
82  virtual void SetLineWidth(double val);
83  virtual void SetOpacity(double val);
84  virtual void SetPointSize(double val);
85  virtual void SetSpecularColor(double r, double g, double b);
86  virtual void SetSpecularPower(double val);
87 
92  virtual void SetSplatSize(double radius);
93 
98  {
99  GAUSSIAN_BLUR, // This is the default
100  SPHERE, // Points shaded to look (something) like a sphere lit from the view direction
101  BLACK_EDGED_CIRCLE, // Camera facing, flat circle, rimmed in black
102  PLAIN_CIRCLE, // Same as above, but without the black edge
103  TRIANGLE, // Camera facing, flat triangle
104  SQUARE_OUTLINE, // Camera facing, flat square, with empty center
105  CUSTOM, // Custom shader
106  NUMBER_OF_PRESETS // !!! THIS MUST ALWAYS BE THE LAST PRESET ENUM !!!
107  };
108 
112  void SelectShaderPreset(int preset);
113 
117  void SetCustomShader(const char* shaderString);
118 
122  void SetCustomTriangleScale(double scale);
123 
129  void SelectScaleArray(int, int, int, int, const char* name);
130 
134  void SelectScaleArrayComponent(int component);
135 
139  void SetUseScaleFunction(bool enable);
140 
147  void SetScaleTransferFunction(vtkPiecewiseFunction* pwf);
148 
153  void SetOpacityTransferFunction(vtkPiecewiseFunction* pwf);
154 
161  void SelectOpacityArray(int, int, int, int, const char* name);
162 
166  void SelectOpacityArrayComponent(int component);
167 
169 
174  void SetOpacityByArray(bool newVal);
175  vtkGetMacro(OpacityByArray, bool);
176  vtkBooleanMacro(OpacityByArray, bool);
178 
180 
184  void SetScaleByArray(bool newVal);
185  vtkGetMacro(ScaleByArray, bool);
186  vtkBooleanMacro(ScaleByArray, bool);
188 
189 protected:
191  ~vtkPointGaussianRepresentation() override;
192 
193  bool AddToView(vtkView* view) override;
194  bool RemoveFromView(vtkView* view) override;
195 
196  int FillInputPortInformation(int port, vtkInformation* info) override;
198 
199  void UpdateColoringParameters();
200  vtkSetStringMacro(LastScaleArray);
201  vtkSetStringMacro(LastOpacityArray);
202  void InitializeShaderPresets();
203  void UpdateMapperScaleFunction();
204 
209 
211 
215 
219 
221 
222  std::vector<std::string> PresetShaderStrings;
223  std::vector<float> PresetShaderScales;
224 
225 private:
227  void operator=(const vtkPointGaussianRepresentation&) = delete;
228 };
229 
230 #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