Open Inventor Reference
SoNodekitParts.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * Further, this software is distributed without any warranty that it is
16  * free of the rightful claim of any third person regarding infringement
17  * or the like. Any license provided herein, whether implied or
18  * otherwise, applies only to this software file. Patent licenses, if
19  * any, provided herein do not apply to combinations of this program with
20  * other software, or any other product whatsoever.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27  * Mountain View, CA 94043, or:
28  *
29  * http://www.sgi.com
30  *
31  * For further information regarding this notice, see:
32  *
33  * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34  *
35  */
36 
37 
38 /*
39  * Copyright (C) 1990,91 Silicon Graphics, Inc.
40  *
41  _______________________________________________________________________
42  ______________ S I L I C O N G R A P H I C S I N C . ____________
43  |
44  | $Revision: 1.1.1.1 $
45  |
46  | Description:
47  | Defines the SoNodekitParts class. An instance of this class is
48  | created for each instance of an Nodekit.
49  | Its function is to describe which 'parts' the nodekit has created
50  | from its class' SoNodekitCatalog.
51  | An SoNodekitParts contains a pointer to an SoNodekitCatalog and
52  | a correlated list of nodes.
53  |
54  | If a new part is asked for, this class uses the catalog as a
55  | guide to create the part.
56  |
57  | Author(s) : Paul Isaacs, Thad Beier
58  |
59  ______________ S I L I C O N G R A P H I C S I N C . ____________
60  _______________________________________________________________________
61 */
62 
63 #ifndef _SO_NODEKIT_PARTS
64 #define _SO_NODEKIT_PARTS
65 
67 
68 class SoNodeKitListPart;
69 class SoBaseKit;
70 class SoNode;
71 class SoFullPath;
72 class SoSFNode;
73 
78 
79  SoEXTENDER public:
81 
83  SoNodekitParts( SoBaseKit *rootOfKit );
84 
87 
88  friend class SoBaseKit;
89 
90  private:
91  const SoNodekitCatalog *catalog;
93  int numEntries;
95  SoBaseKit *rootPointer;
96  SoSFNode **fieldList;
98 
99  bool makePart( const int partNum );
100  bool replacePart( const int partNum, SoNode *newPartNode );
101  void unregisterDescendants( const int partNum );
102 
103  SoNode *getPartFromThisCatalog( const int partNum, bool makeIfNeeded,
104  bool leafCheck, bool publicCheck,
105  bool &existedBefore );
106  SoFullPath *createPathToPartFromThisCatalog( const int partNum,
107  bool makeIfNeeded, bool leafCheck,
108  bool publicCheck, bool &existedBefore );
109  bool setPartFromThisCatalog( const int partNum,
110  SoNode *newPartNode,
111  bool anyPart );
112 
113  SoNode *getSingleNamePart( const SbName &nameOfPart, bool makeIfNeeded,
114  bool leafCheck, bool publicCheck,
115  bool &existedBefore );
116  SoFullPath *getSingleNamePathToPart( const SbName &nameOfPart,
117  bool makeIfNeeded, bool leafCheck,
118  bool publicCheck, bool &existedBefore );
119  bool setSingleNamePart( const SbName &nameOfPart, SoNode *newPartNode,
120  bool anyPart );
121 
126  SoNode *getAnyPart( const SbName &nameOfPart, bool makeIfNeeded,
127  bool leafCheck, bool publicCheck );
128  SoNode *getAnyPart( const SbName &nameOfPart, bool makeIfNeeded,
129  bool leafCheck, bool publicCheck,
130  bool &existedBefore);
131  SoFullPath *createPathToAnyPart( const SbName &nameOfPart,
132  bool makeIfNeeded, bool leafCheck, bool publicCheck );
133  SoFullPath *createPathToAnyPart( const SbName &nameOfPart,
134  bool makeIfNeeded, bool leafCheck,
135  bool publicCheck, bool &existedBefore );
136  bool setAnyPart( const SbName &nameOfPart, SoNode *newPartNode,
137  bool anyPart);
138 
143  bool parseListItem( char *parseString, int &index );
144 
146  bool partIsNonLeafAndMayBeDeleted( int partNum );
147 
149  bool partFoundCheck( int partNum );
150  bool partIsLeafCheck( int partNum );
151  bool partIsPublicCheck( int partNum );
152  bool verifyPartExistence( int partNum );
153 
156  SoFullPath *createPathDownTo( const SbName &nameOfPart, SoNode *theNode );
157 
160  SoFullPath *addPaths( const SoFullPath *pathA,
161  const SoFullPath *pathB ) const;
162 };
163 
164 #endif /* _SO_NODEKIT_PARTS */
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition: SbBasic.h:154
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition: SbSystem.h:81
Character string stored in a hash table.
Definition: SbString.h:264
Base class for all node kits.
Definition: SoBaseKit.h:262
virtual SoNodeKitPath * createPathToAnyPart(const SbName &partName, bool makeIfNeeded, bool leafCheck=FALSE, bool publicCheck=FALSE, const SoPath *pathToExtend=NULL)
virtual SoNode * getAnyPart(const SbName &partName, bool makeIfNeeded, bool leafCheck=FALSE, bool publicCheck=FALSE)
like their public versions, but are allowed access to non-leaf and private parts.
virtual bool setAnyPart(const SbName &partName, SoNode *from, bool anyPart=TRUE)
This SoEXTENDER class allows expert users to examine "hidden" children in paths.
Definition: SoPath.h:299
Group node with restricted children.
Abstract base class for all database nodes.
Definition: SoNode.h:103
Nodekit catalog class.
~SoNodekitParts()
Destructor.
SoNodekitParts(SoBaseKit *rootOfKit)
Instances of SoNodekitParts are created only by subclasses of SoBaseKit.
Field containing a pointer to a node.
Definition: SoSFNode.h:92