The Gnome Chemistry Utils  0.12.11
Public Member Functions
gcu::SpectrumView Class Reference

#include <gcu/spectrumview.h>

List of all members.

Public Member Functions

 SpectrumView (SpectrumDocument *pDoc)
 Constructor.
virtual ~SpectrumView ()
 Destructor.
void SetAxisBounds (GogAxisType target, double min, double max, bool inverted)
void SetAxisLabel (GogAxisType target, char const *unit)
void ShowAxis (GogAxisType target, bool show)
void InvertAxis (GogAxisType target, bool inverted)
void Render (cairo_t *cr, double width, double height)
void OnMinChanged ()
void OnYMinChanged ()
void OnMaxChanged ()
void OnYMaxChanged ()
void OnXRangeChanged ()
void OnYRangeChanged ()
GogSeries * NewSeries (bool new_plot)
void SaveAsImage (std::string const &filename, char const *mime_type, unsigned width, unsigned height) const
SpectrumDocumentGetDoc (void) const
GtkWidget * GetWidget (void) const
GtkWidget * GetOptionBox (void) const
GogSeries * GetSeries (void) const

Detailed Description

The view class used for spectra. This API is still quite unstable and might change in the future.

Definition at line 38 of file spectrumview.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
pDoc,:a pointer to the SpectrumDocument instance.

Creates a view for the document.

virtual gcu::SpectrumView::~SpectrumView ( ) [virtual]

Destructor.

The destructor of SpectrumView.


Member Function Documentation

gcu::SpectrumView::GetDoc ( void  ) const [inline]
Returns:
the associated document.

Definition at line 156 of file spectrumview.h.

gcu::SpectrumView::GetOptionBox ( void  ) const [inline]
Returns:
a GtkBox to which an optional user interface might be added.

Definition at line 164 of file spectrumview.h.

gcu::SpectrumView::GetSeries ( void  ) const [inline]
Returns:
the first GogSeries* created for the view.

Definition at line 168 of file spectrumview.h.

gcu::SpectrumView::GetWidget ( void  ) const [inline]
Returns:
the widget used to display the spectrum.

Definition at line 160 of file spectrumview.h.

void gcu::SpectrumView::InvertAxis ( GogAxisType  target,
bool  inverted 
)
Parameters:
targetan axis type.
invertedwhether to invert the axis scale or not

Used to invert the first axis of either GOG_AXIS_X or GOG_AXIS_Y types.

GogSeries* gcu::SpectrumView::NewSeries ( bool  new_plot)
Parameters:
new_plotif true, a new plot is created (this is not yet implemented). Creates a new GogSeries for the chart.

Called by the framework if the maximum has changed for the x-axis.

Called by the framework if the minimum has changed for the x-axis.

Called by the framework if the range has changed for the x-axis.

Called by the framework if the maximum has changed for the y-axis.

Called by the framework if the minimum has changed for the y-axis.

Called by the framework if the range has changed for the y-axis.

void gcu::SpectrumView::Render ( cairo_t *  cr,
double  width,
double  height 
)
Parameters:
crthe cairo_t* to which render.
widththe width of the rendering area.
heightthe height of the rendering area.

Renders the chart to cr.

void gcu::SpectrumView::SaveAsImage ( std::string const &  filename,
char const *  mime_type,
unsigned  width,
unsigned  height 
) const
Parameters:
filenamethe name of the file.
mime_typethe requested mime type.
widththe width of the generated image.
heightthe height of the generated image.

Export the view contents as an image. The size of the new image is defined by the width and height parameters. Supported ilage file format include svg, png, jpeg, ps, eps, and pdf, and possibly a few other bitmap formats.

void gcu::SpectrumView::SetAxisBounds ( GogAxisType  target,
double  min,
double  max,
bool  inverted 
)
Parameters:
targetan axis type.
minthe mimimum value to show.
maxthe maximum value to show.
invertedwhether to invert the axis.

Sets the scale of the first axis of the selected type.

void gcu::SpectrumView::SetAxisLabel ( GogAxisType  target,
char const *  unit 
)
Parameters:
targetan axis type.
unita text (might be a unit).

Sets the text for the label of the first axis of the selected type.

void gcu::SpectrumView::ShowAxis ( GogAxisType  target,
bool  show 
)
Parameters:
targetan axis type.
showwhether to show the axis or not

Used to show or hide the first axis of either GOG_AXIS_X or GOG_AXIS_Y types.


The documentation for this class was generated from the following file: