Skip to content

Commit

Permalink
refactor: rename plural namespaces to singular for alignment (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishwa2710 authored Nov 27, 2023
1 parent 5086596 commit d1cf4a8
Show file tree
Hide file tree
Showing 47 changed files with 190 additions and 190 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Once the shell is up and running, playing with it is easy:
```py
import numpy
from ostk.mathematics.geometry import Angle
from ostk.mathematics.geometry.d3.transformations.rotations import Quaternion
from ostk.mathematics.geometry.d3.transformations.rotations import RotationVector
from ostk.mathematics.geometry.d3.transformation.rotation import Quaternion
from ostk.mathematics.geometry.d3.transformation.rotation import RotationVector

rv = RotationVector(numpy.array([[0.0], [0.0], [1.0]], dtype=float), Angle.degrees(15.0)) # Construct rotation vector

Expand Down
6 changes: 3 additions & 3 deletions bindings/python/docs/Reference/Geometry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"Sphere = mathematics.geometry.d3.objects.Sphere\n",
"Ellipsoid = mathematics.geometry.d3.objects.Ellipsoid\n",
"Transformation3d = mathematics.geometry.d3.Transformation\n",
"Quaternion = mathematics.geometry.d3.transformations.rotations.Quaternion\n",
"RotationVector = mathematics.geometry.d3.transformations.rotations.RotationVector\n",
"RotationMatrix = mathematics.geometry.d3.transformations.rotations.RotationMatrix"
"Quaternion = mathematics.geometry.d3.transformation.rotation.Quaternion\n",
"RotationVector = mathematics.geometry.d3.transformation.rotation.RotationVector\n",
"RotationMatrix = mathematics.geometry.d3.transformation.rotation.RotationMatrix"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Objects_Composite(pybind11
using ostk::math::geometry::d3::objects::Pyramid;
using ostk::math::geometry::d3::objects::Composite;
using ostk::math::geometry::d3::Intersection;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

class_<Composite, Object>(aModule, "Composite")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Objects_Cuboid(pybind11::m
using ostk::math::geometry::d3::objects::Cuboid;
using ostk::math::geometry::d3::objects::Pyramid;
using ostk::math::geometry::d3::Intersection;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

// scope in_Cuboid = class_<Cuboid, Shared<Cuboid>, bases<Object>>("Cuboid", no_init)
class_<Cuboid, Object>(aModule, "Cuboid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Objects_Ellipsoid(pybind11
using ostk::math::geometry::d3::objects::Pyramid;
using ostk::math::geometry::d3::objects::Cone;
using ostk::math::geometry::d3::Intersection;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

class_<Ellipsoid, Object>(aModule, "Ellipsoid")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Objects_Pyramid(pybind11::
using ostk::math::geometry::d3::objects::Ellipsoid;
using ostk::math::geometry::d3::objects::Pyramid;
using ostk::math::geometry::d3::Intersection;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

class_<Pyramid, Object>(aModule, "Pyramid")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformation(pybind11::m
using ostk::math::object::Matrix4d;
using ostk::math::geometry::d3::objects::Point;
using ostk::math::geometry::d3::Transformation;
using ostk::math::geometry::d3::transformations::rotations::RotationVector;
using ostk::math::geometry::d3::transformations::rotations::RotationMatrix;
using ostk::math::geometry::d3::transformation::rotation::RotationVector;
using ostk::math::geometry::d3::transformation::rotation::RotationMatrix;

class_<Transformation> transformation(aModule, "Transformation");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations(pybind11::module& aModule)
{
// Create "transformations" python submodule
auto transformations = aModule.def_submodule("transformations");
// Create "transformation" python submodule
auto transformation = aModule.def_submodule("transformation");

// Add __path__ attribute for "transformations" submodule
transformations.attr("__path__") = "ostk.mathematics.geometry.d3.transformations";
// Add __path__ attribute for "transformation" submodule
transformation.attr("__path__") = "ostk.mathematics.geometry.d3.transformation";

// Add objects to python "transformations" submodules
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations(transformations);
// Add objects to python "transformation" submodules
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations(transformation);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations(pybind11::module& aModule)
{
// Create "rotations" python submodule
auto rotations = aModule.def_submodule("rotations");
// Create "rotation" python submodule
auto rotation = aModule.def_submodule("rotation");

// Add __path__ attribute for "rotations" submodule
rotations.attr("__path__") = "ostk.mathematics.geometry.d3.transformations.rotations";
// Add __path__ attribute for "rotation" submodule
rotation.attr("__path__") = "ostk.mathematics.geometry.d3.transformation.rotation";

// Add objects to python "rotations" submodules
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_Quaternion(rotations);
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_RotationVector(rotations);
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_RotationMatrix(rotations);
// Add objects to python "rotation" submodules
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_Quaternion(rotation);
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_RotationVector(rotation);
OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_RotationMatrix(rotation);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <OpenSpaceToolkit/Mathematics/Geometry/3D/Transformations/Rotations/RotationVector.hpp>

using ostk::core::ctnr::Array;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

void set_quaternion_array(const Array<Quaternion>& anArray)
{
Expand All @@ -21,7 +21,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_

using ostk::math::object::Vector3d;
using ostk::math::object::Vector4d;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

class_<Quaternion> quaternion(aModule, "Quaternion");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_

using ostk::math::object::Vector3d;
using ostk::math::object::Matrix3d;
using ostk::math::geometry::d3::transformations::rotations::RotationMatrix;
using ostk::math::geometry::d3::transformation::rotation::RotationMatrix;

class_<RotationMatrix>(aModule, "RotationMatrix")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Transformations_Rotations_

using ostk::math::object::Vector3d;
using ostk::math::geometry::Angle;
using ostk::math::geometry::d3::transformations::rotations::RotationVector;
using ostk::math::geometry::d3::transformation::rotation::RotationVector;

class_<RotationVector>(aModule, "RotationVector")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@


Angle = geometry.Angle
Quaternion = geometry.d3.transformations.rotations.Quaternion
RotationVector = geometry.d3.transformations.rotations.RotationVector
RotationMatrix = geometry.d3.transformations.rotations.RotationMatrix
Quaternion = geometry.d3.transformation.rotation.Quaternion
RotationVector = geometry.d3.transformation.rotation.RotationVector
RotationMatrix = geometry.d3.transformation.rotation.RotationMatrix


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


Angle = geometry.Angle
Quaternion = geometry.d3.transformations.rotations.Quaternion
RotationMatrix = geometry.d3.transformations.rotations.RotationMatrix
Quaternion = geometry.d3.transformation.rotation.Quaternion
RotationMatrix = geometry.d3.transformation.rotation.RotationMatrix


# isDefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


Angle = geometry.Angle
Quaternion = geometry.d3.transformations.rotations.Quaternion
RotationVector = geometry.d3.transformations.rotations.RotationVector
Quaternion = geometry.d3.transformation.rotation.Quaternion
RotationVector = geometry.d3.transformation.rotation.RotationVector


def test_geometry_d3_transformations_rotations_rotation_vector():
Expand Down
6 changes: 3 additions & 3 deletions bindings/python/test/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
Sphere = mathematics.geometry.d3.objects.Sphere
Ellipsoid = mathematics.geometry.d3.objects.Ellipsoid
Transformation3d = mathematics.geometry.d3.Transformation
Quaternion = mathematics.geometry.d3.transformations.rotations.Quaternion
RotationVector = mathematics.geometry.d3.transformations.rotations.RotationVector
RotationMatrix = mathematics.geometry.d3.transformations.rotations.RotationMatrix
Quaternion = mathematics.geometry.d3.transformation.rotation.Quaternion
RotationVector = mathematics.geometry.d3.transformation.rotation.RotationVector
RotationMatrix = mathematics.geometry.d3.transformation.rotation.RotationMatrix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using ostk::math::object::Matrix3d;
using ostk::math::geometry::d3::Object;
using ostk::math::geometry::d3::objects::Point;
using ostk::math::geometry::d3::Intersection;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;

#define DEFAULT_ORIENTATION Quaternion::Unit()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ using ostk::math::object::Matrix4d;
using ostk::math::geometry::Angle;
using ostk::math::geometry::d3::Object;
using ostk::math::geometry::d3::objects::Point;
using ostk::math::geometry::d3::transformations::rotations::RotationVector;
using ostk::math::geometry::d3::transformations::rotations::RotationMatrix;
using ostk::math::geometry::d3::transformation::rotation::RotationVector;
using ostk::math::geometry::d3::transformation::rotation::RotationMatrix;

class Transformation
{
Expand Down Expand Up @@ -77,7 +77,7 @@ class Transformation
/// @brief Returns true if transformation is rigid
///
/// A rigid transformation preserves the Euclidean distance between every pair of points.
/// The rigid transformations include rotations, translations, reflections, or their
/// The rigid transformation include rotation, translations, reflections, or their
/// combination.
///
/// @ref https://en.wikipedia.org/wiki/Rigid_transformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ namespace geometry
{
namespace d3
{
namespace transformations
namespace transformation
{
namespace rotations
namespace rotation
{

}
} // namespace transformations
} // namespace transformation
} // namespace d3
} // namespace geometry
} // namespace math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace geometry
{
namespace d3
{
namespace transformations
namespace transformation
{
namespace rotations
namespace rotation
{

using ostk::core::types::Integer;
Expand All @@ -36,7 +36,7 @@ class RotationMatrix;

/// @brief Quaternion
///
/// Provide a convenient mathematical notation for representing orientations and rotations
/// Provide a convenient mathematical notation for representing orientations and rotation
/// of objects in three dimensions. Compared to Euler angles they are simpler to compose and
/// avoid the problem of gimbal lock. Compared to rotation matrices they are more compact,
/// more numerically stable, and more efficient.
Expand Down Expand Up @@ -616,7 +616,7 @@ class Quaternion
/// @param [in] aRotationVector A rotation vector
/// @return Quaternion

static Quaternion RotationVector(const rotations::RotationVector& aRotationVector);
static Quaternion RotationVector(const rotation::RotationVector& aRotationVector);

/// @brief Constructs a rquaternion from a rotation matrix
///
Expand All @@ -627,7 +627,7 @@ class Quaternion
/// @param [in] aRotationMatrix A rotation matrix
/// @return Quaternion

static Quaternion RotationMatrix(const rotations::RotationMatrix& aRotationMatrix);
static Quaternion RotationMatrix(const rotation::RotationMatrix& aRotationMatrix);

/// @brief Constructs a quaternion from a string
///
Expand Down Expand Up @@ -713,8 +713,8 @@ class Quaternion
Real s_;
};

} // namespace rotations
} // namespace transformations
} // namespace rotation
} // namespace transformation
} // namespace d3
} // namespace geometry
} // namespace math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace geometry
{
namespace d3
{
namespace transformations
namespace transformation
{
namespace rotations
namespace rotation
{

using ostk::core::types::Index;
Expand Down Expand Up @@ -302,7 +302,7 @@ class RotationMatrix
/// @param [in] aQuaternion A quaternion
/// @return Rotation matrix

static RotationMatrix Quaternion(const rotations::Quaternion& aQuaternion);
static RotationMatrix Quaternion(const rotation::Quaternion& aQuaternion);

/// @brief Constructs a rotation matrix from a rotation vector
///
Expand All @@ -314,16 +314,16 @@ class RotationMatrix
/// @param [in] aRotationVector A rotation vector
/// @return Rotation matrix

static RotationMatrix RotationVector(const rotations::RotationVector& aRotationVector);
static RotationMatrix RotationVector(const rotation::RotationVector& aRotationVector);

private:
Matrix3d matrix_;

RotationMatrix();
};

} // namespace rotations
} // namespace transformations
} // namespace rotation
} // namespace transformation
} // namespace d3
} // namespace geometry
} // namespace math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace geometry
{
namespace d3
{
namespace transformations
namespace transformation
{
namespace rotations
namespace rotation
{

using ostk::core::types::Real;
Expand Down Expand Up @@ -178,7 +178,7 @@ class RotationVector
/// @param [in] aQuaternion A quaternion
/// @return Rotation vector

static RotationVector Quaternion(const rotations::Quaternion& aQuaternion);
static RotationVector Quaternion(const rotation::Quaternion& aQuaternion);

/// @brief Constructs a rotation vector from a rotation matrix
///
Expand All @@ -189,7 +189,7 @@ class RotationVector
/// @param [in] aRotationMatrix A rotation matrix
/// @return Rotation vector

static RotationVector RotationMatrix(const rotations::RotationMatrix& aRotationMatrix);
static RotationVector RotationMatrix(const rotation::RotationMatrix& aRotationMatrix);

private:
Vector3d axis_;
Expand All @@ -198,8 +198,8 @@ class RotationVector
RotationVector();
};

} // namespace rotations
} // namespace transformations
} // namespace rotation
} // namespace transformation
} // namespace d3
} // namespace geometry
} // namespace math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ void Composite::print(std::ostream& anOutputStream, bool displayDecorators) cons

void Composite::applyTransformation(const Transformation& aTransformation)
{
using ostk::math::geometry::d3::transformations::rotations::RotationMatrix;
using ostk::math::geometry::d3::transformation::rotation::RotationMatrix;

if (!aTransformation.isDefined())
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenSpaceToolkit/Mathematics/Geometry/3D/Objects/Cone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ Angle Cone::getAngle() const
Array<Ray> Cone::getRaysOfLateralSurface(const Size aRayCount) const
{
using ostk::math::object::Interval;
using ostk::math::geometry::d3::transformations::rotations::Quaternion;
using ostk::math::geometry::d3::transformations::rotations::RotationVector;
using ostk::math::geometry::d3::transformation::rotation::Quaternion;
using ostk::math::geometry::d3::transformation::rotation::RotationVector;

if (aRayCount == 0)
{
Expand Down
Loading

0 comments on commit d1cf4a8

Please sign in to comment.