SceneGroup.h
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 #pragma once
25 
26 #include <vector>
27 
28 #include "SceneGroupManager.h"
29 #include "SceneObject.h"
30 
31 namespace scene3D
32 {
33  class SceneGroup
34  {
35  friend class SceneGroupManager;
36 
37  public:
38  /**
39  * Constructor
40  * Creates an instance of the class.
41  *
42  * @param groupID ID of the SceneGroup
43  */
44  SceneGroup(const std::string& groupID);
45 
46  /**
47  * Returns the ID of the SceneGroup.
48  *
49  * @return string ID of SceneGroup
50  */
51  std::string getGroupId();
52 
53  /**
54  * Returns all Objects in SceneGroup.
55  *
56  * @return vector<scene3D::SceneObjectPtr > All Objects in SceneGroup
57  */
58  std::vector<scene3D::SceneObjectPtr> getAllObjects();
59 
60  /**
61  * Checks, if SceneGroup contains Object.
62  *
63  * @param object Object to check Existence
64  * @return bool SceneGroup contains Object
65  */
66  bool contains(scene3D::SceneObjectPtr object);
67 
68  /**
69  * Adds an Object to the SceneGroup.
70  *
71  * @param object Object to be added
72  */
74 
75  /**
76  * Removes an Object from the SceneGroup.
77  *
78  * @param object Object to be removed
79  */
81 
82  /**
83  * Removes all Objects from the SceneGroup.
84  *
85  */
86  void clearGroup();
87 
88  private:
89  std::string groupID;
90 
91  void setGroupId(std::string groupId);
92  std::vector<scene3D::SceneObjectPtr> objects;
93  };
94 } // namespace scene3D
scene3D::SceneGroup::getGroupId
std::string getGroupId()
Returns the ID of the SceneGroup.
Definition: SceneGroup.cpp:31
scene3D::SceneGroup::addObject
void addObject(scene3D::SceneObjectPtr object)
Adds an Object to the SceneGroup.
Definition: SceneGroup.cpp:49
scene3D::SceneGroup::clearGroup
void clearGroup()
Removes all Objects from the SceneGroup.
Definition: SceneGroup.cpp:73
scene3D::SceneGroup
Definition: SceneGroup.h:33
SceneGroupManager.h
scene3D::SceneGroup::contains
bool contains(scene3D::SceneObjectPtr object)
Checks, if SceneGroup contains Object.
Definition: SceneGroup.cpp:43
scene3D::SceneGroupManager
Definition: SceneGroupManager.h:34
SceneObject.h
scene3D
Definition: ManipulatorMode.h:26
scene3D::SceneObjectPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
Definition: PointerDefinitions.h:40
scene3D::SceneGroup::getAllObjects
std::vector< scene3D::SceneObjectPtr > getAllObjects()
Returns all Objects in SceneGroup.
Definition: SceneGroup.cpp:37
scene3D::SceneGroup::SceneGroup
SceneGroup(const std::string &groupID)
Constructor Creates an instance of the class.
Definition: SceneGroup.cpp:78
scene3D::SceneGroup::removeObject
void removeObject(scene3D::SceneObjectPtr object)
Removes an Object from the SceneGroup.
Definition: SceneGroup.cpp:62