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

SoNodeKitListPart.h
1 #ifndef COIN_SONODEKITLISTPART_H
2 #define COIN_SONODEKITLISTPART_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/nodes/SoSubNode.h>
28 #include <Inventor/lists/SoTypeList.h>
29 #include <Inventor/fields/SoSFNode.h>
30 #include <Inventor/fields/SoSFName.h>
31 #include <Inventor/fields/SoMFName.h>
32 
33 class SoGroup;
34 
35 
36 class COIN_DLL_API SoNodeKitListPart : public SoNode {
37  typedef SoNode inherited;
38 
39  SO_NODE_HEADER(SoNodeKitListPart);
40 
41 public:
42  static void initClass(void);
43  SoNodeKitListPart(void);
44 
45  SoType getContainerType(void) const;
46  void setContainerType(SoType newContainerType);
47  const SoTypeList & getChildTypes(void) const;
48  void addChildType(SoType typeToAdd);
49  SbBool isTypePermitted(SoType typeToCheck) const;
50  SbBool isChildPermitted(const SoNode * child) const;
51  void containerSet(const char * fieldDataString);
52  void lockTypes(void);
53  SbBool isTypeLocked(void) const;
54  void addChild(SoNode * child);
55  void insertChild(SoNode * child, int childIndex);
56  SoNode * getChild(int index) const;
57  int findChild(SoNode * child) const;
58  int getNumChildren(void) const;
59  void removeChild(int index);
60  void removeChild(SoNode * child);
61  void replaceChild(int index, SoNode * newChild);
62  void replaceChild(SoNode * oldChild, SoNode * newChild);
63  virtual SbBool affectsState(void) const;
64  virtual void doAction(SoAction * action);
65  virtual void callback(SoCallbackAction * action);
66  virtual void GLRender(SoGLRenderAction * action);
67  virtual void getBoundingBox(SoGetBoundingBoxAction * action);
68  virtual void getMatrix(SoGetMatrixAction * action);
69  virtual void handleEvent(SoHandleEventAction * action);
70  virtual void pick(SoPickAction * action);
71  virtual void search(SoSearchAction * action);
72  virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
73  virtual SoChildList * getChildren(void) const;
74 
75 protected:
76  virtual ~SoNodeKitListPart();
77 
78  SoGroup * getContainerNode(void);
79  virtual SbBool readInstance(SoInput * in, unsigned short flags);
80  virtual void copyContents(const SoFieldContainer * fromFC,
81  SbBool copyConnections);
83 
84 private:
85  void syncInternalData(void);
86 
87  SoSFNode containerNode;
88  SoSFName containerTypeName;
89  SoMFName childTypeNames;
90 
91  SbBool typelistlocked;
92  SoTypeList allowedtypes;
93 
94  SbBool canCreateDefaultChild(void) const;
95  SoNode * createAndAddDefaultChild(void);
96  SoType getDefaultChildType(void) const;
97 
98  friend class SoBaseKit;
99 };
100 
101 #endif // !COIN_SONODEKITLISTPART_H
SbPList::getLength
int getLength(void) const
Definition: SbPList.h:94
SoNodeKitListPart::pick
virtual void pick(SoPickAction *action)
Definition: SoNodeKitListPart.cpp:509
SoType::badType
static SoType badType(void)
Definition: SoType.cpp:664
SoNodeKitListPart::replaceChild
void replaceChild(int index, SoNode *newChild)
Definition: SoNodeKitListPart.cpp:371
SoNodeKitListPart::isTypeLocked
SbBool isTypeLocked(void) const
Definition: SoNodeKitListPart.cpp:278
SoMField::getNum
int getNum(void) const
Definition: SoMField.h:86
SoNode::search
virtual void search(SoSearchAction *action)
Definition: SoNode.cpp:1120
SoType::fromName
static SoType fromName(const SbName name)
Definition: SoType.cpp:463
SoNodeKitListPart::getChildren
virtual SoChildList * getChildren(void) const
Definition: SoNodeKitListPart.cpp:538
SbName
The SbName class stores strings by reference.
Definition: SbName.h:31
SoNodeKitListPart::getChild
SoNode * getChild(int index) const
Definition: SoNodeKitListPart.cpp:325
SoChildList
The SoChildList class is a container for node children.
Definition: SoChildList.h:33
SoDebugError::post
static void post(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:314
SoGetBoundingBoxAction::setCenter
void setCenter(const SbVec3f &center, const SbBool transformcenter)
Definition: SoGetBoundingBoxAction.cpp:529
SoGetBoundingBoxAction::resetCenter
void resetCenter(void)
Definition: SoGetBoundingBoxAction.cpp:571
SoNode::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoNode.cpp:904
SoNodeKitListPart::isTypePermitted
SbBool isTypePermitted(SoType typeToCheck) const
Definition: SoNodeKitListPart.cpp:230
SoNodeKitListPart::getContainerNode
SoGroup * getContainerNode(void)
Definition: SoNodeKitListPart.cpp:548
SoBase::getName
virtual SbName getName(void) const
Definition: SoBase.cpp:730
SoNodeKitListPart::readInstance
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoNodeKitListPart.cpp:557
SoNodeKitListPart::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoNodeKitListPart.cpp:442
SoChildList::remove
void remove(const int index)
Definition: SoChildList.cpp:141
SoSearchAction
The SoSearchAction class provides methods for searching through scene graphs.
Definition: SoSearchAction.h:32
SoAction
The SoAction class is the base class for all traversal actions.
Definition: SoAction.h:67
SoGetBoundingBoxAction::getCenter
const SbVec3f & getCenter(void) const
Definition: SoGetBoundingBoxAction.cpp:332
SoNode::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoNode.cpp:846
SoGroup::addChild
virtual void addChild(SoNode *node)
Definition: SoGroup.cpp:393
SoNode::readInstance
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoNode.cpp:1438
SoAudioRenderAction::addMethod
static void addMethod(const SoType type, SoActionMethod method)
Definition: SoAudioRenderAction.cpp:74
SoNodeKitListPart::addChildType
void addChildType(SoType typeToAdd)
Definition: SoNodeKitListPart.cpp:199
SoType::isDerivedFrom
SbBool isDerivedFrom(const SoType type) const
Definition: SoType.cpp:687
SoNode::callback
virtual void callback(SoCallbackAction *action)
Definition: SoNode.cpp:974
SoNodeKitListPart::lockTypes
void lockTypes(void)
Definition: SoNodeKitListPart.cpp:268
SoField::setDefault
void setDefault(SbBool def)
Definition: SoField.cpp:650
SbPList::truncate
void truncate(const int length, const int fit=0)
Definition: SbPList.h:100
SoGetMatrixAction
The SoGetMatrixAction class is an action for accumulating the transformation matrix of a subgraph.
Definition: SoGetMatrixAction.h:35
SoType
The SoType class is the basis for the run-time type system in Coin.
Definition: SoType.h:50
SoNodeKitListPart::doAction
virtual void doAction(SoAction *action)
Definition: SoNodeKitListPart.cpp:417
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoNode::getMatrix
virtual void getMatrix(SoGetMatrixAction *action)
Definition: SoNode.cpp:1001
SoNodeKitListPart::isChildPermitted
SbBool isChildPermitted(const SoNode *child) const
Definition: SoNodeKitListPart.cpp:248
SoNodeKitListPart::getBoundingBox
virtual void getBoundingBox(SoGetBoundingBoxAction *action)
Definition: SoNodeKitListPart.cpp:451
SoNodeKitListPart
The SoNodeKitListPart class is a container node.
Definition: SoNodeKitListPart.h:36
SoTypeList
The SoTypeList class is a container class for arrays of SoType objects.
Definition: SoTypeList.h:30
SoAction::getPathCode
PathCode getPathCode(int &numindices, const int *&indices)
Definition: SoAction.cpp:890
SoNodeKitListPart::getContainerType
SoType getContainerType(void) const
Definition: SoNodeKitListPart.cpp:127
SoBase
The SoBase class is the top-level superclass for a number of class-hierarchies.
Definition: SoBase.h:41
SoNodeKitListPart::addChild
void addChild(SoNode *child)
Definition: SoNodeKitListPart.cpp:288
SoSFName
The SoSFName class is a container for an SbName.
Definition: SoSFName.h:31
SoNodeKitListPart::callback
virtual void callback(SoCallbackAction *action)
Definition: SoNodeKitListPart.cpp:433
SoField::enableNotify
SbBool enableNotify(SbBool on)
Definition: SoField.cpp:1485
SoNodeKitListPart::getNumChildren
int getNumChildren(void) const
Definition: SoNodeKitListPart.cpp:343
SoFieldContainer
The SoFieldContainer class is a base class for all classes that contain fields.
Definition: SoFieldContainer.h:35
SoChildList::append
void append(SoNode *const node)
Definition: SoChildList.cpp:94
SoNodeKitListPart::initClass
static void initClass(void)
Definition: SoNodeKitListPart.cpp:115
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoGetBoundingBoxAction
The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs.
Definition: SoGetBoundingBoxAction.h:34
SoType::createInstance
void * createInstance(void) const
Definition: SoType.cpp:803
SoNode::getChildren
virtual SoChildList * getChildren(void) const
Definition: SoNode.cpp:1265
SoNodeKitListPart::SoNodeKitListPart
SoNodeKitListPart(void)
Definition: SoNodeKitListPart.cpp:79
SoNodeKitListPart::copyContents
virtual void copyContents(const SoFieldContainer *fromFC, SbBool copyConnections)
Definition: SoNodeKitListPart.cpp:569
SoGetBoundingBoxAction::isCenterSet
SbBool isCenterSet(void) const
Definition: SoGetBoundingBoxAction.cpp:561
SoCallbackAction
The SoCallbackAction class invokes callbacks at specific nodes.
Definition: SoCallbackAction.h:70
SoNodeKitListPart::children
SoChildList * children
Definition: SoNodeKitListPart.h:82
SoMFName
The SoMFName class is a container for SbName values.
Definition: SoMFName.h:31
SoBase::getTypeId
virtual SoType getTypeId(void) const =0
SoNodeKitListPart::affectsState
virtual SbBool affectsState(void) const
Definition: SoNodeKitListPart.cpp:406
SoSFNode
The SoSFNode class is a container for a single node.
Definition: SoSFNode.h:38
SoNode::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoNode.cpp:1031
SoNodeKitListPart::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoNodeKitListPart.cpp:529
SoNodeKitListPart::findChild
int findChild(SoNode *child) const
Definition: SoNodeKitListPart.cpp:334
SoNode::affectsState
virtual SbBool affectsState(void) const
Definition: SoNode.cpp:783
SoFieldContainer::set
SbBool set(const char *const fielddata)
Definition: SoFieldContainer.cpp:291
SoTypeList::append
void append(const SoType type)
Definition: SoTypeList.cpp:62
SoInput
The SoInput class is an abstraction of file import functionality.
Definition: SoInput.h:55
SoBaseKit
The SoBaseKit class is the toplevel superclass for nodekits.
Definition: SoBaseKit.h:57
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoType::getName
SbName getName(void) const
Definition: SoType.cpp:628
SoHandleEventAction
The SoHandleEventAction class distributes user events to the scene.
Definition: SoHandleEventAction.h:36
SoGroup
The SoGroup class is a node which managed other node instances.
Definition: SoGroup.h:31
SoChildList::traverse
void traverse(SoAction *const action)
Definition: SoChildList.cpp:404
SoNodeKitListPart::insertChild
void insertChild(SoNode *child, int childIndex)
Definition: SoNodeKitListPart.cpp:307
SoNode::pick
virtual void pick(SoPickAction *action)
Definition: SoNode.cpp:1057
SoNodeKitListPart::removeChild
void removeChild(int index)
Definition: SoNodeKitListPart.cpp:352
SoNodeKitListPart::search
virtual void search(SoSearchAction *action)
Definition: SoNodeKitListPart.cpp:518
SoNodeKitListPart::containerSet
void containerSet(const char *fieldDataString)
Definition: SoNodeKitListPart.cpp:257
SoNode::doAction
virtual void doAction(SoAction *action)
Definition: SoNode.cpp:761
SoNode::getBoundingBox
virtual void getBoundingBox(SoGetBoundingBoxAction *action)
Definition: SoNode.cpp:817
SoNodeKitListPart::getMatrix
virtual void getMatrix(SoGetMatrixAction *action)
Definition: SoNodeKitListPart.cpp:476
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:39
SoGetPrimitiveCountAction
The SoGetPrimitiveCountAction class counts the primitives in a scene.
Definition: SoGetPrimitiveCountAction.h:32
SoNodeKitListPart::handleEvent
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoNodeKitListPart.cpp:500
SoNodeKitListPart::setContainerType
void setContainerType(SoType newContainerType)
Definition: SoNodeKitListPart.cpp:137
SoChildList::traverseInPath
void traverseInPath(SoAction *const action, const int numindices, const int *indices)
Definition: SoChildList.cpp:253
SoPickAction
The SoPickAction class is the base class for picking actions.
Definition: SoPickAction.h:32
SoNodeKitListPart::getChildTypes
const SoTypeList & getChildTypes(void) const
Definition: SoNodeKitListPart.cpp:177
SoNode::copyContents
virtual void copyContents(const SoFieldContainer *from, SbBool copyconnections)
Definition: SoNode.cpp:1382
SoNodeKitListPart::~SoNodeKitListPart
virtual ~SoNodeKitListPart()
Definition: SoNodeKitListPart.cpp:103
SoSearchAction::isFound
SbBool isFound(void) const
Definition: SoSearchAction.cpp:376

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

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