NDEVR
API Documentation
ViewportAutoZoomFocus.h
1#pragma once
2#include <NDEVR/AutoZoomFocus.h>
3#include <NDEVR/TimeSpan.h>
4#include <NDEVR/UUID.h>
5#include <NDEVR/Buffer.h>
6#include <NDEVR/Bounds.h>
7#include <NDEVR/Angle.h>
8namespace NDEVR
9{
14 {
19
24 AutoZoomFocus(const UUID& model)
25 : targets({ model })
26 {};
27
33 : targets(models)
34 {};
35
41 : snap(focus)
42 {};
43
50 : targets(models)
51 , snap(focus)
52 {};
53
59 AutoZoomFocus(SnapLocation focus, const UUID& model)
60 : targets({ model })
61 , snap(focus)
62 {};
63
77
86 bool operator==(const AutoZoomFocus& layout) const
87 {
88 if (layout.targets != targets)
89 return false;
90 if (memcmp(&layout.bounds, &bounds, sizeof(Bounds<3, fltp08>)) != 0)
91 return false;
92 if (layout.angle_offsets != angle_offsets)
93 return false;
95 return false;
97 return false;
98 if (layout.snap != snap)
99 return false;
101 return false;
102 if (layout.lag_time != lag_time)
103 return false;
104 if (layout.grip_tolerance != grip_tolerance)
105 return false;
107 return false;
108 return true;
109 }
110
116 bool operator!=(const AutoZoomFocus& layout) const
117 {
118 return !(layout == *this);
119 }
120
132 bool use_true_extents = true;
133 bool clear_animations = true;
137 };
138}
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Definition Angle.h:83
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
@ DEGREES
Angle measured in degrees (0 to 360 for a full circle).
Definition Angle.h:58
SnapLocation
A list of directions that a view can be pointed relative to an object or scene.
@ e_no_snap
No snap applied; free camera orientation.
AutoZoomFocus(const UUID &model)
Constructs an AutoZoomFocus that targets a single model.
Vector< 3, Angle< fltp08 > > angle_offsets
Angular offsets applied to the camera orientation relative to the snap direction.
bool override_default_snap
Whether to override the viewport's default snap location with this one.
bool use_true_extents
Whether to use precise object extents rather than approximate bounding volumes.
AutoZoomFocus(SnapLocation focus, const UUID &model)
Constructs an AutoZoomFocus with a snap location targeting a single model.
bool override_camera_lock_invisible
Whether this zoom focus overrides camera lock when the target is not visible.
Vector< 3, fltp08 > transformed_offsets
Positional offsets applied in the camera's local (transformed) coordinate space.
bool clear_animations
Whether to clear any existing camera animations when applying this zoom focus.
fltp08 bounds_edge_tolerance_mult
Multiplier for edge tolerance on bounds changes, helping prevent camera jitter.
AutoZoomFocus(SnapLocation focus)
Constructs an AutoZoomFocus with a specific snap location and no targets.
bool operator!=(const AutoZoomFocus &layout) const
Checks inequality between two AutoZoomFocus instances.
AutoZoomFocus()
Default constructor.
TimeSpan lag_time
Duration over which the camera animates to the target focus position.
fltp08 zoom_bounds_expansion
Amount to expand the computed zoom bounds, adding padding around focused objects.
bool operator==(const AutoZoomFocus &layout) const
Checks equality between two AutoZoomFocus instances by comparing all members.
Buffer< UUID > targets
The UUIDs of the design objects to keep in focus.
AutoZoomFocus(const Buffer< UUID > &models)
Constructs an AutoZoomFocus that targets multiple models.
void clear()
Resets all members to their default state, clearing targets, bounds, offsets, and snap.
fltp08 bounds_center_tolerance
Tolerance for bounds center movement before triggering a camera update, helping prevent jitter.
AutoZoomFocus(SnapLocation focus, const Buffer< UUID > &models)
Constructs an AutoZoomFocus with a snap location targeting multiple models.
bool override_camera_lock_visible
Whether this zoom focus overrides camera lock when the target is visible.
Angle< fltp08 > grip_tolerance
Minimum angular change required before updating the camera, helping prevent jitter.
SnapLocation snap
The directional snap location for the camera view orientation.
Bounds< 3, fltp08 > bounds
Optional explicit 3D bounds to zoom to. Invalid means bounds are computed from targets.
Vector< 3, fltp08 > worldspace_offsets
Positional offsets applied in world-space coordinates.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...