This file is indexed.

/usr/include/BALL/STRUCTURE/graphVertex.h is in libball1.4-dev 1.4.1+20111206-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

#ifndef BALL_STRUCTURE_GRAPHVERTEX_H
#define BALL_STRUCTURE_GRAPHVERTEX_H

#ifndef BALL_COMMON_H
#	include <BALL/common.h>
#endif

#ifndef BALL_DATATYPE_HASHSET_H
#	include <BALL/DATATYPE/hashSet.h>
#endif

namespace BALL
{

	template <typename Vertex, typename Edge, typename Face>
	class GraphEdge;

	template <typename Vertex, typename Edge, typename Face>
	class GraphFace;

	template <typename Vertex, typename Edge, typename Face>
	class GraphTriangle;

	/** Generic GraphVertex Class.
		\ingroup Surface
	*/
	template <typename Vertex, typename Edge, typename Face>
	class GraphVertex
	{
		public:

		/** @name Class friends

					- class GraphEdge<Vertex,Edge,Face>;
					- class GraphFace<Vertex,Edge,Face>;
					- class GraphTriangle<Vertex,Edge,Face>;
				
		*/
		friend class GraphEdge<Vertex,Edge,Face>;
		friend class GraphFace<Vertex,Edge,Face>;
		friend class GraphTriangle<Vertex,Edge,Face>;

		BALL_CREATE(GraphVertex)

		/**	@name	Type definitions
		*/
		//@{

		typedef typename HashSet<Edge*>::Iterator EdgeIterator;
		typedef typename HashSet<Edge*>::ConstIterator ConstEdgeIterator;
		typedef typename HashSet<Face*>::Iterator FaceIterator;
		typedef typename HashSet<Face*>::ConstIterator ConstFaceIterator;

		//@}
		/**	@name	Constructors and Destructors
		*/
		//@{

		/**	Default constructor.
				This method creates a new GraphVertex object.
		*/
		GraphVertex()
			;

		/**	Copy constructor.
				Create a new GraphVertex object from another.
				@param	vertex	the GraphVertex object to be copied
				@param	deep	if deep = false, all pointers are set to NULL (default).
											Otherwise the new GraphVertex object is linked to the
											neighbours of the old GraphVertex object.
		*/
		GraphVertex(const GraphVertex<Vertex,Edge,Face>& vertex, bool deep = false)
			;

		/**	Destructor.
				Destructs the GraphVertex object.
		*/
		virtual ~GraphVertex()
			;
		//@}

		/**	@name	Assignment
		*/
		//@{

		/**	Assign from another GraphVertex.
				@param	vertex	the GraphVertex object to assign from
				@param	deep		if deep = false, all pointers are set to NULL	
												(default). Otherwise the GraphVertex object is linked	
												to the neighbours of the GraphVertex object to assign	
												from.
		*/
		void set(const GraphVertex<Vertex,Edge,Face>& vertex, bool deep = false)
			;

		/**	Assign from another GraphVertex.
				The GraphVertex object is linked to the neighbours of the GraphVertex	
				object to assign from.
				@param	vertex	the GraphVertex object to assign from
		*/
		GraphVertex<Vertex,Edge,Face>& operator =
				(const GraphVertex<Vertex,Edge,Face>& vertex)
			;

		//@}
		/**	@name	Accessors
		*/
		//@{

		/** Insert a new edge into the HashSet of edges the GraphVertex belongs to.
				@param	edge	a pointer to the new edge
		*/
		void insert(Edge* edge)
			;

		/** Insert a new face into the HashSet of faces the GraphVertex belongs to.
				@param	face	a pointer to the new face
		*/
		void insert(Face* face)
			;

		/** Remove an edge from the HashSet of edges the GraphVertex belongs to.
				@param	edge	a pointer to the edge to remove
		*/
		void remove(Edge* edge)
			;

		/** Remove a face from the HashSet of faces the GraphVertex belongs to.
				@param	face	a pointer to the face to remove
		*/
		void remove(Face* face)
			;

		/** Return the number of edges the GraphVertex belongs to.
				@return	Position	the number of edges the GraphVertex belongs to
		*/
		Position numberOfEdges() const
			;

		/** Return the number of faces the GraphVertex belongs to.
				@return	Position	the number of faces the GraphVertex belongs to
		*/
		Position numberOfFaces() const
			;

		/** Set the index of the vertex.
				@param	index	the new index
		*/
		void setIndex(Index index)
			;

		/** Return the index of the vertex.
				@return	Index	the index of the vertex
		*/
		Index getIndex() const
			;

		/** Join two GraphVertices if they are similar.
				All edges and faces of the given Vertex are inserted.
				@param	vertex	the Vertex to join with
				@return	bool		<b>true</b> if the vertices can be joined,
												<b>false</b> otherwise
		*/
		bool join(const Vertex& vertex)
			;

		/** Subsitute the GraphVertex by a similar one.
				The GraphVertex is substituted in all his Edges and Faces.
				@param	vertex	a pointer to the vertex to substitute
				@return	bool		<b>true</b> if the vertex can be substituted,
												<b>false</b> otherwise
		*/
		bool substitute(Vertex* vertex)
			;


		//@}
		/**	@name	Predicates
		*/
		//@{

		/**	Equality operator.
				@return	bool	<b>true</b>
		*/
		virtual bool operator == (const Vertex&) const
			;

		/**	Inequality operator.
				@return	bool	<b>false</b>
		*/
		virtual bool operator != (const Vertex&) const
			;

		/**	Similarity operator.
				@return	bool	<b>true</b>
		*/
		virtual bool operator *= (const Vertex&) const
			;

		/**	Test whether the vertex is meber of a given face.
				@param	face	a pointer to the the face to be tested
				@return	Face*	a pointer to the face if it exists, otherwise <b>NULL</b>
		*/
		Face* has(Face* face) const
			;

		/**	Test whether the vertex is meber of a given edge.
				@param	edge	a pointer to the edge to be tested
				@return	Edge*	a pointer to the edge if it exists, otherwise <b>NULL</b>
		*/
		Edge* has(Edge* edge) const
			;

		/**	Test whether the vertex has edges.
		*/
		bool hasEdges() const
			;

		/**	Test whether the vertex has faces.
		*/
		bool hasFaces() const
			;

		//@}
		/**	@name	External Iterators
		*/
		//@{

		EdgeIterator beginEdge()
			;
		ConstEdgeIterator beginEdge() const
			;
		EdgeIterator endEdge()
			;
		ConstEdgeIterator endEdge() const
			;
		FaceIterator beginFace()
			;
		ConstFaceIterator beginFace() const
			;
		FaceIterator endFace()
			;
		ConstFaceIterator endFace() const
			;

		//@}

		protected:

		/*_	@name	Attributes
		*/
		//@{

		/*_ The RSEdges the RSVetex belongs to
		*/
		HashSet<Edge*> edges_;
		/*_ The RSFaces the RSVetex belongs to
		*/
		HashSet<Face*> faces_;
		/*_ The index of the GraphVertex
		*/
		Index index_;

		//@}

	};



	template <typename Vertex, typename Edge, typename Face>
	GraphVertex<Vertex,Edge,Face>::GraphVertex()
		
		: edges_(),
			faces_(),
			index_(-1)
	{
	}


	template <typename Vertex, typename Edge, typename Face>
	GraphVertex<Vertex,Edge,Face>::GraphVertex
			(const GraphVertex<Vertex,Edge,Face>& vertex, bool deep)
		
		: edges_(),
			faces_(),
			index_(vertex.index_)
	{
		if (deep)
		{
			edges_ = vertex.edges_;
			faces_ = vertex.faces_;
		}
	}


	template <typename Vertex, typename Edge, typename Face>
	GraphVertex<Vertex,Edge,Face>::~GraphVertex()
		
	{
	}


	template <typename Vertex, typename Edge, typename Face>
	void GraphVertex<Vertex,Edge,Face>::set
			(const GraphVertex<Vertex,Edge,Face>& vertex, bool deep)
		
	{
		if (this != &vertex)
		{
			if (deep)
			{
				edges_ = vertex.edges_;
				faces_ = vertex.faces_;
			}
			index_ = vertex.index_;
		}
	}


	template <typename Vertex, typename Edge, typename Face>
	GraphVertex<Vertex,Edge,Face>& GraphVertex<Vertex,Edge,Face>::operator =
			(const GraphVertex<Vertex,Edge,Face>& vertex)
		
	{
		if (this != &vertex)
		{
			edges_ = vertex.edges_;
			faces_ = vertex.faces_;
			index_ = vertex.index_;
		}
		return *this;
	}


	template <typename Vertex, typename Edge, typename Face>
	void GraphVertex<Vertex,Edge,Face>::insert(Edge* edge)
		
	{
		edges_.insert(edge);
	}


	template <typename Vertex, typename Edge, typename Face>
	void GraphVertex<Vertex,Edge,Face>::insert(Face* face)
		
	{
		faces_.insert(face);
	}


	template <typename Vertex, typename Edge, typename Face>
	void GraphVertex<Vertex,Edge,Face>::remove(Edge* edge)
		
	{
		edges_.erase(edge);
	}


	template <typename Vertex, typename Edge, typename Face>
	void GraphVertex<Vertex,Edge,Face>::remove(Face* face)
		
	{
		faces_.erase(face);
	}


	template <typename Vertex, typename Edge, typename Face>
	Position GraphVertex<Vertex,Edge,Face>::numberOfEdges() const
		
	{
		return edges_.size();
	}


	template <typename Vertex, typename Edge, typename Face>
	Position GraphVertex<Vertex,Edge,Face>::numberOfFaces() const
		
	{
		return faces_.size();
	}


	template <typename Vertex, typename Edge, typename Face>
	void GraphVertex<Vertex,Edge,Face>::setIndex(Index index)
		
	{
		index_ = index;
	}


	template <typename Vertex, typename Edge, typename Face>
	Index GraphVertex<Vertex,Edge,Face>::getIndex() const
		
	{
		return index_;
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::substitute(Vertex* vertex)
		
	{
		if (*this *= *vertex)
		{
			typename HashSet<Edge*>::Iterator e;
			for (e = edges_.begin(); e != edges_.end(); e++)
			{
				(*e)->substitute((Vertex*)this,vertex);
			}
			typename HashSet<Face*>::Iterator f;
			for (f = faces_.begin(); f != faces_.end(); f++)
			{
				(*f)->substitute((Vertex*)this,vertex);
			}
			return true;
		}
		return false;
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::join(const Vertex& vertex)
		
	{
		if (*this *= vertex)
		{
			typename HashSet<Edge*>::ConstIterator e;
			for (e = vertex.edges_.begin(); e != vertex.edges_.end(); e++)
			{
				edges_.insert(*e);
			}
			typename HashSet<Face*>::ConstIterator f;
			for (f = vertex.faces_.begin(); f != vertex.faces_.end(); f++)
			{
				faces_.insert(*f);
			}
			return true;
		}
		else
		{
			return false;
		}
	}


	template <typename Vertex, typename Edge, typename Face>
	Face* GraphVertex<Vertex,Edge,Face>::has(Face* face) const
		
	{
		typename HashSet<Face*>::ConstIterator f;
		for (f = faces_.begin(); f != faces_.end(); f++)
		{
			if (*(*f) == *face)
			{
				return *f;
			}
		}
		return NULL;
	}


	template <typename Vertex, typename Edge, typename Face>
	Edge* GraphVertex<Vertex,Edge,Face>::has(Edge* edge) const
		
	{
		typename HashSet<Edge*>::ConstIterator e;
		for (e = edges_.begin(); e != edges_.end(); e++)
		{
			if (*(*e) == *edge)
			{
				return *e;
			}
		}
		return NULL;
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::hasEdges() const
		
	{
		return !edges_.isEmpty();
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::hasFaces() const
		
	{
		return !faces_.isEmpty();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::EdgeIterator
			GraphVertex<Vertex,Edge,Face>::beginEdge()
		
	{
		return edges_.begin();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::ConstEdgeIterator
			GraphVertex<Vertex,Edge,Face>::beginEdge() const
		
	{
		return edges_.begin();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::EdgeIterator
			GraphVertex<Vertex,Edge,Face>::endEdge()
		
	{
		return edges_.end();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::ConstEdgeIterator
			GraphVertex<Vertex,Edge,Face>::endEdge() const
		
	{
		return edges_.end();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::FaceIterator
			GraphVertex<Vertex,Edge,Face>::beginFace()
		
	{
		return faces_.begin();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::ConstFaceIterator
			GraphVertex<Vertex,Edge,Face>::beginFace() const
		
	{
		return faces_.begin();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::FaceIterator
			GraphVertex<Vertex,Edge,Face>::endFace()
		
	{
		return faces_.end();
	}


	template <typename Vertex, typename Edge, typename Face>
	typename GraphVertex<Vertex,Edge,Face>::ConstFaceIterator
			GraphVertex<Vertex,Edge,Face>::endFace() const
		
	{
		return faces_.end();
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::operator == (const Vertex&) const
		
	{
		return true;
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::operator != (const Vertex&) const
		
	{
		return false;
	}


	template <typename Vertex, typename Edge, typename Face>
	bool GraphVertex<Vertex,Edge,Face>::operator *= (const Vertex&) const
		
	{
		return true;
	}

} // namespace BALL

#endif // BALL_STRUCTURE_GRAPHVERTEX_H