Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VtkPolydataInstanceTensorPipeline Class Reference

#include <G4VtkPolydataInstanceTensorPipeline.hh>

+ Inheritance diagram for G4VtkPolydataInstanceTensorPipeline:

Public Member Functions

 G4VtkPolydataInstanceTensorPipeline (G4String name, const G4VtkVisContext &vc)
 
 ~G4VtkPolydataInstanceTensorPipeline () override=default
 
void Print () override
 
- Public Member Functions inherited from G4VtkPolydataInstancePipeline
 G4VtkPolydataInstancePipeline (G4String name, const G4VtkVisContext &vc)
 
 ~G4VtkPolydataInstancePipeline () override=default
 
virtual void addInstance (G4double dx, G4double dy, G4double dz, G4double r00, G4double r01, G4double r02, G4double r10, G4double r11, G4double r12, G4double r20, G4double r21, G4double r22, const G4String &name)
 
virtual void addInstance (G4double dx, G4double dy, G4double dz, G4double r00, G4double r01, G4double r02, G4double r10, G4double r11, G4double r12, G4double r20, G4double r21, G4double r22, G4double r, G4double g, G4double b, G4double a, const G4String &name)
 
virtual void removeInstance (const G4String &name)
 
- Public Member Functions inherited from G4VtkPolydataPipeline
 G4VtkPolydataPipeline (G4String name, const G4VtkVisContext &vc)
 
 ~G4VtkPolydataPipeline () override=default
 
void AddFilter (vtkSmartPointer< vtkPolyDataAlgorithm > f)
 
vtkSmartPointer< vtkPolyDataAlgorithm > GetFilter (G4int iFilter)
 
G4int GetNumberOfFilters ()
 
vtkSmartPointer< vtkPolyDataAlgorithm > GetFinalFilter ()
 
void Enable () override
 
void Disable () override
 
void Print () override
 
void Modified () override
 
void Clear () override
 
virtual vtkSmartPointer< vtkActor > GetActor ()
 
virtual void SetPolydata (const G4Polyhedron &polyhedron)
 
virtual void SetPolydata (const G4Polyline &polyline)
 
virtual void SetPolydata (vtkPolyData *polydata)
 
virtual void SetPolydataData (const G4Point3D &p)
 
virtual void SetPolydataData (double x, double y, double z)
 
virtual void SetActorTransform (G4double dx, G4double dy, G4double dz, G4double r00, G4double r01, G4double r02, G4double r10, G4double r11, G4double r12, G4double r20, G4double r21, G4double r22)
 
virtual void SetActorColour (G4double r, G4double g, G4double b, G4double a)
 
virtual vtkSmartPointer< vtkPolyData > GetPolydata ()
 
virtual G4doubleGetBounds ()
 
- Public Member Functions inherited from G4VVtkPipeline
 G4VVtkPipeline ()
 
 G4VVtkPipeline (G4String nameIn, G4String typeIn, const G4VtkVisContext &vcIn, G4bool disableParentIn=false, vtkSmartPointer< vtkRenderer > rendererIn=nullptr)
 
virtual ~G4VVtkPipeline ()
 
void SetDisableParent (G4bool disableParentIn)
 
bool GetDisableParent ()
 
void SetName (G4String nameIn)
 
const G4String GetName ()
 
void SetTypeName (G4String typeNameIn)
 
G4String GetTypeName ()
 
G4VtkVisContextGetVtkVisContext ()
 
void AddChildPipeline (G4VVtkPipeline *child)
 
G4VVtkPipelineGetChildPipeline (G4int iPipeline)
 
G4int GetNumberOfChildPipelines ()
 
std::vector< G4VVtkPipeline * > GetChildPipelines ()
 
void ClearChildPipeline ()
 

Static Public Member Functions

static std::size_t MakeHash (const G4Polyhedron &p, const G4VtkVisContext &vc)
 
- Static Public Member Functions inherited from G4VtkPolydataPipeline
static std::size_t MakeHash (const G4Polyhedron &p, const G4VtkVisContext &vc)
 

Protected Attributes

vtkSmartPointer< vtkPolyData > instancePolydata
 
vtkSmartPointer< vtkTensorGlyphColorinstanceTensorGlyph
 
- Protected Attributes inherited from G4VtkPolydataInstancePipeline
vtkSmartPointer< vtkDoubleArray > instanceColour
 
vtkSmartPointer< vtkPoints > instancePosition
 
vtkSmartPointer< vtkDoubleArray > instanceTransform
 
std::map< G4String, vtkIdType > instanceMap
 
- Protected Attributes inherited from G4VtkPolydataPipeline
vtkSmartPointer< vtkPoints > polydataPoints
 
vtkSmartPointer< vtkCellArray > polydataCells
 
vtkSmartPointer< vtkPolyData > polydata
 
std::vector< vtkSmartPointer< vtkPolyDataAlgorithm > > filters
 
vtkSmartPointer< vtkPolyDataMapper > mapper
 
vtkSmartPointer< vtkActor > actor
 
- Protected Attributes inherited from G4VVtkPipeline
G4String name
 
G4String type
 
G4bool disableParent
 
std::vector< G4VVtkPipeline * > childPipelines
 
vtkSmartPointer< vtkRenderer > renderer
 
G4VtkVisContext vc
 

Detailed Description

Definition at line 35 of file G4VtkPolydataInstanceTensorPipeline.hh.

Constructor & Destructor Documentation

◆ G4VtkPolydataInstanceTensorPipeline()

G4VtkPolydataInstanceTensorPipeline::G4VtkPolydataInstanceTensorPipeline ( G4String name,
const G4VtkVisContext & vc )

Definition at line 59 of file G4VtkPolydataInstanceTensorPipeline.cc.

61 : G4VtkPolydataInstancePipeline(nameIn, vcIn)
62{
63 // Set pipeline type
64 SetTypeName(G4String("G4VtkPolydataInstanceTensorPipeline"));
65
66 // make polydata from instance data
69 instancePolydata->GetPointData()->SetTensors(instanceTransform);
70 instancePolydata->GetPointData()->SetVectors(instanceColour);
71 instancePolydata->GetPointData()->SetScalars(instanceColour);
72
73 // tensor glyph
76 instanceTensorGlyph->SetSourceConnection(GetFinalFilter()->GetOutputPort());
77 instanceTensorGlyph->ColorGlyphsOn();
78 instanceTensorGlyph->ScalingOff();
79 instanceTensorGlyph->ThreeGlyphsOff();
80 instanceTensorGlyph->ExtractEigenvaluesOff();
81 instanceTensorGlyph->SetColorModeToScalars();
83
84 // set polydata mapper
85 mapper->SetInputConnection(GetFinalFilter()->GetOutputPort());
86
87 // set actor
88 actor->SetMapper(mapper);
89 actor->SetVisibility(1);
90
91 // shading parameters
92 actor->GetProperty()->SetAmbient(0.2);
93 actor->GetProperty()->SetDiffuse(0.7);
94 actor->GetProperty()->SetSpecular(0.1);
95 actor->GetProperty()->SetSpecularPower(1);
96
97 // add to renderer
98 vc.fViewer->renderer->AddActor(GetActor());
99}
void SetTypeName(G4String typeNameIn)
G4VtkVisContext vc
G4VtkPolydataInstancePipeline(G4String name, const G4VtkVisContext &vc)
vtkSmartPointer< vtkPoints > instancePosition
vtkSmartPointer< vtkDoubleArray > instanceColour
vtkSmartPointer< vtkDoubleArray > instanceTransform
vtkSmartPointer< vtkTensorGlyphColor > instanceTensorGlyph
vtkSmartPointer< vtkPolyDataAlgorithm > GetFinalFilter()
vtkSmartPointer< vtkActor > actor
vtkSmartPointer< vtkPolyDataMapper > mapper
virtual vtkSmartPointer< vtkActor > GetActor()
void AddFilter(vtkSmartPointer< vtkPolyDataAlgorithm > f)
vtkNew< vtkRenderer > renderer
const G4VtkViewer * fViewer

◆ ~G4VtkPolydataInstanceTensorPipeline()

G4VtkPolydataInstanceTensorPipeline::~G4VtkPolydataInstanceTensorPipeline ( )
overridedefault

Member Function Documentation

◆ MakeHash()

std::size_t G4VtkPolydataInstanceTensorPipeline::MakeHash ( const G4Polyhedron & p,
const G4VtkVisContext & vc )
static

Definition at line 40 of file G4VtkPolydataInstanceTensorPipeline.cc.

42{
43 // Get view parameters that the user can force through the vis attributes, thereby over-riding the
44 // current view parameter.
46
47 std::size_t vhash = 0;
48 std::hash_combine(vhash, static_cast<int>(drawing_style));
49
50 std::size_t phash = std::hash<G4Polyhedron>{}(polyhedron);
51
52 std::size_t hash = 0;
53 std::hash_combine(hash, phash);
54 std::hash_combine(hash, vhash);
55
56 return hash;
57}
G4ViewParameters::DrawingStyle fDrawingStyle
void hash_combine(std::size_t)

Referenced by G4VtkStore::AddPrimitiveTensorGlyph().

◆ Print()

void G4VtkPolydataInstanceTensorPipeline::Print ( )
overridevirtual

Reimplemented from G4VVtkPipeline.

Definition at line 101 of file G4VtkPolydataInstanceTensorPipeline.cc.

102{
103 G4cout << "G4VtkPolydataInstanceTensorPipeline " << GetName() << G4endl;
105}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4String GetName()

Member Data Documentation

◆ instancePolydata

vtkSmartPointer<vtkPolyData> G4VtkPolydataInstanceTensorPipeline::instancePolydata
protected

◆ instanceTensorGlyph

vtkSmartPointer<vtkTensorGlyphColor> G4VtkPolydataInstanceTensorPipeline::instanceTensorGlyph
protected

The documentation for this class was generated from the following files: