00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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;
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
00048 const NodeType *PixelTexture::type = 0;
00049
00050 void initializeTextureComponent()
00051 {
00052 vector<const FieldBase *> fields;
00053
00054
00055
00056
00057 TextureCoordinateNode::type =
00058 NodeType::newAbstract("TextureCoordinateNode", false, 0,
00059 GeometricPropertyNode::type);
00060
00061
00062
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
00075
00076 AppearanceChildNode::type =
00077 NodeType::newAbstract("AppearanceChildNode", false, 0,
00078 Node::type);
00079
00080
00081
00082
00083 TextureTransformNode::type =
00084 NodeType::newAbstract("TextureTransformNode", false, 0,
00085 AppearanceChildNode::type);
00086
00087
00088
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
00113
00114 TextureNode::type =
00115 NodeType::newAbstract("TextureNode", false, 0,
00116 AppearanceChildNode::type);
00117 fields.clear();
00118
00119
00120
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
00133
00134 ImageTexture::type =
00135 NodeType::newConcrete("ImageTexture", "texture", ImageTexture::instantiate, &fields,
00136 Texture2DNode::type, UrlObject::type);
00137 fields.clear();
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
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 }