Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoNodekitParts.h
Go to the documentation of this file.
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul Isaacs (MMM yyyy)
25** Modified by : Thad Beier (MMM yyyy)
26**=======================================================================*/
27/*=======================================================================
28 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
29 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
30 *** ***
31 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
32 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
33 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
34 *** ***
35 *** RESTRICTED RIGHTS LEGEND ***
36 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
37 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
38 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
39 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
40 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
41 *** ***
42 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
43 *** BORDEAUX, FRANCE ***
44 *** ALL RIGHTS RESERVED ***
45**=======================================================================*/
46/*=======================================================================
47** Modified by : VSG (MMM YYYY)
48**=======================================================================*/
49
50
51#ifndef _SO_NODEKIT_PARTS
52#define _SO_NODEKIT_PARTS
53
55
57class SoBaseKit;
58class SoNode;
59class SoFullPath;
60class SoSFNode;
61
63// Class: SoNodekitParts
65
66{
67
68 private:
69 // Instances of SoNodekitParts are created only by subclasses of SoBaseKit.
70
71 // Constructor -- requires a catalog to build
72 SoNodekitParts( SoBaseKit *rootOfKit );
73
74 // Destructor
76
78 friend class SoBaseKit;
80
81 private:
82 const SoNodekitCatalog *catalog; // the catalog to use in building
83 // parts
84 int numEntries; // must be made equal to numEntries
85 // in the catalog
86 SoBaseKit *rootPointer; // Pointer to the part 'this'
87 SoSFNode **fieldList; // each 'part' is actually just
88 // a node, stored in a field
89
90 SbBool makePart( const int partNum );
91 SbBool replacePart( const int partNum, SoNode *newPartNode );
92 void unregisterDescendants( const int partNum );
93
94 SoNode *getPartFromThisCatalog( const int partNum, SbBool makeIfNeeded,
95 SbBool leafCheck, SbBool publicCheck,
96 SbBool &existedBefore );
97 SoFullPath *createPathToPartFromThisCatalog( const int partNum,
98 SbBool makeIfNeeded, SbBool leafCheck,
99 SbBool publicCheck, SbBool &existedBefore );
100 SbBool setPartFromThisCatalog( const int partNum,
101 SoNode *newPartNode,
102 SbBool anyPart );
103
104 SoNode *getSingleNamePart( const SbName &nameOfPart, SbBool makeIfNeeded,
105 SbBool leafCheck, SbBool publicCheck,
106 SbBool &existedBefore );
107 SoFullPath *getSingleNamePathToPart( const SbName &nameOfPart,
108 SbBool makeIfNeeded, SbBool leafCheck,
109 SbBool publicCheck, SbBool &existedBefore );
110 SbBool setSingleNamePart( const SbName &nameOfPart, SoNode *newPartNode,
111 SbBool anyPart );
112
113 // returns the part requested. If 'leafCheck' then it will only return
114 // leaves. If 'publicCheck', then it will only return public parts.
115 // Otherwise it will also return interior parts.
116 // Interior parts are ordinarily not obtainable through public methods.
117 SoNode *getAnyPart( const SbName &nameOfPart, SbBool makeIfNeeded,
118 SbBool leafCheck, SbBool publicCheck );
119 SoNode *getAnyPart( const SbName &nameOfPart, SbBool makeIfNeeded,
120 SbBool leafCheck, SbBool publicCheck,
121 SbBool &existedBefore);
122 SoFullPath *createPathToAnyPart( const SbName &nameOfPart,
123 SbBool makeIfNeeded, SbBool leafCheck, SbBool publicCheck );
124 SoFullPath *createPathToAnyPart( const SbName &nameOfPart,
125 SbBool makeIfNeeded, SbBool leafCheck,
126 SbBool publicCheck, SbBool &existedBefore );
127 SbBool setAnyPart( const SbName &nameOfPart, SoNode *newPartNode,
128 SbBool anyPart);
129
130 // parse a string like 'nameOfList[elementNum]' into two parts...
131 // Destructive to parseString, so give it a copy if you care.
132 // Replaces the '[' with an end-of-string and reads elementNum
133 // into the integer given
134 SbBool parseListItem( char* parseString, int &index );
135
136 // help to delete unneeded parts...
137 SbBool partIsNonLeafAndMayBeDeleted( int partNum );
138
139 // error check functions...
140 SbBool partFoundCheck( int partNum );
141 SbBool partIsLeafCheck( int partNum );
142 SbBool partIsPublicCheck( int partNum );
143 SbBool verifyPartExistence( int partNum );
144
145 // builds a path from the entry 'this' down to the entry given
146 // by 'nameOfPart'. Assumes that 'theNode' matches 'nameOfPart'
147 SoFullPath *createPathDownTo( const SbName &nameOfPart, SoNode *theNode );
148
149 // appends pathB after pathA and returns result.
150 // result is NULL if either path is NULL or if pathA->tail != pathB->head
151 SoFullPath *addPaths( const SoFullPath *pathA,
152 const SoFullPath *pathB ) const;
153};
154
155#endif /* _SO_NODEKIT_PARTS */
156
157
~SoNodekitParts()
Character string stored in a hash table.
Definition SbName.h:162
Base class for all node kits.
Definition SoBaseKit.h:302
Path that allows access to hidden children.
Definition SoPath.h:604
Abstract base class for all database nodes.
Definition SoNode.h:145
Group node with restricted children.
Nodekit catalog class.
Field containing a a node.
Definition SoSFNode.h:97
int SbBool
Boolean type.
Definition SbBase.h:87