API Documentation
Loading...
Searching...
No Matches
VulkanBitflagObject.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Graphics
28File: VulkanBitflagObject
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "VulkanDefines.h"
35namespace NDEVR
36{
37 /**--------------------------------------------------------------------------------------------------
38 \brief Stores bools to be sent to both the Vertex and Fragment shaders in the Vulkan space
39 **/
41 {
61 : flag{ 0,0,0,0 }
62 {}
64 {
65 flag[0] = object.flag[0];
66 flag[1] = object.flag[1];
67 flag[2] = object.flag[2];
68 flag[3] = object.flag[3];
69 }
70 void set(const VertexProperty& property, bool value)
71 {
72 flag[0](cast<uint01>(property), value);
73 }
74 void setExtra(bool value)
75 {
76 flag[0](7, value);
77 }
78 void set(const ModelProperties& property, bool value)
79 {
80 flag[1](cast<uint01>(property), value);
81 }
82 [[nodiscard]] bool get(const ModelProperties& property) const
83 {
84 return flag[1][cast<uint01>(property)];
85 }
86 void setRenderProperty(RenderProperties property, bool value)
87 {
88 flag[2](cast<uint01>(property), value);
89 }
90 void setHasImage(uint01 type, bool has_image)
91 {
92 flag[3](type, has_image);
93 }
95 {
96 for (uint01 i = 0; i < 4; i++)
97 flag[i] = object.flag[i];
98 return *this;
99 }
100 bool operator==(const VulkanBitflagObject& object) const
101 {
102 return flag[0] == object.flag[0]
103 && flag[1] == object.flag[1]
104 && flag[2] == object.flag[2]
105 && flag[3] == object.flag[3];
106 }
107 bool operator!=(const VulkanBitflagObject& object) const
108 {
109 return flag[0] != object.flag[0]
110 || flag[1] != object.flag[1]
111 || flag[2] != object.flag[2]
112 || flag[3] != object.flag[3];
113 }
115 };
116
117}
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
Definition ACIColor.h:37
VertexProperty
Definition DesignObjectBase.h:52
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
Stores bools to be sent to both the Vertex and Fragment shaders in the Vulkan space.
Definition VulkanBitflagObject.h:41
bool operator==(const VulkanBitflagObject &object) const
Definition VulkanBitflagObject.h:100
BitFlag flag[4]
Definition VulkanBitflagObject.h:114
VulkanBitflagObject()
Definition VulkanBitflagObject.h:60
VulkanBitflagObject(const VulkanBitflagObject &object)
Definition VulkanBitflagObject.h:63
VulkanBitflagObject & operator=(const VulkanBitflagObject &object)
Definition VulkanBitflagObject.h:94
void setExtra(bool value)
Definition VulkanBitflagObject.h:74
void set(const VertexProperty &property, bool value)
Definition VulkanBitflagObject.h:70
bool operator!=(const VulkanBitflagObject &object) const
Definition VulkanBitflagObject.h:107
void set(const ModelProperties &property, bool value)
Definition VulkanBitflagObject.h:78
bool get(const ModelProperties &property) const
Definition VulkanBitflagObject.h:82
ModelProperties
Definition VulkanBitflagObject.h:43
@ e_3D_selected
Definition VulkanBitflagObject.h:44
@ e_scale_to_camera
Definition VulkanBitflagObject.h:48
@ e_orient_to_camera
Definition VulkanBitflagObject.h:46
@ e_3D_focussed
Definition VulkanBitflagObject.h:45
@ e_follow_camera
Definition VulkanBitflagObject.h:47
void setHasImage(uint01 type, bool has_image)
Definition VulkanBitflagObject.h:90
void setRenderProperty(RenderProperties property, bool value)
Definition VulkanBitflagObject.h:86
RenderProperties
Definition VulkanBitflagObject.h:51