Commit b1e7b88d authored by Andrew Wilson's avatar Andrew Wilson
Browse files

ENH: Axes shown in debug, able to change its length

parent 124d0f36
......@@ -30,6 +30,7 @@
#include "vtkCameraActor.h"
#include "vtkAxesActor.h"
#include "vtkCullerCollection.h"
#include "vtkAxesActor.h"
#include "g3log/g3log.hpp"
......@@ -132,11 +133,10 @@ VTKRenderer::VTKRenderer(std::shared_ptr<Scene> scene, const bool enableVR)
}
// Global Axis
auto axes = vtkSmartPointer<vtkAxesActor>::New();
axes->SetShaftType(vtkAxesActor::CYLINDER_SHAFT);
axes->SetAxisLabels(false);
axes->SetTotalLength(40, 40, 40);
//m_debugVtkActors.push_back(axes);
m_AxesActor = vtkSmartPointer<vtkAxesActor>::New();
m_AxesActor->SetShaftType(vtkAxesActor::CYLINDER_SHAFT);
m_AxesActor->SetAxisLabels(false);
m_debugVtkActors.push_back(m_AxesActor);
// Camera and camera actor
if (!enableVR)
......@@ -335,6 +335,33 @@ VTKRenderer::setMode(const Renderer::Mode mode, const bool enableVR)
Renderer::setMode(mode, enableVR);
}
void
VTKRenderer::setAxesLength(double x, double y, double z)
{
m_AxesActor->SetTotalLength(x, y, z);
}
double*
VTKRenderer::getAxesLength()
{
return m_AxesActor->GetTotalLength();
}
void
VTKRenderer::setAxesVisibility(const bool visible)
{
m_AxesActor->SetVisibility(visible);
}
///
/// \brief Returns whether the debug axes is visible or not
///
bool
VTKRenderer::getAxesVisibility() const
{
return m_AxesActor->GetVisibility();
}
void
VTKRenderer::updateSceneCamera(std::shared_ptr<Camera> imstkCam)
{
......
......@@ -44,6 +44,8 @@
#include "vtkOpenVROverlayInternal.h"
#endif
class vtkAxesActor;
namespace imstk
{
class Scene;
......@@ -74,6 +76,26 @@ public:
///
void setMode(const Mode mode, const bool enableVR) override;
///
/// \brief Change the debug axes length
///
void setAxesLength(const double x, const double y, const double z);
///
/// \brief Get the debug axes length
///
double* getAxesLength();
///
/// \brief Change the visibility of the debug axes
///
void setAxesVisibility(const bool visible);
///
/// \brief Returns whether the debug axes is visible or not
///
bool getAxesVisibility() const;
///
/// \brief Updates the scene camera's position and orientation
///
......@@ -116,6 +138,7 @@ protected:
std::vector<vtkSmartPointer<vtkLight>> m_vtkLights;
std::vector<vtkSmartPointer<vtkProp>> m_objectVtkActors;
std::vector<vtkSmartPointer<vtkProp>> m_debugVtkActors;
vtkSmartPointer<vtkAxesActor> m_AxesActor;
std::vector<std::shared_ptr<VTKRenderDelegate>> m_renderDelegates;
std::vector<std::shared_ptr<VTKRenderDelegate>> m_debugRenderDelegates;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment