Skip to content

Commit 5a703a8

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 4d57990 + 6e48db6 commit 5a703a8

3 files changed

Lines changed: 37 additions & 15 deletions

File tree

config/config-colormaps.xml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
<COCONFIG version="1">
33
<GLOBAL>
44
<Colormaps>
5+
<!-- <Voltage> -->
6+
<!-- <Point r="0.859" g="0.169" b="0.153" a="1" x="0" index="0"/> -->
7+
<!-- <Point r="0.992" g="0.749" b="0.067" a="1" x="0.25" index="1"/> -->
8+
<!-- <Point r="0.333" g="0.718" b="0.282" a="1" x="0.5" index="2"/> -->
9+
<!-- <Point r="0.000" g="1.000" b="1.000" a="1" x="0.75" index="3"/> -->
10+
<!-- <Point r="0.086" g="0.588" b="0.824" a="1" x="1.0" index="4"/> -->
11+
<!-- </Voltage> -->
512
<Voltage>
6-
<Point r="0.859" g="0.169" b="0.153" a="1" x="0" index="0"/>
7-
<Point r="0.992" g="0.749" b="0.067" a="1" x="0.25" index="1"/>
8-
<Point r="0.333" g="0.718" b="0.282" a="1" x="0.5" index="2"/>
9-
<Point r="0.000" g="1.000" b="1.000" a="1" x="0.75" index="3"/>
10-
<Point r="0.086" g="0.588" b="0.824" a="1" x="1.0" index="4"/>
13+
<Point r="1.000" g="1.000" b="1.0" a="1" x="0.0" index="0"/>
14+
<Point r="0.859" g="0.169" b="0.153" a="1" x="0.001" index="1"/>
15+
<Point r="0.992" g="0.749" b="0.067" a="1" x="0.25" index="2"/>
16+
<Point r="0.333" g="0.718" b="0.282" a="1" x="0.5" index="3"/>
17+
<Point r="0.000" g="1.000" b="1.000" a="1" x="0.75" index="4"/>
18+
<Point r="0.086" g="0.588" b="0.824" a="1" x="1.0" index="5"/>
1119
</Voltage>
1220
<Utilization>
1321
<Point r="0.333" g="0.718" b="0.282" a="1" x="0" index="0"/>

src/OpenCOVER/DataClient/DataClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class DATACLIENTEXPORT Client {
4949

5050
//register nodes to get updates pushed by the server
5151
//keep the ObserverHandle as long as you want to observe
52-
virtual [[nodiscard]] ObserverHandle observeNode(const std::string &name) = 0;
52+
[[nodiscard]] virtual ObserverHandle observeNode(const std::string &name) = 0;
5353

5454
// Pull-style access
5555
virtual double getNumericScalar(const std::string &name, double *timestep = nullptr) = 0;

src/OpenCOVER/fixLOD/fixLOD.cpp

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
#include <filesystem>
1717

1818

19-
int fixLOD(float factor, const std::string& filename)
19+
int fixLOD(float factor, const std::string& filename, bool includeData)
2020
{
2121

2222
osgDB::Options *options= new osgDB::Options;
23-
24-
options->setOptionString("WriteImageHint=IncludeFile");
23+
if (includeData)
24+
options->setOptionString("WriteImageHint=IncludeData");
25+
else
26+
options->setOptionString("WriteImageHint=IncludeFile");
2527
osg::Node *root=nullptr;
2628
std::filesystem::path p;
2729
p = filename;
@@ -40,7 +42,10 @@ int fixLOD(float factor, const std::string& filename)
4042
nrl.push_back(ranges[i]);
4143
}
4244
double newRad = factor * plod->getRadius();
43-
nrl[0].first = newRad;
45+
if((int)ranges.size()==1)
46+
nrl[0].first = 0;
47+
else
48+
nrl[0].first = newRad;
4449
nrl[0].second = 1.0E10;
4550
for (int i = 1; i< (int)ranges.size(); i++)
4651
{
@@ -96,19 +101,28 @@ int fixLOD(float factor, const std::string& filename)
96101
}
97102

98103
int main(int argc, char **argv) {
104+
int argOffset = 0;
105+
bool writeAsData = false;
106+
if (argc > 1 && strcmp(argv[1], "data") == 0)
107+
{
108+
argc--;
109+
argOffset++;
110+
writeAsData = true;
111+
}
99112
if (argc == 2)
100113
{
101-
std::string filename = argv[1];
102-
return fixLOD(5.0, filename);
114+
std::string filename = argv[1+ argOffset];
115+
return fixLOD(5.0, filename, writeAsData);
103116
}
104117
else if (argc == 3)
105118
{
106-
std::string filename = argv[2];
107-
return fixLOD(atof(argv[1]), filename);
119+
std::string filename = argv[2 + argOffset];
120+
return fixLOD(atof(argv[1 + argOffset]), filename, writeAsData);
108121
}
109122
else
110123
{
111-
std::cerr << "Usage: fixLOD [scaleFactor] [file.osgb]" << std::endl;
124+
std::cerr << "Usage: fixLOD [data] [scaleFactor] [file.osgb]" << std::endl;
125+
std::cerr << "if pictures are missing, use data option" << std::endl;
112126
}
113127

114128
return 0;

0 commit comments

Comments
 (0)