• 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
Pointer Class Reference

#include <Pointer.h>

Inheritance diagram for Pointer:
Inheritance graph
[legend]

Public Slots

void addDynamicProperty (const QString &property, const QVariant &value)
 
QList< QString > properties () const
 
void removeDynamicProperty (const QString &property)
 
void renameDynamicProperty (const QString &oldName, const QString &newName)
 
void setColor (const QColor &color)
 
void setPointerType (int pointerType)
 
void setVisible (bool visible)
 
void setWidth (qreal width)
 
Qt::PenStyle style () const
 
QScriptValue type () const
 
void updateDynamicProperty (const QString &property)
 
void updateRelativeIndex ()
 

Signals

void changed ()
 
void directionChanged (PointerType::Direction direction)
 
void pointerTypeChanged (int pointerType)
 
void posChanged ()
 
void propertyAdded (const QString &name)
 
void propertyChanged (const QString &name)
 
void propertyRemoved (const QString &name)
 
void removed ()
 

Public Member Functions

virtual ~Pointer ()
 
Q_INVOKABLE void add_property (const QString &name, const QString &value)
 
QColor color () const
 
DataStructurePtr dataStructure () const
 
PointerType::Direction direction () const
 
Q_INVOKABLE QScriptValue end () const
 
DataPtr from () const
 
PointerPtr getPointer () const
 
bool isDirected () const
 
bool isVisible () const
 
int pointerType () const
 
int relativeIndex () const
 
Q_INVOKABLE void remove ()
 
Q_INVOKABLE void remove_property (const QString &name)
 
QScriptValue scriptValue () const
 
Q_INVOKABLE void self_remove ()
 
Q_INVOKABLE QScriptValue set_type (int type)
 
void setEngine (QScriptEngine *engine)
 
Q_INVOKABLE QScriptValue start () const
 
DataPtr to () const
 
qreal width () const
 

Static Public Member Functions

static PointerPtr create (DataStructurePtr dataStructure, DataPtr from, DataPtr to, int pointerType)
 

Protected Member Functions

 Pointer (DataStructurePtr parent, DataPtr from, DataPtr to, int pointerType)
 
bool eventFilter (QObject *obj, QEvent *event)
 

Static Protected Member Functions

template<typename T >
static PointerPtr create (DataStructurePtr parent, DataPtr from, DataPtr to, int pointerType)
 

Properties

QColor color
 
bool directed
 
QScriptValue from
 
QScriptValue to
 
int type
 
qreal width
 

Detailed Description

Pointers are connections between two nodes in the data structure.

They are usually unidirectional and hold several properties. Properties can accessed directly by the getter methods or (also from the script engine) be created by 'add_property(name, value)' and access by 'pointer.propertyName'.

Definition at line 48 of file Pointer.h.

Constructor & Destructor Documentation

Pointer::~Pointer ( )
virtual

Default destructor.

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

Definition at line 117 of file Pointer.cpp.

Pointer::Pointer ( DataStructurePtr  parent,
DataPtr  from,
DataPtr  to,
int  pointerType 
)
protected

Protected constructor.

Use static

See also
create() method.
Parameters
parentthe data structure the pointer belongs to
fromthe first data element
tothe second data element
pointerTypethe type of this pointer (default is 0)

Definition at line 99 of file Pointer.cpp.

Member Function Documentation

void Pointer::add_property ( const QString &  name,
const QString &  value 
)

Add new property to pointer.

Parameters
nameis identifier for new property
valueis the initial value of the property

Definition at line 317 of file Pointer.cpp.

void Pointer::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 260 of file Pointer.cpp.

void Pointer::changed ( )
signal

Emitted when a connected data element or the pointer is changed.

QColor Pointer::color ( ) const
Returns
the color of this pointer
PointerPtr Pointer::create ( DataStructurePtr  dataStructure,
DataPtr  from,
DataPtr  to,
int  pointerType 
)
static

Create pointer objects.

Parameters
dataStructureis data structure to that the new data element belongs
fromis source of pointer
tois target of pointer
pointerTypeis the type of the created pointer, it must be existing and registered
Returns
the created pointer element

Definition at line 53 of file Pointer.cpp.

template<typename T >
static PointerPtr Pointer::create ( DataStructurePtr  parent,
DataPtr  from,
DataPtr  to,
int  pointerType 
)
inlinestaticprotected

Factory method to create a pointer element of type T.

Definition at line 299 of file Pointer.h.

DataStructurePtr Pointer::dataStructure ( ) const
Returns
data structure to that this pointer belongs

Definition at line 140 of file Pointer.cpp.

PointerType::Direction Pointer::direction ( ) const
Returns
the direction of the pointer.

Definition at line 210 of file Pointer.cpp.

void Pointer::directionChanged ( PointerType::Direction  direction)
signal

Emitted when direction was changed.

QScriptValue Pointer::end ( ) const
Returns
the
See also
to() data element for script engine

Definition at line 331 of file Pointer.cpp.

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

Definition at line 121 of file Pointer.cpp.

DataPtr Pointer::from ( ) const
Returns
source data element of this pointer
PointerPtr Pointer::getPointer ( ) const
Returns
shared pointer to this pointer element

Definition at line 93 of file Pointer.cpp.

bool Pointer::isDirected ( ) const
Returns
true if the pointer is directed, otherwise false

Definition at line 215 of file Pointer.cpp.

bool Pointer::isVisible ( ) const
Returns
true if the edge is visible, otherwise false.

Definition at line 226 of file Pointer.cpp.

int Pointer::pointerType ( ) const
Returns
pointer type identifier,
See also
class PointerType

Definition at line 155 of file Pointer.cpp.

void Pointer::pointerTypeChanged ( int  pointerType)
signal

Emitted when the pointer type of this pointer changes.

void Pointer::posChanged ( )
signal

Emitted when the position of a connected data element changes.

QList< QString > Pointer::properties ( ) const
slot

Definition at line 179 of file Pointer.cpp.

void Pointer::propertyAdded ( const QString &  name)
signal
void Pointer::propertyChanged ( const QString &  name)
signal
void Pointer::propertyRemoved ( const QString &  name)
signal
int Pointer::relativeIndex ( ) const

The relative index is the index that this pointer has relative to the pair of data elements to which it is bound.

I.e., if its end points have have two or more pointers connecteds between them, the relative index gives a unique identifier for the pointer. Note that the relative index can change whenever pointers between its endpoints are created or removed.

Returns
the relative index identifier

Definition at line 131 of file Pointer.cpp.

void Pointer::remove ( )

Remove pointer.

Definition at line 184 of file Pointer.cpp.

void Pointer::remove_property ( const QString &  name)

Remove a property named name from this pointer.

Parameters
nameidentifier of the property to remove.

Definition at line 312 of file Pointer.cpp.

void Pointer::removed ( )
signal

Emitted when this pointer is removed.

void Pointer::removeDynamicProperty ( const QString &  property)
slot

Remove dynamic property with identifier property from data element.

Parameters
propertyis identifier of the property

Definition at line 270 of file Pointer.cpp.

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

Definition at line 286 of file Pointer.cpp.

QScriptValue Pointer::scriptValue ( ) const

if the qtscript is enabled for this rocs, this method returns the self-referenced script value for this pointer.

Returns
QScriptValue self reference for this datum.

Definition at line 346 of file Pointer.cpp.

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

Definition at line 203 of file Pointer.cpp.

QScriptValue Pointer::set_type ( int  type)

Set pointer type from script engine.

If pointer type type does not exist, the method returns false. Otherwise it returns true.

Parameters
typeis pointer type identifier.
Returns
if change of type was successful

Definition at line 296 of file Pointer.cpp.

void Pointer::setColor ( const QColor &  color)
slot

Set color attribute of this pointer.

The new color must be set either in format "#000000" or by it's english name ("red" for example).

Parameters
coloris the new color of this pointer

Definition at line 231 of file Pointer.cpp.

void Pointer::setEngine ( QScriptEngine *  engine)

if qtscript is enabled for this rocs, this method will set the engine for this single object engine the QScriptEngine that will work on the object

Definition at line 340 of file Pointer.cpp.

void Pointer::setPointerType ( int  pointerType)
slot

Change pointer type of the pointer.

The specified pointer type must exist.

Parameters
pointerTypeis the new pointer type

Definition at line 161 of file Pointer.cpp.

void Pointer::setVisible ( bool  visible)
slot

Definition at line 220 of file Pointer.cpp.

void Pointer::setWidth ( qreal  width)
slot

Set the width of this pointer.

Parameters
widthof the pointer line

Definition at line 249 of file Pointer.cpp.

QScriptValue Pointer::start ( ) const
Returns
the
See also
from() data element for script engine

Definition at line 322 of file Pointer.cpp.

Qt::PenStyle Pointer::style ( ) const
slot
Returns
line style of the pointer line

Definition at line 255 of file Pointer.cpp.

DataPtr Pointer::to ( ) const
Returns
target data element of this pointer
QScriptValue Pointer::type ( ) const
slot
Returns
pointer type identifier for script engine
void Pointer::updateDynamicProperty ( const QString &  property)
slot

Definition at line 276 of file Pointer.cpp.

void Pointer::updateRelativeIndex ( )
slot

Update relative index.

See also
relativeIndex().

Definition at line 136 of file Pointer.cpp.

qreal Pointer::width ( ) const
Returns
width of the pointer

Property Documentation

QColor Pointer::color
readwrite

Definition at line 55 of file Pointer.h.

bool Pointer::directed
read

Definition at line 54 of file Pointer.h.

DataPtr Pointer::from
read

Definition at line 52 of file Pointer.h.

DataPtr Pointer::to
read

Definition at line 53 of file Pointer.h.

QScriptValue Pointer::type
read

Definition at line 57 of file Pointer.h.

qreal Pointer::width
readwrite

Definition at line 56 of file Pointer.h.


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