Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
1f303325
Commit
1f303325
authored
3 years ago
by
Vanessa Karolek
Browse files
Options
Downloads
Patches
Plain Diff
[
#42
] add throwing exception if input index is invalid
parent
deb50349
No related branches found
No related tags found
1 merge request
!35
Resolve "Kamera - Trackballkamera"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/camera/src/vkcv/camera/CameraManager.cpp
+12
-1
12 additions, 1 deletion
modules/camera/src/vkcv/camera/CameraManager.cpp
with
12 additions
and
1 deletion
modules/camera/src/vkcv/camera/CameraManager.cpp
+
12
−
1
View file @
1f303325
...
@@ -94,6 +94,9 @@ namespace vkcv{
...
@@ -94,6 +94,9 @@ namespace vkcv{
}
}
Camera
&
CameraManager
::
getCamera
(
uint32_t
cameraIndex
)
{
Camera
&
CameraManager
::
getCamera
(
uint32_t
cameraIndex
)
{
if
(
cameraIndex
<
0
||
cameraIndex
>
m_cameras
.
size
()
-
1
)
{
throw
std
::
runtime_error
(
"Invalid camera index."
);
}
return
m_cameras
[
cameraIndex
];
return
m_cameras
[
cameraIndex
];
}
}
...
@@ -101,8 +104,10 @@ namespace vkcv{
...
@@ -101,8 +104,10 @@ namespace vkcv{
return
m_cameras
[
getActiveCameraIndex
()];
return
m_cameras
[
getActiveCameraIndex
()];
}
}
void
CameraManager
::
setActiveCamera
(
uint32_t
cameraIndex
)
{
void
CameraManager
::
setActiveCamera
(
uint32_t
cameraIndex
)
{
if
(
cameraIndex
<
0
||
cameraIndex
>
m_cameras
.
size
()
-
1
)
{
throw
std
::
runtime_error
(
"Invalid camera index."
);
}
m_activeCameraIndex
=
cameraIndex
;
m_activeCameraIndex
=
cameraIndex
;
}
}
...
@@ -111,10 +116,16 @@ namespace vkcv{
...
@@ -111,10 +116,16 @@ namespace vkcv{
}
}
void
CameraManager
::
setControllerType
(
uint32_t
cameraIndex
,
ControllerType
controllerType
)
{
void
CameraManager
::
setControllerType
(
uint32_t
cameraIndex
,
ControllerType
controllerType
)
{
if
(
cameraIndex
<
0
||
cameraIndex
>
m_cameras
.
size
()
-
1
)
{
throw
std
::
runtime_error
(
"Invalid camera index."
);
}
m_cameraControllerTypes
[
cameraIndex
]
=
controllerType
;
m_cameraControllerTypes
[
cameraIndex
]
=
controllerType
;
}
}
ControllerType
CameraManager
::
getControllerType
(
uint32_t
cameraIndex
)
{
ControllerType
CameraManager
::
getControllerType
(
uint32_t
cameraIndex
)
{
if
(
cameraIndex
<
0
||
cameraIndex
>
m_cameras
.
size
()
-
1
)
{
throw
std
::
runtime_error
(
"Invalid camera index."
);
}
return
m_cameraControllerTypes
[
cameraIndex
];
return
m_cameraControllerTypes
[
cameraIndex
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment