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

Method GetAtomPosition

Common/DataModel/vtkMolecule.cxx:200–213  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

198
199//------------------------------------------------------------------------------
200vtkVector3f vtkMolecule::GetAtomPosition(vtkIdType id)
201{
202 assert(id >= 0 && id < this->GetNumberOfAtoms());
203 vtkDataArray* positions = this->Points->GetData();
204 auto positionsF = vtkArrayDownCast<vtkFloatArray>(positions);
205 if (positionsF)
206 {
207 float* data = positionsF->GetPointer(id * 3);
208 return vtkVector3f(data);
209 }
210
211 auto point = positions->GetTuple3(id);
212 return vtkVector3f(point[0], point[1], point[2]);
213}
214
215//------------------------------------------------------------------------------
216void vtkMolecule::GetAtomPosition(vtkIdType id, float pos[3])

Callers 3

RunFunction · 0.80
GetLengthMethod · 0.80
GetPositionMethod · 0.80

Calls 9

GetNumberOfAtomsMethod · 0.95
GetTuple3Method · 0.80
GetZMethod · 0.80
vtkVector3fClass · 0.70
assertFunction · 0.50
GetDataMethod · 0.45
GetPointerMethod · 0.45
GetXMethod · 0.45
GetPointMethod · 0.45

Tested by 1

RunFunction · 0.64