00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 # ifndef OPENVRML_VRML97NODE_H
00024 # define OPENVRML_VRML97NODE_H
00025
00026 # include "common.h"
00027 # include "field.h"
00028 # include "nodetypeptr.h"
00029 # include "node.h"
00030 # include "Viewer.h"
00031 # include "Image.h"
00032 # include "bvolume.h"
00033 # include "VrmlMatrix.h"
00034
00035 typedef unsigned int FT_UInt;
00036 typedef struct FT_LibraryRec_ * FT_Library;
00037 typedef struct FT_FaceRec_ * FT_Face;
00038 typedef unsigned int FcChar32;
00039
00040 namespace OpenVRML {
00041
00042 class Audio;
00043
00044 namespace Vrml97Node {
00045
00046 class OPENVRML_SCOPE AbstractBase : public virtual Node {
00047 public:
00048 virtual ~AbstractBase() throw () = 0;
00049
00050 protected:
00051 AbstractBase(const NodeType & nodeType, const ScopePtr & scope);
00052
00053 private:
00054 virtual void setFieldImpl(const std::string & id,
00055 const FieldValue & value)
00056 throw (UnsupportedInterface, std::bad_cast, std::bad_alloc);
00057
00058 virtual const FieldValue &
00059 getFieldImpl(const std::string & id) const
00060 throw (UnsupportedInterface);
00061
00062 virtual void processEventImpl(const std::string & id,
00063 const FieldValue & value,
00064 double timestamp)
00065 throw (UnsupportedInterface, std::bad_cast, std::bad_alloc);
00066
00067 virtual const FieldValue &
00068 getEventOutImpl(const std::string & id) const
00069 throw (UnsupportedInterface);
00070 };
00071
00072
00073 class OPENVRML_SCOPE AbstractChild : public AbstractBase,
00074 public ChildNode {
00075 public:
00076 virtual ~AbstractChild() throw () = 0;
00077
00078 protected:
00079 AbstractChild(const NodeType & nodeType, const ScopePtr & scope);
00080 };
00081
00082
00083 class OPENVRML_SCOPE AbstractGeometry :
00084 public AbstractBase, public GeometryNode {
00085 public:
00086 virtual ~AbstractGeometry() throw () = 0;
00087
00088 virtual void render(Viewer & viewer, VrmlRenderContext context);
00089
00090 protected:
00091 AbstractGeometry(const NodeType & nodeType, const ScopePtr & scope);
00092
00093 Viewer::Object d_viewerObject;
00094 };
00095
00096
00097 class OPENVRML_SCOPE AbstractIndexedSet : public AbstractGeometry {
00098 protected:
00099 SFNode color;
00100 MFInt32 colorIndex;
00101 SFBool colorPerVertex;
00102 SFNode coord;
00103 MFInt32 coordIndex;
00104
00105 public:
00106 virtual ~AbstractIndexedSet() throw () = 0;
00107
00108 virtual bool isModified() const;
00109 virtual void updateModified(NodePath & path, int flags = 0x003);
00110
00111 virtual const ColorNode * getColor() const throw ();
00112
00113 protected:
00114 AbstractIndexedSet(const NodeType & nodeType,
00115 const ScopePtr & scope);
00116
00117
00118
00119
00120 void processSet_color(const FieldValue & sfnode, double timestamp)
00121 throw (std::bad_cast, std::bad_alloc);
00122 void processSet_colorIndex(const FieldValue & mfint32,
00123 double timestamp)
00124 throw (std::bad_cast, std::bad_alloc);
00125 void processSet_coord(const FieldValue & sfnode, double timestamp)
00126 throw (std::bad_cast, std::bad_alloc);
00127 void processSet_coordIndex(const FieldValue & mfint32,
00128 double timestamp)
00129 throw (std::bad_cast, std::bad_alloc);
00130 };
00131
00132
00133 class OPENVRML_SCOPE AbstractLight : public AbstractChild {
00134 protected:
00135 SFFloat ambientIntensity;
00136 SFColor color;
00137 SFFloat intensity;
00138 SFBool on;
00139
00140 public:
00141 virtual ~AbstractLight() throw () = 0;
00142
00143 virtual void renderScoped(Viewer *);
00144 virtual AbstractLight * toLight() const;
00145
00146 float getAmbientIntensity() const { return this->ambientIntensity.get(); }
00147 float getIntensity() const { return this->intensity.get(); }
00148 bool getOn() const { return this->on.get(); }
00149 SFColor::ConstArrayReference getColor() const { return this->color.get(); }
00150
00151 protected:
00152 AbstractLight(const NodeType & nodeType, const ScopePtr & scope);
00153
00154
00155
00156
00157 void processSet_ambientIntensity(const FieldValue & sffloat,
00158 double timestamp)
00159 throw (std::bad_cast);
00160 void processSet_color(const FieldValue & sfcolor, double timestamp)
00161 throw (std::bad_cast);
00162 void processSet_intensity(const FieldValue & sffloat,
00163 double timestamp) throw (std::bad_cast);
00164 void processSet_on(const FieldValue & sfbool, double timestamp)
00165 throw (std::bad_cast);
00166 };
00167
00168
00169 class OPENVRML_SCOPE AbstractTexture : public AbstractBase,
00170 public TextureNode {
00171 protected:
00172 SFBool repeatS;
00173 SFBool repeatT;
00174
00175 public:
00176 virtual ~AbstractTexture() throw () = 0;
00177
00178
00179
00180
00181 virtual const SFBool & getRepeatS() const throw ();
00182 virtual const SFBool & getRepeatT() const throw ();
00183
00184 protected:
00185 AbstractTexture(const NodeType & nodeType, const ScopePtr & scope);
00186 };
00187
00188
00189 class OPENVRML_SCOPE GroupClass : public NodeClass {
00190 public:
00191 explicit GroupClass(Browser & browser);
00192 virtual ~GroupClass() throw ();
00193
00194 virtual const NodeTypePtr createType(const std::string & id,
00195 const NodeInterfaceSet &)
00196 throw (UnsupportedInterface, std::bad_alloc);
00197 };
00198
00199 class OPENVRML_SCOPE Group : public AbstractChild {
00200 friend class GroupClass;
00201
00202 protected:
00203 SFVec3f bboxCenter;
00204 SFVec3f bboxSize;
00205 MFNode children;
00206 SFString relative;
00207
00208 Node * parentTransform;
00209 Viewer::Object viewerObject;
00210
00214 BSphere bsphere;
00215
00216 public:
00217 Group(const NodeType & nodeType,
00218 const ScopePtr & scope);
00219 virtual ~Group() throw ();
00220
00221 virtual Group * toGroup() const;
00222
00223 virtual bool isModified() const;
00224 virtual void updateModified(NodePath& path, int flags);
00225
00226 virtual void render(Viewer & viewer, VrmlRenderContext context);
00227
00228 virtual void accumulateTransform(Node*);
00229
00230 void renderNoCull(Viewer & viewer, VrmlRenderContext context);
00231 void activate(double timeStamp, bool isOver, bool isActive, double *p);
00232
00233 virtual Node* getParentTransform();
00234
00235 const BVolume * getBVolume() const;
00236
00237 protected:
00238
00239
00240
00241 void processAddChildren(const FieldValue & mfnode, double timestamp)
00242 throw (std::bad_cast, std::bad_alloc);
00243 void processRemoveChildren(const FieldValue & mfnode,
00244 double timestamp)
00245 throw (std::bad_cast, std::bad_alloc);
00246 void processSet_children(const FieldValue & mfnode,
00247 double timestamp)
00248 throw (std::bad_cast, std::bad_alloc);
00249
00254 virtual void recalcBSphere();
00255 };
00256
00257
00258 class OPENVRML_SCOPE AnchorClass : public NodeClass {
00259 public:
00260 explicit AnchorClass(Browser & browser);
00261 virtual ~AnchorClass() throw ();
00262
00263 virtual const NodeTypePtr createType(const std::string & id,
00264 const NodeInterfaceSet &)
00265 throw (UnsupportedInterface, std::bad_alloc);
00266 };
00267
00268 class OPENVRML_SCOPE Anchor : public Group {
00269 friend class AnchorClass;
00270
00271 SFString description;
00272 MFString parameter;
00273 MFString url;
00274
00275 public:
00276 Anchor(const NodeType & nodeType,
00277 const ScopePtr & scope);
00278 virtual ~Anchor() throw ();
00279
00280 virtual Anchor * toAnchor() const;
00281
00282 virtual void render(Viewer & viewer, VrmlRenderContext context);
00283
00284 void activate();
00285
00286 const BVolume * getBVolume() const;
00287
00288 private:
00289
00290
00291
00292 void setDescription(const FieldValue & sfstring)
00293 throw (std::bad_cast, std::bad_alloc);
00294 void setParameter(const FieldValue & mfstring)
00295 throw (std::bad_cast, std::bad_alloc);
00296 void setUrl(const FieldValue & mfstring)
00297 throw (std::bad_cast, std::bad_alloc);
00298
00299
00300
00301
00302 void processSet_description(const FieldValue & sfstring,
00303 double timestamp)
00304 throw (std::bad_cast, std::bad_alloc);
00305 void processSet_parameter(const FieldValue & mfstring,
00306 double timestamp)
00307 throw (std::bad_cast, std::bad_alloc);
00308 void processSet_url(const FieldValue & mfstring, double timestamp)
00309 throw (std::bad_cast, std::bad_alloc);
00310 };
00311
00312
00313 class OPENVRML_SCOPE AppearanceClass : public NodeClass {
00314 public:
00315 explicit AppearanceClass(Browser & browser);
00316 virtual ~AppearanceClass() throw ();
00317
00318 virtual const NodeTypePtr createType(const std::string & id,
00319 const NodeInterfaceSet &)
00320 throw (UnsupportedInterface, std::bad_alloc);
00321 };
00322
00323 class OPENVRML_SCOPE Appearance : public AbstractBase,
00324 public AppearanceNode {
00325 friend class AppearanceClass;
00326
00327 SFNode material;
00328 SFNode texture;
00329 SFNode textureTransform;
00330
00331 public:
00332 Appearance(const NodeType & nodeType,
00333 const ScopePtr & scope);
00334 virtual ~Appearance() throw ();
00335
00336 virtual bool isModified() const;
00337 virtual void updateModified(NodePath & path, int flags = 0x003);
00338
00339 virtual void render(Viewer & viewer, VrmlRenderContext context);
00340
00341
00342
00343
00344 virtual const SFNode & getMaterial() const throw ();
00345 virtual const SFNode & getTexture() const throw ();
00346 virtual const SFNode & getTextureTransform() const throw ();
00347
00348 private:
00349
00350
00351
00352 void processSet_material(const FieldValue & sfnode,
00353 double timestamp)
00354 throw (std::bad_cast, std::bad_alloc);
00355 void processSet_texture(const FieldValue & sfnode,
00356 double timestamp)
00357 throw (std::bad_cast, std::bad_alloc);
00358 void processSet_textureTransform(const FieldValue & sfnode,
00359 double timestamp)
00360 throw (std::bad_cast, std::bad_alloc);
00361 };
00362
00363
00364 class OPENVRML_SCOPE AudioClipClass : public NodeClass {
00365 public:
00366 explicit AudioClipClass(Browser & browser);
00367 virtual ~AudioClipClass() throw ();
00368
00369 virtual const NodeTypePtr createType(const std::string & id,
00370 const NodeInterfaceSet &)
00371 throw (UnsupportedInterface, std::bad_alloc);
00372 };
00373
00374 class OPENVRML_SCOPE AudioClip : public AbstractBase {
00375 friend class AudioClipClass;
00376
00377 SFString description;
00378 SFBool loop;
00379 SFFloat pitch;
00380 SFTime startTime;
00381 SFTime stopTime;
00382 MFString url;
00383 SFTime duration;
00384 SFBool active;
00385
00386 SFString relativeUrl;
00387
00388 Audio * audio;
00389 bool url_modified;
00390 int audio_index;
00391 double audio_intensity;
00392 int audio_fd;
00393
00394 public:
00395 AudioClip(const NodeType & nodeType,
00396 const ScopePtr & scope);
00397 virtual ~AudioClip() throw ();
00398
00399 void update(double time);
00400
00401 virtual AudioClip * toAudioClip() const;
00402
00403 private:
00404 virtual void initializeImpl(double timestamp) throw ();
00405
00406
00407
00408
00409 void processSet_description(const FieldValue & sfstring,
00410 double timestamp)
00411 throw (std::bad_cast, std::bad_alloc);
00412 void processSet_loop(const FieldValue & sfbool, double timestamp)
00413 throw (std::bad_cast);
00414 void processSet_pitch(const FieldValue & sffloat, double timestamp)
00415 throw (std::bad_cast);
00416 void processSet_startTime(const FieldValue & sftime,
00417 double timestamp)
00418 throw (std::bad_cast);
00419 void processSet_stopTime(const FieldValue & sftime,
00420 double timestamp)
00421 throw (std::bad_cast);
00422 void processSet_url(const FieldValue & mfstring, double timestamp)
00423 throw (std::bad_cast, std::bad_alloc);
00424 };
00425
00426
00427 class Background;
00428
00429 class OPENVRML_SCOPE BackgroundClass : public NodeClass {
00430 Background * first;
00431 std::vector<NodePtr> boundNodes;
00432
00433 public:
00434 explicit BackgroundClass(Browser & browser);
00435 virtual ~BackgroundClass() throw ();
00436
00437 void setFirst(Background & background) throw ();
00438 bool hasFirst() const throw ();
00439 void bind(Background & background, double timestamp)
00440 throw (std::bad_alloc);
00441 void unbind(Background & background, double timestamp) throw ();
00442
00443 virtual void initialize(double timestamp) throw ();
00444 virtual void render(Viewer & viewer) throw ();
00445 virtual const NodeTypePtr createType(const std::string & id,
00446 const NodeInterfaceSet &)
00447 throw (UnsupportedInterface, std::bad_alloc);
00448 };
00449
00450 class OPENVRML_SCOPE Background : public AbstractChild {
00451 friend class BackgroundClass;
00452
00453 MFFloat groundAngle;
00454 MFColor groundColor;
00455 MFString backUrl;
00456 MFString bottomUrl;
00457 MFString frontUrl;
00458 MFString leftUrl;
00459 MFString rightUrl;
00460 MFString topUrl;
00461 MFFloat skyAngle;
00462 MFColor skyColor;
00463 SFBool bound;
00464
00465 SFString relativeUrl;
00466
00467
00468 Image * texPtr[6];
00469 Image tex[6];
00470
00471
00472 Viewer::Object viewerObject;
00473
00474 public:
00475 Background(const NodeType & nodeType,
00476 const ScopePtr & scope);
00477 virtual ~Background() throw ();
00478
00479 private:
00480 virtual void initializeImpl(double timestamp) throw ();
00481
00482
00483
00484
00485 void processSet_bind(const FieldValue & sfbool, double timestamp)
00486 throw (std::bad_cast, std::bad_alloc);
00487 void processSet_groundAngle(const FieldValue & mffloat,
00488 double timestamp)
00489 throw (std::bad_cast, std::bad_alloc);
00490 void processSet_groundColor(const FieldValue & mfcolor,
00491 double timestamp)
00492 throw (std::bad_cast, std::bad_alloc);
00493 void processSet_backUrl(const FieldValue & mfstring,
00494 double timestamp)
00495 throw (std::bad_cast, std::bad_alloc);
00496 void processSet_bottomUrl(const FieldValue & mfstring,
00497 double timestamp)
00498 throw (std::bad_cast, std::bad_alloc);
00499 void processSet_frontUrl(const FieldValue & mfstring,
00500 double timestamp)
00501 throw (std::bad_cast, std::bad_alloc);
00502 void processSet_leftUrl(const FieldValue & mfstring,
00503 double timestamp)
00504 throw (std::bad_cast, std::bad_alloc);
00505 void processSet_rightUrl(const FieldValue & mfstring,
00506 double timestamp)
00507 throw (std::bad_cast, std::bad_alloc);
00508 void processSet_topUrl(const FieldValue & mfstring,
00509 double timestamp)
00510 throw (std::bad_cast, std::bad_alloc);
00511 void processSet_skyAngle(const FieldValue & mffloat,
00512 double timestamp)
00513 throw (std::bad_cast, std::bad_alloc);
00514 void processSet_skyColor(const FieldValue & mfcolor,
00515 double timestamp)
00516 throw (std::bad_cast, std::bad_alloc);
00517 };
00518
00519
00520 class OPENVRML_SCOPE BillboardClass : public NodeClass {
00521 public:
00522 explicit BillboardClass(Browser & browser);
00523 virtual ~BillboardClass() throw ();
00524
00525 virtual const NodeTypePtr createType(const std::string & id,
00526 const NodeInterfaceSet &)
00527 throw (UnsupportedInterface, std::bad_alloc);
00528 };
00529
00530 class OPENVRML_SCOPE Billboard : public Group {
00531 friend class BillboardClass;
00532
00533 SFVec3f axisOfRotation;
00534
00535 Node * parentTransform;
00536 Viewer::Object xformObject;
00537
00538 public:
00539 static void billboard_to_matrix(const Billboard * t_arg,
00540 const VrmlMatrix & MV,
00541 VrmlMatrix & M);
00542
00543 Billboard(const NodeType & nodeType,
00544 const ScopePtr & scope);
00545 virtual ~Billboard() throw ();
00546
00547 virtual void render(Viewer & viewer, VrmlRenderContext context);
00548
00549 virtual void accumulateTransform(Node*);
00550 virtual Node* getParentTransform();
00551 virtual void inverseTransform(VrmlMatrix &);
00552
00553 private:
00554
00555
00556
00557 void setAxisOfRotation(const FieldValue & sfvec3f)
00558 throw (std::bad_cast);
00559
00560
00561
00562
00563 void processSet_axisOfRotation(const FieldValue & sfvec3f,
00564 double timestamp)
00565 throw (std::bad_cast);
00566 };
00567
00568
00569 class OPENVRML_SCOPE BoxClass : public NodeClass {
00570 public:
00571 explicit BoxClass(Browser & browser);
00572 virtual ~BoxClass() throw ();
00573
00574 virtual const NodeTypePtr createType(const std::string & id,
00575 const NodeInterfaceSet &)
00576 throw (UnsupportedInterface, std::bad_alloc);
00577 };
00578
00579 class OPENVRML_SCOPE Box : public AbstractGeometry {
00580 friend class BoxClass;
00581
00582 SFVec3f size;
00583
00584 BSphere bsphere;
00585
00586 public:
00587 Box(const NodeType & nodeType,
00588 const ScopePtr & scope);
00589 virtual ~Box() throw ();
00590
00591 virtual Viewer::Object insertGeometry(Viewer & viewer,
00592 VrmlRenderContext context);
00593 virtual const BVolume * getBVolume() const;
00594 };
00595
00596
00597 class OPENVRML_SCOPE CollisionClass : public NodeClass {
00598 public:
00599 explicit CollisionClass(Browser & browser);
00600 virtual ~CollisionClass() throw ();
00601
00602 virtual const NodeTypePtr createType(const std::string & id,
00603 const NodeInterfaceSet &)
00604 throw (UnsupportedInterface, std::bad_alloc);
00605 };
00606
00607 class OPENVRML_SCOPE Collision : public Group {
00608 friend class CollisionClass;
00609
00610 SFBool collide;
00611 SFNode proxy;
00612 SFTime collideTime;
00613
00614 public:
00615 Collision(const NodeType & nodeType,
00616 const ScopePtr & scope);
00617 virtual ~Collision() throw ();
00618
00619 virtual bool isModified() const;
00620
00621 private:
00622
00623
00624
00625 void processSet_collide(const FieldValue & sfbool, double timestamp)
00626 throw (std::bad_cast);
00627 };
00628
00629
00630 class OPENVRML_SCOPE ColorClass : public NodeClass {
00631 public:
00632 explicit ColorClass(Browser & browser);
00633 virtual ~ColorClass() throw ();
00634
00635 virtual const NodeTypePtr createType(const std::string & id,
00636 const NodeInterfaceSet &)
00637 throw (UnsupportedInterface, std::bad_alloc);
00638 };
00639
00640 class OPENVRML_SCOPE Color : public AbstractBase, public ColorNode {
00641 friend class ColorClass;
00642
00643 MFColor color;
00644
00645 public:
00646 Color(const NodeType & nodeType,
00647 const ScopePtr & scope);
00648 virtual ~Color() throw ();
00649
00650
00651
00652
00653 virtual const MFColor & getColor() const throw ();
00654
00655 private:
00656
00657
00658
00659 void setColor(const FieldValue & mfcolor)
00660 throw (std::bad_cast, std::bad_alloc);
00661
00662
00663
00664
00665 void processSet_color(const FieldValue & mfcolor, double timestamp)
00666 throw (std::bad_cast, std::bad_alloc);
00667 };
00668
00669
00670 class OPENVRML_SCOPE ColorInterpolatorClass : public NodeClass {
00671 public:
00672 explicit ColorInterpolatorClass(Browser & browser);
00673 virtual ~ColorInterpolatorClass() throw ();
00674
00675 virtual const NodeTypePtr createType(const std::string & id,
00676 const NodeInterfaceSet &)
00677 throw (UnsupportedInterface, std::bad_alloc);
00678 };
00679
00680 class OPENVRML_SCOPE ColorInterpolator : public AbstractChild {
00681 friend class ColorInterpolatorClass;
00682
00683 MFFloat key;
00684 MFColor keyValue;
00685 SFColor value;
00686
00687 public:
00688 ColorInterpolator(const NodeType & nodeType,
00689 const ScopePtr & scope);
00690 virtual ~ColorInterpolator() throw ();
00691
00692 private:
00693
00694
00695
00696 void setKey(const FieldValue & mffloat)
00697 throw (std::bad_cast, std::bad_alloc);
00698 void setKeyValue(const FieldValue & mfcolor)
00699 throw (std::bad_cast, std::bad_alloc);
00700
00701
00702
00703
00704 void processSet_fraction(const FieldValue & sffloat,
00705 double timestamp)
00706 throw (std::bad_cast, std::bad_alloc);
00707 void processSet_key(const FieldValue & mffloat, double timestamp)
00708 throw (std::bad_cast, std::bad_alloc);
00709 void processSet_keyValue(const FieldValue & mfcolor,
00710 double timestamp)
00711 throw (std::bad_cast, std::bad_alloc);
00712 };
00713
00714
00715 class OPENVRML_SCOPE ConeClass : public NodeClass {
00716 public:
00717 explicit ConeClass(Browser & browser);
00718 virtual ~ConeClass() throw ();
00719
00720 virtual const NodeTypePtr createType(const std::string & id,
00721 const NodeInterfaceSet &)
00722 throw (UnsupportedInterface, std::bad_alloc);
00723 };
00724
00725 class OPENVRML_SCOPE Cone : public AbstractGeometry {
00726 friend class ConeClass;
00727
00728 SFBool bottom;
00729 SFFloat bottomRadius;
00730 SFFloat height;
00731 SFBool side;
00732
00733 public:
00734 Cone(const NodeType & nodeType,
00735 const ScopePtr & scope);
00736 virtual ~Cone() throw ();
00737
00738 virtual Viewer::Object insertGeometry(Viewer & viewer,
00739 VrmlRenderContext context);
00740 };
00741
00742
00743 class OPENVRML_SCOPE CoordinateClass : public NodeClass {
00744 public:
00745 explicit CoordinateClass(Browser & browser);
00746 virtual ~CoordinateClass() throw ();
00747
00748 virtual const NodeTypePtr createType(const std::string & id,
00749 const NodeInterfaceSet &)
00750 throw (UnsupportedInterface, std::bad_alloc);
00751 };
00752
00753 class OPENVRML_SCOPE Coordinate : public AbstractBase,
00754 public CoordinateNode {
00755 friend class CoordinateClass;
00756
00757 MFVec3f point;
00758
00759 public:
00760 Coordinate(const NodeType & nodeType,
00761 const ScopePtr & scope);
00762 virtual ~Coordinate() throw ();
00763
00764
00765
00766
00767 virtual const MFVec3f & getPoint() const throw ();
00768
00769 private:
00770
00771
00772
00773 void setPoint(const FieldValue & mfvec3f)
00774 throw (std::bad_cast, std::bad_alloc);
00775
00776
00777
00778
00779 void processSet_point(const FieldValue & mfvec3f, double timestamp)
00780 throw (std::bad_cast, std::bad_alloc);
00781 };
00782
00783
00784 class OPENVRML_SCOPE CoordinateInterpolatorClass : public NodeClass {
00785 public:
00786 explicit CoordinateInterpolatorClass(Browser & browser);
00787 virtual ~CoordinateInterpolatorClass() throw ();
00788
00789 virtual const NodeTypePtr createType(const std::string & id,
00790 const NodeInterfaceSet &)
00791 throw (UnsupportedInterface, std::bad_alloc);
00792 };
00793
00794 class OPENVRML_SCOPE CoordinateInterpolator : public AbstractChild {
00795 friend class CoordinateInterpolatorClass;
00796
00797 MFFloat key;
00798 MFVec3f keyValue;
00799 MFVec3f value;
00800
00801 public:
00802 CoordinateInterpolator(const NodeType & nodeType,
00803 const ScopePtr & scope);
00804 virtual ~CoordinateInterpolator() throw ();
00805
00806 private:
00807
00808
00809
00810 void setKey(const FieldValue & mffloat)
00811 throw (std::bad_cast, std::bad_alloc);
00812 void setKeyValue(const FieldValue & mfvec3f)
00813 throw (std::bad_cast, std::bad_alloc);
00814
00815
00816
00817
00818 void processSet_fraction(const FieldValue & sffloat,
00819 double timestamp)
00820 throw (std::bad_cast, std::bad_alloc);
00821 void processSet_key(const FieldValue & mffloat,
00822 double timestamp)
00823 throw (std::bad_cast, std::bad_alloc);
00824 void processSet_keyValue(const FieldValue & mfvec3f,
00825 double timestamp)
00826 throw (std::bad_cast, std::bad_alloc);
00827 };
00828
00829
00830 class OPENVRML_SCOPE CylinderClass : public NodeClass {
00831 public:
00832 explicit CylinderClass(Browser & browser);
00833 virtual ~CylinderClass() throw ();
00834
00835 virtual const NodeTypePtr createType(const std::string & id,
00836 const NodeInterfaceSet &)
00837 throw (UnsupportedInterface, std::bad_alloc);
00838 };
00839
00840 class OPENVRML_SCOPE Cylinder : public AbstractGeometry {
00841 friend class CylinderClass;
00842
00843 SFBool bottom;
00844 SFFloat height;
00845 SFFloat radius;
00846 SFBool side;
00847 SFBool top;
00848
00849 public:
00850 Cylinder(const NodeType & nodeType,
00851 const ScopePtr & scope);
00852 virtual ~Cylinder() throw ();
00853
00854 virtual Viewer::Object insertGeometry(Viewer & viewer,
00855 VrmlRenderContext context);
00856 };
00857
00858
00859 class OPENVRML_SCOPE CylinderSensorClass : public NodeClass {
00860 public:
00861 explicit CylinderSensorClass(Browser & browser);
00862 virtual ~CylinderSensorClass() throw ();
00863
00864 virtual const NodeTypePtr createType(const std::string & id,
00865 const NodeInterfaceSet &)
00866 throw (UnsupportedInterface, std::bad_alloc);
00867 };
00868
00869 class OPENVRML_SCOPE CylinderSensor : public AbstractChild {
00870 friend class CylinderSensorClass;
00871
00872 SFBool autoOffset;
00873 SFFloat diskAngle;
00874 SFBool enabled;
00875 SFFloat maxAngle;
00876 SFFloat minAngle;
00877 SFFloat offset;
00878 SFBool active;
00879 SFRotation rotation;
00880 SFVec3f trackPoint;
00881
00882 SFFloat rotation_val;
00883 SFVec3f activationPoint;
00884 SFBool disk;
00885 VrmlMatrix activationMatrix;
00886 VrmlMatrix M;
00887
00888 public:
00889 CylinderSensor(const NodeType & nodeType,
00890 const ScopePtr & scope);
00891 virtual ~CylinderSensor() throw ();
00892
00893 virtual CylinderSensor * toCylinderSensor() const;
00894
00895 virtual void render(Viewer & viewer, VrmlRenderContext context);
00896 void activate( double timeStamp, bool isActive, double *p );
00897
00898 bool isEnabled() { return this->enabled.get(); }
00899
00900 private:
00901
00902
00903
00904 void processSet_autoOffset(const FieldValue & sfbool,
00905 double timestamp) throw (std::bad_cast);
00906 void processSet_diskAngle(const FieldValue & sffloat,
00907 double timestamp) throw (std::bad_cast);
00908 void processSet_enabled(const FieldValue & sfbool,
00909 double timestamp) throw (std::bad_cast);
00910 void processSet_maxAngle(const FieldValue & sffloat,
00911 double timestamp) throw (std::bad_cast);
00912 void processSet_minAngle(const FieldValue & sffloat,
00913 double timestamp) throw (std::bad_cast);
00914 void processSet_offset(const FieldValue & sffloat,
00915 double timestamp) throw (std::bad_cast);
00916
00917 void setMVMatrix(const VrmlMatrix & M_in);
00918 const VrmlMatrix & getMVMatrix()const;
00919 };
00920
00921
00922 class OPENVRML_SCOPE DirectionalLightClass : public NodeClass {
00923 public:
00924 explicit DirectionalLightClass(Browser & browser);
00925 virtual ~DirectionalLightClass() throw ();
00926
00927 virtual const NodeTypePtr createType(const std::string & id,
00928 const NodeInterfaceSet &)
00929 throw (UnsupportedInterface, std::bad_alloc);
00930 };
00931
00932 class OPENVRML_SCOPE DirectionalLight : public AbstractLight {
00933 friend class DirectionalLightClass;
00934
00935 SFVec3f direction;
00936
00937 public:
00938 DirectionalLight(const NodeType & nodeType,
00939 const ScopePtr & scope);
00940 virtual ~DirectionalLight() throw ();
00941
00942 virtual void render(Viewer & viewer, VrmlRenderContext context);
00943
00944 private:
00945
00946
00947
00948 void processSet_direction(const FieldValue & sfvec3f,
00949 double timestamp) throw (std::bad_cast);
00950 };
00951
00952
00953 class OPENVRML_SCOPE ElevationGridClass : public NodeClass {
00954 public:
00955 explicit ElevationGridClass(Browser & browser);
00956 virtual ~ElevationGridClass() throw ();
00957
00958 virtual const NodeTypePtr createType(const std::string & id,
00959 const NodeInterfaceSet &)
00960 throw (UnsupportedInterface, std::bad_alloc);
00961 };
00962
00963 class OPENVRML_SCOPE ElevationGrid : public AbstractGeometry {
00964 friend class ElevationGridClass;
00965
00966 SFNode color;
00967 SFNode normal;
00968 SFNode texCoord;
00969 SFBool ccw;
00970 SFBool colorPerVertex;
00971 SFFloat creaseAngle;
00972 MFFloat height;
00973 SFBool normalPerVertex;
00974 SFBool solid;
00975 SFInt32 xDimension;
00976 SFFloat xSpacing;
00977 SFInt32 zDimension;
00978 SFFloat zSpacing;
00979
00980 public:
00981 ElevationGrid(const NodeType & nodeType,
00982 const ScopePtr & scope);
00983 virtual ~ElevationGrid() throw ();
00984
00985 virtual bool isModified() const;
00986 virtual void updateModified(NodePath & path, int flags = 0x003);
00987 virtual Viewer::Object insertGeometry(Viewer & viewer,
00988 VrmlRenderContext context);
00989
00990 private:
00991
00992
00993
00994 void processSet_color(const FieldValue & sfnode, double timestamp)
00995 throw (std::bad_cast, std::bad_alloc);
00996 void processSet_height(const FieldValue & mffloat, double timestamp)
00997 throw (std::bad_cast, std::bad_alloc);
00998 void processSet_normal(const FieldValue & sfnode, double timestamp)
00999 throw (std::bad_cast, std::bad_alloc);
01000 void processSet_texCoord(const FieldValue & sfnode,
01001 double timestamp)
01002 throw (std::bad_cast, std::bad_alloc);
01003 };
01004
01005
01006 class OPENVRML_SCOPE ExtrusionClass : public NodeClass {
01007 public:
01008 explicit ExtrusionClass(Browser & browser);
01009 virtual ~ExtrusionClass() throw ();
01010
01011 virtual const NodeTypePtr createType(const std::string & id,
01012 const NodeInterfaceSet &)
01013 throw (UnsupportedInterface, std::bad_alloc);
01014 };
01015
01016 class OPENVRML_SCOPE Extrusion : public AbstractGeometry {
01017 friend class ExtrusionClass;
01018
01019 SFBool beginCap;
01020 SFBool ccw;
01021 SFBool convex;
01022 SFFloat creaseAngle;
01023 MFVec2f crossSection;
01024 SFBool endCap;
01025 MFRotation orientation;
01026 MFVec2f scale;
01027 SFBool solid;
01028 MFVec3f spine;
01029
01030 public:
01031 Extrusion(const NodeType & nodeType,
01032 const ScopePtr & scope);
01033 virtual ~Extrusion() throw ();
01034
01035 virtual Viewer::Object insertGeometry(Viewer & viewer,
01036 VrmlRenderContext context);
01037
01038 private:
01039
01040
01041
01042 void processSet_crossSection(const FieldValue & mfvec2f,
01043 double timestamp)
01044 throw (std::bad_cast, std::bad_alloc);
01045 void processSet_orientation(const FieldValue & mfrotation,
01046 double timestamp)
01047 throw (std::bad_cast, std::bad_alloc);
01048 void processSet_scale(const FieldValue & mfvec2f,
01049 double timestamp)
01050 throw (std::bad_cast, std::bad_alloc);
01051 void processSet_spine(const FieldValue & mfvec3f,
01052 double timestamp)
01053 throw (std::bad_cast, std::bad_alloc);
01054 };
01055
01056
01057 class Fog;
01058
01059 class OPENVRML_SCOPE FogClass : public NodeClass {
01060 Fog * first;
01061 std::vector<NodePtr> boundNodes;
01062
01063 public:
01064 explicit FogClass(Browser & browser);
01065 virtual ~FogClass() throw ();
01066
01067 void setFirst(Fog & fog) throw ();
01068 bool hasFirst() const throw ();
01069 void bind(Fog & fog, double timestamp) throw (std::bad_alloc);
01070 void unbind(Fog & fog, double timestamp) throw ();
01071
01072 virtual void initialize(double timestamp) throw ();
01073 virtual void render(Viewer & viewer) throw ();
01074 virtual const NodeTypePtr createType(const std::string & id,
01075 const NodeInterfaceSet &)
01076 throw (UnsupportedInterface, std::bad_alloc);
01077 };
01078
01079 class OPENVRML_SCOPE Fog : public AbstractChild {
01080 friend class FogClass;
01081
01082 SFColor color;
01083 SFString fogType;
01084 SFFloat visibilityRange;
01085 SFBool bound;
01086
01087 public:
01088 Fog(const NodeType & nodeType,
01089 const ScopePtr & scope);
01090 virtual ~Fog() throw ();
01091
01092 private:
01093 virtual void initializeImpl(double timestamp) throw ();
01094
01095
01096
01097
01098 void processSet_bind(const FieldValue & sfbool, double timestamp)
01099 throw (std::bad_cast, std::bad_alloc);
01100 void processSet_color(const FieldValue & sfcolor, double timestamp)
01101 throw (std::bad_cast);
01102 void processSet_fogType(const FieldValue & sfstring,
01103 double timestamp)
01104 throw (std::bad_cast, std::bad_alloc);
01105 void processSet_visibilityRange(const FieldValue & sffloat,
01106 double timestamp)
01107 throw (std::bad_cast);
01108 };
01109
01110
01111 class OPENVRML_SCOPE FontStyleClass : public NodeClass {
01112 public:
01113 explicit FontStyleClass(Browser & browser);
01114 virtual ~FontStyleClass() throw ();
01115
01116 virtual const NodeTypePtr createType(const std::string & id,
01117 const NodeInterfaceSet &)
01118 throw (UnsupportedInterface, std::bad_alloc);
01119 };
01120
01121 class OPENVRML_SCOPE FontStyle : public AbstractBase,
01122 public FontStyleNode {
01123 friend class FontStyleClass;
01124
01125 MFString family;
01126 SFBool horizontal;
01127 MFString justify;
01128 SFString language;
01129 SFBool leftToRight;
01130 SFFloat size;
01131 SFFloat spacing;
01132 SFString style;
01133 SFBool topToBottom;
01134
01135 public:
01136 FontStyle(const NodeType & nodeType,
01137 const ScopePtr & scope);
01138 virtual ~FontStyle() throw ();
01139
01140
01141
01142
01143 virtual const MFString & getFamily() const throw ();
01144 virtual const SFBool & getHorizontal() const throw ();
01145 virtual const MFString & getJustify() const throw ();
01146 virtual const SFString & getLanguage() const throw ();
01147 virtual const SFBool & getLeftToRight() const throw ();
01148 virtual const SFFloat & getSize() const throw ();
01149 virtual const SFFloat & getSpacing() const throw ();
01150 virtual const SFString & getStyle() const throw ();
01151 virtual const SFBool & getTopToBottom() const throw ();
01152 };
01153
01154
01155 class OPENVRML_SCOPE ImageTextureClass : public NodeClass {
01156 public:
01157 explicit ImageTextureClass(Browser & browser);
01158 virtual ~ImageTextureClass() throw ();
01159
01160 virtual const NodeTypePtr createType(const std::string & id,
01161 const NodeInterfaceSet &)
01162 throw (UnsupportedInterface, std::bad_alloc);
01163 };
01164
01165 class OPENVRML_SCOPE ImageTexture : public AbstractTexture {
01166 friend class ImageTextureClass;
01167
01168 MFString url;
01169
01170 Image * image;
01171
01172 Viewer::TextureObject texObject;
01173
01174 public:
01175 ImageTexture(const NodeType & nodeType,
01176 const ScopePtr & scope);
01177 virtual ~ImageTexture() throw ();
01178
01179 virtual void render(Viewer & viewer, VrmlRenderContext context);
01180
01181 virtual size_t nComponents() const throw ();
01182 virtual size_t width() const throw ();
01183 virtual size_t height() const throw ();
01184 virtual size_t nFrames() const throw ();
01185 virtual const unsigned char * pixels() const throw ();
01186
01187 private:
01188
01189
01190
01191 void processSet_url(const FieldValue & mfstring, double timestamp)
01192 throw (std::bad_cast, std::bad_alloc);
01193 };
01194
01195
01196 class OPENVRML_SCOPE IndexedFaceSetClass : public NodeClass {
01197 public:
01198 explicit IndexedFaceSetClass(Browser & browser);
01199 virtual ~IndexedFaceSetClass() throw ();
01200
01201 virtual const NodeTypePtr createType(const std::string & id,
01202 const NodeInterfaceSet &)
01203 throw (UnsupportedInterface, std::bad_alloc);
01204 };
01205
01206 class OPENVRML_SCOPE IndexedFaceSet : public AbstractIndexedSet {
01207 friend class IndexedFaceSetClass;
01208
01209 SFBool ccw;
01210 SFBool convex;
01211 SFFloat creaseAngle;
01212 SFNode normal;
01213 MFInt32 normalIndex;
01214 SFBool normalPerVertex;
01215 SFBool solid;
01216 SFNode texCoord;
01217 MFInt32 texCoordIndex;
01218
01219 BSphere bsphere;
01220
01221 public:
01222 IndexedFaceSet(const NodeType & nodeType,
01223 const ScopePtr & scope);
01224 virtual ~IndexedFaceSet() throw ();
01225
01226 virtual bool isModified() const;
01227 virtual void updateModified(NodePath & path, int flags = 0x003);
01228 virtual Viewer::Object insertGeometry(Viewer & viewer,
01229 VrmlRenderContext context);
01230 virtual const BVolume * getBVolume() const;
01231
01232 private:
01233
01234
01235
01236 void processSet_normal(const FieldValue & sfnode, double timestamp)
01237 throw (std::bad_cast, std::bad_alloc);
01238 void processSet_normalIndex(const FieldValue & mfint32,
01239 double timestamp)
01240 throw (std::bad_cast, std::bad_alloc);
01241 void processSet_texCoord(const FieldValue & sfnode,
01242 double timestamp)
01243 throw (std::bad_cast, std::bad_alloc);
01244 void processSet_texCoordIndex(const FieldValue & mfint32,
01245 double timestamp)
01246 throw (std::bad_cast, std::bad_alloc);
01247
01248 void recalcBSphere();
01249 };
01250
01251
01252 class OPENVRML_SCOPE IndexedLineSetClass : public NodeClass {
01253 public:
01254 explicit IndexedLineSetClass(Browser & browser);
01255 virtual ~IndexedLineSetClass() throw ();
01256
01257 virtual const NodeTypePtr createType(const std::string & id,
01258 const NodeInterfaceSet &)
01259 throw (UnsupportedInterface, std::bad_alloc);
01260 };
01261
01262 class OPENVRML_SCOPE IndexedLineSet : public AbstractIndexedSet {
01263 friend class IndexedLineSetClass;
01264
01265 public:
01266 IndexedLineSet(const NodeType & nodeType,
01267 const ScopePtr & scope);
01268 virtual ~IndexedLineSet() throw ();
01269
01270 virtual Viewer::Object insertGeometry(Viewer & viewer,
01271 VrmlRenderContext context);
01272 };
01273
01274
01275 class OPENVRML_SCOPE InlineClass : public NodeClass {
01276 public:
01277 explicit InlineClass(Browser & browser);
01278 virtual ~InlineClass() throw ();
01279
01280 virtual const NodeTypePtr createType(const std::string & id,
01281 const NodeInterfaceSet &)
01282 throw (UnsupportedInterface, std::bad_alloc);
01283 };
01284
01285 class OPENVRML_SCOPE Inline : public AbstractChild {
01286 friend class InlineClass;
01287
01288 SFVec3f bboxCenter;
01289 SFVec3f bboxSize;
01290 MFString url;
01291
01292 Scene * inlineScene;
01293 bool hasLoaded;
01294
01295 public:
01296 Inline(const NodeType & nodeType,
01297 const ScopePtr & scope);
01298 virtual ~Inline() throw ();
01299
01300 virtual void render(Viewer & viewer, VrmlRenderContext context);
01301 virtual Inline * toInline() const;
01302
01303 private:
01304 void load();
01305
01306
01307
01308
01309 void processSet_url(const FieldValue & mfstring, double timestamp)
01310 throw (std::bad_cast, std::bad_alloc);
01311 };
01312
01313
01314 class OPENVRML_SCOPE LODClass : public NodeClass {
01315 public:
01316 explicit LODClass(Browser & browser);
01317 virtual ~LODClass() throw ();
01318
01319 virtual const NodeTypePtr createType(const std::string & id,
01320 const NodeInterfaceSet &)
01321 throw (UnsupportedInterface, std::bad_alloc);
01322 };
01323
01324 class OPENVRML_SCOPE LOD : public AbstractChild {
01325 friend class LODClass;
01326
01327 MFNode level;
01328 SFVec3f center;
01329 MFFloat range;
01330
01331 BSphere bsphere;
01332
01333 public:
01334 LOD(const NodeType & nodeType,
01335 const ScopePtr & scope);
01336 virtual ~LOD() throw ();
01337
01338 virtual bool isModified() const;
01339 virtual void updateModified(NodePath & path, int flags = 0x003);
01340 virtual void render(Viewer & viewer, VrmlRenderContext context);
01341 virtual const BVolume * getBVolume() const;
01342
01343 private:
01344
01345
01346
01347 void processSet_level(const FieldValue & mfnode, double timestamp)
01348 throw (std::bad_cast, std::bad_alloc);
01349
01350 virtual void recalcBSphere();
01351 };
01352
01353
01354 class OPENVRML_SCOPE MaterialClass : public NodeClass {
01355 public:
01356 explicit MaterialClass(Browser & browser);
01357 virtual ~MaterialClass() throw ();
01358
01359 virtual const NodeTypePtr createType(const std::string & id,
01360 const NodeInterfaceSet &)
01361 throw (UnsupportedInterface, std::bad_alloc);
01362 };
01363
01364 class OPENVRML_SCOPE Material : public AbstractBase,
01365 public MaterialNode {
01366 friend class MaterialClass;
01367
01368 SFFloat ambientIntensity;
01369 SFColor diffuseColor;
01370 SFColor emissiveColor;
01371 SFFloat shininess;
01372 SFColor specularColor;
01373 SFFloat transparency;
01374
01375 public:
01376 Material(const NodeType & nodeType,
01377 const ScopePtr & scope);
01378 virtual ~Material() throw ();
01379
01380
01381
01382
01383 virtual const SFFloat & getAmbientIntensity() const throw ();
01384 virtual const SFColor & getDiffuseColor() const throw ();
01385 virtual const SFColor & getEmissiveColor() const throw ();
01386 virtual const SFFloat & getShininess() const throw ();
01387 virtual const SFColor & getSpecularColor() const throw ();
01388 virtual const SFFloat & getTransparency() const throw ();
01389
01390 private:
01391
01392
01393
01394 void processSet_ambientIntensity(const FieldValue & sffloat,
01395 double timestamp)
01396 throw (std::bad_cast);
01397 void processSet_diffuseColor(const FieldValue & sfcolor,
01398 double timestamp)
01399 throw (std::bad_cast);
01400 void processSet_emissiveColor(const FieldValue & sfcolor,
01401 double timestamp)
01402 throw (std::bad_cast);
01403 void processSet_shininess(const FieldValue & sffloat,
01404 double timestamp)
01405 throw (std::bad_cast);
01406 void processSet_specularColor(const FieldValue & sfcolor,
01407 double timestamp)
01408 throw (std::bad_cast);
01409 void processSet_transparency(const FieldValue & sffloat,
01410 double timestamp)
01411 throw (std::bad_cast);
01412 };
01413
01414
01415 class OPENVRML_SCOPE MovieTextureClass : public NodeClass {
01416 public:
01417 explicit MovieTextureClass(Browser & browser);
01418 virtual ~MovieTextureClass() throw ();
01419
01420 virtual const NodeTypePtr createType(const std::string & id,
01421 const NodeInterfaceSet &)
01422 throw (UnsupportedInterface, std::bad_alloc);
01423 };
01424
01425 class OPENVRML_SCOPE MovieTexture : public AbstractTexture {
01426 friend class MovieTextureClass;
01427
01428 SFBool loop;
01429 SFFloat speed;
01430 SFTime startTime;
01431 SFTime stopTime;
01432 MFString url;
01433 SFTime duration;
01434 SFBool active;
01435
01436 Image * image;
01437 int frame, lastFrame;
01438 double lastFrameTime;
01439
01440 Viewer::TextureObject texObject;
01441
01442 public:
01443 MovieTexture(const NodeType & nodeType,
01444 const ScopePtr & scope);
01445 virtual ~MovieTexture() throw ();
01446
01447 virtual MovieTexture * toMovieTexture() const;
01448
01449 void update(double time);
01450
01451 virtual void render(Viewer & viewer, VrmlRenderContext context);
01452
01453 virtual size_t nComponents() const throw ();
01454 virtual size_t width() const throw ();
01455 virtual size_t height() const throw ();
01456 virtual size_t nFrames() const throw ();
01457 virtual const unsigned char * pixels() const throw ();
01458
01459 private:
01460 virtual void initializeImpl(double timestamp) throw ();
01461
01462
01463
01464
01465 void processSet_loop(const FieldValue & sfbool, double timestamp)
01466 throw (std::bad_cast);
01467 void processSet_speed(const FieldValue & sffloat, double timestamp)
01468 throw (std::bad_cast);
01469 void processSet_startTime(const FieldValue & sftime,
01470 double timestamp) throw (std::bad_cast);
01471 void processSet_stopTime(const FieldValue & sftime,
01472 double timestamp) throw (std::bad_cast);
01473 void processSet_url(const FieldValue & mfstring, double timestamp)
01474 throw (std::bad_cast, std::bad_alloc);
01475 };
01476
01477
01478 class OPENVRML_SCOPE NavigationInfoClass : public NodeClass {
01479 public:
01480 explicit NavigationInfoClass(Browser & browser);
01481 virtual ~NavigationInfoClass() throw ();
01482
01483 virtual const NodeTypePtr createType(const std::string & id,
01484 const NodeInterfaceSet &)
01485 throw (UnsupportedInterface, std::bad_alloc);
01486 };
01487
01488 class OPENVRML_SCOPE NavigationInfo : public AbstractChild {
01489 friend class NavigationInfoClass;
01490
01491 MFFloat avatarSize;
01492 SFBool headlight;
01493 SFFloat speed;
01494 MFString type;
01495 SFFloat visibilityLimit;
01496 SFBool bound;
01497
01498 public:
01499 NavigationInfo(const NodeType & nodeType,
01500 const ScopePtr & scope);
01501 virtual ~NavigationInfo() throw ();
01502
01503 virtual NavigationInfo * toNavigationInfo() const;
01504
01505 const float * getAvatarSize()
01506 {
01507 return this->avatarSize.getLength() > 0
01508 ? &this->avatarSize.getElement(0)
01509 : 0;
01510 }
01511 bool getHeadlightOn() { return this->headlight.get(); }
01512 float getSpeed() { return this->speed.get(); }
01513 float getVisibilityLimit() { return this->visibilityLimit.get(); }
01514
01515 private:
01516 virtual void initializeImpl(double timestamp) throw ();
01517
01518
01519
01520
01521 void processSet_avatarSize(const FieldValue & mffloat,
01522 double timestamp)
01523 throw (std::bad_cast, std::bad_alloc);
01524 void processSet_bind(const FieldValue & sfbool, double timestamp)
01525 throw (std::bad_cast, std::bad_alloc);
01526 void processSet_headlight(const FieldValue & sfbool,
01527 double timestamp) throw (std::bad_cast);
01528 void processSet_speed(const FieldValue & sffloat, double timestamp)
01529 throw (std::bad_cast);
01530 void processSet_type(const FieldValue & mfstring, double timestamp)
01531 throw (std::bad_cast, std::bad_alloc);
01532 void processSet_visibilityLimit(const FieldValue & sffloat,
01533 double timestamp)
01534 throw (std::bad_cast);
01535 };
01536
01537
01538 class OPENVRML_SCOPE NormalClass : public NodeClass {
01539 public:
01540 explicit NormalClass(Browser & browser);
01541 virtual ~NormalClass() throw ();
01542
01543 virtual const NodeTypePtr createType(const std::string & id,
01544 const NodeInterfaceSet &)
01545 throw (UnsupportedInterface, std::bad_alloc);
01546 };
01547
01548 class OPENVRML_SCOPE Normal : public AbstractBase, public NormalNode {
01549 friend class NormalClass;
01550
01551 MFVec3f vector;
01552
01553 public:
01554 Normal(const NodeType & nodeType,
01555 const ScopePtr & scope);
01556 virtual ~Normal() throw ();
01557
01558
01559
01560
01561 virtual const MFVec3f & getVector() const throw ();
01562
01563 private:
01564
01565
01566
01567 void processSet_vector(const FieldValue & mfvec3f, double timestamp)
01568 throw (std::bad_cast, std::bad_alloc);
01569 };
01570
01571
01572 class OPENVRML_SCOPE NormalInterpolatorClass : public NodeClass {
01573 public:
01574 explicit NormalInterpolatorClass(Browser & browser);
01575 virtual ~NormalInterpolatorClass() throw ();
01576
01577 virtual const NodeTypePtr createType(const std::string & id,
01578 const NodeInterfaceSet &)
01579 throw (UnsupportedInterface, std::bad_alloc);
01580 };
01581
01582 class OPENVRML_SCOPE NormalInterpolator : public AbstractChild {
01583 friend class NormalInterpolatorClass;
01584
01585 MFFloat key;
01586 MFVec3f keyValue;
01587 MFVec3f value;
01588
01589 public:
01590 NormalInterpolator(const NodeType & nodeType,
01591 const ScopePtr & scope);
01592 virtual ~NormalInterpolator() throw ();
01593
01594 private:
01595
01596
01597
01598 void processSet_fraction(const FieldValue & sffloat,
01599 double timestamp)
01600 throw (std::bad_cast, std::bad_alloc);
01601 void processSet_key(const FieldValue & mffloat, double timestamp)
01602 throw (std::bad_cast, std::bad_alloc);
01603 void processSet_keyValue(const FieldValue & mfvec3f,
01604 double timestamp)
01605 throw (std::bad_cast, std::bad_alloc);
01606 };
01607
01608
01609 class OPENVRML_SCOPE OrientationInterpolatorClass : public NodeClass {
01610 public:
01611 explicit OrientationInterpolatorClass(Browser & browser);
01612 virtual ~OrientationInterpolatorClass() throw ();
01613
01614 virtual const NodeTypePtr createType(const std::string & id,
01615 const NodeInterfaceSet &)
01616 throw (UnsupportedInterface, std::bad_alloc);
01617 };
01618
01619 class OPENVRML_SCOPE OrientationInterpolator : public AbstractChild {
01620 friend class OrientationInterpolatorClass;
01621
01622 MFFloat key;
01623 MFRotation keyValue;
01624 SFRotation value;
01625
01626 public:
01627 OrientationInterpolator(const NodeType & nodeType,
01628 const ScopePtr & scope);
01629 virtual ~OrientationInterpolator() throw ();
01630
01631 private:
01632
01633
01634
01635 void processSet_fraction(const FieldValue & sffloat,
01636 double timestamp)
01637 throw (std::bad_cast, std::bad_alloc);
01638 void processSet_key(const FieldValue & mffloat, double timestamp)
01639 throw (std::bad_cast, std::bad_alloc);
01640 void processSet_keyValue(const FieldValue & mfrotation,
01641 double timestamp)
01642 throw (std::bad_cast, std::bad_alloc);
01643 };
01644
01645
01646 class OPENVRML_SCOPE PixelTextureClass : public NodeClass {
01647 public:
01648 explicit PixelTextureClass(Browser & browser);
01649 virtual ~PixelTextureClass() throw ();
01650
01651 virtual const NodeTypePtr createType(const std::string & id,
01652 const NodeInterfaceSet &)
01653 throw (UnsupportedInterface, std::bad_alloc);
01654 };
01655
01656 class OPENVRML_SCOPE PixelTexture : public AbstractTexture {
01657 friend class PixelTextureClass;
01658
01659 SFImage image;
01660
01661 Viewer::TextureObject texObject;
01662
01663 public:
01664 PixelTexture(const NodeType & nodeType,
01665 const ScopePtr & scope);
01666 virtual ~PixelTexture() throw ();
01667
01668 virtual void render(Viewer & viewer, VrmlRenderContext context);
01669
01670 virtual size_t nComponents() const throw ();
01671 virtual size_t width() const throw ();
01672 virtual size_t height() const throw ();
01673 virtual size_t nFrames() const throw ();
01674 virtual const unsigned char * pixels() const throw ();
01675
01676 private:
01677
01678
01679
01680 void processSet_image(const FieldValue & sfimage, double timestamp)
01681 throw (std::bad_cast, std::bad_alloc);
01682 };
01683
01684
01685 class OPENVRML_SCOPE PlaneSensorClass : public NodeClass {
01686 public:
01687 explicit PlaneSensorClass(Browser & browser);
01688 virtual ~PlaneSensorClass() throw ();
01689
01690 virtual const NodeTypePtr createType(const std::string & id,
01691 const NodeInterfaceSet &)
01692 throw (UnsupportedInterface, std::bad_alloc);
01693 };
01694
01695 class OPENVRML_SCOPE PlaneSensor : public AbstractChild {
01696 friend class PlaneSensorClass;
01697
01698 SFBool autoOffset;
01699 SFBool enabled;
01700 SFVec2f maxPosition;
01701 SFVec2f minPosition;
01702 SFVec3f offset;
01703 SFBool active;
01704 SFVec3f translation;
01705 SFVec3f trackPoint;
01706
01707 SFVec3f activationPoint;
01708
01709 Node * parentTransform;
01710 VrmlMatrix activationMatrix;
01711 VrmlMatrix M;
01712
01713 public:
01714 PlaneSensor(const NodeType & nodeType,
01715 const ScopePtr & scope);
01716 virtual ~PlaneSensor() throw ();
01717
01718 virtual PlaneSensor * toPlaneSensor() const;
01719
01720 virtual void render(Viewer & viewer, VrmlRenderContext context);
01721 void activate( double timeStamp, bool isActive, double *p );
01722
01723 virtual void accumulateTransform( Node* );
01724 virtual Node* getParentTransform();
01725
01726 bool isEnabled() { return this->enabled.get(); }
01727
01728 private:
01729
01730
01731
01732 void processSet_autoOffset(const FieldValue & sfbool,
01733 double timestamp) throw (std::bad_cast);
01734 void processSet_enabled(const FieldValue & sfbool, double timestamp)
01735 throw (std::bad_cast);
01736 void processSet_maxPosition(const FieldValue & sfvec2f,
01737 double timestamp) throw (std::bad_cast);
01738 void processSet_minPosition(const FieldValue & sfvec2f,
01739 double timestamp) throw (std::bad_cast);
01740 void processSet_offset(const FieldValue & sfvec3f, double timestamp)
01741 throw (std::bad_cast);
01742
01743 void setMVMatrix(const VrmlMatrix & M_in);
01744 const VrmlMatrix & getMVMatrix()const;
01745 };
01746
01747
01748 class OPENVRML_SCOPE PointLightClass : public NodeClass {
01749 public:
01750 explicit PointLightClass(Browser & browser);
01751 virtual ~PointLightClass() throw ();
01752
01753 virtual const NodeTypePtr createType(const std::string & id,
01754 const NodeInterfaceSet &)
01755 throw (UnsupportedInterface, std::bad_alloc);
01756 };
01757
01758 class OPENVRML_SCOPE PointLight : public AbstractLight {
01759 friend class PointLightClass;
01760
01761 SFVec3f attenuation;
01762 SFVec3f location;
01763 SFFloat radius;
01764
01765 public:
01766 PointLight(const NodeType & nodeType,
01767 const ScopePtr & scope);
01768 virtual ~PointLight() throw ();
01769
01770 virtual PointLight * toPointLight() const;
01771
01772 virtual void renderScoped(Viewer *);
01773
01774 private:
01775 virtual void initializeImpl(double timestamp) throw ();
01776
01777
01778
01779
01780 void processSet_attenuation(const FieldValue & sfvec3f,
01781 double timestamp) throw (std::bad_cast);
01782 void processSet_location(const FieldValue & sfvec3f,
01783 double timestamp) throw (std::bad_cast);
01784 void processSet_radius(const FieldValue & sffloat, double timestamp)
01785 throw (std::bad_cast);
01786 };
01787
01788
01789 class OPENVRML_SCOPE PointSetClass : public NodeClass {
01790 public:
01791 explicit PointSetClass(Browser & browser);
01792 virtual ~PointSetClass() throw ();
01793
01794 virtual const NodeTypePtr createType(const std::string & id,
01795 const NodeInterfaceSet &)
01796 throw (UnsupportedInterface, std::bad_alloc);
01797 };
01798
01799 class OPENVRML_SCOPE PointSet : public AbstractGeometry {
01800 friend class PointSetClass;
01801
01802 SFNode color;
01803 SFNode coord;
01804
01805 BSphere bsphere;
01806
01807 public:
01808 PointSet(const NodeType & nodeType,
01809 const ScopePtr & scope);
01810 virtual ~PointSet() throw ();
01811
01812 virtual void updateModified(NodePath & path, int flags = 0x003);
01813 virtual bool isModified() const;
01814 virtual Viewer::Object insertGeometry(Viewer & viewer,
01815 VrmlRenderContext context);
01816 virtual const BVolume * getBVolume() const;
01817
01818 private:
01819
01820
01821
01822 void processSet_color(const FieldValue & sfnode, double timestamp)
01823 throw (std::bad_cast, std::bad_alloc);
01824 void processSet_coord(const FieldValue & sfnode, double timestamp)
01825 throw (std::bad_cast, std::bad_alloc);
01826
01827 void recalcBSphere();
01828 };
01829
01830
01831 class OPENVRML_SCOPE PositionInterpolatorClass : public NodeClass {
01832 public:
01833 explicit PositionInterpolatorClass(Browser & browser);
01834 virtual ~PositionInterpolatorClass() throw ();
01835
01836 virtual const NodeTypePtr createType(const std::string & id,
01837 const NodeInterfaceSet &)
01838 throw (UnsupportedInterface, std::bad_alloc);
01839 };
01840
01841 class OPENVRML_SCOPE PositionInterpolator : public AbstractChild {
01842 friend class PositionInterpolatorClass;
01843
01844 MFFloat key;
01845 MFVec3f keyValue;
01846 SFVec3f value;
01847
01848 public:
01849 PositionInterpolator(const NodeType & nodeType,
01850 const ScopePtr & scope);
01851 virtual ~PositionInterpolator() throw ();
01852
01853 private:
01854
01855
01856
01857 void processSet_fraction(const FieldValue & sffloat,
01858 double timestamp)
01859 throw (std::bad_cast, std::bad_alloc);
01860 void processSet_key(const FieldValue & mffloat,
01861 double timestamp)
01862 throw (std::bad_cast, std::bad_alloc);
01863 void processSet_keyValue(const FieldValue & mfvec3f,
01864 double timestamp)
01865 throw (std::bad_cast, std::bad_alloc);
01866 };
01867
01868
01869 class OPENVRML_SCOPE ProximitySensorClass : public NodeClass {
01870 public:
01871 explicit ProximitySensorClass(Browser & browser);
01872 virtual ~ProximitySensorClass() throw ();
01873
01874 virtual const NodeTypePtr createType(const std::string & id,
01875 const NodeInterfaceSet &)
01876 throw (UnsupportedInterface, std::bad_alloc);
01877 };
01878
01879 class OPENVRML_SCOPE ProximitySensor : public AbstractChild {
01880 friend class ProximitySensorClass;
01881
01882 SFVec3f center;
01883 SFBool enabled;
01884 SFVec3f size;
01885 SFBool active;
01886 SFVec3f position;
01887 SFRotation orientation;
01888 SFTime enterTime;
01889 SFTime exitTime;
01890
01891 public:
01892 ProximitySensor(const NodeType & nodeType,
01893 const ScopePtr & scope);
01894 virtual ~ProximitySensor() throw ();
01895
01896 virtual void render(Viewer & viewer, VrmlRenderContext context);
01897
01898 private:
01899
01900
01901
01902 void processSet_center(const FieldValue & sfvec3f, double timestamp)
01903 throw (std::bad_cast);
01904 void processSet_size(const FieldValue & sfvec3f, double timestamp)
01905 throw (std::bad_cast);
01906 void processSet_enabled(const FieldValue & sfbool, double timestamp)
01907 throw (std::bad_cast);
01908 };
01909
01910
01911 class OPENVRML_SCOPE ScalarInterpolatorClass : public NodeClass {
01912 public:
01913 explicit ScalarInterpolatorClass(Browser & browser);
01914 virtual ~ScalarInterpolatorClass() throw ();
01915
01916 virtual const NodeTypePtr createType(const std::string & id,
01917 const NodeInterfaceSet &)
01918 throw (UnsupportedInterface, std::bad_alloc);
01919 };
01920
01921 class OPENVRML_SCOPE ScalarInterpolator : public AbstractChild {
01922 friend class ScalarInterpolatorClass;
01923
01924 MFFloat key;
01925 MFFloat keyValue;
01926 SFFloat value;
01927
01928 public:
01929 ScalarInterpolator(const NodeType & nodeType,
01930 const ScopePtr & scope);
01931 virtual ~ScalarInterpolator() throw ();
01932
01933 private:
01934
01935
01936
01937 void processSet_fraction(const FieldValue & sffloat,
01938 double timestamp)
01939 throw (std::bad_cast, std::bad_alloc);
01940 void processSet_key(const FieldValue & mffloat,
01941 double timestamp)
01942 throw (std::bad_cast, std::bad_alloc);
01943 void processSet_keyValue(const FieldValue & mffloat,
01944 double timestamp)
01945 throw (std::bad_cast, std::bad_alloc);
01946 };
01947
01948
01949 class OPENVRML_SCOPE ShapeClass : public NodeClass {
01950 public:
01951 explicit ShapeClass(Browser & browser);
01952 virtual ~ShapeClass() throw ();
01953
01954 virtual const NodeTypePtr createType(const std::string & id,
01955 const NodeInterfaceSet &)
01956 throw (UnsupportedInterface, std::bad_alloc);
01957 };
01958
01959 class OPENVRML_SCOPE Shape : public AbstractChild {
01960 friend class ShapeClass;
01961
01962 SFNode appearance;
01963 SFNode geometry;
01964
01965 Viewer::Object viewerObject;
01966
01967 public:
01968 Shape(const NodeType & nodeType,
01969 const ScopePtr & scope);
01970 virtual ~Shape() throw ();
01971
01972 virtual bool isModified() const;
01973 virtual void updateModified(NodePath& path, int flags);
01974 virtual const BVolume * getBVolume() const;
01975 virtual void render(Viewer & viewer, VrmlRenderContext context);
01976
01977 private:
01978
01979
01980
01981 void processSet_appearance(const FieldValue & sfnode,
01982 double timestamp)
01983 throw (std::bad_cast, std::bad_alloc);
01984 void processSet_geometry(const FieldValue & sfnode,
01985 double timestamp)
01986 throw (std::bad_cast, std::bad_alloc);
01987 };
01988
01989
01990 class OPENVRML_SCOPE SoundClass : public NodeClass {
01991 public:
01992 explicit SoundClass(Browser & browser);
01993 virtual ~SoundClass() throw ();
01994
01995 virtual const NodeTypePtr createType(const std::string & id,
01996 const NodeInterfaceSet &)
01997 throw (UnsupportedInterface, std::bad_alloc);
01998 };
01999
02000 class OPENVRML_SCOPE Sound : public AbstractChild {
02001 friend class SoundClass;
02002
02003 SFVec3f direction;
02004 SFFloat intensity;
02005 SFVec3f location;
02006 SFFloat maxBack;
02007 SFFloat maxFront;
02008 SFFloat minBack;
02009 SFFloat minFront;
02010 SFFloat priority;
02011 SFNode source;
02012 SFBool spatialize;
02013
02014 public:
02015 Sound(const NodeType & nodeType,
02016 const ScopePtr & scope);
02017 virtual ~Sound() throw ();
02018
02019 virtual void updateModified(NodePath & path, int flags = 0x003);
02020 virtual void render(Viewer & viewer, VrmlRenderContext context);
02021
02022 private:
02023
02024
02025
02026 void processSet_direction(const FieldValue & sfvec3f,
02027 double timestamp) throw (std::bad_cast);
02028 void processSet_intensity(const FieldValue & sffloat,
02029 double timestamp) throw (std::bad_cast);
02030 void processSet_location(const FieldValue & sfvec3f,
02031 double timestamp) throw (std::bad_cast);
02032 void processSet_maxBack(const FieldValue & sffloat,
02033 double timestamp) throw (std::bad_cast);
02034 void processSet_maxFront(const FieldValue & sffloat,
02035 double timestamp) throw (std::bad_cast);
02036 void processSet_minBack(const FieldValue & sffloat,
02037 double timestamp) throw (std::bad_cast);
02038 void processSet_minFront(const FieldValue & sffloat,
02039 double timestamp) throw (std::bad_cast);
02040 void processSet_priority(const FieldValue & sffloat,
02041 double timestamp) throw (std::bad_cast);
02042 void processSet_source(const FieldValue & sfnode, double timestamp)
02043 throw (std::bad_cast, std::bad_alloc);
02044 };
02045
02046
02047 class OPENVRML_SCOPE SphereClass : public NodeClass {
02048 public:
02049 explicit SphereClass(Browser & browser);
02050 virtual ~SphereClass() throw ();
02051
02052 virtual const NodeTypePtr createType(const std::string & id,
02053 const NodeInterfaceSet &)
02054 throw (UnsupportedInterface, std::bad_alloc);
02055 };
02056
02057 class OPENVRML_SCOPE Sphere : public AbstractGeometry {
02058 friend class SphereClass;
02059
02060 SFFloat radius;
02061 BSphere bsphere;
02062
02063 public:
02064 Sphere(const NodeType & nodeType,
02065 const ScopePtr & scope);
02066 virtual ~Sphere() throw ();
02067
02068 virtual Viewer::Object insertGeometry(Viewer & viewer,
02069 VrmlRenderContext context);
02070 virtual const BVolume * getBVolume() const;
02071 };
02072
02073
02074 class OPENVRML_SCOPE SphereSensorClass : public NodeClass {
02075 public:
02076 explicit SphereSensorClass(Browser & browser);
02077 virtual ~SphereSensorClass() throw ();
02078
02079 virtual const NodeTypePtr createType(const std::string & id,
02080 const NodeInterfaceSet &)
02081 throw (UnsupportedInterface, std::bad_alloc);
02082 };
02083
02084 class OPENVRML_SCOPE SphereSensor : public AbstractChild {
02085 friend class SphereSensorClass;
02086
02087 SFBool autoOffset;
02088 SFBool enabled;
02089 SFRotation offset;
02090 SFBool active;
02091 SFRotation rotation;
02092 SFVec3f trackPoint;
02093
02094 SFVec3f activationPoint;
02095 SFVec3f centerPoint;
02096 VrmlMatrix M;
02097
02098 public:
02099 SphereSensor(const NodeType & nodeType,
02100 const ScopePtr & scope);
02101 virtual ~SphereSensor() throw ();
02102
02103 virtual SphereSensor * toSphereSensor() const;
02104
02105 virtual void render(Viewer & viewer, VrmlRenderContext context);
02106 void activate( double timeStamp, bool isActive, double *p );
02107
02108 bool isEnabled() { return this->enabled.get(); }
02109
02110 private:
02111
02112
02113
02114 void processSet_autoOffset(const FieldValue & sfbool,
02115 double timestamp) throw (std::bad_cast);
02116 void processSet_enabled(const FieldValue & sfbool, double timestamp)
02117 throw (std::bad_cast);
02118 void processSet_offset(const FieldValue & sfrotation,
02119 double timestamp) throw (std::bad_cast);
02120
02121 void setMVMatrix(const VrmlMatrix & M_in);
02122 const VrmlMatrix & getMVMatrix()const;
02123 };
02124
02125
02126 class OPENVRML_SCOPE SpotLightClass : public NodeClass {
02127 public:
02128 explicit SpotLightClass(Browser & browser);
02129 virtual ~SpotLightClass() throw ();
02130
02131 virtual const NodeTypePtr createType(const std::string & id,
02132 const NodeInterfaceSet &)
02133 throw (UnsupportedInterface, std::bad_alloc);
02134 };
02135
02136 class OPENVRML_SCOPE SpotLight : public AbstractLight {
02137 friend class SpotLightClass;
02138
02139 SFVec3f attenuation;
02140 SFFloat beamWidth;
02141 SFFloat cutOffAngle;
02142 SFVec3f direction;
02143 SFVec3f location;
02144 SFFloat radius;
02145
02146 public:
02147 SpotLight(const NodeType & nodeType,
02148 const ScopePtr & scope);
02149 virtual ~SpotLight() throw ();
02150
02151 virtual SpotLight * toSpotLight() const;
02152
02153 virtual void renderScoped(Viewer *);
02154
02155 private:
02156 virtual void initializeImpl(double timestamp) throw ();
02157
02158
02159
02160
02161 void processSet_attenuation(const FieldValue & sfvec3f,
02162 double timestamp) throw (std::bad_cast);
02163 void processSet_beamWidth(const FieldValue & sffloat,
02164 double timestamp) throw (std::bad_cast);
02165 void processSet_cutOffAngle(const FieldValue & sffloat,
02166 double timestamp) throw (std::bad_cast);
02167 void processSet_direction(const FieldValue & sfvec3f,
02168 double timestamp) throw (std::bad_cast);
02169 void processSet_location(const FieldValue & sfvec3f,
02170 double timestamp) throw (std::bad_cast);
02171 void processSet_radius(const FieldValue & sffloat,
02172 double timestamp) throw (std::bad_cast);
02173 };
02174
02175
02176 class OPENVRML_SCOPE SwitchClass : public NodeClass {
02177 public:
02178 explicit SwitchClass(Browser & browser);
02179 virtual ~SwitchClass() throw ();
02180
02181 virtual const NodeTypePtr createType(const std::string & id,
02182 const NodeInterfaceSet &)
02183 throw (UnsupportedInterface, std::bad_alloc);
02184 };
02185
02186 class OPENVRML_SCOPE Switch : public AbstractChild {
02187 friend class SwitchClass;
02188
02189 MFNode choice;
02190 SFInt32 whichChoice;
02191
02192 BSphere bsphere;
02193
02194 public:
02195 Switch(const NodeType & nodeType,
02196 const ScopePtr & scope);
02197 virtual ~Switch() throw ();
02198
02199 virtual bool isModified() const;
02200 virtual void updateModified(NodePath & path, int flags = 0x003);
02201 virtual void render(Viewer & viewer, VrmlRenderContext context);
02202 virtual const BVolume * getBVolume() const;
02203
02204 private:
02205
02206
02207
02208 void processSet_choice(const FieldValue & mfnode, double timestamp)
02209 throw (std::bad_cast, std::bad_alloc);
02210 void processSet_whichChoice(const FieldValue & sfint32,
02211 double timestamp) throw (std::bad_cast);
02212
02213 virtual void recalcBSphere();
02214 };
02215
02216
02217 class OPENVRML_SCOPE TextClass : public NodeClass {
02218 public:
02219 FT_Library freeTypeLibrary;
02220
02221 explicit TextClass(Browser & browser);
02222 virtual ~TextClass() throw ();
02223
02224 virtual const NodeTypePtr createType(const std::string & id,
02225 const NodeInterfaceSet &)
02226 throw (UnsupportedInterface, std::bad_alloc);
02227 };
02228
02229 class OPENVRML_SCOPE Text : public AbstractGeometry {
02230 friend class TextClass;
02231
02232 MFString string;
02233 SFNode fontStyle;
02234 MFFloat length;
02235 SFFloat maxExtent;
02236
02237 struct GlyphGeometry {
02238 MFVec2f coord;
02239 MFInt32 coordIndex;
02240 float advanceWidth;
02241 float advanceHeight;
02242
02243 GlyphGeometry(const std::vector<MFVec2f> & contours,
02244 float advanceWidth, float advanceHeight)
02245 throw (std::bad_alloc);
02246 };
02247
02248 struct TextGeometry {
02249 MFVec3f coord;
02250 MFInt32 coordIndex;
02251 MFVec3f normal;
02252 };
02253
02254 typedef std::vector<std::vector<FcChar32> > Ucs4String;
02255 typedef std::map<FT_UInt, GlyphGeometry> GlyphGeometryMap;
02256
02257 Ucs4String ucs4String;
02258 FT_Face face;
02259 GlyphGeometryMap glyphGeometryMap;
02260 TextGeometry textGeometry;
02261
02262 public:
02263 Text(const NodeType & nodeType,
02264 const ScopePtr & scope);
02265 virtual ~Text() throw ();
02266
02267 virtual bool isModified() const;
02268 virtual void updateModified(NodePath & path, int flags = 0x003);
02269 virtual Viewer::Object insertGeometry(Viewer & viewer,
02270 VrmlRenderContext context);
02271
02272 private:
02273 virtual void initializeImpl(double timestamp) throw ();
02274
02275
02276
02277
02278 void processSet_string(const FieldValue & mfstring,
02279 double timestamp)
02280 throw (std::bad_cast, std::bad_alloc);
02281 void processSet_fontStyle(const FieldValue & sfnode,
02282 double timestamp)
02283 throw (std::bad_cast, std::bad_alloc);
02284 void processSet_length(const FieldValue & mffloat,
02285 double timestamp)
02286 throw (std::bad_cast, std::bad_alloc);
02287 void processSet_maxExtent(const FieldValue & sffloat,
02288 double timestamp) throw (std::bad_cast);
02289
02290 void updateUcs4() throw (std::bad_alloc);
02291 void updateFace() throw (std::bad_alloc);
02292 void updateGeometry() throw (std::bad_alloc);
02293 };
02294
02295
02296 class OPENVRML_SCOPE TextureCoordinateClass : public NodeClass {
02297 public:
02298 explicit TextureCoordinateClass(Browser & browser);
02299 virtual ~TextureCoordinateClass() throw ();
02300
02301 virtual const NodeTypePtr createType(const std::string & id,
02302 const NodeInterfaceSet &)
02303 throw (UnsupportedInterface, std::bad_alloc);
02304 };
02305
02306 class OPENVRML_SCOPE TextureCoordinate : public AbstractBase,
02307 public TextureCoordinateNode {
02308 friend class TextureCoordinateClass;
02309
02310 MFVec2f point;
02311
02312 public:
02313 TextureCoordinate(const NodeType & nodeType,
02314 const ScopePtr & scope);
02315 virtual ~TextureCoordinate() throw ();
02316
02317
02318
02319
02320 virtual const MFVec2f & getPoint() const throw();
02321
02322 private:
02323
02324
02325
02326 void processSet_point(const FieldValue & mfvec2f, double timestamp)
02327 throw (std::bad_cast, std::bad_alloc);
02328 };
02329
02330
02331 class OPENVRML_SCOPE TextureTransformClass : public NodeClass {
02332 public:
02333 explicit TextureTransformClass(Browser & browser);
02334 virtual ~TextureTransformClass() throw ();
02335
02336 virtual const NodeTypePtr createType(const std::string & id,
02337 const NodeInterfaceSet &)
02338 throw (UnsupportedInterface, std::bad_alloc);
02339 };
02340
02341 class OPENVRML_SCOPE TextureTransform : public AbstractBase,
02342 public TextureTransformNode {
02343 friend class TextureTransformClass;
02344
02345 SFVec2f center;
02346 SFFloat rotation;
02347 SFVec2f scale;
02348 SFVec2f translation;
02349
02350 public:
02351 TextureTransform(const NodeType & nodeType,
02352 const ScopePtr & scope);
02353 virtual ~TextureTransform() throw ();
02354
02355 virtual void render(Viewer & viewer, VrmlRenderContext context);
02356
02357 private:
02358
02359
02360
02361 void processSet_center(const FieldValue & sfvec2f, double timestamp)
02362 throw (std::bad_cast);
02363 void processSet_rotation(const FieldValue & sffloat,
02364 double timestamp) throw (std::bad_cast);
02365 void processSet_scale(const FieldValue & sfvec2f, double timestamp)
02366 throw (std::bad_cast);
02367 void processSet_translation(const FieldValue & sfvec2f,
02368 double timestamp) throw (std::bad_cast);
02369 };
02370
02371
02372 class OPENVRML_SCOPE TimeSensorClass : public NodeClass {
02373 public:
02374 explicit TimeSensorClass(Browser & browser);
02375 virtual ~TimeSensorClass() throw ();
02376
02377 virtual const NodeTypePtr createType(const std::string & id,
02378 const NodeInterfaceSet &)
02379 throw (UnsupportedInterface, std::bad_alloc);
02380 };
02381
02382 class OPENVRML_SCOPE TimeSensor : public AbstractChild {
02383 friend class TimeSensorClass;
02384
02385 SFTime cycleInterval;
02386 SFBool enabled;
02387 SFBool loop;
02388 SFTime startTime;
02389 SFTime stopTime;
02390 SFTime cycleTime;
02391 SFFloat fraction;
02392 SFBool active;
02393 SFTime time;
02394
02395 double lastTime;
02396
02397 public:
02398 TimeSensor(const NodeType & nodeType,
02399 const ScopePtr & scope);
02400 virtual ~TimeSensor() throw ();
02401
02402 virtual TimeSensor * toTimeSensor() const;
02403 virtual const BVolume * getBVolume() const;
02404
02405 void update(double time);
02406
02407 private:
02408 virtual void initializeImpl(double timestamp) throw ();
02409
02410
02411
02412
02413 void processSet_cycleInterval(const FieldValue & sftime,
02414 double timestamp)
02415 throw (std::bad_cast);
02416 void processSet_enabled(const FieldValue & sfbool, double timestamp)
02417 throw (std::bad_cast);
02418 void processSet_loop(const FieldValue & sfbool, double timestamp)
02419 throw (std::bad_cast);
02420 void processSet_startTime(const FieldValue & sftime,
02421 double timestamp) throw (std::bad_cast);
02422 void processSet_stopTime(const FieldValue & sftime,
02423 double timestamp) throw (std::bad_cast);
02424 };
02425
02426
02427 class OPENVRML_SCOPE TouchSensorClass : public NodeClass {
02428 public:
02429 explicit TouchSensorClass(Browser & browser);
02430 virtual ~TouchSensorClass() throw ();
02431
02432 virtual const NodeTypePtr createType(const std::string & id,
02433 const NodeInterfaceSet &)
02434 throw (UnsupportedInterface, std::bad_alloc);
02435 };
02436
02437 class OPENVRML_SCOPE TouchSensor : public AbstractChild {
02438 friend class TouchSensorClass;
02439
02440 SFBool enabled;
02441 SFVec3f hitNormal;
02442 SFVec3f hitPoint;
02443 SFVec2f hitTexCoord;
02444 SFBool active;
02445 SFBool over;
02446 SFTime touchTime;
02447
02448 public:
02449 TouchSensor(const NodeType & nodeType,
02450 const ScopePtr & scope);
02451 virtual ~TouchSensor() throw ();
02452
02453 virtual TouchSensor * toTouchSensor() const;
02454
02455 void activate( double timeStamp, bool isOver, bool isActive, double *p );
02456
02457 bool isEnabled() const;
02458
02459 private:
02460
02461
02462
02463 void processSet_enabled(const FieldValue & sfbool, double timestamp)
02464 throw (std::bad_cast);
02465 };
02466
02467
02468 class OPENVRML_SCOPE TransformClass : public NodeClass {
02469 public:
02470 explicit TransformClass(Browser & browser);
02471 virtual ~TransformClass() throw ();
02472
02473 virtual const NodeTypePtr createType(const std::string & id,
02474 const NodeInterfaceSet &)
02475 throw (UnsupportedInterface, std::bad_alloc);
02476 };
02477
02478 class OPENVRML_SCOPE Transform : public Group {
02479 friend class TransformClass;
02480
02481 SFVec3f center;
02482 SFRotation rotation;
02483 SFVec3f scale;
02484 SFRotation scaleOrientation;
02485 SFVec3f translation;
02486
02487 Viewer::Object xformObject;
02488 VrmlMatrix M;
02489 bool M_dirty;
02490
02491 public:
02492 Transform(const NodeType & nodeType,
02493 const ScopePtr & scope);
02494 virtual ~Transform() throw ();
02495
02496 virtual void render(Viewer & viewer, VrmlRenderContext context);
02497
02498 virtual void accumulateTransform(Node*);
02499 virtual void inverseTransform(VrmlMatrix &);
02500 virtual const BVolume * getBVolume() const;
02501
02502 void getMatrix(VrmlMatrix & M) const;
02503
02504 private:
02505
02506
02507
02508 void processSet_center(const FieldValue & sfvec3f, double timestamp)
02509 throw (std::bad_cast);
02510 void processSet_rotation(const FieldValue & sfrotation,
02511 double timestamp) throw (std::bad_cast);
02512 void processSet_scale(const FieldValue & sfvec3f, double timestamp)
02513 throw (std::bad_cast);
02514 void processSet_scaleOrientation(const FieldValue & sfrotation,
02515 double timestamp)
02516 throw (std::bad_cast);
02517 void processSet_translation(const FieldValue & sfvec3f,
02518 double timestamp) throw (std::bad_cast);
02519
02520 void recalcBSphere();
02521 void synch_cached_matrix();
02522 };
02523
02524
02525 class OPENVRML_SCOPE ViewpointClass : public NodeClass {
02526 public:
02527 explicit ViewpointClass(Browser & browser);
02528 virtual ~ViewpointClass() throw ();
02529
02530 virtual const NodeTypePtr createType(const std::string & id,
02531 const NodeInterfaceSet &)
02532 throw (UnsupportedInterface, std::bad_alloc);
02533 };
02534
02535 class OPENVRML_SCOPE Viewpoint : public AbstractChild {
02536 friend class ViewpointClass;
02537
02538 SFFloat fieldOfView;
02539 SFBool jump;
02540 SFRotation orientation;
02541 SFVec3f position;
02542 SFString description;
02543 SFBool bound;
02544 SFTime bindTime;
02545
02546 Node * parentTransform;
02547
02548 public:
02549 Viewpoint(const NodeType & nodeType,
02550 const ScopePtr & scope);
02551 virtual ~Viewpoint() throw ();
02552
02553 virtual Viewpoint * toViewpoint() const;
02554
02555 virtual void accumulateTransform( Node* );
02556 virtual Node* getParentTransform();
02557
02558 const SFFloat & getFieldOfView() const;
02559 const SFRotation & getOrientation() const;
02560 const SFVec3f & getPosition() const;
02561 const SFString & getDescription() const;
02562
02563 const BVolume * getBVolume() const;
02564
02565 void getInverseMatrix(VrmlMatrix & M) const;
02566
02567 void getFrustum(VrmlFrustum& frust) const;
02568
02569 private:
02570 virtual void initializeImpl(double timestamp) throw ();
02571
02572
02573
02574
02575 void processSet_bind(const FieldValue & sfbool, double timestamp)
02576 throw (std::bad_cast, std::bad_alloc);
02577 void processSet_fieldOfView(const FieldValue & sffloat,
02578 double timestamp) throw (std::bad_cast);
02579 void processSet_jump(const FieldValue & sfbool, double timestamp)
02580 throw (std::bad_cast);
02581 void processSet_orientation(const FieldValue & sfrotation,
02582 double timestamp) throw (std::bad_cast);
02583 void processSet_position(const FieldValue & sfvec3f,
02584 double timestamp) throw (std::bad_cast);
02585 };
02586
02587
02588 class OPENVRML_SCOPE VisibilitySensorClass : public NodeClass {
02589 public:
02590 explicit VisibilitySensorClass(Browser & browser);
02591 virtual ~VisibilitySensorClass() throw ();
02592
02593 virtual const NodeTypePtr createType(const std::string & id,
02594 const NodeInterfaceSet &)
02595 throw (UnsupportedInterface, std::bad_alloc);
02596 };
02597
02598 class OPENVRML_SCOPE VisibilitySensor : public AbstractChild {
02599 friend class VisibilitySensorClass;
02600
02601 SFVec3f center;
02602 SFBool enabled;
02603 SFVec3f size;
02604 SFBool active;
02605 SFTime enterTime;
02606 SFTime exitTime;
02607
02608 public:
02609 VisibilitySensor(const NodeType & nodeType,
02610 const ScopePtr & scope);
02611 virtual ~VisibilitySensor() throw ();
02612
02613 virtual void render(Viewer & viewer, VrmlRenderContext context);
02614
02615 private:
02616
02617
02618
02619 void processSet_center(const FieldValue & sfvec3f, double timestamp)
02620 throw (std::bad_cast);
02621 void processSet_enabled(const FieldValue & sfbool, double timestamp)
02622 throw (std::bad_cast);
02623 void processSet_size(const FieldValue & sfvec3f, double timestamp)
02624 throw (std::bad_cast);
02625 };
02626
02627
02628 class OPENVRML_SCOPE WorldInfoClass : public NodeClass {
02629 public:
02630 explicit WorldInfoClass(Browser & browser);
02631 virtual ~WorldInfoClass() throw ();
02632
02633 virtual const NodeTypePtr createType(const std::string & id,
02634 const NodeInterfaceSet &)
02635 throw (UnsupportedInterface, std::bad_alloc);
02636 };
02637
02638 class OPENVRML_SCOPE WorldInfo : public AbstractChild {
02639 friend class WorldInfoClass;
02640
02641 MFString info;
02642 SFString title;
02643
02644 public:
02645 WorldInfo(const NodeType & nodeType,
02646 const ScopePtr & scope);
02647 virtual ~WorldInfo() throw ();
02648 };
02649 }
02650 }
02651
02652 # endif