/*////////////////////////////////////////////////////////////////////////////// // 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 VTK_DETECTOR_CHAMBER_H #define VTK_DETECTOR_CHAMBER_H #include #include #include #include #include "HEP/Detectors/DetectorChamber.h" #include "Math/Dense.h" #include "Vtk/uLibVtkInterface.h" #include "Vtk/vtkContainerBox.h" #include #include #include namespace uLib { namespace Vtk { // class vtkHandlerWidget; // Removed as we use vtkBoxWidget now class vtkDetectorChamber : public vtkContainerBox { typedef DetectorChamber Content; typedef vtkContainerBox BaseClass; public: vtkDetectorChamber(DetectorChamber *content); ~vtkDetectorChamber(); Content *GetContent(); void SetTransform(class vtkTransform *t); class vtkBoxWidget *GetWidget(); void Update(); void ConnectInteractor(vtkRenderWindowInteractor *interactor) override; void PrintSelf(std::ostream &o) const; protected: void InstallPipe() override; private: class vtkWidgetCallback : public vtkCommand { public: static vtkWidgetCallback *New() { return new vtkWidgetCallback; } void SetChamber(uLib::Vtk::vtkDetectorChamber *ch) { this->chamber = ch; } virtual void Execute(vtkObject *caller, unsigned long, void *) override; private: uLib::Vtk::vtkDetectorChamber *chamber; }; class vtkSelectionCallback : public vtkCommand { public: static vtkSelectionCallback *New() { return new vtkSelectionCallback; } void SetChamber(uLib::Vtk::vtkDetectorChamber *ch) { this->chamber = ch; } virtual void Execute(vtkObject *caller, unsigned long, void *) override; private: uLib::Vtk::vtkDetectorChamber *chamber; }; vtkActor *m_Actor; vtkBoxWidget *m_Widget; vtkWidgetCallback *m_Callback; vtkSelectionCallback *m_PickerCallback; vtkSmartPointer m_InitialTransform; vtkSmartPointer m_RelativeTransform; vtkSmartPointer m_TotalTransform; }; } // namespace Vtk } // namespace uLib #endif // VTK_DETECTOR_CHAMBER_H