VTK  9.5.20251216
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
35
36#ifndef vtkImporter_h
37#define vtkImporter_h
38
39#include "vtkDataAssembly.h" // for vtkDataAssembly
40#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_6_0
41#include "vtkIOImportModule.h" // For export macro
42#include "vtkResourceStream.h" // For Stream
43#include "vtkSmartPointer.h" // for vtkSmartPointer
44
45#include "vtkObject.h"
46
47#include <string> // for std::string
48
49VTK_ABI_NAMESPACE_BEGIN
52class vtkCollection;
53class vtkDataSet;
54class vtkDoubleArray;
57class vtkRenderWindow;
58class vtkRenderer;
59
60class VTKIOIMPORT_EXPORT vtkImporter : public vtkObject
61{
62public:
63 vtkTypeMacro(vtkImporter, vtkObject);
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
67
73
75
80 vtkSetSmartPointerMacro(Stream, vtkResourceStream);
81 vtkGetSmartPointerMacro(Stream, vtkResourceStream);
83
85
89 vtkGetObjectMacro(Renderer, vtkRenderer);
91
93
98 vtkGetObjectMacro(SceneHierarchy, vtkDataAssembly);
100
102
111
113
122 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
124
130 bool Update();
131
136 virtual std::string GetOutputsDescription() { return ""; }
137
138 enum class AnimationSupportLevel : unsigned char
139 {
144 };
145
159
165
170 virtual std::string GetAnimationName(vtkIdType vtkNotUsed(animationIndex)) { return ""; }
171
173
176 virtual void EnableAnimation(vtkIdType vtkNotUsed(animationIndex)) {}
177 virtual void DisableAnimation(vtkIdType vtkNotUsed(animationIndex)) {}
178 virtual bool IsAnimationEnabled(vtkIdType vtkNotUsed(animationIndex)) { return false; }
180
185 virtual vtkIdType GetNumberOfCameras() { return 0; }
186
191 virtual std::string GetCameraName(vtkIdType vtkNotUsed(camIndex)) { return ""; }
192
198 virtual void SetCamera(vtkIdType vtkNotUsed(camIndex)) {}
199
211 VTK_DEPRECATED_IN_9_6_0("Use GetTemporalInformation without framerate parameter instead.")
212 virtual bool GetTemporalInformation(vtkIdType animationIndex, double frameRate, int& nbTimeSteps,
213 double timeRange[2], vtkDoubleArray* timeSteps);
214
224 vtkIdType animationIndex, double timeRange[2], int& nbTimeSteps, vtkDoubleArray* timeSteps);
225
231 virtual bool UpdateAtTimeValue(double vtkNotUsed(timeValue)) { return true; };
232
233 enum class InterpolateAnimationSupportLevel : unsigned char
234 {
238 };
239
254
256
260 vtkSetMacro(InterpolateBetweenTimeSteps, bool);
261 vtkGetMacro(InterpolateBetweenTimeSteps, bool);
262 vtkBooleanMacro(InterpolateBetweenTimeSteps, bool);
264
266
270 vtkSetMacro(ImportArmature, bool);
271 vtkGetMacro(ImportArmature, bool);
272 vtkBooleanMacro(ImportArmature, bool);
274
275protected:
277 ~vtkImporter() override;
278
279 virtual int ImportBegin() { return 1; }
280 virtual void ImportEnd() {}
281 virtual void ImportActors(vtkRenderer*) {}
282 virtual void ImportCameras(vtkRenderer*) {}
283 virtual void ImportLights(vtkRenderer*) {}
285 virtual void ReadData();
286
287 enum class UpdateStatusEnum : bool
288 {
291 };
292
301 {
302 this->UpdateStatus = updateStatus;
303 this->Modified();
304 }
305
309 UpdateStatusEnum GetUpdateStatus() { return this->UpdateStatus; }
310
311 static std::string GetDataSetDescription(vtkDataSet* ds, vtkIndent indent);
312 static std::string GetArrayDescription(vtkAbstractArray* array, vtkIndent indent);
313
317
321
322private:
323 vtkImporter(const vtkImporter&) = delete;
324 void operator=(const vtkImporter&) = delete;
325
326 bool SetAndCheckUpdateStatus();
327
328 char* FileName = nullptr;
330
332 bool ImportArmature = false;
333 bool InterpolateBetweenTimeSteps = true;
334};
335
336VTK_ABI_NAMESPACE_END
337#endif
Abstract superclass for all arrays.
an ordered list of actors
create and manipulate ordered lists of objects
hierarchical representation to use with vtkPartitionedDataSetCollection
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
dynamic, self-adjusting array of double
virtual void DisableAnimation(vtkIdType animationIndex)
Enable/Disable/Get the status of specific animations.
InterpolateAnimationSupportLevel
virtual void ImportProperties(vtkRenderer *)
virtual void EnableAnimation(vtkIdType animationIndex)
Enable/Disable/Get the status of specific animations.
virtual bool UpdateAtTimeValue(double timeValue)
Import the actors, camera, lights and properties at a specific time value.
virtual void ReadData()
vtkNew< vtkCollection > CameraCollection
vtkRenderWindow * RenderWindow
virtual std::string GetOutputsDescription()
Recover a printable string that let importer implementation Describe their outputs.
virtual std::string GetAnimationName(vtkIdType animationIndex)
Get the name of an animation.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ImportCameras(vtkRenderer *)
UpdateStatusEnum GetUpdateStatus()
Get the update status.
vtkSetFilePathMacro(FileName)
Specify file name of the file to read.
virtual bool GetTemporalInformation(vtkIdType animationIndex, double frameRate, int &nbTimeSteps, double timeRange[2], vtkDoubleArray *timeSteps)
DEPRECATED, use the version without framerate Get temporal information for the provided animationInde...
vtkLightCollection * GetImportedLights()
Get collection of actors, cameras and lights that were imported by this importer.
bool Update()
Import the actors, cameras, lights and properties into a vtkRenderWindow and return if it was success...
vtkNew< vtkActorCollection > ActorCollection
virtual void ImportActors(vtkRenderer *)
vtkSmartPointer< vtkDataAssembly > SceneHierarchy
vtkGetFilePathMacro(FileName)
Specify file name of the file to read.
vtkActorCollection * GetImportedActors()
Get collection of actors, cameras and lights that were imported by this importer.
virtual std::string GetCameraName(vtkIdType camIndex)
Get the name of a camera.
virtual AnimationSupportLevel GetAnimationSupportLevel()
Get the level of animation support, this is coming either from the file format or as a limitation of ...
virtual int ImportBegin()
static std::string GetDataSetDescription(vtkDataSet *ds, vtkIndent indent)
void SetUpdateStatus(UpdateStatusEnum updateStatus)
Set the update status.
static std::string GetArrayDescription(vtkAbstractArray *array, vtkIndent indent)
vtkRenderer * Renderer
virtual void SetCamera(vtkIdType camIndex)
Enable a specific camera.
virtual void ImportEnd()
virtual InterpolateAnimationSupportLevel GetInterpolateAnimationSupportLevel()
Get the level of animation interpolation support, this is coming either from the file format or as a ...
~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 ...
vtkCollection * GetImportedCameras()
Get collection of actors, cameras and lights that were imported by this importer.
virtual vtkIdType GetNumberOfCameras()
Get the number of available cameras.
virtual void ImportLights(vtkRenderer *)
virtual bool IsAnimationEnabled(vtkIdType animationIndex)
Enable/Disable/Get the status of specific animations.
vtkNew< vtkLightCollection > LightCollection
a simple class to control print indentation
Definition vtkIndent.h:108
Key for integer values in vtkInformation.
an ordered list of lights
Allocate and hold a VTK object.
Definition vtkNew.h:167
virtual void Modified()
Update the modification time for this object.
create a window for renderers to draw into
abstract specification for renderers
Abstract class used for custom streams.
Hold a reference to a vtkObjectBase instance.
#define VTK_DEPRECATED_IN_9_6_0(reason)
int vtkIdType
Definition vtkType.h:368
#define VTK_UNBLOCKTHREADS