core.H

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 
00020 #ifndef ARCHON_X3D_CORE_H
00021 #define ARCHON_X3D_CORE_H
00022 
00029 #include <archon/x3d/server/type.H>
00030 #include <archon/x3d/server/context.H>
00031 
00032 namespace Archon
00033 {
00034   namespace X3D
00035   {
00036     struct Viewer; // "view.H"
00037 
00041     struct MetadataObject: virtual NodeBase
00042     {
00043       static const NodeType *type;
00044 
00045     protected:
00046       MetadataObject() {}
00047 
00048     private:
00049       friend void initializeCoreComponent();
00050 
00051       string name;
00052       string reference;
00053 
00054       EventSource nameChanged;
00055       EventSource referenceChanged;
00056 
00057       Time nameStamp;
00058       Time referenceStamp;
00059     };
00060 
00061 
00069     struct Node: virtual NodeBase
00070     {
00071       static const NodeType *type;
00072 
00073     protected:
00074       Node() {}
00075 
00076     private:
00077       friend void initializeCoreComponent();
00078 
00079       Ref<MetadataObject> metadata;
00080 
00081       EventSource metadataChanged;
00082 
00083       Time metadataStamp;
00084     };
00085 
00086 
00092     struct ChildNode: virtual Node
00093     {
00094       static const NodeType *type;
00095 
00096     protected:
00097       ChildNode() {}
00098     };
00099 
00100 
00104     struct SensorNode: virtual ChildNode
00105     {
00106       static const NodeType *type;
00107 
00108       bool getEnabled() const { return enabled; }
00109 
00110     protected:
00111       SensorNode(): enabled(true), isActive(false) {}
00112 
00113     private:
00114       friend class Viewer;
00115       friend void initializeCoreComponent();
00116 
00117       bool enabled;
00118 
00119     protected:
00120       bool isActive;
00121 
00122     private:
00123       EventSource enabledChanged;
00124 
00125     protected:
00126       EventSource isActiveChanged;
00127 
00128       Time enabledStamp;
00129 
00130     private:
00146       bool enabledAssign(const bool &, const Time &);
00147 
00154       virtual void onDisable();
00155     };
00156 
00157 
00161     struct MetadataDouble: virtual Node, MetadataObject
00162     {
00163       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00164       {
00165         return new MetadataDouble(c);
00166       }
00167 
00168       static const NodeType *type;
00169       const NodeType *getType() const { return type; }
00170 
00171       MetadataDouble(BackRef<ExecutionContext> c): NodeBase(c) {}
00172 
00173     private:
00174       friend void initializeCoreComponent();
00175 
00176       vector<double> value;
00177 
00178       EventSource valueChanged;
00179 
00180       Time valueStamp;
00181     };
00182 
00183 
00187     struct MetadataFloat: virtual Node, MetadataObject
00188     {
00189       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00190       {
00191         return new MetadataFloat(c);
00192       }
00193 
00194       static const NodeType *type;
00195       const NodeType *getType() const { return type; }
00196 
00197       MetadataFloat(BackRef<ExecutionContext> c): NodeBase(c) {}
00198 
00199     private:
00200       friend void initializeCoreComponent();
00201 
00202       vector<double> value;
00203 
00204       EventSource valueChanged;
00205 
00206       Time valueStamp;
00207     };
00208 
00209 
00213     struct MetadataInteger: virtual Node, MetadataObject
00214     {
00215       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00216       {
00217         return new MetadataInteger(c);
00218       }
00219 
00220       static const NodeType *type;
00221       const NodeType *getType() const { return type; }
00222 
00223       MetadataInteger(BackRef<ExecutionContext> c): NodeBase(c) {}
00224 
00225     private:
00226       friend void initializeCoreComponent();
00227 
00228       vector<int> value;
00229 
00230       EventSource valueChanged;
00231 
00232       Time valueStamp;
00233     };
00234 
00235 
00239     struct MetadataSet: virtual Node, MetadataObject
00240     {
00241       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00242       {
00243         return new MetadataSet(c);
00244       }
00245 
00246       static const NodeType *type;
00247       const NodeType *getType() const { return type; }
00248 
00249       MetadataSet(BackRef<ExecutionContext> c): NodeBase(c) {}
00250 
00251     private:
00252       friend void initializeCoreComponent();
00253 
00254       vector<Ref<MetadataObject> > value;
00255 
00256       EventSource valueChanged;
00257 
00258       Time valueStamp;
00259     };
00260 
00261 
00265     struct MetadataString: virtual Node, MetadataObject
00266     {
00267       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00268       {
00269         return new MetadataString(c);
00270       }
00271 
00272       static const NodeType *type;
00273       const NodeType *getType() const { return type; }
00274 
00275       MetadataString(BackRef<ExecutionContext> c): NodeBase(c) {}
00276 
00277     private:
00278       friend void initializeCoreComponent();
00279 
00280       vector<string> value;
00281 
00282       EventSource valueChanged;
00283 
00284       Time valueStamp;
00285     };
00286   }
00287 }
00288 
00289 #endif // ARCHON_X3D_CORE_H

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