File: SASVertex.C

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 239,888 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 95
file content (134 lines) | stat: -rw-r--r-- 2,128 bytes parent folder | download | duplicates (10)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

#include <BALL/STRUCTURE/SASEdge.h>
#include <BALL/STRUCTURE/SASFace.h>
#include <BALL/STRUCTURE/SASVertex.h>
#include <BALL/MATHS/vector3.h>


namespace BALL
{

	SASVertex::SASVertex()
		
		: GraphVertex< SASVertex,SASEdge,SASFace >(),
			point_()
	{
	}


	SASVertex::SASVertex(const SASVertex& sasvertex, bool deep)
		
		: GraphVertex< SASVertex,SASEdge,SASFace >(sasvertex,deep),
			point_(sasvertex.point_)
	{
	}


	SASVertex::SASVertex(const TVector3<double>& point, Index index)
		
		: GraphVertex< SASVertex,SASEdge,SASFace >(),
			point_(point)
	{
		index_ = index;
	}


	SASVertex::~SASVertex()
		
	{
	}


	void SASVertex::set(const SASVertex& sasvertex, bool deep)
		
	{
		if (this != &sasvertex)
		{
			GraphVertex< SASVertex,SASEdge,SASFace >::set(sasvertex,deep);
			point_ = sasvertex.point_;
		}
	}


	SASVertex& SASVertex::operator = (const SASVertex& sasvertex)
		
	{
		if (this != &sasvertex)
		{
			GraphVertex< SASVertex,SASEdge,SASFace >::operator =
					(sasvertex);
			point_ = sasvertex.point_;
		}
		return *this;
	}


	void SASVertex::set(const TVector3<double> point, Index index)
		
	{
		point_ = point;
		index_ = index;
	}


	void SASVertex::setPoint(const TVector3<double>& point)
		
	{
		point_ = point;
	}


	TVector3<double> SASVertex::getPoint() const
		
	{
		return point_;
	}


	bool SASVertex::operator == (const SASVertex&) const
		
	{
		return true;
	}


	bool SASVertex::operator != (const SASVertex&) const
		
	{
		return false;
	}


	bool SASVertex::operator *= (const SASVertex&) const
		
	{
		return true;
	}


	std::ostream& operator << (std::ostream& s, const SASVertex& sasvertex)
	{
		s << "SASVERTEX"
			<< sasvertex.getIndex()
			<< "(" << sasvertex.getPoint()
			<< " [";
		 SASVertex::ConstEdgeIterator e;
		for (e = sasvertex.beginEdge(); e != sasvertex.endEdge(); e++)
		{
			s << (*e)->getIndex() << ' ';
		}
		s << "] [";
		 SASVertex::ConstFaceIterator f;
		for (f = sasvertex.beginFace(); f != sasvertex.endFace(); f++)
		{
			s << (*f)->getIndex() << ' ';
		}
		s << "] )";
		return s;
	}


}	// namespace BALL