• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

rocs/RocsCore

  • sources
  • kde-4.12
  • kdeedu
  • rocs
  • RocsCore
  • DataStructures
  • RootedTree
RootedTreeNode.h
Go to the documentation of this file.
1 /*
2  This file is part of RootedTree (Rocs Plugin).
3  Copyright 2012 Wagner Reck <wagner.reck@gmail.com>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of
8  the License, or (at your option) any later version.
9 
10  This program 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
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef ROOTEDTREENODE_H
20 #define ROOTEDTREENODE_H
21 
22 #include "Data.h"
23 #include <boost/shared_ptr.hpp>
24 
25 class RootedTreeNode : public Data
26 {
27  Q_OBJECT
28 
29  Q_PROPERTY(quint32 numberOfChilds READ numberOfChilds WRITE setNumberOfChilds)
30  Q_PROPERTY(QScriptValue leftChild READ left_child)
31  Q_PROPERTY(QScriptValue rightChild READ right_child)
32  Q_PROPERTY(QScriptValue nodeParent READ node_parent)
33 
34  qint32 m_nChilds;
35 
36 public:
37  static DataPtr create(DataStructurePtr parent, int uniqueIdentifier, int dataType);
38  RootedTreeNode(DataStructurePtr parent, int uniqueIdentifier, int dataType);
39  ~RootedTreeNode();
40 
41  qint8 height() const;
42 
43 public slots:
44  DataPtr leftChild() const;
45  DataPtr rightChild() const;
46  DataPtr nodeParent() const;
48  DataPtr child(const quint32 i) const;
49 
50  DataList children() const;
51 
52  PointerPtr addLeftChild(DataPtr child) const;
53  PointerPtr addRigthChild(DataPtr child) const;
54  PointerPtr setNodeParent(DataPtr parent) const;
55  PointerPtr setChild(DataPtr child, quint32 idx) const;
56 
57  QScriptValue add_left_child(RootedTreeNode* child) const;
58  QScriptValue add_right_child(RootedTreeNode* child) const;
59  QScriptValue add_child(RootedTreeNode* child, quint32 idx) const;
60  QScriptValue add_node_parent(RootedTreeNode* child) const;
61 
62  QScriptValue left_child() const;
63  QScriptValue right_child() const;
64  QScriptValue child_at(quint32 idx) const;
65  QScriptValue node_parent() const;
66 
68  QScriptValue children_list() const;
69 
70  quint32 numberOfChilds() const;
71 
72  void setNumberOfChilds(const qint32 number);
73 
74  void adjustPosition();
75 };
76 
77 Q_DECLARE_METATYPE(RootedTreeNode*)
78 
79 #endif // ROOTEDTREENODE_H
RootedTreeNode::create
static DataPtr create(DataStructurePtr parent, int uniqueIdentifier, int dataType)
Definition: RootedTreeNode.cpp:26
RootedTreeNode::height
qint8 height() const
Definition: RootedTreeNode.cpp:285
RootedTreeNode::nodeParent
DataPtr nodeParent() const
RootedTreeNode::m_nChilds
qint32 m_nChilds
Definition: RootedTreeNode.h:34
RootedTreeNode::add_left_child
QScriptValue add_left_child(RootedTreeNode *child) const
Definition: RootedTreeNode.cpp:169
DataStructurePtr
boost::shared_ptr< DataStructure > DataStructurePtr
Definition: CoreTypes.h:38
DataList
QList< boost::shared_ptr< Data > > DataList
Definition: CoreTypes.h:30
Data::dataType
int dataType() const
Definition: Data.cpp:387
RootedTreeNode::add_node_parent
QScriptValue add_node_parent(RootedTreeNode *child) const
Definition: RootedTreeNode.cpp:197
Data.h
RootedTreeNode::addLeftChild
PointerPtr addLeftChild(DataPtr child) const
Definition: RootedTreeNode.cpp:86
RootedTreeNode::add_child
QScriptValue add_child(RootedTreeNode *child, quint32 idx) const
Definition: RootedTreeNode.cpp:156
RootedTreeNode::setNodeParent
PointerPtr setNodeParent(DataPtr parent) const
Definition: RootedTreeNode.cpp:98
PointerPtr
boost::shared_ptr< Pointer > PointerPtr
Definition: CoreTypes.h:35
RootedTreeNode::adjustPosition
void adjustPosition()
Definition: RootedTreeNode.cpp:261
RootedTreeNode::addRigthChild
PointerPtr addRigthChild(DataPtr child) const
Definition: RootedTreeNode.cpp:75
RootedTreeNode::child_at
QScriptValue child_at(quint32 idx) const
Definition: RootedTreeNode.cpp:211
RootedTreeNode::right_child
QScriptValue right_child() const
Definition: RootedTreeNode.cpp:231
RootedTreeNode::children_list
QScriptValue children_list() const
return the list of valid children
Definition: RootedTreeNode.cpp:251
RootedTreeNode::leftChild
DataPtr leftChild() const
RootedTreeNode::numberOfChilds
quint32 numberOfChilds() const
RootedTreeNode::node_parent
QScriptValue node_parent() const
Definition: RootedTreeNode.cpp:241
DataPtr
boost::shared_ptr< Data > DataPtr
Definition: CoreTypes.h:34
RootedTreeNode::left_child
QScriptValue left_child() const
Definition: RootedTreeNode.cpp:221
Data
Definition: Data.h:40
RootedTreeNode::setNumberOfChilds
void setNumberOfChilds(const qint32 number)
Definition: RootedTreeNode.cpp:53
RootedTreeNode::rightChild
DataPtr rightChild() const
RootedTreeNode::children
DataList children() const
Definition: RootedTreeNode.cpp:64
RootedTreeNode::setChild
PointerPtr setChild(DataPtr child, quint32 idx) const
Definition: RootedTreeNode.cpp:139
RootedTreeNode
Definition: RootedTreeNode.h:25
RootedTreeNode::child
DataPtr child(const quint32 i) const
return the i (0 to n-1) child
Definition: RootedTreeNode.cpp:125
RootedTreeNode::add_right_child
QScriptValue add_right_child(RootedTreeNode *child) const
Definition: RootedTreeNode.cpp:183
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/RocsCore

Skip menu "rocs/RocsCore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal