Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoMFFieldContainer.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (MMM yyyy)
22**=======================================================================*/
23
24
25#ifndef _SO_MF_FIELDCONTAINER_
26#define _SO_MF_FIELDCONTAINER_
27
29
31
33//
34// SoMFFieldContainer subclass of SoMField. Each field value is a pointer to an
35// SoFieldContainer. The field automatically maintains references to the
36// fieldContainers it points to and propagates notification from the
37// fieldContainers.
38//
40
55
56 // Use standard field stuff
61
65 void addFieldContainer(SoFieldContainer *fieldContainer);
66
71 void insertFieldContainer(SoFieldContainer *fieldContainer, int newFieldContainerIndex);
72
78
82 int findFieldContainer(const SoFieldContainer *fieldContainer) const;
83
88
93 void removeFieldContainer(int index);
94
99 { removeFieldContainer(findFieldContainer(fieldContainer)); }
100
105
110 void replaceFieldContainer(int index, SoFieldContainer *newFieldContainer);
111
115 void replaceFieldContainer(SoFieldContainer *oldFieldContainer, SoFieldContainer *newFieldContainer)
116 { replaceFieldContainer(findFieldContainer(oldFieldContainer), newFieldContainer); }
117
130
133
134 private:
135 static void initClass();
136 static void exitClass();
137
138 // Update a copied field to use the copy of each fieldContainer if there is one
139 virtual void fixCopy(SbBool copyConnections);
140
141 // Override this to also check the stored fieldContainers
142 virtual SbBool referencesCopy() const;
143
144private:
145 // Override this to maintain write-references in fieldContainers
146 virtual void countWriteRefs(SoOutput *out) const;
147
148 // Changes value in field without doing other notification stuff.
149 // Keeps track of references and auditors.
150 void setVal(int index, SoFieldContainer *newValue);
151
152 SoFieldContainer** m_oldValues;
153 int m_oldNum;
154
155};
156
157#endif // _SO_MF_FIELDCONTAINER_
158
159
160
161
#define SO_MFIELD_REQUIRED_HEADER(className)
Definition SoSubField.h:311
#define SO_MFIELD_CONSTRUCTOR_HEADER(className)
Definition SoSubField.h:320
#define SO_MFIELD_SETVALUESPOINTER_HEADER(userType)
#define SO_MFIELD_VALUE_HEADER(className, valueType, valueRef)
Definition SoSubField.h:335
Abstract base class for objects that contain fields.
Multiple-value field containing any number of pointers to fieldContainers.
int getNumFieldContainers() const
Returns number of fieldContainers.
void removeFieldContainer(int index)
Removes fieldContainer with given index from group.
SoFieldContainer * getFieldContainer(int index) const
Returns pointer to nth fieldContainer.
SoFieldContainer ** startEditing()
Returns a pointer to the internally maintained array that can be modified.
void addFieldContainer(SoFieldContainer *fieldContainer)
Adds a fieldContainer as last one in group.
void finishEditing()
Indicates that batch edits have finished.
void removeAllFieldContainers()
Removes all fieldContainers from group.
void removeFieldContainer(SoFieldContainer *fieldContainer)
Removes first instance of given fieldContainer from group.
int findFieldContainer(const SoFieldContainer *fieldContainer) const
Finds index of given fieldContainer within group.
void replaceFieldContainer(SoFieldContainer *oldFieldContainer, SoFieldContainer *newFieldContainer)
Replaces first instance of given fieldContainer with new fieldContainer.
void replaceFieldContainer(int index, SoFieldContainer *newFieldContainer)
Replaces fieldContainer with given index with new fieldContainer.
void insertFieldContainer(SoFieldContainer *fieldContainer, int newFieldContainerIndex)
Adds a fieldContainer so that it becomes the one with the given index.
Base class for all multiple-valued fields.
Definition SoMField.h:134
Used to write Open Inventor data files.
Definition SoOutput.h:185
int SbBool
Boolean type.
Definition SbBase.h:87