ufe 5.5
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/ECP/ufe/ufe-full-python3.11-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"
16#include "types.h"
17
18#include <memory>
19#include <array>
20
22{
23
25
50{
51public:
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);
79
87 static bool removeObserver(
88 const SceneItem::Ptr &item, const Observer::Ptr &obs);
89
90 typedef bool (*RemoveObserverItemType)(const SceneItem::Ptr &item, const Observer::Ptr& obs);
91
99 static bool removeObserver(
100 const Path &path, const Observer::Ptr &obs);
101
102 typedef bool (*RemoveObserverPathType)(const Path& path, const Observer::Ptr& obs);
103
109 static std::size_t nbObservers(const SceneItem::Ptr &item);
110
118 static bool hasObserver(
119 const SceneItem::Ptr &item, const Observer::Ptr &obs);
120
123 static bool hasObservers(const Path &path);
124
129 static bool hasObservers(Rtid runTimeId);
130
134 static void notify(const Path &path);
135
139 Camera(const Camera &) = default;
141 virtual ~Camera();
142
144 virtual const Path &path() const = 0;
145
147 virtual SceneItem::Ptr sceneItem() const = 0;
148
154 float ha) = 0;
155
159 virtual void horizontalAperture(float ha)
160 {
161 auto cmd = horizontalApertureCmd(ha);
162 if (cmd)
163 {
164 cmd->execute();
165 }
166 }
167
170 virtual float horizontalAperture() const = 0;
171
177 float va) = 0;
178
182 virtual void verticalAperture(float va)
183 {
184 auto cmd = verticalApertureCmd(va);
185 if (cmd)
186 {
187 cmd->execute();
188 }
189 }
190
193 virtual float verticalAperture() const = 0;
194
200 float hao) = 0;
201
205 virtual void horizontalApertureOffset(float hao)
206 {
207 auto cmd = horizontalApertureOffsetCmd(hao);
208 if (cmd)
209 {
210 cmd->execute();
211 }
212 }
213
216 virtual float horizontalApertureOffset() const = 0;
217
223 float vao) = 0;
224
228 virtual void verticalApertureOffset(float vao)
229 {
230 auto cmd = verticalApertureOffsetCmd(vao);
231 if (cmd)
232 {
233 cmd->execute();
234 }
235 }
236
239 virtual float verticalApertureOffset() const = 0;
240
246 float fs) = 0;
247
251 virtual void fStop(float fs)
252 {
253 auto cmd = fStopCmd(fs);
254 if (cmd)
255 {
256 cmd->execute();
257 }
258 }
259
262 virtual float fStop() const = 0;
263
269 float fl) = 0;
270
274 virtual void focalLength(float fl)
275 {
276 auto cmd = focalLengthCmd(fl);
277 if (cmd)
278 {
279 cmd->execute();
280 }
281 }
282
285 virtual float focalLength() const = 0;
286
292 float fd) = 0;
293
297 virtual void focusDistance(float fd)
298 {
299 auto cmd = focusDistanceCmd(fd);
300 if (cmd)
301 {
302 cmd->execute();
303 }
304 }
305
308 virtual float focusDistance() const = 0;
309
315 float ncp) = 0;
316
320 virtual void nearClipPlane(float ncp)
321 {
322 auto cmd = nearClipPlaneCmd(ncp);
323 if (cmd)
324 {
325 cmd->execute();
326 }
327 }
328
331 virtual float nearClipPlane() const = 0;
332
338 float fcp) = 0;
339
343 virtual void farClipPlane(float fcp)
344 {
345 auto cmd = farClipPlaneCmd(fcp);
346 if (cmd)
347 {
348 cmd->execute();
349 }
350 }
351
354 virtual float farClipPlane() const = 0;
355
361 Projection p) = 0;
362
366 virtual void projection(Projection p)
367 {
368 auto cmd = projectionCmd(p);
369 if (cmd)
370 {
371 cmd->execute();
372 }
373 }
374
377 virtual Projection projection() const = 0;
378};
379
380}
381
382#endif /* _camera */
Abstract base class for camera interface.
Definition: camera.h:50
virtual void focalLength(float fl)
Definition: camera.h:274
static void notify(const Path &path)
@ Perspective
Definition: camera.h:56
virtual float verticalAperture() const =0
virtual float focalLength() const =0
virtual Projection projection() const =0
virtual void focusDistance(float fd)
Definition: camera.h:297
virtual VerticalApertureUndoableCommand::Ptr verticalApertureCmd(float va)=0
virtual void verticalApertureOffset(float vao)
Definition: camera.h:228
std::shared_ptr< Camera > Ptr
Definition: camera.h:52
Camera()
Constructor.
static Ptr camera(const SceneItem::Ptr &item)
virtual HorizontalApertureUndoableCommand::Ptr horizontalApertureCmd(float ha)=0
virtual float verticalApertureOffset() const =0
virtual void farClipPlane(float fcp)
Definition: camera.h:343
static std::size_t nbObservers(const SceneItem::Ptr &item)
virtual float nearClipPlane() const =0
static bool hasObservers(const Path &path)
Camera(const Camera &)=default
Default copy constructor.
virtual float focusDistance() const =0
virtual float horizontalApertureOffset() const =0
virtual void projection(Projection p)
Definition: camera.h:366
virtual void nearClipPlane(float ncp)
Definition: camera.h:320
static bool removeObserver(const Path &path, const Observer::Ptr &obs)
virtual SceneItem::Ptr sceneItem() const =0
virtual float fStop() const =0
virtual const Path & path() const =0
virtual FStopUndoableCommand::Ptr fStopCmd(float fs)=0
virtual FocalLengthUndoableCommand::Ptr focalLengthCmd(float fl)=0
static bool addObserver(const SceneItem::Ptr &item, const Observer::Ptr &obs)
virtual FarClipPlaneUndoableCommand::Ptr farClipPlaneCmd(float fcp)=0
virtual void horizontalAperture(float ha)
Definition: camera.h:159
virtual HorizontalApertureOffsetUndoableCommand::Ptr horizontalApertureOffsetCmd(float hao)=0
virtual float horizontalAperture() const =0
virtual void verticalAperture(float va)
Definition: camera.h:182
virtual NearClipPlaneUndoableCommand::Ptr nearClipPlaneCmd(float ncp)=0
virtual FocusDistanceUndoableCommand::Ptr focusDistanceCmd(float fd)=0
virtual void fStop(float fs)
Definition: camera.h:251
static bool hasObservers(Rtid runTimeId)
static bool removeObserver(const SceneItem::Ptr &item, const Observer::Ptr &obs)
virtual ~Camera()
Destructor.
virtual ProjectionUndoableCommand::Ptr projectionCmd(Projection p)=0
virtual void horizontalApertureOffset(float hao)
Definition: camera.h:205
virtual VerticalApertureOffsetUndoableCommand::Ptr verticalApertureOffsetCmd(float vao)=0
virtual float farClipPlane() const =0
static bool hasObserver(const SceneItem::Ptr &item, const Observer::Ptr &obs)
std::shared_ptr< Observer > Ptr
Definition: observer.h:36
Identify an object or 3D path in the scene.
Definition: path.h:38
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
std::shared_ptr< SetValueUndoableCommand > Ptr
Path path(const std::string &pathString)
uint32_t Rtid
Definition: rtid.h:26
#define UFE_NS_DEF
Definition: ufe.h:35
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:36