Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoFieldData.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SOFIELDDATA_H
00021 #define COIN_SOFIELDDATA_H
00022 
00023 #include <Inventor/SbBasic.h>
00024 #include <Inventor/lists/SbList.h>
00025 
00026 class SbName;
00027 class SoField;
00028 class SoFieldContainer;
00029 class SoInput;
00030 class SoOutput;
00031 
00032 class SoEnumEntry;
00033 class SoFieldEntry;
00034 
00035 class COIN_DLL_API SoFieldData {
00036 public:
00037   SoFieldData(void);
00038   SoFieldData(const SoFieldData & fd);
00039   SoFieldData(const SoFieldData * fd);
00040   SoFieldData(int numfields);
00041   ~SoFieldData();
00042 
00043   void addField(SoFieldContainer * base, const char * name,
00044                 const SoField * field);
00045 
00046   void overlay(SoFieldContainer * to, const SoFieldContainer * from,
00047                SbBool copyconnections) const;
00048 
00049   int getNumFields(void) const;
00050   const SbName & getFieldName(int index) const;
00051   SoField * getField(const SoFieldContainer * object, int index) const;
00052   int getIndex(const SoFieldContainer * fc, const SoField * field) const;
00053 
00054   void addEnumValue(const char * enumname, const char * valuename, int value);
00055   void getEnumData(const char * enumname,
00056                    int & num, const int *& values, const SbName *& names);
00057 
00058   SbBool read(SoInput * in, SoFieldContainer * object,
00059               SbBool erroronunknownfield, SbBool & notbuiltin) const;
00060   SbBool read(SoInput * in, SoFieldContainer * object,
00061               const SbName & fieldname, SbBool & foundname) const;
00062   void write(SoOutput * out, const SoFieldContainer * object) const;
00063   void copy(const SoFieldData * src);
00064   SbBool isSame(const SoFieldContainer * c1,
00065                 const SoFieldContainer * c2) const;
00066 
00067   SbBool readFieldDescriptions(SoInput * in, SoFieldContainer * object,
00068                                int numdescriptionsexpected) const;
00069   void writeFieldDescriptions(SoOutput * out,
00070                               const SoFieldContainer * object) const;
00071 
00072 private:
00073   // Bitflags for control word in the file format.
00074   enum ControlWord {
00075     NOTBUILTIN = 0x40
00076   };
00077 
00078   int operator==(const SoFieldData * fd) const;
00079   int operator!=(const SoFieldData * fd) const { return ! operator==(fd); }
00080   int operator==(const SoFieldData & fd) const { return operator==(&fd); }
00081   int operator!=(const SoFieldData & fd) const { return ! operator==(&fd); }
00082 
00083   void freeResources(void);
00084 
00085   SbList<SoFieldEntry *> fields;
00086   SbList<SoEnumEntry *> enums;
00087 };
00088 
00089 #endif // !COIN_SOFIELDDATA_H

Generated at Tue Mar 5 03:31:13 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001