-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroup.cpp
More file actions
46 lines (39 loc) · 742 Bytes
/
Copy pathGroup.cpp
File metadata and controls
46 lines (39 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Russell Smith
* russellsmith@csu.fullerton.edu
* CS 566
* February 18, 2011
*/
#include "Group.h"
Group::Group()
{
}
Group::~Group()
{
// Free Object3D objects
std::vector<Object3D*>::iterator vecIt;
for(vecIt = vecObjects.begin(); vecIt != vecObjects.end(); ++vecIt)
{
delete *vecIt;
}
}
void Group::AddObject(Object3D* o)
{
vecObjects.push_back(o);
}
void Group::write(std::ostream &out) const
{
std::vector<Object3D*>::const_iterator vecIt;
for(vecIt = vecObjects.begin(); vecIt != vecObjects.end(); ++vecIt)
{
out << *vecIt << std::endl;
}
}
std::ostream& operator <<( std::ostream &out, const Object3D *o)
{
o->write(out);
return out;
}
const std::vector<Object3D*>& Group::Objects()
{
return vecObjects;
}