2021-09-28 14:10:44 +02:00
|
|
|
|
|
|
|
// This file is part of the Herezh++ application.
|
|
|
|
//
|
|
|
|
// The finite element software Herezh++ is dedicated to the field
|
|
|
|
// of mechanics for large transformations of solid structures.
|
|
|
|
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
|
|
|
|
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
|
|
|
|
//
|
|
|
|
// Herezh++ is distributed under GPL 3 license ou ultérieure.
|
|
|
|
//
|
2023-05-03 17:23:49 +02:00
|
|
|
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
|
2021-09-28 14:10:44 +02:00
|
|
|
// AUTHOR : Gérard Rio
|
|
|
|
// E-MAIL : gerardrio56@free.fr
|
|
|
|
//
|
|
|
|
// This program 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.
|
|
|
|
//
|
|
|
|
// This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
//
|
|
|
|
// For more information, please consult: <https://herezh.irdl.fr/>.
|
|
|
|
|
|
|
|
#ifndef RGB_H
|
|
|
|
#define RGB_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class Rgb
|
|
|
|
{
|
|
|
|
float r, g, b;
|
|
|
|
|
|
|
|
public :
|
|
|
|
Rgb();
|
|
|
|
Rgb(float, float, float);
|
|
|
|
|
|
|
|
friend istream& operator>>(istream& i, Rgb& c);
|
|
|
|
friend ostream& operator<<(ostream& o, const Rgb& c);
|
|
|
|
friend int operator != (Rgb c1, Rgb c2);
|
|
|
|
friend Rgb operator + (Rgb c1, Rgb c2);
|
|
|
|
friend Rgb operator * (float f, Rgb c);
|
|
|
|
friend Rgb hexaToRgb(const char*);
|
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
inline int operator != (Rgb c1, Rgb c2)
|
|
|
|
{
|
|
|
|
return (c1.r!=c2.r || c1.g!=c2.g || c1.b!=c2.b);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////
|
|
|
|
// couleurs utilisees pour les spectres :
|
|
|
|
const Rgb Noir(.1, .1, .1);
|
|
|
|
const Rgb Bleu(.0, .0, 1.);
|
|
|
|
const Rgb Bleu2(.07, .28, .8);
|
|
|
|
const Rgb Bleu3(.0, .5, 1.);
|
|
|
|
const Rgb Cyan(.0, 1., 1.);
|
|
|
|
const Rgb Cyan2(.0, .7, .9);
|
|
|
|
const Rgb Vert(.0, 1., .0);
|
|
|
|
const Rgb Vert2(.0, .85, .2);
|
|
|
|
const Rgb Jaune(1., 1., .0);
|
|
|
|
const Rgb Rouge(1., .0, .0);
|
|
|
|
const Rgb Violet(1., .0, 1.);
|
|
|
|
const Rgb Magenta(.425, .0, .425);
|
|
|
|
const Rgb Mag(.3, .0, .5);
|
|
|
|
const Rgb Blanc(1., 1., 1.);
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
// couleur par defaut pour les maillages:
|
|
|
|
// il faut esperer ne pas retrouver dans des legendes
|
|
|
|
// ou autre, car autrement ca ne sort pas
|
|
|
|
// (Cf sources de ostream& operator<<(ostream& o, const Rgb& c)
|
|
|
|
const Rgb DefautRgb(.0123, .0213, .0312);
|
|
|
|
|
|
|
|
#endif
|