Skip to content

Commit 9b500c2

Browse files
committed
fix Sky and GeoData vrml nodes
1 parent 7cbc69b commit 9b500c2

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/OpenCOVER/plugins/general/GeoData/VrmlNodeGeoData.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ void VrmlNodeGeoData::initFields(VrmlNodeGeoData *node, VrmlNodeType *t)
4444
std::cerr << "[VrmlNodeGeoData::initFields] GeoData: invalid offsetName '" << node->d_offsetName.get() << "'." << std::endl;
4545
return;
4646
}
47-
osg::Vec3 origin = osg::Vec3(dataset->easting, dataset->northing, dataset->altitude); }),
47+
osg::Vec3 origin = osg::Vec3(dataset->easting, dataset->northing, dataset->altitude);
48+
opencover::GeoData::instance()->setProjectOffset(origin); }),
4849
field("regions", node->d_regions, [node](auto f)
4950
{
5051
auto geoData = GeoDataLoader::instance();
@@ -59,6 +60,8 @@ void VrmlNodeGeoData::initFields(VrmlNodeGeoData *node, VrmlNodeType *t)
5960
} }),
6061
field("showTerrain", node->d_showTerrain, [node](auto f)
6162
{ GeoDataLoader::instance()->setShowBuildings(node->d_showTerrain.get()); }),
63+
field("showLabels", node->d_showLabels, [node](auto f)
64+
{ GeoDataLoader::instance()->setShowLabels(node->d_showLabels.get()); }),
6265
field("showBuildings", node->d_showBuildings, [node](auto f)
6366
{ GeoDataLoader::instance()->setShowBuildings(node->d_showBuildings.get()); }));
6467
}

src/OpenCOVER/plugins/general/GeoData/VrmlNodeGeoData.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class VrmlNodeGeoData : public VrmlNodeChild
4141
VrmlSFString d_offsetName;
4242
VrmlMFString d_regions; // list of region names (see config/plugin/GeoData.toml), include ALL_REGIONS_STRING in the list to enable all regions
4343
VrmlSFBool d_showTerrain;
44+
VrmlSFBool d_showLabels;
4445
VrmlSFBool d_showBuildings;
4546
};
4647
#endif //_VRMLNODEGeoData_

src/OpenCOVER/plugins/general/Sky/Sky.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
#include <PluginUtil/PluginMessageTypes.h>
5555
#include <filesystem>
5656

57+
#include <vrml97/vrml/vrmlexport.h>
58+
#include <vrml97/vrml/VrmlNamespace.h>
59+
#include <vrml97/vrml/VrmlNode.h>
60+
#include <vrml97/vrml/VrmlNodeChild.h>
61+
5762
#include "VrmlNodeSky.h"
5863

5964
namespace opencover
@@ -70,6 +75,7 @@ namespace ui
7075

7176
using namespace covise;
7277
using namespace opencover;
78+
using namespace vrml;
7379

7480
Sky *Sky::s_instance = nullptr;
7581

@@ -82,7 +88,7 @@ Sky::Sky()
8288
}
8389
bool Sky::init()
8490
{
85-
// vrml::VrmlNamespace::addBuiltIn(vrml::VrmlNode::defineType<VrmlNodeSky>());
91+
VrmlNamespace::addBuiltIn(VrmlNode::defineType<VrmlNodeSky>());
8692

8793
geoDataMenu = dynamic_cast<ui::Menu *>(cover->ui->getByPath("Manager.GeoData"));
8894
if (!geoDataMenu)

0 commit comments

Comments
 (0)