• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paulmthompson / WhiskerToolbox / 17826420298

18 Sep 2025 02:24AM UTC coverage: 71.942% (-0.002%) from 71.944%
17826420298

push

github

paulmthompson
Merge branch 'main' of https://github.com/paulmthompson/WhiskerToolbox

110 of 158 new or added lines in 12 files covered. (69.62%)

222 existing lines in 9 files now uncovered.

39625 of 55079 relevant lines covered (71.94%)

1301.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.0
/src/WhiskerToolbox/Analysis_Dashboard/Visualizers/Points/PointDataVisualization.cpp
1
#include "PointDataVisualization.hpp"
2

3
#include "DataManager/Points/Point_Data.hpp"
4
#include "DataManager/Points/utils/Point_Data_utils.hpp"
5
#include "GroupManagementWidget/GroupManager.hpp"
6

7
#include <QOpenGLShaderProgram>
8

9
PointDataVisualization::PointDataVisualization(QString const & data_key,
26✔
10
                                               std::shared_ptr<PointData> const & point_data,
11
                                               GroupManager * group_manager)
26✔
12
    : GenericPointVisualization<EntityId>(data_key, group_manager),
13
      m_point_data(point_data) {
26✔
14

15
    populateData();
26✔
16
}
26✔
17

18
void PointDataVisualization::populateData() {
26✔
19
    if (!m_point_data) {
26✔
UNCOV
20
        qDebug() << "PointDataVisualization: No PointData provided";
×
21
        return;
×
22
    }
23

24
    BoundingBox const bounds = calculateBoundsForPointData(m_point_data.get());
26✔
25

26
    m_spatial_index = std::make_unique<QuadTree<EntityId>>(bounds);
26✔
27
    m_vertex_data.reserve(m_point_data->GetAllPointsAsRange().size() * 3); // Reserve space for x, y, group_id
26✔
28

29
    std::vector<EntityId> entity_ids;
26✔
30

31
    for (auto const & time_points_pair: m_point_data->GetAllPointsAsRange()) {
89✔
32

33
        auto const & frame_entity_ids = m_point_data->getEntityIdsAtTime(time_points_pair.time);
63✔
34

35
        for (size_t i = 0; i < time_points_pair.points.size(); ++i) {
212✔
36
            auto const & point = time_points_pair.points[i];
149✔
37

38
            EntityId eid = 0;
149✔
39
            if (i < frame_entity_ids.size()) {
149✔
40
                eid = frame_entity_ids[i];
149✔
41
            }
42

43
            m_spatial_index->insert(point.x, point.y, eid);
149✔
44

45
            m_vertex_data.push_back(point.x);
149✔
46
            m_vertex_data.push_back(point.y);
149✔
47
            m_vertex_data.push_back(0.0f);
149✔
48

49
            entity_ids.push_back(eid);
149✔
50
        }
51
    }
52

53
    m_total_point_count = m_vertex_data.size() / 3;
26✔
54
    m_hidden_point_count = 0;
26✔
55
    m_visible_vertex_count = m_vertex_data.size();
26✔
56

57
    qDebug() << "PointDataVisualization: Setting up" << entity_ids.size() << "EntityIds for grouping";
26✔
58
    setPerPointEntityIds(std::move(entity_ids));
26✔
59

60
    if (m_vertex_buffer.isCreated()) {
26✔
61
        m_vertex_buffer.bind();
26✔
62
        m_vertex_buffer.allocate(m_vertex_data.data(), static_cast<int>(m_vertex_data.size() * sizeof(float)));
26✔
63
        m_vertex_buffer.release();
26✔
64
    }
65

66
    qDebug() << "PointDataVisualization: Populated data with" << m_total_point_count << "points";
26✔
67
}
26✔
68

UNCOV
69
BoundingBox PointDataVisualization::getDataBounds() const {
×
UNCOV
70
    if (!m_point_data) {
×
UNCOV
71
        return {0.0f, 0.0f, 1.0f, 1.0f};
×
72
    }
UNCOV
73
    return calculateBoundsForPointData(m_point_data.get());
×
74
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc