Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoFieldData.h
1#ifndef COIN_SOFIELDDATA_H
2#define COIN_SOFIELDDATA_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <Inventor/SbBasic.h>
28#include <Inventor/lists/SbList.h>
29
30class SbName;
31class SoField;
33class SoInput;
34class SoOutput;
35
36class SoEnumEntry;
37class SoFieldEntry;
38
39class COIN_DLL_API SoFieldData {
40public:
41 SoFieldData(void);
42 SoFieldData(const SoFieldData & fd);
43 SoFieldData(const SoFieldData * fd);
44 SoFieldData(int numfields);
46
47 void addField(SoFieldContainer * base, const char * name,
48 const SoField * field);
49
50 void overlay(SoFieldContainer * to, const SoFieldContainer * from,
51 SbBool copyconnections) const;
52
53 int getNumFields(void) const;
54 const SbName & getFieldName(int index) const;
55 SoField * getField(const SoFieldContainer * object, int index) const;
56 int getIndex(const SoFieldContainer * fc, const SoField * field) const;
57
58 void addEnumValue(const char * enumname, const char * valuename, int value);
59 void getEnumData(const char * enumname,
60 int & num, const int *& values, const SbName *& names);
61
62 SbBool read(SoInput * input, SoFieldContainer * object,
63 SbBool erroronunknownfield, SbBool & notbuiltin) const;
64 SbBool read(SoInput * input, SoFieldContainer * object,
65 const SbName & fieldname, SbBool & foundname) const;
66 void write(SoOutput * out, const SoFieldContainer * object) const;
67 void copy(const SoFieldData * src);
68 SbBool isSame(const SoFieldContainer * c1,
69 const SoFieldContainer * c2) const;
70
71 SbBool readFieldDescriptions(SoInput * input, SoFieldContainer * object,
72 int numdescriptionsexpected,
73 const SbBool readfieldvalues = TRUE) const;
74 void writeFieldDescriptions(SoOutput * out,
75 const SoFieldContainer * object) const;
76
77private:
78 SbBool hasField(const char * name) const;
79 SbBool hasEnumValue(const char * enumname, const char * valuename);
80
81 // Bitflags for control word in the file format.
82 enum ControlWord {
83 NOTBUILTIN = 0x40
84 };
85
86 int operator==(const SoFieldData * fd) const;
87 int operator!=(const SoFieldData * fd) const { return ! operator==(fd); }
88 int operator==(const SoFieldData & fd) const { return operator==(&fd); }
89 int operator!=(const SoFieldData & fd) const { return ! operator==(&fd); }
90
91 void freeResources(void);
92
95};
96
97#endif // !COIN_SOFIELDDATA_H
The SbList class is a template container class for lists.
Definition SbList.h:61
The SbName class stores strings by reference.
Definition SbName.h:31
The SoFieldContainer class is a base class for all classes that contain fields.
Definition SoFieldContainer.h:34
The SoFieldData class is a container for a prototype set of fields.
Definition SoFieldData.h:39
The SoField class is the top-level abstract base class for fields.
Definition SoField.h:38
The SoInput class is an abstraction of file import functionality.
Definition SoInput.h:52
The SoOutput class is an abstraction of an output stream.
Definition SoOutput.h:42

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.