CGAL 4.5.1 - Kinetic Framework
|
This container holds a set of objects of a particular type. It creates notifications using the standard Multi_listener<Interface>
interface when a primitive changes or is added or deleted. Objects which are listening for events can then ask which primitives changed.
For speed, modifications to the Kinetic::ActiveObjectsTable
can be grouped into editing sessions. A session is begun by calling set_is_editing(true)
and ended by calling set_is_editing(false)
. There is one type of notification, namely, Listener::IS_EDITING
which occurs when the editing mode is set to false, signaling that a batch of changes is completed.
As an convenience, the change methods can be called without setting the editing state to true, this acts as if it were set to true for that one function call.
CGAL::Kinetic::Active_objects_vector<MovingObject>
Multi_listener<Interface>
CGAL::Kinetic::Active_objects_listener_helper<ActiveObjectsTable, KDS>
Types | |
typedef unspecified_type | Key |
A key identifying an object in the table. | |
typedef unspecified_type | Data |
The type being stored in the table. | |
typedef unspecified_type | Listener |
The base class to derive from for listening for runtime events. | |
Iterators | |
The following types are iterators. Each type, | |
typedef unspecified_type | Key_iterator |
An iterator through all the valid keys in the table. | |
typedef unspecified_type | Changed_iterator |
An iterator through all the objects which have been changed in the last editing session. More... | |
typedef unspecified_type | Inserted_iterator |
An iterator through all the objects which were added in the last editing session. | |
typedef unspecified_type | Erased_iterator |
An iterator through all the objects which were deleted in the last editing session. | |
Operations | |
Data | operator[] (Key key) const |
Access the object referenced by the key. | |
Data | at (Key key) const |
Access the object referenced by the key. | |
void | set_is_editing (bool is_editing) |
Set the editing state of the object. More... | |
bool | is_editing () const |
Access the editing state. | |
void | set (Key key, Data object) |
This method changes the motion of one moving object. More... | |
Key | insert_object (Data ob) |
Insert a new object into the table and return a Key which can be used to refer to it. More... | |
void | erase (Key key) |
Delete an object from the table. More... | |
void | clear () |
Remove all objects from the table and free all storage. | |
void | is_set (Key) const |
Returns true if the object has been set in the currently notified editing session. More... | |
void | is_new (Key) const |
Returns true if the object has been set in the currently notified editing session. | |
void | clear (Key) const |
Returns true if the object has been set in the currently notified editing session. | |
An iterator through all the objects which have been changed in the last editing session.
The iterator iterates through the objects in lexicographical order.
void Kinetic::ActiveObjectsTable::erase | ( | Key | key) |
Delete an object from the table.
The object with Key key must already be in the table. This does not necessarily decrease the amount of storage used at all. In fact, it is unlikely to do so. See set(Key,Data)
for an explainating of how the editing modes are used.
Insert a new object into the table and return a Key
which can be used to refer to it.
See set(Key, Data)
for a description of editing modes.
void Kinetic::ActiveObjectsTable::is_set | ( | Key | ) | const |
Returns true if the object has been set in the currently notified editing session.
Note that this method can only be saftely called when processing an IS_EDITING
notification.
This method changes the motion of one moving object.
The position at the current time should not be different from the previous current position. However, at the moment I do not check this as there is no reference to time in the Kinetic::ActiveObjectsTable
. If is_editing()
is not true, then it is as if the calls set_is_editing(true)
, set(key, value)
and finally set_is_editing(false)
were made. If it is true, then no notifications are created.
void Kinetic::ActiveObjectsTable::set_is_editing | ( | bool | is_editing) |
Set the editing state of the object.
A notification is sent when the editing state is set to false after it has been true, i.e. the editing session is finished. This allows changes to be batched together.