Import Geant4 10.7.1 source tree
This commit is contained in:
@@ -19,6 +19,26 @@ committal in the CVS repository !
|
||||
History file for visualization/OpenInventor
|
||||
-------------------------------------------
|
||||
|
||||
06 January 2021 Frederick Jones (openinventor-V10-06-12)
|
||||
- G4OpenInventorQtViewer, G4OpenInventorQtExaminerViewer
|
||||
o Under UIQt: viewer fails (root node is null) if
|
||||
/vis/open/OI command is entered. Suspected a timing
|
||||
problem and moved uiQt->addTabWidget() from G4OIQtViewer
|
||||
to G4OIQtExaminerviewer::afterRealizeHook().
|
||||
|
||||
08 December 2020 Frederick Jones
|
||||
- G4OpenInventorQtViewer.hh,cc:
|
||||
o Fixed the uiQt->addTabWidget() call with correct arguments
|
||||
so that tabbed viewer opens correctly.
|
||||
o For UIQt case suppressed the viewer window titling which was
|
||||
changing the UI window title.
|
||||
|
||||
22 October 2020 John Allison
|
||||
- Some changes to instantiation and initialisation.
|
||||
o G4OpenInventorQtViewer now opens in a tab with correct name.
|
||||
o The main window name is left unchanged (it has same name as executable).
|
||||
o But the G4OpenInventorQtExaminerViewer still opens in a detached window.
|
||||
|
||||
20 October 2020 Frederick Jones (openinventor-V10-06-11)
|
||||
- Completed all the planned features of the OIQt viewer.
|
||||
- This Qt based viewer implements all the functionality
|
||||
|
||||
@@ -127,6 +127,7 @@ private Q_SLOTS :
|
||||
private:
|
||||
|
||||
static G4OpenInventorQtExaminerViewer* viewer;
|
||||
const char* fName;
|
||||
|
||||
void (*escapeCallback)();
|
||||
// void (*escapeCallback)(void*);
|
||||
|
||||
@@ -31,14 +31,7 @@
|
||||
// this :
|
||||
#include "G4OpenInventorQt.hh"
|
||||
|
||||
#include <Inventor/Qt/SoQt.h>
|
||||
|
||||
#include "G4SoQt.hh"
|
||||
#include "G4UIQt.hh"
|
||||
#include "G4Qt.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include <qobject.h>
|
||||
//#include "G4Qt.hh"
|
||||
#include "G4OpenInventorSceneHandler.hh"
|
||||
#include "G4OpenInventorQtViewer.hh"
|
||||
|
||||
@@ -119,20 +112,28 @@ G4OpenInventorQt::~G4OpenInventorQt()
|
||||
G4VViewer* G4OpenInventorQt::CreateViewer(G4VSceneHandler& scene,
|
||||
const G4String& name)
|
||||
{
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
G4UIQt *uiQt = static_cast<G4UIQt*> (UI->GetG4UIWindow());
|
||||
if (uiQt) {
|
||||
if (!((G4Qt*)(GetInteractorManager()->GetMainInteractor()))->IsExternalApp()) {
|
||||
QWidget* mainWin = (QWidget*)(GetInteractorManager()->GetMainInteractor());
|
||||
// Trying to get around git by adding this comment 2
|
||||
uiQt->AddTabWidget((QWidget*)mainWin,QString(name));
|
||||
auto pView = new G4OpenInventorQtViewer(static_cast<G4OpenInventorSceneHandler&>(scene), name);
|
||||
|
||||
if (pView) {
|
||||
if (pView->GetViewId() < 0) {
|
||||
G4cerr <<
|
||||
"G4OpenInventorQt::CreateViewer: ERROR flagged by negative"
|
||||
" view id in G4OpenInventorQtViewer creation."
|
||||
"\n Destroying view and returning null pointer."
|
||||
<< G4endl;
|
||||
delete pView;
|
||||
pView = 0;
|
||||
}
|
||||
}
|
||||
if (!pView) {
|
||||
G4cerr <<
|
||||
"G4OpenInventorQt::CreateViewer: ERROR: null pointer on new G4OpenInventorQtViewer."
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
Initialize();
|
||||
|
||||
G4OpenInventorSceneHandler* pScene = (G4OpenInventorSceneHandler*)&scene;
|
||||
return new G4OpenInventorQtViewer(*pScene, name);
|
||||
|
||||
return pView;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
#include <algorithm> // For using sort on a vector
|
||||
|
||||
#include "G4ios.hh"
|
||||
//#include "G4UImanager.hh"
|
||||
//#include "G4UIQt.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIQt.hh"
|
||||
|
||||
#include <Inventor/Qt/SoQt.h>
|
||||
#include <Inventor/Qt/SoQtCursor.h>
|
||||
@@ -131,7 +131,7 @@ G4OpenInventorQtExaminerViewer(QWidget* parent, const char* name, SbBool embed,
|
||||
// FWJ THIS DOESN'T WORK APPARENTLY NO MAINWINDOW
|
||||
// QMenuBar* menubar = ((QMainWindow*)parent)->menuBar();
|
||||
// G4cout << "G4OpenInventorQtExaminerViewer menubar=" << menubar << G4endl;
|
||||
|
||||
fName = name;
|
||||
viewer = this;
|
||||
construct(TRUE);
|
||||
}
|
||||
@@ -164,12 +164,6 @@ void G4OpenInventorQtExaminerViewer::construct(const SbBool)
|
||||
|
||||
buildWidget(getParentWidget());
|
||||
|
||||
// TRY TO EMBED IN Qt UI
|
||||
// Works but dumps core on a subsequent vis/open OIQt
|
||||
// auto UI = G4UImanager::GetUIpointer();
|
||||
// auto uiQt = dynamic_cast<G4UIQt*>(UI->GetG4UIWindow());
|
||||
// if (uiQt) uiQt->AddTabWidget(getParentWidget(), "OIQt");
|
||||
|
||||
fileName = "bookmarkFile"; // Default viewpoint file name
|
||||
viewPtIdx = -1; // index of the most recent viewpoint in viewPtList vector
|
||||
|
||||
@@ -762,6 +756,11 @@ void G4OpenInventorQtExaminerViewer::afterRealizeHook()
|
||||
AuxWindow->show();
|
||||
AuxWindow->raise();
|
||||
AuxWindow->activateWindow();
|
||||
|
||||
auto UI = G4UImanager::GetUIpointer();
|
||||
auto uiQt = dynamic_cast<G4UIQt*>(UI->GetG4UIWindow());
|
||||
// This explicitly sets the TabWidget as parent before addTab():
|
||||
if (uiQt) uiQt->AddTabWidget(getParentWidget(), QString(fName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
#include "G4OpenInventorSceneHandler.hh"
|
||||
#include "G4VInteractorManager.hh"
|
||||
#include "G4VisManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIQt.hh"
|
||||
|
||||
#include "G4SoQt.hh"
|
||||
|
||||
@@ -64,7 +66,7 @@ G4OpenInventorQtViewer::G4OpenInventorQtViewer(
|
||||
{
|
||||
// FWJ fName is in G4VViewer parent of G4OpenInventorViewer
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations)
|
||||
G4cout << "Window name: " << fName << G4endl;
|
||||
G4cout << "Window name: " << fName << G4endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +79,23 @@ void G4OpenInventorQtViewer::Initialise()
|
||||
// G4cout << "G4OIQtViewer: Creating G4OIQtExaminerViewer with parent " <<
|
||||
// parent << G4endl;
|
||||
|
||||
// fViewer = new SoQtExaminerViewer(parent, "Geant4", TRUE);
|
||||
fViewer = new G4OpenInventorQtExaminerViewer(parent, "Geant4", TRUE);
|
||||
fViewer = new G4OpenInventorQtExaminerViewer(parent, fName, TRUE);
|
||||
|
||||
auto UI = G4UImanager::GetUIpointer();
|
||||
auto uiQt = dynamic_cast<G4UIQt*>(UI->GetG4UIWindow());
|
||||
|
||||
// Moved this to G4OpenInventorQtExaminerViewer::afterRealizeHook()
|
||||
///////////////////////////////////////////////////////////
|
||||
//
|
||||
// This explicitly sets the TabWidget as parent before addTab():
|
||||
// if (uiQt) uiQt->AddTabWidget(parent, QString(fName));
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// Simpler: calls addTab(), but causes viewer parts to show (temporarily)
|
||||
// in the "Useful tips" page !!
|
||||
// if (uiQt) uiQt->AddViewerTab(parent, fName);
|
||||
// Leaves an empty viewer window frame hanging around:
|
||||
// if (uiQt) uiQt->AddTabWidget(fViewer->getWidget(), QString(fName));
|
||||
|
||||
// G4String wName = fName;
|
||||
//
|
||||
@@ -215,7 +232,8 @@ void G4OpenInventorQtViewer::Initialise()
|
||||
fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
|
||||
fViewer->viewAll();
|
||||
fViewer->saveHomePosition();
|
||||
fViewer->setTitle(fName);
|
||||
// SOMEHOW this also the OIQt main window title
|
||||
if (!uiQt) fViewer->setTitle(fName);
|
||||
fViewer->show();
|
||||
|
||||
// This SHOULD invoke the event loop:
|
||||
|
||||
Reference in New Issue
Block a user