My Project
vertex.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 #include "../stdafx.h"
3 #include "vertex.h"
4 
6 {
7  this->X = 0;
8  this->Y = 0;
9  this->Z = 0;
10 }
11 
12 Vertex::Vertex(double X, double Y, double Z)
13 {
14  this->X = X;
15  this->Y = Y;
16  this->Z = Z;
17 }
18 
19 Vertex::Vertex(const Vertex& other)
20 {
21  this->X = other.X;
22  this->Y = other.Y;
23  this->Z = other.Z;
24 }
25 
27 {
28  this->X = other.X;
29  this->Y = other.Y;
30  this->Z = other.Z;
31 }
32 
34 {
35  this->X = 0;
36  this->Y = 0;
37  this->Z = 0;
38 }
39 
41 {
42  this->X = other.X;
43  this->Y = other.Y;
44  this->Z = other.Z;
45  return *this;
46 }
47 
49 {
50  GVector vec(this->X, this->Y, this->Z, 1);
51  return vec;
52 }
53 
54 void Vertex::modificate(Modification* modification, Vertex* center)
55 {
56  modification->run(this);
57 }
58 
60 
61 {
62  GVector tmp(this->X, this->Y, this->Z, 1);
63 
64  tmp = tmp * matrix;
65 
66  Vertex vresult;
67 
68  vresult.X = tmp[0];
69  vresult.Y = tmp[1];
70  vresult.Z = tmp[2];
71  return vresult;
72 }
Vertex operator*(GMatrix matrix)
Definition: vertex.cpp:59
double X
Definition: vertex.h:90
virtual void run(BaseObject *vertex)=0
Define vertex consisting 3 double coordinates.
Definition: vertex.h:24
virtual void modificate(Modification *modification, Vertex *center) override
Definition: vertex.cpp:54
Define geometric vector.
Definition: gvector.h:26
GVector vector()
Definition: vertex.cpp:48
Vertex & operator=(Vertex other)
Definition: vertex.cpp:40
double Z
Definition: vertex.h:92
Define vertex consisting 3 double coordinates.
double Y
Definition: vertex.h:91
Vertex()
Definition: vertex.cpp:5
Define geometric matrix.
Definition: gmatrix.h:24
~Vertex()
Definition: vertex.cpp:33
Base modification object class.
Definition: modification.h:26