26#ifndef CAMITK_TESTPERSISTENCE_H
27#define CAMITK_TESTPERSISTENCE_H
31#include <QTemporaryFile>
59 void cleanupTestCase() {
64 void saveLoadEmptyWorkspace() {
76 void saveLoadWorkspaceComponents() {
85 QVERIFY(tr !=
nullptr);
86 QUuid transformationId = tr->getUuid();
89 QTemporaryFile file1(QDir::tempPath() + QDir::separator() +
"Component-XXXXXX.vtk");
90 QTemporaryFile file2(QDir::tempPath() + QDir::separator() +
"Component-XXXXXX.vtk");
91 QTemporaryFile fileWorkspace(QDir::tempPath() + QDir::separator() +
"Workspace-XXXXXX.camitk");
92 QVERIFY(file1.open());
93 QVERIFY(file2.open());
94 QVERIFY(fileWorkspace.open());
133 component1 =
nullptr;
134 component2 =
nullptr;
136 if (comp->getName() ==
"SphereMeshComponent") {
140 if (comp->getName() ==
"SphereMeshComponent2") {
145 QVERIFY(component1 !=
nullptr);
146 QVERIFY(component2 !=
nullptr);
camitk::Component * createNamedSphere(float radius, QString name)
Create a basic MeshComponent for tests.
Definition TestPersistence.cpp:34
camitk::Component * createNamedSphere(float radius=1.0, QString name="No name")
Create a basic MeshComponent for tests.
Definition TestPersistence.cpp:34
virtual camitk::Action::ApplyStatus apply()=0
This method is called when the action has to be applied on the target list (get the target lists usin...
static const ComponentList & getAllComponents()
get the current application wide list of all Components.
Definition Application.cpp:1273
static Action * getAction(QString)
get a registered action given its name
Definition Application.cpp:967
static bool loadWorkspace(const QString &filepath)
load a camitk file and its content into the application
Definition Application.cpp:728
static bool close(Component *component, bool blockRefresh=false)
Close a Component: if it has been changed, ask the user for more information, then if everything is o...
Definition Application.cpp:755
static bool saveWorkspace(const QString &filepath)
save the current workspace to a .camitk file.
Definition Application.cpp:868
static bool save(Component *component)
save a component to its file (as given by component->getFileName()).
Definition Application.cpp:804
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition sdk/libraries/core/component/Component.h:304
virtual const FrameOfReference * getFrame() const override
Get the pointer to this object's FrameOfReference.
Definition sdk/libraries/core/component/Component.h:795
void setFileName(const QString &)
set the file name where the data have to be stored
Definition sdk/libraries/core/component/Component.cpp:425
static void autoload()
Autoload component, action and viewer extensions (dlls) as well as registered CamiTK extension file.
Definition ExtensionManager.cpp:46
QUuid getUuid() const override
Get the unique identifier of the Frame.
Definition FrameOfReference.h:339
Definition TestPersistence.h:48