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

Method Initialize

Common/DataModel/vtkMolecule.cxx:42–79  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

40
41//------------------------------------------------------------------------------
42void vtkMolecule::Initialize()
43{
44 // Reset underlying data structure
45 this->Superclass::Initialize();
46
47 // Setup vertex data
48 vtkDataSetAttributes* vertData = this->GetVertexData();
49 vertData->AllocateArrays(1); // atomic nums
50
51 // Atomic numbers
52 this->SetAtomicNumberArrayName("Atomic Numbers");
53 vtkNew<vtkUnsignedShortArray> atomicNums;
54 atomicNums->SetNumberOfComponents(1);
55 atomicNums->SetName(this->GetAtomicNumberArrayName());
56 vertData->SetScalars(atomicNums);
57
58 // Nuclear coordinates
59 vtkPoints* points = vtkPoints::New();
60 this->SetPoints(points);
61 points->Delete();
62
63 // Setup edge data
64 vtkDataSetAttributes* edgeData = this->GetEdgeData();
65 edgeData->AllocateArrays(1); // Bond orders
66
67 this->SetBondOrdersArrayName("Bond Orders");
68 vtkNew<vtkUnsignedShortArray> bondOrders;
69 bondOrders->SetNumberOfComponents(1);
70 bondOrders->SetName(this->GetBondOrdersArrayName());
71 edgeData->SetScalars(bondOrders);
72
73 this->UpdateBondList();
74
75 // Electronic data
76 this->SetElectronicData(nullptr);
77
78 this->Modified();
79}
80
81//------------------------------------------------------------------------------
82vtkMolecule::~vtkMolecule()

Callers 1

vtkMoleculeMethod · 0.95

Calls 15

UpdateBondListMethod · 0.95
GetVertexDataMethod · 0.80
SetScalarsMethod · 0.80
GetEdgeDataMethod · 0.80
SetTuple1Method · 0.80
GetTuple1Method · 0.80
ForceOwnershipMethod · 0.80
GetAtomicNumberArrayMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
stringClass · 0.50
AllocateArraysMethod · 0.45

Tested by

no test coverage detected