AGX Dynamics  2.37.2.0
BufferPrinter.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 AGX_BUFFERPRINTER_H
18 #define AGX_BUFFERPRINTER_H
19 
20 #include <agx/Task.h>
21 #include <agx/TaskTemplate.h>
22 #include <agx/IndexRange.h>
23 #include <agx/Parameter.h>
24 #include <agx/Vector.h>
25 #include <agxIO/Events.h>
26 #include <agx/Bound.h>
27 #include <agx/String.h>
28 
29 namespace agx
30 {
31  class BufferPrinter : public SerialTask
32  {
33  public:
34  BufferPrinter(Device* device);
36  virtual void run();
37 
38  private:
39  ScalarParameterRef m_rangeParameter;
40  agx::Bound1u m_range;
41  size_t m_rangeLength;
42  agxIO::InputEvent::CallbackType m_printAlwaysCallback;
43  agxIO::InputEvent::CallbackType m_printOnceCallback;
44  agxIO::InputEvent::CallbackType m_printImmediatelyCallback;
45 
46  void print();
47  void requestOnePrint();
48  void requestContinuousPrint();
49  void requestImmediatePrint();
50  bool m_printOnce;
51 
54  Columns m_toPrint;
55  Vector<agx::UInt> m_columnWidths;
56 
57  void fillToPrint(const ParameterPtrVector& arguments);
58  void findColumnWidths();
59  void printColumns();
60 
61  };
62 }
63 
64 #endif
65 
SerialTask.
Definition: Task.h:469
Templated vector class.
Definition: Vector.h:52
BufferPrinter(Device *device)
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Callback2< T1, T2 > CallbackType
Definition: Event.h:37
virtual void run()
Execution callback.
An agx::Device is an abstract representation of a device on which data can be stored and processed...
Definition: Device.h:57