My Project
composite.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 #include "../stdafx.h"
3 #include "composite.h"
4 
6 {
7  this->ID = 0;
8 }
9 
11 {
12  this->clear();
13 }
14 
16 {
17  if (!obj)
18  {
19  throw CompositeAddNULLError();
20  }
21  this->objects.push_back(obj);
22  this->ID++;
23 }
24 
25 void Composite::modificate(Modification* modification, Vertex* center)
26 {
27  for (int i = 0; i < this->objects.size(); i++)
28  {
29  this->objects[i]->modificate(modification, center);
30  }
31 }
32 
34 {
35  for (int i = 0; i < this->objects.size(); i++)
36  {
37  if (this->objects[i]->ID == ID)
38  {
39  delete this->objects[i];
40  this->objects.erase(this->objects.begin() + i);
41  break;
42  }
43  }
44 }
45 
47 {
48  for (int i = 0; i < this->objects.size(); i++)
49  {
50  delete this->objects[i];
51  this->objects.erase(this->objects.begin() + i);
52  }
53 }
Define vertex consisting 3 double coordinates.
Definition: vertex.h:24
void remove(int ID)
Definition: composite.cpp:33
Brick archetecture.
Definition: brick.h:25
vector< Brick * > objects
Definition: composite.h:59
Composite class.
virtual void modificate(Modification *modification, Vertex *center) override
Definition: composite.cpp:25
void add(Brick *obj)
Definition: composite.cpp:15
void clear()
Definition: composite.cpp:46
Base modification object class.
Definition: modification.h:26