appear.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 
00030 #include <archon/x3d/server/field_type.H>
00031 #include <archon/x3d/server/field.H>
00032 #include <archon/x3d/server/appear.H>
00033 
00034 namespace Archon
00035 {
00036   namespace X3D
00037   {
00038     const NodeType *MaterialNode::type = 0;
00039     const NodeType *Material::type = 0;
00040 
00041     const NodeType *AppearanceNode::type = 0;
00042     const NodeType *Appearance::type = 0;
00043 
00044     const NodeType *BindableNode::type = 0;
00045     const NodeType *Fog::type = 0;
00046     const NodeType *Background::type = 0;
00047 
00048     void initializeAppearComponent()
00049     {
00050       vector<const FieldBase *> fields;
00051 
00052 
00053       // MaterialNode
00054 
00055       MaterialNode::type =
00056         NodeType::newAbstract("MaterialNode", false, 0,
00057                               AppearanceChildNode::type);
00058 
00059 
00060       // Material
00061 
00062       fields.push_back(newExposedField("ambientIntensity", SFFloat::type,
00063                                        &Material::ambientIntensity,
00064                                        &Material::ambientIntensityChanged,
00065                                        &Material::ambientIntensityStamp));
00066       fields.push_back(newExposedField("diffuseColor", SFColor::type,
00067                                        &Material::diffuseColor,
00068                                        &Material::diffuseColorChanged,
00069                                        &Material::diffuseColorStamp));
00070       fields.push_back(newExposedField("emissiveColor", SFColor::type,
00071                                        &Material::emissiveColor,
00072                                        &Material::emissiveColorChanged,
00073                                        &Material::emissiveColorStamp));
00074       fields.push_back(newExposedField("shininess", SFFloat::type,
00075                                        &Material::shininess,
00076                                        &Material::shininessChanged,
00077                                        &Material::shininessStamp));
00078       fields.push_back(newExposedField("specularColor", SFColor::type,
00079                                        &Material::specularColor,
00080                                        &Material::specularColorChanged,
00081                                        &Material::specularColorStamp));
00082       fields.push_back(newExposedField("transparency", SFFloat::type,
00083                                        &Material::transparency,
00084                                        &Material::transparencyChanged,
00085                                        &Material::transparencyStamp));
00086       fields.push_back(newExposedField("refractiveIndex", SFFloat::type,
00087                                        &Material::refractiveIndex,
00088                                        &Material::refractiveIndexChanged,
00089                                        &Material::refractiveIndexStamp));
00090       Material::type =
00091         NodeType::newConcrete("Material", "material",
00092                               Material::instantiate, &fields,
00093                               MaterialNode::type);
00094       fields.clear();
00095 
00096 
00097 
00098       // AppearanceNode
00099 
00100       AppearanceNode::type =
00101         NodeType::newAbstract("AppearanceNode", false, 0,
00102                               Node::type);
00103 
00104 
00105       // Appearance
00106 
00107       fields.push_back(newExposedField("material",
00108                                        &Appearance::material,
00109                                        &Appearance::materialChanged,
00110                                        &Appearance::materialStamp));
00111       fields.push_back(newExposedField("texture",
00112                                        &Appearance::texture,
00113                                        &Appearance::textureChanged,
00114                                        &Appearance::textureStamp));
00115       fields.push_back(newExposedField("textureTransform",
00116                                        &Appearance::textureTransform,
00117                                        &Appearance::textureTransformChanged,
00118                                        &Appearance::textureTransformStamp));
00119       Appearance::type =
00120         NodeType::newConcrete("Appearance", "appearance",
00121                               Appearance::instantiate, &fields,
00122                               AppearanceNode::type);
00123       fields.clear();
00124 
00125 
00126 
00127       // BindableNode
00128 
00129       fields.push_back(newEventIn("set_bind", SFBool::type,
00130                                   &BindableNode::setBind,
00131                                   &BindableNode::bindStamp));
00132       fields.push_back(newEventOut("isBound", SFBool::type,
00133                                    &BindableNode::isBound,
00134                                    &BindableNode::isBoundChanged));
00135       fields.push_back(newEventOut("bindTime", SFTime::type,
00136                                    &BindableNode::bindTime,
00137                                    &BindableNode::bindTimeChanged));
00138       BindableNode::type =
00139         NodeType::newAbstract("BindableNode", false, &fields,
00140                               ChildNode::type);
00141       fields.clear();
00142 
00143 
00144       // Fog
00145 
00146       /*
00147        * Note: 'set_bind' should have been an EventIn field - it is in
00148        * the VRML97 specification.
00149        */
00150       fields.push_back(newExposedField("color", SFColor::type,
00151                                        &Fog::color,
00152                                        &Fog::colorChanged,
00153                                        &Fog::colorStamp));
00154       fields.push_back(newExposedField("fogType", SFString::type,
00155                                        &Fog::fogType,
00156                                        &Fog::fogTypeChanged,
00157                                        &Fog::fogTypeStamp));
00158       fields.push_back(newExposedField("visibilityRange", SFFloat::type,
00159                                        &Fog::visibilityRange,
00160                                        &Fog::visibilityRangeChanged,
00161                                        &Fog::visibilityRangeStamp));
00162       Fog::type =
00163         NodeType::newConcrete("Fog", "children",
00164                               Fog::instantiate, &fields,
00165                               BindableNode::type);
00166       fields.clear();
00167 
00168 
00169       // Background
00170 
00171       fields.push_back(newExposedField("groundAngle", MFFloat::type,
00172                                        &Background::groundAngle,
00173                                        &Background::groundAngleChanged,
00174                                        &Background::groundAngleStamp));
00175       fields.push_back(newExposedField("groundColor", MFVec3f::type,
00176                                        &Background::groundColor,
00177                                        &Background::groundColorChanged,
00178                                        &Background::groundColorStamp));
00179       fields.push_back(newExposedField("backUrl", MFString::type,
00180                                        &Background::backUrl,
00181                                        &Background::backUrlChanged,
00182                                        &Background::backUrlStamp));
00183       fields.push_back(newExposedField("bottomUrl", MFString::type,
00184                                        &Background::bottomUrl,
00185                                        &Background::bottomUrlChanged,
00186                                        &Background::bottomUrlStamp));
00187       fields.push_back(newExposedField("frontUrl", MFString::type,
00188                                        &Background::frontUrl,
00189                                        &Background::frontUrlChanged,
00190                                        &Background::frontUrlStamp));
00191       fields.push_back(newExposedField("leftUrl", MFString::type,
00192                                        &Background::leftUrl,
00193                                        &Background::leftUrlChanged,
00194                                        &Background::leftUrlStamp));
00195       fields.push_back(newExposedField("rightUrl", MFString::type,
00196                                        &Background::rightUrl,
00197                                        &Background::rightUrlChanged,
00198                                        &Background::rightUrlStamp));
00199       fields.push_back(newExposedField("topUrl", MFString::type,
00200                                        &Background::topUrl,
00201                                        &Background::topUrlChanged,
00202                                        &Background::topUrlStamp));
00203       fields.push_back(newExposedField("skyAngle", MFFloat::type,
00204                                        &Background::skyAngle,
00205                                        &Background::skyAngleChanged,
00206                                        &Background::skyAngleStamp));
00207       fields.push_back(newExposedField("skyColor", MFVec3f::type,
00208                                        &Background::skyColor,
00209                                        &Background::skyColorChanged,
00210                                        &Background::skyColorStamp));
00211       Background::type =
00212         NodeType::newConcrete("Background", "children",
00213                               Background::instantiate, &fields,
00214                               BindableNode::type);
00215       fields.clear();
00216     }
00217   }
00218 }

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