Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

field.h

00001 //
00002 // OpenVRML
00003 //
00004 // Copyright (C) 1998  Chris Morley
00005 // Copyright (C) 2001  Braden McDaniel
00006 // 
00007 // This library is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public
00009 // License as published by the Free Software Foundation; either
00010 // version 2.1 of the License, or (at your option) any later version.
00011 // 
00012 // This library is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 // Lesser General Public License for more details.
00016 // 
00017 // You should have received a copy of the GNU Lesser General Public
00018 // License along with this library; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 // 
00021 
00022 # ifndef OPENVRML_FIELD_H
00023 #   define OPENVRML_FIELD_H
00024 
00025 #   include <iosfwd>
00026 #   include <memory>
00027 #   include <string>
00028 #   include <typeinfo>
00029 #   include <vector>
00030 #   include "nodeptr.h"
00031 
00032 namespace OpenVRML {
00033     class FieldValue;
00034 
00035     std::ostream & operator<<(std::ostream & out,
00036                               const FieldValue & fieldValue);
00037 
00038     class OPENVRML_SCOPE FieldValue {
00039         friend std::ostream & operator<<(std::ostream & out,
00040                                          const FieldValue & fieldValue);
00041 
00042     public:
00043         enum Type {
00044             invalidType, sfbool, sfcolor, sffloat, sfimage, sfint32, sfnode,
00045             sfrotation, sfstring, sftime, sfvec2f, sfvec3f, mfcolor, mffloat,
00046             mfint32, mfnode, mfrotation, mfstring, mftime, mfvec2f, mfvec3f
00047         };
00048 
00049         virtual ~FieldValue() throw () = 0;
00050         
00051         virtual std::auto_ptr<FieldValue> clone() const
00052             throw (std::bad_alloc) = 0;
00053         virtual FieldValue & assign(const FieldValue & value)
00054             throw (std::bad_cast, std::bad_alloc) = 0;
00055         virtual Type type() const throw () = 0;
00056     
00057     protected:
00058         FieldValue() throw ();
00059         FieldValue(const FieldValue & value) throw ();
00060         FieldValue & operator=(const FieldValue & value) throw ();
00061     
00062     private:
00063         virtual void print(std::ostream & out) const = 0;
00064     };
00065 
00066     std::ostream & operator<<(std::ostream & out, FieldValue::Type type);
00067     std::istream & operator>>(std::istream & out, FieldValue::Type & type);
00068 
00069 
00070     class OPENVRML_SCOPE SFBool : public FieldValue {
00071         bool value;
00072 
00073     public:
00074         explicit SFBool(bool value = false) throw ();
00075         virtual ~SFBool() throw ();
00076 
00077         // Use compiler-defined copy ctor and operator=.
00078 
00079         bool get() const throw ();
00080         void set(bool value) throw ();
00081 
00082         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00083         virtual FieldValue & assign(const FieldValue & value)
00084             throw (std::bad_cast);
00085         virtual Type type() const throw ();
00086     
00087     private:
00088         virtual void print(std::ostream & out) const;
00089     };
00090 
00091 
00092     class OPENVRML_SCOPE SFColor : public FieldValue {
00093         float value[3];
00094 
00095     public:
00096         typedef float (&ArrayReference)[3];
00097         typedef const float (&ConstArrayReference)[3];
00098         typedef float (*ArrayPointer)[3];
00099         typedef const float (*ConstArrayPointer)[3];
00100         
00101         static void HSVtoRGB(ConstArrayReference hsv, ArrayReference rgb)
00102                 throw ();
00103         static void RGBtoHSV(ConstArrayReference rgb, ArrayReference hsv)
00104                 throw ();
00105 
00106         SFColor() throw ();
00107         explicit SFColor(ConstArrayReference rgb) throw ();
00108         SFColor(float r, float g, float b) throw ();
00109         virtual ~SFColor() throw ();
00110 
00111         // Use compiler-defined copy ctor and operator=.
00112 
00113         float operator[](size_t index) const throw ();
00114         float & operator[](size_t index) throw ();
00115         float getR() const throw ();
00116         float getG() const throw ();
00117         float getB() const throw ();
00118         ConstArrayReference get() const throw ();
00119         void set(ConstArrayReference rgb) throw ();
00120         void setHSV(float h, float s, float v) throw ();
00121         void getHSV(ArrayReference hsv) const throw ();
00122 
00123         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00124         virtual FieldValue & assign(const FieldValue & value)
00125             throw (std::bad_cast);
00126         virtual Type type() const throw ();
00127     
00128     private:
00129         virtual void print(std::ostream & out) const;
00130     };
00131 
00132 
00133     class OPENVRML_SCOPE SFFloat : public FieldValue {
00134         float value;
00135 
00136     public:
00137         explicit SFFloat(float value = 0.0) throw ();
00138         virtual ~SFFloat() throw ();
00139 
00140         // Use compiler-defined copy ctor and operator=.
00141 
00142         float get() const throw ();
00143         void set(float value) throw ();
00144 
00145         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00146         virtual FieldValue & assign(const FieldValue & value)
00147             throw (std::bad_cast);
00148         virtual Type type() const throw ();
00149     
00150     private:
00151         virtual void print(std::ostream & out) const;
00152     };
00153 
00154 
00155     class OPENVRML_SCOPE SFImage : public FieldValue {
00156         size_t d_w, d_h, d_nc;
00157         unsigned char * d_pixels;       // nc bytes/pixel, lower left to upper right
00158 
00159     public:
00160         SFImage() throw ();
00161         SFImage(size_t w, size_t h, size_t nc, const unsigned char * pixels = 0)
00162                 throw (std::bad_alloc);
00163         SFImage(const SFImage &) throw (std::bad_alloc);
00164         virtual ~SFImage() throw ();
00165 
00166         SFImage & operator=(const SFImage & rhs) throw (std::bad_alloc);
00167 
00168         size_t getWidth() const throw ();
00169         size_t getHeight() const throw ();
00170         size_t getComponents() const throw ();
00171         const unsigned char * getPixels() const throw ();
00172         void set(size_t width, size_t height, size_t components,
00173                  const unsigned char * pixels) throw (std::bad_alloc);
00174 
00175         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00176         virtual FieldValue & assign(const FieldValue & value)
00177             throw (std::bad_cast, std::bad_alloc);
00178         virtual Type type() const throw ();
00179     
00180     private:
00181         virtual void print(std::ostream & out) const;
00182     };
00183 
00184 
00185     class OPENVRML_SCOPE SFInt32 : public FieldValue {
00186         long value;
00187 
00188     public:
00189         explicit SFInt32(long value = 0) throw ();
00190         virtual ~SFInt32() throw ();
00191 
00192         // Use compiler-defined copy ctor and operator=.
00193 
00194         long get() const throw ();
00195         void set(long value) throw ();
00196 
00197         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00198         virtual FieldValue & assign(const FieldValue & value)
00199             throw (std::bad_cast);
00200         virtual Type type() const throw ();
00201     
00202     private:
00203         virtual void print(std::ostream &) const;
00204     };
00205 
00206 
00207     class OPENVRML_SCOPE SFNode : public FieldValue {
00208         NodePtr node;
00209 
00210     public:
00211         explicit SFNode(const NodePtr & node = NodePtr(0)) throw ();
00212         virtual ~SFNode() throw ();
00213 
00214         // Use compiler-defined copy ctor and operator=.
00215 
00216         const NodePtr & get() const throw ();
00217         void set(const NodePtr & node) throw ();
00218 
00219         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00220         virtual FieldValue & assign(const FieldValue & value)
00221             throw (std::bad_cast);
00222         virtual Type type() const throw ();
00223     
00224     private:
00225         virtual void print(std::ostream &) const;
00226     };
00227 
00228 
00229     class SFVec3f;
00230     
00231     class OPENVRML_SCOPE SFRotation : public FieldValue {
00232         float value[4];
00233 
00234     public:
00235         typedef float (&ArrayReference)[4];
00236         typedef const float (&ConstArrayReference)[4];
00237         typedef float (*ArrayPointer)[4];
00238         typedef const float (*ConstArrayPointer)[4];
00239         
00240         SFRotation() throw ();
00241         explicit SFRotation(ConstArrayReference rot) throw ();
00242         SFRotation(float x, float y, float z, float angle) throw ();
00243         SFRotation(const SFVec3f & axis, float angle) throw ();
00244         SFRotation(const SFVec3f & fromVec, const SFVec3f & toVec) throw ();
00245         virtual ~SFRotation() throw ();
00246 
00247         // Use compiler-defined copy ctor and operator=.
00248 
00249         ConstArrayReference get() const throw ();
00250         void set(ConstArrayReference rot) throw ();
00251         float getX() const throw ();
00252         void setX(float value) throw ();
00253         float getY() const throw ();
00254         void setY(float value) throw ();
00255         float getZ() const throw ();
00256         void setZ(float value) throw ();
00257         float getAngle() const throw ();
00258         void setAngle(float value) throw ();
00259         const SFVec3f getAxis() const throw ();
00260         void setAxis(const SFVec3f & vec) throw ();
00261         const SFRotation inverse() const throw ();
00262         const SFRotation multiply(const SFRotation & rot) const throw ();
00263         const SFVec3f multVec(const SFVec3f & vec) const;
00264         const SFRotation slerp(const SFRotation & destRot, float t) const
00265                 throw ();  
00266 
00267         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00268         virtual FieldValue & assign(const FieldValue & value)
00269             throw (std::bad_cast);
00270         virtual Type type() const throw ();
00271 
00272     private:
00273         virtual void print(std::ostream & os) const;
00274     };
00275 
00276 
00277     class OPENVRML_SCOPE SFString : public FieldValue {
00278         std::string value;
00279 
00280     public:
00281         explicit SFString(const std::string & value = std::string())
00282                 throw (std::bad_alloc);
00283         virtual ~SFString() throw ();
00284 
00285         // Use compiler-defined copy ctor and operator=.
00286 
00287         const std::string & get() const throw ();
00288         void set(const std::string & value) throw (std::bad_alloc);
00289 
00290         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00291         virtual FieldValue & assign(const FieldValue & value)
00292             throw (std::bad_cast, std::bad_alloc);
00293         virtual Type type() const throw ();
00294     
00295     private:
00296         virtual void print(std::ostream &) const;
00297     };
00298 
00299 
00300     class OPENVRML_SCOPE SFTime : public FieldValue {
00301         double value;
00302 
00303     public:
00304         explicit SFTime(double value = 0.0) throw ();
00305         virtual ~SFTime() throw ();
00306 
00307         // Use compiler-defined copy ctor and operator=.
00308 
00309         double get() const throw ();
00310         void set(double value) throw ();
00311 
00312         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00313         virtual FieldValue & assign(const FieldValue & value)
00314             throw (std::bad_cast);
00315         virtual Type type() const throw ();
00316     
00317     private:
00318         virtual void print(std::ostream &) const;
00319     };
00320 
00321 
00322     class OPENVRML_SCOPE SFVec2f : public FieldValue {
00323         float value[2];
00324 
00325     public:
00326         typedef float (&ArrayReference)[2];
00327         typedef const float (&ConstArrayReference)[2];
00328         typedef float (*ArrayPointer)[2];
00329         typedef const float (*ConstArrayPointer)[2];
00330         
00331         SFVec2f() throw ();
00332         explicit SFVec2f(ConstArrayReference vec) throw ();
00333         SFVec2f(float x, float y) throw ();
00334         virtual ~SFVec2f() throw ();
00335 
00336         // Use compiler-defined copy ctor and operator=.
00337 
00338         float operator[](size_t index) const throw ();
00339         float & operator[](size_t index) throw ();
00340         float getX() const throw ();
00341         void setX(float) throw ();
00342         float getY() const throw ();
00343         void setY(float) throw ();
00344         ConstArrayReference get() const throw ();
00345         void set(ConstArrayReference vec) throw ();
00346         const SFVec2f add(const SFVec2f & vec) const throw ();
00347         const SFVec2f divide(float number) const throw ();
00348         double dot(const SFVec2f & vec) const throw ();
00349         double length() const throw ();
00350         const SFVec2f multiply(float number) const throw ();
00351         const SFVec2f negate() const throw ();
00352         const SFVec2f normalize() const throw ();
00353         const SFVec2f subtract(const SFVec2f & vec) const throw ();
00354 
00355         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00356         virtual FieldValue & assign(const FieldValue & value)
00357             throw (std::bad_cast);
00358         virtual Type type() const throw ();
00359     
00360     private:
00361         virtual void print(std::ostream &) const;
00362     };
00363 
00364 
00365     class OPENVRML_SCOPE SFVec3f : public FieldValue {
00366         float value[3];
00367 
00368     public:
00369         typedef float (&ArrayReference)[3];
00370         typedef const float (&ConstArrayReference)[3];
00371         typedef float (*ArrayPointer)[3];
00372         typedef const float (*ConstArrayPointer)[3];
00373         
00374         SFVec3f() throw ();
00375         explicit SFVec3f(ConstArrayReference vec) throw ();
00376         SFVec3f(float x, float y, float z) throw ();
00377         virtual ~SFVec3f() throw ();
00378 
00379         // Use compiler-defined copy ctor and operator=.
00380 
00381         float operator[](size_t index) const throw ();
00382         float & operator[](size_t index) throw ();
00383         float getX() const throw ();
00384         void setX(float) throw ();
00385         float getY() const throw ();
00386         void setY(float) throw ();
00387         float getZ() const throw ();
00388         void setZ(float) throw ();
00389         ConstArrayReference get() const throw ();
00390         void set(ConstArrayReference vec) throw ();
00391         const SFVec3f add(const SFVec3f & vec) const throw ();
00392         const SFVec3f cross(const SFVec3f & vec) const throw ();
00393         const SFVec3f divide(float number) const throw ();
00394         double dot(const SFVec3f & vec) const throw ();
00395         double length() const throw ();
00396         const SFVec3f multiply(float number) const throw ();
00397         const SFVec3f negate() const throw ();
00398         const SFVec3f normalize() const throw ();
00399         const SFVec3f subtract(const SFVec3f & vec) const throw ();
00400 
00401         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00402         virtual FieldValue & assign(const FieldValue & value)
00403             throw (std::bad_cast);
00404         virtual Type type() const throw ();
00405     
00406     private:
00407         virtual void print(std::ostream &) const;
00408     };
00409 
00410 
00411     class OPENVRML_SCOPE MFColor : public FieldValue {
00412         void * values;
00413 
00414     public:
00415         explicit MFColor(size_t length = 0,
00416                          SFColor::ConstArrayPointer values = 0)
00417             throw (std::bad_alloc);
00418         MFColor(const MFColor & mfcolor) throw (std::bad_alloc);
00419         virtual ~MFColor() throw ();
00420 
00421         MFColor & operator=(const MFColor & mfcolor) throw (std::bad_alloc);
00422 
00423         SFColor::ConstArrayReference getElement(size_t index) const throw ();
00424         void setElement(size_t index, SFColor::ConstArrayReference value)
00425             throw ();
00426         size_t getLength() const throw ();
00427         void setLength(size_t length) throw (std::bad_alloc);
00428         void addElement(SFColor::ConstArrayReference value)
00429             throw (std::bad_alloc);
00430         void insertElement(size_t index, SFColor::ConstArrayReference value)
00431             throw (std::bad_alloc);
00432         void removeElement(size_t index) throw ();
00433 
00434         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00435         virtual FieldValue & assign(const FieldValue & value)
00436             throw (std::bad_cast, std::bad_alloc);
00437         virtual Type type() const throw ();
00438     
00439     private:
00440         virtual void print(std::ostream &) const;
00441     };
00442 
00443 
00444     class OPENVRML_SCOPE MFFloat : public FieldValue {
00445         std::vector<float> values;
00446 
00447     public:
00448         explicit MFFloat(size_t length = 0, float const * values = 0)
00449             throw (std::bad_alloc);
00450         virtual ~MFFloat() throw ();
00451 
00452         // Use compiler-generated copy constructor and operator=.
00453         
00454         const float & getElement(size_t index) const throw ();
00455         void setElement(size_t index, float value) throw ();
00456         size_t getLength() const throw ();
00457         void setLength(size_t length) throw (std::bad_alloc);
00458         void addElement(float value) throw (std::bad_alloc);
00459         void insertElement(size_t index, float value) throw (std::bad_alloc);
00460         void removeElement(size_t index) throw ();
00461 
00462         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00463         virtual FieldValue & assign(const FieldValue & value)
00464             throw (std::bad_cast, std::bad_alloc);
00465         virtual Type type() const throw ();
00466     
00467     private:
00468         virtual void print(std::ostream &) const;
00469     };
00470 
00471 
00472     class OPENVRML_SCOPE MFInt32 : public FieldValue {
00473         std::vector<long> values;
00474 
00475     public:
00476         explicit MFInt32(size_t length = 0, const long * numbers = 0)
00477             throw (std::bad_alloc);
00478         virtual ~MFInt32() throw ();
00479 
00480         // Use compiler-defined copy constructor and operator=.
00481         
00482         const long & getElement(size_t index) const throw ();
00483         void setElement(size_t index, long value) throw ();
00484         size_t getLength() const throw ();
00485         void setLength(size_t length) throw (std::bad_alloc);
00486         void addElement(long value) throw (std::bad_alloc);
00487         void insertElement(size_t index, long value) throw (std::bad_alloc);
00488         void removeElement(size_t index) throw ();
00489 
00490         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00491         virtual FieldValue & assign(const FieldValue & value)
00492             throw (std::bad_cast, std::bad_alloc);
00493         virtual Type type() const throw ();
00494     
00495     private:
00496         virtual void print(std::ostream &) const;
00497     };
00498 
00499 
00500     class OPENVRML_SCOPE MFNode : public FieldValue {
00501         std::vector<NodePtr> nodes;
00502 
00503     public:
00504         explicit MFNode(size_t length = 0, const NodePtr * nodes = 0)
00505             throw (std::bad_alloc);
00506         virtual ~MFNode() throw ();
00507 
00508         // Use compiler-defined copy ctor and operator=
00509 
00510         const NodePtr & getElement(size_t index) const throw ();
00511         void setElement(size_t index, const NodePtr & node) throw ();
00512         size_t getLength() const throw ();
00513         void setLength(size_t length) throw (std::bad_alloc);
00514         bool exists(const Node & node) const;
00515         bool addNode(const NodePtr & node);
00516         bool removeNode(const Node & node);
00517         void addElement(const NodePtr & node) throw (std::bad_alloc);
00518         void insertElement(size_t index, const NodePtr & node)
00519             throw (std::bad_alloc);
00520         void removeElement(size_t index) throw ();
00521         void clear() throw ();
00522 
00523         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00524         virtual FieldValue & assign(const FieldValue & value)
00525             throw (std::bad_cast, std::bad_alloc);
00526         virtual Type type() const throw ();
00527     
00528     private:
00529         virtual void print(std::ostream &) const;
00530     };
00531 
00532 
00533     class OPENVRML_SCOPE MFRotation : public FieldValue {
00534         void * values;
00535 
00536     public:
00537         explicit MFRotation(size_t length = 0,
00538                             SFRotation::ConstArrayPointer values = 0)
00539             throw (std::bad_alloc);
00540         MFRotation(const MFRotation & mfrotation) throw (std::bad_alloc);
00541         virtual ~MFRotation() throw ();
00542 
00543         MFRotation & operator=(const MFRotation & mfrotation)
00544             throw (std::bad_alloc);
00545 
00546         SFRotation::ConstArrayReference getElement(size_t index) const throw ();
00547         void setElement(size_t index, SFRotation::ConstArrayReference value)
00548             throw ();
00549         size_t getLength() const throw ();
00550         void setLength(size_t length) throw (std::bad_alloc);
00551         void addElement(SFRotation::ConstArrayReference value)
00552             throw (std::bad_alloc);
00553         void insertElement(size_t index, SFRotation::ConstArrayReference value)
00554             throw (std::bad_alloc);
00555         void removeElement(size_t index) throw ();
00556 
00557         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00558         virtual FieldValue & assign(const FieldValue & value)
00559             throw (std::bad_cast, std::bad_alloc);
00560         virtual Type type() const throw ();
00561     
00562     private:
00563         virtual void print(std::ostream &) const;
00564     };
00565 
00566 
00567     class OPENVRML_SCOPE MFString : public FieldValue {
00568         std::vector<std::string> values;
00569 
00570     public:
00571         explicit MFString(size_t length = 0, const std::string * values = 0)
00572                 throw (std::bad_alloc);
00573         MFString(const MFString & mfstring) throw (std::bad_alloc);
00574         virtual ~MFString() throw ();
00575 
00576         MFString & operator=(const MFString & mfstring) throw (std::bad_alloc);
00577 
00578         const std::string & getElement(size_t index) const throw ();
00579         void setElement(size_t index, const std::string & value)
00580             throw (std::bad_alloc);
00581         size_t getLength() const throw ();
00582         void setLength(const size_t length) throw (std::bad_alloc);
00583         void addElement(const std::string & value) throw (std::bad_alloc);
00584         void insertElement(size_t index, const std::string & value)
00585             throw (std::bad_alloc);
00586         void removeElement(size_t index) throw ();
00587 
00588         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00589         virtual FieldValue & assign(const FieldValue & value)
00590             throw (std::bad_cast, std::bad_alloc);
00591         virtual Type type() const throw ();
00592     
00593     private:
00594         virtual void print(std::ostream &) const;
00595     };
00596 
00597 
00598     class OPENVRML_SCOPE MFTime : public FieldValue {
00599         std::vector<double> values;
00600 
00601     public:
00602         explicit MFTime(size_t length = 0, const double * times = 0)
00603             throw (std::bad_alloc);
00604         virtual ~MFTime() throw ();
00605 
00606         // Use compiler-defined copy constructor and operator=.
00607         
00608         const double & getElement(size_t index) const throw ();
00609         void setElement(size_t index, double value) throw ();
00610         size_t getLength() const throw ();
00611         void setLength(size_t length) throw (std::bad_alloc);
00612         void addElement(double value) throw (std::bad_alloc);
00613         void insertElement(size_t index, double value) throw (std::bad_alloc);
00614         void removeElement(size_t index) throw ();
00615 
00616         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00617         virtual FieldValue & assign(const FieldValue & value)
00618             throw (std::bad_cast, std::bad_alloc);
00619         virtual Type type() const throw ();
00620     
00621     private:
00622         virtual void print(std::ostream &) const;
00623     };
00624 
00625 
00626     class OPENVRML_SCOPE MFVec2f : public FieldValue {
00627         void * values;
00628 
00629     public:
00630         explicit MFVec2f(size_t length = 0,
00631                          SFVec2f::ConstArrayPointer values = 0)
00632             throw (std::bad_alloc);
00633         MFVec2f(const MFVec2f & mfvec2f) throw (std::bad_alloc);
00634         virtual ~MFVec2f() throw ();
00635 
00636         MFVec2f & operator=(const MFVec2f & mfvec2f) throw (std::bad_alloc);
00637 
00638         SFVec2f::ConstArrayReference getElement(size_t index) const throw ();
00639         void setElement(size_t index, SFVec2f::ConstArrayReference value)
00640             throw ();
00641         size_t getLength() const throw ();
00642         void setLength(size_t length) throw (std::bad_alloc);
00643         void addElement(SFVec2f::ConstArrayReference value)
00644             throw (std::bad_alloc);
00645         void insertElement(size_t index, SFVec2f::ConstArrayReference value)
00646             throw (std::bad_alloc);
00647         void removeElement(size_t index) throw ();
00648 
00649         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00650         virtual FieldValue & assign(const FieldValue & value)
00651             throw (std::bad_cast, std::bad_alloc);
00652         virtual Type type() const throw ();
00653     
00654     private:
00655         virtual void print(std::ostream &) const;
00656     };
00657 
00658 
00659     class OPENVRML_SCOPE MFVec3f : public FieldValue {
00660         void * values;
00661 
00662     public:
00663         explicit MFVec3f(size_t length = 0,
00664                          SFVec3f::ConstArrayPointer values = 0)
00665             throw (std::bad_alloc);
00666         MFVec3f(const MFVec3f & mfvec3f) throw (std::bad_alloc);
00667         virtual ~MFVec3f() throw ();
00668 
00669         MFVec3f & operator=(const MFVec3f & mfvec3f) throw (std::bad_alloc);
00670 
00671         SFVec3f::ConstArrayReference getElement(size_t index) const throw ();
00672         void setElement(size_t index, SFVec3f::ConstArrayReference value)
00673             throw ();
00674         size_t getLength() const throw ();
00675         void setLength(size_t length) throw (std::bad_alloc);
00676         void addElement(SFVec3f::ConstArrayReference value)
00677             throw (std::bad_alloc);
00678         void insertElement(size_t index, SFVec3f::ConstArrayReference value)
00679             throw (std::bad_alloc);
00680         void removeElement(size_t index) throw ();
00681 
00682         virtual std::auto_ptr<FieldValue> clone() const throw (std::bad_alloc);
00683         virtual FieldValue & assign(const FieldValue & value)
00684             throw (std::bad_cast, std::bad_alloc);
00685         virtual Type type() const throw ();
00686     
00687     private:
00688         virtual void print(std::ostream &) const;
00689     };
00690 }
00691 
00692 # endif