Skip to content

Commit 736c0f0

Browse files
Merge remote-tracking branch 'origin/master'
2 parents 6b417ad + 961de1e commit 736c0f0

12 files changed

Lines changed: 147 additions & 146 deletions

File tree

src/OpenCOVER/PluginUtil/ModuleFeedbackManager.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,17 @@ void ModuleFeedbackManager::createMenu()
262262
});
263263
}
264264
#endif
265-
if (!covise || !covise::coCoviseConfig::isOn("COVER.ExecuteOnChange", true))
265+
if (!covise)
266+
{
267+
executeAction_ = new ui::Action(menu_, "Execute");
268+
executeAction_->setCallback(
269+
[this]()
270+
{
271+
inExecute_ = true;
272+
inter_->executeModule();
273+
});
274+
}
275+
else if (!covise::coCoviseConfig::isOn("COVER.ExecuteOnChange", true))
266276
{
267277
executeCheckbox_ = new ui::Button(menu_, "Execute");
268278
executeCheckbox_->setCallback([this](bool){

src/OpenCOVER/PluginUtil/ModuleFeedbackManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class PLUGIN_UTILEXPORT ModuleFeedbackManager
128128
ui::Action *newButton_ = nullptr; // copy this module
129129
ui::Action *deleteButton_ = nullptr; // delete this module
130130
ui::Button *executeCheckbox_ = nullptr; // execute module button
131+
ui::Action *executeAction_ = nullptr; // execute module action
131132
//ui::coSubMenuItem *colorsButton_; // open colorbar
132133
opencover::coInteractor *inter_ = nullptr; // the last interaction got from the module at issue
133134
bool inExecute_; // switch checkbox off when new object arrived

src/OpenCOVER/PluginUtil/colors/coColorMap.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,21 @@ ColorMaps &opencover::ConfigColorMaps()
4040
static ColorMaps maps;
4141
if (maps.empty())
4242
maps = readColorMaps();
43+
assert(!maps.empty());
4344
return maps;
4445
}
4546

4647
ColorMaps opencover::readColorMaps() {
4748
// read the name of all colormaps in file
4849

4950
auto colorMapEntries = covise::coCoviseConfig::getScopeEntries("Colormaps");
50-
ColorMaps colorMaps;
5151
#ifdef NO_COLORMAP_PARAM
5252
colorMapEntries["COVISE"];
5353
#else
5454
// colorMapEntries["Editable"];
5555
#endif
5656

57+
ColorMaps colorMaps;
5758
for (const auto &map : colorMapEntries) {
5859
string name = "Colormaps." + map.first;
5960

@@ -76,6 +77,12 @@ ColorMaps opencover::readColorMaps() {
7677
}
7778
colorMaps.push_back(BaseColorMap{colors, samplingPoints, map.first});
7879
}
80+
81+
if (colorMaps.empty())
82+
{
83+
colorMaps.push_back(BaseColorMap{{osg::Vec4(0,0,1,1), osg::Vec4(1,0,0,1), osg::Vec4(1,1,0,1)}, {0.0, 0.5, 1.0}, "COVISE" });
84+
}
85+
7986
return colorMaps;
8087
}
8188

src/OpenCOVER/cover/OpenCOVER.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,13 @@ void OpenCOVER::restartVrbc()
16371637
}
16381638

16391639
if (m_loadVistlePlugin) {
1640+
if (!m_visPlugin)
1641+
{
1642+
m_vrbc.reset();
1643+
std::cerr << "OpenCOVER::restartVrbc: Vistle plugin not loaded, cannot start VRB client" << std::endl;
1644+
return;
1645+
}
1646+
16401647
class PluginMessageSender : public covise::MessageSenderInterface {
16411648

16421649
public:

src/OpenCOVER/cover/coVRNavigationManager.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,16 @@ void coVRNavigationManager::initMenu()
412412
m_viewAll->setPriority(ui::Element::Toolbar);
413413
m_viewAll->setIcon("zoom-fit-best");
414414

415+
m_viewVisible = new ui::Action(navMenu_, "ViewVisible");
416+
m_viewVisible->setText("View visible");
417+
m_viewVisible->setShortcut("Shift+Alt+V");
418+
m_viewVisible->setCallback([this, protectNav](){
419+
protectNav([](){
420+
VRSceneGraph::instance()->viewAll(false, true);
421+
});
422+
});
423+
m_viewVisible->setPriority(ui::Element::Toolbar);
424+
m_viewVisible->setIcon("zoom-to-visible");
415425

416426

417427

@@ -1197,7 +1207,7 @@ void coVRNavigationManager::update()
11971207
break;
11981208
}
11991209
}
1200-
1210+
12011211

12021212
// was ist wenn mehrere Objekte geladen sind???
12031213

@@ -2176,7 +2186,7 @@ void coVRNavigationManager::doPointNav() {
21762186
//m.setTrans(rotPointVec);
21772187
//rotPoint->setMatrix(m);
21782188
//setRotationAxis(rotPointVec[0], rotPointVec[1], rotPointVec[2]);
2179-
2189+
21802190
// general
21812191
const float width = mouseWinWidth();
21822192
const float height = mouseWinHeight();
@@ -2211,7 +2221,7 @@ void coVRNavigationManager::doPointNav() {
22112221
const float newxTrans = mouseX() - originX;
22122222
const float newzTrans = mouseY() - originY;
22132223

2214-
// drive
2224+
// drive
22152225
if ((interactionMA->isRunning() && (mouseNavButtonRotate == 0)) ||
22162226
(interactionMC->isRunning() && (mouseNavButtonRotate == 1)) ||
22172227
(interactionMB->isRunning() && (mouseNavButtonRotate == 2))) {
@@ -2301,7 +2311,7 @@ void coVRNavigationManager::doMouseScale(float newScaleFactor)
23012311

23022312
VRSceneGraph::instance()->getTransform()->setMatrix(xform_mat);
23032313
VRSceneGraph::instance()->setScaleFactor(newScaleFactor);
2304-
2314+
23052315
}
23062316

23072317
void coVRNavigationManager::doMouseScale()
@@ -2903,7 +2913,7 @@ void coVRNavigationManager::doWalkMoveToFloor()
29032913

29042914
// do not sync with remote, they will do the same
29052915
// on their side SyncXform();
2906-
2916+
29072917
// coVRCollaboration::instance()->SyncXform();
29082918
}
29092919

src/OpenCOVER/cover/coVRNavigationManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class COVEREXPORT coVRNavigationManager: public ui::Owner
357357
vrui::coRowMenu *nameMenu_;
358358
vrui::coButtonMenuItem *nameButton_;
359359
ui::Menu *navMenu_ = nullptr;
360-
ui::Action *m_viewAll=nullptr, *m_resetView=nullptr;
360+
ui::Action *m_viewAll=nullptr, *m_resetView=nullptr, *m_viewVisible=nullptr;
361361
ui::Group *navModes_ = nullptr;
362362
ui::ButtonGroup *navGroup_ = nullptr;
363363
ui::Button *noNavButton_=nullptr;
@@ -384,7 +384,7 @@ class COVEREXPORT coVRNavigationManager: public ui::Owner
384384
void initMenu();
385385
void initShowName();
386386
void initMeasure();
387-
387+
388388
osg::Vec3 getCenter() const;
389389
void centerView();
390390
osg::Vec3 mouseNavCenter;

src/OpenCOVER/cover/input/deviceDiscovery.cpp

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -79,37 +79,38 @@ namespace opencover
7979
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);
8080
int numToAdd = toAdd.size();
8181
coVRMSController::instance()->syncData(&numToAdd, sizeof(numToAdd));
82-
if (coVRMSController::instance()->isMaster())
83-
{
84-
for(const auto &i:toAdd)
85-
{
86-
devices.push_back(i);
87-
int len = i->pluginName.length();
88-
coVRMSController::instance()->sendSlaves(&len, sizeof(len));
89-
coVRMSController::instance()->sendSlaves(i->pluginName.c_str(), len + 1);
90-
cover->addPlugin(i->pluginName.c_str());
91-
}
92-
}
93-
else
94-
{
95-
for(int i=0;i<numToAdd;i++)
96-
{
97-
std::string pluginName;
98-
int len = 0;
99-
char buf[1000];
100-
coVRMSController::instance()->readMaster(&len, sizeof(len));
101-
coVRMSController::instance()->readMaster(buf, len+1);
102-
cover->addPlugin(buf);
103-
}
104-
}
105-
toAdd.clear();
106-
auto firstNew = devices.end() - numToAdd;
107-
for (int i = 0; i < numToAdd; i++)
108-
{
109-
deviceAdded(*firstNew);
110-
++firstNew;
111-
}
82+
if (coVRMSController::instance()->isMaster())
83+
{
84+
for(const auto &i:toAdd)
85+
{
86+
devices.push_back(i);
87+
int len = i->pluginName.length();
88+
coVRMSController::instance()->sendSlaves(&len, sizeof(len));
89+
coVRMSController::instance()->sendSlaves(i->pluginName.c_str(), len + 1);
90+
cover->addPlugin(i->pluginName.c_str());
91+
}
92+
auto firstNew = devices.end() - numToAdd;
93+
for (int i = 0; i < numToAdd; i++)
94+
{
95+
deviceAdded(*firstNew);
96+
++firstNew;
97+
}
98+
}
99+
else
100+
{
101+
for(int i=0;i<numToAdd;i++)
102+
{
103+
std::string pluginName;
104+
int len = 0;
105+
char buf[1000];
106+
coVRMSController::instance()->readMaster(&len, sizeof(len));
107+
coVRMSController::instance()->readMaster(buf, len+1);
108+
cover->addPlugin(buf);
109+
}
110+
}
111+
toAdd.clear();
112112
}
113+
113114
void deviceDiscovery::run()
114115
{
115116
covise::setThreadName("deviceDiscoveryThread");

src/OpenCOVER/cover/input/deviceDiscovery.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ namespace opencover
5858

5959
// only to be used from main thread
6060
const std::vector<const deviceInfo *> &getDevices() const;
61+
// only called on master, slaves don't know about devices
6162
sigslot::signal<const deviceInfo *> deviceAdded;
6263

6364
private:

src/OpenCOVER/plugins/general/CuttingSurface/CuttingSurfaceInteraction.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ CuttingSurfaceInteraction::getParameters()
209209
int numoptions;
210210
char **labels;
211211
inter_->getChoiceParam(OPTION, numoptions, labels, option_);
212+
213+
inter_->getBooleanParam("flip", flip_);
212214
}
213215

214216
void CuttingSurfaceInteraction::createMenu(bool invertClip)
@@ -221,15 +223,11 @@ void CuttingSurfaceInteraction::createMenu(bool invertClip)
221223
clipInvertCheckbox_->setCallback(
222224
[this](bool state)
223225
{
226+
plugin->getSyncInteractors(inter_);
224227
plugin->setBooleanParam("flip", state);
225228
plugin->executeModule();
226-
227-
if (clipPlaneFlipCheckbox_)
228-
{
229-
bool flip = clipPlaneFlipCheckbox_->state();
230-
clipPlaneFlipCheckbox_->setState(!flip);
231-
}
232229
});
230+
clipInvertCheckbox_->setState(flip_ != 0);
233231
}
234232

235233
optionChoice_ = new ui::SelectionList(menu_, "SurfaceStyle");
@@ -285,6 +283,7 @@ void CuttingSurfaceInteraction::createMenu(bool invertClip)
285283
break;
286284
}
287285
}
286+
plugin->getSyncInteractors(inter_);
288287
plugin->executeModule();
289288
}
290289
});
@@ -385,6 +384,11 @@ CuttingSurfaceInteraction::updateMenu()
385384
break;
386385
}
387386

387+
if (clipInvertCheckbox_)
388+
{
389+
clipInvertCheckbox_->setState(flip_ != 0);
390+
}
391+
388392
updatePickInteractors(showPickInteractor_);
389393
updateDirectInteractors(showDirectInteractor_);
390394
}

src/OpenCOVER/plugins/general/CuttingSurface/CuttingSurfaceInteraction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class CuttingSurfaceInteraction : public ModuleInteraction
9797
NumSurfaceStyles
9898
};
9999
int option_ = OPTION_NONE;
100+
int flip_ = 0;
100101
ui::SelectionList *optionChoice_=nullptr;
101102

102103
CuttingSurfacePlane *csPlane_;

0 commit comments

Comments
 (0)