Operation.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-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 MemoryX::gui-plugins::SceneEditor
19  * @date 2015
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #include "Operation.h"
25 
27  const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
28  const std::shared_ptr<scene3D::Scene>& scene,
29  const std::string& objectId) :
30  scene(scene), memoryXController(memoryXController), objectId(objectId)
31 {
32 }
33 
35  const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController,
36  const std::shared_ptr<scene3D::Scene>& scene) :
37  scene(scene), memoryXController(memoryXController), objectId()
38 {
39 }
40 
41 const std::shared_ptr<scene3D::Scene>
43 {
44  return scene.lock();
45 }
46 
47 const std::shared_ptr<memoryxcontroller::MemoryXController>
49 {
50  return memoryXController.lock();
51 }
52 
53 std::string
55 {
56  return objectId;
57 }
58 
59 void
60 controller::Operation::setObjectId(const std::string& objectId)
61 {
62  Operation::objectId = objectId;
63 }
64 
65 bool
67 {
68  return true;
69 }
controller::Operation::getObjectId
std::string getObjectId() const
Returns the ID of the object, this Operation is working on.
Definition: Operation.cpp:54
Operation.h
controller::Operation::getScene
const std::shared_ptr< scene3D::Scene > getScene() const
Returns the the Scene to execute the Operation at.
Definition: Operation.cpp:42
controller::Operation::getMemoryXController
const std::shared_ptr< memoryxcontroller::MemoryXController > getMemoryXController() const
Returns the the MemoryXController to execute the Operation at.
Definition: Operation.cpp:48
controller::Operation::Operation
Operation(const std::shared_ptr< memoryxcontroller::MemoryXController > &memoryXController, const std::shared_ptr< scene3D::Scene > &scene, const std::string &objectId)
A constructor.
Definition: Operation.cpp:26
controller::Operation::isExecuteable
virtual bool isExecuteable()
Return wehether the operation can be executed currently.
Definition: Operation.cpp:66
controller::Operation::setObjectId
void setObjectId(const std::string &objectId)
Sets the ID, this operation is working on.
Definition: Operation.cpp:60