75 lines
2.4 KiB
C++
75 lines
2.4 KiB
C++
/*//////////////////////////////////////////////////////////////////////////////
|
||
// 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
|