00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
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