SimulatorViewerApp.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2013-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarXSimulation::application::SimulatorViewer
19  * @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu )
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
26 
27 #include <QApplication>
28 
29 #include "ArmarXSimulatorWindow.h"
35 
37 
38 
39 namespace armarx
40 {
43  {
44  public:
45  /**
46  * @see armarx::PropertyDefinitionContainer::PropertyDefinitionContainer()
47  */
49  {
50  defineOptionalProperty<float>("UpdateRate", 30.0f, "Rate at which the data is polled from the simulator");
51  defineOptionalProperty<bool>("UseDebugDrawer", false,
52  "Whether to create the debug drawer component for the viewer.");
53  }
54  };
55 
56 
57  /**
58  * @class SimulatorViewerApp
59  * @brief A viewer that visualizes the content of the ArmarX Simulator.
60  *
61  * The application creates an armarx::ArmarXPhysicsWorldVisualization component which connects to the SimulatorVisuUpdate topic
62  * in order to retrieve the visualization stream of the current simulated environment. The simulator data stream is continously processed and
63  * the visualization is updated accordingly. The viewer is capable of generating a complete visualization at any time.
64  * Hence, it can be started from any PC in the network at any time.
65  *
66  *
67  *
68  */
70  public QObject,
71  virtual public armarx::Application
72  {
73  Q_OBJECT
74  public:
75  /**
76  * Constructor
77  */
79 
80  ~SimulatorViewerApp() override;
81 
82  /**
83  * @see armarx::Application::setup()
84  */
85  void setup(const ManagedIceObjectRegistryInterfacePtr& registry,
86  Ice::PropertiesPtr properties) override;
87 
88  /**
89  * Runs the Qt Event Loop
90  */
91  int exec(const ArmarXManagerPtr& armarXManager) override;
92 
93  /*!
94  * \brief interruptCallback Recieve interrupt callbacks to gracefully shut down simulator
95  * \param signal
96  */
97  void interruptCallback(int signal) override;
98 
100  {
102  }
103  private slots:
104  void closeRequest_sent();
105 
106  protected:
107  QCoreApplication* qApplication;
110 
112 
113  // the one and only mutex
115 
117  };
118 }
armarx::SimulatorViewerApp::exitApplication
bool exitApplication
Definition: SimulatorViewerApp.h:116
ArmarXSimulatorWindow.h
armarx::SimulatorViewerApp::mutex
CoinViewer::RecursiveMutexPtr mutex
Definition: SimulatorViewerApp.h:114
armarx::SimulatorViewerApp::simVisu
ArmarXPhysicsWorldVisualizationPtr simVisu
Definition: SimulatorViewerApp.h:111
armarx::SimulatorViewerApp::qApplication
QCoreApplication * qApplication
Definition: SimulatorViewerApp.h:107
ObjectClass.h
armarx::SimulatorViewerApp::interruptCallback
void interruptCallback(int signal) override
interruptCallback Recieve interrupt callbacks to gracefully shut down simulator
Definition: SimulatorViewerApp.cpp:245
armarx::SimulatorViewerApp::exec
int exec(const ArmarXManagerPtr &armarXManager) override
Runs the Qt Event Loop.
Definition: SimulatorViewerApp.cpp:96
armarx::SimulatorViewerAppPropertyDefinitions::SimulatorViewerAppPropertyDefinitions
SimulatorViewerAppPropertyDefinitions(std::string prefix)
Definition: SimulatorViewerApp.h:48
armarx::SimulatorViewerApp::debugDrawer
memoryx::EntityDrawerComponentPtr debugDrawer
Definition: SimulatorViewerApp.h:109
IceInternal::Handle< ::Ice::Properties >
armarx::Application::getDomainName
virtual std::string getDomainName()
Retrieve the domain name used for property parsing.
Definition: Application.cpp:602
ArmarXPhysicsWorldVisualization.h
armarx::SimulatorViewerApp
A viewer that visualizes the content of the ArmarX Simulator.
Definition: SimulatorViewerApp.h:69
armarx::SimulatorViewerApp::setup
void setup(const ManagedIceObjectRegistryInterfacePtr &registry, Ice::PropertiesPtr properties) override
Definition: SimulatorViewerApp.cpp:55
armarx::SimulatorViewerApp::~SimulatorViewerApp
~SimulatorViewerApp() override
Definition: SimulatorViewerApp.cpp:47
armarx::CoinViewer::RecursiveMutexPtr
std::shared_ptr< RecursiveMutex > RecursiveMutexPtr
Definition: CoinViewer.h:52
armarx::SimulatorViewerApp::mainWindow
ArmarXSimulatorWindowPtr mainWindow
Definition: SimulatorViewerApp.h:108
MemoryXCoreObjectFactories.h
armarx::SimulatorViewerApp::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SimulatorViewerApp.h:99
armarx::Application
Baseclass for all ArmarX applications.
Definition: Application.h:193
armarx::ApplicationPropertyDefinitions
Application property definition container.
Definition: Application.h:101
EntityDrawerComponent.h
IceUtil::Handle< ManagedIceObjectRegistryInterface >
MemoryXTypesObjectFactories.h
ARMARXCORE_IMPORT_EXPORT
#define ARMARXCORE_IMPORT_EXPORT
Definition: ImportExport.h:38
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
CoinViewer.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::SimulatorViewerAppPropertyDefinitions
Definition: SimulatorViewerApp.h:41
Application.h
armarx::SimulatorViewerApp::SimulatorViewerApp
SimulatorViewerApp()
Constructor.
Definition: SimulatorViewerApp.cpp:41