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  state(state)
31  {
32 
33  }
34 
35  bool AbstractStateMimeData::hasFormat(const QString& mimetype) const
36  {
37  if (mimetype == formats().first())
38  {
39  return true;
40  }
41  else
42  {
43  return false;
44  }
45  }
46  QStringList AbstractStateMimeData::formats() const
47  {
48  return QStringList() << "application/x-State";
49  }
50 
51  QVariant AbstractStateMimeData::retrieveData(const QString& mimetype, QVariant::Type preferredType) const
52  {
53  ARMARX_INFO_S << "retrieveData: " << mimetype.toStdString();
54 
55  if (mimetype == "application/x-State")
56  {
57  ARMARX_INFO_S << "Generating state variant";
58  QVariant v;
59  v.setValue(state);
61  return v;
62  }
63  else
64  {
65  return QMimeData::retrieveData(mimetype, preferredType);
66  }
67  }
68  const QString& AbstractStateMimeData::getProxyName() const
69  {
70  return proxyName;
71  }
72 
74  {
75  proxyName = value;
76  }
77 
79  {
80  return state;
81  }
82 
84  {
85  state = value;
86  }
87 
88 
89 
90 
91 }
92 
93 
94 
95 
armarx::AbstractStateMimeData::formats
QStringList formats() const override
Definition: StateMimeData.cpp:46
armarx::AbstractStateMimeData::hasFormat
bool hasFormat(const QString &mimetype) const override
Definition: StateMimeData.cpp:35
armarx::AbstractStateMimeData::setProxyName
void setProxyName(const QString &value)
Definition: StateMimeData.cpp:73
armarx::AbstractStateMimeData::getState
statechartmodel::StatePtr getState() const
Definition: StateMimeData.cpp:78
armarx::AbstractStateMimeData::setState
void setState(const statechartmodel::StatePtr &value)
Definition: StateMimeData.cpp:83
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::AbstractStateMimeData::getProxyName
const QString & getProxyName() const
Definition: StateMimeData.cpp:68
armarx::AbstractStateMimeData::AbstractStateMimeData
AbstractStateMimeData(statechartmodel::StatePtr state)
Definition: StateMimeData.cpp:29
armarx::aron::similarity::FloatSimilarity::Type
Type
The Type enum.
Definition: FloatSimilarity.h:8
armarx::AbstractStateMimeData::retrieveData
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const override
Definition: StateMimeData.cpp:51
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:57
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:46
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:195
StateMimeData.h
armarx::AbstractStateMimeData::state
statechartmodel::StatePtr state
Definition: StateMimeData.h:56
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:28