Browse Source

DebugTools: completed documentation review.

pull/54/merge
Vladimír Vondruš 12 years ago
parent
commit
e3d87fb00b
  1. 2
      src/Magnum/DebugTools/DebugTools.h
  2. 5
      src/Magnum/DebugTools/ForceRenderer.h
  3. 5
      src/Magnum/DebugTools/ObjectRenderer.h
  4. 24
      src/Magnum/DebugTools/Profiler.h
  5. 2
      src/Magnum/DebugTools/ResourceManager.h
  6. 10
      src/Magnum/DebugTools/ShapeRenderer.h

2
src/Magnum/DebugTools/DebugTools.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Forward declarations for Magnum::DebugTools namespace
* @brief Forward declarations for @ref Magnum::DebugTools namespace
*/
#include "Magnum/Types.h"

5
src/Magnum/DebugTools/ForceRenderer.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class Magnum::DebugTools::ForceRenderer, Magnum::DebugTools::ForceRendererOptions, typedef Magnum::DebugTools::ForceRenderer2D, Magnum::DebugTools::ForceRenderer3D
* @brief Class @ref Magnum::DebugTools::ForceRenderer, @ref Magnum::DebugTools::ForceRendererOptions, typedef @ref Magnum::DebugTools::ForceRenderer2D, @ref Magnum::DebugTools::ForceRenderer3D
*/
#include "Magnum/Color.h"
@ -122,10 +122,9 @@ template<UnsignedInt dimensions> class MAGNUM_DEBUGTOOLS_EXPORT ForceRenderer: p
/** @overload */
ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>&, const typename DimensionTraits<dimensions, Float>::VectorType&, typename DimensionTraits<dimensions, Float>::VectorType&&, ResourceKey = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* = nullptr) = delete;
protected:
private:
void draw(const typename DimensionTraits<dimensions, Float>::MatrixType& transformationMatrix, SceneGraph::AbstractCamera<dimensions, Float>& camera) override;
private:
const typename DimensionTraits<dimensions, Float>::VectorType forcePosition;
const typename DimensionTraits<dimensions, Float>::VectorType& force;

5
src/Magnum/DebugTools/ObjectRenderer.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class Magnum::DebugTools::ObjectRenderer, Magnum::DebugTools::ObjectRendererOptions, typedef Magnum::DebugTools::ObjectRenderer2D, Magnum::DebugTools::ObjectRenderer3D
* @brief Class @ref Magnum::DebugTools::ObjectRenderer, @ref Magnum::DebugTools::ObjectRendererOptions, typedef @ref Magnum::DebugTools::ObjectRenderer2D, @ref Magnum::DebugTools::ObjectRenderer3D
*/
#include "Magnum/Resource.h"
@ -97,10 +97,9 @@ template<UnsignedInt dimensions> class MAGNUM_DEBUGTOOLS_EXPORT ObjectRenderer:
*/
explicit ObjectRenderer(SceneGraph::AbstractObject<dimensions, Float>& object, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr);
protected:
private:
void draw(const typename DimensionTraits<dimensions, Float>::MatrixType& transformationMatrix, SceneGraph::AbstractCamera<dimensions, Float>& camera) override;
private:
Resource<ObjectRendererOptions> options;
Resource<AbstractShaderProgram, Shaders::VertexColor<dimensions>> shader;
Resource<Mesh> mesh;

24
src/Magnum/DebugTools/Profiler.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class Magnum::DebugTools::Profiler
* @brief Class @ref Magnum::DebugTools::Profiler
*/
#include <chrono>
@ -43,7 +43,7 @@ namespace Magnum { namespace DebugTools {
@brief %Profiler
Measures time passed during specified sections of each frame. It's meant to be
used in rendering and event loops (e.g. Platform::Sdl2Application::drawEvent()),
used in rendering and event loops (e.g. @ref Platform::Sdl2Application::drawEvent()),
but it's possible to use it standalone elsewhere. Example usage:
@code
DebugTools::Profiler p;
@ -94,7 +94,7 @@ p.printStatistics();
@endcode
It's possible to start profiler only for certain parts of the code and then
stop it again using stop(), if you are not interested in profiling the rest.
stop it again using @ref stop(), if you are not interested in profiling the rest.
@todo Some unit testing
@todo More time intervals
@ -104,14 +104,14 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
/**
* @brief Section ID
*
* @see otherSection, addSection(), start(Section)
* @see @ref otherSection, @ref addSection(), @ref start(Section)
*/
typedef UnsignedInt Section;
/**
* @brief Default section
*
* @see start()
* @see @ref start()
*/
static const Section otherSection = 0;
@ -130,15 +130,15 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
* @brief Add named section
*
* @attention This function cannot be called if profiling is enabled.
* @see otherSection, start(Section), stop()
* @see @ref otherSection, @ref start(Section), @ref stop()
*/
Section addSection(const std::string& name);
/**
* @brief Whether profiling is enabled
*
* If the profiling is not enabled, calls to start() and stop() have
* no effect.
* If the profiling is not enabled, calls to @ref start() and
* @ref stop() have no effect.
*/
bool isEnabled() { return enabled; }
@ -146,14 +146,14 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
* @brief Enable profiling
*
* Clears already mesaured data.
* @see disable(), isEnabled()
* @see @ref disable(), @ref isEnabled()
*/
void enable();
/**
* @brief Disable profiling
*
* @see enable(), isEnabled()
* @see @ref enable(), @ref isEnabled()
*/
void disable();
@ -162,14 +162,14 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
*
* If profiling is already running, current time is saved for previous
* section.
* @see @ref otherSection, start(Section)
* @see @ref otherSection, @ref start(Section)
*/
void start(Section section);
/**
* @brief Start profiling of "other" section
*
* Same as calling `start(Profiler::otherSection)`.
* Same as calling `start(DebugTools::Profiler::otherSection)`.
* @note Does nothing if profiling is disabled.
*/
void start() { start(otherSection); }

2
src/Magnum/DebugTools/ResourceManager.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class Magnum::DebugTools::ResourceManager
* @brief Class @ref Magnum::DebugTools::ResourceManager
*/
#ifndef MAGNUM_RESOURCEMANAGER_DEFINE_INTERNALINSTANCE

10
src/Magnum/DebugTools/ShapeRenderer.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class Magnum::DebugTools::ShapeRenderer, Magnum::DebugTools::ShapeRendererOptions, typedef Magnum::DebugTools::ShapeRenderer2D, Magnum::DebugTools::ShapeRenderer3D
* @brief Class @ref Magnum::DebugTools::ShapeRenderer, @ref Magnum::DebugTools::ShapeRendererOptions, typedef @ref Magnum::DebugTools::ShapeRenderer2D, @ref Magnum::DebugTools::ShapeRenderer3D
*/
#include "Magnum/Color.h"
@ -56,7 +56,7 @@ class ShapeRendererOptions {
/**
* @brief Shape rendering mode
*
* @see setRenderMode()
* @see @ref setRenderMode()
*/
enum class RenderMode: UnsignedByte {
Wireframe, /**< Wireframe rendering */
@ -138,7 +138,9 @@ new DebugTools::ShapeRenderer2D(shape, "red", debugDrawables);
@todo Different drawing style for inverted shapes? (marking the "inside" somehow)
*/
template<UnsignedInt dimensions> class MAGNUM_DEBUGTOOLS_EXPORT ShapeRenderer: public SceneGraph::Drawable<dimensions, Float> {
#ifndef DOXYGEN_GENERATING_OUTPUT
friend void Implementation::createDebugMesh<>(ShapeRenderer<dimensions>&, const Shapes::Implementation::AbstractShape<dimensions>&);
#endif
public:
/**
@ -157,11 +159,9 @@ template<UnsignedInt dimensions> class MAGNUM_DEBUGTOOLS_EXPORT ShapeRenderer: p
~ShapeRenderer();
protected:
/** @todoc Remove Float when Doxygen properly treats this as override */
private:
void draw(const typename DimensionTraits<dimensions, Float>::MatrixType& transformationMatrix, SceneGraph::AbstractCamera<dimensions, Float>& camera) override;
private:
Resource<ShapeRendererOptions> options;
std::vector<Implementation::AbstractShapeRenderer<dimensions>*> renderers;
};

Loading…
Cancel
Save