AGX Dynamics  2.37.2.0
ParticleRenderWidget.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXQT_QTPARTICLERENDERWIDGET_H
18 #define AGXQT_QTPARTICLERENDERWIDGET_H
19 
20 #include <agxQt/export.h>
21 #include <agxQt/QtOSGUtils.h>
22 #include <agx/Referenced.h>
23 #include <agx/Bound.h>
24 #include <agxQt/ParticleFilters.h>
25 
26 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
27 #include <QWidget>
28 #include <QProcess>
29 #include <agxQt/ui_ParticleRenderSettingsWidget.h>
30 #include <osgViewer/ViewerEventHandlers>
31 #include <osgViewer/Renderer>
32 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
33 
34 #define DEFAULT_VIDEO_FPS 30
35 #define DEFAULT_CAPTURE_FPS 30
36 
37 #define QUALITY_INTERVAL 20
38 #define DEFAULT_QUALITY_TICK 17
39 
40 namespace agxQt
41 {
42  class QtAgxWrapper;
43 
44  class AGXQT_EXPORT ParticleRenderWidget : public QWidget
45  {
46  Q_OBJECT
47 
48  public:
49  explicit ParticleRenderWidget(QWidget *parent = 0);
50  virtual ~ParticleRenderWidget();
51 
53  void setInitialData( agxQt::QtAgxWrapper* wrapper );
54 
55  void setActiveColorModeFromName(const agx::String& mode);
56 
57  void setActiveParticleFilterFromName(const agx::String& name);
58 
59  agx::String getSelectedParticleFilterModeName() const { return m_activeParticleFilterMode.m_id; }
60 
61  protected:
62  void synchComboBox(const ParticleColorModeVector& modes);
63 
64  void synchComboBox(const ParticleRenderFilterModeVector& modes);
65 
66  signals:
67  void signalSynchSettingWithAgxInstance();
68  void signalRenderSettingsUpdated();
69 
70  protected:
71  void connectSignals();
72  void synchLabels();
73  bool hasParticleUtil();
74  bool hasValidColoring();
75 
76  protected slots:
77  void slotMinVelEditFinished();
78  void slotMaxVelEditFinished();
79  void slotSliderChanged(int val);
80 
81  void slotMinNetworkForceEditFinished();
82  void slotMaxNetworkForceEditFinished();
83  void slotImpactEnergyEditFinished();
84 
85  void slotColorSelectionChanged(int);
86  void slotPositionSliderChanged(int);
87  void slotSamplingEditFinished();
88  void slotParticleFilterModeChanged(int);
89  void slotFilterThresholdScalarEditFinished();
90 
91  void slotParticleContactNetworkCheckBox(bool enable);
92  void slotParticleTrajectoriesCheckBox(bool enable);
93  void slotLimitToAnalysisBoxCheckBox(bool enable);
94  void slotParticleRenderingCheckBox(bool enable);
95  void slotImpactGeometryParticleCheckBox(bool enable);
96  void slotImpactParticleParticleCheckBox(bool enable);
97  void slotShowColorLegendCheckBox(bool enable);
98 
100  // Variables
102  private:
103  ParticleRenderFilterModeVector m_particleParticleFilterModes;
104  ParticleFilterMode m_activeParticleFilterMode;
105  Ui::ParticleRenderWidget* m_ui;
108  agx::Vector<QCheckBox*> m_checkBoxes;
109  ParticleColorMode m_activeColorMode;
110  ParticleColorModeVector m_colorModes;
111  };
112 }
113 
114 #endif // QT_VIDEOSETTINGS_WIDGET
#define AGXQT_EXPORT
Contains classes/utility functions for connecting AGX to QT with OSG.
agx::String getSelectedParticleFilterModeName() const
Class that wraps SimulationController with an interface that enables QT Gui signals to control the si...
Definition: QtAgxWrapper.h:70