29#include "ImgCellBase.h"
51 void GnuplotSource(wxString sourcefile, wxString datafile,
const wxString &wxmFile)
52 {
if (m_image) m_image->GnuplotSource(std::move(sourcefile),
55 void CompressedGnuplotSource(wxString sourcefile, wxString datafile,
56 const wxString &wxmFile)
57 {
if (m_image) m_image->CompressedGnuplotSource(std::move(sourcefile),
63 {
return m_image ? m_image->GnuplotSource() : wxString(); }
65 void LoadImage(wxString image,
bool remove =
true);
68 void SetPPI(
int ppi)
override {m_image->SetPPI(ppi);}
69 int GetPPI()
const override {
return m_image->GetPPI();}
70 size_t GetOriginalWidth()
const override {
return m_image->GetOriginalWidth();}
71 size_t GetOriginalHeight()
const override {
return m_image->GetOriginalHeight();}
73 void ReloadImage(
const wxString &image,
const wxString &wxmFile);
76 bool CanExportSVG()
const override {
return (m_image != NULL) && m_image->CanExportSVG();}
95 void ClearCache()
override {
if (m_image) m_image->ClearCache(); }
97 const wxString
GetToolTip(wxPoint point)
const override;
105 void DrawRectangle(
bool draw) { m_drawRectangle = draw; }
109 {
if (m_image)
return m_image->GetExtension();
else return wxEmptyString; }
113 {
return m_origImageFile; }
117 { m_origImageFile = file; }
122 wxCoord GetMaxWidth()
const override {
return m_image ? m_image->GetMaxWidth() : -1; }
123 wxCoord GetHeightList()
const override {
return m_image ? m_image->GetHeightList() : -1; }
124 void SetMaxWidth(wxCoord width)
override {
if (m_image) m_image->SetMaxWidth(width); }
125 void SetMaxHeight(wxCoord height)
override {
if (m_image) m_image->SetMaxHeight(height); }
129 void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC)
override;
132 wxString
ToRTF()
const override;
134 wxString
ToTeX()
const override;
135 wxString
ToXML()
const override;
137 bool CanPopOut()
const override {
return m_image && m_image->HasGnuplotSource(); }
141 void DrawBoundingBox(wxDC &WXUNUSED(dc),
bool WXUNUSED(all) =
false)
override;
142 int GetImageBorderWidth()
const override {
return m_imageBorderWidth; }
144 std::shared_ptr<Image> m_image;
148 int m_imageBorderWidth = 0;
152 void InitBitFields_ImgCell()
155 m_drawRectangle =
true;
156 m_drawBoundingBox =
false;
158 bool m_drawRectangle : 1 ;
159 bool m_drawBoundingBox : 1 ;
161 static int s_counter;
163 wxString m_origImageFile;
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
Definition: AnimationCell.h:46
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
void SetOrigImageFile(const wxString &file)
Sets the name of the file the image was originally created from.
Definition: ImgCell.h:116
wxString ToString() const override
Returns the cell's representation as a string.
Definition: ImgCell.cpp:214
wxString GetExtension() const override
Returns the file name extension that matches the image type.
Definition: ImgCell.h:108
bool CanPopOut() const override
Can this cell be popped out interactively in gnuplot?
Definition: ImgCell.h:137
void GnuplotSource(wxString sourcefile, wxString datafile, const wxString &wxmFile)
Tell the image which gnuplot files it was made from.
Definition: ImgCell.h:51
void SetPPI(int ppi) override
Set the image's resolution.
Definition: ImgCell.h:68
void SetBitmap(const wxBitmap &bitmap)
Sets the bitmap that is shown.
Definition: ImgCell.cpp:117
wxMemoryBuffer GetCompressedImage() const
Returns the original compressed version of the image.
Definition: ImgCell.h:120
wxSize ToImageFile(wxString filename) override
Writes the image to a file.
Definition: ImgCell.cpp:220
void Recalculate(AFontSize fontsize) override
Recalculate the size of the cell and the difference between top and center.
Definition: ImgCell.cpp:143
wxString ToTeX() const override
Convert this cell to its LaTeX representation.
Definition: ImgCell.cpp:218
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: ImgCell.cpp:283
void ClearCache() override
Removes the cached scaled image from memory.
Definition: ImgCell.h:95
std::unique_ptr< Cell > Copy(GroupCell *group) const override
Create a copy of this cell.
wxString GetOrigImageFile() const
Returns the name of the file the image was originally created from.
Definition: ImgCell.h:112
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC) override
Draw this cell.
Definition: ImgCell.cpp:162
bool CopyToClipboard() const override
Copies the cell to the system's clipboard.
Definition: ImgCell.cpp:349
wxString ToRTF() const override
Returns the cell's representation as RTF.
Definition: ImgCell.cpp:241
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: ImgCell.cpp:216
wxString GnuplotSource() const override
The name of the file with gnuplot commands that created this file.
Definition: ImgCell.h:62
ImgCell & operator=(const ImgCell &)=delete
This class can be derived from wxAccessible which has no copy constructor.
const wxString GetToolTip(wxPoint point) const override
Returns the ToolTip this cell provides at a given point.
Definition: ImgCell.cpp:134
bool CanExportSVG() const override
Can this image be exported in SVG format?
Definition: ImgCell.h:76