diff --git a/contrib/mobile/drawContext.cpp b/contrib/mobile/drawContext.cpp index f8c45f6df029fd8060ef9f9f0c11c264d99db94d..ea30ee420a58eff5cd6133be7f40a53d7e41aaf9 100644 --- a/contrib/mobile/drawContext.cpp +++ b/contrib/mobile/drawContext.cpp @@ -382,7 +382,7 @@ void drawContext::drawScale() double height = size / 10.; double dh = height / 5; - // Draw the scale bar + // Draw the scale bar int nPview = 0; for(int i=0; i<PView::list.size();i++){ PView *p = PView::list[i]; @@ -578,6 +578,51 @@ void drawContext::drawAxes() glPopMatrix(); } +int drawContext::fix2dCoordinates(double *x, double *y) +{ + int ret = (*x > 99999 && *y > 99999) ? 3 : (*y > 99999) ? 2 : (*x > 99999) ? 1 : 0; + + if(*x < 0) // measure from right border + *x = _right + *x; + else if(*x > 99999) // by convention, x-centered + *x = _right / 2; + + if(*y < 0) // measure from bottom border + *y = -(*y); + else if(*y > 99999) // by convention, y-centered + *y = _top / 2.; + else + *y = _top - *y; + return ret; +} + +void drawContext::drawText2d() +{ + glPushMatrix(); + glLoadIdentity(); + + for(unsigned int i = 0; i < PView::list.size(); i++){ + PViewData *data = PView::list[i]->getData(); + PViewOptions *opt = PView::list[i]->getOptions(); + if(opt->visible && opt->drawStrings){ + for(int j = 0; j < data->getNumStrings2D(); j++){ + double x, y, style; + std::string str; + data->getString2D(j, opt->timeStep, str, x, y, style); + //fix2dCoordinates(&x, &y); + GLfloat colors[] = {0., 0, 0, 1.}; + drawString s(str.c_str(), 20 * _fontFactor, colors); + // FIXME: + s.draw(_left + (_right - _left) / 2., + _bottom + 0.8 * (_top - _bottom), 0, + _width/(_right-_left), _height/(_top-_bottom), true); + } + } + } + + glPopMatrix(); +} + void drawContext::drawView() { OrthofFromGModel(); @@ -651,6 +696,8 @@ void drawContext::drawView() checkGlError("Draw scales"); drawAxes(); checkGlError("Draw axes"); + drawText2d(); + checkGlError("Draw text2d"); } std::vector<std::string> commandToVector(const std::string cmd) diff --git a/contrib/mobile/drawContext.h b/contrib/mobile/drawContext.h index ac7076d86c0a0ba68b06787c9a2ec07114665550..5768e5406a1a2a6021f0fca6e27ea50f67bd18a3 100644 --- a/contrib/mobile/drawContext.h +++ b/contrib/mobile/drawContext.h @@ -36,12 +36,14 @@ public: void setScale(int i, float s) {if(i>=0 && i<3) _scale[i] = s;} float getScale(int i) {if(i>=0 && i<3) return _scale[i]; return 0;} void initView(int w, int h); + int fix2dCoordinates(double *x, double *y); void drawView(); void drawAxes(); void drawGeom(); void drawMesh(); void drawPost(); void drawScale(); + void drawText2d(); }; void drawArray(VertexArray *va, int type, bool useColorArray=false, diff --git a/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj b/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj index 173b753edbd859a15fe7685476e35d6af7cb9d1a..3eb4164b4b14ecf778a0d1b33a2b95bcf8300f3c 100644 --- a/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj +++ b/contrib/mobile/iOS/Onelab.xcodeproj/project.pbxproj @@ -445,7 +445,6 @@ 9C96086D1712C16400E1D4A0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; @@ -475,7 +474,6 @@ 9C96086E1712C16400E1D4A0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; diff --git a/contrib/mobile/utils/iOS.cmake b/contrib/mobile/utils/iOS.cmake index 5c79dd14c8f1bf79420d61bbf9a0ee0bde91965d..611a6c9363dc6554f78839f84711dbeaaa2d6ec2 100644 --- a/contrib/mobile/utils/iOS.cmake +++ b/contrib/mobile/utils/iOS.cmake @@ -25,10 +25,10 @@ set (UNIX True) set (APPLE True) set (IOS True) -# Force the compilers to gcc for iOS -include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER (gcc gcc) -CMAKE_FORCE_CXX_COMPILER (g++ g++) +# Force the compilers to gcc for iOS - removed for Yosemite XCode +#include (CMakeForceCompiler) +#CMAKE_FORCE_C_COMPILER (gcc gcc) +#CMAKE_FORCE_CXX_COMPILER (g++ g++) # Skip the platform compiler checks for cross compiling set (CMAKE_CXX_COMPILER_WORKS TRUE)