AGX Dynamics  2.37.2.0
ImpactAnalysis.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_IMPACTANALYSIS_H
18 #define AGXQT_IMPACTANALYSIS_H
19 
20 #include <functional>
23 
25 #include <QThread>
26 #include <agx/PopDisableWarnings.h>
27 
28 namespace agxQt
29 {
30  // Time settings struct. Used in the export function for exporting data in time intervals.
31  struct TimeSettings
32  {
36  };
37 
42  {
43  public:
44  typedef std::function<bool(int, double)> StepforwardCallback;
45 
47  static bool writeSimulationDataToFile(agx::String filename,
48  agx::String sessionName,
49  const agx::Bound3& bound,
50  const TimeSettings& settings,
52  StepforwardCallback callback);
53  };
54 
56  class ContactWriterThread : public QThread
57  {
58  Q_OBJECT
59 
60  public:
71 
73  void setExportType(agx::GranularDataExporter::ExporterDataType type);
74 
76  void update(agx::String filename, agx::String sessionName, agx::AnalysisBox* bound);
77 
79  void setTimeSettings(const TimeSettings& timeSettings);
80 
82  void reset();
83 
84  // Set if the AnalysisBox should be used in the export.
85  void setShouldUseBound(bool enable);
86 
87  // Get if the AnalysisBox should be used in the export.
88  bool getShouldUseBound() const;
89 
90  public slots:
91  void slotAbortThread();
92 
93  signals:
94  void update(int);
95  void updateTimeLeft(double);
96 
97  protected:
98  void run();
99 
101  // Variables
103  public:
105  bool m_running;
106  protected:
107  agxSDK::SimulationController* m_controller;
114  };
115 }
116 
117 #endif
agxSDK::SimulationController * m_controller
Contains classes/utility functions for connecting AGX to QT with OSG.
agx::GranularDataExporter::ExporterDataType m_exportType
ExporterDataType
Export Data Type.
Thread class for writing simulation information to file.
std::function< bool(int, double)> StepforwardCallback
Class containing utility functions for exporting simulation data.
agx::AnalysisBox * m_bound
Class that can be used to extract data from elements in a simulation within a specified bound...
Definition: AnalysisBox.h:31
double Real
Definition: Real.h:42