StateMimeData.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarX::
17 * @author Mirko Waechter ( mirko.waechter at kit dot edu)
18 * @date 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #include "StateMimeData.h"
24 
25 namespace armarx
26 {
27 
28 
30  {
31  }
32 
33  bool
34  AbstractStateMimeData::hasFormat(const QString& mimetype) const
35  {
36  if (mimetype == formats().first())
37  {
38  return true;
39  }
40  else
41  {
42  return false;
43  }
44  }
45 
46  QStringList
48  {
49  return QStringList() << "application/x-State";
50  }
51 
52  QVariant
53  AbstractStateMimeData::retrieveData(const QString& mimetype, QVariant::Type preferredType) const
54  {
55  ARMARX_INFO_S << "retrieveData: " << mimetype.toStdString();
56 
57  if (mimetype == "application/x-State")
58  {
59  ARMARX_INFO_S << "Generating state variant";
60  QVariant v;
61  v.setValue(state);
63  return v;
64  }
65  else
66  {
67  return QMimeData::retrieveData(mimetype, preferredType);
68  }
69  }
70 
71  const QString&
73  {
74  return proxyName;
75  }
76 
77  void
79  {
80  proxyName = value;
81  }
82 
85  {
86  return state;
87  }
88 
89  void
91  {
92  state = value;
93  }
94 
95 
96 } // namespace armarx
armarx::AbstractStateMimeData::formats
QStringList formats() const override
Definition: StateMimeData.cpp:47
armarx::AbstractStateMimeData::hasFormat
bool hasFormat(const QString &mimetype) const override
Definition: StateMimeData.cpp:34
armarx::AbstractStateMimeData::setProxyName
void setProxyName(const QString &value)
Definition: StateMimeData.cpp:78
armarx::AbstractStateMimeData::getState
statechartmodel::StatePtr getState() const
Definition: StateMimeData.cpp:84
armarx::AbstractStateMimeData::setState
void setState(const statechartmodel::StatePtr &value)
Definition: StateMimeData.cpp:90
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::AbstractStateMimeData::getProxyName
const QString & getProxyName() const
Definition: StateMimeData.cpp:72
armarx::AbstractStateMimeData::AbstractStateMimeData
AbstractStateMimeData(statechartmodel::StatePtr state)
Definition: StateMimeData.cpp:29
armarx::aron::similarity::FloatSimilarity::Type
Type
The Type enum.
Definition: FloatSimilarity.h:10
armarx::AbstractStateMimeData::retrieveData
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const override
Definition: StateMimeData.cpp:53
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
armarx::AbstractStateMimeData::proxyName
QString proxyName
Definition: StateMimeData.h:59
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:48
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:202
StateMimeData.h
armarx::AbstractStateMimeData::state
statechartmodel::StatePtr state
Definition: StateMimeData.h:58
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27