Plasma Engine  2.0
Loading...
Searching...
No Matches
SceneCommands.h
1#pragma once
2
3#include <ToolsFoundation/Command/Command.h>
4#include <ToolsFoundation/Document/Document.h>
5#include <ToolsFoundation/ToolsFoundationDLL.h>
6
7class plRandomGauss;
8
10{
11 PL_ADD_DYNAMIC_REFLECTION(plDuplicateObjectsCommand, plCommand);
12
13public:
15
16public: // Properties
17 plString m_sGraphTextFormat;
18 plString m_sParentNodes;
19
21
23 plVec3 m_vAccumulativeRotation;
24 plVec3 m_vRandomRotation;
25 plVec3 m_vRandomTranslation;
26 bool m_bGroupDuplicates;
27
29 float m_fRevolveRadius;
30 plAngle m_RevolveStartAngle;
31 plAngle m_RevolveAngleStep;
32
33private:
34 virtual plStatus DoInternal(bool bRedo) override;
35
36 void SetAsSelection();
37
38 void DeserializeGraph(plAbstractObjectGraph& graph);
39
40 void CreateOneDuplicate(plAbstractObjectGraph& graph, plHybridArray<plDocument::PasteInfo, 16>& ToBePasted);
41 void AdjustObjectPositions(plHybridArray<plDocument::PasteInfo, 16>& Duplicates, plUInt32 uiNumDuplicate, plRandomGauss& rngRotX,
42 plRandomGauss& rngRotY, plRandomGauss& rngRotZ, plRandomGauss& rngTransX, plRandomGauss& rngTransY, plRandomGauss& rngTransZ);
43
44 virtual plStatus UndoInternal(bool bFireEvents) override;
45 virtual void CleanupInternal(CommandState state) override;
46
47private:
48 struct DuplicatedObject
49 {
50 plDocumentObject* m_pObject;
51 plDocumentObject* m_pParent;
52 plString m_sParentProperty;
53 plVariant m_Index;
54 };
55
56 plDeque<const plDocumentObject*> m_OriginalSelection;
57 plHybridArray<DuplicatedObject, 4> m_DuplicatedObjects;
58};
Definition AbstractObjectGraph.h:115
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
Interface for a command.
Definition Command.h:15
Definition Deque.h:270
Definition DocumentObjectBase.h:11
Definition SceneCommands.h:10
plInt8 m_iRevolveAxis
0 = disabled, 1 = x, 2 = y, 3 = z
Definition SceneCommands.h:28
plUInt32 m_uiNumberOfCopies
A stringyfied map in format "uuidObj1=uuidParent1;..." that defines the previous parents of all top l...
Definition SceneCommands.h:20
plVec3 m_vAccumulativeTranslation
if set to 0 (the default), all the 'advanced' duplication code is skipped and only a single straight ...
Definition SceneCommands.h:22
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
A random number generator that produces values with a normal / Gaussian distribution.
Definition Random.h:91
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
An plResult with an additional message for the reason of failure.
Definition Status.h:12