This file is indexed.

/usr/include/BALL/VIEW/KERNEL/representation.h is in libballview1.4-dev 1.4.3~beta1-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
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

#ifndef  BALL_VIEW_KERNEL_REPRESENTATION_H
#define  BALL_VIEW_KERNEL_REPRESENTATION_H

#ifndef BALL_CONCEPT_PROPERTY_H
#	include <BALL/CONCEPT/property.h>
#endif

#ifndef BALL_CONCEPT_COMPOSITE_H
#	include <BALL/CONCEPT/composite.h>
#endif

#ifndef BALL_VIEW_KERNEL_COMMON_H
# include <BALL/VIEW/KERNEL/common.h>
#endif

#ifndef BALL_CONCEPT_MOLECULARINFORMATION_H
#	include <BALL/CONCEPT/molecularInformation.h>
#endif

#ifndef BALL_VIEW_KERNEL_MODELINFORMATION_H
#	include <BALL/VIEW/KERNEL/modelInformation.h>
#endif

// next two defines need to be included in header file, because of iC file
#ifndef BALL_VIEW_MODELS_MODELPROCESSOR_H
# include <BALL/VIEW/MODELS/modelProcessor.h>
#endif

#ifndef BALL_VIEW_MODELS_COLORPROCESSOR_H
# include <BALL/VIEW/MODELS/colorProcessor.h>
#endif


namespace BALL
{
	namespace VIEW
	{
		class ModelProcessor;
		class ColorProcessor;
		class GeometricObject;
		class UpdateRepresentationThread;
		class RepresentationManager;

		/** Representation
		 		A Representation is a collection of geometric objects for a group of 
				composites and a given model, for example a surface.
				An instance of Representation manages the memory for the geometric objects, the ColorProcessor and 
				the ModelProcessor. So when a Representation is destroyed, so are its geometric objects
				and processors. 
				It stores the drawing precision and mode.
				\ingroup ViewKernelGeometricPrimitives
		*/
		class BALL_VIEW_EXPORT Representation
			: public PropertyManager
		{
			friend class UpdateRepresentationThread;
			friend class RepresentationManager;
			public:

			BALL_CREATE(Representation)

			/** @name Enums
			 */
			//@{
			
			/// Properties
			enum Properties
			{
				///
				PROPERTY__ALWAYS_FRONT = 0,
				
				///
				PROPERTY__IS_COORDINATE_SYSTEM
			};
				
			//@}
			/**	@name	Constructors and Destuctor
			*/	
			//@{

			/** Default Constructor
			*/
			Representation();

			///
			Representation(ModelType model_type,
										 DrawingPrecision drawing_precision,
										 DrawingMode drawing_mode);

			/** Copy constructor
			*/
			Representation(const Representation& representation);

			/** Destructor
			*/
			virtual ~Representation();

			//@}
			/**	@name	Predicats and Accessors
			*/	
			//@{
			
			///
			const Representation& operator = (const Representation& rep);
			
			///
			void clear();

			///
			void setHidden(bool state) ;

			///
			bool isHidden() const;

			///
			void setDrawingPrecision(DrawingPrecision precision);

			///
			DrawingPrecision getDrawingPrecision() const;

			///
			float getSurfaceDrawingPrecision() const;

			///
			void setSurfaceDrawingPrecision(float precision);

			///
			void setDrawingMode(DrawingMode mode);

			///
			DrawingMode getDrawingMode() const;
			
			/// get transparency (0 - 255)
			Size getTransparency() const;

			/// set transparency (0 - 255)
			void setTransparency(Size value);
			
			///
			const GeometricObjectList& getGeometricObjects() const;

			///
			GeometricObjectList& getGeometricObjects();

			///
			void setGeometricObjects(GeometricObjectList& gol) 
				{ geometric_objects_ = gol;}

			///
			void insert(GeometricObject& object) ;

			///
			const std::list<const Composite*>& getComposites() const
				{ return composites_;}

			///
			void setComposites(const std::list<const Composite*>& composites);

			///
			void setComposite(const Composite* composite);

			///
			const ModelProcessor* getModelProcessor() const;

			///
			ModelProcessor* getModelProcessor();

			///
			void setModelProcessor(ModelProcessor* processor);
			
			///
			ColorProcessor* getColorProcessor();

			///
			void setColorProcessor(ColorProcessor* processor);

			///
			void setModelType(ModelType type);

			///
			ModelType getModelType() const;

			///
			String getName() const;

			///
			void setName(const String& name);

			/// Returns a human-readable, potentially abbreviated string describing the molecular entity this representation belongs to
			String getCompositeName() const;

			///
			void setColoringMethod(ColoringMethod type);

			///
			ColoringMethod getColoringMethod() const;

			///
			void enableModelUpdate(bool state);

			///
			void enableColoringUpdate(bool state) { coloring_update_enabled_ = state;}

			///
			bool modelUpdateEnabled() const { return model_update_enabled_;}

			///
			bool coloringUpdateEnabled() const { return coloring_update_enabled_;}

			/// Get a descpription string (nr triangles and geometric objects, transparency, mode)
			String getProperties() const;
			
			/// Check if drawing mode, transparency and drawing precision have reasonable values.
			bool isValid() const;

			/** Apply ModelProcessor (if rebuild) and ColorProcessor.
			 		The usage of these processors can be disabled, either by setting a NULL-pointer
					accordingly or call enableColoringUpdate(false) and enableModelUpdate(false).
			*/
			void update(bool rebuild);

			/// Clear and destroy all stored GeometricObject.
			void clearGeometricObjects();

			/** Get the time when the model was builded
			 		This is needed for updating the Representation, after
					the vector of atom attributes was modified.
					@see Atom::getAttributesModificationTime
			*/
			const PreciseTime& getModelBuildTime() const;

			/** Returns true, if Representation needs to be updated.
			 		Called by GeometricControl.
					Uses needs_update_.
			*/
			bool needsUpdate() const;

			///
			void setNeedsUpdate(bool state=true);

			/// Dum to ostream for debugging
			void dump(std::ostream& s = std::cout, Size depth = 0) const;

			/// Get a String containing all settings for Usage in project files.
			String toString() const;

			/// Set a custom ModelInformation e.g. when new models were added external of the library.
			void setModelInformation(const ModelInformation& mi);

			///
			const ModelInformation& getModelInformation() const;

			/// 
			bool operator == (const Representation& object) const;

		
			/// Needed for MSVC
			bool operator < (const Representation& object) const
				{ return this < &object;}

			//@}

			protected:

			/** Wrapper method for multithreading.
			 		Can be called by update() directly, or by the RepresentationManager' s 
					UpdateRepresentationThread.
			*/
			void update_();

			// Create a hashmap with the numerical position of every composite in its root Composite. 
			// Needed for toString().
			void collectRecursive_(const Composite& c, HashMap<const Composite*, Position>& hashmap) const;

			//_
			DrawingMode 				drawing_mode_;

			//_
			DrawingPrecision 		drawing_precision_;

			//_
			float 							surface_drawing_precision_;

			//_
			ModelType 					model_type_;

			//_
			ColoringMethod 			coloring_method_;

			//_
			Size  							transparency_;

			//_
			ModelProcessor* 		model_processor_;

			//_
			ColorProcessor* 		color_processor_;

			//_
			std::list<const Composite*> composites_;

			//_
			PreciseTime 				model_build_time_;

			//_ set to true, if update is called, while representation is hidden
			bool 								needs_update_;

			//_ true means the ModelProcessor will be applied in the next update
			bool 								rebuild_;

			//_ true means the ColorProcessor was changed since the last update call, so apply it!
			bool 								changed_color_processor_;

			//_
			bool 								hidden_;

			//_
			GeometricObjectList geometric_objects_;

			//_
			bool 								model_update_enabled_;

			//_
			bool 								coloring_update_enabled_;

			String 							name_;

			//_ 							  used for getName()
			static 							MolecularInformation information_;
			
			//_ 							  used for getName()
			static 							ModelInformation model_information_;

			const ModelInformation* custom_model_information_;
		};

		///
		typedef std::list<Representation*> RepresentationList;

#	ifndef BALL_NO_INLINE_FUNCTIONS
#		include <BALL/VIEW/KERNEL/representation.iC>
#	endif

	} // namespace VIEW
} // namespace BALL

#endif // BALL_VIEW_KERNEL_REPRESENTATION_H