a2dCanvasDocumentIOHandlerImageOut Class Reference
[File IO]

Input and output handler for a2dCanvasDocument to/from a wxImage. More...

#include <imageioh.h>

Inheritance diagram for a2dCanvasDocumentIOHandlerImageOut:

Inheritance graph
[legend]
Collaboration diagram for a2dCanvasDocumentIOHandlerImageOut:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 a2dCanvasDocumentIOHandlerImageOut (wxBitmapType type=wxBITMAP_TYPE_ANY)
 Constructor.
 ~a2dCanvasDocumentIOHandlerImageOut ()
 Destructor.
bool CanSave (const wxObject *obj=NULL)
 this handler can also save as CVG
virtual bool Save (a2dDocumentOutputStream &stream, const wxObject *obj)
 save a2dCanvasDocument as image
void SetShowObject (a2dCanvasObject *showObject)
 document will be rendered as seen from this object, if NULL, the root of the document will be used.
a2dCanvasObjectGetShowObject () const
 return pointer of then currently shown object on the drawer.
wxImage RenderImage (a2dCanvasDocument *document)
 render the document into an image.
void SetImageSize (const wxSize &size)
 Set the size of the image to create.
void SetViewRectangle (double minx, double miny, double maxx, double maxy)
 Give the virtual size to be rendered to an image.
void SetViewRectangle (a2dBoundingBox viewBox)
 Give the virtual size to be rendered to an image as boundingbox.
void SetYaxis (bool up)
 set if the Yaxis goes up or down
bool GetYaxis () const
 get y axis orientation
void SetType (wxBitmapType type)
 set the image type to save to, wxBITMAP_TYPE_ANY means outdetect from filename in CanSave().
long GetType () const
 return the image type to save to, wxBITMAP_TYPE_ANY means outdetect from filename in CanSave().
void SetMaxWidthHeight (long maxWidthHeight)
 when image size is calculated, this is the maximum size possible
void SetBorder (wxUint16 border, bool percentual=true)
 leafs a border of this amount of pixels around the drawing
void SetDrawer2D (a2dDrawer2D *drawer2d)
 set the internal m_drawer2D to be used for rendering the document
a2dDrawer2DGetDrawer2D () const
 get the internal m_drawer2D that is used for rendering the document

Protected Attributes

a2dDrawer2Dm_drawer2D
 the drawing engine to use
a2dCanvasDocumentm_doc
 the document to store/load the data found into
wxSize m_imageSize
 image size that will be created.
wxSize m_imageSizeCalc
 calculate image size as set by user when m_imageSize = (0,0) else eqauls m_imageSize
a2dCanvasObjectm_showObject
 render the document using this object as ShowObject.
int m_border
 create a border in this ammount of pixels.
bool m_borderpercentual
 border is not in pixel but a percentage of the smallest height/width
wxBitmapType m_type
 image type
wxBitmapType m_typeDetectedFromFilename
 image type as detected in CanSave(), wil be used in Save() if m_type is wxBITMAP_TYPE_ANY
bool m_yaxis
 axis is up or down
a2dBoundingBox m_viewBox
 viewing area in world coordinates to display on bitmap
long m_maxWidthHeight


Detailed Description

Input and output handler for a2dCanvasDocument to/from a wxImage.

This IoHandler is to render parts of a a2dCanvasDocument to an wxImage, and save this as a bitmap to a stream. The maximum size of the bitmap in X or Y is given upfront or else asked for. The a2dCanvasObject to display is set, or the root object of the a2dCanvasDocument is used. The part to display is set as a rectangle defined in world coordinates. That part seen from the m_showObject, is rendered to the image. The image is sized, taking into account the maximum size, such that the view rectangle fits it. The image size can be set upfront, in which case the drawing will be centered on that image size.

The rendering itself is done via a a2dDrawer2D, which can be set. The default is a2dMemDcDrawer. You can use a2dAggDrawer for antialiased drawing etc.

Definition at line 83 of file imageioh.h.


Member Function Documentation

a2dCanvasObject* a2dCanvasDocumentIOHandlerImageOut::GetShowObject (  )  const [inline]

return pointer of then currently shown object on the drawer.

Returns:
pointer to the current object that is shown.

Definition at line 105 of file imageioh.h.

void a2dCanvasDocumentIOHandlerImageOut::SetViewRectangle ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Give the virtual size to be rendered to an image.

Here you give the minimum and maximum in world coordinates, which must be displayed on the bitmap.

SetImageSize() is used for the image size itself.

Parameters:
minx minimum x coordinate of display area
miny minimum y coordinate of display area
maxx maximum x coordinate of display area
maxy maximum y coordinate of display area
Remarks:
these setting are only used when m_automaticScale is set false.

Definition at line 148 of file imageioh.cpp.

void a2dCanvasDocumentIOHandlerImageOut::SetViewRectangle ( a2dBoundingBox  viewBox  )  [inline]

Give the virtual size to be rendered to an image as boundingbox.

Here you give the minimum and maximum in world coordinates, which must be displayed on the bitmap.

Parameters:
viewBox boundingbox in world coordinates to display

Definition at line 134 of file imageioh.h.


The documentation for this class was generated from the following files:
a2dCanvasDocumentIOHandlerImageOut Class Reference -- Tue Aug 31 18:12:37 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation