VTK  9.3.20240419
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 "vtkDataAssembly.h" // for vtkDataAssembly
37 #include "vtkIOImportModule.h" // For export macro
38 #include "vtkSmartPointer.h" // for vtkSmartPointer
39 
40 #include "vtkObject.h"
41 
42 #include <string> // for std::string
43 
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkAbstractArray;
46 class vtkDataSet;
47 class vtkDoubleArray;
48 class vtkRenderWindow;
49 class vtkRenderer;
50 
51 class VTKIOIMPORT_EXPORT vtkImporter : public vtkObject
52 {
53 public:
54  vtkTypeMacro(vtkImporter, vtkObject);
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
62  vtkGetObjectMacro(Renderer, vtkRenderer);
64 
66 
71  vtkGetObjectMacro(SceneHierarchy, vtkDataAssembly);
73 
75 
84  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
86 
88 
91  void Read();
92  void Update() { this->Read(); }
94 
99  virtual std::string GetOutputsDescription() { return ""; }
100 
106 
111  virtual std::string GetAnimationName(vtkIdType vtkNotUsed(animationIndex)) { return ""; }
112 
114 
117  virtual void EnableAnimation(vtkIdType vtkNotUsed(animationIndex)) {}
118  virtual void DisableAnimation(vtkIdType vtkNotUsed(animationIndex)) {}
119  virtual bool IsAnimationEnabled(vtkIdType vtkNotUsed(animationIndex)) { return false; }
121 
126  virtual vtkIdType GetNumberOfCameras() { return 0; }
127 
132  virtual std::string GetCameraName(vtkIdType vtkNotUsed(camIndex)) { return ""; }
133 
139  virtual void SetCamera(vtkIdType vtkNotUsed(camIndex)) {}
140 
151  virtual bool GetTemporalInformation(vtkIdType animationIndex, double frameRate, int& nbTimeSteps,
152  double timeRange[2], vtkDoubleArray* timeSteps);
153 
158  virtual void UpdateTimeStep(double timeValue);
159 
160 protected:
162  ~vtkImporter() override;
163 
164  virtual int ImportBegin() { return 1; }
165  virtual void ImportEnd() {}
166  virtual void ImportActors(vtkRenderer*) {}
167  virtual void ImportCameras(vtkRenderer*) {}
168  virtual void ImportLights(vtkRenderer*) {}
169  virtual void ImportProperties(vtkRenderer*) {}
170 
173 
177 
178  virtual void ReadData();
179 
180 private:
181  vtkImporter(const vtkImporter&) = delete;
182  void operator=(const vtkImporter&) = delete;
183 };
184 
185 VTK_ABI_NAMESPACE_END
186 #endif
Abstract superclass for all arrays.
hierarchical representation to use with vtkPartitionedDataSetCollection
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
dynamic, self-adjusting array of double
importer abstract class
Definition: vtkImporter.h:52
virtual bool IsAnimationEnabled(vtkIdType vtkNotUsed(animationIndex))
Enable/Disable/Get the status of specific animations.
Definition: vtkImporter.h:119
virtual void ImportProperties(vtkRenderer *)
Definition: vtkImporter.h:169
virtual void ReadData()
void Update()
Import the actors, cameras, lights and properties into a vtkRenderWindow.
Definition: vtkImporter.h:92
virtual void SetCamera(vtkIdType vtkNotUsed(camIndex))
Enable a specific camera.
Definition: vtkImporter.h:139
virtual void UpdateTimeStep(double timeValue)
Import the actors, camera, lights and properties at a specific time value.
vtkRenderWindow * RenderWindow
Definition: vtkImporter.h:175
virtual void DisableAnimation(vtkIdType vtkNotUsed(animationIndex))
Enable/Disable/Get the status of specific animations.
Definition: vtkImporter.h:118
virtual std::string GetOutputsDescription()
Recover a printable string that let importer implementation Describe their outputs.
Definition: vtkImporter.h:99
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:167
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:166
virtual std::string GetCameraName(vtkIdType vtkNotUsed(camIndex))
Get the name of a camera.
Definition: vtkImporter.h:132
vtkSmartPointer< vtkDataAssembly > SceneHierarchy
Definition: vtkImporter.h:176
virtual void EnableAnimation(vtkIdType vtkNotUsed(animationIndex))
Enable/Disable/Get the status of specific animations.
Definition: vtkImporter.h:117
virtual int ImportBegin()
Definition: vtkImporter.h:164
static std::string GetDataSetDescription(vtkDataSet *ds, vtkIndent indent)
static std::string GetArrayDescription(vtkAbstractArray *array, vtkIndent indent)
vtkRenderer * Renderer
Definition: vtkImporter.h:174
virtual void ImportEnd()
Definition: vtkImporter.h:165
~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:126
virtual void ImportLights(vtkRenderer *)
Definition: vtkImporter.h:168
virtual std::string GetAnimationName(vtkIdType vtkNotUsed(animationIndex))
Get the name of an animation.
Definition: vtkImporter.h:111
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:172
@ string
Definition: vtkX3D.h:490
int vtkIdType
Definition: vtkType.h:315