MCPcopy Create free account
hub / github.com/Kitware/VTK / CopyInternal

Method CopyInternal

Common/DataModel/vtkGraph.cxx:641–717  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

639
640//------------------------------------------------------------------------------
641void vtkGraph::CopyInternal(vtkGraph* g, bool deep)
642{
643 if (deep)
644 {
645 vtkDataObject::DeepCopy(g);
646 }
647 else
648 {
649 vtkDataObject::ShallowCopy(g);
650 }
651 if (g->DistributedHelper)
652 {
653 if (!this->DistributedHelper)
654 {
655 this->SetDistributedGraphHelper(g->DistributedHelper->Clone());
656 }
657 }
658 else if (this->DistributedHelper)
659 {
660 this->SetDistributedGraphHelper(nullptr);
661 }
662
663 // Copy on write.
664 this->SetInternals(g->Internals);
665
666 if (deep)
667 {
668 this->EdgeData->DeepCopy(g->EdgeData);
669 this->VertexData->DeepCopy(g->VertexData);
670 this->DeepCopyEdgePoints(g);
671 }
672 else
673 {
674 this->EdgeData->ShallowCopy(g->EdgeData);
675 this->VertexData->ShallowCopy(g->VertexData);
676 this->ShallowCopyEdgePoints(g);
677 }
678
679 // Copy points
680 if (g->Points && deep)
681 {
682 if (!this->Points)
683 {
684 this->Points = vtkPoints::New();
685 }
686 this->Points->DeepCopy(g->Points);
687 }
688 else
689 {
690 this->SetPoints(g->Points);
691 }
692
693 // Copy edge list
694 this->Internals->NumberOfEdges = g->Internals->NumberOfEdges;
695 if (g->EdgeList && deep)
696 {
697 if (!this->EdgeList)
698 {

Callers 6

CheckedShallowCopyMethod · 0.95
CheckedDeepCopyMethod · 0.95
ShallowCopyMethod · 0.95
DeepCopyMethod · 0.95
ToDirectedGraphMethod · 0.80
ToUndirectedGraphMethod · 0.80

Calls 13

DeepCopyEdgePointsMethod · 0.95
ShallowCopyEdgePointsMethod · 0.95
BuildEdgeListMethod · 0.95
DeepCopyFunction · 0.70
ShallowCopyFunction · 0.70
NewFunction · 0.50
CloneMethod · 0.45
DeepCopyMethod · 0.45
ShallowCopyMethod · 0.45
SetPointsMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected