This file is indexed.

/usr/include/miaviewit-1.0/viewit/smarty.hh is in libmiaviewit-dev 1.0.4-1+b1.

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
/* -*- mia-c++ -*-
 *
 * This file is part of viewitgui - a library and program for the
 * visualization of 3D data sets. 
 *
 * Copyright (c) Leipzig, Madrid 1999-2013 Mirco Hellmann, Gert Wollny
 *
 * viewitgui is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * viewitgui is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with viewitgui; if not, see <http://www.gnu.org/licenses/>.
 */


#ifndef __smarties_hh
#define __smarties_hh

#include <memory>
#include <viewit/drawable.hh>
#include <GL/glu.h>

class CShape;
class CShading; 

#define SMARTIES_CLASSNAME "TSmarties"

/**
   Ths smarty is an ellisoide shape that corresponds to a 3x3 tensor describing, e.g. diffusion patterns.
   It will be colored based on the main axis direction and its size corresponds to the tensor "magnitute"   
*/
class TSmarty {
public:
	/** initialze a smarty with its position 
	    \param position  the position of the center of the smarty
	    \param cshape a shaping policy
	    \param cshading a shadingpolicy
	 */
	TSmarty(const C3DFVector& position, std::shared_ptr<CShape> cshape, std::shared_ptr<CShading> shading);
	
	/// copy constructor
	TSmarty(const TSmarty& org);

	/// copy constructor
	TSmarty& operator = (const TSmarty& org);
		
	/// clean up the data
	~TSmarty();
	
	/** prepare the smarty for drawing */
	virtual void pre_draw();
	
	/** clean up after drawing */
	virtual void post_draw();
	
	/** create the neccessary GL-instances */
	virtual void gl_attach();
	
	/** remove the neccessary GL-instances */
	virtual void gl_detach();
	
	bool operator == (const TSmarty& other) {
		return m_position == other.m_position;
	}
	
	bool operator != (const TSmarty& other) {
		return ! (*this == other); 
	}

private:
	C3DFVector  m_position; 
	std::shared_ptr<CShape> m_shape; 
	std::shared_ptr<CShading> m_shading; 
};


/** this is the "official" drawable, that handles the smarties */
class TSmarties : public TDrawable {
public:
	TSmarties(const string& name);
	~TSmarties();
	
	void add_smarty(TSmarty *smarty);
	void remove_smarty(TSmarty *smarty);
	
	void increase_smarty_number();
	void decrease_smarty_number();
	
	virtual void gl_attach();
	virtual void gl_detach();
	virtual const char* get_classname() const;
	virtual void get_classname_list(list<string> *classlist) const;
	
protected:
	virtual void do_gl_draw(const TCamera& c) const; 
	virtual bool do_handle_key_event(int key);
	virtual bool do_handle_command_event(PEventInfo info);
	

private:
	enum EDrawStepType  {
		dst_selection,
		dst_forward,
		dst_backward
 	};
	
	
	GLUquadricObj *		m_qobj;
 	GLuint			m_GLSphereDrawList;
	std::list<TSmarty *>	m_smarties;
	unsigned int		m_draw_smarty_step;
	EDrawStepType		m_draw_smarty_step_kind;
	
};

#endif