20 #ifndef _VFN_WX_POWDERPATTERN_H_
21 #define _VFN_WX_POWDERPATTERN_H_
25 #include "ObjCryst/wxCryst/wxRefinableObj.h"
26 #include "ObjCryst/ObjCryst/ScatteringCorr.h"
27 #include "ObjCryst/ObjCryst/PowderPattern.h"
28 #include "ObjCryst/ObjCryst/Indexing.h"
31 class WXPowderPatternGraph;
38 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
39 void OnMenuAddCompBackgd(wxCommandEvent & WXUNUSED(event));
40 void OnMenuAddCompBackgdBayesian(wxCommandEvent & WXUNUSED(event));
41 void OnMenuAddCompCryst(wxCommandEvent & WXUNUSED(event));
42 void OnMenuRemoveComp(wxCommandEvent & WXUNUSED(event));
43 void OnMenuShowGraph(wxCommandEvent & WXUNUSED(event));
44 void OnMenuSaveText(wxCommandEvent & WXUNUSED(event));
45 void OnMenuSimulate(wxCommandEvent & WXUNUSED(event));
46 void OnMenuImportPattern(wxCommandEvent & WXUNUSED(event));
47 void OnMenuFitScaleForR(wxCommandEvent & WXUNUSED(event));
48 void OnMenuFitScaleForRw(wxCommandEvent & WXUNUSED(event));
49 void OnMenuSavePattern(wxCommandEvent & WXUNUSED(event));
50 void OnMenuSetWavelength(wxCommandEvent &event);
51 void OnMenuAddExclude(wxCommandEvent & WXUNUSED(event));
54 void OnMenuExport(wxCommandEvent &event);
55 void NotifyDeleteGraph();
58 void UpdateUI(
const bool mutexlock=
false);
85 void OnPaint(wxPaintEvent& WXUNUSED(event));
87 void OnMouse(wxMouseEvent &event);
92 void OnUpdate(wxCommandEvent & WXUNUSED(event));
99 const CrystVector_REAL &calc,
100 const REAL tthetaMin,
const REAL tthetaStep,
101 const CrystVector_REAL &sigma,
102 const CrystVector_REAL &chi2Cumul);
107 const CrystVector_REAL &obs,
108 const CrystVector_REAL &calc,
109 const CrystVector_REAL &sigma,
110 const CrystVector_REAL &chi2Cumul);
113 void OnToggleLabel(wxCommandEvent& WXUNUSED(event));
114 void OnFindPeaks(wxCommandEvent& WXUNUSED(event));
115 void OnLoadPeaks(wxCommandEvent& WXUNUSED(event));
116 void OnSavePeaks(wxCommandEvent& WXUNUSED(event));
119 void OnIndex(wxCommandEvent& WXUNUSED(event));
120 void OnChangeScale(wxCommandEvent &event);
122 void OnLeBail(wxCommandEvent &event);
123 void OnKeyDown(wxKeyEvent& event);
124 void OnSize(wxSizeEvent& event);
142 CrystVector_REAL
mX,mObs,mCalc,m2theta,mSigma,mChi2Cumul;
144 const REAL mDiffPercentShift;
145 REAL mMaxIntensity,mMinIntensity,mMinX,mMaxX;
148 wxFrame *mpParentFrame;
173 DECLARE_EVENT_TABLE()
187 void OnMenuImportUserBackground(wxCommandEvent & WXUNUSED(event));
188 void OnMenuOptimizeBayesianBackground(wxCommandEvent & WXUNUSED(event));
189 void OnMenuAutomaticBayesianBackground(wxCommandEvent & WXUNUSED(event));
190 void OnEditGridBackgroundPoint(wxGridEvent &e);
191 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
192 virtual void UpdateUI(
const bool mutexlock=
false);
193 virtual bool Enable(
bool enable=
true);
196 wxGrid *mpGridBackgroundPoint;
201 bool mIsSelfUpdating;
202 DECLARE_EVENT_TABLE()
213 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
214 virtual void UpdateUI(
const bool mutexlock=
false);
230 void OnAddTexturePhase(wxCommandEvent & WXUNUSED(event));
231 void OnDeleteTexturePhase(wxCommandEvent & WXUNUSED(event));
234 DECLARE_EVENT_TABLE()
260 void OnChangeCrystal(wxCommandEvent & WXUNUSED(event));
261 void OnMenuSaveHKLFcalc(wxCommandEvent & WXUNUSED(event));
262 void OnChangeProfile(wxCommandEvent & event);
263 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
264 virtual void UpdateUI(
const bool mutexlock=
false);
265 virtual bool Enable(
bool enable=
true);
267 void OnLeBail(wxCommandEvent &event);
273 wxCheckBox *mpProfileFittingMode;
274 wxCheckBox *mpFreezeLatticePar;
275 wxGrid *mpGridFrozenLatticePar;
276 bool mFreezeLatticePar;
277 CrystVector_REAL mFrozenLatticePar;
280 DECLARE_EVENT_TABLE()
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Class to store positions of observed reflections.
Phase to compute a background contribution to a powder pattern using an interpolation.
Class to compute the contribution to a powder pattern from a crystalline phase.
Powder pattern class, with an observed pattern and several calculated components to modelize the patt...
Pseudo-Voigt reflection profile.
Pseudo-Voigt reflection profile, with 6-parameters anisotropic Lorentzian broadening and Toraya asymm...
Double-Exponential Pseudo-Voigt profile for TOF.
One texture phase for the March-Dollase model.
Texture correction using the March-Dollase model.
Texture correction using the Ellipsoidal preferred orientation function.
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
Abstract base class for all objects in wxCryst.
A List of WXCrystObjBasic.
Base class for all displayed ObjCryst objects (with a title, and a sizer to stack objects).
Class to pick one choice...
WX Class for PowderPattern objects.
void OnMenuLeBail(wxCommandEvent &event)
Profile fitting & Le Bail intensity extraction.
virtual void CrystUpdate(const bool updateUI=false, const bool mutexlock=false)
Get new values to be displayed from the underlying object, and raise flag if an UI update is necessar...
void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
bool mPowderPatternWasPreviouslyEmpty
This flag is used to automatically open the powder pattern graph once data has been loaded.
Class to display a Powder Pattern (calc,obs) in a graphic window.
bool mDisplayPeak
Display peaks ?
CrystMutex mMutex
Mutex to lock the pattern and associated data.
PeakList mPeakList
List of observed peak positions.
REAL mDraggingX0
Remember coordinates at the beginning of the dragging.
list< list< pair< const REAL,const string > > > mvLabelList
The lists of labels for all components of the powder pattern.
bool mIsDragging
Are we within a dragging event ?
void OnMouse(wxMouseEvent &event)
Display the Theta and intensity values at the mouse position, in the status bar.
void OnChangePeak(wxCommandEvent &WXUNUSED(event))
Add or remove peak.
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.
long Data2ScreenY(const REAL y) const
Convert Y data (intensity) coordinate to screen coordinate (pixel)
void OnPaint(wxPaintEvent &WXUNUSED(event))
Redraw the spectrum.
REAL Screen2DataX(const long x) const
Convert X screen coordinate (pixel) to data (2theta) coordinate.
void OnUpdate(wxCommandEvent &WXUNUSED(event))
Update the powder spectrum, at the user's request.
void OnLeBail(wxCommandEvent &event)
Profile fitting & Le Bail intensity extraction.
REAL Screen2DataY(const long y) const
Convert Y screen coordinate (pixel) to data (intensity) coordinate.
void OnRedrawNewPattern(wxUpdateUIEvent &WXUNUSED(event))
Redraw the pattern (special function to ensure complete redrawing under windows......
long Data2ScreenX(const REAL x) const
Convert X data (2theta) coordinate to screen coordinate (pixel)
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)...
RefinableObjClock mClockAxisLimits
Clock corresponding to when the graph limits where last changed.
bool mDisplayLabel
Display labels ?
long Point2ScreenX(const long x) const
Convert X data (as data point index) to screen coordinate (pixel)
void ResetAxisLimits()
Reset the limits of the axis to full range.
wxMenu * mpPopUpMenu
Pop-up menu.
WXPowderPatternGraph(wxFrame *frame, WXPowderPattern *parent)
Constructor. The top frame should have a Status bar with two fields (at least)
void OnMouseWheel(wxMouseEvent &event)
Wheel wan be used to scroll the pattern.
CrystVector_REAL mX
Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here)
bool mDefaultIntensityScale
True if no vertical zoom has been used.
Class to display a Powder Pattern Background.
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
virtual void CrystUpdate(const bool updateUI=false, const bool mutexlock=false)
Get new values to be displayed from the underlying object, and raise flag if an UI update is necessar...
bool mNeedUpdateUI
True if the list of points has changed since last displayed.
CrystVector_REAL mBackgroundInterpPointX
Copy of the list of points and intensity.
Class to display one Preferred Orientation phase using the March-Dollase parametrization.
virtual void CrystUpdate(const bool updateUI=false, const bool mutexlock=false)
Get new values to be displayed from the underlying object, and raise flag if an UI update is necessar...
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
Class to display the Preferred Orientation Correction using the March-Dollase parametrization.
Class to display one Preferred Orientation phase using the Ellipsoid model.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
Class to display a Powder Pattern for a crystalline phase.
void OnLeBail(wxCommandEvent &event)
Perform Le Bail extraction.
virtual void CrystUpdate(const bool updateUI=false, const bool mutexlock=false)
Get new values to be displayed from the underlying object, and raise flag if an UI update is necessar...
void OnFreezeLatticePar(wxCommandEvent &event)
Freeze lattice parameter, which will not follow anymore the Crystal Unitcell values.
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
Class to display a Powder Pattern Pseudo-Voigt Profile.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
Class to display a Powder Pattern Pseudo-Voigt Profile with Anisotropic broadening.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
Class to display a Powder Pattern Pseudo-Voigt Profile.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
This displays all components of a ObjCryst++ Registry.
The base wxCryst class for all RefinableObj objects.