Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ObjCryst::WXPowderPatternGraph Class Reference

Class to display a Powder Pattern (calc,obs) in a graphic window. More...

Collaboration diagram for ObjCryst::WXPowderPatternGraph:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WXPowderPatternGraph (wxFrame *frame, WXPowderPattern *parent)
 Constructor. The top frame should have a Status bar with two fields (at least).

 ~WXPowderPatternGraph ()
void OnPaint (wxPaintEvent &WXUNUSED(event))
 Redraw the spectrum.

void OnMouse (wxMouseEvent &event)
 Display the Theta and intensity values at the mouse position, in the status bar.

void OnMouseWheel (wxMouseEvent &event)
 Wheel wan be used to scroll the pattern.

void OnUpdate (wxCommandEvent &WXUNUSED(event))
 Update the powder spectrum, at the user's request.

void SetPattern (const CrystVector_REAL &obs, const CrystVector_REAL &calc, const REAL tthetaMin, const REAL tthetaStep, const CrystVector_REAL &sigma, const CrystVector_REAL &chi2Cumul)
 Update the pattern.

void SetPattern (const CrystVector_REAL &x, const CrystVector_REAL &obs, const CrystVector_REAL &calc, const CrystVector_REAL &sigma, const CrystVector_REAL &chi2Cumul)
 Update the pattern.

void OnRedrawNewPattern (wxUpdateUIEvent &WXUNUSED(event))
 Redraw the pattern (special function to ensure complete redrawing under windows...).

void OnToggleLabel (wxCommandEvent &WXUNUSED(event))
void OnFindPeaks (wxCommandEvent &WXUNUSED(event))
void OnKeyDown (wxKeyEvent &event)
void OnSize (wxSizeEvent &event)

Private Member Functions

void ResetAxisLimits ()
 Reset the limits of the axis to full range.

long Data2ScreenX (const REAL x) const
 Convert X data (2theta) coordinate to screen coordinate (pixel).

long Point2ScreenX (const long x) const
 Convert X data (as data point index) to screen coordinate (pixel).

long Data2ScreenY (const REAL y) const
 Convert Y data (intensity) coordinate to screen coordinate (pixel).

REAL Screen2DataX (const long x) const
 Convert X screen coordinate (pixel) to data (2theta) coordinate.

REAL Screen2DataY (const long y) const
 Convert Y screen coordinate (pixel) to data (intensity) coordinate.


Private Attributes

WXPowderPatternmpPattern
CrystVector_REAL mX
 Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL mObs
 Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL mCalc
 Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL m2theta
 Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL mSigma
 Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL mChi2Cumul
 Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

const long mMargin
const REAL mDiffPercentShift
REAL mMaxIntensity
REAL mMinIntensity
REAL mMinX
REAL mMaxX
wxFrame * mpParentFrame
CrystMutex mMutex
 Mutex to lock the pattern and associated data.

wxMenu * mpPopUpMenu
 Pop-up menu.

bool mIsDragging
 Are we within a dragging event ?

REAL mDraggingX0
 Remember coordinates at the beginning of the dragging.

REAL mDraggingIntensity0
 Remember coordinates at the beginning of the dragging.

RefinableObjClock mClockAxisLimits
 Clock corresponding to when the graph limits where last changed.

bool mDisplayLabel
 Display labels ?

list< list< pair< const REAL,
const string > > > 
mvLabelList
 The lists of labels for all components of the powder pattern.


Detailed Description

Class to display a Powder Pattern (calc,obs) in a graphic window.

So far only displays calc and obs patterns.

Todo:
display the difference pattern. Allow to zoom. Display reflection positions for crystalline phases.


Constructor & Destructor Documentation

ObjCryst::WXPowderPatternGraph::WXPowderPatternGraph wxFrame *  frame,
WXPowderPattern parent
 

Constructor. The top frame should have a Status bar with two fields (at least).

ObjCryst::WXPowderPatternGraph::~WXPowderPatternGraph  ) 
 


Member Function Documentation

long ObjCryst::WXPowderPatternGraph::Data2ScreenX const REAL  x  )  const [private]
 

Convert X data (2theta) coordinate to screen coordinate (pixel).

long ObjCryst::WXPowderPatternGraph::Data2ScreenY const REAL  y  )  const [private]
 

Convert Y data (intensity) coordinate to screen coordinate (pixel).

void ObjCryst::WXPowderPatternGraph::OnFindPeaks wxCommandEvent &  WXUNUSED(event)  ) 
 

void ObjCryst::WXPowderPatternGraph::OnKeyDown wxKeyEvent &  event  ) 
 

void ObjCryst::WXPowderPatternGraph::OnMouse wxMouseEvent &  event  ) 
 

Display the Theta and intensity values at the mouse position, in the status bar.

void ObjCryst::WXPowderPatternGraph::OnMouseWheel wxMouseEvent &  event  ) 
 

Wheel wan be used to scroll the pattern.

void ObjCryst::WXPowderPatternGraph::OnPaint wxPaintEvent &  WXUNUSED(event)  ) 
 

Redraw the spectrum.

void ObjCryst::WXPowderPatternGraph::OnRedrawNewPattern wxUpdateUIEvent &  WXUNUSED(event)  ) 
 

Redraw the pattern (special function to ensure complete redrawing under windows...).

void ObjCryst::WXPowderPatternGraph::OnSize wxSizeEvent &  event  ) 
 

void ObjCryst::WXPowderPatternGraph::OnToggleLabel wxCommandEvent &  WXUNUSED(event)  ) 
 

void ObjCryst::WXPowderPatternGraph::OnUpdate wxCommandEvent &  WXUNUSED(event)  ) 
 

Update the powder spectrum, at the user's request.

This calls the WXPowderPattern::CrystUpdate().

long ObjCryst::WXPowderPatternGraph::Point2ScreenX const long  x  )  const [private]
 

Convert X data (as data point index) to screen coordinate (pixel).

void ObjCryst::WXPowderPatternGraph::ResetAxisLimits  )  [private]
 

Reset the limits of the axis to full range.

REAL ObjCryst::WXPowderPatternGraph::Screen2DataX const long  x  )  const [private]
 

Convert X screen coordinate (pixel) to data (2theta) coordinate.

REAL ObjCryst::WXPowderPatternGraph::Screen2DataY const long  y  )  const [private]
 

Convert Y screen coordinate (pixel) to data (intensity) coordinate.

void ObjCryst::WXPowderPatternGraph::SetPattern const CrystVector_REAL &  x,
const CrystVector_REAL &  obs,
const CrystVector_REAL &  calc,
const CrystVector_REAL &  sigma,
const CrystVector_REAL &  chi2Cumul
 

Update the pattern.

This is called by the WXPowderPattern parent.

void ObjCryst::WXPowderPatternGraph::SetPattern const CrystVector_REAL &  obs,
const CrystVector_REAL &  calc,
const REAL  tthetaMin,
const REAL  tthetaStep,
const CrystVector_REAL &  sigma,
const CrystVector_REAL &  chi2Cumul
 

Update the pattern.

This is called by the WXPowderPattern parent.

Deprecated:
Rather, use the new WXPowderPatternGraph::SetPattern() which takes a full vector of x coordinates rather than min & step


Member Data Documentation

CrystVector_REAL ObjCryst::WXPowderPatternGraph::m2theta [private]
 

Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL ObjCryst::WXPowderPatternGraph::mCalc [private]
 

Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

CrystVector_REAL ObjCryst::WXPowderPatternGraph::mChi2Cumul [private]
 

Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

RefinableObjClock ObjCryst::WXPowderPatternGraph::mClockAxisLimits [private]
 

Clock corresponding to when the graph limits where last changed.

This is compared to PowderPattern::GetClockPowderPatternPar() to know if these parameter need to be reset.

const REAL ObjCryst::WXPowderPatternGraph::mDiffPercentShift [private]
 

bool ObjCryst::WXPowderPatternGraph::mDisplayLabel [private]
 

Display labels ?

REAL ObjCryst::WXPowderPatternGraph::mDraggingIntensity0 [private]
 

Remember coordinates at the beginning of the dragging.

REAL ObjCryst::WXPowderPatternGraph::mDraggingX0 [private]
 

Remember coordinates at the beginning of the dragging.

bool ObjCryst::WXPowderPatternGraph::mIsDragging [private]
 

Are we within a dragging event ?

const long ObjCryst::WXPowderPatternGraph::mMargin [private]
 

REAL ObjCryst::WXPowderPatternGraph::mMaxIntensity [private]
 

REAL ObjCryst::WXPowderPatternGraph::mMaxX [private]
 

REAL ObjCryst::WXPowderPatternGraph::mMinIntensity [private]
 

REAL ObjCryst::WXPowderPatternGraph::mMinX [private]
 

CrystMutex ObjCryst::WXPowderPatternGraph::mMutex [private]
 

Mutex to lock the pattern and associated data.

CrystVector_REAL ObjCryst::WXPowderPatternGraph::mObs [private]
 

Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

wxFrame* ObjCryst::WXPowderPatternGraph::mpParentFrame [private]
 

WXPowderPattern* ObjCryst::WXPowderPatternGraph::mpPattern [private]
 

wxMenu* ObjCryst::WXPowderPatternGraph::mpPopUpMenu [private]
 

Pop-up menu.

CrystVector_REAL ObjCryst::WXPowderPatternGraph::mSigma [private]
 

Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).

list<list<pair<const REAL ,const string > > > ObjCryst::WXPowderPatternGraph::mvLabelList [private]
 

The lists of labels for all components of the powder pattern.

CrystVector_REAL ObjCryst::WXPowderPatternGraph::mX [private]
 

Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here).


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:07:29 2006 for ObjCryst++ by doxygen 1.3.6