Coin Logo http://www.sim.no
http://www.coin3d.org

SoNodeKitPath.h
1 #ifndef COIN_SONODEKITPATH_H
2 #define COIN_SONODEKITPATH_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/SoPath.h>
28 
29 class SoNode;
30 class SoBaseKit;
31 class SoSearchAction;
32 
33 class COIN_DLL_API SoNodeKitPath : public SoPath {
34  typedef SoPath inherited;
35 
36 public:
37  int getLength(void) const;
38  SoNode * getTail(void) const;
39  SoNode * getNode(const int idx) const;
40  SoNode * getNodeFromTail(const int idx) const;
41  void truncate(const int length);
42  void pop(void);
43  void append(SoBaseKit * childKit);
44  void append(const SoNodeKitPath * fromPath);
45  SbBool containsNode(SoBaseKit * node) const;
46  int findFork(const SoNodeKitPath * path) const;
47 
48  friend COIN_DLL_API int operator==(const SoNodeKitPath & p1, const SoNodeKitPath & p2);
49 
50 protected:
51  SoNodeKitPath(const int approxLength);
52  virtual ~SoNodeKitPath();
53 
54 private:
55 
56  static void clean(void);
57  static SoSearchAction *searchAction;
58  SoSearchAction *getSearchAction(void);
59 
60  // these methods should not be used on an SoNodeKitPath
61  void append(const int childIndex);
62  void append(SoNode *childNode);
63  void append(const SoPath *fromPath);
64  void push(const int childIndex);
65  int getIndex(const int i) const;
66  int getIndexFromTail(const int i) const;
67  void insertIndex(SoNode *parent,const int newIndex);
68  void removeIndex(SoNode *parent,const int oldIndex);
69  void replaceIndex(SoNode *parent,const int index,SoNode *newChild);
70 };
71 
72 COIN_DLL_API int operator==(const SoNodeKitPath & p1, const SoNodeKitPath & p2);
73 
74 #endif // !COIN_SONODEKITPATH_H
SoPath::getIndexFromTail
int getIndexFromTail(const int index) const
Definition: SoPath.cpp:455
SoNodeKitPath::getNodeFromTail
SoNode * getNodeFromTail(const int idx) const
Definition: SoNodeKitPath.cpp:128
SoAction::apply
virtual void apply(SoNode *root)
Definition: SoAction.cpp:476
SoNodeKitPath::getLength
int getLength(void) const
Definition: SoNodeKitPath.cpp:76
SoPath::getTail
SoNode * getTail(void) const
Definition: SoPath.cpp:373
SoNodeKitPath::pop
void pop(void)
Definition: SoNodeKitPath.cpp:169
SoNodeKitPath::truncate
void truncate(const int length)
Definition: SoNodeKitPath.cpp:147
SoPath::push
void push(const int childindex)
Definition: SoPath.h:127
SoNodeKitPath::getNode
SoNode * getNode(const int idx) const
Definition: SoNodeKitPath.cpp:107
SoNodeKitPath
The SoNodeKitPath class is a path that contains only nodekit nodes.
Definition: SoNodeKitPath.h:33
SoSearchAction
The SoSearchAction class provides methods for searching through scene graphs.
Definition: SoSearchAction.h:32
SoSearchAction::setNode
void setNode(SoNode *const node)
Definition: SoSearchAction.cpp:145
SoNodeKitPath::SoNodeKitPath
SoNodeKitPath(const int approxLength)
Definition: SoNodeKitPath.cpp:51
SoBaseKit::isSearchingChildren
static SbBool isSearchingChildren(void)
Definition: SoBaseKit.cpp:1527
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SoNodeKitPath::findFork
int findFork(const SoNodeKitPath *path) const
Definition: SoNodeKitPath.cpp:241
SoPath::pop
void pop(void)
Definition: SoPath.h:133
SoPath::getLength
int getLength(void) const
Definition: SoPath.cpp:473
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoNodeKitPath::getTail
SoNode * getTail(void) const
Definition: SoNodeKitPath.cpp:90
SoSearchAction::getPath
SoPath * getPath(void) const
Definition: SoSearchAction.cpp:317
SoPath::getNodeFromTail
SoNode * getNodeFromTail(const int index) const
Definition: SoPath.cpp:419
SoPath::append
void append(const int childindex)
Definition: SoPath.cpp:191
SoPath::replaceIndex
void replaceIndex(SoNode *const parent, const int index, SoNode *const newchild)
Definition: SoPath.cpp:817
SoBaseKit::setSearchingChildren
static void setSearchingChildren(const SbBool newval)
Definition: SoBaseKit.cpp:1537
SbBox2s::operator==
int operator==(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.cpp:432
SoSearchAction::setInterest
void setInterest(const Interest interest)
Definition: SoSearchAction.cpp:249
SoPath::setHead
void setHead(SoNode *const head)
Definition: SoPath.cpp:167
SoPath::insertIndex
void insertIndex(SoNode *const parent, const int newindex)
Definition: SoPath.cpp:750
SoPath::findFork
int findFork(const SoPath *const path) const
Definition: SoPath.cpp:565
SoPath::truncate
void truncate(const int length)
Definition: SoPath.cpp:493
SoNodeKitPath::append
void append(SoBaseKit *childKit)
Definition: SoNodeKitPath.cpp:191
SoNodeKitPath::containsNode
SbBool containsNode(SoBaseKit *node) const
Definition: SoNodeKitPath.cpp:231
SoPath::getIndex
int getIndex(const int index) const
Definition: SoPath.cpp:436
SoPath::getNode
SoNode * getNode(const int index) const
Definition: SoPath.cpp:402
SoBaseKit
The SoBaseKit class is the toplevel superclass for nodekits.
Definition: SoBaseKit.h:57
SoBase::isOfType
SbBool isOfType(SoType type) const
Definition: SoBase.cpp:710
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoPath::removeIndex
void removeIndex(SoNode *const parent, const int oldindex)
Definition: SoPath.cpp:779
SoPath::containsNode
SbBool containsNode(const SoNode *const node) const
Definition: SoPath.cpp:601
SoNodeKitPath::~SoNodeKitPath
virtual ~SoNodeKitPath()
Definition: SoNodeKitPath.cpp:68
SoPath::operator==
friend SbBool operator==(const SoPath &lhs, const SoPath &rhs)
Definition: SoPath.cpp:634
SoSearchAction::setSearchingAll
void setSearchingAll(const SbBool searchall)
Definition: SoSearchAction.cpp:278

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Mon Jul 27 2020 for Coin by Doxygen. 1.8.18