MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / updateAtomSelectionDebug

Function updateAtomSelectionDebug

App/debug/UpdateDebugData.cpp:27–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void updateAtomSelectionDebug(const DebugViews& debugViews, const Lattice::Simulation& simulation) {
28 const AtomStorage& atoms = simulation.atoms();
29 const auto& selectedAtomIds = ToolsManager::pickingSystem->getSelectedAtomIds();
30 if (selectedAtomIds.size() == 1) {
31 debugViews.atomSingle->visible = true;
32 debugViews.atomBatch->visible = false;
33 const size_t selectedIndex = atoms.indexOf(*selectedAtomIds.begin());
34 if (selectedIndex < atoms.size()) {
35 debugViews.atomSingle->add_data("Позиция", atoms.pos(selectedIndex));
36 const float speed = glm::length(atoms.vel(selectedIndex));
37 debugViews.atomSingle->add_data("Скорость (A/dt)", speed);
38 debugViews.atomSingle->add_data("Скорость (м/с)", speed * Units::SpeedUnitToMps);
39 debugViews.atomSingle->add_data("Скорость (км/ч)", speed * Units::SpeedUnitToKmph);
40 debugViews.atomSingle->add_data("Силы", atoms.force(selectedIndex));
41 debugViews.atomSingle->add_data("Пред. силы", atoms.prevForce(selectedIndex));
42 debugViews.atomSingle->add_data("Потенциальная энергия", atoms.energy(selectedIndex));
43 const AtomData::Type atomType = atoms.type(selectedIndex);
44 debugViews.atomSingle->add_data("Масса", AtomData::getProps(atomType).mass);
45 debugViews.atomSingle->add_data("Радиус", AtomData::getProps(atomType).radius);
46 debugViews.atomSingle->add_data("Тип", static_cast<int>(atomType));
47 }
48 }
49 else {
50 debugViews.atomBatch->visible = true;
51 debugViews.atomSingle->visible = false;
52 debugViews.atomBatch->add_data("Выбрано атомов", selectedAtomIds.size());
53 }
54}
55
56void updateSimulationDebug(const DebugViews& debugViews, const Lattice::Simulation& simulation, std::string_view integratorName) {
57 struct StepsRateSample {

Callers 1

refreshAtomDebugViewsFunction · 0.85

Calls 7

indexOfMethod · 0.80
add_dataMethod · 0.80
posMethod · 0.80
velMethod · 0.80
forceMethod · 0.80
prevForceMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected