sKit  0.0.9
BRect.cpp
Go to the documentation of this file.
1 #include "BRect.hpp"
2 
3 #include <cmath>
4 
5 namespace sKit {
6 namespace structure {
7 
8 auto BRect::getDimensions() -> Dimensions { return {x_, y_, width_, height_}; }
9 
10 auto BRect::getNumRows() -> unsigned int { return pow(2, levels / 2); };
11 
12 auto BRect::getNumCols() -> unsigned int {
13  unsigned int exp = (levels / 2) + (levels % 2);
14  return pow(2, exp);
15 };
16 
17 auto BRect::getId() -> glm::vec2 { return id; };
18 
19 auto BRect::setDimensions(float x, float y, float width, float height) -> void {
20  x_ = x;
21  y_ = y;
22  width_ = width;
23  height_ = height;
24 }
25 
26 auto BRect::setOrientation(Orientation orientation) -> void {
27  orientation_ = orientation;
28 };
29 
30 } // namespace structure
31 } // namespace sKit
sKit::structure::BRect::setOrientation
auto setOrientation(Orientation orientation) -> void
Definition: BRect.cpp:26
sKit::structure::BRect::getDimensions
auto getDimensions() -> Dimensions
Definition: BRect.cpp:8
sKit::structure::BRect::setDimensions
auto setDimensions(float x, float y, float width, float height) -> void
Definition: BRect.cpp:19
sKit::structure::BRect::getNumCols
auto getNumCols() -> unsigned int
Definition: BRect.cpp:12
sKit::structure::BRect::getId
auto getId() -> glm::vec2
Definition: BRect.cpp:17
BRect.hpp
sKit
Definition: camera.hpp:8
sKit::structure::BRect::getNumRows
auto getNumRows() -> unsigned int
Definition: BRect.cpp:10
sKit::structure::Dimensions
Definition: BRect.hpp:9