Skip to content
Snippets Groups Projects
Commit 6b929c5d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

set min/max for raise

parent 7e8e859e
No related branches found
No related tags found
No related merge requests found
#import "PostProcessingViewController.h"
#include <gmsh/Context.h>
@interface PostProcessingViewController ()
@end
......@@ -30,7 +32,6 @@
[_IntervalsType setDelegate:self];
[_Intervals setText:[NSString stringWithFormat:@"%d",_pview->getOptions()->nbIso]];
UIToolbar* numberToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
numberToolbar.barStyle = UIBarStyleBlackTranslucent;
numberToolbar.items = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
[[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneWithNumberPad)],
......@@ -39,6 +40,12 @@
_Intervals.delegate = self;
_Intervals.inputAccessoryView = numberToolbar;
[_RaiseZ setValue:_pview->getOptions()->raise[2]];
double maxval = std::max(fabs(_pview->getData()->getMin()), fabs(_pview->getData()->getMax()));
if(!maxval) maxval = 1.;
double val2 = 2. * CTX::instance()->lc / maxval;
[_RaiseZ setMinimumValue:-val2];
[_RaiseZ setMaximumValue:val2];
[_RaiseZ addTarget:self action:@selector(slideRaiseZ:) forControlEvents:UIControlEventValueChanged];
[_IntervalsStepper setStepValue:1];
[_IntervalsStepper setValue:_pview->getOptions()->nbIso];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment