My Project
normal.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 #include "../stdafx.h"
3 #include "normal.h"
4 
6 Normal::Normal(const GVector& v) : GVector(v) {}
8 Normal::Normal(const Normal& other) : GVector(other) {}
9 Normal::Normal(Normal&& other) : GVector(other) {}
10 Normal::Normal(double X, double Y, double Z, double length) : GVector(X, Y, Z, length) {}
12 
14 {
15  return Normal(static_cast<GVector&>(*this) = static_cast<GVector>(other));
16 }
17 
19 {
20  return Normal(static_cast<GVector>(*this) + static_cast<GVector>(other));
21 }
22 
24 {
25  return Normal(static_cast<GVector>(*this) - static_cast<GVector>(other));
26 }
27 
28 Normal Normal::operator/(const double value)
29 {
30  return Normal(static_cast<GVector>(*this) / value);
31 }
32 
33 Normal Normal::operator*(const double value)
34 {
35  return Normal(static_cast<GVector>(*this) * value);
36 }
37 
38 double& Normal::operator[](const size_t index)
39 {
40  return static_cast<GVector>(*this)[index];
41 }
42 
43 const double& Normal::operator[](const size_t index) const
44 {
45  return static_cast<GVector>(*this)[index];
46 }
47 
49 {
50  Normal result = Normal(static_cast<GVector>(*this) * matrix);
51  return result;
52 }
53 
54 void Normal::modificate(Modification* modification, Vertex* center)
55 {
56  modification->run(this);
57 }
virtual void run(BaseObject *vertex)=0
Normal()
Definition: normal.cpp:5
Normal operator+(const Normal &other)
Definition: normal.cpp:18
Define vertex consisting 3 double coordinates.
Definition: vertex.h:24
Normal & operator=(Normal other)
Definition: normal.cpp:13
Define geometric vector.
Definition: gvector.h:26
virtual void modificate(Modification *modification, Vertex *center) override
Definition: normal.cpp:54
Define normal (object container for GVector)
Definition: normal.h:24
Normal operator-(const Normal &other)
Definition: normal.cpp:23
~Normal()
Definition: normal.cpp:11
double & operator[](const size_t index)
Definition: normal.cpp:38
Normal operator*(const double value)
Definition: normal.cpp:33
Define geometric matrix.
Definition: gmatrix.h:24
Normal operator/(const double value)
Definition: normal.cpp:28
Define normal (object container for GVector)
double length()
Definition: gvector.cpp:106
Base modification object class.
Definition: modification.h:26