Commit 395745ca authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/improve-docu-magnitude' into 'master'

Feature/improve docu magnitude

See merge request DennisGlaeser/frackit!5
parents 94889770 8425e34f
......@@ -106,6 +106,8 @@ public:
ctype height() const { return height_; }
//! Return the radius of the cylinder
ctype radius() const { return bottom_.radius(); }
//! Return the area of this surface
ctype area() { return 2.0*M_PI*radius()*height(); }
//! Return the circle describing the top boundary of this surface
const Circle& upperBoundingCircle() const { return top_; }
......
......@@ -4,4 +4,4 @@ containedmagnitude.hh
length.hh
magnitude.hh
volume.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/frackit/geometry)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/frackit/magnitude)
......@@ -19,7 +19,7 @@
/*!
* \file
* \brief Contains functionality for computing the
* area of two-dimensional geometries.
* areas of two-dimensional geometries.
*/
#ifndef FRACKIT_MAGNITUDE_AREA_HH
#define FRACKIT_MAGNITUDE_AREA_HH
......@@ -31,23 +31,26 @@
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <frackit/geometry/disk.hh>
#include <frackit/geometry/cylindersurface.hh>
#include <frackit/precision/precision.hh>
namespace Frackit {
//! \todo TODO doc me.
/*!
* \brief Returns the area of an internal geometry
* that has an area() function available.
*/
template<class Geometry>
typename Geometry::ctype computeArea(const Geometry& geometry)
{ return geometry.area(); }
//! \todo TODO doc me.
template<class ctype>
ctype computeArea(const CylinderSurface<ctype>& cylSurface)
{ return 2.0*M_PI*cylSurface.radius()*cylSurface.height(); }
//! \todo TODO doc me.
/*!
* \brief Returns the area of a TopoDS_Face.
* \param face The face
* \param eps Tolerance value to be used
* \param loc A location; defaults to the origin, however,
* higher precision is achieved if a point close
* to the actual face is chosen.
*/
template<class ctype = double>
ctype computeArea(const TopoDS_Face& face,
ctype eps = Precision<ctype>::confusion(),
......
......@@ -19,7 +19,7 @@
/*!
* \file
* \brief Contains functionality for computing the
* length of one-dimensional geometries.
* lengths of one-dimensional geometries.
*/
#ifndef FRACKIT_MAGNITUDE_LENGTH_HH
#define FRACKIT_MAGNITUDE_LENGTH_HH
......@@ -38,8 +38,6 @@
#include <frackit/geometry/circle.hh>
#include <frackit/geometry/ellipse.hh>
#include <frackit/geometry/ellipsearc.hh>
#include <frackit/geometry/segment.hh>
#include <frackit/geometry/vector.hh>
namespace Frackit {
......@@ -71,13 +69,6 @@ template<class ctype = double>
ctype computeLength(const TopoDS_Edge& edge)
{ return computeLength(OCCUtilities::getGeomHandle(edge)); }
/*!
* \brief Returns the length of a vector
*/
template<class ctype, int worldDim>
ctype computeLength(const Vector<ctype, worldDim>& vec)
{ return vec.length(); }
/*!
* \brief Returns the length of a circle (circumference).
*/
......
......@@ -74,6 +74,11 @@ ctype computeMagnitude(const TopoDS_Edge& edge)
/*!
* \brief Returns the area of a BRep face
* \param face The face
* \param eps Tolerance value to be used
* \param loc A location; defaults to the origin, however,
* higher precision is achieved if a point close
* to the actual face is chosen.
*/
template<class ctype = double>
ctype computeMagnitude(const TopoDS_Face& face,
......@@ -82,7 +87,12 @@ ctype computeMagnitude(const TopoDS_Face& face,
{ return computeArea(face, eps, loc); }
/*!
* \brief Returns the area of a BRep solid
* \brief Returns the volume of a BRep solid
* \param solid The solid
* \param eps Tolerance value to be used
* \param loc A location; defaults to the origin, however,
* higher precision is achieved if a point close
* to the actual solid is chosen.
*/
template<class ctype = double>
ctype computeMagnitude(const TopoDS_Solid& solid,
......
......@@ -31,11 +31,18 @@
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <frackit/geometry/cylinder.hh>
#include <frackit/precision/precision.hh>
namespace Frackit {
//! \todo TODO doc me.
/*!
* \brief Returns the volume of a TopoDS_Solid.
* \param solid The solid
* \param eps Tolerance value to be used
* \param loc A location; defaults to the origin, however,
* higher precision is achieved if a point close
* to the actual solid is chosen.
*/
template<class ctype = double>
ctype computeVolume(const TopoDS_Solid& solid,
ctype eps = Precision<ctype>::confusion(),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment