Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) TestDrawCanvas

 

TestDrawCanvas is a tool to test the DrawCanvas class.

 

 

 

 

 

Downloads

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestDrawCanvas/ToolTestDrawCanvasConsole.pro

 

include(../../ConsoleApplication.pri)

include(../../Libraries/Boost.pri)

include(../../Classes/CppAbout/CppAbout.pri)
include(../../Classes/CppFileIo/CppFileIo.pri)
include(../../Classes/CppHelp/CppHelp.pri)
include(../../Classes/CppMenuDialog/CppMenuDialog.pri)
include(../../Classes/CppRichelBilderbeekProgram/CppRichelBilderbeekProgram.pri)
include(../../Classes/CppTrace/CppTrace.pri)

#Specific
include(../../Tools/ToolTestDrawCanvas/ToolTestDrawCanvasConsole.pri)
include(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppDrawCanvas/CppDrawCanvas.pri)
include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppXml/CppXml.pri)

SOURCES += main.cpp

 

 

 

 

 

Qt project file: ./ToolTestDrawCanvas/ToolTestDrawCanvasDesktop.pro

 

include(../../DesktopApplication.pri)
include(../../Libraries/Boost.pri)
include(../../Libraries/GeneralConsole.pri)
include(../../Libraries/GeneralDesktop.pri)

include(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppDrawCanvas/CppDrawCanvas.pri)
include(../../Classes/CppGeometry/CppGeometry.pri)
include(../../Classes/CppPlane/CppPlane.pri)
include(../../Classes/CppQtSurfacePlotWidget/CppQtSurfacePlotWidget.pri)
include(../../Classes/CppXml/CppXml.pri)

include(../../Classes/CppQtCanvas/CppQtCanvas.pri)
include(../../Tools/ToolTestDrawCanvas/ToolTestDrawCanvasDesktop.pri)

SOURCES += qtmain.cpp

 

 

 

 

 

./ToolTestDrawCanvas/ToolTestDrawCanvasConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestDrawCanvas

SOURCES += \
    ../../Tools/ToolTestDrawCanvas/testdrawcanvasmenudialog.cpp

HEADERS += \
    ../../Tools/ToolTestDrawCanvas/testdrawcanvasmenudialog.h

OTHER_FILES += \
    ../../Tools/ToolTestDrawCanvas/Licence.txt

 

 

 

 

 

./ToolTestDrawCanvas/ToolTestDrawCanvasDesktop.pri

 

include(../../Tools/ToolTestDrawCanvas/ToolTestDrawCanvasConsole.pri)

RESOURCES += \
    ../../Tools/ToolTestDrawCanvas/ToolTestDrawCanvas.qrc

FORMS += \
    ../../Tools/ToolTestDrawCanvas/qttestdrawcanvasmenudialog.ui \
    ../../Tools/ToolTestDrawCanvas/qttestdrawcanvasmaindialog.ui

SOURCES += \
    ../../Tools/ToolTestDrawCanvas/qttestdrawcanvasmenudialog.cpp \
    ../../Tools/ToolTestDrawCanvas/qttestdrawcanvasmaindialog.cpp

HEADERS += \
    ../../Tools/ToolTestDrawCanvas/qttestdrawcanvasmenudialog.h \
    ../../Tools/ToolTestDrawCanvas/qttestdrawcanvasmaindialog.h

 

 

 

 

 

./ToolTestDrawCanvas/ToolTestDrawCanvasWebsite.pri

 

include(../../Tools/ToolTestDrawCanvas/ToolTestDrawCanvasConsole.pri)

SOURCES +=

HEADERS +=

 

 

 

 

 

./ToolTestDrawCanvas/main.cpp

 

#include "testdrawcanvasmenudialog.h"
#include "trace.h"
#include "xml.h"

int main(int argc, char* argv[])
{
  START_TRACE();
  ribi::xml::Test();
  const std::vector<std::string> args { ribi::MenuDialog::ConvertArguments(argc,argv) };
  return ribi::TestDrawCanvasMenuDialog().Execute(args);
}

 

 

 

 

 

./ToolTestDrawCanvas/qtmain.cpp

 

//---------------------------------------------------------------------------
/*
ToolTestCanvas, tests the Canvas class
Copyright (C) 2013  Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestCanvas.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <QApplication>

#include "qttestdrawcanvasmenudialog.h"
#include "trace.h"
#pragma GCC diagnostic pop

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  START_TRACE();
  ribi::QtTestDrawCanvasMenuDialog d;
  d.show();
  return a.exec();
}

 

 

 

 

 

./ToolTestDrawCanvas/qttestdrawcanvasmaindialog.h

 

#ifndef QTTESTDRAWCANVASMAINDIALOG_H
#define QTTESTDRAWCANVASMAINDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <boost/shared_ptr.hpp>
#include "qthideandshowdialog.h"
#pragma GCC diagnostic pop

namespace Ui {
  class QtTestDrawCanvasMainDialog;
}

namespace ribi {

struct DrawCanvas;
struct QtSurfacePlotWidget;

class QtTestDrawCanvasMainDialog : public QtHideAndShowDialog
{
  Q_OBJECT
  
public:
  explicit QtTestDrawCanvasMainDialog(QWidget *parent = 0);
  QtTestDrawCanvasMainDialog(const QtTestDrawCanvasMainDialog&) = delete;
  QtTestDrawCanvasMainDialog& operator=(const QtTestDrawCanvasMainDialog&) = delete;
  ~QtTestDrawCanvasMainDialog() noexcept;
  
private slots:

  void on_box_color_system_currentIndexChanged(int index);

  void on_box_coordinat_system_currentIndexChanged(int index);

  void on_button_arc_clicked();
  void on_button_circle_clicked();
  void on_button_clear_clicked();
  void on_button_dot_clicked();
  void on_button_ellipse_clicked();
  void on_button_line_clicked();

private:
  Ui::QtTestDrawCanvasMainDialog *ui;
  boost::shared_ptr<DrawCanvas> m_canvas;
  QtSurfacePlotWidget * m_surface_plot;

  static const boost::shared_ptr<DrawCanvas> CreateCanvas();
  void OnChanged() noexcept;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // QTTESTDRAWCANVASMAINDIALOG_H

 

 

 

 

 

./ToolTestDrawCanvas/qttestdrawcanvasmaindialog.cpp

 

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include "qttestdrawcanvasmaindialog.h"

#include <cassert>
#include <sstream>

#include <boost/bind.hpp>
#include <boost/lambda/lambda.hpp>

#include "drawcanvas.h"
#include "qtcanvas.h"
#include "qtsurfaceplotwidget.h"
#include "testtimer.h"
#include "trace.h"
#include "ui_qttestdrawcanvasmaindialog.h"
#pragma GCC diagnostic pop

ribi::QtTestDrawCanvasMainDialog::QtTestDrawCanvasMainDialog(QWidget *parent) :
  QtHideAndShowDialog(parent),
  ui(new Ui::QtTestDrawCanvasMainDialog),
  m_canvas(CreateCanvas()),
  m_surface_plot(new ribi::QtSurfacePlotWidget)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);

  {
    assert(ui->verticalLayout);
    QtCanvas * const qtcanvas {
      new QtCanvas(m_canvas)
    };
    ui->verticalLayout->addWidget(qtcanvas);
    ui->verticalLayout->addWidget(m_surface_plot);
  }

  {
    const double w = m_canvas->GetWidth();
    const double h = m_canvas->GetHeight();
    ui->box_circle_x->setValue(0.5 * w);
    ui->box_circle_y->setValue(0.5 * h);
    ui->box_circle_r->setValue(0.4 * h);
    ui->box_dot_x->setValue(0.5 * w);
    ui->box_dot_y->setValue(0.5 * h);
    ui->box_line_x1->setValue(0.25 * w);
    ui->box_line_y1->setValue(0.25 * h);
    ui->box_line_x2->setValue(0.75 * w);
    ui->box_line_y2->setValue(0.75 * h);
  }

  m_canvas->m_signal_changed.connect(
    boost::bind(&ribi::QtTestDrawCanvasMainDialog::OnChanged,this)
  );
  OnChanged();
}

ribi::QtTestDrawCanvasMainDialog::~QtTestDrawCanvasMainDialog() noexcept
{
  delete ui;
}

const boost::shared_ptr<ribi::DrawCanvas> ribi::QtTestDrawCanvasMainDialog::CreateCanvas()
{
  const int maxx = 79;
  const int maxy = 23;
  boost::shared_ptr<ribi::DrawCanvas> canvas(new DrawCanvas(maxx,maxy));
  //Determine and calculate dimensions and coordinats of smiley
  const double maxxD = static_cast<double>(maxx);
  const double maxyD = static_cast<double>(maxy);
  const double midX        = 0.50 * maxxD;
  const double midY        = 0.50 * maxyD;
  const double headRay     = 0.50 * maxyD;
  const double eyeLeftX    = 0.50 * maxxD - (0.35 * headRay) ;
  const double eyeLeftY    = 0.50 * maxyD - (0.25 * headRay) ;
  const double eyeRightX   = 0.50 * maxxD + (0.35 * headRay) ;
  const double eyeRightY   = 0.50 * maxyD - (0.25 * headRay) ;
  const double eyeRay      = 0.30 * headRay;
  const double mouthLeftX  = 0.50 * maxxD - (0.7 * headRay) ;
  const double mouthMidX   = 0.50 * maxxD;
  const double mouthRightX = 0.50 * maxxD + (0.7 * headRay) ;
  const double mouthLeftY  = 0.50 * maxyD + (0.2 * headRay) ;
  const double mouthMidY   = 0.50 * maxyD + (0.7 * headRay) ;
  const double mouthRightY = 0.50 * maxyD + (0.2 * headRay) ;
  //Draw the image on Canvas
  canvas->DrawCircle(midX, midY, headRay);
  canvas->DrawCircle(eyeLeftX, eyeLeftY, eyeRay);
  canvas->DrawDot(eyeLeftX, eyeLeftY);
  canvas->DrawCircle(eyeRightX, eyeRightY, eyeRay);
  canvas->DrawDot(eyeRightX, eyeRightY);
  canvas->DrawLine(mouthLeftX, mouthLeftY, mouthMidX, mouthMidY);
  canvas->DrawLine(mouthMidX, mouthMidY, mouthRightX, mouthRightY);
  canvas->DrawLine(mouthRightX, mouthRightY, mouthLeftX, mouthLeftY);
  return canvas;
}


void ribi::QtTestDrawCanvasMainDialog::on_box_color_system_currentIndexChanged(int )
{
  const CanvasColorSystem color_system
    = ui->box_color_system->currentIndex() == 0
    ? CanvasColorSystem::normal
    : CanvasColorSystem::invert;
  this->m_canvas->SetColorSystem(color_system);
  //Should redraw automatically
}

void ribi::QtTestDrawCanvasMainDialog::on_box_coordinat_system_currentIndexChanged(int )
{
  const CanvasCoordinatSystem coordinat_system
    = ui->box_coordinat_system->currentIndex() == 0
    ? CanvasCoordinatSystem::screen : CanvasCoordinatSystem::graph;
  this->m_canvas->SetCoordinatSystem(coordinat_system);
  //Should redraw automatically
}


void ribi::QtTestDrawCanvasMainDialog::on_button_arc_clicked()
{
  const double left  = std::min(ui->box_arc_x1->value(),ui->box_arc_x2->value());
  const double right = std::max(ui->box_arc_x1->value(),ui->box_arc_x2->value());
  const double top    = std::min(ui->box_arc_y1->value(),ui->box_arc_y2->value());
  const double bottom = std::max(ui->box_arc_y1->value(),ui->box_arc_y2->value());
  const boost::units::quantity<boost::units::si::plane_angle> start_arc {
    ui->box_arc_start_arc->value() * boost::units::si::radian
  };
  const boost::units::quantity<boost::units::si::plane_angle> arc_length {
    ui->box_arc_arc_length->value() * boost::units::si::radian
  };
  m_canvas->DrawArc(left,top,right,bottom,start_arc,arc_length);
}

void ribi::QtTestDrawCanvasMainDialog::on_button_clear_clicked()
{
  m_canvas->Clear();
  //Should redraw automatically
}

void ribi::QtTestDrawCanvasMainDialog::on_button_circle_clicked()
{
  m_canvas->DrawCircle(
    ui->box_circle_x->value(),
    ui->box_circle_y->value(),
    ui->box_circle_r->value()
  );
}

void ribi::QtTestDrawCanvasMainDialog::on_button_dot_clicked()
{
   m_canvas->DrawDot(
     ui->box_dot_x->value(),
     ui->box_dot_y->value()
   );
}

void ribi::QtTestDrawCanvasMainDialog::on_button_ellipse_clicked()
{
  const double left  = std::min(ui->box_ellipse_x1->value(),ui->box_ellipse_x2->value());
  const double right = std::max(ui->box_ellipse_x1->value(),ui->box_ellipse_x2->value());
  const double top    = std::min(ui->box_ellipse_y1->value(),ui->box_ellipse_y2->value());
  const double bottom = std::max(ui->box_ellipse_y1->value(),ui->box_ellipse_y2->value());
  m_canvas->DrawEllipse(left,top,right,bottom);
}

void ribi::QtTestDrawCanvasMainDialog::on_button_line_clicked()
{
  m_canvas->DrawLine(
    ui->box_line_x1->value(),
    ui->box_line_y1->value(),
    ui->box_line_x2->value(),
    ui->box_line_y2->value()
  );
}

void ribi::QtTestDrawCanvasMainDialog::OnChanged() noexcept
{
  m_surface_plot->SetSurfaceGrey(m_canvas->GetGreynesses());
}

#ifndef NDEBUG
void ribi::QtTestDrawCanvasMainDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
  QtTestDrawCanvasMainDialog d;
  d.on_button_clear_clicked();
  {
    for (const auto r: d.m_canvas->GetGreynesses())
    {
      assert(std::find_if(std::begin(r),std::end(r),[](const double x) { return x > 0.01; } ) == std::end(r)
        && "on_button_clear_clicked must clear the canvas");
    }
  }

  for (int i=0; i!=6; ++i)
  {
    switch (i)
    {
      case 0: d.on_button_arc_clicked(); break;
      case 1: d.on_button_circle_clicked(); break;
      case 2: d.on_button_clear_clicked(); break;
      case 3: d.on_button_dot_clicked(); break;
      case 4: d.on_button_ellipse_clicked(); break;
      case 5: d.on_button_line_clicked(); break;
    }
    const auto v = d.m_canvas->GetGreynesses();
    assert(
      std::count_if(std::begin(v),std::end(v),
        [](const std::vector<double>& r)
        {
          return std::find_if(std::begin(r),std::end(r),[](const double x) { return x > 0.01; } ) == std::end(r);
        }
      ) > 0
      && "At least one row must have some greynesses"
    );
  }
}
#endif

 

 

 

 

 

./ToolTestDrawCanvas/qttestdrawcanvasmenudialog.h

 

#ifndef QTTESTDRAWCANVASMENUDIALOG_H
#define QTTESTDRAWCANVASMENUDIALOG_H

#include "qthideandshowdialog.h"

namespace Ui {
  class QtTestDrawCanvasMenuDialog;
}

namespace ribi {

class QtTestDrawCanvasMenuDialog : public QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestDrawCanvasMenuDialog(QWidget *parent = 0);
  QtTestDrawCanvasMenuDialog(const QtTestDrawCanvasMenuDialog&) = delete;
  QtTestDrawCanvasMenuDialog& operator=(const QtTestDrawCanvasMenuDialog&) = delete;
  ~QtTestDrawCanvasMenuDialog() noexcept;

protected:
  void keyPressEvent(QKeyEvent * event);

private:
  Ui::QtTestDrawCanvasMenuDialog *ui;

private slots:
  void on_button_about_clicked();
  void on_button_quit_clicked();
  void on_button_start_canvas_clicked();

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // QTTESTDRAWCANVASMENUDIALOG_H

 

 

 

 

 

./ToolTestDrawCanvas/qttestdrawcanvasmenudialog.cpp

 

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include "qttestdrawcanvasmenudialog.h"

#include <QDesktopWidget>
#include <QKeyEvent>

#include "testdrawcanvasmenudialog.h"
#include "qtaboutdialog.h"
#include "qttestdrawcanvasmaindialog.h"
#include "testtimer.h"
#include "qthideandshowdialog.h"
#include "trace.h"
#include "ui_qttestdrawcanvasmenudialog.h"
#pragma GCC diagnostic pop

ribi::QtTestDrawCanvasMenuDialog::QtTestDrawCanvasMenuDialog(
  QWidget *parent)
  : QtHideAndShowDialog(parent),
    ui(new Ui::QtTestDrawCanvasMenuDialog)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);
}

ribi::QtTestDrawCanvasMenuDialog::~QtTestDrawCanvasMenuDialog() noexcept
{
  delete ui;
}

void ribi::QtTestDrawCanvasMenuDialog::keyPressEvent(QKeyEvent * event)
{
  if (event->key() == Qt::Key_Escape) { close(); return; }
}

void ribi::QtTestDrawCanvasMenuDialog::on_button_about_clicked()
{
  About a = TestDrawCanvasMenuDialog().GetAbout();
  a.AddLibrary("QtHideAndShowDialog version: " + QtHideAndShowDialog::GetVersion());
  QtAboutDialog d(a);
  d.setWindowIcon(this->windowIcon());
  d.setStyleSheet(this->styleSheet());
  this->ShowChild(&d);
}

void ribi::QtTestDrawCanvasMenuDialog::on_button_quit_clicked()
{
  close();
}

void ribi::QtTestDrawCanvasMenuDialog::on_button_start_canvas_clicked()
{
  QtTestDrawCanvasMainDialog d;
  d.setWindowIcon(this->windowIcon());
  //d.setStyleSheet(this->styleSheet());
  ShowChild(&d);
}

#ifndef NDEBUG
void ribi::QtTestDrawCanvasMenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  QtTestDrawCanvasMainDialog();
  const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif

 

 

 

 

 

./ToolTestDrawCanvas/testdrawcanvasmenudialog.h

 

#ifndef TESTDRAWCANVASMENUDIALOG_H
#define TESTDRAWCANVASMENUDIALOG_H

#include "menudialog.h"

namespace ribi {

///GUI independent TestDrawCanvas menu dialog
struct TestDrawCanvasMenuDialog final : public MenuDialog
{
  About GetAbout() const noexcept override;
  Help GetHelp() const noexcept override;
  boost::shared_ptr<const Program> GetProgram() const noexcept override;
  std::string GetVersion() const noexcept override;
  std::vector<std::string> GetVersionHistory() const noexcept override;

  private:
  int ExecuteSpecific(const std::vector<std::string>& argv) noexcept override;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // TESTDRAWCANVASMENUDIALOG_H

 

 

 

 

 

./ToolTestDrawCanvas/testdrawcanvasmenudialog.cpp

 

#include "testdrawcanvasmenudialog.h"

#include <cassert>
#include <iostream>

#include "drawcanvas.h"
#include "richelbilderbeekprogram.h"
#include "trace.h"
#include "testtimer.h"

int ribi::TestDrawCanvasMenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
  #ifndef NDEBUG
  Test();
  #endif
  const int argc = static_cast<int>(argv.size());
  if (argc != 1)
  {
    std::cout << GetHelp() << '\n';
    return 1;
  }
  //Specify the dimensions of the canvas equal to the screen
  //Coordinat (0,0) is the top-left coordinat
  //Coordinat (79,23) is the bottom-right coordinat
  const int maxx = 79;
  const int maxy = 23;

  for (int i=0; i!=4; ++i)
  {
    const ribi::CanvasColorSystem color_system
      = i % 2 ? ribi::CanvasColorSystem::normal : ribi::CanvasColorSystem::invert;
    const ribi::CanvasCoordinatSystem coordinat_system
      = i / 2 ? ribi::CanvasCoordinatSystem::graph : ribi::CanvasCoordinatSystem::screen;
    ribi::DrawCanvas c( maxx, maxy, color_system, coordinat_system);

    //Draw smiley to Canvas

    //Determine and calculate dimensions and coordinats of smiley
    const double maxxD = static_cast<double>(maxx);
    const double maxyD = static_cast<double>(maxy);
    const double midX        = 0.50 * maxxD;
    const double midY        = 0.50 * maxyD;
    const double headRay     = 0.50 * maxyD;
    const double eyeLeftX    = 0.50 * maxxD - (0.35 * headRay) ;
    const double eyeLeftY    = 0.50 * maxyD - (0.25 * headRay) ;
    const double eyeRightX   = 0.50 * maxxD + (0.35 * headRay) ;
    const double eyeRightY   = 0.50 * maxyD - (0.25 * headRay) ;
    const double eyeRay      = 0.30 * headRay;
    const double mouthLeftX  = 0.50 * maxxD - (0.7 * headRay) ;
    const double mouthMidX   = 0.50 * maxxD;
    const double mouthRightX = 0.50 * maxxD + (0.7 * headRay) ;
    const double mouthLeftY  = 0.50 * maxyD + (0.2 * headRay) ;
    const double mouthMidY   = 0.50 * maxyD + (0.7 * headRay) ;
    const double mouthRightY = 0.50 * maxyD + (0.2 * headRay) ;
    //Draw the image on Canvas
    c.DrawCircle(midX, midY, headRay);
    c.DrawCircle(eyeLeftX, eyeLeftY, eyeRay);
    c.DrawDot(eyeLeftX, eyeLeftY);
    c.DrawCircle(eyeRightX, eyeRightY, eyeRay);
    c.DrawDot(eyeRightX, eyeRightY);
    c.DrawLine(mouthLeftX, mouthLeftY, mouthMidX, mouthMidY);
    c.DrawLine(mouthMidX, mouthMidY, mouthRightX, mouthRightY);
    c.DrawLine(mouthRightX, mouthRightY, mouthLeftX, mouthLeftY);
    //Display the image
    std::cout << c;
    std::cout << std::endl;
  }
  return 0;
}

ribi::About ribi::TestDrawCanvasMenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestDrawCanvas",
    "tests the DrawCanvas class",
    "the 10th of January 2014",
    "2013-2015",
    "http://www.richelbilderbeek.nl/ToolTestDrawCanvas.htm",
    GetVersion(),
    GetVersionHistory());
  a.AddLibrary("Canvas version: " + Canvas::GetVersion());
  a.AddLibrary("DrawCanvas version: " + DrawCanvas::GetVersion());
  a.AddLibrary("Trace version: " + Trace::GetVersion());
  return a;
}

ribi::Help ribi::TestDrawCanvasMenuDialog::GetHelp() const noexcept
{
  return Help(
    this->GetAbout().GetFileTitle(),
    this->GetAbout().GetFileDescription(),
    {

    },
    {

    }
  );
}

boost::shared_ptr<const ribi::Program> ribi::TestDrawCanvasMenuDialog::GetProgram() const noexcept
{
  const boost::shared_ptr<const Program> p {
    new ProgramTestDrawCanvas
  };
  assert(p);
  return p;
}

std::string ribi::TestDrawCanvasMenuDialog::GetVersion() const noexcept
{
  return "1.2";
}

std::vector<std::string> ribi::TestDrawCanvasMenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2013-08-28: version 1.0: initial desktop version, originally called TestCanvas",
    "2013-11-05: version 1.1: conformized for ProjectRichelBilderbeekConsole",
    "2014-01-10: version 1.2: renamed TestCanvas to TestDrawCanvas"
  };
}

#ifndef NDEBUG
void ribi::TestDrawCanvasMenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
  ribi::DrawCanvas();
}
#endif

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml