API Documentation
Loading...
Searching...
No Matches
DesignObjectOrientation.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: NDEVR
28File: DesignObjectOrientation
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/OrientationEditor.h>
35#include <NDEVR/Button.h>
36#include <NDEVR/ManagedDesignCommand.h>
37#include <NDEVR/Translator.h>
38#include <QBoxLayout>
39namespace NDEVR
40{
42 {
43 public:
44 DesignObjectOrientation(const DynamicPointer<QTDesignObject>& object, QWidget* parent = nullptr)
45 : OrientationEditor(parent)
46 , m_design_object(object)
47 {
50 setTarget(object);
51 offsetLayout()->addWidget(new Button(_t("Center"), "", [this](Button*)
52 {
53 WLock lock = m_design_object->manager()->writeLock();
54 m_design_object->getAs<Model>().centerAlignModel();
56 }));
57 }
66 protected slots:
68 {
69 setMatrix(m_design_object->get().getTransform());
70 }
72 {
74 if (mat != m_design_object->get().getTransform())
76 }
77 protected:
79 };
80}
#define _t(english_string)
Definition Translator.h:90
A core widget that allows the user to click one of many button types.
Definition Button.h:66
Definition DesignObjectOrientation.h:42
DynamicPointer< QTDesignObject > m_design_object
Definition DesignObjectOrientation.h:78
void modelUpdatedSlot()
Definition DesignObjectOrientation.h:67
DesignObjectOrientation(const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
Definition DesignObjectOrientation.h:44
void orientationEditedSlot()
Definition DesignObjectOrientation.h:71
void setTarget(const DynamicPointer< QTDesignObject > &object)
Definition DesignObjectOrientation.h:58
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:319
static DynamicPointer< DesignCommand > SetTransform(const Matrix< fltp08 > &transform)
Definition ManagedDesignCommand.h:166
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or.
Definition Model.h:58
A dialog where the user can set a 3D orientation of an object.
Definition OrientationEditor.h:54
QBoxLayout * offsetLayout()
Matrix< fltp08 > getMatrix()
void setMatrix(const Matrix< fltp08 > &matrix)
void updatedSignal(UUID id)
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