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;
45
46 /**--------------------------------------------------------------------------------------------------
47 \brief A command for safely modifying something in a DesignObjectLookup. Modifications will be done
48 in a seperate thread from the UI and will be recorded for undo-redo. Most user modifications of
49 data should occur via a DesignCommand.
50 **/
52 {
53 public:
55 virtual ~DesignCommand(){};
56 virtual void execute(DesignObjectLookup*) {};
57 virtual bool canGroupWith(const DynamicPointer<DesignCommand>&) { return false; }
58 virtual bool canCombineWith(const DynamicPointer<DesignCommand>& command) { return targets == command->targets; };
59 virtual void combineWith(const DynamicPointer<DesignCommand>& command);
60 virtual bool isAsyncExecution() const { return false; };
61 void setUndoRedoID(UUID undo_redo_group);
63 virtual TranslatedString name() const = 0;
64 virtual String icon() const = 0;
65 public:
66 ProgressInfo* log = nullptr;
70 bool has_executed = false;
71 bool is_undo = false;
72 bool can_undo = true;
73 bool update_project_modified = true;
74 protected:
76 };
77}
78
79
80
#define NDEVR_DESIGN_API
Definition DLLInfo.h:55
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A command for safely modifying something in a DesignObjectLookup. Modifications will be done in a sep...
Definition DesignCommand.h:52
virtual void combineWith(const DynamicPointer< DesignCommand > &command)
UUID id
Definition DesignCommand.h:69
virtual ~DesignCommand()
Definition DesignCommand.h:55
virtual TranslatedString name() const =0
virtual void execute(DesignObjectLookup *)
Definition DesignCommand.h:56
virtual bool isAsyncExecution() const
Definition DesignCommand.h:60
virtual String icon() const =0
void setUndoRedoID(UUID undo_redo_group)
UUID m_undo_redo_group
Definition DesignCommand.h:75
virtual bool canCombineWith(const DynamicPointer< DesignCommand > &command)
Definition DesignCommand.h:58
Buffer< UUID > targets
Definition DesignCommand.h:68
UUID undoRedoID() const
virtual bool canGroupWith(const DynamicPointer< DesignCommand > &)
Definition DesignCommand.h:57
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The core String class for the NDEVR API.
Definition String.h:69
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233