Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 26 #include "G4VtkPolydataInstancePipeline.hh" 27 28 #include <vtkDoubleArray.h> 29 #include <vtkPoints.h> 30 31 G4VtkPolydataInstancePipeline::G4VtkPolydataIn 32 33 : G4VtkPolydataPipeline(nameIn, vcIn) 34 { 35 // Set pipeline type 36 SetTypeName(G4String("G4VtkPolydataInstanceP 37 38 instanceColour = vtkSmartPointer<vtkDoubleAr 39 instanceColour->SetName("colours"); 40 instanceColour->SetNumberOfComponents(4); 41 42 instancePosition = vtkSmartPointer<vtkPoints 43 44 instanceTransform = vtkSmartPointer<vtkDoubl 45 instanceTransform->SetName("transform"); 46 instanceTransform->SetNumberOfComponents(9); 47 } 48 49 void G4VtkPolydataInstancePipeline::addInstanc 50 51 52 53 { 54 // add the instance without colour or alpha 55 addInstance(dx, dy, dz, r00, r01, r02, r10, 56 } 57 58 void G4VtkPolydataInstancePipeline::addInstanc 59 60 61 62 63 { 64 instanceColour->InsertNextTuple4(r, g, b, a) 65 auto idp = instancePosition->InsertNextPoint 66 instanceTransform->InsertNextTuple9(r00, r01 67 instanceMap[nameIn] = idp; 68 } 69 70 void G4VtkPolydataInstancePipeline::removeInst 71 { 72 // remove from instanceColour, instancePosit 73 }