34#include <vtkActor2D.h>
35#include <vtkCoordinate.h>
37#include <vtkPolyDataAlgorithm.h>
38#include <vtkPolyDataMapper.h>
39#include <vtkPolyDataMapper2D.h>
40#include <vtkProperty.h>
41#include <vtkProperty2D.h>
45 return std::hash<G4VisAttributes>{}(*pVA);
68 coordinate->SetCoordinateSystemToNormalizedViewport();
69 mapper2D->SetTransformCoordinate(coordinate);
73 GetActor2D()->GetProperty()->SetLineWidth(lineWidth);
75 GetActor2D()->GetProperty()->SetOpacity(opacity);
99 const size_t nLines = polyline.size();
101 for (
size_t i = 0; i < nLines; ++i) {
103 polydataPoints->InsertNextPoint((polyline[i].x() + 1) / 2.0, (polyline[i].y() + 1) / 2.0, 0);
105 if (i < nLines - 1) {
107 line->GetPointIds()->SetId(0,
id);
108 line->GetPointIds()->SetId(1,
id + 1);
G4double GetAlpha() const
G4double GetGreen() const
void SetTypeName(G4String typeNameIn)
vtkSmartPointer< vtkRenderer > renderer
G4double GetLineWidth() const
const G4Colour & GetColour() const
vtkSmartPointer< vtkPolyDataAlgorithm > GetFinalFilter()
vtkSmartPointer< vtkCellArray > polydataCells
vtkSmartPointer< vtkPoints > polydataPoints
virtual vtkSmartPointer< vtkActor > GetActor()
G4VtkPolydataPipeline(G4String name, const G4VtkVisContext &vc)
static std::size_t MakeHash(const G4VisAttributes *va)
vtkSmartPointer< vtkActor2D > actor2D
G4VtkPolydataPolyline2DPipeline(G4String name, const G4VtkVisContext &vc, const G4VisAttributes *pVA)
vtkSmartPointer< vtkActor2D > GetActor2D()
void SetPolydata(const G4Polyline &polyline) override
vtkSmartPointer< vtkPolyDataMapper2D > mapper2D