texture.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/texture.H>
00033 
00034 namespace Archon
00035 {
00036   namespace X3D
00037   {
00038     const NodeType *TextureCoordinateNode::type = 0;
00039     const NodeType *TextureCoordinate::type = 0;
00040 
00041     const NodeType *AppearanceChildNode::type = 0; // See above
00042     const NodeType *TextureTransformNode::type = 0;
00043     const NodeType *TextureTransform::type = 0;
00044     const NodeType *TextureNode::type = 0;
00045     const NodeType *Texture2DNode::type = 0;
00046     const NodeType *ImageTexture::type = 0;
00047     //const NodeType *MovieTexture::type = 0;
00048     const NodeType *PixelTexture::type = 0;
00049 
00050     void initializeTextureComponent()
00051     {
00052       vector<const FieldBase *> fields;
00053 
00054 
00055       // TextureCoordinateNode
00056 
00057       TextureCoordinateNode::type =
00058         NodeType::newAbstract("TextureCoordinateNode", false, 0,
00059                               GeometricPropertyNode::type);
00060 
00061 
00062       // TextureCoordinate
00063 
00064       fields.push_back(newExposedField("point", MFVec2f::type,
00065                                        &TextureCoordinate::point,
00066                                        &TextureCoordinate::pointChanged,
00067                                        &TextureCoordinate::pointStamp));
00068       TextureCoordinate::type =
00069         NodeType::newConcrete("TextureCoordinate", "texCoord", TextureCoordinate::instantiate, &fields,
00070                               TextureCoordinateNode::type);
00071       fields.clear();
00072 
00073 
00074       // AppearanceChildNode
00075 
00076       AppearanceChildNode::type =
00077         NodeType::newAbstract("AppearanceChildNode", false, 0,
00078                               Node::type);
00079 
00080 
00081       // TextureTransformNode
00082 
00083       TextureTransformNode::type =
00084         NodeType::newAbstract("TextureTransformNode", false, 0,
00085                               AppearanceChildNode::type);
00086 
00087 
00088       // TextureTransform
00089 
00090       fields.push_back(newExposedField("center", SFVec2f::type,
00091                                        &TextureTransform::center,
00092                                        &TextureTransform::centerChanged,
00093                                        &TextureTransform::centerStamp));
00094       fields.push_back(newExposedField("rotation", SFFloat::type,
00095                                        &TextureTransform::rotation,
00096                                        &TextureTransform::rotationChanged,
00097                                        &TextureTransform::rotationStamp));
00098       fields.push_back(newExposedField("scale", SFVec2f::type,
00099                                        &TextureTransform::scale,
00100                                        &TextureTransform::scaleChanged,
00101                                        &TextureTransform::scaleStamp));
00102       fields.push_back(newExposedField("translation", SFVec2f::type,
00103                                        &TextureTransform::translation,
00104                                        &TextureTransform::translationChanged,
00105                                        &TextureTransform::translationStamp));
00106       TextureTransform::type =
00107         NodeType::newConcrete("TextureTransform", "textureTransform", TextureTransform::instantiate, &fields,
00108                               TextureTransformNode::type);
00109       fields.clear();
00110 
00111 
00112       // TextureNode
00113 
00114       TextureNode::type =
00115         NodeType::newAbstract("TextureNode", false, 0,
00116                               AppearanceChildNode::type);
00117       fields.clear();
00118 
00119 
00120       // Texture2DNode
00121 
00122       fields.push_back(newPrivateField("repeatS", SFBool::type,
00123                                        &Texture2DNode::repeatS));
00124       fields.push_back(newPrivateField("repeatT", SFBool::type,
00125                                        &Texture2DNode::repeatT));
00126       Texture2DNode::type =
00127         NodeType::newAbstract("Texture2DNode", false, &fields,
00128                               TextureNode::type);
00129       fields.clear();
00130 
00131 
00132       // ImageTexture
00133 
00134       ImageTexture::type =
00135         NodeType::newConcrete("ImageTexture", "texture", ImageTexture::instantiate, &fields,
00136                               Texture2DNode::type, UrlObject::type);
00137       fields.clear();
00138 
00139 
00140       // MovieTexture
00141       /*
00142       fields.push_back(newExposedField("loop", SFBool::type,
00143                                        &MovieTexture::loop,
00144                                        &MovieTexture::loopChanged,
00145                                        &MovieTexture::loopStamp));
00146       fields.push_back(newExposedField("speed", SFFloat::type,
00147                                        &MovieTexture::speed,
00148                                        &MovieTexture::speedChanged,
00149                                        &MovieTexture::speedStamp));
00150       fields.push_back(newExposedField("startTime", SFTime::type,
00151                                        &MovieTexture::startTime,
00152                                        &MovieTexture::startTimeChanged,
00153                                        &MovieTexture::startTimeStamp));
00154       fields.push_back(newExposedField("stopTime", SFTime::type,
00155                                        &MovieTexture::stopTime,
00156                                        &MovieTexture::stopTimeChanged,
00157                                        &MovieTexture::stopTimeStamp));
00158       fields.push_back(newEventOut("duration_changed", SFTime::type,
00159                                    &MovieTexture::duration,
00160                                    &MovieTexture::durationChanged));
00161       fields.push_back(newEventOut("isActive", SFBool::type,
00162                                    &MovieTexture::isActive,
00163                                    &MovieTexture::isActiveChanged));
00164       MovieTexture::type =
00165         NodeType::newConcrete("MovieTexture", "texture", MovieTexture::instantiate, &fields,
00166                               Texture2DNode::type, UrlObject::type);
00167       fields.clear();
00168       */
00169 
00170       // PixelTexture
00171 
00172       fields.push_back(newExposedField("image", SFImage::type,
00173                                        &PixelTexture::image,
00174                                        &PixelTexture::imageChanged,
00175                                        &PixelTexture::imageStamp));
00176       PixelTexture::type =
00177         NodeType::newConcrete("PixelTexture", "texture", PixelTexture::instantiate, &fields,
00178                               Texture2DNode::type);
00179       fields.clear();
00180     }
00181   }
00182 }

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