ParaView
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 
25 #include "vtkPVClientServerCoreRenderingModule.h" // needed for exports
27 #include "vtkSmartPointer.h" // needed for smart pointer
28 
29 class vtkActor;
30 class vtkPointGaussianMapper;
31 class vtkScalarsToColors;
32 class vtkPolyData;
33 class vtkPiecewiseFunction;
34 
35 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPointGaussianRepresentation
37 {
38 public:
39  vtkTypeMacro(vtkPointGaussianRepresentation,
41  virtual void PrintSelf(ostream& os, vtkIndent indent);
42 
43  virtual int ProcessViewRequest(
44  vtkInformationRequestKey* request_type, vtkInformation* inInfo, vtkInformation* outInfo);
45 
49  void SetLookupTable(vtkScalarsToColors* lut);
50 
54  virtual void SetVisibility(bool val);
55 
59  virtual void SetEmissive(bool val);
60 
65  virtual void SetMapScalars(int val);
66 
67  //***************************************************************************
68  // Forwarded to Actor.
69  virtual void SetOrientation(double, double, double);
70  virtual void SetOrigin(double, double, double);
71  virtual void SetPickable(int val);
72  virtual void SetPosition(double, double, double);
73  virtual void SetScale(double, double, double);
74 
75  //***************************************************************************
76  // Forwarded to Actor->GetProperty()
77  virtual void SetAmbientColor(double r, double g, double b);
78  virtual void SetColor(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  NUMBER_OF_PRESETS // !!! THIS MUST ALWAYS BE THE LAST PRESET ENUM !!!
106  };
107 
111  void SelectShaderPreset(int preset);
112 
116  void SetCustomShader(const char* shaderString);
117 
123  void SelectScaleArray(int, int, int, int, const char* name);
124 
131  void SetScaleTransferFunction(vtkPiecewiseFunction* pwf);
132 
137  void SetOpacityTransferFunction(vtkPiecewiseFunction* pwf);
138 
145  void SelectOpacityArray(int, int, int, int, const char* name);
146 
148 
153  void SetOpacityByArray(bool newVal);
154  vtkGetMacro(OpacityByArray, bool);
155  vtkBooleanMacro(OpacityByArray, bool);
157 
159 
163  void SetScaleByArray(bool newVal);
164  vtkGetMacro(ScaleByArray, bool);
165  vtkBooleanMacro(ScaleByArray, bool);
167 
168 protected:
171 
172  virtual bool AddToView(vtkView* view);
173  virtual bool RemoveFromView(vtkView* view);
174 
175  virtual int FillInputPortInformation(int port, vtkInformation* info);
176  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
177 
178  vtkSmartPointer<vtkActor> Actor;
179  vtkSmartPointer<vtkPointGaussianMapper> Mapper;
180  vtkSmartPointer<vtkPolyData> ProcessedData;
181 
182  void UpdateColoringParameters();
183 
186 
187  vtkSetStringMacro(LastScaleArray);
188 
189  bool OpacityByArray;
191 
192  vtkSetStringMacro(LastOpacityArray);
193 
194 private:
196  void operator=(const vtkPointGaussianRepresentation&) VTK_DELETE_FUNCTION;
197 };
198 
199 #endif // vtkPointGaussianRepresentation_h
vtkSmartPointer< vtkPolyData > ProcessedData
void PrintSelf(ostream &os, vtkIndent indent)
vtkPVDataRepresentation adds some ParaView specific API to data representations.
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 bool AddToView(vtkView *view)
Making these methods public.
virtual int ProcessViewRequest(vtkInformationRequestKey *request_type, vtkInformation *inInfo, vtkInformation *outInfo)
vtkAlgorithm::ProcessRequest() equivalent for rendering passes.
ShaderPresets
An enum specifying some preset fragment shaders.
vtkSmartPointer< vtkPointGaussianMapper > Mapper
virtual bool RemoveFromView(vtkView *view)
Making these methods public.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Overridden to invoke vtkCommand::UpdateDataEvent.