FOX/ObjCryst++  1.10.X (development)
ObjCryst::WXPowderPatternGraph Class Reference

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

+ Inheritance diagram for ObjCryst::WXPowderPatternGraph:
+ Collaboration diagram for ObjCryst::WXPowderPatternGraph:

Public Member Functions

 WXPowderPatternGraph (wxFrame *frame, WXPowderPattern *parent)
 Constructor. The top frame should have a Status bar with two fields (at least)
 
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. More...
 
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. More...
 
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. More...
 
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 OnLoadPeaks (wxCommandEvent &WXUNUSED(event))
 
void OnSavePeaks (wxCommandEvent &WXUNUSED(event))
 
void OnChangePeak (wxCommandEvent &WXUNUSED(event))
 Add or remove peak.
 
void OnIndex (wxCommandEvent &WXUNUSED(event))
 
void OnChangeScale (wxCommandEvent &event)
 
void OnLeBail (wxCommandEvent &event)
 Profile fitting & Le Bail intensity extraction.
 
void OnKeyDown (wxKeyEvent &event)
 
void OnSize (wxSizeEvent &event)
 
WXPowderPatternGetWXPowderPattern ()
 
const WXPowderPatternGetWXPowderPattern () const
 

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
 
CrystVector_REAL mCalc
 
CrystVector_REAL m2theta
 
CrystVector_REAL mSigma
 
CrystVector_REAL mChi2Cumul
 
const long mMargin
 
const REAL mDiffPercentShift
 
REAL mMaxIntensity
 
REAL mMinIntensity
 
REAL mMinX
 
REAL mMaxX
 
bool mDefaultIntensityScale
 True if no vertical zoom has been used.
 
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
 
RefinableObjClock mClockAxisLimits
 Clock corresponding to when the graph limits where last changed. More...
 
bool mDisplayLabel
 Display labels ?
 
bool mDisplayPeak
 Display peaks ?
 
list< list< pair< const REAL,const
string > > > 
mvLabelList
 The lists of labels for all components of the powder pattern.
 
PeakList mPeakList
 List of observed peak positions.
 
long mXScale
 Scaling options for x and y axis x: 0 data (2theta, tof) ; 1: 1/d ; 2: 2pi/d y: 0 linear ; 1: sqrt(I) ; 2: log10(I)
 
long mYScale
 

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.

Definition at line 75 of file wxPowderPattern.h.

Member Function Documentation

void ObjCryst::WXPowderPatternGraph::OnUpdate ( wxCommandEvent &  WXUNUSEDevent)

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

This calls the WXPowderPattern::CrystUpdate().

Definition at line 1781 of file wxPowderPattern.cpp.

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
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.

Definition at line 3091 of file wxPowderPattern.cpp.

Member Data Documentation

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.

Definition at line 157 of file wxPowderPattern.h.


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