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

graphia-app / graphia / 40767028424

28 Oct 2026 08:51PM UTC coverage: 69.589% (-1.5%) from 71.111%
40767028424

push

github

timangus
blah

11606 of 18200 branches covered (63.77%)

Branch coverage included in aggregate %.

818 of 2594 new or added lines in 59 files covered. (31.53%)

69 existing lines in 10 files now uncovered.

30070 of 41689 relevant lines covered (72.13%)

167447.52 hits per line

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

0.0
/source/app/rendering/nodegeometry.cpp
1
/* Copyright © 2013-2025 Tim Angus
2
 * Copyright © 2013-2025 Tom Freeman
3
 *
4
 * This file is part of Graphia.
5
 *
6
 * Graphia is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * Graphia is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with Graphia.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19

20
#include "nodegeometry.h"
21

22
#include "app/layout/nodepositions.h"
23

24
void NodeGeometry::setPositions(const std::vector<NodeId>& nodeIds, const NodePositions& nodePositions)
NEW
25
{
×
NEW
26
    _geometry.resize(nodePositions.size() * 4);
×
27

NEW
28
    if(!nodeIds.empty())
×
NEW
29
    {
×
NEW
30
        const auto position = nodePositions.get(nodeIds.front());
×
NEW
31
        _bounds.set(position, position);
×
NEW
32
    }
×
33

NEW
34
    for(auto nodeId : nodeIds)
×
NEW
35
    {
×
NEW
36
        const auto position = nodePositions.get(nodeId);
×
NEW
37
        auto* texel = texelFor(nodeId);
×
38

NEW
39
        texel[0] = position.x();
×
NEW
40
        texel[1] = position.y();
×
NEW
41
        texel[2] = position.z();
×
42

NEW
43
        _bounds.expandToInclude(position);
×
NEW
44
    }
×
NEW
45
}
×
46

47
void NodeGeometry::setSize(NodeId nodeId, float size)
NEW
48
{
×
NEW
49
    texelFor(nodeId)[3] = size;
×
NEW
50
}
×
51

52
void NodeGeometry::copyFrom(const NodeGeometry& other)
NEW
53
{
×
NEW
54
    _geometry = other._geometry;
×
NEW
55
    _bounds = other._bounds;
×
NEW
56
}
×
57

58
void NodeGeometry::upload()
NEW
59
{
×
NEW
60
    _texels.upload(_geometry);
×
NEW
61
}
×
62

63
GLfloat* NodeGeometry::texelFor(NodeId nodeId)
NEW
64
{
×
NEW
65
    return &_geometry.at(static_cast<size_t>(nodeId) * 4);
×
NEW
66
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc