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

rocs/RocsCore

  • Rocs
  • GraphStructure
Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Properties | List of all members
Rocs::GraphStructure Class Reference

#include <GraphStructure.h>

Inheritance diagram for Rocs::GraphStructure:
Inheritance graph
[legend]

Public Types

enum  GRAPH_TYPE { Graph, Multigraph }
 

Public Slots

QScriptValue add_edge (Data *fromRaw, Data *toRaw)
 
QScriptValue add_node (const QString &name)
 
QScriptValue add_overlay_edge (Data *fromRaw, Data *toRaw, int overlay)
 
QScriptValue dijkstra_shortest_path (Data *fromRaw, Data *toRaw)
 
QScriptValue distances (Data *fromRaw)
 
QScriptValue list_edges ()
 
QScriptValue list_edges (int type)
 
QScriptValue list_nodes ()
 
QScriptValue list_nodes (int type)
 
QScriptValue overlay_edges (int overlay)
 
void setGraphType (int type)
 
- Public Slots inherited from DataStructure
void add_property (const QString &name, const QVariant &value)
 
virtual DataList addDataList (DataList dataList)
 
virtual DataList addDataList (QList< QPair< QString, QPointF > > dataList, int dataType)
 
void addDynamicProperty (const QString &property, const QVariant &value=QVariant(0))
 
virtual GroupPtr addGroup (const QString &name)
 
virtual DataPtr createData (const QString &name, const QPointF &point, int dataType)
 
DataPtr getData (int uniqueIdentifier)
 
virtual void remove (DataPtr data)
 
virtual void remove (PointerPtr pointer)
 
virtual void remove (GroupPtr group)
 
void remove ()
 
void remove_property (const QString &name)
 
void removeDynamicProperty (const QString &property)
 
void renameDynamicProperty (const QString &oldName, const QString &newName)
 
void setName (const QString &s)
 

Public Member Functions

 GraphStructure (Document *parent=0)
 
 ~GraphStructure ()
 
DataPtr createData (const QString &name, int dataType)
 
Q_INVOKABLE QScriptValue createEdge (Data *fromRaw, Data *toRaw, int type)
 
Q_INVOKABLE QScriptValue createEdge (Data *fromRaw, Data *toRaw)
 
Q_INVOKABLE QScriptValue createNode (int type)
 
Q_INVOKABLE QScriptValue createNode ()
 
PointerPtr createPointer (DataPtr from, DataPtr to, int pointerType)
 
QMap< DataPtr, PointerList > dijkstraShortestPaths (DataPtr from)
 
Q_INVOKABLE QScriptValue edges ()
 
Q_INVOKABLE QScriptValue edges (int type)
 
GRAPH_TYPE graphType () const
 
void importStructure (DataStructurePtr other)
 
bool multigraph () const
 
Q_INVOKABLE QScriptValue nodes ()
 
Q_INVOKABLE QScriptValue nodes (int type)
 
QMap< QString, QString > pluginProperties () const
 
void setPluginProperty (const QString &identifier, const QString &property)
 
- Public Member Functions inherited from DataStructure
virtual void cleanUpBeforeConvert ()
 
const DataList dataList (int dataType) const
 
DataList dataListAll () const
 
Document * document () const
 
QScriptEngine * engine () const
 
virtual DataStructurePtr getDataStructure () const
 
const QList< GroupPtr > groups () const
 
bool isDataVisible (int dataType) const
 
bool isPointerVisible (int pointerType) const
 
QString name () const
 
PointerList pointerListAll () const
 
const PointerList pointers (int pointerType) const
 
bool readOnly () const
 
QScriptValue scriptValue () const
 
virtual void setEngine (QScriptEngine *engine)
 
void setReadOnly (bool r)
 
void updateData (DataPtr data)
 
void updatePointer (PointerPtr pointer)
 

Static Public Member Functions

static DataStructurePtr create (Document *parent)
 
static DataStructurePtr create (DataStructurePtr other, Document *parent)
 
- Static Public Member Functions inherited from DataStructure
static DataStructurePtr create (Document *parent=0)
 
static DataStructurePtr create (DataStructurePtr other, Document *parent=0)
 

Properties

QString name
 
- Properties inherited from DataStructure
QString name
 

Additional Inherited Members

- Signals inherited from DataStructure
void changed ()
 
void dataCreated (DataPtr n)
 
void dataPositionChanged (const QPointF)
 
void nameChanged (const QString &name)
 
void pointerCreated (PointerPtr e)
 
void scriptError (const QString &message)
 
- Protected Member Functions inherited from DataStructure
 DataStructure (Document *parent=0)
 
virtual ~DataStructure ()
 
DataPtr addData (DataPtr data)
 
PointerPtr addPointer (PointerPtr pointer)
 
int generateUniqueIdentifier ()
 
void initialize ()
 
- Static Protected Member Functions inherited from DataStructure
template<typename T >
static DataStructurePtr create (Document *parent=0)
 
template<typename T >
static DataStructurePtr create (DataStructurePtr other, Document *parent=0)
 

Detailed Description

Definition at line 29 of file GraphStructure.h.

Member Enumeration Documentation

enum Rocs::GraphStructure::GRAPH_TYPE
Enumerator
Graph 
Multigraph 

Definition at line 35 of file GraphStructure.h.

Constructor & Destructor Documentation

Rocs::GraphStructure::GraphStructure ( Document *  parent = 0)
explicit

Definition at line 57 of file GraphStructure.cpp.

Rocs::GraphStructure::~GraphStructure ( )

Definition at line 91 of file GraphStructure.cpp.

Member Function Documentation

QScriptValue Rocs::GraphStructure::add_edge ( Data *  fromRaw,
Data *  toRaw 
)
slot

Creates a new edge from.

Parameters
fromRawto
toRaw.
fromRawis origin of pointer
toRawis target of pointer
Returns
script value for the new pointer
Deprecated:

Definition at line 227 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::add_node ( const QString &  name)
slot

Creates a new node with specified.

Parameters
name.
nameof the new node
Returns
script value for the new node
Deprecated:

Definition at line 217 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::add_overlay_edge ( Data *  fromRaw,
Data *  toRaw,
int  overlay 
)
slot

Creates a new overlay edge from.

Parameters
fromRawto
toRawat overlay
overlay.If the overlay does not exist no pointer is created.
fromRawis origin of pointer
toRawis target of pointer
overlayis the overlay for the to created pointer
Returns
script value for the new pointer
Deprecated:

Definition at line 235 of file GraphStructure.cpp.

DataStructurePtr Rocs::GraphStructure::create ( Document *  parent)
static

Definition at line 44 of file GraphStructure.cpp.

DataStructurePtr Rocs::GraphStructure::create ( DataStructurePtr  other,
Document *  parent 
)
static

Definition at line 49 of file GraphStructure.cpp.

DataPtr Rocs::GraphStructure::createData ( const QString &  name,
int  dataType 
)
virtual

Internal method to create new graph node.

Use

See also
Data::create(...) for creating new nodes.
Parameters
nameis the name of the node
dataTypeis the type of this node, defaults to 0
Returns
the created node as DataPtr

Reimplemented from DataStructure.

Definition at line 450 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::createEdge ( Data *  fromRaw,
Data *  toRaw,
int  type 
)

Creates a new edge edge from.

Parameters
fromRawto
toRawof pointer type
type.If the specified pointer type does not exist, no pointer is created.
fromRawis origin of pointer
toRawis target of pointer
overlayis the overlay for the to created pointer
Returns
script value for the new pointer

Definition at line 152 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::createEdge ( Data *  fromRaw,
Data *  toRaw 
)

Creates a new edge from.

Parameters
fromRawto
toRaw.
fromRawis origin of pointer
toRawis target of pointer
Returns
script value for the new pointer

Definition at line 147 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::createNode ( int  type)

Creates a new data element and return it.

If the specified data type is not registered, no data element is created.

Parameters
typeis the data type of the created node
Returns
script value for the new node

Definition at line 140 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::createNode ( )

Creates a new data element and return it.

Returns
script value for the new node

Definition at line 135 of file GraphStructure.cpp.

PointerPtr Rocs::GraphStructure::createPointer ( DataPtr  from,
DataPtr  to,
int  pointerType 
)
virtual

Internal method to create new graph edge.

Use

See also
Pointer::create(...) for creating new edges.
Parameters
fromis the origin of the new edge
tois the target of the new edge
pointerTypeis the type of this edge, defaults to 0
Returns
the created edge as PointerPtr

Reimplemented from DataStructure.

Definition at line 423 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::dijkstra_shortest_path ( Data *  fromRaw,
Data *  toRaw 
)
slot

Computes the Dijkstra's shortest path algorithm to compute the shortes path from.

Parameters
fromto
to.Note: this shortest path algorithm works only for graphs with all edges values non-negative. For undirected graphs reverse edges are add automatically. The algorithm has time complexity O(V log V + E).
fromthe node from which the computation starts
tothe node to which the shortest path shall be computed
Returns
the edge set of the shortest path

Definition at line 243 of file GraphStructure.cpp.

QMap< DataPtr, PointerList > Rocs::GraphStructure::dijkstraShortestPaths ( DataPtr  from)

Computes the Dijkstra's shortest path algorithm to compute all shortest path distances from from.

Note: this shortest path algorithm works only for graphs with all edges values non-negative. For undirected graphs reverse edges are add automatically. The algorithm has time complexity O(V log V + E).

Parameters
fromthe node from which the computation starts
Returns
list is map with keys = target elements, values = path to target

Definition at line 294 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::distances ( Data *  fromRaw)
slot

Computes the Dijkstra's shortest path algorithm to compute all shortest path distances from from.

If edge has value 0, the edge value is set to 1. Infinity is returned when there is no path between from and another node in the graph. Note: this shortest path algorithm works only for graphs with all edges values non-negative. For undirected graphs reverse edges are added automatically. The algorithm has time complexity O(V log V + E).

Parameters
fromthe node from which the computation starts
Returns
the edge set of the shortest path

Definition at line 262 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::edges ( )

Returns a list of all edges of the graph.

Returns
array containing the edges

Definition at line 115 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::edges ( int  type)

Returns a list of all edges of given type in the graph.

Parameters
typeis the overlay for the to created pointer
Returns
array containing the edges

Definition at line 126 of file GraphStructure.cpp.

Rocs::GraphStructure::GRAPH_TYPE Rocs::GraphStructure::graphType ( ) const

Returns type of the graph given by enum.

See also
GRAPH_TYPE.
Returns
graph type

Definition at line 413 of file GraphStructure.cpp.

void Rocs::GraphStructure::importStructure ( DataStructurePtr  other)
virtual

overwrites the current DataStructure with all values (Data and Pointer) from the given datastructure object.

Parameters
otherthe data structure that shall be imported
Returns
void

Reimplemented from DataStructure.

Definition at line 63 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::list_edges ( )
slot

Returns a list of all edges of the graph.

Returns
array containing the edges
Deprecated:

Definition at line 201 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::list_edges ( int  type)
slot

Returns a list of all edges of given type in the graph.

Parameters
typeis the overlay for the to created pointer
Returns
array containing the edges
Deprecated:

Definition at line 209 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::list_nodes ( )
slot

Returns a list of all nodes of the graph.

Returns
array containing the nodes
Deprecated:

Definition at line 185 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::list_nodes ( int  type)
slot

Returns a list of all nodes of given type in the graph.

Parameters
typeis the overlay for the to created pointer
Returns
array containing the nodes
Deprecated:

Definition at line 193 of file GraphStructure.cpp.

bool Rocs::GraphStructure::multigraph ( ) const

Definition at line 418 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::nodes ( )

Returns a list of all nodes of the graph.

Returns
array containing the nodes

Definition at line 95 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::nodes ( int  type)

Returns a list of all nodes of given type in the graph.

Parameters
typeis the overlay for the to created pointer
Returns
array containing the nodes

Definition at line 106 of file GraphStructure.cpp.

QScriptValue Rocs::GraphStructure::overlay_edges ( int  overlay)
slot

Gives array of edges of specified overlay.

If overlay does not exist an empty array is returned.

Parameters
overlayinteger that identifies the overlay
Returns
QScriptValue array
Deprecated:

Definition at line 177 of file GraphStructure.cpp.

QMap< QString, QString > Rocs::GraphStructure::pluginProperties ( ) const
virtual

Gives a map with plugin specific properties of the data structure.

Implementation of virtual method

See also
DataStructure::pluginProperties()
Returns
map keys are property names, values are property values.

Reimplemented from DataStructure.

Definition at line 462 of file GraphStructure.cpp.

void Rocs::GraphStructure::setGraphType ( int  type)
slot

Setter for graph type.

No conversations are performed.

Parameters
typeas specified by enum GRAPH_TYPE
Returns
void

Definition at line 383 of file GraphStructure.cpp.

void Rocs::GraphStructure::setPluginProperty ( const QString &  identifier,
const QString &  property 
)
virtual

Set plugin specific properties of data structure.

Parameters
identifieris the unique identifier for this property
valueis the to be set value for the property

Reimplemented from DataStructure.

Definition at line 469 of file GraphStructure.cpp.

Property Documentation

QString Rocs::GraphStructure::name
readwrite

Definition at line 32 of file GraphStructure.h.


The documentation for this class was generated from the following files:
  • GraphStructure.h
  • GraphStructure.cpp
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