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

rocs/RocsCore

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Properties | List of all members
Data Class Reference

#include <Data.h>

Inheritance diagram for Data:
Inheritance graph
[legend]

Public Slots

void add_property (const QString &name, const QString &value)
 
void addDynamicProperty (const QString &property, const QVariant &value)
 
QScriptValue adj_data ()
 
QScriptValue adj_pointers ()
 
QScriptValue adj_pointers (int pointerType)
 
QScriptValue connected_pointers (Data *n)
 
QScriptValue input_pointers ()
 
QScriptValue input_pointers (int pointerType)
 
QScriptValue output_pointers ()
 
QScriptValue output_pointers (int pointerType)
 
void remove ()
 
void remove_property (const QString &name)
 
void removeDynamicProperty (const QString &property)
 
void renameDynamicProperty (const QString &oldName, const QString &newName)
 
void self_remove ()
 
QScriptValue set_type (int type)
 
void setColor (const QVariant &s)
 
void setDataType (int dataType)
 
void setPos (qreal x, qreal y)
 
void setVisible (bool visible)
 
void setWidth (double w)
 
void setX (int x)
 
void setY (int y)
 
QScriptValue type ()
 
void updateDynamicProperty (const QString &property)
 
void updatePointerList ()
 

Signals

void colorChanged (const QColor &c)
 
void dataTypeChanged (int dataType)
 
void pointerListChanged ()
 
void posChanged (const QPointF &p)
 
void propertyAdded (const QString &name)
 
void propertyChanged (const QString &name)
 
void propertyRemoved (const QString &name)
 
void removed ()
 
void useColorChanged (bool b)
 
void visibilityChanged (bool visible)
 
void widthChanged (double w)
 

Public Member Functions

virtual ~Data ()
 
void addPointer (PointerPtr pointer)
 
DataList adjacentDataList () const
 
QVariant color () const
 
PointerPtr createPointer (DataPtr to)
 
DataStructurePtr dataStructure () const
 
int dataType () const
 
QScriptEngine * engine () const
 
virtual DataPtr getData () const
 
QString icon () const
 
int identifier () const
 
PointerList & inPointerList () const
 
bool isVisible () const
 
PointerList & outPointerList () const
 
PointerList pointerList () const
 
PointerList pointerList (DataPtr to) const
 
QList< QString > properties () const
 
void remove (PointerPtr e)
 
QScriptValue scriptValue () const
 
virtual void setEngine (QScriptEngine *_engine)
 
qreal width () const
 
qreal x () const
 
qreal y () const
 

Static Public Member Functions

static DataPtr create (DataStructurePtr dataStructure, int uniqueIdentifier, int dataType)
 

Protected Member Functions

 Data (DataStructurePtr dataStructure, int uniqueIdentifer, int dataType)
 
bool eventFilter (QObject *obj, QEvent *event)
 

Static Protected Member Functions

template<typename T >
static DataPtr create (DataStructurePtr parent, int uniqueIdentifier, int dataType)
 

Properties

QVariant color
 
int id
 
qreal width
 
qreal x
 
qreal y
 

Detailed Description

Definition at line 40 of file Data.h.

Constructor & Destructor Documentation

Data::~Data ( )
virtual

Default destructor.

DO NOT CALL IT, let the shared pointer take care for deletion.

Definition at line 138 of file Data.cpp.

Data::Data ( DataStructurePtr  dataStructure,
int  uniqueIdentifer,
int  dataType 
)
protected

Protected constructor.

Definition at line 132 of file Data.cpp.

Member Function Documentation

void Data::add_property ( const QString &  name,
const QString &  value 
)
slot

Definition at line 503 of file Data.cpp.

void Data::addDynamicProperty ( const QString &  property,
const QVariant &  value 
)
slot

Add new dynamic property with identifier property to this data element and sets it to value.

Parameters
propertyis the identifier for the new property
valueis the value of this new property

Definition at line 434 of file Data.cpp.

void Data::addPointer ( PointerPtr  pointer)

Register an created pointer to this data element.

By the pointer direction it is decided whether it is an out-/in-pointer. Calling this method more than once with the same pointer is safe (the pointer is added still only once.)

Parameters
pointeris pointer to be added

Definition at line 231 of file Data.cpp.

QScriptValue Data::adj_data ( )
slot

Definition at line 513 of file Data.cpp.

QScriptValue Data::adj_pointers ( )
slot

Definition at line 523 of file Data.cpp.

QScriptValue Data::adj_pointers ( int  pointerType)
slot

Definition at line 529 of file Data.cpp.

DataList Data::adjacentDataList ( ) const
Returns
list of adjacent data elements

Definition at line 197 of file Data.cpp.

QVariant Data::color ( ) const
Returns
color of data element
void Data::colorChanged ( const QColor &  c)
signal
QScriptValue Data::connected_pointers ( Data *  n)
slot

Definition at line 577 of file Data.cpp.

DataPtr Data::create ( DataStructurePtr  dataStructure,
int  uniqueIdentifier,
int  dataType 
)
static

Create data element objects.

Parameters
dataStructureis data structure to that the new data element belongs
uniqueIdentifieris unique identifier of the data element, it must be unique within the document
dataTypeis the type of the created data element, it must be existing and registered
Returns
the created data element

Definition at line 92 of file Data.cpp.

template<typename T >
static DataPtr Data::create ( DataStructurePtr  parent,
int  uniqueIdentifier,
int  dataType 
)
inlinestaticprotected

Factory method to create a data element of type T.

Definition at line 264 of file Data.h.

PointerPtr Data::createPointer ( DataPtr  to)

Create new pointer to to.

By using this method, the pointer gets registered at both of its end-points. Use this method to create new pointers.

Parameters
tois the target of the new pointer
Returns
the created pointer

Definition at line 257 of file Data.cpp.

DataStructurePtr Data::dataStructure ( ) const
Returns
data structure to that this data element belongs

Definition at line 150 of file Data.cpp.

int Data::dataType ( ) const
Returns
data type of this data element

Definition at line 387 of file Data.cpp.

void Data::dataTypeChanged ( int  dataType)
signal
QScriptEngine * Data::engine ( ) const
Returns
script engine

Definition at line 482 of file Data.cpp.

bool Data::eventFilter ( QObject *  obj,
QEvent *  event 
)
protected

Definition at line 142 of file Data.cpp.

DataPtr Data::getData ( ) const
virtual
Returns
shared pointer to this data element

Definition at line 125 of file Data.cpp.

QString Data::icon ( ) const
Returns
icon of data element

Definition at line 362 of file Data.cpp.

int Data::identifier ( ) const
Returns
unique identifier of this data element

Definition at line 382 of file Data.cpp.

PointerList & Data::inPointerList ( ) const
Returns
list of in-pointers of this data element

Definition at line 372 of file Data.cpp.

QScriptValue Data::input_pointers ( )
slot

Definition at line 541 of file Data.cpp.

QScriptValue Data::input_pointers ( int  pointerType)
slot

Definition at line 547 of file Data.cpp.

bool Data::isVisible ( ) const
Returns
true if data element is visible, otherwise false

Definition at line 155 of file Data.cpp.

PointerList & Data::outPointerList ( ) const
Returns
list of out-pointers of this data element

Definition at line 377 of file Data.cpp.

QScriptValue Data::output_pointers ( )
slot

Definition at line 559 of file Data.cpp.

QScriptValue Data::output_pointers ( int  pointerType)
slot

Definition at line 565 of file Data.cpp.

PointerList Data::pointerList ( ) const
Returns
list of all pointers connected to this data element (in and out pointers)

Definition at line 218 of file Data.cpp.

PointerList Data::pointerList ( DataPtr  to) const
Returns
all pointers that connect this data element with to

Definition at line 308 of file Data.cpp.

void Data::pointerListChanged ( )
signal
void Data::posChanged ( const QPointF &  p)
signal
QList< QString > Data::properties ( ) const

Definition at line 367 of file Data.cpp.

void Data::propertyAdded ( const QString &  name)
signal
void Data::propertyChanged ( const QString &  name)
signal
void Data::propertyRemoved ( const QString &  name)
signal
void Data::remove ( PointerPtr  e)

Remove pointer from pointer list.

Parameters
eis pointer to be removed

Definition at line 262 of file Data.cpp.

void Data::remove ( )
slot

Definition at line 319 of file Data.cpp.

void Data::remove_property ( const QString &  name)
slot

Definition at line 508 of file Data.cpp.

void Data::removed ( )
signal
void Data::removeDynamicProperty ( const QString &  property)
slot

Remove dynamic property with identifier property from data element.

Parameters
propertyis identifier of the property

Definition at line 444 of file Data.cpp.

void Data::renameDynamicProperty ( const QString &  oldName,
const QString &  newName 
)
slot

Definition at line 461 of file Data.cpp.

QScriptValue Data::scriptValue ( ) const
Returns
script value representation of this data element

Definition at line 471 of file Data.cpp.

void Data::self_remove ( )
slot
Deprecated:
Will be removed in Rocs 2.0

Definition at line 336 of file Data.cpp.

QScriptValue Data::set_type ( int  type)
slot

Definition at line 487 of file Data.cpp.

void Data::setColor ( const QVariant &  s)
slot

Definition at line 425 of file Data.cpp.

void Data::setDataType ( int  dataType)
slot

Definition at line 166 of file Data.cpp.

void Data::setEngine ( QScriptEngine *  _engine)
virtual

Set script engine.

The engine must be set to access the script value.

Reimplemented in GraphNode.

Definition at line 476 of file Data.cpp.

void Data::setPos ( qreal  x,
qreal  y 
)
slot

Definition at line 416 of file Data.cpp.

void Data::setVisible ( bool  visible)
slot

Definition at line 160 of file Data.cpp.

void Data::setWidth ( double  w)
slot

Definition at line 408 of file Data.cpp.

void Data::setX ( int  x)
slot

Definition at line 392 of file Data.cpp.

void Data::setY ( int  y)
slot

Definition at line 400 of file Data.cpp.

QScriptValue Data::type ( )
slot

Definition at line 498 of file Data.cpp.

void Data::updateDynamicProperty ( const QString &  property)
slot

Definition at line 451 of file Data.cpp.

void Data::updatePointerList ( )
slot

FIXME proof of concept implementation: since each Pointer emits a changed direction signal, there are unnecessary many updates.

Update pointer e in inPointerList and outPointerList, depending on how the direction changed This method is a condidate for optimizations, but it happens only seldom.

Definition at line 277 of file Data.cpp.

void Data::useColorChanged ( bool  b)
signal
void Data::visibilityChanged ( bool  visible)
signal
qreal Data::width ( ) const
Returns
size of data icon
void Data::widthChanged ( double  w)
signal
qreal Data::x ( ) const
Returns
x-position of data element
qreal Data::y ( ) const
Returns
y-position of data element

Property Documentation

QVariant Data::color
readwrite

Definition at line 47 of file Data.h.

int Data::id
read

Definition at line 46 of file Data.h.

qreal Data::width
readwrite

Definition at line 45 of file Data.h.

qreal Data::x
readwrite

Definition at line 43 of file Data.h.

qreal Data::y
readwrite

Definition at line 44 of file Data.h.


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