Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

quadricRGBfunctions.h 1.74 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
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
/*
 * quadricLF.h
 *
 *  Created on: Nov 4, 2010
 *      Author: kenneth
 */

#ifndef QUADRICLF_H_
#define QUADRICLF_H_


#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"

using namespace CGoGN;

enum channel {RED=0, GREEN, BLUE};
#define COLCHANNELS 3

template <typename REAL>
class QuadricRGBfunctions {
public:
	typedef Geom::Vector<3,REAL> VEC3;
	typedef Geom::Vector<6,REAL> VEC6;
	typedef Geom::Matrix<6,6,REAL> MATRIX66;

	typedef Geom::Matrix<3,3,REAL> MATRIX33;
	typedef Quadric<REAL> QUADRIC;
	typedef MATRIX33 FRAME;
	typedef Geom::Matrix<3,6,REAL> RGBFUNCTIONS;

private:
	MATRIX66 A[COLCHANNELS];
	VEC6 b[COLCHANNELS];
	REAL c[COLCHANNELS];


public:
	static std::string CGoGNnameOfType() ;

	QuadricRGBfunctions();
	QuadricRGBfunctions(int i);
	QuadricRGBfunctions(const QuadricRGBfunctions&);
44
	QuadricRGBfunctions(const RGBFUNCTIONS&, const REAL gamma = REAL(0), const REAL alpha = REAL(0)) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
45

46
	virtual ~QuadricRGBfunctions() {} ;
Pierre Kraemer's avatar
Pierre Kraemer committed
47
48
49
50
51
52
53

	REAL operator() (const RGBFUNCTIONS&) const;

	bool findOptimizedRGBfunctions(RGBFUNCTIONS& lff) const;

	void operator += (const QuadricRGBfunctions&) ;
	void operator -= (const QuadricRGBfunctions&) ;
54
55
	void operator *= (const REAL v) ;
	void operator /= (const REAL v) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
56
57
58
59
60
61
62

	void zero () ;

	friend std::ostream& operator<< (std::ostream &out, const QuadricRGBfunctions&) {return out;};
	friend std::istream& operator>> (std::istream &in, const QuadricRGBfunctions&) {return in;};

private :
63
64
65
66
	void buildIntegralMatrix_A(MATRIX66 &, const REAL alpha) const;
	void buildIntegralMatrix_b(MATRIX66 &, const REAL alpha) const;
	void buildIntegralMatrix_c(MATRIX66 &, const REAL alpha) const;
	void buildRotateMatrix(MATRIX66 &N, const REAL gamma) const;
Pierre Kraemer's avatar
Pierre Kraemer committed
67
68
69
70
71
72
73

};


#include "quadricRGBfunctions.hpp"

#endif /* QUADRICLF_H_ */