Skip to content

Commit

Permalink
misc cleanup (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren authored Oct 23, 2024
1 parent 65c8725 commit 35dd525
Show file tree
Hide file tree
Showing 29 changed files with 24 additions and 44 deletions.
1 change: 0 additions & 1 deletion include/threepp/core/EventDispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef THREEPP_EVENTDISPATCHER_HPP
#define THREEPP_EVENTDISPATCHER_HPP

#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion include/threepp/core/InterleavedBufferAttribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "threepp/core/BufferAttribute.hpp"
#include "threepp/core/InterleavedBuffer.hpp"
#include "threepp/math/Matrix4.hpp"

namespace threepp {

Expand Down
1 change: 0 additions & 1 deletion include/threepp/core/Raycaster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "threepp/math/Vector2.hpp"

#include <limits>
#include <memory>
#include <vector>

namespace threepp {
Expand Down
1 change: 0 additions & 1 deletion include/threepp/extras/ShapeUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "threepp/math/Vector2.hpp"

#include <algorithm>
#include <vector>

namespace threepp::shapeutils {
Expand Down
2 changes: 0 additions & 2 deletions include/threepp/extras/core/Path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include "threepp/extras/core/CurvePath.hpp"

#include <optional>

namespace threepp {

class Path: public CurvePath<Vector2> {
Expand Down
1 change: 0 additions & 1 deletion include/threepp/extras/curves/CubicBezierCurve3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "threepp/extras/core/Curve.hpp"


namespace threepp {

class CubicBezierCurve3: public Curve3 {
Expand Down
1 change: 0 additions & 1 deletion include/threepp/geometries/BoxGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "threepp/core/BufferGeometry.hpp"


namespace threepp {

class BoxGeometry: public BufferGeometry {
Expand Down
2 changes: 1 addition & 1 deletion include/threepp/geometries/EdgesGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef THREEPP_EDGESGEOMETRY_HPP
#define THREEPP_EDGESGEOMETRY_HPP

#include <threepp/core/BufferGeometry.hpp>
#include "threepp/core/BufferGeometry.hpp"

namespace threepp {

Expand Down
1 change: 0 additions & 1 deletion include/threepp/geometries/ExtrudeGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "threepp/core/BufferGeometry.hpp"
#include "threepp/extras/core/Curve.hpp"


namespace threepp {

class Shape;
Expand Down
1 change: 0 additions & 1 deletion include/threepp/helpers/SkeletonHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "threepp/objects/LineSegments.hpp"
#include "threepp/objects/Skeleton.hpp"


namespace threepp {

class SkeletonHelper: public LineSegments {
Expand Down
5 changes: 0 additions & 5 deletions include/threepp/materials/MeshBasicMaterial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
#include "threepp/materials/Material.hpp"
#include "threepp/materials/interfaces.hpp"

#include "threepp/math/Color.hpp"
#include "threepp/textures/Texture.hpp"

#include <optional>

namespace threepp {

class MeshBasicMaterial
Expand Down
2 changes: 0 additions & 2 deletions include/threepp/materials/interfaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#ifndef THREEPP_INTERFACES_HPP
#define THREEPP_INTERFACES_HPP

#include <utility>

#include "threepp/materials/Material.hpp"

#include "threepp/textures/Texture.hpp"
Expand Down
2 changes: 0 additions & 2 deletions include/threepp/math/Box3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "threepp/math/Vector3.hpp"
#include "threepp/math/infinity.hpp"

#include <vector>

namespace threepp {

class Triangle;
Expand Down
1 change: 0 additions & 1 deletion include/threepp/math/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#ifndef THREEPP_COLOR_HPP
#define THREEPP_COLOR_HPP

#include <cstdint>
#include <ostream>

namespace threepp {
Expand Down
1 change: 0 additions & 1 deletion include/threepp/math/Vector2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#define THREEPP_VECTOR2_HPP

#include <ostream>
#include <string>

namespace threepp {

Expand Down
2 changes: 1 addition & 1 deletion include/threepp/math/Vector3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ namespace threepp {

// Implementing get function template
template<std::size_t N>
inline auto get(const Vector3& p) {
auto get(const Vector3& p) {
if constexpr (N == 0) return p.x;
else if constexpr (N == 1)
return p.y;
Expand Down
11 changes: 7 additions & 4 deletions include/threepp/math/Vector4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ namespace threepp {

// Implementing get function template
template<std::size_t N>
inline auto get(const Vector4& p) {
auto get(const Vector4& p) {
if constexpr (N == 0) return p.x;
else if constexpr (N == 1) return p.y;
else if constexpr (N == 2) return p.z;
else if constexpr (N == 3) return p.w;
else if constexpr (N == 1)
return p.y;
else if constexpr (N == 2)
return p.z;
else if constexpr (N == 3)
return p.w;
}

}// namespace threepp
Expand Down
1 change: 0 additions & 1 deletion include/threepp/objects/LOD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "threepp/core/Object3D.hpp"

#include <utility>

namespace threepp {

Expand Down
1 change: 0 additions & 1 deletion include/threepp/objects/Line.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "threepp/objects/ObjectWithMaterials.hpp"

#include <memory>
#include <utility>
#include <vector>

namespace threepp {
Expand Down
1 change: 0 additions & 1 deletion include/threepp/objects/ObjectWithMaterials.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "threepp/core/Object3D.hpp"
#include "threepp/materials/Material.hpp"


#include <vector>

namespace threepp {
Expand Down
2 changes: 0 additions & 2 deletions include/threepp/objects/Reflector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#ifndef THREEPP_REFLECTOR_HPP
#define THREEPP_REFLECTOR_HPP

#include <utility>

#include "threepp/core/Shader.hpp"
#include "threepp/objects/Mesh.hpp"

Expand Down
2 changes: 0 additions & 2 deletions include/threepp/objects/Water.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#ifndef THREEPP_WATER_HPP
#define THREEPP_WATER_HPP

#include <utility>

#include "threepp/objects/Mesh.hpp"

namespace threepp {
Expand Down
2 changes: 1 addition & 1 deletion include/threepp/textures/Texture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "threepp/textures/Image.hpp"

#include <functional>
#include <memory>
#include <optional>

namespace threepp {
Expand Down
1 change: 0 additions & 1 deletion include/threepp/utils/TaskManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <memory>
#include <functional>


namespace threepp {

class TaskManager {
Expand Down
6 changes: 3 additions & 3 deletions src/threepp/canvas/Canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ struct Canvas::Impl {

static void drop_callback(GLFWwindow* w, int count, const char** paths) {

auto p = static_cast<Canvas::Impl*>(glfwGetWindowUserPointer(w));
auto p = static_cast<Impl*>(glfwGetWindowUserPointer(w));

std::vector<std::string> v;
for (int i = 0; i < count; ++i) {
Expand Down Expand Up @@ -510,10 +510,10 @@ Canvas::Parameters& Canvas::Parameters::resizable(bool flag) {

Canvas::Parameters& Canvas::Parameters::favicon(const std::filesystem::path& path) {

if (std::filesystem::exists(path)) {
if (exists(path)) {
favicon_ = path;
} else {
std::cerr << "Invalid favicon path: " << std::filesystem::absolute(path) << std::endl;
std::cerr << "Invalid favicon path: " << absolute(path) << std::endl;
}

return *this;
Expand Down
1 change: 1 addition & 0 deletions src/threepp/geometries/ShapeGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "threepp/extras/ShapeUtils.hpp"

#include <functional>
#include <algorithm>

using namespace threepp;

Expand Down
1 change: 1 addition & 0 deletions src/threepp/loaders/MTLLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "threepp/utils/StringUtils.hpp"

#include <fstream>
#include <functional>
#include <utility>

using namespace threepp;
Expand Down
12 changes: 7 additions & 5 deletions src/threepp/math/Triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "threepp/math/Triangle.hpp"

#include <cmath>
#include <string>

using namespace threepp;

Expand All @@ -20,6 +21,7 @@ const Vector3& Triangle::a() const {

return a_;
}

const Vector3& Triangle::b() const {

return b_;
Expand Down Expand Up @@ -128,27 +130,27 @@ void Triangle::getMidpoint(Vector3& target) {

void Triangle::getNormal(Vector3& target) {

return Triangle::getNormal(this->a_, this->b_, this->c_, target);
return getNormal(this->a_, this->b_, this->c_, target);
}

void Triangle::getBarycoord(Vector3& point, Vector3& target) {

return Triangle::getBarycoord(point, this->a_, this->b_, this->c_, target);
return getBarycoord(point, this->a_, this->b_, this->c_, target);
}

void Triangle::getUV(const Vector3& point, const Vector2& uv1, const Vector2& uv2, const Vector2& uv3, Vector2& target) {

return Triangle::getUV(point, this->a_, this->b_, this->c_, uv1, uv2, uv3, target);
return getUV(point, this->a_, this->b_, this->c_, uv1, uv2, uv3, target);
}

bool Triangle::containsPoint(const Vector3& point) {

return Triangle::containsPoint(point, this->a_, this->b_, this->c_);
return containsPoint(point, this->a_, this->b_, this->c_);
}

bool Triangle::isFrontFacing(const Vector3& direction) {

return Triangle::isFrontFacing(this->a_, this->b_, this->c_, direction);
return isFrontFacing(this->a_, this->b_, this->c_, direction);
}

void Triangle::closestPointToPoint(const Vector3& p, Vector3& target) {
Expand Down
2 changes: 2 additions & 0 deletions tests/core/EventDispatcher_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <catch2/catch_test_macros.hpp>

#include <functional>

using namespace threepp;

namespace {
Expand Down

0 comments on commit 35dd525

Please sign in to comment.