Browse Source

Shapes: completed documentation review.

pull/54/merge
Vladimír Vondruš 12 years ago
parent
commit
9256b704ce
  1. 8
      src/Magnum/Shapes/AbstractShape.h
  2. 1
      src/Magnum/Shapes/Collision.h
  3. 14
      src/Magnum/Shapes/Composition.h
  4. 2
      src/Magnum/Shapes/Line.h
  5. 2
      src/Magnum/Shapes/Shape.h

8
src/Magnum/Shapes/AbstractShape.h

@ -58,7 +58,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT AbstractShape: publi
Dimensions = dimensions /**< Dimension count */ Dimensions = dimensions /**< Dimension count */
}; };
/** @brief Shape type */ /** @brief %Shape type */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
enum class Type { enum class Type {
Point, /**< Point */ Point, /**< Point */
@ -83,14 +83,14 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT AbstractShape: publi
explicit AbstractShape(SceneGraph::AbstractObject<dimensions, Float>& object, ShapeGroup<dimensions>* group = nullptr); explicit AbstractShape(SceneGraph::AbstractObject<dimensions, Float>& object, ShapeGroup<dimensions>* group = nullptr);
/** /**
* @brief Shape group containing this shape * @brief %Shape group containing this shape
* *
* If the shape doesn't belong to any group, returns `nullptr`. * If the shape doesn't belong to any group, returns `nullptr`.
*/ */
ShapeGroup<dimensions>* group(); ShapeGroup<dimensions>* group();
const ShapeGroup<dimensions>* group() const; /**< @overload */ const ShapeGroup<dimensions>* group() const; /**< @overload */
/** @brief Shape type */ /** @brief %Shape type */
Type type() const; Type type() const;
/** /**
@ -101,7 +101,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT AbstractShape: publi
bool collides(const AbstractShape<dimensions>& other) const; bool collides(const AbstractShape<dimensions>& other) const;
/** /**
* @brief Collision with other shape * @brief %Collision with other shape
* *
* Default implementation returns empty collision. * Default implementation returns empty collision.
*/ */

1
src/Magnum/Shapes/Collision.h

@ -98,6 +98,7 @@ template<UnsignedInt dimensions> class Collision {
* @brief Separation distance * @brief Separation distance
* *
* @see @ref separationNormal(), operator bool() * @see @ref separationNormal(), operator bool()
* @todoc explicit reference when Doxygen can do it for operator bool
*/ */
Float separationDistance() const { Float separationDistance() const {
return _separationDistance; return _separationDistance;

14
src/Magnum/Shapes/Composition.h

@ -52,7 +52,7 @@ namespace Implementation {
} }
} }
/** @brief Shape operation */ /** @brief %Shape operation */
enum class CompositionOperation: UnsignedByte { enum class CompositionOperation: UnsignedByte {
Not, /**< Boolean NOT */ Not, /**< Boolean NOT */
And, /**< Boolean AND */ And, /**< Boolean AND */
@ -60,7 +60,7 @@ enum class CompositionOperation: UnsignedByte {
}; };
/** /**
@brief Composition of shapes @brief %Composition of shapes
Result of logical operations on shapes. See @ref shapes for brief introduction. Result of logical operations on shapes. See @ref shapes for brief introduction.
*/ */
@ -74,7 +74,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Composition {
Dimensions = dimensions /**< Dimension count */ Dimensions = dimensions /**< Dimension count */
}; };
/** @brief Shape type */ /** @brief %Shape type */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
enum class Type { enum class Type {
Point, /**< Point */ Point, /**< Point */
@ -137,10 +137,10 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Composition {
/** @brief Type of shape at given position */ /** @brief Type of shape at given position */
Type type(std::size_t i) const { return _shapes[i]->type(); } Type type(std::size_t i) const { return _shapes[i]->type(); }
/** @brief Shape at given position */ /** @brief %Shape at given position */
template<class T> const T& get(std::size_t i) const; template<class T> const T& get(std::size_t i) const;
/** @brief Collision with another shape */ /** @brief %Collision with another shape */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
template<class T> bool operator%(const T& other) const { template<class T> bool operator%(const T& other) const {
#else #else
@ -194,12 +194,12 @@ typedef Composition<2> Composition2D;
typedef Composition<3> Composition3D; typedef Composition<3> Composition3D;
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
/** @debugoperator{Magnum::Shapes::Composition} */ /** @debugoperatorclassenum{Magnum::Shapes::Composition,Magnum::Shapes::Composition::Type} */
template<UnsignedInt dimensions> Debug operator<<(Debug debug, typename Composition<dimensions>::Type value); template<UnsignedInt dimensions> Debug operator<<(Debug debug, typename Composition<dimensions>::Type value);
#endif #endif
/** @relates Composition /** @relates Composition
@brief Collision of shape with @ref Composition @brief %Collision occurence of shape with %Composition
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
template<UnsignedInt dimensions, class T> inline bool operator%(const T& a, const Composition<dimensions>& b) { template<UnsignedInt dimensions, class T> inline bool operator%(const T& a, const Composition<dimensions>& b) {

2
src/Magnum/Shapes/Line.h

@ -40,7 +40,7 @@ namespace Magnum { namespace Shapes {
See @ref shapes for brief introduction. See @ref shapes for brief introduction.
@see @ref Line2D, @ref Line3D @see @ref Line2D, @ref Line3D
@todo collision detection of two @ref Line2D @todo collision detection of two Line2D
*/ */
template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Line { template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Line {
public: public:

2
src/Magnum/Shapes/Shape.h

@ -73,7 +73,7 @@ template<class T> class Shape: public AbstractShape<T::Dimensions> {
/** /**
* @brief Constructor * @brief Constructor
* @param object Object holding this feature * @param object Object holding this feature
* @param shape Shape * @param shape %Shape
* @param group Group this shape belongs to * @param group Group this shape belongs to
*/ */
explicit Shape(SceneGraph::AbstractObject<T::Dimensions, Float>& object, const T& shape, ShapeGroup<T::Dimensions>* group = nullptr): AbstractShape<T::Dimensions>(object, group) { explicit Shape(SceneGraph::AbstractObject<T::Dimensions, Float>& object, const T& shape, ShapeGroup<T::Dimensions>* group = nullptr): AbstractShape<T::Dimensions>(object, group) {

Loading…
Cancel
Save