ufe  2.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
camera.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ufe-full-windows/ufe/include/camera.h"
2 #ifndef _camera
3 #define _camera
4 // ===========================================================================
5 // Copyright 2020 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"
15 #include "cameraUndoableCommands.h"
16 #include "types.h"
17 
18 #include <memory>
19 #include <array>
20 
22 {
23 
25 
50  {
51  public:
52  typedef std::shared_ptr<Camera> Ptr;
53 
55  {
57  Orthographic
58  };
59 
68  static Ptr camera(const SceneItem::Ptr &item);
69 
77  static bool addObserver(
78  const SceneItem::Ptr &item, const Observer::Ptr &obs);
86  static bool removeObserver(
87  const SceneItem::Ptr &item, const Observer::Ptr &obs);
88 
94  static std::size_t nbObservers(const SceneItem::Ptr &item);
95 
103  static bool hasObserver(
104  const SceneItem::Ptr &item, const Observer::Ptr &obs);
105 
108  static bool hasObservers(const Path &path);
109 
114  static bool hasObservers(Rtid runTimeId);
115 
119  static void notify(const Path &path);
120 
122  Camera();
124  Camera(const Camera &) = default;
126  virtual ~Camera();
127 
129  virtual const Path &path() const = 0;
130 
132  virtual SceneItem::Ptr sceneItem() const = 0;
133 
138  virtual HorizontalApertureUndoableCommand::Ptr horizontalApertureCmd(
139  float ha) = 0;
140 
144  virtual void horizontalAperture(float ha)
145  {
146  auto cmd = horizontalApertureCmd(ha);
147  if (cmd)
148  {
149  cmd->execute();
150  }
151  }
152 
155  virtual float horizontalAperture() const = 0;
156 
161  virtual VerticalApertureUndoableCommand::Ptr verticalApertureCmd(
162  float va) = 0;
163 
167  virtual void verticalAperture(float va)
168  {
169  auto cmd = verticalApertureCmd(va);
170  if (cmd)
171  {
172  cmd->execute();
173  }
174  }
175 
178  virtual float verticalAperture() const = 0;
179 
184  virtual HorizontalApertureOffsetUndoableCommand::Ptr horizontalApertureOffsetCmd(
185  float hao) = 0;
186 
190  virtual void horizontalApertureOffset(float hao)
191  {
192  auto cmd = horizontalApertureOffsetCmd(hao);
193  if (cmd)
194  {
195  cmd->execute();
196  }
197  }
198 
201  virtual float horizontalApertureOffset() const = 0;
202 
207  virtual VerticalApertureOffsetUndoableCommand::Ptr verticalApertureOffsetCmd(
208  float vao) = 0;
209 
213  virtual void verticalApertureOffset(float vao)
214  {
215  auto cmd = verticalApertureOffsetCmd(vao);
216  if (cmd)
217  {
218  cmd->execute();
219  }
220  }
221 
224  virtual float verticalApertureOffset() const = 0;
225 
230  virtual FStopUndoableCommand::Ptr fStopCmd(
231  float fs) = 0;
232 
236  virtual void fStop(float fs)
237  {
238  auto cmd = fStopCmd(fs);
239  if (cmd)
240  {
241  cmd->execute();
242  }
243  }
244 
247  virtual float fStop() const = 0;
248 
253  virtual FocalLengthUndoableCommand::Ptr focalLengthCmd(
254  float fl) = 0;
255 
259  virtual void focalLength(float fl)
260  {
261  auto cmd = focalLengthCmd(fl);
262  if (cmd)
263  {
264  cmd->execute();
265  }
266  }
267 
270  virtual float focalLength() const = 0;
271 
276  virtual FocusDistanceUndoableCommand::Ptr focusDistanceCmd(
277  float fd) = 0;
278 
282  virtual void focusDistance(float fd)
283  {
284  auto cmd = focusDistanceCmd(fd);
285  if (cmd)
286  {
287  cmd->execute();
288  }
289  }
290 
293  virtual float focusDistance() const = 0;
294 
299  virtual NearClipPlaneUndoableCommand::Ptr nearClipPlaneCmd(
300  float ncp) = 0;
301 
305  virtual void nearClipPlane(float ncp)
306  {
307  auto cmd = nearClipPlaneCmd(ncp);
308  if (cmd)
309  {
310  cmd->execute();
311  }
312  }
313 
316  virtual float nearClipPlane() const = 0;
317 
322  virtual FarClipPlaneUndoableCommand::Ptr farClipPlaneCmd(
323  float fcp) = 0;
324 
328  virtual void farClipPlane(float fcp)
329  {
330  auto cmd = farClipPlaneCmd(fcp);
331  if (cmd)
332  {
333  cmd->execute();
334  }
335  }
336 
339  virtual float farClipPlane() const = 0;
340 
345  virtual ProjectionUndoableCommand::Ptr projectionCmd(
346  Projection p) = 0;
347 
351  virtual void projection(Projection p)
352  {
353  auto cmd = projectionCmd(p);
354  if (cmd)
355  {
356  cmd->execute();
357  }
358  }
359 
362  virtual Projection projection() const = 0;
363  };
364 }
365 
366 #endif /* _camera */
virtual void focalLength(float fl)
Definition: camera.h:259
std::shared_ptr< Observer > Ptr
Definition: observer.h:36
Definition of macros for symbol visibility.
std::shared_ptr< ObservableSelection > Ptr
virtual void fStop(float fs)
Definition: camera.h:236
virtual void verticalAperture(float va)
Definition: camera.h:167
virtual void farClipPlane(float fcp)
Definition: camera.h:328
std::shared_ptr< SetValueUndoableCommand > Ptr
virtual void verticalApertureOffset(float vao)
Definition: camera.h:213
Identify an object or 3D path in the scene.
Definition: path.h:37
virtual void nearClipPlane(float ncp)
Definition: camera.h:305
uint32_t Rtid
Definition: rtid.h:26
Abstract base class for camera interface.
Definition: camera.h:49
std::shared_ptr< Camera > Ptr
Definition: camera.h:52
#define UFE_NS_DEF
Definition: ufe.h:35
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
virtual void horizontalAperture(float ha)
Definition: camera.h:144
virtual void focusDistance(float fd)
Definition: camera.h:282
virtual void horizontalApertureOffset(float hao)
Definition: camera.h:190
Path path(const std::string &pathString)
virtual void projection(Projection p)
Definition: camera.h:351
#define UFE_SDK_DECL
Definition: ufeExport.h:36