API Documentation
Loading...
Searching...
No Matches
DesignCommand.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: DesignCommand
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/UUID.h>
35#include <NDEVR/Resource.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/String.h>
38#include <NDEVR/Time.h>
39#include <NDEVR/ProgressInfo.h>
40namespace NDEVR
41{
42
43 class RWLock;
44 class DesignObjectLookup;
46 {
47 public:
49 virtual ~DesignCommand(){};
50 virtual void execute(DesignObjectLookup*) {};
51 virtual bool canGroupWith(const DynamicPointer<DesignCommand>&) { return false; }
52 virtual bool canCombineWith(const DynamicPointer<DesignCommand>& command) { return targets == command->targets; };
53 virtual void combineWith(const DynamicPointer<DesignCommand>& command);
54 virtual bool isAsyncExecution() const { return false; };
55 void setUndoRedoID(UUID undo_redo_group);
56 UUID undoRedoID() const;
57 virtual TranslatedString name() const = 0;
58 virtual String icon() const = 0;
59 public:
60 ProgressInfo* log = nullptr;
64 bool has_executed = false;
65 bool is_undo = false;
66 bool can_undo = true;
67 bool update_project_modified = true;
68 protected:
70 };
71}
72
73
74
#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:64
Definition DesignCommand.h:46
UUID id
Definition DesignCommand.h:63
virtual ~DesignCommand()
Definition DesignCommand.h:49
virtual TranslatedString name() const =0
virtual void execute(DesignObjectLookup *)
Definition DesignCommand.h:50
virtual bool isAsyncExecution() const
Definition DesignCommand.h:54
virtual String icon() const =0
UUID m_undo_redo_group
Definition DesignCommand.h:69
virtual bool canCombineWith(const DynamicPointer< DesignCommand > &command)
Definition DesignCommand.h:52
Buffer< UUID > targets
Definition DesignCommand.h:62
virtual bool canGroupWith(const DynamicPointer< DesignCommand > &)
Definition DesignCommand.h:51
Definition DesignObjectLookup.h:61
Definition Pointer.hpp:303
Definition ProgressInfo.hpp:43
Definition String.h:40
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition TranslatedString.h:9
Definition UUID.h:66
Definition ACIColor.h:37
Definition BaseValues.hpp:272