Commit 7171e7cc authored by michael's avatar michael

hérite maintenant de lrpertcolorcomposed

parent a077825a
......@@ -24,13 +24,22 @@
/*---------------------------------------------------------------------------*
* constructors and destructor *
*---------------------------------------------------------------------------*/
LrPertColorTwoLayers::LrPertColorTwoLayers( LrPertColor *pertColorHaute,
LrPertColor *pertColorBasse,
Real coef)
:
LrPertColorComposed(),
m_coef(coef)
{
m_listPertColors.push_back(pertColorHaute);
m_listPertColors.push_back(pertColorBasse);
}
LrPertColorTwoLayers::LrPertColorTwoLayers(const LrPertColorTwoLayers &source)
:
LrPertColor(source),
m_pertColorHaute(source.m_pertColorHaute),
m_pertColorBasse(source.m_pertColorBasse),
LrPertColorComposed(source),
m_coef(source.m_coef)
{
......@@ -41,17 +50,6 @@ LrPertColorTwoLayers* LrPertColorTwoLayers::clone() const
return new LrPertColorTwoLayers(*this);
}
LrPertColorTwoLayers::LrPertColorTwoLayers( LrPertColor *pertColorHaute,
LrPertColor *pertColorBasse,
Real coef)
:
LrPertColor(),
m_pertColorHaute(pertColorHaute),
m_pertColorBasse(pertColorBasse),
m_coef(coef)
{
}
LrPertColorTwoLayers::~LrPertColorTwoLayers()
{
......@@ -93,10 +91,19 @@ bool operator != (const LrPertColorTwoLayers &lhs, const LrPertColorTwoLayers &r
LrColor LrPertColorTwoLayers::getColor(Real u, Real v, LrPoint &pointInter)const
{
//melange les 2 couches de couleurs
LrColor colorRes(m_coef*(m_pertColorHaute->getColor(u,v, pointInter)));
colorRes=colorRes+(m_pertColorBasse->getColor(u,v, pointInter));
LrPertColorList::const_iterator itH;
LrPertColorList::const_iterator itB;
itH=m_listPertColors.begin();
itB=m_listPertColors.end();
LrColor CoucheHaute=(*itH)->getColor(u,v, pointInter);
LrColor CoucheBasse=(*itB)->getColor(u,v, pointInter);
LrColor colorRes(m_coef* CoucheHaute);
colorRes=colorRes+CoucheBasse;
/*
LrColor colorRes;
if((v<0.17) )
......@@ -115,11 +122,9 @@ LrColor LrPertColorTwoLayers::getColor(Real u, Real v, LrPoint &pointInter)const
//colorRes=m_pertColorHaute->getColor(u,v, pointInter);
colorRes=LrColor::BLUE;
}
}
*/
return colorRes;
}
......
......@@ -17,7 +17,7 @@
#ifndef LRPERTCOLOR_COMPOSED_TWOLAYERS_H
#define LRPERTCOLOR_COMPOSED_TWOLAYERS_H
#include "LrPertColor.h"
#include "LrPertColorComposed.h"
/**
* @brief PertColor : les perturbations de couleur d'une optic.
......@@ -25,7 +25,7 @@
* Classe représentant une perturbation de couleur grace
* grace a deux perturbation de couleur
*/
class LrPertColorTwoLayers : public LrPertColor
class LrPertColorTwoLayers : public LrPertColorComposed
{
public:
......@@ -77,8 +77,7 @@ public:
private :
LrPertColor* m_pertColorHaute;
LrPertColor* m_pertColorBasse;
Real m_coef;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment