29#ifndef ANIMATIONCELL_H
30#define ANIMATIONCELL_H
34#include "ImgCellBase.h"
40#include <wx/mstream.h>
41#include <wx/wfstream.h>
60 const wxString &wxmxFile,
int framerate = -1);
71 int GetPPI()
const override {
if(IsOk())
return m_images.at(m_displayed)->GetPPI();
else return 0;}
72 size_t GetOriginalWidth()
const override {
73 if(IsOk())
return m_images.at(m_displayed)->GetOriginalWidth();
else return 0;}
74 size_t GetOriginalHeight()
const override {
75 if(IsOk())
return m_images.at(m_displayed)->GetOriginalHeight();
else return 0;}
77 {
if (IsOk())
return m_images.at(m_displayed)->GetExtension();
else return wxEmptyString; }
81 int Length()
const {
return m_images.size();}
82 void LoadImages(wxMemoryBuffer imageData);
83 void LoadImages(wxString imageFile);
85 void SetPPI(
int ppi)
override;
90 bool CanExportSVG()
const override {
return (m_images.at(m_displayed) != NULL) && m_images.at(m_displayed)->CanExportSVG();}
101 wxCharBuffer m_databuf;
106 const wxString
GetToolTip(wxPoint point)
const override;
115 void LoadImages(wxArrayString images,
bool deleteRead);
117 int GetDisplayedIndex()
const {
return m_displayed; }
119 wxImage GetBitmap(
int n)
const
120 {
return m_images[n]->GetUnscaledBitmap().ConvertToImage(); }
122 void SetDisplayedIndex(
int ind);
128 wxSize
ToGif(wxString file);
161 bool AnimationRunning()
const {
return m_animationRunning; }
162 void AnimationRunning(
bool run);
163 void ToggleAnimationRunning(){AnimationRunning(!AnimationRunning());}
165 {
return m_images.at(m_displayed) && (m_images.at(m_displayed)->HasGnuplotSource()); }
167 void GnuplotSource(
int image, wxString gnuplotFilename, wxString dataFilename,
168 const wxString &wxmxFile)
169 { m_images[image]->GnuplotSource(std::move(gnuplotFilename),
170 std::move(dataFilename), wxmxFile); }
171 void CompressedGnuplotSource(
int image, wxString gnuplotFilename, wxString dataFilename,
172 const wxString &wxmxFile)
173 { m_images[image]->CompressedGnuplotSource(std::move(gnuplotFilename),
174 std::move(dataFilename),
179 if (!m_images.at(m_displayed))
180 return wxEmptyString;
182 return m_images.at(m_displayed)->GnuplotSource();
188 std::vector<std::shared_ptr<Image>> m_images;
194 int m_framerate = -1;
196 int m_imageBorderWidth = 0;
200 void InitBitFields_AnimationCell()
203 m_animationRunning =
true;
204 m_drawBoundingBox =
false;
207 bool m_animationRunning : 1 ;
208 bool m_drawBoundingBox : 1 ;
211 int GetImageBorderWidth()
const override {
return m_imageBorderWidth; }
213 void Recalculate(
AFontSize fontsize)
override;
215 void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC)
override;
217 wxString ToMatlab()
const override;
218 wxString ToRTF()
const override;
219 wxString ToString()
const override;
220 wxString ToTeX()
const override;
221 wxString ToXML()
const override;
223 wxCoord GetMaxWidth()
const override;
224 wxCoord GetHeightList()
const override;
225 void SetMaxWidth(wxCoord width)
override;
226 void SetMaxHeight(wxCoord height)
override;
228 void DrawBoundingBox(wxDC &WXUNUSED(dc),
bool WXUNUSED(all) =
false)
override
229 { m_drawBoundingBox =
true; }
The definition of the base class of all cells the worksheet consists of.
This file declares the class Image.
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:98
A Gif object for the clipboard.
Definition: AnimationCell.h:94
Definition: AnimationCell.h:46
wxString GetExtension() const override
Returns the file name extension that matches the image type.
Definition: AnimationCell.h:76
bool CopyToClipboard() const override
Copies the cell to the system's clipboard.
Definition: AnimationCell.cpp:522
void ClearCache() override
Remove all cached scaled images from memory.
Definition: AnimationCell.cpp:510
AnimationCell(GroupCell *group, Configuration *config, const wxMemoryBuffer &image, const wxString &type)
A constructor that loads the compressed file from a wxMemoryBuffer.
bool CanPopOut() const override
Can this cell be popped out interactively in gnuplot?
Definition: AnimationCell.h:164
wxSize ToGif(wxString file)
Exports the whole animation as animated gif.
Definition: AnimationCell.cpp:476
void SetPPI(int ppi) override
Set the animation's resolution.
Definition: AnimationCell.cpp:410
wxSize ToImageFile(wxString file) override
Exports the image the animation currently displays.
Definition: AnimationCell.cpp:416
wxString GnuplotSource() const override
The name of the file with gnuplot commands that created this file.
Definition: AnimationCell.h:177
void StopTimer()
Stops the timer.
Definition: AnimationCell.cpp:143
std::unique_ptr< Cell > Copy(GroupCell *group) const override
Create a copy of this cell.
int GetFrameRate() const
Get the frame rate of this AnimationCell [in Hz].
Definition: AnimationCell.cpp:120
int SetFrameRate(int Freq)
Set the frame rate of this AnimationCell [in Hz].
Definition: AnimationCell.cpp:156
void ReloadTimer()
Reload the animation timer starting and instantiating and registering it if necessary.
Definition: AnimationCell.cpp:135
bool CopyAnimationToClipboard()
Put the animation on the clipboard.
Definition: AnimationCell.cpp:548
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
void SetConfiguration(Configuration *config) override
Tell this cell to use the configuration object config.
Definition: AnimationCell.cpp:106
const wxString GetToolTip(wxPoint point) const override
Returns the ToolTip this cell provides at a given point.
Definition: AnimationCell.cpp:465
static wxDataFormat m_gifFormat
A class that publishes wxm data to the clipboard.
Definition: AnimationCell.h:87
bool CanExportSVG() const override
Can the current image be exported in SVG format?
Definition: AnimationCell.h:90
The storage for pointers to cells.
Definition: CellPointers.h:45
A class that carries information about the type of a cell.
Definition: Cell.h:93
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:74
Definition: ImgCellBase.h:42