Files
uLib/src/Vtk/Math/vtkCylinder.h

75 lines
2.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*//////////////////////////////////////////////////////////////////////////////
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Copyright (c) 2014, Universita degli Studi di Padova, INFN sez. di Padova
All rights reserved
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
------------------------------------------------------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library.
//////////////////////////////////////////////////////////////////////////////*/
#ifndef U_VTKCYLINDER_H
#define U_VTKCYLINDER_H
#include "Core/ObjectFactory.h"
#include "Math/Cylinder.h"
#include "Vtk/uLibVtkInterface.h"
#include <vtkActor.h>
class vtkAssembly;
namespace uLib {
namespace Vtk {
/**
* @brief VTK representation of the uLib::Cylinder object.
*
* This class wraps a vtkCylinderSource and synchronizes it with the
* mathematical state of a Cylinder object. It manages the alignment
* between VTK's Y-centered cylinder and uLib's Z-based coordinate system.
*/
class Cylinder : public Prop3D, public uLib::ObjectWrapper<uLib::Cylinder> {
typedef uLib::Cylinder Content;
public:
Cylinder(Content *content);
virtual ~Cylinder();
/** Synchronizes the VTK actor with the uLib model matrix and vice-versa */
virtual void Update() override;
/** Synchronizes the uLib model matrix with the VTK actor specifically for gizmo interactions */
virtual void SyncFromVtk() override;
virtual uLib::Object *GetContent() const override {
return (uLib::Object *)m_model.get();
}
protected:
/** Sets up the VTK visualization pipeline */
virtual void InstallPipe();
vtkActor *m_Actor;
::vtkAssembly *m_VtkAsm;
uLib::Connection m_UpdateSignal;
};
} // namespace Vtk
} // namespace uLib
#endif // U_VTKCYLINDER_H