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