Coin Logo http://www.coin3d.org/
http://www.kongsberg.com/kogt/

SoFieldContainer.h
1 #ifndef COIN_SOFIELDCONTAINER_H
2 #define COIN_SOFIELDCONTAINER_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <Inventor/misc/SoBase.h>
37 
38 class SbString;
39 class SoFieldData;
40 class SoFieldList;
41 class SoOutput;
42 
43 class COIN_DLL_API SoFieldContainer : public SoBase {
44  typedef SoBase inherited;
45 
46 public:
47  static void initClass(void);
48  static SoType getClassTypeId(void);
49  static void cleanupClass(void);
50 
51  void setToDefaults(void);
52  SbBool hasDefaultValues(void) const;
53 
54  SbBool fieldsAreEqual(const SoFieldContainer * container) const;
55  void copyFieldValues(const SoFieldContainer * container,
56  SbBool copyconnections = FALSE);
57 
58  SbBool set(const char * const fielddata);
59  void get(SbString & fielddata);
60 
61  virtual int getFields(SoFieldList & l) const;
62  virtual int getAllFields(SoFieldList & l) const;
63  virtual SoField * getField(const SbName & name) const;
64  virtual SoField * getEventIn(const SbName & name) const;
65  virtual SoField * getEventOut(const SbName & name) const;
66  SbBool getFieldName(const SoField * const field, SbName & name) const;
67 
68  SbBool enableNotify(const SbBool flag);
69  SbBool isNotifyEnabled(void) const;
70 
71  SbBool set(const char * fielddata, SoInput * input);
72  void get(SbString & fielddata, SoOutput * out);
73 
74  virtual void notify(SoNotList * l);
75 
76  virtual SbBool validateNewFieldValue(SoField * field, void * newval);
77 
78  virtual void addWriteReference(SoOutput * out, SbBool isfromfield = FALSE);
79  virtual void writeInstance(SoOutput * out);
80 
81  SbBool getIsBuiltIn(void) const;
82  virtual const SoFieldData * getFieldData(void) const;
83 
84  virtual void copyContents(const SoFieldContainer * from,
85  SbBool copyconnections);
86  virtual SoFieldContainer * copyThroughConnection(void) const;
87 
88  static void initCopyDict(void);
89  static void addCopy(const SoFieldContainer * orig,
90  const SoFieldContainer * copy);
91  static SoFieldContainer * checkCopy(const SoFieldContainer * orig);
92  static SoFieldContainer * findCopy(const SoFieldContainer * orig,
93  const SbBool copyconnections);
94  static void copyDone(void);
95 
96  virtual void getFieldsMemorySize(size_t & managed, size_t & unmanaged) const;
97 
98  void setUserData(void * userdata) const;
99  void * getUserData(void) const;
100 
101 protected:
102  SoFieldContainer(void);
103  virtual ~SoFieldContainer();
104 
105  virtual SbBool readInstance(SoInput * in, unsigned short flags);
106  SbBool isBuiltIn;
107 
108 private:
109  static SoType classTypeId;
110  SbBool donotify;
111 
112 }; // SoFieldContainer
113 
114 #endif // !COIN_SOFIELDCONTAINER_H

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

Generated on Sat Oct 26 2013 19:06:29 for Coin by Doxygen 1.8.4.