API Documentation
Loading...
Searching...
No Matches
DesignCommandManager.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/DesignCommand.h>
4#include <NDEVR/TranslatedString.h>
5namespace NDEVR
6{
7 class Thread;
8 class RLock;
9 class WLock;
10 /**--------------------------------------------------------------------------------------------------
11 \brief Stores logic for performing, undoing, or redoing DesignCommands.
12 *-----------------------------------------------------------------------------------------------**/
14 {
15 public:
18 void clear();
23
24
26 //const Buffer<UUID>& finishedCommands() const { return m_undo_commands; };
27 const Buffer<UUID>& undoneCommands() const { return m_undone_commands; };
28
29 virtual void postCommand(const DynamicPointer<DesignCommand>& command);
30 virtual void runCommand(const DynamicPointer<DesignCommand>& command);
31 virtual void finishCommand(const DynamicPointer<DesignCommand>& command);
32 bool hasCommand(UUID id);
33 bool canUndo() const { return m_undo_commands.size() > 0; }
34 bool canRedo() const { return m_undone_commands.size() > 0; }
35 bool hasPendingCommands() const;
38 virtual void undoCommand(UUID command);
39
42
46 public:
48 protected:
53#if NDEVR_SUPPORTS_THREADING
56#endif
59 };
60}
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Stores logic for performing, undoing, or redoing DesignCommands.
Definition DesignCommandManager.h:14
const DynamicPointer< DesignCommand > & lastPendingCommand() const
Buffer< UUID > m_thread_pending_commands
Definition DesignCommandManager.h:54
bool canRedo() const
Definition DesignCommandManager.h:34
Buffer< UUID > m_pending_commands
Definition DesignCommandManager.h:52
DesignCommandManager(DesignObjectLookup *lookup, ProgressInfo *log)
Resource< UUID > command_id
Definition DesignCommandManager.h:43
DesignObjectLookup * m_lookup
Definition DesignCommandManager.h:58
Resource< TranslatedString > command_hint
Definition DesignCommandManager.h:45
Resource< bool > command_lock
Definition DesignCommandManager.h:47
Thread * m_command_thread
Definition DesignCommandManager.h:55
const Buffer< UUID > & undoneCommands() const
Definition DesignCommandManager.h:27
Buffer< UUID > m_undo_commands
Definition DesignCommandManager.h:50
virtual void runCommand(const DynamicPointer< DesignCommand > &command)
bool canUndo() const
Definition DesignCommandManager.h:33
ProgressInfo * m_log
Definition DesignCommandManager.h:57
virtual void undoCommand(UUID command)
Resource< TranslatedString > command_name
Definition DesignCommandManager.h:44
const DynamicPointer< DesignCommand > & getCommand(UUID command_id) const
virtual void postCommand(const DynamicPointer< DesignCommand > &command)
Buffer< UUID > m_undone_commands
Definition DesignCommandManager.h:51
virtual void executeCommand(DynamicPointer< DesignCommand > command)
Dictionary< UUID, DynamicPointer< DesignCommand > > m_commands
Definition DesignCommandManager.h:49
virtual void finishCommand(const DynamicPointer< DesignCommand > &command)
A core class where all Design Objects including models, materials, and geometries are stored.
Definition DesignObjectLookup.h:65
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:319
A light-weight base class for Log that allows processes to update, without the need for.
Definition ProgressInfo.hpp:48
Used to lock a particular variable for reading. Any number of readers can be created when no write lo...
Definition RWLock.h:91
A core part of the engine, stores variables that can be listened to with ResourceListener.
Definition Toggle.h:41
A thread is a single sequence stream within the software.
Definition Thread.h:66
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:62
Used to lock a particular variable for writing. Only one write lock can be created when no read locks...
Definition RWLock.h:115
Definition ACIColor.h:37