<commit_before>/*
 *  Copyright (C) 2010 - 2015 <NAME>
 *
 *  Chair of Medical Engineering (mediTEC)
 *  RWTH Aachen University
 *  Pauwelsstr. 20
 *  52074 Aachen
 *  Germany
 *
 */

#ifndef VIEWPORT_H_6014714286
#define VIEWPORT_H_6014714286

#include <Carna/Carna.h>
#include <Carna/base/noncopyable.h>

/** \file   Viewport.h
  * \brief  Defines \ref Carna::base::Viewport.
  */

namespace Carna
{

namespace base
{



// ----------------------------------------------------------------------------------
// Viewport
// ----------------------------------------------------------------------------------

class CARNA_LIB Viewport
{

    NON_COPYABLE

    const Viewport* parent;

    mutable bool isDone;

public:

    Viewport( const FrameRenderer& fr, bool fitSquare );
    
    Viewport( const Viewport& parent, unsigned int left, unsigned int top, unsigned int width, unsigned int height );

    Viewport( const Viewport& parent, float width, float height, float left, float top );

    ~Viewport();

    unsigned int left;

    unsigned int top;

    unsigned int width;

    unsigned int height;

    void makeActive() const;

    void done() const;

}; // Viewport



}  // namespace Carna :: base

}  // namespace Carna

#endif // VIEWPORT_H_6014714286<commit_msg>Started documentation of Viewport class.<commit_after>/*
 *  Copyright (C) 2010 - 2015 <NAME>
 *
 *  Chair of Medical Engineering (mediTEC)
 *  RWTH Aachen University
 *  Pauwelsstr. 20
 *  52074 Aachen
 *  Germany
 *
 */

#ifndef VIEWPORT_H_6014714286
#define VIEWPORT_H_6014714286

#include <Carna/Carna.h>
#include <Carna/base/noncopyable.h>

/** \file   Viewport.h
  * \brief  Defines \ref Carna::base::Viewport.
  */

namespace Carna
{

namespace base
{



// ----------------------------------------------------------------------------------
// Viewport
// ----------------------------------------------------------------------------------

/** \brief
  * Defines a \ref WindowCoordinates "rendering viewport". The viewport is a property
  * of the \ref GLContext "current OpenGL context".
  *
  * \author <NAME>
  * \date   22.2.15 - 19.3.15
  */
class CARNA_LIB Viewport
{

    NON_COPYABLE

    const Viewport* parent;

    mutable bool isDone;

public:

    /** \brief
      * Creates root viewport. For internal usage only.
      */
    Viewport( const FrameRenderer& fr, bool fitSquare );
    
    /** \brief
      * Derives viewport from \a parent.
      */
    Viewport( const Viewport& parent, unsigned int left, unsigned int top, unsigned int width, unsigned int height );

    /** \brief
      * Derives viewport from \a parent. The arguments must be given relatively.
      *
      * \todo finish this
      */
    Viewport( const Viewport& parent, float width, float height, float left, float top );

    /** \brief
      * Restores the parent viewport if this viewport is still active.
      */
    ~Viewport();

    unsigned int left;

    unsigned int top;

    unsigned int width;

    unsigned int height;

    /** Makes this viewport the active one of the
      * \ref GLContext "current OpenGL context".
      */
    void makeActive() const;

    /** \brief
      * Restores the parent viewport.
      */
    void done() const;

}; // Viewport



}  // namespace Carna :: base

}  // namespace Carna

#endif // VIEWPORT_H_6014714286
{'fraction_non_alphanumeric': 0.1926192619261926, 'fraction_numerical': 0.030003000300030003, 'mean_word_length': 1.8520102651839179, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1336400', 'n_tokens_mistral': 1074, 'n_tokens_neox': 971, 'n_words': 305}