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 
26 controller::Operation::Operation(const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController, const std::shared_ptr<scene3D::Scene>& scene, const std::string& objectId) :
27  scene(scene),
28  memoryXController(memoryXController),
29  objectId(objectId)
30 {
31 
32 }
33 
34 controller::Operation::Operation(const std::shared_ptr<memoryxcontroller::MemoryXController>& memoryXController, const std::shared_ptr<scene3D::Scene>& scene) :
35  scene(scene),
36  memoryXController(memoryXController),
37  objectId()
38 {
39 
40 }
41 
42 const std::shared_ptr<scene3D::Scene> controller::Operation::getScene() const
43 {
44  return scene.lock();
45 }
46 
47 const std::shared_ptr<memoryxcontroller::MemoryXController> controller::Operation::getMemoryXController() const
48 {
49  return memoryXController.lock();
50 }
51 
53 {
54  return objectId;
55 }
56 
57 void controller::Operation::setObjectId(const std::string& objectId)
58 {
59  Operation::objectId = objectId;
60 }
61 
63 {
64  return true;
65 }
controller::Operation::getObjectId
std::string getObjectId() const
Returns the ID of the object, this Operation is working on.
Definition: Operation.cpp:52
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:47
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:62
controller::Operation::setObjectId
void setObjectId(const std::string &objectId)
Sets the ID, this operation is working on.
Definition: Operation.cpp:57