Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) TestMultiCanvas

 

TestMultiCanvas is a tool to test the MultiCanvas class.

 

 

 

 

 

Downloads

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestMultiCanvas/ToolTestMultiCanvasConsole.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(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppDrawCanvas/CppDrawCanvas.pri)
include(../../Classes/CppImageCanvas/CppImageCanvas.pri)
include(../../Classes/CppMultiCanvas/CppMultiCanvas.pri)
include(../../Classes/CppTextCanvas/CppTextCanvas.pri)
include(../../Classes/CppXml/CppXml.pri)
include(../../Tools/ToolTestMultiCanvas/ToolTestMultiCanvasConsole.pri)

SOURCES += main.cpp

 

 

 

 

 

Qt project file: ./ToolTestMultiCanvas/ToolTestMultiCanvasDesktop.pro

 

include(../../DesktopApplication.pri)

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

#Specific for this application
#Console
include(../../Classes/CppCanvas/CppCanvas.pri)
include(../../Classes/CppContainer/CppContainer.pri)
include(../../Classes/CppDotMatrix/CppDotMatrix.pri)
include(../../Classes/CppDrawCanvas/CppDrawCanvas.pri)
include(../../Classes/CppGeometry/CppGeometry.pri)
include(../../Classes/CppImageCanvas/CppImageCanvas.pri)
include(../../Classes/CppMultiCanvas/CppMultiCanvas.pri)
include(../../Classes/CppPlane/CppPlane.pri)
include(../../Classes/CppRibiRegex/CppRibiRegex.pri)
include(../../Classes/CppTextCanvas/CppTextCanvas.pri)
include(../../Classes/CppXml/CppXml.pri)

#Desktop
include(../../Tools/ToolTestMultiCanvas/ToolTestMultiCanvasDesktop.pri)

SOURCES += qtmain.cpp

 

 

 

 

 

Qt project file: ./ToolTestMultiCanvas/ToolWebsite.pro

 

include(../../Tools/Tool/ToolConsole.pri)

 

 

 

 

 

./ToolTestMultiCanvas/ToolTestMultiCanvasConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestMultiCanvas

SOURCES += \
    ../../Tools/ToolTestMultiCanvas/testmulticanvasmenudialog.cpp

HEADERS += \
    ../../Tools/ToolTestMultiCanvas/testmulticanvasmenudialog.h

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

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

 

 

 

 

 

./ToolTestMultiCanvas/ToolTestMultiCanvasDesktop.pri

 

include(../../Tools/ToolTestMultiCanvas/ToolTestMultiCanvasConsole.pri)

#Added in ToolTestMultiCanvasConsole.pri
#RESOURCES += \
#    ../../Tools/ToolTestMultiCanvas/ToolTestMultiCanvas.qrc

FORMS += \
    ../../Tools/ToolTestMultiCanvas/qttestmulticanvasmenudialog.ui \
    ../../Tools/ToolTestMultiCanvas/qttestmulticanvasmaindialog.ui

SOURCES += \
    ../../Tools/ToolTestMultiCanvas/qttestmulticanvasmenudialog.cpp \
    ../../Tools/ToolTestMultiCanvas/qttestmulticanvasmaindialog.cpp

HEADERS += \
    ../../Tools/ToolTestMultiCanvas/qttestmulticanvasmenudialog.h \
    ../../Tools/ToolTestMultiCanvas/qttestmulticanvasmaindialog.h

 

 

 

 

 

./ToolTestMultiCanvas/ToolTestMultiCanvasWebsite.pri

 

include(../../Tools/ToolTestMultiCanvas/ToolTestMultiCanvasConsole.pri)

SOURCES +=

HEADERS +=

 

 

 

 

 

./ToolTestMultiCanvas/main.cpp

 

#include "testmulticanvasmenudialog.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::TestMultiCanvasMenuDialog().Execute(args);
}

 

 

 

 

 

./ToolTestMultiCanvas/qtmain.cpp

 

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#include <QApplication>
#include "qttestmulticanvasmenudialog.h"
#include "trace.h"
#pragma GCC diagnostic pop

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

 

 

 

 

 

./ToolTestMultiCanvas/qttestmulticanvasmaindialog.h

 

#ifndef QTTESTMULTICANVASMAINDIALOG_H
#define QTTESTMULTICANVASMAINDIALOG_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 QtTestMultiCanvasMainDialog;
}

namespace ribi {

struct Canvas;
struct DrawCanvas;

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

  //void on_box_color_system_currentIndexChanged(int index);
  //void on_box_coordinat_system_currentIndexChanged(int index);
  //void on_button_dot_clicked();
  //void on_button_clear_clicked();
  //void on_button_circle_clicked();
  //void on_button_line_clicked();

private:
  Ui::QtTestMultiCanvasMainDialog *ui;
  boost::shared_ptr<DrawCanvas> m_canvas;

  static const boost::shared_ptr<DrawCanvas> CreateCanvas();
  void ShowCanvas(const Canvas * const canvas = nullptr);

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

} //~namespace ribi

#endif // QTTESTMULTICANVASMAINDIALOG_H

 

 

 

 

 

./ToolTestMultiCanvas/qttestmulticanvasmaindialog.cpp

 

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

#include <cassert>
#include <sstream>

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

#include "drawcanvas.h"
#include "imagecanvas.h"
#include "textcanvas.h"
#include "testtimer.h"
#include "multicanvas.h"
#include "trace.h"
#include "ui_qttestmulticanvasmaindialog.h"
#pragma GCC diagnostic pop

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

  m_canvas->m_signal_changed.connect(
    boost::bind(
      &ribi::QtTestMultiCanvasMainDialog::ShowCanvas,this,
      boost::lambda::_1)
    );

  {
    const double w = m_canvas->GetWidth();
    const double h = m_canvas->GetHeight();
    ui->box_circle_x_draw->setValue(0.5 * w);
    ui->box_circle_y_draw->setValue(0.5 * h);
    ui->box_circle_r_draw->setValue(0.4 * h);
    ui->box_dot_x_draw->setValue(0.5 * w);
    ui->box_dot_y_draw->setValue(0.5 * h);
    ui->box_line_x1_draw->setValue(0.25 * w);
    ui->box_line_y1_draw->setValue(0.25 * h);
    ui->box_line_x2_draw->setValue(0.75 * w);
    ui->box_line_y2_draw->setValue(0.75 * h);
  }

  ShowCanvas(0);
}

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

const boost::shared_ptr<ribi::DrawCanvas> ribi::QtTestMultiCanvasMainDialog::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::QtTestMultiCanvasMainDialog::on_box_color_system_currentIndexChanged(int )
{
  const CanvasColorSystem color_system
    = ui->box_color_system_draw->currentIndex() == 0
    ? CanvasColorSystem::normal
    : CanvasColorSystem::invert;
  this->m_canvas->SetColorSystem(color_system);
  //Should redraw automatically
}

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

void ribi::QtTestMultiCanvasMainDialog::ShowCanvas(const ribi::Canvas * const)
{
  //Display the image
  std::stringstream s;
  s << (*m_canvas);
  ui->text->setPlainText(s.str().c_str());

}

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

void ribi::QtTestMultiCanvasMainDialog::on_button_circle_clicked()
{
  m_canvas->DrawCircle(
    ui->box_circle_x_draw->value(),
    ui->box_circle_y_draw->value(),
    ui->box_circle_r_draw->value()
  );
}

void ribi::QtTestMultiCanvasMainDialog::on_button_dot_clicked()
{
   m_canvas->DrawDot(
     ui->box_dot_x_draw->value(),
     ui->box_dot_y_draw->value()
   );
}

void ribi::QtTestMultiCanvasMainDialog::on_button_line_clicked()
{
  m_canvas->DrawLine(
    ui->box_line_x1_draw->value(),
    ui->box_line_y1_draw->value(),
    ui->box_line_x2_draw->value(),
    ui->box_line_y2_draw->value()
  );
}
*/

#ifndef NDEBUG
void ribi::QtTestMultiCanvasMainDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
  //MultiCanvas is tested in TestMultiCanvasMenuDialog
}
#endif

 

 

 

 

 

./ToolTestMultiCanvas/qttestmulticanvasmenudialog.h

 

#ifndef QTTESTMULTICANVASMENUDIALOG_H
#define QTTESTMULTICANVASMENUDIALOG_H

#include "qthideandshowdialog.h"

namespace Ui {
  class QtTestMultiCanvasMenuDialog;
}

namespace ribi {

class QtTestMultiCanvasMenuDialog : public QtHideAndShowDialog
{
  Q_OBJECT

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

protected:
  void keyPressEvent(QKeyEvent * event);

private:
  Ui::QtTestMultiCanvasMenuDialog *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 // QTTESTMULTICANVASMENUDIALOG_H

 

 

 

 

 

./ToolTestMultiCanvas/qttestmulticanvasmenudialog.cpp

 

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

#include <QDesktopWidget>
#include <QKeyEvent>

#include "testmulticanvasmenudialog.h"
#include "qtaboutdialog.h"
#include "qttestmulticanvasmaindialog.h"
#include "qthideandshowdialog.h"
#include "testtimer.h"
#include "trace.h"
#include "ui_qttestmulticanvasmenudialog.h"
#pragma GCC diagnostic pop

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

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

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

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

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

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

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

 

 

 

 

 

./ToolTestMultiCanvas/testmulticanvasmenudialog.h

 

#ifndef TESTMULTICANVASMENUDIALOG_H
#define TESTMULTICANVASMENUDIALOG_H

#include "menudialog.h"

namespace ribi {

///GUI independent TestMultiCanvas menu dialog
struct TestMultiCanvasMenuDialog 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 // TESTMULTICANVASMENUDIALOG_H

 

 

 

 

 

./ToolTestMultiCanvas/testmulticanvasmenudialog.cpp

 

#include "testmulticanvasmenudialog.h"

#include <cassert>
#include <iostream>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <QFile>

#include "drawcanvas.h"
#include "fileio.h"
#include "imagecanvas.h"
#include "multicanvas.h"
#include "testtimer.h"
#include "richelbilderbeekprogram.h"
#include "textcanvas.h"
#include "trace.h"
#pragma GCC diagnostic pop

int ribi::TestMultiCanvasMenuDialog::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::MultiCanvas 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::TestMultiCanvasMenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestMultiCanvas",
    "tests the MultiCanvas class",
    "the 13th of January 2014",
    "2014-2015",
    "http://www.richelbilderbeek.nl/ToolTestMultiCanvas.htm",
    GetVersion(),
    GetVersionHistory());
  a.AddLibrary("Canvas version: " + Canvas::GetVersion());
  a.AddLibrary("MultiCanvas version: " + MultiCanvas::GetVersion());
  a.AddLibrary("Trace version: " + Trace::GetVersion());
  return a;
}

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

    },
    {

    }
  );
}

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

std::string ribi::TestMultiCanvasMenuDialog::GetVersion() const noexcept
{
  return "1.0";
}

std::vector<std::string> ribi::TestMultiCanvasMenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2014-01-13: version 1.0: initial desktop version",
  };
}

#ifndef NDEBUG
void ribi::TestMultiCanvasMenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
  boost::shared_ptr<Canvas> draw_canvas;
  const int n_cols = 78;
  {
    draw_canvas.reset(new DrawCanvas);
  }
  boost::shared_ptr<Canvas> image_canvas;
  {
    const std::string filename { fileio::FileIo().GetTempFileName() };
    QFile file(":/ToolTestMultiCanvas/images/R.png");
    file.copy(filename.c_str());
    assert(fileio::FileIo().IsRegularFile(filename));
    image_canvas.reset(
      new ImageCanvas(
        filename,
        n_cols
      )
    );
    //Note: cannot delete the file!
  }
  boost::shared_ptr<Canvas> text_canvas;
  {
    text_canvas.reset(new TextCanvas);
  }
  const std::vector<boost::shared_ptr<Canvas>> canvases { text_canvas, draw_canvas, image_canvas };
  const boost::shared_ptr<ribi::MultiCanvas> multi_canvas {
    new MultiCanvas(canvases)
  };
  std::stringstream s;
  s << (*multi_canvas);
  TRACE(*multi_canvas);
}
#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