@@ -2604,6 +2604,43 @@ void PowderPattern::AddPowderPatternComponent(PowderPatternComponent &comp)
2604
2604
VFN_DEBUG_EXIT (" PowderPattern::AddPowderPatternComponent():" <<comp.GetName (),5 )
2605
2605
}
2606
2606
2607
+ void PowderPattern::RemovePowderPatternComponent (PowderPatternComponent &comp)
2608
+ {
2609
+ VFN_DEBUG_ENTRY (" PowderPattern::RemovePowderPatternComponent():" <<comp.GetName (),5 )
2610
+ if (comp.IsScalable ())
2611
+ {
2612
+ // Remove one scale factor parameter
2613
+ cout<<" PowderPattern::RemovePowderPatternComponent: removing 1 scale paramater" <<endl;
2614
+ this ->Print ();
2615
+ this ->RemovePar (&this ->GetPar (mScaleFactor .data ()+mPowderPatternComponentRegistry .GetNb ()-1 ));
2616
+ this ->Print ();
2617
+ }
2618
+
2619
+ this ->RemoveSubRefObj (comp);
2620
+ comp.DeRegisterClient (*this );
2621
+ mClockPowderPatternCalc .Reset ();
2622
+ mClockIntegratedFactorsPrep .Reset ();
2623
+ mPowderPatternComponentRegistry .DeRegister (comp);
2624
+
2625
+ // Shift scale factors
2626
+ unsigned int i=0 ;
2627
+ for (unsigned int i=0 ;i<this ->GetNbPowderPatternComponent ();i++)
2628
+ if (&comp == &this ->GetPowderPatternComponent (i)) break ;
2629
+ for (unsigned int j=i;j<this ->GetNbPowderPatternComponent ()-1 ;j++) mScaleFactor (j) = mScaleFactor (j+1 );
2630
+
2631
+ mClockScaleFactor .Click ();
2632
+ this ->UpdateDisplay ();
2633
+ VFN_DEBUG_EXIT (" PowderPattern::RemovePowderPatternComponent():" <<comp.GetName (),5 )
2634
+ }
2635
+
2636
+ void PowderPattern::RemovePowderPatternComponent (const int i)
2637
+ {
2638
+ VFN_DEBUG_ENTRY (" PowderPattern::RemovePowderPatternComponent():" <<i,5 )
2639
+ this ->RemovePowderPatternComponent (mPowderPatternComponentRegistry .GetObj (i));
2640
+ VFN_DEBUG_EXIT (" PowderPattern::RemovePowderPatternComponent():" <<i,5 )
2641
+ }
2642
+
2643
+
2607
2644
unsigned int PowderPattern::GetNbPowderPatternComponent ()const
2608
2645
{
2609
2646
return mPowderPatternComponentRegistry .GetNb ();
0 commit comments