ufe  1.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
transform3d.h
Go to the documentation of this file.
1 #line 1 "E:/jenkins/workspace/ufe-full-windows/ufe/include/transform3d.h"
2 #ifndef _transform3d
3 #define _transform3d
4 // ===========================================================================
5 // Copyright 2018 Autodesk, Inc. All rights reserved.
6 //
7 // Use of this software is subject to the terms of the Autodesk license
8 // agreement provided at the time of installation or download, or which
9 // otherwise accompanies this software in either electronic or hard copy form.
10 // ===========================================================================
11 
12 #include "common/ufeExport.h"
13 #include "sceneItem.h"
14 #include "observer.h"
16 
17 #include <memory>
18 #include <array>
19 
20 UFE_NS_DEF {
21 
23 
27  std::array<std::array<double, 4>, 4> matrix;
28 
30  Matrix4d operator*(const Matrix4d& rhs) const;
31 };
32 
35  std::array<double, 3> vector;
36 
37  Vector3d(double x, double y, double z);
38 
39  double x() const;
40  double y() const;
41  double z() const;
42 };
43 
45 
84 {
85 public:
86  typedef std::shared_ptr<Transform3d> Ptr;
87 
95  static Ptr transform3d(const SceneItem::Ptr& item);
96 
104  static bool addObserver(
105  const SceneItem::Ptr& item, const Observer::Ptr& obs);
113  static bool removeObserver(
114  const SceneItem::Ptr& item, const Observer::Ptr& obs);
115 
121  static std::size_t nbObservers(const SceneItem::Ptr& item);
122 
130  static bool hasObserver(
131  const SceneItem::Ptr& item, const Observer::Ptr& obs);
132 
135  static bool hasObservers(const Path& path);
136 
141  static bool hasObservers(Rtid runTimeId);
142 
146  static void notify(const Path& path);
147 
149  Transform3d();
151  Transform3d(const Transform3d&) = default;
153  virtual ~Transform3d();
154 
156  virtual const Path& path() const = 0;
157 
159  virtual SceneItem::Ptr sceneItem() const = 0;
160 
163  virtual TranslateUndoableCommand::Ptr translateCmd() = 0;
164 
169  virtual void translate(double x, double y, double z) = 0;
170 
173  virtual Vector3d translation() const = 0;
174 
177  virtual RotateUndoableCommand::Ptr rotateCmd() = 0;
178 
183  virtual void rotate(double x, double y, double z) = 0;
184 
187  virtual ScaleUndoableCommand::Ptr scaleCmd() = 0;
188 
193  virtual void scale(double x, double y, double z) = 0;
194 
197  virtual TranslateUndoableCommand::Ptr rotatePivotTranslateCmd() = 0;
198 
203  virtual void rotatePivotTranslate(double x, double y, double z) = 0;
204 
207  virtual Vector3d rotatePivot() const = 0;
208 
211  virtual TranslateUndoableCommand::Ptr scalePivotTranslateCmd() = 0;
212 
217  virtual void scalePivotTranslate(double x, double y, double z) = 0;
218 
221  virtual Vector3d scalePivot() const = 0;
222 
226  Matrix4d inclusiveMatrix() const;
227 
231  Matrix4d exclusiveMatrix() const;
232 
240  virtual Matrix4d segmentInclusiveMatrix() const = 0;
241 
249  virtual Matrix4d segmentExclusiveMatrix() const = 0;
250 };
251 
252 }
253 
254 #endif /* _transform3d */
std::shared_ptr< RotateUndoableCommand > Ptr
Abstract base class for 3D transform interface.
Definition: transform3d.h:83
std::shared_ptr< Observer > Ptr
Definition: observer.h:36
Definition of macros for symbol visibility.
std::shared_ptr< Transform3d > Ptr
Definition: transform3d.h:86
std::shared_ptr< ScaleUndoableCommand > Ptr
std::shared_ptr< TranslateUndoableCommand > Ptr
Identify an object or 3D path in the scene.
Definition: path.h:37
uint32_t Rtid
Definition: rtid.h:26
std::array< double, 3 > vector
Definition: transform3d.h:35
3D vector class.
Definition: transform3d.h:34
#define UFE_NS_DEF
Definition: ufe.h:35
std::array< std::array< double, 4 >, 4 > matrix
Definition: transform3d.h:27
Matrix class for 3D transforms.
Definition: transform3d.h:26
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:39
#define UFE_SDK_DECL
Definition: ufeExport.h:36