BlankMat 0.1.0
Free open-source 3D texture creation application
Loading...
Searching...
No Matches
UIVec3 Class Reference

A vector3 that can be directly displayed and edited in the UI. More...

Inheritance diagram for UIVec3:
Collaboration diagram for UIVec3:

Public Member Functions

void Display () override
 Displays the variable as an editable field in the UI.
 
glm::vec3 operator+ (const glm::vec3 &other) const
 Adds the given value to this value.
 
glm::vec3 operator+ (const UIVec3 &other) const
 Adds the given value to this value.
 
glm::vec3 operator- (const glm::vec3 &other) const
 Subtracts the given value from this value.
 
glm::vec3 operator- (const UIVec3 &other) const
 Subtracts the given value from this value.
 
glm::vec3 operator* (float other) const
 Multiplies the given value with this value.
 
glm::vec3 operator* (const glm::vec3 &other) const
 Multiplies the given value with this value.
 
glm::vec3 operator* (const UIVec3 &other) const
 Multiplies the given value with this value.
 
 UIVec3 (const std::string &name="", const glm::vec3 &value=glm::vec3(0.0f), ActionStack *actionStack=nullptr, std::function< void()> callback=std::function< void()>(nullptr))
 Creates a new variable that can be displayed and updated directly in the UI.
 
- Public Member Functions inherited from IUIVariable< glm::vec3 >
bool Equals (const glm::vec3 &value) const
 Returns whether the value is equal to the given value.
 
glm::vec3 Get () const
 Returns the current value of this variable.
 
glm::vec3 * GetRef () const
 Returns a reference to the value stored in this variable. This is unsafe, but is necessary for Commands outside of the class to update the value.
 
 operator glm::vec3 ()
 Explicitly converts this variable to its internal value.
 
glm::vec3 & operator* ()
 Returns a reference to the value stored in this variable.
 
glm::vec3 * operator-> ()
 Returns a reference to the value stored in this variable.
 
std::string Name () const
 Returns the name of the variable.
 
void Set (const glm::vec3 &newValue)
 Sets the value of the variable to the new value only if it is different. Sends a Command to the action stack indicating the changed value.
 
void SetNoUpdate (const glm::vec3 &newValue)
 Sets the value of the variable to the new value without creating a command.
 

Additional Inherited Members

- Protected Attributes inherited from IUIVariable< glm::vec3 >
std::string mName
 Name of the variable.
 
glm::vec3 mValue
 Value of the variable.
 
ActionStackmActionStack
 Reference to the global action stack.
 
std::function< void()> mSetCallback
 Callback function that runs whenever set is modified.
 

Detailed Description

A vector3 that can be directly displayed and edited in the UI.

Constructor & Destructor Documentation

◆ UIVec3()

UIVec3::UIVec3 ( const std::string &  name = "",
const glm::vec3 &  value = glm::vec3(0.0f),
ActionStack actionStack = nullptr,
std::function< void()>  callback = std::function<void()>(nullptr) 
)
inlineexplicit

Creates a new variable that can be displayed and updated directly in the UI.

Parameters
nameName of the variable
valueValue to initialize the variable to
actionStackGlobal action stack
callbackCallback function to run when set

Member Function Documentation

◆ Display()

void UIVec3::Display ( )
inlineoverridevirtual

Displays the variable as an editable field in the UI.

Implements IUIVariable< glm::vec3 >.

◆ operator*() [1/3]

glm::vec3 UIVec3::operator* ( const glm::vec3 &  other) const
inline

Multiplies the given value with this value.

Parameters
otherValue to multiply
Returns
This * Other

◆ operator*() [2/3]

glm::vec3 UIVec3::operator* ( const UIVec3 other) const
inline

Multiplies the given value with this value.

Parameters
otherValue to multiply
Returns
This * Other

◆ operator*() [3/3]

glm::vec3 UIVec3::operator* ( float  other) const
inline

Multiplies the given value with this value.

Parameters
otherValue to multiply
Returns
This * Other

◆ operator+() [1/2]

glm::vec3 UIVec3::operator+ ( const glm::vec3 &  other) const
inline

Adds the given value to this value.

Parameters
otherValue to add
Returns
This + Other

◆ operator+() [2/2]

glm::vec3 UIVec3::operator+ ( const UIVec3 other) const
inline

Adds the given value to this value.

Parameters
otherValue to add
Returns
This + Other

◆ operator-() [1/2]

glm::vec3 UIVec3::operator- ( const glm::vec3 &  other) const
inline

Subtracts the given value from this value.

Parameters
otherValue to subtract
Returns
This - Other

◆ operator-() [2/2]

glm::vec3 UIVec3::operator- ( const UIVec3 other) const
inline

Subtracts the given value from this value.

Parameters
otherValue to subtract
Returns
This - Other