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

#include <G4VtkStore.hh>

Public Member Functions

 G4VtkStore (G4String name)
 
 ~G4VtkStore ()
 
void Modified ()
 
void Clear ()
 
void ClearNonG4 ()
 
void Print ()
 
void AddPrimitive (const G4Polyline &polyline, const G4VtkVisContext &vc)
 
void AddPrimitive (const G4Text &text, const G4VtkVisContext &vc)
 
void AddPrimitive (const G4Circle &circle, const G4VtkVisContext &vc)
 
void AddPrimitive (const G4Square &square, const G4VtkVisContext &vc)
 
void AddPrimitiveSeparate (const G4Polyhedron &polyhedron, const G4VtkVisContext &vc)
 
void AddPrimitiveTensorGlyph (const G4Polyhedron &polyhedron, const G4VtkVisContext &vc)
 
void AddPrimitiveAppend (const G4Polyhedron &polyhedron, const G4VtkVisContext &vc)
 
void AddPrimitiveTransformBake (const G4Polyhedron &polyhedron, const G4VtkVisContext &vc)
 
void AddCompound (const G4Mesh &mesh, const G4VtkVisContext &vc)
 
void UpdatePlanePipelines (G4String name, G4String type, const G4Plane3D)
 
void AddClipper (G4String name, const G4Plane3D &plane)
 
void UpdateClipper (G4String name, const G4Plane3D &plane)
 
void RemoveClipper (G4String name)
 
void AddCutter (G4String name, const G4Plane3D &plane)
 
void UpdateCutter (G4String name, const G4Plane3D &plane)
 
void RemoveCutter (G4String name)
 
void AddNonG4ObjectImage (const G4String &fileName, const G4VtkVisContext &vc)
 
void AddNonG4ObjectPolydata (const G4String fileName, const G4VtkVisContext &vc)
 
void GetBounds (G4double maxBound[6])
 
void AddToRenderer (vtkRenderer *renderer)
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataPolylinePipeline > > & GetPolylinePipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataPolyline2DPipeline > > & GetPolyline2DPipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataSpherePipeline > > & GetPolydataSpherePipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataPolygonPipeline > > & GetPolydataPolygonPipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataPipeline > > & GetSeparatePipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataInstanceTensorPipeline > > & GetTensorPipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataInstanceAppendPipeline > > & GetAppendPipeMap ()
 
std::map< std::size_t, std::shared_ptr< G4VtkPolydataInstanceBakePipeline > > & GetBakePipeMap ()
 

Detailed Description

Definition at line 97 of file G4VtkStore.hh.

Constructor & Destructor Documentation

◆ G4VtkStore()

G4VtkStore::G4VtkStore ( G4String name)

Definition at line 83 of file G4VtkStore.cc.

83: name(nameIn) {}
const char * name(G4int ptype)

◆ ~G4VtkStore()

G4VtkStore::~G4VtkStore ( )

Definition at line 85 of file G4VtkStore.cc.

86{
87 Clear();
88}
void Clear()

Member Function Documentation

◆ AddClipper()

void G4VtkStore::AddClipper ( G4String name,
const G4Plane3D & plane )

Definition at line 579 of file G4VtkStore.cc.

580{
581 for (const auto& v : separatePipeMap) {
582 auto clip_pl = new G4VtkClipClosedSurfacePipeline(nameIn, v.second->GetVtkVisContext(),
583 v.second->GetFinalFilter(), true);
584 clip_pl->SetPlane(plane);
585 v.second->AddChildPipeline(clip_pl);
586 }
587
588 for (const auto& v : tensorGlyphPipeMap) {
589 auto clip_pl = new G4VtkClipClosedSurfacePipeline(nameIn, v.second->GetVtkVisContext(),
590 v.second->GetFinalFilter());
591 clip_pl->SetPlane(plane);
592 v.second->AddChildPipeline(clip_pl);
593 }
594
595 for (const auto& v : appendPipeMap) {
596 auto clip_pl = new G4VtkClipClosedSurfacePipeline(nameIn, v.second->GetVtkVisContext(),
597 v.second->GetFinalFilter(), true);
598 clip_pl->SetPlane(plane);
599 v.second->AddChildPipeline(clip_pl);
600 }
601
602 for (const auto& v : bakePipeMap) {
603 auto clip_pl = new G4VtkClipClosedSurfacePipeline(nameIn, v.second->GetVtkVisContext(),
604 v.second->GetFinalFilter(), true);
605 clip_pl->SetPlane(plane);
606 v.second->AddChildPipeline(clip_pl);
607 }
608}

◆ AddCompound()

void G4VtkStore::AddCompound ( const G4Mesh & mesh,
const G4VtkVisContext & vc )

Definition at line 560 of file G4VtkStore.cc.

560 {
561 const auto& container = mesh.GetContainerVolume();
562 auto& containerName = const_cast<G4String&>(container->GetName());
563
564 auto pl = std::make_shared<G4VtkUnstructuredGridPipeline>(containerName,vc);
565 pl->SetUnstructuredGridData(mesh);
566 ugridPipeMap.insert(std::make_pair(G4String("test"), pl));
567}
G4VPhysicalVolume * GetContainerVolume() const
Definition G4Mesh.hh:73

Referenced by G4VtkSceneHandler::AddCompound().

◆ AddCutter()

void G4VtkStore::AddCutter ( G4String name,
const G4Plane3D & plane )

Definition at line 655 of file G4VtkStore.cc.

656{
657 for (const auto& v : separatePipeMap) {
658 auto cut_pl = new G4VtkCutterPipeline(nameIn, v.second->GetVtkVisContext(),
659 v.second->GetFinalFilter(), true);
660 cut_pl->SetPlane(plane);
661 v.second->AddChildPipeline(cut_pl);
662 }
663
664 for (const auto& v : tensorGlyphPipeMap) {
665 auto cut_pl =
666 new G4VtkCutterPipeline(nameIn, v.second->GetVtkVisContext(), v.second->GetFinalFilter());
667 cut_pl->SetPlane(plane);
668 v.second->AddChildPipeline(cut_pl);
669 }
670
671 for (const auto& v : appendPipeMap) {
672 auto cut_pl =
673 new G4VtkCutterPipeline(nameIn, v.second->GetVtkVisContext(), v.second->GetFinalFilter());
674 cut_pl->SetPlane(plane);
675 v.second->AddChildPipeline(cut_pl);
676 }
677
678 for (const auto& v : bakePipeMap) {
679 auto cut_pl =
680 new G4VtkCutterPipeline(nameIn, v.second->GetVtkVisContext(), v.second->GetFinalFilter());
681 cut_pl->SetPlane(plane);
682 v.second->AddChildPipeline(cut_pl);
683 }
684}

◆ AddNonG4ObjectImage()

void G4VtkStore::AddNonG4ObjectImage ( const G4String & fileName,
const G4VtkVisContext & vc )

Definition at line 731 of file G4VtkStore.cc.

732{
733 auto pl = std::make_shared<G4VtkImagePipeline>(G4String("name"), vc);
734 pl->SetImage(fileName);
735 imagePipeMap.insert(std::make_pair(fileName, pl));
736}

Referenced by G4VtkViewer::AddImageOverlay().

◆ AddNonG4ObjectPolydata()

void G4VtkStore::AddNonG4ObjectPolydata ( const G4String fileName,
const G4VtkVisContext & vc )

Definition at line 738 of file G4VtkStore.cc.

739{
740
742
743 if (fileName.find("obj") != G4String::npos) {
744 vtkNew<vtkOBJReader> objReader;
745 objReader->SetFileName(fileName.c_str());
746 objReader->Update();
747 pd = objReader->GetOutput();
748 }
749 else if (fileName.find("ply") != G4String::npos) {
750 vtkNew<vtkPLYReader> plyReader;
751 plyReader->SetFileName(fileName.c_str());
752 plyReader->Update();
753 pd = plyReader->GetOutput();
754 }
755 else if (fileName.find("stl") != G4String::npos) {
756 vtkNew<vtkSTLReader> stlReader;
757 stlReader->SetFileName(fileName.c_str());
758 stlReader->Update();
759 pd = stlReader->GetOutput();
760 }
761 else if (fileName.find("vtp") != G4String::npos && fileName.find("vtu") != G4String::npos) {
762 G4cout << "G4VtkStore::AddNonG4ObjectPolydata> vtp/vtu Warning not yet implemented" << G4endl;
763 }
764
765 auto pl = std::make_shared<G4VtkPolydataPipeline>(G4String("name"), vc);
766
767
768 G4Transform3D fInvObjTrans = vc.fTransform.inverse();
769 pl->SetPolydata(pd);
770 pl->SetActorTransform(vc.fTransform.dx(), vc.fTransform.dy(), vc.fTransform.dz(),
771 fInvObjTrans.xx(), fInvObjTrans.xy(), fInvObjTrans.xz(),
772 fInvObjTrans.yx(), fInvObjTrans.yy(), fInvObjTrans.yz(),
773 fInvObjTrans.zx(), fInvObjTrans.zy(), fInvObjTrans.zz());
774 pl->SetActorColour(vc.red, vc.green, vc.blue, vc.alpha);
775}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4Transform3D & fTransform
double dy() const
double zz() const
double yz() const
double dz() const
double dx() const
double xy() const
double zx() const
double yx() const
Transform3D inverse() const
double zy() const
double xx() const
double yy() const
double xz() const

Referenced by G4VtkViewer::AddGeometryOverlay().

◆ AddPrimitive() [1/4]

void G4VtkStore::AddPrimitive ( const G4Circle & circle,
const G4VtkVisContext & vc )

Definition at line 331 of file G4VtkStore.cc.

332{
334
335 if (vc.fProcessing2D) {
337 }
338 else {
340 }
341
342 // Get vis attributes - pick up defaults if none.
344
346 std::size_t hash = G4VtkPolydataSpherePipeline::MakeHash(pVA);
347 std::shared_ptr<G4VtkPolydataSpherePipeline> pl;
348
349 if (circlePipeMap.find(hash) == circlePipeMap.end()) {
350 // Create new pipeline
351 pl = std::make_shared<G4VtkPolydataSpherePipeline>(G4String("name"), vc, pVA);
352
353 // add to map
354 circlePipeMap.insert(std::make_pair(hash, pl));
355 }
356 else {
357 pl = circlePipeMap[hash];
358 }
359
360 // Data data point
362 G4Point3D posPrime = rot * circle.GetPosition();
363 pl->SetPolydataData(vc.fTransform.dx() + posPrime.x(), vc.fTransform.dy() + posPrime.y(),
364 vc.fTransform.dz() + posPrime.z());
365 }
366}
G4Point3D GetPosition() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4VisAttributes * GetVisAttributes() const
static std::size_t MakeHash(const G4VisAttributes *va)
const G4VtkViewer * fViewer
CLHEP::HepRotation getRotation() const

◆ AddPrimitive() [2/4]

void G4VtkStore::AddPrimitive ( const G4Polyline & polyline,
const G4VtkVisContext & vc )

Definition at line 254 of file G4VtkStore.cc.

255{
257 if (vc.fProcessing2D) {
259 }
260 else {
262 }
263
264 // Get vis attributes - pick up defaults if none.
266
268 std::size_t hash = G4VtkPolydataPolylinePipeline::MakeHash(pVA);
269 std::shared_ptr<G4VtkPolydataPolylinePipeline> pl;
270
271 if (polylinePipeMap.find(hash) == polylinePipeMap.end()) {
272 // Create new pipeline
273 pl = std::make_shared<G4VtkPolydataPolylinePipeline>(G4String("name"), vc, pVA);
274
275 // Add to map
276 polylinePipeMap.insert(std::make_pair(hash, pl));
277 }
278 else {
279 pl = polylinePipeMap[hash];
280 }
281 pl->SetPolydata(polyline);
282 }
283
284 else if (sizeType == G4VSceneHandler::MarkerSizeType::screen) {
285 std::size_t hash = G4VtkPolydataPolyline2DPipeline::MakeHash(pVA);
286 std::shared_ptr<G4VtkPolydataPolyline2DPipeline> pl;
287
288 if (polyline2DPipeMap.find(hash) == polyline2DPipeMap.end()) {
289 // Create new pipeline
290 pl = std::make_shared<G4VtkPolydataPolyline2DPipeline>(G4String("name"), vc, pVA);
291
292 // Add to map
293 polyline2DPipeMap.insert(std::make_pair(hash, pl));
294 }
295 else {
296 pl = polyline2DPipeMap[hash];
297 }
298 pl->SetPolydata(polyline);
299 }
300}
static std::size_t MakeHash(const G4VisAttributes *va)
static std::size_t MakeHash(const G4VisAttributes *va)

Referenced by G4VtkSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), and G4VtkSceneHandler::AddPrimitive().

◆ AddPrimitive() [3/4]

void G4VtkStore::AddPrimitive ( const G4Square & square,
const G4VtkVisContext & vc )

Definition at line 368 of file G4VtkStore.cc.

369{
371
372 if (vc.fProcessing2D) {
374 }
375 else {
377 }
378
379 // Get vis attributes - pick up defaults if none.
381
383 std::size_t hash = std::hash<G4VisAttributes>{}(*pVA);
384
385 std::shared_ptr<G4VtkPolydataPolygonPipeline> pl;
386 if (squarePipeMap.find(hash) == squarePipeMap.end()) {
387 // Create new pipeline
388 pl = std::make_shared<G4VtkPolydataPolygonPipeline>(G4String("name"), vc, pVA);
389
390 // add to map
391 squarePipeMap.insert(std::make_pair(hash, pl));
392 }
393 else {
394 pl = squarePipeMap[hash];
395 }
396
397 // Data data point
399 G4Point3D posPrime = rot * square.GetPosition();
400 pl->SetPolydataData(vc.fTransform.dx() + posPrime.x(), vc.fTransform.dy() + posPrime.y(),
401 vc.fTransform.dz() + posPrime.z());
402 }
403}

◆ AddPrimitive() [4/4]

void G4VtkStore::AddPrimitive ( const G4Text & text,
const G4VtkVisContext & vc )

Definition at line 302 of file G4VtkStore.cc.

303{
305 if (vc.fProcessing2D) {
307 }
308 else {
310 }
311
313
314 switch (sizeType) {
315 default:
317 std::size_t hash = G4VtkTextPipeline::MakeHash(text, vc, pVA);
318 auto pl = std::make_shared<G4VtkText2DPipeline>(text, vc, pVA);
319 text2DPipeMap.insert(std::make_pair(hash, pl));
320 break;
321 }
323 std::size_t hash = G4VtkTextPipeline::MakeHash(text, vc, pVA);
324 auto pl = std::make_shared<G4VtkTextPipeline>(text, vc, pVA);
325 textPipeMap.insert(std::make_pair(hash, pl));
326 break;
327 }
328 }
329}
static std::size_t MakeHash(const G4Text &text, const G4VtkVisContext &vc, const G4VisAttributes *pVA)

◆ AddPrimitiveAppend()

void G4VtkStore::AddPrimitiveAppend ( const G4Polyhedron & polyhedron,
const G4VtkVisContext & vc )

Definition at line 473 of file G4VtkStore.cc.

474{
475 // Empty polyhedron
476 if (polyhedron.GetNoFacets() == 0) {
477 return;
478 }
479
480 // Possible the polyhedron already has a transform baked in (definitely the case
481 // for scoring meshes. Remove them here
482 auto centre = polyhedron.vertexUnweightedMean();
483 auto transform = G4Translate3D(-centre.x(), -centre.y(), -centre.z());
484
485 auto polyhedronNew = G4Polyhedron(polyhedron);
486 auto fTransformNew = G4Transform3D(vc.fTransform*transform.inverse());
487
488 polyhedronNew.Transform(transform);
489
490 auto hash = G4VtkPolydataInstanceAppendPipeline::MakeHash(polyhedronNew, vc);
491 std::shared_ptr<G4VtkPolydataInstanceAppendPipeline> pl;
492
493 if (appendPipeMap.find(hash) == appendPipeMap.end()) {
494 pl = std::make_shared<G4VtkPolydataInstanceAppendPipeline>(G4String("name"), vc);
495 pl->SetPolydata(polyhedronNew);
496 appendPipeMap.insert(std::make_pair(hash, pl));
497 }
498 else {
499 pl = appendPipeMap[hash];
500 }
501
502 G4Transform3D fInvObjTrans = fTransformNew.inverse();
503
504 pl->addInstance(fTransformNew.dx(), fTransformNew.dy(), fTransformNew.dz(),
505 fInvObjTrans.xx(), fInvObjTrans.xy(), fInvObjTrans.xz(),
506 fInvObjTrans.yx(), fInvObjTrans.yy(), fInvObjTrans.yz(),
507 fInvObjTrans.zx(), fInvObjTrans.zy(), fInvObjTrans.zz(),
508 0, 0, 0, 0, G4String("null"));
509};
HepGeom::Transform3D G4Transform3D
HepGeom::Translate3D G4Translate3D
static std::size_t MakeHash(const G4Polyhedron &p, const G4VtkVisContext &vc)
G4Point3D vertexUnweightedMean() const
G4int GetNoFacets() const

Referenced by G4VtkSceneHandler::AddPrimitive().

◆ AddPrimitiveSeparate()

void G4VtkStore::AddPrimitiveSeparate ( const G4Polyhedron & polyhedron,
const G4VtkVisContext & vc )

Definition at line 405 of file G4VtkStore.cc.

406{
407 // Return if empty polyhedron
408 if (polyhedron.GetNoFacets() == 0) {
409 return;
410 }
411
412 auto hash = G4VtkPolydataPipeline::MakeHash(polyhedron, vc);
413
414 auto pl = std::make_shared<G4VtkPolydataPipeline>(G4String("name"), vc);
415 pl->SetPolydata(polyhedron);
416
417 separatePipeMap.insert(std::make_pair(hash, pl));
418
419 const G4VisAttributes* pVA =
421 G4Color colour = pVA->GetColour();
422 G4Transform3D fInvObjTrans = vc.fTransform.inverse();
423
424 pl->SetActorTransform(vc.fTransform.dx(), vc.fTransform.dy(), vc.fTransform.dz(),
425 fInvObjTrans.xx(), fInvObjTrans.xy(), fInvObjTrans.xz(),
426 fInvObjTrans.yx(), fInvObjTrans.yy(), fInvObjTrans.yz(),
427 fInvObjTrans.zx(), fInvObjTrans.zy(), fInvObjTrans.zz());
428 pl->SetActorColour(colour.GetRed(), colour.GetGreen(), colour.GetBlue(), colour.GetAlpha());
429}
G4double GetBlue() const
Definition G4Colour.hh:154
G4double GetAlpha() const
Definition G4Colour.hh:155
G4double GetRed() const
Definition G4Colour.hh:152
G4double GetGreen() const
Definition G4Colour.hh:153
const G4Colour & GetColour() const
static std::size_t MakeHash(const G4Polyhedron &p, const G4VtkVisContext &vc)

Referenced by G4VtkSceneHandler::AddPrimitive().

◆ AddPrimitiveTensorGlyph()

void G4VtkStore::AddPrimitiveTensorGlyph ( const G4Polyhedron & polyhedron,
const G4VtkVisContext & vc )

Definition at line 431 of file G4VtkStore.cc.

432{
433 // Return if empty polyhedron
434 if (polyhedron.GetNoFacets() == 0) {
435 return;
436 }
437
438 // Possible the polyhedron already has a transform baked in (definitely the case
439 // for scoring meshes. Remove them here
440 auto centre = polyhedron.vertexUnweightedMean();
441 auto transform = G4Translate3D(-centre.x(), -centre.y(), -centre.z());
442
443 auto polyhedronNew = G4Polyhedron(polyhedron);
444 auto fTransformNew = G4Transform3D(vc.fTransform*transform.inverse());
445
446 polyhedronNew.Transform(transform);
447
448 auto hash = G4VtkPolydataInstanceTensorPipeline::MakeHash(polyhedronNew, vc);
449 std::shared_ptr<G4VtkPolydataInstanceTensorPipeline> pl;
450
451 if (tensorGlyphPipeMap.find(hash) == tensorGlyphPipeMap.end()) {
452 pl = std::make_shared<G4VtkPolydataInstanceTensorPipeline>(G4String("name"), vc);
453 pl->SetPolydata(polyhedronNew);
454 tensorGlyphPipeMap.insert(std::make_pair(hash, pl));
455 }
456 else {
457 pl = tensorGlyphPipeMap[hash];
458 }
459
460 G4Transform3D fInvObjTrans = fTransformNew.inverse();
461 const G4VisAttributes* pVA =
463 G4Color colour = pVA->GetColour();
464
465 pl->addInstance(fTransformNew.dx(), fTransformNew.dy(), fTransformNew.dz(),
466 fInvObjTrans.xx(), fInvObjTrans.xy(), fInvObjTrans.xz(),
467 fInvObjTrans.yx(), fInvObjTrans.yy(), fInvObjTrans.yz(),
468 fInvObjTrans.zx(), fInvObjTrans.zy(), fInvObjTrans.zz(),
469 colour.GetRed(), colour.GetGreen(), colour.GetBlue(), colour.GetAlpha(),
470 G4String("null"));
471}
static std::size_t MakeHash(const G4Polyhedron &p, const G4VtkVisContext &vc)

Referenced by G4VtkSceneHandler::AddPrimitive().

◆ AddPrimitiveTransformBake()

void G4VtkStore::AddPrimitiveTransformBake ( const G4Polyhedron & polyhedron,
const G4VtkVisContext & vc )

Definition at line 511 of file G4VtkStore.cc.

513{
514 // Empty polyhedron
515 if (polyhedron.GetNoFacets() == 0) {
516 return;
517 }
518
519 // Possible the polyhedron already has a transform baked in (definitely the case
520 // for scoring meshes. Remove them here
521 auto centre = polyhedron.vertexUnweightedMean();
522 auto transform = G4Translate3D(-centre.x(), -centre.y(), -centre.z());
523
524 auto polyhedronNew = G4Polyhedron(polyhedron);
525 auto fTransformNew = G4Transform3D(vc.fTransform*transform.inverse());
526
527 polyhedronNew.Transform(transform);
528
529 // Get vis attributes - pick up defaults if none.
530 const G4VisAttributes* pVA =
532
533 // Polyhedron colour
534 G4Colour colour = pVA->GetColour();
535
536 // Hash the vis (alpha) attributes and polyhedron
537 std::size_t hash = G4VtkPolydataInstanceBakePipeline::MakeHash(polyhedronNew, vc);
538
539 std::shared_ptr<G4VtkPolydataInstanceBakePipeline> pl;
540 if (bakePipeMap.find(hash) == bakePipeMap.end()) {
541 pl = std::make_shared<G4VtkPolydataInstanceBakePipeline>(G4String("none"), vc);
542
543 bakePipeMap.insert(std::make_pair(hash, pl));
544 }
545 else {
546 pl = bakePipeMap[hash];
547 }
548
549 G4Transform3D fInvObjTrans = fTransformNew.inverse();
550 pl->SetPolydata(polyhedronNew);
551
552 pl->addInstance(fTransformNew.dx(), fTransformNew.dy(), fTransformNew.dz(),
553 fInvObjTrans.xx(), fInvObjTrans.xy(), fInvObjTrans.xz(),
554 fInvObjTrans.yx(), fInvObjTrans.yy(), fInvObjTrans.yz(),
555 fInvObjTrans.zx(), fInvObjTrans.zy(), fInvObjTrans.zz(),
556 colour.GetRed(), colour.GetGreen(), colour.GetBlue(), colour.GetAlpha(),
557 G4String("null"));
558};
static std::size_t MakeHash(const G4Polyhedron &p, const G4VtkVisContext &vc)

Referenced by G4VtkSceneHandler::AddPrimitive().

◆ AddToRenderer()

void G4VtkStore::AddToRenderer ( vtkRenderer * renderer)

Definition at line 809 of file G4VtkStore.cc.

810{
811 for (const auto& it : polylinePipeMap)
812 renderer->AddActor(it.second->GetActor());
813 for (const auto& it : polyline2DPipeMap)
814 renderer->AddActor(it.second->GetActor());
815 for (const auto& it : circlePipeMap)
816 renderer->AddActor(it.second->GetActor());
817 for (const auto& it : squarePipeMap)
818 renderer->AddActor(it.second->GetActor());
819 for (const auto& it : textPipeMap)
820 renderer->AddActor(it.second->GetActor());
821 for (const auto& it : text2DPipeMap)
822 renderer->AddActor(it.second->GetActor());
823 for (const auto& it : separatePipeMap)
824 renderer->AddActor(it.second->GetActor());
825 for (const auto& it : tensorGlyphPipeMap)
826 renderer->AddActor(it.second->GetActor());
827 for (const auto& it : appendPipeMap)
828 renderer->AddActor(it.second->GetActor());
829 for (const auto& it : bakePipeMap)
830 renderer->AddActor(it.second->GetActor());
831}

Referenced by G4VtkViewer::ExportFormatStore().

◆ Clear()

void G4VtkStore::Clear ( )

Definition at line 127 of file G4VtkStore.cc.

128{
129#ifdef G4VTKDEBUG
130 G4cout << "G4VtkStore::Clear() " << name << G4endl;
131#endif
132
133 for (const auto& v : polylinePipeMap) {
134 v.second->Clear();
135 }
136 polylinePipeMap.clear();
137
138 for (const auto& v : polyline2DPipeMap) {
139 v.second->Clear();
140 }
141 polyline2DPipeMap.clear();
142
143 for (const auto& v : circlePipeMap) {
144 v.second->Clear();
145 }
146 circlePipeMap.clear();
147
148 for (const auto& v : squarePipeMap) {
149 v.second->Clear();
150 }
151 squarePipeMap.clear();
152
153 for (const auto& v : textPipeMap) {
154 v.second->Clear();
155 }
156 textPipeMap.clear();
157
158 for (const auto& v : text2DPipeMap) {
159 v.second->Clear();
160 }
161 text2DPipeMap.clear();
162
163 for (const auto& v : separatePipeMap) {
164 v.second->Clear();
165 }
166 separatePipeMap.clear();
167
168 for (const auto& v : tensorGlyphPipeMap) {
169 v.second->Clear();
170 }
171 tensorGlyphPipeMap.clear();
172
173 for (const auto& v : appendPipeMap) {
174 v.second->Clear();
175 }
176 appendPipeMap.clear();
177
178 for (const auto& v : bakePipeMap) {
179 v.second->Clear();
180 }
181 bakePipeMap.clear();
182}

Referenced by G4VtkSceneHandler::ClearStore(), G4VtkSceneHandler::ClearTransientStore(), G4VtkViewer::ClearView(), and ~G4VtkStore().

◆ ClearNonG4()

void G4VtkStore::ClearNonG4 ( )

Definition at line 184 of file G4VtkStore.cc.

185{
186#ifdef G4VTKDEBUG
187 G4cout << "G4VtkStore::Clear() " << name << G4endl;
188#endif
189
190 for (const auto& v : imagePipeMap) {
191 v.second->Clear();
192 }
193 imagePipeMap.clear();
194
195 for (const auto& v : sideloadPipeMap) {
196 v.second->Clear();
197 }
198 sideloadPipeMap.clear();
199}

Referenced by G4VtkMessenger::SetNewValue().

◆ GetAppendPipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataInstanceAppendPipeline > > & G4VtkStore::GetAppendPipeMap ( )
inline

Definition at line 160 of file G4VtkStore.hh.

161 {
162 return appendPipeMap;
163 }

◆ GetBakePipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataInstanceBakePipeline > > & G4VtkStore::GetBakePipeMap ( )
inline

Definition at line 164 of file G4VtkStore.hh.

165 {
166 return bakePipeMap;
167 }

◆ GetBounds()

void G4VtkStore::GetBounds ( G4double maxBound[6])

Definition at line 777 of file G4VtkStore.cc.

778{
779 G4double maxBound[6] = {1e99, -1e99, 1e99, -1e99, 1e99, -1e99};
780
781 for (const auto& v : separatePipeMap) {
782 auto b = v.second->GetBounds();
783 MaxBounds(maxBound, b);
784 }
785
786 for (const auto& v : tensorGlyphPipeMap) {
787 auto b = v.second->GetBounds();
788 MaxBounds(maxBound, b);
789 }
790
791 for (const auto& v : appendPipeMap) {
792 auto b = v.second->GetBounds();
793 MaxBounds(maxBound, b);
794 }
795
796 for (const auto& v : bakePipeMap) {
797 auto b = v.second->GetBounds();
798 MaxBounds(maxBound, b);
799 }
800
801 maxBoundIn[0] = maxBound[0];
802 maxBoundIn[1] = maxBound[1];
803 maxBoundIn[2] = maxBound[2];
804 maxBoundIn[3] = maxBound[3];
805 maxBoundIn[4] = maxBound[4];
806 maxBoundIn[5] = maxBound[5];
807}
double G4double
Definition G4Types.hh:83
void MaxBounds(G4double *maxBound, G4double *boundToCheck)

Referenced by G4VtkViewer::AddClipperPlaneWidget(), and G4VtkViewer::AddCutterPlaneWidget().

◆ GetPolydataPolygonPipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataPolygonPipeline > > & G4VtkStore::GetPolydataPolygonPipeMap ( )
inline

Definition at line 148 of file G4VtkStore.hh.

149 {
150 return squarePipeMap;
151 }

◆ GetPolydataSpherePipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataSpherePipeline > > & G4VtkStore::GetPolydataSpherePipeMap ( )
inline

Definition at line 143 of file G4VtkStore.hh.

144 {
145 return circlePipeMap;
146 }

◆ GetPolyline2DPipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataPolyline2DPipeline > > & G4VtkStore::GetPolyline2DPipeMap ( )
inline

Definition at line 139 of file G4VtkStore.hh.

140 {
141 return polyline2DPipeMap;
142 }

◆ GetPolylinePipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataPolylinePipeline > > & G4VtkStore::GetPolylinePipeMap ( )
inline

Definition at line 135 of file G4VtkStore.hh.

136 {
137 return polylinePipeMap;
138 }

◆ GetSeparatePipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataPipeline > > & G4VtkStore::GetSeparatePipeMap ( )
inline

Definition at line 152 of file G4VtkStore.hh.

153 {
154 return separatePipeMap;
155 }

Referenced by G4VtkViewer::ExportVTPCutter().

◆ GetTensorPipeMap()

std::map< std::size_t, std::shared_ptr< G4VtkPolydataInstanceTensorPipeline > > & G4VtkStore::GetTensorPipeMap ( )
inline

Definition at line 156 of file G4VtkStore.hh.

157 {
158 return tensorGlyphPipeMap;
159 }

◆ Modified()

void G4VtkStore::Modified ( )

Definition at line 90 of file G4VtkStore.cc.

91{
92#ifdef G4VTKDEBUG
93 G4cout << "G4VtkStore::Modified() " << name << G4endl;
94#endif
95
96 for (const auto& it : polylinePipeMap)
97 it.second->Modified();
98
99 for (const auto& it : polyline2DPipeMap)
100 it.second->Modified();
101
102 for (const auto& it : circlePipeMap)
103 it.second->Modified();
104
105 for (const auto& it : squarePipeMap)
106 it.second->Modified();
107
108 for (const auto& it : textPipeMap)
109 it.second->Modified();
110
111 for (const auto& it : text2DPipeMap)
112 it.second->Modified();
113
114 for (const auto& it : separatePipeMap)
115 it.second->Modified();
116
117 for (const auto& it : tensorGlyphPipeMap)
118 it.second->Modified();
119
120 for (const auto& it : appendPipeMap)
121 it.second->Modified();
122
123 for (const auto& it : bakePipeMap)
124 it.second->Modified();
125}

Referenced by G4VtkSceneHandler::Modified().

◆ Print()

void G4VtkStore::Print ( )

Definition at line 201 of file G4VtkStore.cc.

202{
203 G4cout << "G4VtkStore::Print() " << name << std::endl;
204 G4cout << "G4VtkStore::Print() polylinePipeMap size > " << polylinePipeMap.size()
205 << G4endl;
206 G4cout << "G4VtkStore::Print() polyline2DPipeMap size > " << polyline2DPipeMap.size()
207 << G4endl;
208 G4cout << "G4VtkStore::Print() circlePipeMap size > " << circlePipeMap.size() << G4endl;
209 G4cout << "G4VtkStore::Print() squarePipeMap size > " << squarePipeMap.size() << G4endl;
210 G4cout << "G4VtkStore::Print() textPipeMap size > " << textPipeMap.size() << G4endl;
211 G4cout << "G4VtkStore::Print() text2DPipeMap size > " << text2DPipeMap.size() << G4endl;
212 G4cout << "G4VtkStore::Print() separatePipeMap size > " << separatePipeMap.size()
213 << G4endl;
214 G4cout << "G4VtkStore::Print() tensorGlyphPipeMap size > " << tensorGlyphPipeMap.size()
215 << G4endl;
216 G4cout << "G4VtkStore::Print() transformAppendPipeMap size > " << appendPipeMap.size() << G4endl;
217 G4cout << "G4VtkStore::Print() bakePipeMap size > " << bakePipeMap.size() << G4endl;
218 G4cout << "G4VtkStore::Print() ugridPipeMap size > " << ugridPipeMap.size() << G4endl;
219 G4cout << "G4VtkStore::Print() imagePipeMap size > " << imagePipeMap.size() << G4endl;
220
221 for (const auto& it : polylinePipeMap)
222 it.second->Print();
223
224 for (const auto& it : polyline2DPipeMap)
225 it.second->Print();
226
227 for (const auto& it : circlePipeMap)
228 it.second->Print();
229
230 for (const auto& it : squarePipeMap)
231 it.second->Print();
232
233 for (const auto& it : separatePipeMap)
234 it.second->Print();
235
236 for (const auto& it : tensorGlyphPipeMap)
237 it.second->Print();
238
239 for (const auto& it : appendPipeMap)
240 it.second->Print();
241
242 for (const auto& it : bakePipeMap)
243 it.second->Print();
244
245 for (const auto& it : ugridPipeMap) {
246 G4cout << it.first << G4endl;
247 it.second->Print();
248 }
249
250 for (const auto& it : imagePipeMap)
251 it.second->Print();
252}

Referenced by G4VtkViewer::Print().

◆ RemoveClipper()

void G4VtkStore::RemoveClipper ( G4String name)

Definition at line 653 of file G4VtkStore.cc.

653{}

Referenced by G4VtkViewer::DisableClipper().

◆ RemoveCutter()

void G4VtkStore::RemoveCutter ( G4String name)

Definition at line 729 of file G4VtkStore.cc.

729{}

Referenced by G4VtkViewer::DisableCutter().

◆ UpdateClipper()

void G4VtkStore::UpdateClipper ( G4String name,
const G4Plane3D & plane )

Definition at line 610 of file G4VtkStore.cc.

611{
612 for (const auto& v : separatePipeMap) {
613 auto children = v.second->GetChildPipelines();
614 for (auto c : children) {
615 if (c->GetName() == nameIn) {
616 auto cc = dynamic_cast<G4VtkClipClosedSurfacePipeline*>(c);
617 cc->SetPlane(plane);
618 }
619 }
620 }
621
622 for (const auto& v : tensorGlyphPipeMap) {
623 auto children = v.second->GetChildPipelines();
624 for (auto c : children) {
625 if (c->GetName() == nameIn) {
626 auto cc = dynamic_cast<G4VtkClipClosedSurfacePipeline*>(c);
627 cc->SetPlane(plane);
628 }
629 }
630 }
631
632 for (const auto& v : appendPipeMap) {
633 auto children = v.second->GetChildPipelines();
634 for (auto c : children) {
635 if (c->GetName() == nameIn) {
636 auto cc = dynamic_cast<G4VtkClipClosedSurfacePipeline*>(c);
637 cc->SetPlane(plane);
638 }
639 }
640 }
641
642 for (const auto& v : bakePipeMap) {
643 auto children = v.second->GetChildPipelines();
644 for (auto c : children) {
645 if (c->GetName() == nameIn) {
646 auto cc = dynamic_cast<G4VtkClipClosedSurfacePipeline*>(c);
647 cc->SetPlane(plane);
648 }
649 }
650 }
651}

Referenced by UpdatePlanePipelines().

◆ UpdateCutter()

void G4VtkStore::UpdateCutter ( G4String name,
const G4Plane3D & plane )

Definition at line 686 of file G4VtkStore.cc.

687{
688 for (const auto& v : separatePipeMap) {
689 auto children = v.second->GetChildPipelines();
690 for (auto c : children) {
691 if (c->GetName() == nameIn) {
692 auto cc = dynamic_cast<G4VtkCutterPipeline*>(c);
693 cc->SetPlane(plane);
694 }
695 }
696 }
697
698 for (const auto& v : tensorGlyphPipeMap) {
699 auto children = v.second->GetChildPipelines();
700 for (auto c : children) {
701 if (c->GetName() == nameIn) {
702 auto cc = dynamic_cast<G4VtkCutterPipeline*>(c);
703 cc->SetPlane(plane);
704 }
705 }
706 }
707
708 for (const auto& v : appendPipeMap) {
709 auto children = v.second->GetChildPipelines();
710 for (auto c : children) {
711 if (c->GetName() == nameIn) {
712 auto cc = dynamic_cast<G4VtkCutterPipeline*>(c);
713 cc->SetPlane(plane);
714 }
715 }
716 }
717
718 for (const auto& v : bakePipeMap) {
719 auto children = v.second->GetChildPipelines();
720 for (auto c : children) {
721 if (c->GetName() == nameIn) {
722 auto cc = dynamic_cast<G4VtkCutterPipeline*>(c);
723 cc->SetPlane(plane);
724 }
725 }
726 }
727}
void SetPlane(const G4Plane3D &plane)

Referenced by UpdatePlanePipelines().

◆ UpdatePlanePipelines()

void G4VtkStore::UpdatePlanePipelines ( G4String name,
G4String type,
const G4Plane3D plane )

Definition at line 569 of file G4VtkStore.cc.

570{
571 if (type == "clipper") {
572 UpdateClipper(nameIn, plane);
573 }
574 else if (type == "cutter") {
575 UpdateCutter(nameIn, plane);
576 }
577}
void UpdateCutter(G4String name, const G4Plane3D &plane)
void UpdateClipper(G4String name, const G4Plane3D &plane)

Referenced by vtkIPWCallback::Execute().


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