Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -5,7 +5,47 @@ which **must** added in reverse chronological order (newest at the top).
|
||||
It must **not** be used as a substitute for writing good git commit messages!
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
## 2025-10-31 Andrea Barresi (interfaces-V11-03-12)
|
||||
-G4VInteractiveSession:
|
||||
- Added UpdateDrawingStyle, UpdateProjectionStyle, UpdateTransparencySlider
|
||||
virtual methods to update the control widgets
|
||||
- G4UIQt:
|
||||
- Added UpdateDrawingStyle, UpdateProjectionStyle, UpdateTransparencySlider
|
||||
methods to update the control widgets
|
||||
- Moved transparency slider radio buttons to be class members
|
||||
- Added icon for point cloud surface style
|
||||
- Added icon to reset target point
|
||||
- Changed behavior of the icon "Reset camera" to avoid popup window with dedicated call back
|
||||
- Improved picking behavior avoiding opening picking window when picking is enabled
|
||||
- Fixed icons selection behaviour and syncronization
|
||||
|
||||
## 2025-10-24 Guy Barrand (interfaces-V11-03-11)
|
||||
- implementation/sources.cmake: handle "-DTOOLS_USE_GL_VERSION_3_2" in case "GEANT4_USE_VTK".
|
||||
|
||||
## 2025-10-17 Guy Barrand (interfaces-V11-03-10)
|
||||
- G4Qt.cc: have "#ifdef TOOLS_USE_GL_VERSION_3_2" to set the "QSurfaceFormat to 3.2" if Vtk
|
||||
did not did it first. Note that for Qt-5, we have to set the "QGLSurface" which is NOT set
|
||||
by vtk (at I saw it on my Vtk-9.3-Qt5 on my Mac/intel and my virtual ubuntu).
|
||||
|
||||
## 2025-09-16 John Allison (interfaces-V11-03-09)
|
||||
- G4UIQt:
|
||||
- Fix link and add "Action" guidance table in "Useful tips".
|
||||
- Tidy.
|
||||
|
||||
## 2025-08-17 John Allison (interfaces-V11-03-08)
|
||||
- G4UIQt:
|
||||
- Scene tree: simplify interaction for visibility of touchables.
|
||||
|
||||
## 2025-08-07 John Allison (interfaces-V11-03-07)
|
||||
- G4UIQt:
|
||||
- Intercept the case of "help" with argument:
|
||||
- Write guidance to output window.
|
||||
- Avoid undiagnosed crash with Qt6.
|
||||
|
||||
## 2025-06-18 Andrea Barresi (interfaces-V11-03-06)
|
||||
- G4UIQt:
|
||||
- Added icon to reset camera and improved base size of MainWindow
|
||||
|
||||
## 2025-05-12 Andrea Barresi (interfaces-V11-03-05)
|
||||
- G4UIQt:
|
||||
- Improved pick info window size
|
||||
|
||||
@@ -63,6 +63,10 @@ class G4VInteractiveSession
|
||||
void AddInteractor(G4String, G4Interactor);
|
||||
G4Interactor GetInteractor(const G4String&);
|
||||
const std::map<G4String, OutputStyle>& GetOutputStyles() const;
|
||||
|
||||
virtual void UpdateDrawingStyle(G4int style);
|
||||
virtual void UpdateProjectionStyle(G4int style);
|
||||
virtual void UpdateTransparencySlider(G4double depth, G4int option);
|
||||
|
||||
protected:
|
||||
void SetStyleUtility(const G4String& destination, const G4String& style);
|
||||
|
||||
@@ -84,6 +84,10 @@ G4VInteractiveSession::GetOutputStyles() const
|
||||
return fOutputStyles;
|
||||
}
|
||||
|
||||
void G4VInteractiveSession::UpdateDrawingStyle(G4int) {}
|
||||
void G4VInteractiveSession::UpdateProjectionStyle(G4int) {}
|
||||
void G4VInteractiveSession::UpdateTransparencySlider(G4double, G4int) {}
|
||||
|
||||
void G4VInteractiveSession::SetStyleUtility(const G4String& destination, const G4String& style)
|
||||
{
|
||||
G4String destinationG4(destination);
|
||||
|
||||
@@ -59,6 +59,7 @@ class QCompleter;
|
||||
class QtGlobal;
|
||||
class QStandardItemModel;
|
||||
class QToolButton;
|
||||
class QRadioButton;
|
||||
|
||||
// Class description :
|
||||
//
|
||||
@@ -94,10 +95,10 @@ class G4QTabWidget : public QTabWidget
|
||||
G4int fLastCreated;
|
||||
G4int fPreferedSizeX;
|
||||
G4int fPreferedSizeY;
|
||||
inline void setPreferredSize(QSize s)
|
||||
inline void setPreferredSize(QSize size)
|
||||
{
|
||||
fPreferedSizeX = s.width() + 6; // tab label height + margin left+right
|
||||
fPreferedSizeY = s.height() + 58; // margin left+right
|
||||
fPreferedSizeX = size.width() + 6; // tab label height + margin left+right
|
||||
fPreferedSizeY = size.height() + 58; // margin left+right
|
||||
}
|
||||
inline QSize sizeHint() const override { return QSize(fPreferedSizeX, fPreferedSizeY); }
|
||||
};
|
||||
@@ -192,13 +193,14 @@ class G4UIQt : public QObject, public G4VBasicShell, public G4VInteractiveSessio
|
||||
|
||||
void SetIconMoveSelected();
|
||||
void SetIconRotateSelected();
|
||||
void SetIconPickSelected();
|
||||
void TogglePickSelection();
|
||||
void SetIconZoomInSelected();
|
||||
void SetIconZoomOutSelected();
|
||||
void SetIconHLHSRSelected();
|
||||
void SetIconHLRSelected();
|
||||
void SetIconSolidSelected();
|
||||
void SetIconWireframeSelected();
|
||||
void SetIconCoudPointSelected();
|
||||
void SetIconPerspectiveSelected();
|
||||
void SetIconOrthoSelected();
|
||||
|
||||
@@ -243,6 +245,12 @@ class G4UIQt : public QObject, public G4VBasicShell, public G4VInteractiveSessio
|
||||
// Update "new" scene tree
|
||||
void UpdateSceneTree(const G4SceneTreeItem&) override;
|
||||
|
||||
// Update control widgets
|
||||
void UpdateDrawingStyle(G4int style) override;
|
||||
void UpdateProjectionStyle(G4int style) override;
|
||||
void UpdateTransparencySlider(G4double depth, G4int option) override;
|
||||
|
||||
|
||||
public:
|
||||
~G4UIQt() override;
|
||||
void Prompt(const G4String&);
|
||||
@@ -353,6 +361,9 @@ private:
|
||||
NewSceneTreeItemTreeWidget* fNewSceneTreeItemTreeWidget;
|
||||
G4int fMaxPVDepth;
|
||||
QSlider* fNewSceneTreeSlider;
|
||||
QRadioButton* fUnwrapButtonWidget;
|
||||
QRadioButton* fFadeButtonWidget;
|
||||
QRadioButton* fXrayButtonWidget;
|
||||
QWidget* fViewerPropertiesWidget;
|
||||
QWidget* fPickInfosWidget;
|
||||
QLineEdit* fHelpLine;
|
||||
@@ -384,6 +395,7 @@ private:
|
||||
QPixmap* fZoomOutIcon;
|
||||
QPixmap* fWireframeIcon;
|
||||
QPixmap* fSolidIcon;
|
||||
QPixmap* fPointCloudIcon;
|
||||
QPixmap* fHiddenLineRemovalIcon;
|
||||
QPixmap* fHiddenLineAndSurfaceRemovalIcon;
|
||||
QPixmap* fPerspectiveIcon;
|
||||
@@ -394,6 +406,8 @@ private:
|
||||
QPixmap* fParamIcon;
|
||||
QPixmap* fPickTargetIcon;
|
||||
QPixmap* fExitIcon;
|
||||
QPixmap* fResetCameraIcon;
|
||||
QPixmap* fResetTargetPointIcon;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
QComboBox* fThreadsFilterComboBox;
|
||||
@@ -435,6 +449,8 @@ private:
|
||||
void SaveIconCallback(const QString&);
|
||||
void ViewerPropertiesIconCallback(int);
|
||||
void ChangePerspectiveOrtho(const QString&);
|
||||
void ResetCameraCallback();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@ if(GEANT4_USE_QT)
|
||||
if(GEANT4_USE_VTK)
|
||||
geant4_module_compile_definitions(G4UIimplementation PRIVATE G4VIS_USE_VTK_QT)
|
||||
geant4_module_link_libraries(G4UIimplementation PRIVATE ${VTK_LIBRARIES})
|
||||
geant4_module_compile_definitions(G4UIimplementation PRIVATE TOOLS_USE_GL_VERSION_3_2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@
|
||||
# include <qsurfaceformat.h>
|
||||
#endif
|
||||
|
||||
#ifdef TOOLS_USE_GL_VERSION_3_2
|
||||
#if QT_VERSION < 0x060000
|
||||
# include <qgl.h>
|
||||
#else
|
||||
#ifndef G4VIS_USE_VTK_QT
|
||||
#include <qsurfaceformat.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
G4Qt* G4Qt::instance = nullptr;
|
||||
|
||||
static G4bool QtInited = false;
|
||||
@@ -112,6 +122,23 @@ G4Qt::G4Qt(int a_argn, char** a_args, char* /*a_class */
|
||||
#ifdef G4VIS_USE_VTK_QT
|
||||
QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());
|
||||
#endif
|
||||
|
||||
#ifdef TOOLS_USE_GL_VERSION_3_2
|
||||
#if QT_VERSION < 0x060000
|
||||
QGLFormat format = QGLFormat::defaultFormat();
|
||||
format.setVersion(3,2);
|
||||
format.setProfile(QGLFormat::CoreProfile);
|
||||
QGLFormat::setDefaultFormat(format);
|
||||
#else
|
||||
#ifndef G4VIS_USE_VTK_QT
|
||||
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
|
||||
format.setVersion(3,2);
|
||||
format.setProfile(QSurfaceFormat::CoreProfile);
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
new QApplication(*p_argn, args);
|
||||
if (! qApp) {
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
@@ -143,6 +143,9 @@ G4UIQt::G4UIQt(G4int argc, char** argv)
|
||||
fNewSceneTreeItemTreeWidget(nullptr),
|
||||
fMaxPVDepth(0),
|
||||
fNewSceneTreeSlider(nullptr),
|
||||
fUnwrapButtonWidget(nullptr),
|
||||
fFadeButtonWidget(nullptr),
|
||||
fXrayButtonWidget(nullptr),
|
||||
fViewerPropertiesWidget(nullptr),
|
||||
fPickInfosWidget(nullptr),
|
||||
fHelpLine(nullptr),
|
||||
@@ -167,6 +170,7 @@ G4UIQt::G4UIQt(G4int argc, char** argv)
|
||||
fZoomOutIcon(nullptr),
|
||||
fWireframeIcon(nullptr),
|
||||
fSolidIcon(nullptr),
|
||||
fPointCloudIcon(nullptr),
|
||||
fHiddenLineRemovalIcon(nullptr),
|
||||
fHiddenLineAndSurfaceRemovalIcon(nullptr),
|
||||
fPerspectiveIcon(nullptr),
|
||||
@@ -176,7 +180,9 @@ G4UIQt::G4UIQt(G4int argc, char** argv)
|
||||
fRunIcon(nullptr),
|
||||
fParamIcon(nullptr),
|
||||
fPickTargetIcon(nullptr),
|
||||
fExitIcon(nullptr)
|
||||
fExitIcon(nullptr),
|
||||
fResetCameraIcon(nullptr),
|
||||
fResetTargetPointIcon(nullptr)
|
||||
#ifdef G4MULTITHREADED
|
||||
,
|
||||
fThreadsFilterComboBox(nullptr)
|
||||
@@ -251,13 +257,15 @@ G4UIQt::G4UIQt(G4int argc, char** argv)
|
||||
#endif
|
||||
|
||||
fMainWindow->setWindowTitle(QFileInfo(QCoreApplication::applicationFilePath()).fileName());
|
||||
fMainWindow->move(QPoint(50, 50));
|
||||
|
||||
// force the size at be correct at the beggining
|
||||
// because the widget is not realized yet, the size of the main window is not up to date. But
|
||||
// we need it in order to add some viewer inside
|
||||
fMainWindow->resize(fUIDockWidget->width() + fCoutDockWidget->width() + 20,
|
||||
fUIDockWidget->height() + fCoutDockWidget->height() + 20);
|
||||
int width = QGuiApplication::primaryScreen()->geometry().size().width() * 0.9;
|
||||
int height = QGuiApplication::primaryScreen()->geometry().size().height() * 0.9;
|
||||
fMainWindow->resize(width, height);
|
||||
fMainWindow->move((QGuiApplication::primaryScreen()->geometry().size().width() - width) / 2,
|
||||
(QGuiApplication::primaryScreen()->geometry().size().height() - height) / 4);
|
||||
|
||||
// set last focus on command line
|
||||
fCommandArea->setFocus(Qt::TabFocusReason);
|
||||
@@ -334,10 +342,13 @@ void G4UIQt::SetDefaultIconsToolbar()
|
||||
AddIcon("Hidden line and hidden surface removal", "hidden_line_and_surface_removal", "");
|
||||
AddIcon("Surfaces", "solid", "");
|
||||
AddIcon("Wireframe", "wireframe", "");
|
||||
AddIcon("PointCloud", "point_cloud", "");
|
||||
|
||||
// Perspective/Ortho icons
|
||||
AddIcon("Perspective", "perspective", "");
|
||||
AddIcon("Orthographic", "ortho", "");
|
||||
AddIcon("ResetCamera", "reset_camera", "");
|
||||
AddIcon("Reset target point", "resetTargetPoint", "/vis/viewer/set/targetPoint 0 0 0 m");
|
||||
AddIcon("Run beam on", "runBeamOn", "/run/beamOn 1");
|
||||
AddIcon("Exit Application", "exit", "exit");
|
||||
}
|
||||
@@ -1455,6 +1466,126 @@ void G4UIQt::CreateIcons()
|
||||
" "
|
||||
};
|
||||
fExitIcon= new QPixmap(exitIcon);
|
||||
|
||||
const char * const resetCamera[]={
|
||||
"32 32 3 1",
|
||||
" c None",
|
||||
". c #D5D8D5",
|
||||
"@ c #000000",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" .......................... ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@@@@@@@@@@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@. .@. .@. ",
|
||||
" .@. .@@@@@@@@@@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@. .@. ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@. ",
|
||||
" .......................... ",
|
||||
" ",
|
||||
" ",
|
||||
" "}
|
||||
;
|
||||
fResetCameraIcon = new QPixmap(resetCamera);
|
||||
|
||||
const char * const resetTargetPointIcon[]={
|
||||
"32 32 3 1",
|
||||
" c None",
|
||||
". c #D5D8D5",
|
||||
"@ c #000000",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@ ",
|
||||
" .@.................... ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" .@. ",
|
||||
" ",
|
||||
" "}
|
||||
;
|
||||
fResetTargetPointIcon = new QPixmap(resetTargetPointIcon);
|
||||
|
||||
const char * const pointCloudIcon[] = {
|
||||
"32 32 2 1 ",
|
||||
" c None",
|
||||
". c black",
|
||||
" ",
|
||||
" ... ",
|
||||
" .. . .. ",
|
||||
" .. .. ",
|
||||
" .. .. .. . .. ",
|
||||
" .. .. .. . . . ",
|
||||
" . .. .. . . . ",
|
||||
" .. . ",
|
||||
" .. . ",
|
||||
" . .. .. . . . ",
|
||||
" . .. .. . . . ",
|
||||
" .. .. . ",
|
||||
" .. . ",
|
||||
" . .. . . . ",
|
||||
" . .. .. . . . ",
|
||||
" .. .. . . ",
|
||||
" .. .. . ",
|
||||
" . .. . . ",
|
||||
" . .. . . . ",
|
||||
" .. .. . . ",
|
||||
" .. .. . ",
|
||||
" . .. .. . . ",
|
||||
" . .. . . . ",
|
||||
" .. .. . . ",
|
||||
" .. .. .. .. ",
|
||||
" .... . . ",
|
||||
" .. . .. ",
|
||||
" ... ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "
|
||||
};
|
||||
fPointCloudIcon = new QPixmap(pointCloudIcon);
|
||||
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
@@ -1524,13 +1655,13 @@ void G4UIQt::CreateNewSceneTreeWidget()
|
||||
auto buttonBox = new QWidget();
|
||||
auto buttonBoxlayout = new QHBoxLayout();
|
||||
buttonBox->setLayout(buttonBoxlayout);
|
||||
auto unwrapButtonWidget = new QRadioButton("Unwrap");
|
||||
unwrapButtonWidget->setChecked(true); // Initial state
|
||||
auto fadeButtonWidget = new QRadioButton("Fade");
|
||||
auto xrayButtonWidget = new QRadioButton("X-ray");
|
||||
buttonBoxlayout->addWidget(unwrapButtonWidget);
|
||||
buttonBoxlayout->addWidget(fadeButtonWidget);
|
||||
buttonBoxlayout->addWidget(xrayButtonWidget);
|
||||
fUnwrapButtonWidget = new QRadioButton("Unwrap");
|
||||
fUnwrapButtonWidget->setChecked(true); // Initial state
|
||||
fFadeButtonWidget = new QRadioButton("Fade");
|
||||
fXrayButtonWidget = new QRadioButton("X-ray");
|
||||
buttonBoxlayout->addWidget(fUnwrapButtonWidget);
|
||||
buttonBoxlayout->addWidget(fFadeButtonWidget);
|
||||
buttonBoxlayout->addWidget(fXrayButtonWidget);
|
||||
buttonBoxlayout->setContentsMargins(0,0,0,0);
|
||||
buttonBox->setLayout(buttonBoxlayout);
|
||||
// Layout
|
||||
@@ -1565,11 +1696,11 @@ void G4UIQt::CreateNewSceneTreeWidget()
|
||||
[&]{SliderReleased();});
|
||||
|
||||
// Connect the slider buttons
|
||||
connect(unwrapButtonWidget, &QRadioButton::clicked,
|
||||
connect(fUnwrapButtonWidget, &QRadioButton::clicked,
|
||||
[&]{SliderRadioButtonClicked(1);}); // Unwrap
|
||||
connect(fadeButtonWidget, &QRadioButton::clicked,
|
||||
connect(fFadeButtonWidget, &QRadioButton::clicked,
|
||||
[&]{SliderRadioButtonClicked(2);}); // Fade
|
||||
connect(xrayButtonWidget, &QRadioButton::clicked,
|
||||
connect(fXrayButtonWidget, &QRadioButton::clicked,
|
||||
[&]{SliderRadioButtonClicked(3);}); // X-ray
|
||||
}
|
||||
|
||||
@@ -1626,6 +1757,61 @@ void G4UIQt::UpdateSceneTree(const G4SceneTreeItem& root)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G4UIQt::UpdateDrawingStyle(G4int style) {
|
||||
// Surface style
|
||||
switch (style) {
|
||||
case 0:
|
||||
this->SetIconWireframeSelected();
|
||||
break;
|
||||
case 1:
|
||||
this->SetIconHLRSelected();
|
||||
break;
|
||||
case 2:
|
||||
this->SetIconSolidSelected();
|
||||
break;
|
||||
case 3:
|
||||
this->SetIconHLHSRSelected();
|
||||
break;
|
||||
case 4:
|
||||
this->SetIconCoudPointSelected();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::UpdateProjectionStyle(G4int style) {
|
||||
if (style == 0.) { // ortho
|
||||
this->SetIconOrthoSelected();
|
||||
} else {
|
||||
this->SetIconPerspectiveSelected();
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::UpdateTransparencySlider(G4double depth, G4int option) {
|
||||
fNewSceneTreeSlider->blockSignals(true);
|
||||
fNewSceneTreeSlider->setValue(depth * maxInherentSliderValue / fMaxPVDepth);
|
||||
fNewSceneTreeSlider->blockSignals(false);
|
||||
if (option == 1) {
|
||||
fUnwrapButtonWidget->blockSignals(true);
|
||||
fUnwrapButtonWidget->setChecked(true);
|
||||
fUnwrapButtonWidget->blockSignals(false);
|
||||
}
|
||||
else if (option == 2) {
|
||||
fFadeButtonWidget->blockSignals(true);
|
||||
fFadeButtonWidget->setChecked(true);
|
||||
fFadeButtonWidget->blockSignals(false);
|
||||
}
|
||||
else if (option == 3) {
|
||||
fXrayButtonWidget->blockSignals(true);
|
||||
fXrayButtonWidget->setChecked(true);
|
||||
fXrayButtonWidget->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Build Physical Volume tree of touchables
|
||||
void G4UIQt::BuildPVQTree(const G4SceneTreeItem& g4stItem, QTreeWidgetItem* qtwItem)
|
||||
{
|
||||
@@ -1655,7 +1841,7 @@ void G4UIQt::BuildPVQTree(const G4SceneTreeItem& g4stItem, QTreeWidgetItem* qtwI
|
||||
oss.str(""); oss << nameCopyNo <<
|
||||
": Click to make visible and get more information."
|
||||
"\n This may not work if the volume is in the \"base path\". (Hover on"
|
||||
"\n the model to see base path.) If this is the case,"
|
||||
"\n G4PhysicalVolumeModel to see base path.) If this is the case,"
|
||||
"\n \"/vis/scene/add/volume " << name << "\" to bring into the displayed tree.)";
|
||||
newQTWItem->setToolTip(0, oss.str().c_str());
|
||||
} else { // A fully defined touchable
|
||||
@@ -1724,27 +1910,14 @@ void G4UIQt::SceneTreeItemClicked(QTreeWidgetItem* item)
|
||||
}
|
||||
uiMan->ApplyCommand("/vis/set/touchable" + sceneTreeItem->GetPVPath());
|
||||
uiMan->ApplyCommand("/vis/touchable/set/visibility " + argument);
|
||||
// If daughters, set daughtersInvisible too
|
||||
if (sceneTreeItem->GetChildren().size() > 0 ) {
|
||||
uiMan->ApplyCommand("/vis/touchable/set/daughtersInvisible " + inverse);
|
||||
}
|
||||
// If not cancelled and if daughters > 0 and if making invisible
|
||||
static G4bool wanted = true;
|
||||
if (wanted && sceneTreeItem->GetChildren().size() > 0 && argument == "false") {
|
||||
static G4bool first = true;
|
||||
if (first && sceneTreeItem->GetChildren().size() > 0 && argument == "false") {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText
|
||||
("This action makes this volume and all descendants invisible."
|
||||
" To see descendants, right-click and select daughtersInvisible/false"
|
||||
" and check visibility of descendants individually. If this gets out"
|
||||
" of hand, \"/vis/viewer/clearVisAttributesModifiers\" and start again.");
|
||||
msgBox.setInformativeText
|
||||
("To suppress this message click \"Discard\" or \"Don't Save\"");
|
||||
msgBox.setStandardButtons(QMessageBox::Discard | QMessageBox::Ok);
|
||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||
auto action = msgBox.exec();
|
||||
if (action == QMessageBox::Discard) {
|
||||
wanted = false;
|
||||
}
|
||||
("To make all descendants invisible, select, then right-click/daughtersInvisible/true.");
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2853,29 +3026,96 @@ void G4UIQt::CreateViewerWidget()
|
||||
// Set layouts
|
||||
|
||||
// clang-format off
|
||||
SetStartPage(std::string("<table width='100%'><tr><td width='30%'></td><td><div ")+
|
||||
"style='color: rgb(140, 31, 31); font-size: xx-large; font-family: Garamond, serif; padding-bottom: 0px; font-weight: normal'>Geant4: "+
|
||||
QApplication::applicationName ().toStdString()+
|
||||
"</div></td><td width='40%'> <br/><i>http://cern.ch/geant4/</i></td></tr></table>"+
|
||||
"<p> </p>"+
|
||||
"<div style='background:#EEEEEE;'><b>Tooltips :</b><ul>"+
|
||||
"<li><b>Start a new viewer :</b><br />"+
|
||||
"<i>'/vis/open/...'<br />"+
|
||||
"For example '/vis/open OGL'</i></li>"+
|
||||
"<li><b>Execute a macro file :</b><br />"+
|
||||
"<i>'/control/execute my_macro_file'</i></li>"+
|
||||
"</ul></div>"+
|
||||
SetStartPage
|
||||
("<table width='100%'>"
|
||||
"<tr>"
|
||||
"<td width='30%'></td>"
|
||||
"<td>"
|
||||
"<div style='color: rgb(140, 31, 31); font-size: xx-large;"
|
||||
"font-family: Garamond, serif; padding-bottom: 0px; font-weight: normal'>"
|
||||
"Geant4: "+QApplication::applicationName ().toStdString()+
|
||||
"</div>"
|
||||
"</td><td width='40%'> <br/><i>http://cern.ch/geant4/</i></td>"
|
||||
"</tr>"
|
||||
"</table>"
|
||||
|
||||
"<div style='background:#EEEEEE;'><b>Documentation :</b><ul>"+
|
||||
"<li><b>Visualisation publication :</b><br />"+
|
||||
"<i><a href='http://www.worldscientific.com/doi/abs/10.1142/S1793962313400011'>The Geant4 Visualization System - A Multi-Driver Graphics System</b><br />, Allison, J. et al., International Journal of Modeling, Simulation, and Scientific Computing, Vol. 4, Suppl. 1 (2013) 1340001</a>:<br/> http://www.worldscientific.com/doi/abs/10.1142/S1793962313400011</i></li>"+
|
||||
"</ul></div>"+
|
||||
"<p> </p>"
|
||||
|
||||
"<div style='background:#EEEEEE;'><b>Getting Help :</b><ul>"+
|
||||
"<li><b>If problems arise, try <a href='https://cern.ch/geant4-forum'>browsing the user forum</a> to see whether or not your problem has already been encountered.<br /> If it hasn't, you can post it and Geant4 developers will do their best to find a solution. This is also a good place to<br /> discuss Geant4 topics in general.</b> https://cern.ch/geant4-forum"+
|
||||
"<li><b>Get a look at <a href='http://cern.ch/geant4/support'>Geant4 User support pages</a>: <i>http://cern.ch/geant4/support</i></b></li>"+
|
||||
"</ul></div>"
|
||||
);
|
||||
"<div>"
|
||||
"<table>"
|
||||
"<td>"
|
||||
"<div style='background:#EEEEEE;'>"
|
||||
"<b>Tooltips :</b>"
|
||||
"<ul>"
|
||||
"<li><b>Start a new viewer :</b><br />"
|
||||
"<i>'/vis/open/...', for example '/vis/open OGL'</i>"
|
||||
"</li>"
|
||||
"<li><b>Draw the detector :</b><br />"
|
||||
"<i>'/vis/drawVolume'</i>"
|
||||
"</li>"
|
||||
"<li><b>Execute a macro file :</b><br />"
|
||||
"<i>'/control/execute my_macro_file'</i>"
|
||||
"</li>"
|
||||
"<li><b>Interacting with the viewer :</b><br />"
|
||||
"<i>"
|
||||
"Different viewers may behave somewhat differently, but the table gives a guide."
|
||||
"</i>"
|
||||
"</li>"
|
||||
"</ul>"
|
||||
"</div>"
|
||||
"</td>"
|
||||
"<td>"
|
||||
"<div style='background:#EEEEEE;'><br><br>"
|
||||
"<table border=\"1\">"
|
||||
"<tr><th>Action</th><th>Mouse actions</th><th>Trackpad actions</th></tr>"
|
||||
"<tr>"
|
||||
"<td>Rotate</td>"
|
||||
"<td>left-button-press move or middle-button-move</td>"
|
||||
"<td>one-finger-press-move or three-finger-move</td>"
|
||||
"</tr>"
|
||||
"<tr><td>Zoom</td><td>right-button-move</td><td>two-finger-move</td></tr>"
|
||||
"<tr><td>Zoom to cursor</td><td>SHIFT-Zoom</td><td>SHIFT-Zoom</td></tr>"
|
||||
"<tr><td>Pan</td><td>SHIFT-Rotate</td><td>SHIFT-Rotate</td></tr>"
|
||||
"</table>"
|
||||
"</div>"
|
||||
"</td>"
|
||||
"</table>"
|
||||
"</div>"
|
||||
|
||||
"<div style='background:#EEEEEE;'>"
|
||||
"<b>Documentation :</b>"
|
||||
"<ul>"
|
||||
"<li><b>Visualisation publication :</b><br />"+
|
||||
"<i>"
|
||||
"<a href='https://doi.org/10.48550/arXiv.1212.6923'>"
|
||||
"The Geant4 Visualisation System - A Multi-Driver Graphics System</b><br />"
|
||||
"Allison, J. et al., International Journal of Modeling, Simulation,"
|
||||
" and Scientific Computing, Vol. 4, Suppl. 1 (2013) 1340001"
|
||||
"</a><br/>http://www.worldscientific.com/doi/abs/10.1142/S1793962313400011"
|
||||
"</i>"
|
||||
"</li>"
|
||||
"</ul>"
|
||||
"</div>"
|
||||
|
||||
"<div style='background:#EEEEEE;'>"
|
||||
"<b>Getting Help :</b>"
|
||||
"<ul>"
|
||||
"<li>"
|
||||
"<b>"
|
||||
"If problems arise, try "
|
||||
"<a href='https://cern.ch/geant4-forum'>"
|
||||
"browsing the user forum"
|
||||
"</a>"
|
||||
"to see whether or not your problem has already been encountered.<br />"
|
||||
"If it hasn't, you can post it and Geant4 developers will do their best to find"
|
||||
" a solution. This is also a good place to<br />"
|
||||
"discuss Geant4 topics in general."
|
||||
"</b>"
|
||||
" https://cern.ch/geant4-forum"
|
||||
"</li>"
|
||||
"</ul>"
|
||||
"</div>"
|
||||
);
|
||||
// clang-format on
|
||||
|
||||
// fill right splitter
|
||||
@@ -3640,6 +3880,9 @@ void G4UIQt::AddIcon(
|
||||
else if (std::string(aIconFile) == "solid") {
|
||||
pix = fSolidIcon;
|
||||
}
|
||||
else if (std::string(aIconFile) == "point_cloud") {
|
||||
pix = fPointCloudIcon;
|
||||
}
|
||||
else if (std::string(aIconFile) == "hidden_line_removal") {
|
||||
pix = fHiddenLineRemovalIcon;
|
||||
}
|
||||
@@ -3658,6 +3901,12 @@ void G4UIQt::AddIcon(
|
||||
else if (std::string(aIconFile) == "exit") {
|
||||
pix = fExitIcon;
|
||||
}
|
||||
else if (std::string(aIconFile) == "reset_camera") {
|
||||
pix = fResetCameraIcon;
|
||||
}
|
||||
else if (std::string(aIconFile) == "resetTargetPoint") {
|
||||
pix = fResetTargetPointIcon;
|
||||
}
|
||||
else {
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
G4int verbose = UImanager->GetVerboseLevel();
|
||||
@@ -3723,30 +3972,20 @@ void G4UIQt::AddIcon(
|
||||
QAction* action = currentToolbar->addAction(
|
||||
QIcon(*pix), aIconFile, this, [this, txt]() { this->ChangeCursorAction(txt); });
|
||||
action->setCheckable(true);
|
||||
action->setChecked(true);
|
||||
action->setChecked(false);
|
||||
action->setData(aIconFile);
|
||||
|
||||
if (std::string(aIconFile) == "move") {
|
||||
SetIconMoveSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "rotate") {
|
||||
SetIconRotateSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "pick") {
|
||||
SetIconPickSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "zoom_in") {
|
||||
SetIconZoomInSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "zoom_out") {
|
||||
SetIconZoomOutSelected();
|
||||
}
|
||||
|
||||
// special case : surface style
|
||||
}
|
||||
else if ((std::string(aIconFile) == "hidden_line_removal") ||
|
||||
(std::string(aIconFile) == "hidden_line_and_surface_removal") ||
|
||||
(std::string(aIconFile) == "solid") || (std::string(aIconFile) == "wireframe"))
|
||||
(std::string(aIconFile) == "solid") ||
|
||||
(std::string(aIconFile) == "wireframe") ||
|
||||
(std::string(aIconFile) == "point_cloud"))
|
||||
{
|
||||
QString txt = QString(aIconFile);
|
||||
QAction* action = currentToolbar->addAction(
|
||||
@@ -3755,18 +3994,21 @@ void G4UIQt::AddIcon(
|
||||
action->setChecked(true);
|
||||
action->setData(aIconFile);
|
||||
|
||||
if (std::string(aIconFile) == "hidden_line_removal") {
|
||||
/*if (std::string(aIconFile) == "hidden_line_removal") {
|
||||
SetIconHLRSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "hidden_line_and_surface_removal") {
|
||||
SetIconHLHSRSelected();
|
||||
}
|
||||
}*/
|
||||
if (std::string(aIconFile) == "solid") {
|
||||
SetIconSolidSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "wireframe") {
|
||||
/*if (std::string(aIconFile) == "wireframe") {
|
||||
SetIconWireframeSelected();
|
||||
}
|
||||
if (std::string(aIconFile) == "point_cloud") {
|
||||
SetIconWireframeSelected();
|
||||
}*/
|
||||
|
||||
// special case : perspective/ortho
|
||||
}
|
||||
@@ -3784,6 +4026,10 @@ void G4UIQt::AddIcon(
|
||||
if (std::string(aIconFile) == "ortho") {
|
||||
SetIconOrthoSelected();
|
||||
}
|
||||
// special cases :"resetCamera"
|
||||
}
|
||||
else if (std::string(aIconFile) == "reset_camera") {
|
||||
currentToolbar->addAction(QIcon(*pix), aIconFile, this, [this]() { this->ResetCameraCallback(); });
|
||||
}
|
||||
else {
|
||||
// Find the command in the command tree
|
||||
@@ -3807,8 +4053,8 @@ void G4UIQt::AddIcon(
|
||||
}
|
||||
}
|
||||
QString txt = QString(aCommand);
|
||||
currentToolbar->addAction(
|
||||
QIcon(*pix), aCommand, this, [this, txt]() { this->ButtonCallback(txt); });
|
||||
currentToolbar->addAction(QIcon(*pix), aCommand, this,
|
||||
[this, txt]() { this->ButtonCallback(txt); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5299,6 +5545,14 @@ void G4UIQt::LookForHelpStringCallback()
|
||||
|
||||
void G4UIQt::OpenHelpTreeOnCommand(const QString& searchText)
|
||||
{
|
||||
// Invoke textual help (writes guidance to output window)
|
||||
ApplyShellCommand("help "+G4String(searchText.toStdString()), exitSession, exitPause);
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
// The code below searches the help tree and offers a list of commands matching searchText.
|
||||
// All is OK with Qt5, but there is an undiagnosed crash with Qt6, so disable this feature.
|
||||
// FIXME : JA 8/8/25
|
||||
|
||||
// the help tree
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
if (UI == nullptr) return;
|
||||
@@ -5406,6 +5660,7 @@ void G4UIQt::OpenHelpTreeOnCommand(const QString& searchText)
|
||||
fHelpTreeWidget->resizeColumnToContents(0);
|
||||
fHelpTreeWidget->sortItems(1, Qt::DescendingOrder);
|
||||
// fHelpTreeWidget->setColumnWidth(1,10);//resizeColumnToContents (1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
@@ -5559,38 +5814,40 @@ void G4UIQt::ChangeCursorAction(const QString& action)
|
||||
{
|
||||
// Theses actions should be in the app toolbar
|
||||
|
||||
if (fToolbarApp == nullptr) return;
|
||||
|
||||
QList<QAction*> list = fToolbarApp->actions();
|
||||
|
||||
if (action == "pick") {
|
||||
for (auto i : list) {
|
||||
if (i->data().toString() == "pick") {
|
||||
fPickSelected = !fPickSelected;
|
||||
i->setChecked(fPickSelected);
|
||||
if (fPickSelected) {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/picking true");
|
||||
CreatePickInfosDialog();
|
||||
} else {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/picking false");
|
||||
if (fPickInfosDialog != nullptr) fPickInfosDialog->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fMoveSelected = true;
|
||||
fPickSelected = true;
|
||||
fRotateSelected = true;
|
||||
fZoomInSelected = true;
|
||||
fZoomOutSelected = true;
|
||||
|
||||
if (fToolbarApp == nullptr) return;
|
||||
QList<QAction*> list = fToolbarApp->actions();
|
||||
for (auto i : list) {
|
||||
if (i->data().toString() == action) {
|
||||
i->setChecked(true);
|
||||
if (i->data().toString() == "pick") {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/picking true");
|
||||
CreatePickInfosDialog();
|
||||
|
||||
fPickInfosDialog->show();
|
||||
fPickInfosDialog->raise();
|
||||
fPickInfosDialog->activateWindow();
|
||||
}
|
||||
}
|
||||
else if (i->data().toString() == "move") {
|
||||
fMoveSelected = false;
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "pick") {
|
||||
fPickSelected = false;
|
||||
i->setChecked(false);
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/picking false");
|
||||
if (fPickInfosDialog != nullptr) {
|
||||
fPickInfosDialog->hide();
|
||||
}
|
||||
}
|
||||
else if (i->data().toString() == "rotate") {
|
||||
fRotateSelected = false;
|
||||
i->setChecked(false);
|
||||
@@ -5635,8 +5892,10 @@ void G4UIQt::ChangeSurfaceStyle(const QString& action)
|
||||
else if (i->data().toString() == "wireframe") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "point_cloud") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
}
|
||||
// FIXME : Should connect this to Vis
|
||||
|
||||
if (action == "hidden_line_removal") {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style w");
|
||||
@@ -5654,6 +5913,10 @@ void G4UIQt::ChangeSurfaceStyle(const QString& action)
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style w");
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0");
|
||||
}
|
||||
else if (action == "point_cloud") {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style c");
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0");
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::OpenIconCallback(const QString& aParam)
|
||||
@@ -5810,12 +6073,15 @@ void G4UIQt::ChangePerspectiveOrtho(const QString& action)
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::ResetCameraCallback() {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/resetCameraParameters");
|
||||
}
|
||||
|
||||
void G4UIQt::SetIconMoveSelected()
|
||||
{
|
||||
// Theses actions should be in the app toolbar
|
||||
fMoveSelected = true;
|
||||
fRotateSelected = false;
|
||||
fPickSelected = false;
|
||||
fZoomInSelected = false;
|
||||
fZoomOutSelected = false;
|
||||
|
||||
@@ -5828,9 +6094,6 @@ void G4UIQt::SetIconMoveSelected()
|
||||
else if (i->data().toString() == "rotate") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "pick") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "zoom_in") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
@@ -5845,7 +6108,6 @@ void G4UIQt::SetIconRotateSelected()
|
||||
// Theses actions should be in the app toolbar
|
||||
fRotateSelected = true;
|
||||
fMoveSelected = false;
|
||||
fPickSelected = false;
|
||||
fZoomInSelected = false;
|
||||
fZoomOutSelected = false;
|
||||
|
||||
@@ -5858,9 +6120,6 @@ void G4UIQt::SetIconRotateSelected()
|
||||
else if (i->data().toString() == "move") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "pick") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "zoom_in") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
@@ -5870,14 +6129,10 @@ void G4UIQt::SetIconRotateSelected()
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::SetIconPickSelected()
|
||||
void G4UIQt::TogglePickSelection()
|
||||
{
|
||||
// Theses actions should be in the app toolbar
|
||||
fPickSelected = true;
|
||||
fMoveSelected = false;
|
||||
fRotateSelected = false;
|
||||
fZoomInSelected = false;
|
||||
fZoomOutSelected = false;
|
||||
fPickSelected = !fPickSelected;
|
||||
|
||||
QToolBar* toolbar = fToolbarApp;
|
||||
if (! fDefaultIcons) {
|
||||
@@ -5888,22 +6143,10 @@ void G4UIQt::SetIconPickSelected()
|
||||
QList<QAction*> list = toolbar->actions();
|
||||
for (auto i : list) {
|
||||
if (i->data().toString() == "pick") {
|
||||
i->setChecked(true);
|
||||
i->setChecked(fPickSelected);
|
||||
}
|
||||
else if (i->data().toString() == "move") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "rotate") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "zoom_in") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "zoom_out") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::SetIconZoomInSelected()
|
||||
{
|
||||
@@ -5911,7 +6154,6 @@ void G4UIQt::SetIconZoomInSelected()
|
||||
fZoomInSelected = true;
|
||||
fMoveSelected = false;
|
||||
fRotateSelected = false;
|
||||
fPickSelected = false;
|
||||
fZoomOutSelected = false;
|
||||
|
||||
QToolBar* toolbar = fToolbarApp;
|
||||
@@ -5931,9 +6173,6 @@ void G4UIQt::SetIconZoomInSelected()
|
||||
else if (i->data().toString() == "rotate") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "pick") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "zoom_out") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
@@ -5946,7 +6185,6 @@ void G4UIQt::SetIconZoomOutSelected()
|
||||
fZoomOutSelected = true;
|
||||
fMoveSelected = false;
|
||||
fRotateSelected = false;
|
||||
fPickSelected = false;
|
||||
fZoomInSelected = false;
|
||||
|
||||
QToolBar* toolbar = fToolbarApp;
|
||||
@@ -5966,9 +6204,6 @@ void G4UIQt::SetIconZoomOutSelected()
|
||||
else if (i->data().toString() == "rotate") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "pick") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "zoom_in") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
@@ -5999,6 +6234,9 @@ void G4UIQt::SetIconSolidSelected()
|
||||
else if (i->data().toString() == "wireframe") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "point_cloud") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6026,6 +6264,9 @@ void G4UIQt::SetIconWireframeSelected()
|
||||
else if (i->data().toString() == "solid") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "point_cloud") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6053,6 +6294,9 @@ void G4UIQt::SetIconHLRSelected()
|
||||
else if (i->data().toString() == "wireframe") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "point_cloud") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6081,6 +6325,40 @@ void G4UIQt::SetIconHLHSRSelected()
|
||||
else if (i->data().toString() == "wireframe") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "point_cloud") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G4UIQt::SetIconCoudPointSelected()
|
||||
{
|
||||
// Theses actions should be in the app toolbar
|
||||
|
||||
QToolBar* toolbar = fToolbarApp;
|
||||
if (!fDefaultIcons) {
|
||||
toolbar = fToolbarUser;
|
||||
}
|
||||
if (toolbar == nullptr) return;
|
||||
|
||||
QList<QAction*> list = toolbar->actions();
|
||||
for (auto i : list) {
|
||||
if (i->data().toString() == "point_cloud") {
|
||||
i->setChecked(true);
|
||||
}
|
||||
else if (i->data().toString() == "wireframe") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "hidden_line_removal") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "hidden_line_and_surface_removal") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
else if (i->data().toString() == "solid") {
|
||||
i->setChecked(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user