-
Notifications
You must be signed in to change notification settings - Fork 9
/
vertex.cpp
43 lines (34 loc) · 884 Bytes
/
vertex.cpp
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
#include "vertex.h"
Vertex::Vertex(Vertex *parent)
{
}
Vertex::Vertex(qreal xpos, qreal ypos, qreal zpos):QVector3D(xpos,ypos,zpos){
}
Vertex& Vertex::operator=(const Vertex & other){
this->setX(other.x());
this->setY(other.y());
this->setZ(other.z());
this->edges=other.edges;
return *this;
}
Vertex& Vertex::operator=(const QVector3D & other){
this->setX(other.x());
this->setY(other.y());
this->setZ(other.z());
this->edges.clear();
return *this;
}
void Vertex::addHalEdge(HalfEdge *edge){
if(edge!=NULL && !this->edges.contains(edge)){
this->edges.append(edge);
}
}
void Vertex::removeHalEdge(HalfEdge *edge){
this->edges.removeAt(this->edges.indexOf(edge));
}
QList<HalfEdge*> Vertex::getEdges(){
return this->edges;
}
QVector3D Vertex::toVector3D(){
return QVector3D(this->x(),this->y(),this->z());
}