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 OnMenuShowGraph(wxCommandEvent & WXUNUSED(event));
43 void OnMenuSaveText(wxCommandEvent & WXUNUSED(event));
44 void OnMenuSimulate(wxCommandEvent & WXUNUSED(event));
45 void OnMenuImportPattern(wxCommandEvent & WXUNUSED(event));
46 void OnMenuFitScaleForR(wxCommandEvent & WXUNUSED(event));
47 void OnMenuFitScaleForRw(wxCommandEvent & WXUNUSED(event));
48 void OnMenuSavePattern(wxCommandEvent & WXUNUSED(event));
49 void OnMenuSetWavelength(wxCommandEvent &event);
50 void OnMenuAddExclude(wxCommandEvent & WXUNUSED(event));
53 void OnMenuExport(wxCommandEvent &event);
54 void NotifyDeleteGraph();
57 void UpdateUI(
const bool mutexlock=
false);
82 void OnPaint(wxPaintEvent& WXUNUSED(event));
84 void OnMouse(wxMouseEvent &event);
89 void OnUpdate(wxCommandEvent & WXUNUSED(event));
96 const CrystVector_REAL &calc,
97 const REAL tthetaMin,
const REAL tthetaStep,
98 const CrystVector_REAL &sigma,
99 const CrystVector_REAL &chi2Cumul);
104 const CrystVector_REAL &obs,
105 const CrystVector_REAL &calc,
106 const CrystVector_REAL &sigma,
107 const CrystVector_REAL &chi2Cumul);
110 void OnToggleLabel(wxCommandEvent& WXUNUSED(event));
111 void OnFindPeaks(wxCommandEvent& WXUNUSED(event));
112 void OnLoadPeaks(wxCommandEvent& WXUNUSED(event));
113 void OnSavePeaks(wxCommandEvent& WXUNUSED(event));
116 void OnIndex(wxCommandEvent& WXUNUSED(event));
117 void OnChangeScale(wxCommandEvent &event);
119 void OnLeBail(wxCommandEvent &event);
120 void OnKeyDown(wxKeyEvent& event);
121 void OnSize(wxSizeEvent& event);
139 CrystVector_REAL
mX,mObs,mCalc,m2theta,mSigma,mChi2Cumul;
141 const REAL mDiffPercentShift;
142 REAL mMaxIntensity,mMinIntensity,mMinX,mMaxX;
145 wxFrame *mpParentFrame;
170 DECLARE_EVENT_TABLE()
184 void OnMenuImportUserBackground(wxCommandEvent & WXUNUSED(event));
185 void OnMenuOptimizeBayesianBackground(wxCommandEvent & WXUNUSED(event));
186 void OnMenuAutomaticBayesianBackground(wxCommandEvent & WXUNUSED(event));
187 void OnEditGridBackgroundPoint(wxGridEvent &e);
188 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
189 virtual void UpdateUI(
const bool mutexlock=
false);
190 virtual bool Enable(
bool enable=
true);
193 wxGrid *mpGridBackgroundPoint;
198 bool mIsSelfUpdating;
199 DECLARE_EVENT_TABLE()
210 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
211 virtual void UpdateUI(
const bool mutexlock=
false);
227 void OnAddTexturePhase(wxCommandEvent & WXUNUSED(event));
228 void OnDeleteTexturePhase(wxCommandEvent & WXUNUSED(event));
231 DECLARE_EVENT_TABLE()
257 void OnChangeCrystal(wxCommandEvent & WXUNUSED(event));
258 void OnMenuSaveHKLFcalc(wxCommandEvent & WXUNUSED(event));
259 void OnChangeProfile(wxCommandEvent & event);
260 virtual void CrystUpdate(
const bool updateUI=
false,
const bool mutexlock=
false);
261 virtual void UpdateUI(
const bool mutexlock=
false);
262 virtual bool Enable(
bool enable=
true);
264 void OnLeBail(wxCommandEvent &event);
270 wxCheckBox *mpProfileFittingMode;
271 wxCheckBox *mpFreezeLatticePar;
272 wxGrid *mpGridFrozenLatticePar;
273 bool mFreezeLatticePar;
274 CrystVector_REAL mFrozenLatticePar;
277 DECLARE_EVENT_TABLE()
322 #endif //_VFN_WX_POWDERPATTERN_H_
bool mNeedUpdateUI
True if the list of points has changed since last displayed.
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
void OnUpdate(wxCommandEvent &WXUNUSED(event))
Update the powder spectrum, at the user's request.
list< list< pair< const REAL,const string > > > mvLabelList
The lists of labels for all components of the powder pattern.
Texture correction using the March-Dollase model.
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
long Data2ScreenY(const REAL y) const
Convert Y data (intensity) coordinate to screen coordinate (pixel)
Pseudo-Voigt reflection profile, with 6-parameters anisotropic Lorentzian broadening and Toraya asymm...
A List of WXCrystObjBasic.
Double-Exponential Pseudo-Voigt profile for TOF.
Class to pick one choice...
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
bool mDisplayLabel
Display labels ?
void OnRedrawNewPattern(wxUpdateUIEvent &WXUNUSED(event))
Redraw the pattern (special function to ensure complete redrawing under windows...)
void OnLeBail(wxCommandEvent &event)
Perform Le Bail extraction.
Class to display one Preferred Orientation phase using the March-Dollase parametrization.
Class to display a Powder Pattern (calc,obs) in a graphic window.
void ResetAxisLimits()
Reset the limits of the axis to full range.
virtual void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
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...
Class to display a Powder Pattern Background.
One texture phase for the March-Dollase model.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
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...
Texture correction using the Ellipsoidal preferred orientation function.
void OnChangePeak(wxCommandEvent &WXUNUSED(event))
Add or remove peak.
Phase to compute a background contribution to a powder pattern using an interpolation.
Class to display a Powder Pattern Pseudo-Voigt Profile with Anisotropic broadening.
WXPowderPatternGraph(wxFrame *frame, WXPowderPattern *parent)
Constructor. The top frame should have a Status bar with two fields (at least)
Class to compute the contribution to a powder pattern from a crystalline phase.
This displays all components of a ObjCryst++ Registry.
void OnMenuLeBail(wxCommandEvent &event)
Profile fitting & Le Bail intensity extraction.
Class to store positions of observed reflections.
PeakList mPeakList
List of observed peak positions.
Class to display the Preferred Orientation Correction using the March-Dollase parametrization.
Class to display a Powder Pattern for a crystalline phase.
Abstract base class for all objects in wxCryst.
void OnPaint(wxPaintEvent &WXUNUSED(event))
Redraw the spectrum.
WX Class for PowderPattern objects.
CrystMutex mMutex
Mutex to lock the pattern and associated data.
REAL mDraggingX0
Remember coordinates at the beginning of the dragging.
bool mDefaultIntensityScale
True if no vertical zoom has been used.
REAL Screen2DataY(const long y) const
Convert Y screen coordinate (pixel) to data (intensity) coordinate.
bool mDisplayPeak
Display peaks ?
void UpdateUI(const bool mutexlock=false)
Update the User Interface, if necessary.
virtual bool OnChangeName(const int id)
When a WXFieldName has been changed by the user, it is handled here.
long Point2ScreenX(const long x) const
Convert X data (as data point index) to screen coordinate (pixel)
Powder pattern class, with an observed pattern and several calculated components to modelize the patt...
void OnMouseWheel(wxMouseEvent &event)
Wheel wan be used to scroll the pattern.
Class to display a Powder Pattern Pseudo-Voigt Profile.
Base class for all displayed ObjCryst objects (with a title, and a sizer to stack objects)...
RefinableObjClock mClockAxisLimits
Clock corresponding to when the graph limits where last changed.
long Data2ScreenX(const REAL x) const
Convert X data (2theta) coordinate to screen coordinate (pixel)
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 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.
The base wxCryst class for all RefinableObj objects.
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)...
REAL Screen2DataX(const long x) const
Convert X screen coordinate (pixel) to data (2theta) coordinate.
CrystVector_REAL mX
Data vectors (Note that when x coordinates are 2theta, they are stored in degrees here) ...
Class to display one Preferred Orientation phase using the Ellipsoid model.
bool mIsDragging
Are we within a dragging event ?
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
wxMenu * mpPopUpMenu
Pop-up menu.
void OnFreezeLatticePar(wxCommandEvent &event)
Freeze lattice parameter, which will not follow anymore the Crystal Unitcell values.
CrystVector_REAL mBackgroundInterpPointX
Copy of the list of points and intensity.
Class to display a Powder Pattern Pseudo-Voigt Profile.
Pseudo-Voigt reflection profile.
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 OnLeBail(wxCommandEvent &event)
Profile fitting & Le Bail intensity extraction.
void OnMouse(wxMouseEvent &event)
Display the Theta and intensity values at the mouse position, in the status bar.