VTK  9.3.0
vtkImporter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
33 #ifndef vtkImporter_h
34 #define vtkImporter_h
35 
36 #include "vtkIOImportModule.h" // For export macro
37 #include "vtkObject.h"
38 
39 #include <string> // for std::string
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkAbstractArray;
43 class vtkDataSet;
44 class vtkDoubleArray;
45 class vtkRenderWindow;
46 class vtkRenderer;
47 
48 class VTKIOIMPORT_EXPORT vtkImporter : public vtkObject
49 {
50 public:
51  vtkTypeMacro(vtkImporter, vtkObject);
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
59  vtkGetObjectMacro(Renderer, vtkRenderer);
61 
63 
72  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
74 
76 
79  void Read();
80  void Update() { this->Read(); }
82 
87  virtual std::string GetOutputsDescription() { return ""; }
88 
94 
99  virtual std::string GetAnimationName(vtkIdType vtkNotUsed(animationIndex)) { return ""; }
100 
102 
105  virtual void EnableAnimation(vtkIdType vtkNotUsed(animationIndex)) {}
106  virtual void DisableAnimation(vtkIdType vtkNotUsed(animationIndex)) {}
107  virtual bool IsAnimationEnabled(vtkIdType vtkNotUsed(animationIndex)) { return false; }
109 
114  virtual vtkIdType GetNumberOfCameras() { return 0; }
115 
120  virtual std::string GetCameraName(vtkIdType vtkNotUsed(camIndex)) { return ""; }
121 
127  virtual void SetCamera(vtkIdType vtkNotUsed(camIndex)) {}
128 
139  virtual bool GetTemporalInformation(vtkIdType animationIndex, double frameRate, int& nbTimeSteps,
140  double timeRange[2], vtkDoubleArray* timeSteps);
141 
146  virtual void UpdateTimeStep(double timeValue);
147 
148 protected:
150  ~vtkImporter() override;
151 
152  virtual int ImportBegin() { return 1; }
153  virtual void ImportEnd() {}
154  virtual void ImportActors(vtkRenderer*) {}
155  virtual void ImportCameras(vtkRenderer*) {}
156  virtual void ImportLights(vtkRenderer*) {}
157  virtual void ImportProperties(vtkRenderer*) {}
158 
161 
164 
165  virtual void ReadData();
166 
167 private:
168  vtkImporter(const vtkImporter&) = delete;
169  void operator=(const vtkImporter&) = delete;
170 };
171 
172 VTK_ABI_NAMESPACE_END
173 #endif
Abstract superclass for all arrays.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
dynamic, self-adjusting array of double
importer abstract class
Definition: vtkImporter.h:49
virtual bool IsAnimationEnabled(vtkIdType vtkNotUsed(animationIndex))
Enable/Disable/Get the status of specific animations.
Definition: vtkImporter.h:107
virtual void ImportProperties(vtkRenderer *)
Definition: vtkImporter.h:157
virtual void ReadData()
void Update()
Import the actors, cameras, lights and properties into a vtkRenderWindow.
Definition: vtkImporter.h:80
virtual void SetCamera(vtkIdType vtkNotUsed(camIndex))
Enable a specific camera.
Definition: vtkImporter.h:127
virtual void UpdateTimeStep(double timeValue)
Import the actors, camera, lights and properties at a specific time value.
vtkRenderWindow * RenderWindow
Definition: vtkImporter.h:163
virtual void DisableAnimation(vtkIdType vtkNotUsed(animationIndex))
Enable/Disable/Get the status of specific animations.
Definition: vtkImporter.h:106
virtual std::string GetOutputsDescription()
Recover a printable string that let importer implementation Describe their outputs.
Definition: vtkImporter.h:87
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ImportCameras(vtkRenderer *)
Definition: vtkImporter.h:155
virtual bool GetTemporalInformation(vtkIdType animationIndex, double frameRate, int &nbTimeSteps, double timeRange[2], vtkDoubleArray *timeSteps)
Get temporal information for the provided animationIndex and frameRate.
virtual void ImportActors(vtkRenderer *)
Definition: vtkImporter.h:154
virtual std::string GetCameraName(vtkIdType vtkNotUsed(camIndex))
Get the name of a camera.
Definition: vtkImporter.h:120
virtual void EnableAnimation(vtkIdType vtkNotUsed(animationIndex))
Enable/Disable/Get the status of specific animations.
Definition: vtkImporter.h:105
virtual int ImportBegin()
Definition: vtkImporter.h:152
static std::string GetDataSetDescription(vtkDataSet *ds, vtkIndent indent)
static std::string GetArrayDescription(vtkAbstractArray *array, vtkIndent indent)
vtkRenderer * Renderer
Definition: vtkImporter.h:162
virtual void ImportEnd()
Definition: vtkImporter.h:153
~vtkImporter() override
virtual vtkIdType GetNumberOfAnimations()
Get the number of available animations.
virtual void SetRenderWindow(vtkRenderWindow *)
Set the vtkRenderWindow to contain the imported actors, cameras and lights, If no vtkRenderWindow is ...
void Read()
Import the actors, cameras, lights and properties into a vtkRenderWindow.
virtual vtkIdType GetNumberOfCameras()
Get the number of available cameras.
Definition: vtkImporter.h:114
virtual void ImportLights(vtkRenderer *)
Definition: vtkImporter.h:156
virtual std::string GetAnimationName(vtkIdType vtkNotUsed(animationIndex))
Get the name of an animation.
Definition: vtkImporter.h:99
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:71
@ string
Definition: vtkX3D.h:490
int vtkIdType
Definition: vtkType.h:315