11 #ifndef __A2D_WXIMAGEIOH_H__
12 #define __A2D_WXIMAGEIOH_H__
19 #include "wx/editor/candoc.h"
55 void SetScale(
double scale ) { m_scale = scale; }
57 double GetScale() {
return m_scale; }
60 void SetType( wxBitmapType type ) { m_type = type; }
68 wxBitmapType DetectImageType();
107 bool CanSave(
const wxObject* obj = NULL );
140 void SetViewRectangle(
double minx,
double miny,
double maxx,
double maxy );
157 void SetType( wxBitmapType type ) { m_type = type; }
166 void SetBorder( wxUint16 border,
bool percentual =
true );
209 long m_maxWidthHeight;
wxBitmapType m_type
image type
wxSize m_imageSizeCalc
calculate image size as set by user when m_imageSize = (0,0) else eqauls m_imageSize ...
long GetType() const
return the image type to save to, wxBITMAP_TYPE_ANY means outdetect from filename in CanSave()...
virtual bool Load(a2dDocumentInputStream &stream, wxObject *obj)=0
override to read the stream and store (part of) the contents in to a specific a2dDocument or othere o...
wxSize m_imageSize
image size that will be created.
wxOutputStream a2dDocumentOutputStream
output stream based wxStreams
wxBitmapType GetType()
return the image type to load from, wxBITMAP_TYPE_ANY means outdetect from filename in CanSave()...
void SetImageSize(const wxSize &size)
Set the size of the image to create.
using a file stream for input, stream the file into a a2dDocument or other object ...
void SetShowObject(a2dCanvasObject *showObject)
The image loaded, will be added to this object.
a2dDrawer2D * GetDrawer2D() const
get the internal m_drawer2D that is used for rendering the document
virtual bool CanLoad(a2dDocumentInputStream &stream, const wxObject *obj=NULL, wxClassInfo *docClassInfo=NULL)=0
Should return true if the handler can read from the stream.
a2dCanvasObject is the base class for Canvas Objects.
void SetMaxWidthHeight(long maxWidthHeight)
when image size is calculated, this is the maximum size possible
a2dBoundingBox m_viewBox
viewing area in world coordinates to display on bitmap
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the drawer.
void SetViewRectangle(a2dBoundingBox viewBox)
Give the virtual size to be rendered to an image as boundingbox.
a2dDrawer2D * m_drawer2D
the drawing engine to use
a2dCanvasDocument * m_doc
the document to store/load the data found into
void SetYaxis(bool up)
set if the Yaxis goes up or down
a2dCanvasDocument * m_doc
the document to store/load the data found into
wxBitmapType m_type
image type
Drawing context abstraction.
Input and output handler for a2dCanvasDocument to/from a wxImage.
Input and output handler for a2dCanvasDocument to/from a wxImage.
void SetShowObject(a2dCanvasObject *showObject)
document will be rendered as seen from this object, if NULL, the root of the document will be used...
virtual bool Save(a2dDocumentOutputStream &stream, const wxObject *obj)=0
Override to write to the stream and store (part of) of the document contents in the stream...
void SetScale(double scale)
scale the a2dImage by this factor, taking width and height from image imported.
void SetType(wxBitmapType type)
set the image type to load from, wxBITMAP_TYPE_ANY means outdetect from filename in CanSave()...
using a file stream for output, stream a a2dDocument or other wxObject into a stream.
wxInputStream a2dDocumentInputStream
input stream based wxStreams
virtual bool CanSave(const wxObject *obj=NULL)=0
Should return true if the handler can write this document to a stream.
Each a2dCanvasView needs to have a a2dCanvasDocument set in order to render data. ...
a2dCanvasObject * GetShowObject() const
The image loaded, will be added to this object.
void SetType(wxBitmapType type)
set the image type to save to, wxBITMAP_TYPE_ANY means outdetect from filename in CanSave()...
bool m_borderpercentual
border is not in pixel but a percentage of the smallest height/width
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
all headers of the canvas module
int m_border
create a border in this ammount of pixels.
a2dCanvasObject * m_showObject
render the document using this object as ShowObject.
wxBitmapType m_typeDetectedFromFilename
image type as detected in CanSave(), wil be used in Save() if m_type is wxBITMAP_TYPE_ANY ...
bool GetYaxis() const
get y axis orientation
bool m_yaxis
axis is up or down