The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcugtk::SpectrumView Class Reference

#include <gcugtk/spectrumview.h>

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
void AddToOptionBox (GtkWidget *w)
void DestroyExtraWidget ()
SpectrumDocumentGetDoc (void) const
GtkWidget * GetWidget (void) const
GtkWidget * GetOptionBox (void) const
GogSeries * GetSeries (void) const
int GetWidth (void) const
int GetHeight (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

gcugtk::SpectrumView::SpectrumView ( SpectrumDocument pDoc)

Constructor.

Parameters
pDoc,:a pointer to the SpectrumDocument instance.

Creates a view for the document.

virtual gcugtk::SpectrumView::~SpectrumView ( )
virtual

Destructor.

The destructor of SpectrumView.

Member Function Documentation

void gcugtk::SpectrumView::AddToOptionBox ( GtkWidget *  w)
Parameters
wthe widget to add to the view.

Adds a widget to display more options to the view.

void gcugtk::SpectrumView::DestroyExtraWidget ( )

Destroys any widget that might have been added to the view using AddToOptionBox().

gcugtk::SpectrumView::GetDoc ( void  ) const
inline
Returns
the associated document.

Definition at line 170 of file spectrumview.h.

gcugtk::SpectrumView::GetHeight ( void  ) const
inline
Returns
the view height.

Definition at line 190 of file spectrumview.h.

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

Definition at line 178 of file spectrumview.h.

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

Definition at line 182 of file spectrumview.h.

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

Definition at line 174 of file spectrumview.h.

gcugtk::SpectrumView::GetWidth ( void  ) const
inline
Returns
the view width.

Definition at line 186 of file spectrumview.h.

void gcugtk::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* gcugtk::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.
void gcugtk::SpectrumView::OnMaxChanged ( )

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

void gcugtk::SpectrumView::OnMinChanged ( )

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

void gcugtk::SpectrumView::OnXRangeChanged ( )

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

void gcugtk::SpectrumView::OnYMaxChanged ( )

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

void gcugtk::SpectrumView::OnYMinChanged ( )

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

void gcugtk::SpectrumView::OnYRangeChanged ( )

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

void gcugtk::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 gcugtk::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 gcugtk::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 gcugtk::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 gcugtk::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: