Skip to content

Commit

Permalink
BUG: Remove unneeded loading of haptic probe model
Browse files Browse the repository at this point in the history
Revert 03d5f0c ("ENH: Add a default model as haptic probe", 2022-04-29)
  • Loading branch information
jcfr committed Mar 15, 2024
1 parent a147a1d commit 846ca05
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
32 changes: 0 additions & 32 deletions Applications/vpawApp/Main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
and was partially funded by NIH grant 3P41RR013218-12S1
==============================================================================*/
// Qt includes
#include <QFile>

// vpaw includes
#include "qvpawAppMainWindow.h"
Expand All @@ -26,12 +24,8 @@
#include "qSlicerApplicationHelper.h"
#include "vtkSlicerConfigure.h" // For Slicer_MAIN_PROJECT_APPLICATION_NAME
#include "vtkSlicerVersionConfigure.h" // For Slicer_MAIN_PROJECT_VERSION_FUL
#include "vtkMRMLLinearTransformNode.h"
#include "vtkMRMLModelNode.h"
#include "vtkMRMLScene.h"

// VTK Includes
#include "vtkPLYReader.h"

namespace
{
Expand Down Expand Up @@ -62,32 +56,6 @@ SlicerAppMain(int argc, char * argv[])
window->setWindowTitle(windowTitle);
}

// Load default haptic probe model from resource file.
QFile file(":/cylinder.ply");
if (file.open(QIODevice::ReadOnly) && app.mrmlScene())
{
auto bytes = file.readAll();

vtkNew<vtkPLYReader> reader;
reader->SetInputString(bytes.toStdString());
reader->ReadFromInputStringOn();
reader->Update();

if (reader->GetErrorCode() == 0)
{
vtkNew<vtkMRMLModelNode> hapticProbe;
hapticProbe->SetName("Model: Haptic Probe");
app.mrmlScene()->AddNode(hapticProbe);
hapticProbe->SetAndObserveMesh(reader->GetOutput());

vtkNew<vtkMRMLLinearTransformNode> transformNode;
transformNode->SetName("Transform: Haptic Probe");
app.mrmlScene()->AddNode(transformNode);
hapticProbe->SetAndObserveTransformNodeID(transformNode->GetID());
hapticProbe->SetDisplayVisibility(true);
}
}

return app.exec();
}

Expand Down
1 change: 0 additions & 1 deletion Applications/vpawApp/Resources/App.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
<file alias="Logo.png">Images/Logo.png</file>
<file alias="LogoFull.png">Images/LogoFull.png</file>
<file alias="SplashScreen.png">Images/SplashScreen.png</file>
<file alias="cylinder.ply">Models/cylinder.ply</file>
</qresource>
</RCC>
Binary file removed Applications/vpawApp/Resources/Models/cylinder.ply
Binary file not shown.

0 comments on commit 846ca05

Please sign in to comment.