Skip to content
Snippets Groups Projects
Commit 1c061d91 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

Add file-sharing support

parent e24fa093
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ drawContext::drawContext()
}
static void checkGlError(const char* op) {
for (GLint error = glGetError(); error; error = glGetError())
for (GLint error = glGetError(); error; error = glGetError())
Msg::Error("%s: glError (0x%x)",op,error);
}
......@@ -158,8 +158,6 @@ void drawContext::OrthofFromGModel()
{
SBoundingBox3d bb = GModel::current()->bounds();
double ratio = (double)(this->_width ? this->_width : 1.) / (double)(this->_height ? this->_height : 1.);
double modelh = bb.max().y() - bb.min().y(), modelw = bb.max().x() - bb.min().x();
double modelratio = (modelw ? modelw : 1.) / (modelh ? modelh : 1.);
double xmin = -ratio, xmax = ratio, ymin = -1., ymax = 1.;
xmin = bb.min().x();
xmax = bb.max().x();
......@@ -322,7 +320,6 @@ void drawContext::drawVectorArray(PViewOptions *opt, VertexArray *va)
void drawContext::drawPView(PView *p)
{
PViewOptions *opt = p->getOptions();
PViewData *data = p->getData(true);
if(!opt->visible) return;
glPointSize((GLfloat)opt->pointSize);
......@@ -487,7 +484,7 @@ void drawContext::drawGeom()
(GLubyte)CTX::instance()->unpackGreen(col),
(GLubyte)CTX::instance()->unpackBlue(col),
(GLubyte)CTX::instance()->unpackAlpha(col));
glLineWidth(CTX::instance()->geom.lineWidth);
//glLineWidth((GLfloat)CTX::instance()->geom.lineWidth); OpenGL Error -> GL_INVALID_VALUE​, 0x0501
for(GModel::eiter it = GModel::current()->firstEdge(); it != GModel::current()->lastEdge(); it++){
GEdge *e = *it;
int N = e->minimumDrawSegments() + 1;
......@@ -496,7 +493,7 @@ void drawContext::drawGeom()
double t_max = t_bounds.high();
// Create a VA for this edge
GLfloat edge[N*3];
GLfloat *edge = (GLfloat *) malloc(N*3*sizeof(GLfloat));
for(unsigned int i=0; i < N; i++) {
double t = t_min + (double)i / (double)(N-1) * (t_max - t_min);
......@@ -508,6 +505,7 @@ void drawContext::drawGeom()
glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(GL_LINE_STRIP, 0, N);
glDisableClientState(GL_VERTEX_ARRAY);
free(edge);
}
glLineWidth(1);
}
......@@ -601,11 +599,15 @@ void drawContext::drawView()
this->drawAxes(this->_right - (this->_top - this->_bottom)/15.0,
this->_bottom + (this->_top - this->_bottom)/15.0,
0, (this->_top - this->_bottom)/20.);
checkGlError("Draw axes");
this->drawPost();
checkGlError("Draw post-pro");
if(_showGeom) this->drawGeom();
checkGlError("Draw geometry");
if(_showMesh) this->drawMesh();
checkGlError("Draw mesh");
this->drawScale();
checkGlError("Draw model,post-pro,...");
checkGlError("Draw scales");
}
std::vector<std::string> commandToVector(const std::string cmd)
......
......@@ -40,6 +40,7 @@
9CE08E18178AEC5F00A83B4B /* Trackball.h in Sources */ = {isa = PBXBuildFile; fileRef = 9CE08E05178AE6BE00A83B4B /* Trackball.h */; };
9CEAECC717A91CD20014D229 /* ModelListController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CEAECC617A91CD20014D229 /* ModelListController.mm */; };
9CF1C1ED17AA6E7E002CD2E3 /* iPhoneStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9CF1C1EB17AA6E7E002CD2E3 /* iPhoneStoryboard.storyboard */; };
9CF1C1EF17AA8997002CD2E3 /* Onelab-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9CF1C1EE17AA8997002CD2E3 /* Onelab-Info.plist */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -94,6 +95,8 @@
9CEAECC517A91CD20014D229 /* ModelListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelListController.h; sourceTree = "<group>"; };
9CEAECC617A91CD20014D229 /* ModelListController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ModelListController.mm; sourceTree = "<group>"; };
9CF1C1EC17AA6E7E002CD2E3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/iPhoneStoryboard.storyboard; sourceTree = "<group>"; };
9CF1C1EE17AA8997002CD2E3 /* Onelab-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Onelab-Info.plist"; sourceTree = "<group>"; };
9CF1C1F117AA8A7D002CD2E3 /* Onelab-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Onelab-Prefix.pch"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -168,7 +171,6 @@
isa = PBXGroup;
children = (
9CC85C011790286C00F241C4 /* files */,
9C95B7F51726C88E00C0CCE2 /* main.m */,
9C9608AA1712EF0900E1D4A0 /* iPadStoryboard.storyboard */,
9CF1C1EB17AA6E7E002CD2E3 /* iPhoneStoryboard.storyboard */,
9C9608491712C16300E1D4A0 /* AppDelegate.h */,
......@@ -190,6 +192,7 @@
9C96089E1712C8EB00E1D4A0 /* emulatorFix.c */,
9CEAECC517A91CD20014D229 /* ModelListController.h */,
9CEAECC617A91CD20014D229 /* ModelListController.mm */,
9CF1C1F017AA8A46002CD2E3 /* Supporting Files */,
);
path = Onelab;
sourceTree = "<group>";
......@@ -213,6 +216,16 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9CF1C1F017AA8A46002CD2E3 /* Supporting Files */ = {
isa = PBXGroup;
children = (
9CF1C1F117AA8A7D002CD2E3 /* Onelab-Prefix.pch */,
9C95B7F51726C88E00C0CCE2 /* main.m */,
9CF1C1EE17AA8997002CD2E3 /* Onelab-Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -289,6 +302,7 @@
9C9F8BCF174B5A23004332C5 /* ic_launcher.png in Resources */,
9CC85C021790286C00F241C4 /* files in Resources */,
9CF1C1ED17AA6E7E002CD2E3 /* iPhoneStoryboard.storyboard in Resources */,
9CF1C1EF17AA8997002CD2E3 /* Onelab-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -219,17 +219,17 @@
-(IBAction)PViewIntervalType:(id)sender
{
if( [((UIButton *)sender) titleForState:UIControlStateNormal] == @"Use Iso-values")
if( [[((UIButton *)sender) titleForState:UIControlStateNormal] isEqual: @"Use Iso-values"])
{
[((UIButton *)sender) setTitle:@"Use Continous map" forState:UIControlStateNormal];
PView::list[((UIButton *)sender).tag]->getOptions()->intervalsType = 1;
}
else if( [((UIButton *)sender) titleForState:UIControlStateNormal] == @"Use Continous map")
else if( [[((UIButton *)sender) titleForState:UIControlStateNormal] isEqual: @"Use Continous map"])
{
[((UIButton *)sender) setTitle:@"Use Filled iso-values" forState:UIControlStateNormal];
PView::list[((UIButton *)sender).tag]->getOptions()->intervalsType = 2;
}
else if( [((UIButton *)sender) titleForState:UIControlStateNormal] == @"Use Filled iso-values")
else if( [[((UIButton *)sender) titleForState:UIControlStateNormal] isEqual: @"Use Filled iso-values"])
{
[((UIButton *)sender) setTitle:@"Use Iso-values" forState:UIControlStateNormal];
PView::list[((UIButton *)sender).tag]->getOptions()->intervalsType = 3;
......@@ -240,8 +240,6 @@
- (void)viewDidUnload
{
[self setGlView:nil];
[self setGlView:nil];
[self setGlView:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
......
......@@ -91,7 +91,6 @@
NSUInteger ntouch = [[event allTouches] count];
UITouch* touch = [touches anyObject];
CGPoint position = [touch locationInView:self];
CGPoint lastPosition = [touch previousLocationInView:self];
switch(ntouch)
{
case 1:
......
......@@ -146,7 +146,6 @@
onelab::server::instance()->get(number,[paramName UTF8String]);
if(number.size() > 0){
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath: [NSIndexPath indexPathForRow:n inSection:i]];
UISlider *slider;
for(UIView *v in cell.subviews)
{
if ([v isKindOfClass:UISlider.class]){
......
......@@ -33,37 +33,23 @@
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell;
//NSString *modelName = [models objectAtIndex:indexPath.row];
if(indexPath.row >= [models count])
return cell;
NSString *modelName = [models objectAtIndex:indexPath.row];
cell = [tableView dequeueReusableCellWithIdentifier:modelName];
if(cell != nil) return cell;
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:modelName];
switch (indexPath.row) {
case 0:
cell = [tableView dequeueReusableCellWithIdentifier:@"magnet"];
if(cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"magnet"];
else
return cell;
[cell.textLabel setText:@"Magnet"];
[cell.detailTextLabel setText:@"A simple magnet example"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
break;
case 1:
cell = [tableView dequeueReusableCellWithIdentifier:@"pmsm"];
if(cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"pmsm"];
else
return cell;
[cell.textLabel setText:@"Eight-pole permanent magnet synchronous machine"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
break;
default:
cell = [tableView dequeueReusableCellWithIdentifier:@"Default"];
if(cell == nil)
return [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Default"];
else
return cell;
break;
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
......
......@@ -24,8 +24,12 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<string>iPhoneStoryboard</string>
<key>UIMainStoryboardFile~ipad</key>
<string>iPadStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
......@@ -35,6 +39,7 @@
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment