light.C

Go to the documentation of this file.
00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and
00008  * its documentation under the terms of the GNU General Public License is
00009  * hereby granted. No representations are made about the suitability of
00010  * this software for any purpose. It is provided "as is" without express
00011  * or implied warranty. See the GNU General Public License
00012  * (http://www.gnu.org/copyleft/gpl.html) for more details.
00013  *
00014  * The characters in this file are ISO8859-1 encoded.
00015  *
00016  * The documentation in this file is in "Doxygen" style
00017  * (http://www.doxygen.org).
00018  */
00019 
00026 #include <archon/x3d/server/field_type.H>
00027 #include <archon/x3d/server/field.H>
00028 #include <archon/x3d/server/light.H>
00029 
00030 namespace Archon
00031 {
00032   namespace X3D
00033   {
00034     const NodeType *LightNode::type = 0;
00035     const NodeType *DirectionalLight::type = 0;
00036     const NodeType *PointLight::type = 0;
00037     const NodeType *SpotLight::type = 0;
00038 
00039     void initializeLightComponent()
00040     {
00041       vector<const FieldBase *> fields;
00042 
00043 
00044       // LightNode
00045 
00046       fields.push_back(newExposedField("ambientIntensity", SFFloat::type,
00047                                        &LightNode::ambientIntensity,
00048                                        &LightNode::ambientIntensityChanged,
00049                                        &LightNode::ambientIntensityStamp));
00050       fields.push_back(newExposedField("color", SFColor::type,
00051                                        &LightNode::color,
00052                                        &LightNode::colorChanged,
00053                                        &LightNode::colorStamp));
00054       fields.push_back(newExposedField("intensity", SFFloat::type,
00055                                        &LightNode::intensity,
00056                                        &LightNode::intensityChanged,
00057                                        &LightNode::intensityStamp));
00058       fields.push_back(newExposedField("on", SFBool::type,
00059                                        &LightNode::on,
00060                                        &LightNode::onChanged,
00061                                        &LightNode::onStamp));
00062       LightNode::type =
00063         NodeType::newAbstract("LightNode", false, &fields,
00064                               ChildNode::type);
00065       fields.clear();
00066 
00067 
00068       // DirectionalLight
00069 
00070       fields.push_back(newExposedField("direction", SFVec3f::type,
00071                                        &DirectionalLight::direction,
00072                                        &DirectionalLight::directionChanged,
00073                                        &DirectionalLight::directionStamp));
00074       DirectionalLight::type =
00075         NodeType::newConcrete("DirectionalLight", "children",
00076                               DirectionalLight::instantiate, &fields,
00077                               LightNode::type);
00078       fields.clear();
00079 
00080 
00081       // PointLight
00082 
00083       fields.push_back(newExposedField("attenuation", SFVec3f::type,
00084                                        &PointLight::attenuation,
00085                                        &PointLight::attenuationChanged,
00086                                        &PointLight::attenuationStamp));
00087       fields.push_back(newExposedField("location", SFVec3f::type,
00088                                        &PointLight::location,
00089                                        &PointLight::locationChanged,
00090                                        &PointLight::locationStamp));
00091       fields.push_back(newExposedField("radius", SFFloat::type,
00092                                        &PointLight::radius,
00093                                        &PointLight::radiusChanged,
00094                                        &PointLight::radiusStamp));
00095       PointLight::type =
00096         NodeType::newConcrete("PointLight", "children",
00097                               PointLight::instantiate, &fields,
00098                               LightNode::type);
00099       fields.clear();
00100 
00101 
00102       // SpotLight
00103 
00104       fields.push_back(newExposedField("attenuation", SFVec3f::type,
00105                                        &SpotLight::attenuation,
00106                                        &SpotLight::attenuationChanged,
00107                                        &SpotLight::attenuationStamp));
00108       fields.push_back(newExposedField("beamWidth", SFFloat::type,
00109                                        &SpotLight::beamWidth,
00110                                        &SpotLight::beamWidthChanged,
00111                                        &SpotLight::beamWidthStamp));
00112       fields.push_back(newExposedField("cutOffAngle", SFFloat::type,
00113                                        &SpotLight::cutOffAngle,
00114                                        &SpotLight::cutOffAngleChanged,
00115                                        &SpotLight::cutOffAngleStamp));
00116       fields.push_back(newExposedField("direction", SFVec3f::type,
00117                                        &SpotLight::direction,
00118                                        &SpotLight::directionChanged,
00119                                        &SpotLight::directionStamp));
00120       fields.push_back(newExposedField("location", SFVec3f::type,
00121                                        &SpotLight::location,
00122                                        &SpotLight::locationChanged,
00123                                        &SpotLight::locationStamp));
00124       fields.push_back(newExposedField("radius", SFFloat::type,
00125                                        &SpotLight::radius,
00126                                        &SpotLight::radiusChanged,
00127                                        &SpotLight::radiusStamp));
00128       SpotLight::type =
00129         NodeType::newConcrete("SpotLight", "children",
00130                               SpotLight::instantiate, &fields,
00131                               LightNode::type);
00132       fields.clear();
00133     }
00134   }
00135 }

Generated on Sun Jul 30 22:55:49 2006 for Archon by  doxygen 1.4.4