Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoNodeKitPath.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 : Paul S. Strauss (MMM yyyy)
26** Modified by : Nick Thompson (MMM yyyy)
27**=======================================================================*/
28/*=======================================================================
29 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
30 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
31 *** ***
32 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
33 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
34 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
35 *** ***
36 *** RESTRICTED RIGHTS LEGEND ***
37 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
38 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
39 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
40 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
41 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
42 *** ***
43 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
44 *** BORDEAUX, FRANCE ***
45 *** ALL RIGHTS RESERVED ***
46**=======================================================================*/
47/*=======================================================================
48** Modified by : VSG (MMM YYYY)
49**=======================================================================*/
50
51
52#ifndef _SO_NODE_KIT_PATH_
53#define _SO_NODE_KIT_PATH_
54
55#include <Inventor/SbBasic.h>
56#include <Inventor/SoPath.h>
57
58class SoBaseKit;
59class SoSearchAction;
60
62//
63// Class: SoNodeKitPath
64//
65// A SoNodeKitPath represents a scene graph or subgraph. It contains
66// pointers to a chain of nodeKitss, each of which is a child of the
67// previous.
68//
69// Intermediary nodes between nodeKits are not included in the nodeKit path.
70//
71//
73
112class SoNodeKitPath : public SoPath {
113
114 public:
115
119 int getLength() const;
120
126 SoNode * getTail() const;
127
131 SoNode * getNode(int i) const;
132
137 SoNode * getNodeFromTail(int i) const;
138
143 void truncate(int start);
144
148 void pop();
149
155 void append(SoBaseKit *childKit);
156
161 void append(const SoNodeKitPath *fromPath);
162
167
173 int findFork(const SoNodeKitPath *path) const;
174
178 friend int operator ==(const SoNodeKitPath &p1, const SoNodeKitPath &p2);
179
180 private:
181 // Hide the constructor
182 SoNodeKitPath(int approxLength) : SoPath(approxLength) {}
183 // Destructor
184 virtual ~SoNodeKitPath();
185
186 private:
187 // This action is used to search for nodes.
188 static SoSearchAction *searchAction;
189
190};
191
192#endif /* _SO_NODE_KIT_PATH_ */
193
void start()
Base class for all node kits.
Definition SoBaseKit.h:302
Abstract base class for all database nodes.
Definition SoNode.h:145
Path that points to a list of hierarchical nodekits.
void append(const SoNodeKitPath *fromPath)
Adds all nodekits in fromPath's chain to end of chain; the head node of fromPath must be the same as ...
SoNode * getTail() const
Return the last nodekit in a path chain.
void append(SoBaseKit *childKit)
Adds childKit to end of chain; uses first occurrence of childKit as a part within current last nodeki...
SbBool containsNode(SoBaseKit *node) const
Returns TRUE if the passed nodekit is found anywhere in the path chain.
SoNode * getNodeFromTail(int i) const
Returns the i'th nodekit in the chain, counting backward from the tail nodekit.
friend int operator==(const SoNodeKitPath &p1, const SoNodeKitPath &p2)
Returns TRUE if all nodes in the two nodekit path chains are equal.
int findFork(const SoNodeKitPath *path) const
If the two paths have different head nodes, this returns -1.
void pop()
Pops the last nodekit off the end of the path.
void truncate(int start)
Truncates the path chain, removing all nodes from index start on.
SoNode * getNode(int i) const
Returns the i'th node in the nodekit path.
int getLength() const
Returns length of path chain (number of nodekits).
Path that points to a list of hierarchical nodes.
Definition SoPath.h:187
Searches for nodes in a scene graph.
int SbBool
Boolean type.
Definition SbBase.h:87