Main Page | Class Hierarchy | Class List | File List | Class Members

material3d.h

00001 /* ************************************************************************* 00002 material3d.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: material3d_8h-source.html,v 1.1 2005/02/04 21:02:27 micha Exp $ 00009 00010 ************************************************************************* */ 00011 00012 /* ************************************************************************* 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ************************************************************************* */ 00020 00021 #ifndef MATERIAL3D_H 00022 #define MATERIAL3D_H 00023 00024 #include "types.h" 00025 #include "transparenttransformatable.h" 00026 //#include "object3d.h" 00027 #include "texture3d.h" 00028 #include "interior.h" 00029 00035 class Material3D: public TransparentTransformatable { 00036 00037 public: // Public attributes 00038 Texture3D* texture; 00039 Interior* interior; 00040 00041 public: // Constructors and destructor 00042 Material3D(): texture(0), interior(0) {} 00043 Material3D(Texture3D* t, Interior* i): texture(t), interior(i) {} 00044 Material3D(const Material3D& m): TransparentTransformatable(m) { 00045 if (m.texture) texture = new Texture3D(*m.texture); else texture = 0; 00046 if (m.interior) interior = new Interior(*m.interior); else interior = 0; 00047 } 00048 00049 ~Material3D() { 00050 delete(texture); 00051 delete(interior); 00052 } 00053 00054 private: 00055 Material3D& operator=(const Material3D&); 00056 00057 public: // Public methods 00060 void overlay(const Material3D& m) { 00061 if (!texture) 00062 texture = new Texture3D(*m.texture); 00063 else 00064 texture->overlay(*m.texture); 00065 00066 if (!interior) 00067 interior = new Interior(*m.interior); 00068 else 00069 interior->overlay(*m.interior); 00070 } 00071 00072 }; 00073 00074 00075 #endif

Generated on Thu Jan 27 12:16:05 2005 for raytracer.kdevelop by doxygen 1.3.8