PLaSK library

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
plask::GeometryObject::Event Class Reference

Store information about event connected with geometry object. More...

`#include <plask/geometry/object.hpp>`

Inheritance diagram for plask::GeometryObject::Event:
[legend]
Collaboration diagram for plask::GeometryObject::Event:
[legend]

## Public Types
enum | Flags : FlagsType { EVENT_DELETE = 1 << 0 , EVENT_RESIZE = 1 << 1 , EVENT_DELEGATED = 1 << 2 , EVENT_CHILDREN_INSERT = 1 << 3 , EVENT_CHILDREN_REMOVE = 1 << 4 , EVENT_CHILDREN_GENERIC = 1 << 5 , EVENT_EDGES , EVENT_STEPS = 1 << 7 , EVENT_USER_DEFINED = 1 << 8 }
| Event flags (which describes event properties). More...
Public Types inherited from plask::EventWithSourceAndFlags< GeometryObject, unsigned >
typedef unsigned | FlagsType

## Public Member Functions
FlagsType | flagsForParent () const
| Get event's flags for parent in tree of geometry (useful to calculate flags for event which should be generated by parent of object which is a source of this event).
FlagsType | flagsForParentWithChildrenWasChangedInformation () const
| Get event's flags for parent in tree of geometry, for parents which want to delegate information about changes of children list.
bool | hasFlag (Flags flag) const
| Check if given `flag` is set.
bool | isDelete () const
| Check if EVENT_DELETE flag is set, which mean that source of event is deleted.
bool | isResize () const
| Check if EVENT_RESIZE flag is set, which mean that source of event could be resized.
bool | isDelgatedFromChild () const
| Check if EVENT_DELEGATED flag is set, which mean that source delegate event from its child.
bool | hasChangedChildrenList () const
| Check if CHILD_LIST flag is set, which mean that children list of source could be changed.
bool | hasChangedEdges () const
| Check if EVENT_EDGES flag is set, which mean that edges connected with source could changed.
const GeometryObject * | originalSource () const
| Get original source of event which can differ from source if event was delegated.
| Event (GeometryObject *source, FlagsType flags=0)
| Construct event.
| Event (GeometryObject *source, const GeometryObject *originalSource, FlagsType flags)
| Construct event.
Public Member Functions inherited from plask::EventWithSourceAndFlags< GeometryObject, unsigned >
const GeometryObject * | source () const
| Get source of event.
GeometryObject * | source ()
| Get source of event.
const T * | source () const
| Get source of event casted (using dynamic_cast) to given type T.
T * | source ()
| Get source of event casted (using dynamic_cast) to given type T.
FlagsType | flags () const
| Get event's flags.
FlagsType | flagsWithout (FlagsType flagsToRemove) const
| Get event's flags with excluded `flagsToRemove`.
bool | hasAllFlags (FlagsType flags) const
| Check if given all of `flags` are set.
bool | hasAnyFlag (FlagsType flags) const
| Check if one of given `flags` are set.
| EventWithSourceAndFlags (GeometryObject *source, FlagsType flags=0)
| Construct event.
virtual | ~EventWithSourceAndFlags ()
| Virtual destructor for eventual subclassing.

## Detailed Description

Store information about event connected with geometry object.

Subroles of this can contains additional information about specific type of event.

Note: when object is being deleted (isDelete() returns `true`), source() can't be successfully dynamic cast to subroles of GeometryObject, because source() is already partially deleted.

Definition at line 99 of file object.hpp.

## Member Enumeration Documentation

## ◆ Flags

enum plask::GeometryObject::Event::Flags : FlagsType

Event flags (which describes event properties).

Enumerator
EVENT_DELETE | is deleted
EVENT_RESIZE | size could be changed
EVENT_DELEGATED | delegated from child
EVENT_CHILDREN_INSERT | children was inserted
EVENT_CHILDREN_REMOVE | children was removed
EVENT_CHILDREN_GENERIC | children list was changed (other or custom changes)
EVENT_EDGES | edges was changed (only Geometries/calculation spaces emit events with this flags)
EVENT_STEPS | step refining was changed
EVENT_USER_DEFINED | user-defined flags could have ids: EVENT_USER_DEFINED, EVENT_USER_DEFINED<<1, EVENT_USER_DEFINED<<2, ...

Definition at line 106 of file object.hpp.

## Constructor & Destructor Documentation

## ◆ Event() [1/2]

plask::GeometryObject::Event::Event | ( | GeometryObject * | source,
|  | FlagsType | flags = `0`
| ) |  |
| inline explicit

Construct event.

Parameters

  source | source and original source of event
  flags | which describes event's properties

Definition at line 196 of file object.hpp.

## ◆ Event() [2/2]

plask::GeometryObject::Event::Event | ( | GeometryObject * | source,
|  | const GeometryObject * | originalSource,
|  | FlagsType | flags
| ) |  |
| inline explicit

Construct event.

Parameters

  source | source of event
  originalSource | original source of event
  flags | which describes event's properties

Definition at line 205 of file object.hpp.

## Member Function Documentation

## ◆ flagsForParent()

FlagsType plask::GeometryObject::Event::flagsForParent | ( |  | ) | const
| inline

Get event's flags for parent in tree of geometry (useful to calculate flags for event which should be generated by parent of object which is a source of this event).

Returns
  flags for parent in tree of geometry

Definition at line 126 of file object.hpp.

## ◆ flagsForParentWithChildrenWasChangedInformation()

FlagsType plask::GeometryObject::Event::flagsForParentWithChildrenWasChangedInformation | ( |  | ) | const
| inline

Get event's flags for parent in tree of geometry, for parents which want to delegate information about changes of children list.

(uses mainly by parents of hidden child to calculate flags for event which should be generated by parent of object which is a source of this event).

Note: In most cases You should use flagsForParent() instead.

Returns
  flags for parent in tree of geometry

Definition at line 139 of file object.hpp.

## ◆ hasChangedChildrenList()

bool plask::GeometryObject::Event::hasChangedChildrenList | ( |  | ) | const
| inline

Check if CHILD_LIST flag is set, which mean that children list of source could be changed.

Returns
  `true` only if CHILD_LIST flag is set

Definition at line 175 of file object.hpp.

## ◆ hasChangedEdges()

bool plask::GeometryObject::Event::hasChangedEdges | ( |  | ) | const
| inline

Check if EVENT_EDGES flag is set, which mean that edges connected with source could changed.

Returns
  `true` only if EVENT_EDGES flag is set

Definition at line 183 of file object.hpp.

## ◆ hasFlag()

bool plask::GeometryObject::Event::hasFlag | ( | Flags | flag | ) | const
| inline

Check if given `flag` is set.

Parameters

  flag | flag to check

Returns
  `true` only if `flag` is set

Definition at line 151 of file object.hpp.

## ◆ isDelete()

bool plask::GeometryObject::Event::isDelete | ( |  | ) | const
| inline

Check if EVENT_DELETE flag is set, which mean that source of event is deleted.

Returns
  `true` only if EVENT_DELETE flag is set

Definition at line 157 of file object.hpp.

## ◆ isDelgatedFromChild()

bool plask::GeometryObject::Event::isDelgatedFromChild | ( |  | ) | const
| inline

Check if EVENT_DELEGATED flag is set, which mean that source delegate event from its child.

Returns
  `true` only if EVENT_DELEGATED flag is set

Definition at line 169 of file object.hpp.

## ◆ isResize()

bool plask::GeometryObject::Event::isResize | ( |  | ) | const
| inline

Check if EVENT_RESIZE flag is set, which mean that source of event could be resized.

Returns
  `true` only if EVENT_RESIZE flag is set

Definition at line 163 of file object.hpp.

## ◆ originalSource()

const GeometryObject * plask::GeometryObject::Event::originalSource | ( |  | ) | const
| inline

Get original source of event which can differ from source if event was delegated.

Returns
  original source of event

Definition at line 189 of file object.hpp.

The documentation for this class was generated from the following file:

- plask/geometry/object.hpp