/* * Ray++ - Object-oriented ray tracing library * Copyright (C) 1998-2001 Martin Reinecke and others. * See the AUTHORS file for more information. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * See the README file for more information. */ #include "surfaces/lambert.h" #include "surfaces/pigments/pure_colour.h" namespace RAYPP { LAMBERT::LAMBERT () {} LAMBERT::LAMBERT (const HANDLE &pig) : Pigment (pig) {} LAMBERT::LAMBERT (const COLOUR &Col) : Pigment (Cnew PURE_COLOUR(Col)) {} //virtual void LAMBERT::Init () { if (initialized) return; if (!Pigment) error ("LAMBERT: no pigment given"); initialized = true; } //virtual void LAMBERT::Transform (const TRANSFORM &trans) { cni(); if (Pigment) Pigment->Transform (trans); } //virtual void LAMBERT::Get_Full_Shading_Info (const SHADING_INFO &In, FULL_SHADING_INFO &Out) const { SHADING_INFO &tmp = Out; tmp = In; Out.MC_diffuse = false; Out.reflect = false; Out.MC_reflect = false; Out.refract = false; Out.MC_refract = false; Out.Bumped_Normal = In.Normal; Out.Reflected = VECTOR (0,0,0); Out.Refracted = VECTOR (0,0,0); } //virtual COLOUR LAMBERT::Get_Total_Importance (const FULL_SHADING_INFO &, const VECTOR &) const { ci(); return COLOUR (0,0,0); } //virtual VECTOR LAMBERT::Get_MC_Reflected_Dir (const FULL_SHADING_INFO &) const { ci(); return VECTOR (0,0,0); } //virtual VECTOR LAMBERT::Get_MC_Refracted_Dir (const FULL_SHADING_INFO &) const { ci(); return VECTOR (0,0,0); } //virtual VECTOR LAMBERT::Get_MC_Diffuse_Dir (const FULL_SHADING_INFO &) const { ci(); return VECTOR (0,0,0); } //virtual COLOUR LAMBERT::Get_Emitted_Light (const FULL_SHADING_INFO &Info, const INCIDENT_ARRAY &, const COLOUR &, const COLOUR &, const INCIDENT_ARRAY &, const INCIDENT_ARRAY &, const INCIDENT_ARRAY &) const { ci(); return Pigment->Get_Colour (Info); } //virtual COLOUR LAMBERT::Get_Transmitted_Light (const SHADING_INFO &, const COLOUR &) const { ci(); return COLOUR (0,0,0); } void LAMBERT::Set_Pigment (const HANDLE &ThePig) { cni(); Pigment = ThePig; } } // namespace RAYPP