diff --git a/Android/G3MAndroidTestingApplication/res/layout/goto_dialog.xml b/Android/G3MAndroidTestingApplication/res/layout/goto_dialog.xml new file mode 100644 index 0000000000..a340eca12a --- /dev/null +++ b/Android/G3MAndroidTestingApplication/res/layout/goto_dialog.xml @@ -0,0 +1,50 @@ + + + + + + + + + + +
+ Go to: lat: + + lon: + + hgt: + + pitch: + + +
+
+
+ + + + + \ No newline at end of file diff --git a/WebGL/G3MWebGLTestingApplication/war/org.glob3.mobile.G3MWebGLTestingApplication/org.glob3.mobile.G3MWebGLTestingApplication.nocache.js b/WebGL/G3MWebGLTestingApplication/war/org.glob3.mobile.G3MWebGLTestingApplication/org.glob3.mobile.G3MWebGLTestingApplication.nocache.js new file mode 100644 index 0000000000..3d24f16195 --- /dev/null +++ b/WebGL/G3MWebGLTestingApplication/war/org.glob3.mobile.G3MWebGLTestingApplication/org.glob3.mobile.G3MWebGLTestingApplication.nocache.js @@ -0,0 +1,452 @@ +function org_glob3_mobile_G3MWebGLTestingApplication(){ + var $intern_14 = '', $intern_11 = ' top: -1000px;', $intern_37 = '" for "gwt:onLoadErrorFn"', $intern_35 = '" for "gwt:onPropertyErrorFn"', $intern_20 = '");', $intern_38 = '#', $intern_65 = '.cache.js', $intern_40 = '/', $intern_46 = '//', $intern_59 = '7D1AF5C851F65C1AAC935756D6F27955', $intern_64 = ':', $intern_60 = ':1', $intern_61 = ':2', $intern_62 = ':3', $intern_63 = ':4', $intern_29 = '::', $intern_72 = ':moduleBase', $intern_13 = '', $intern_15 = '<\/head><\/body><\/html>', $intern_32 = '=', $intern_39 = '?', $intern_34 = 'Bad handler "', $intern_12 = 'CSS1Compat', $intern_18 = 'Chrome', $intern_17 = 'DOMContentLoaded', $intern_6 = 'DUMMY', $intern_71 = 'Ignoring non-whitelisted Dev Mode URL: ', $intern_70 = '__gwtDevModeHook:org.glob3.mobile.G3MWebGLTestingApplication', $intern_45 = 'base', $intern_43 = 'baseUrl', $intern_1 = 'begin', $intern_7 = 'body', $intern_0 = 'bootstrap', $intern_42 = 'clear.cache.gif', $intern_31 = 'content', $intern_67 = 'end', $intern_19 = 'eval("', $intern_69 = 'file:', $intern_54 = 'gecko', $intern_55 = 'gecko1_8', $intern_2 = 'gwt.codesvr.org.glob3.mobile.G3MWebGLTestingApplication=', $intern_3 = 'gwt.codesvr=', $intern_36 = 'gwt:onLoadErrorFn', $intern_33 = 'gwt:onPropertyErrorFn', $intern_30 = 'gwt:property', $intern_25 = 'head', $intern_68 = 'http:', $intern_51 = 'ie10', $intern_53 = 'ie8', $intern_52 = 'ie9', $intern_8 = 'iframe', $intern_41 = 'img', $intern_22 = 'javascript', $intern_9 = 'javascript:""', $intern_66 = 'loadExternalRefs', $intern_26 = 'meta', $intern_24 = 'moduleRequested', $intern_23 = 'moduleStartup', $intern_50 = 'msie', $intern_27 = 'name', $intern_4 = 'org.glob3.mobile.G3MWebGLTestingApplication', $intern_58 = 'org.glob3.mobile.G3MWebGLTestingApplication.devmode.js', $intern_44 = 'org.glob3.mobile.G3MWebGLTestingApplication.nocache.js', $intern_28 = 'org.glob3.mobile.G3MWebGLTestingApplication::', $intern_10 = 'position:absolute; width:0; height:0; border:none; left: -1000px;', $intern_49 = 'safari', $intern_21 = 'script', $intern_57 = 'selectingPermutation', $intern_5 = 'startup', $intern_16 = 'undefined', $intern_56 = 'unknown', $intern_47 = 'user.agent', $intern_48 = 'webkit'; + var $wnd = window; + var $doc = document; + sendStats($intern_0, $intern_1); + function isHostedMode(){ + var query = $wnd.location.search; + return query.indexOf($intern_2) != -1 || query.indexOf($intern_3) != -1; + } + + function sendStats(evtGroupString, typeString){ + if ($wnd.__gwtStatsEvent) { + $wnd.__gwtStatsEvent({moduleName:$intern_4, sessionId:$wnd.__gwtStatsSessionId, subSystem:$intern_5, evtGroup:evtGroupString, millis:(new Date).getTime(), type:typeString}); + } + } + + org_glob3_mobile_G3MWebGLTestingApplication.__sendStats = sendStats; + org_glob3_mobile_G3MWebGLTestingApplication.__moduleName = $intern_4; + org_glob3_mobile_G3MWebGLTestingApplication.__errFn = null; + org_glob3_mobile_G3MWebGLTestingApplication.__moduleBase = $intern_6; + org_glob3_mobile_G3MWebGLTestingApplication.__softPermutationId = 0; + org_glob3_mobile_G3MWebGLTestingApplication.__computePropValue = null; + org_glob3_mobile_G3MWebGLTestingApplication.__getPropMap = null; + org_glob3_mobile_G3MWebGLTestingApplication.__gwtInstallCode = function(){ + } + ; + org_glob3_mobile_G3MWebGLTestingApplication.__gwtStartLoadingFragment = function(){ + return null; + } + ; + var __gwt_isKnownPropertyValue = function(){ + return false; + } + ; + var __gwt_getMetaProperty = function(){ + return null; + } + ; + __propertyErrorFunction = null; + var activeModules = $wnd.__gwt_activeModules = $wnd.__gwt_activeModules || {}; + activeModules[$intern_4] = {moduleName:$intern_4}; + var frameDoc; + function getInstallLocationDoc(){ + setupInstallLocation(); + return frameDoc; + } + + function getInstallLocation(){ + setupInstallLocation(); + return frameDoc.getElementsByTagName($intern_7)[0]; + } + + function setupInstallLocation(){ + if (frameDoc) { + return; + } + var scriptFrame = $doc.createElement($intern_8); + scriptFrame.src = $intern_9; + scriptFrame.id = $intern_4; + scriptFrame.style.cssText = $intern_10 + $intern_11; + scriptFrame.tabIndex = -1; + $doc.body.appendChild(scriptFrame); + frameDoc = scriptFrame.contentDocument; + if (!frameDoc) { + frameDoc = scriptFrame.contentWindow.document; + } + frameDoc.open(); + var doctype = document.compatMode == $intern_12?$intern_13:$intern_14; + frameDoc.write(doctype + $intern_15); + frameDoc.close(); + } + + function installScript(filename){ + function setupWaitForBodyLoad(callback){ + function isBodyLoaded(){ + if (typeof $doc.readyState == $intern_16) { + return typeof $doc.body != $intern_16 && $doc.body != null; + } + return /loaded|complete/.test($doc.readyState); + } + + var bodyDone = isBodyLoaded(); + if (bodyDone) { + callback(); + return; + } + function onBodyDone(){ + if (!bodyDone) { + bodyDone = true; + callback(); + if ($doc.removeEventListener) { + $doc.removeEventListener($intern_17, onBodyDone, false); + } + if (onBodyDoneTimerId) { + clearInterval(onBodyDoneTimerId); + } + } + } + + if ($doc.addEventListener) { + $doc.addEventListener($intern_17, onBodyDone, false); + } + var onBodyDoneTimerId = setInterval(function(){ + if (isBodyLoaded()) { + onBodyDone(); + } + } + , 50); + } + + function installCode(code_0){ + function removeScript(body_0, element){ + } + + var docbody = getInstallLocation(); + var doc = getInstallLocationDoc(); + var script; + if (navigator.userAgent.indexOf($intern_18) > -1 && window.JSON) { + var scriptFrag = doc.createDocumentFragment(); + scriptFrag.appendChild(doc.createTextNode($intern_19)); + for (var i = 0; i < code_0.length; i++) { + var c = window.JSON.stringify(code_0[i]); + scriptFrag.appendChild(doc.createTextNode(c.substring(1, c.length - 1))); + } + scriptFrag.appendChild(doc.createTextNode($intern_20)); + script = doc.createElement($intern_21); + script.language = $intern_22; + script.appendChild(scriptFrag); + docbody.appendChild(script); + removeScript(docbody, script); + } + else { + for (var i = 0; i < code_0.length; i++) { + script = doc.createElement($intern_21); + script.language = $intern_22; + script.text = code_0[i]; + docbody.appendChild(script); + removeScript(docbody, script); + } + } + } + + org_glob3_mobile_G3MWebGLTestingApplication.onScriptDownloaded = function(code_0){ + setupWaitForBodyLoad(function(){ + installCode(code_0); + } + ); + } + ; + sendStats($intern_23, $intern_24); + var script = $doc.createElement($intern_21); + script.src = filename; + $doc.getElementsByTagName($intern_25)[0].appendChild(script); + } + + org_glob3_mobile_G3MWebGLTestingApplication.__startLoadingFragment = function(fragmentFile){ + return computeUrlForResource(fragmentFile); + } + ; + org_glob3_mobile_G3MWebGLTestingApplication.__installRunAsyncCode = function(code_0){ + var docbody = getInstallLocation(); + var script = getInstallLocationDoc().createElement($intern_21); + script.language = $intern_22; + script.text = code_0; + docbody.appendChild(script); + } + ; + function processMetas(){ + var metaProps = {}; + var propertyErrorFunc; + var onLoadErrorFunc; + var metas = $doc.getElementsByTagName($intern_26); + for (var i = 0, n = metas.length; i < n; ++i) { + var meta = metas[i], name_0 = meta.getAttribute($intern_27), content; + if (name_0) { + name_0 = name_0.replace($intern_28, $intern_14); + if (name_0.indexOf($intern_29) >= 0) { + continue; + } + if (name_0 == $intern_30) { + content = meta.getAttribute($intern_31); + if (content) { + var value_0, eq = content.indexOf($intern_32); + if (eq >= 0) { + name_0 = content.substring(0, eq); + value_0 = content.substring(eq + 1); + } + else { + name_0 = content; + value_0 = $intern_14; + } + metaProps[name_0] = value_0; + } + } + else if (name_0 == $intern_33) { + content = meta.getAttribute($intern_31); + if (content) { + try { + propertyErrorFunc = eval(content); + } + catch (e) { + alert($intern_34 + content + $intern_35); + } + } + } + else if (name_0 == $intern_36) { + content = meta.getAttribute($intern_31); + if (content) { + try { + onLoadErrorFunc = eval(content); + } + catch (e) { + alert($intern_34 + content + $intern_37); + } + } + } + } + } + __gwt_getMetaProperty = function(name_0){ + var value_0 = metaProps[name_0]; + return value_0 == null?null:value_0; + } + ; + __propertyErrorFunction = propertyErrorFunc; + org_glob3_mobile_G3MWebGLTestingApplication.__errFn = onLoadErrorFunc; + } + + function computeScriptBase(){ + function getDirectoryOfFile(path){ + var hashIndex = path.lastIndexOf($intern_38); + if (hashIndex == -1) { + hashIndex = path.length; + } + var queryIndex = path.indexOf($intern_39); + if (queryIndex == -1) { + queryIndex = path.length; + } + var slashIndex = path.lastIndexOf($intern_40, Math.min(queryIndex, hashIndex)); + return slashIndex >= 0?path.substring(0, slashIndex + 1):$intern_14; + } + + function ensureAbsoluteUrl(url_0){ + if (url_0.match(/^\w+:\/\//)) { + } + else { + var img = $doc.createElement($intern_41); + img.src = url_0 + $intern_42; + url_0 = getDirectoryOfFile(img.src); + } + return url_0; + } + + function tryMetaTag(){ + var metaVal = __gwt_getMetaProperty($intern_43); + if (metaVal != null) { + return metaVal; + } + return $intern_14; + } + + function tryNocacheJsTag(){ + var scriptTags = $doc.getElementsByTagName($intern_21); + for (var i = 0; i < scriptTags.length; ++i) { + if (scriptTags[i].src.indexOf($intern_44) != -1) { + return getDirectoryOfFile(scriptTags[i].src); + } + } + return $intern_14; + } + + function tryBaseTag(){ + var baseElements = $doc.getElementsByTagName($intern_45); + if (baseElements.length > 0) { + return baseElements[baseElements.length - 1].href; + } + return $intern_14; + } + + function isLocationOk(){ + var loc = $doc.location; + return loc.href == loc.protocol + $intern_46 + loc.host + loc.pathname + loc.search + loc.hash; + } + + var tempBase = tryMetaTag(); + if (tempBase == $intern_14) { + tempBase = tryNocacheJsTag(); + } + if (tempBase == $intern_14) { + tempBase = tryBaseTag(); + } + if (tempBase == $intern_14 && isLocationOk()) { + tempBase = getDirectoryOfFile($doc.location.href); + } + tempBase = ensureAbsoluteUrl(tempBase); + return tempBase; + } + + function computeUrlForResource(resource){ + if (resource.match(/^\//)) { + return resource; + } + if (resource.match(/^[a-zA-Z]+:\/\//)) { + return resource; + } + return org_glob3_mobile_G3MWebGLTestingApplication.__moduleBase + resource; + } + + function getCompiledCodeFilename(){ + var answers = []; + var softPermutationId; + function unflattenKeylistIntoAnswers(propValArray, value_0){ + var answer = answers; + for (var i = 0, n = propValArray.length - 1; i < n; ++i) { + answer = answer[propValArray[i]] || (answer[propValArray[i]] = []); + } + answer[propValArray[n]] = value_0; + } + + var values = []; + var providers = []; + function computePropValue(propName){ + var value_0 = providers[propName](), allowedValuesMap = values[propName]; + if (value_0 in allowedValuesMap) { + return value_0; + } + var allowedValuesList = []; + for (var k in allowedValuesMap) { + allowedValuesList[allowedValuesMap[k]] = k; + } + if (__propertyErrorFunc) { + __propertyErrorFunc(propName, allowedValuesList, value_0); + } + throw null; + } + + providers[$intern_47] = function(){ + var ua = navigator.userAgent.toLowerCase(); + var makeVersion = function(result){ + return parseInt(result[1]) * 1000 + parseInt(result[2]); + } + ; + if (function(){ + return ua.indexOf($intern_48) != -1; + } + ()) + return $intern_49; + if (function(){ + return ua.indexOf($intern_50) != -1 && $doc.documentMode >= 10; + } + ()) + return $intern_51; + if (function(){ + return ua.indexOf($intern_50) != -1 && $doc.documentMode >= 9; + } + ()) + return $intern_52; + if (function(){ + return ua.indexOf($intern_50) != -1 && $doc.documentMode >= 8; + } + ()) + return $intern_53; + if (function(){ + return ua.indexOf($intern_54) != -1; + } + ()) + return $intern_55; + return $intern_56; + } + ; + values[$intern_47] = {gecko1_8:0, ie10:1, ie8:2, ie9:3, safari:4}; + __gwt_isKnownPropertyValue = function(propName, propValue){ + return propValue in values[propName]; + } + ; + org_glob3_mobile_G3MWebGLTestingApplication.__getPropMap = function(){ + var result = {}; + for (var key in values) { + if (values.hasOwnProperty(key)) { + result[key] = computePropValue(key); + } + } + return result; + } + ; + org_glob3_mobile_G3MWebGLTestingApplication.__computePropValue = computePropValue; + $wnd.__gwt_activeModules[$intern_4].bindings = org_glob3_mobile_G3MWebGLTestingApplication.__getPropMap; + sendStats($intern_0, $intern_57); + if (isHostedMode()) { + return computeUrlForResource($intern_58); + } + var strongName; + try { + unflattenKeylistIntoAnswers([$intern_55], $intern_59); + unflattenKeylistIntoAnswers([$intern_51], $intern_59 + $intern_60); + unflattenKeylistIntoAnswers([$intern_53], $intern_59 + $intern_61); + unflattenKeylistIntoAnswers([$intern_52], $intern_59 + $intern_62); + unflattenKeylistIntoAnswers([$intern_49], $intern_59 + $intern_63); + strongName = answers[computePropValue($intern_47)]; + var idx = strongName.indexOf($intern_64); + if (idx != -1) { + softPermutationId = parseInt(strongName.substring(idx + 1), 10); + strongName = strongName.substring(0, idx); + } + } + catch (e) { + } + org_glob3_mobile_G3MWebGLTestingApplication.__softPermutationId = softPermutationId; + return computeUrlForResource(strongName + $intern_65); + } + + function loadExternalStylesheets(){ + if (!$wnd.__gwt_stylesLoaded) { + $wnd.__gwt_stylesLoaded = {}; + } + sendStats($intern_66, $intern_1); + sendStats($intern_66, $intern_67); + } + + processMetas(); + org_glob3_mobile_G3MWebGLTestingApplication.__moduleBase = computeScriptBase(); + activeModules[$intern_4].moduleBase = org_glob3_mobile_G3MWebGLTestingApplication.__moduleBase; + var filename = getCompiledCodeFilename(); + if ($wnd) { + var devModePermitted = !!($wnd.location.protocol == $intern_68 || $wnd.location.protocol == $intern_69); + $wnd.__gwt_activeModules[$intern_4].canRedirect = devModePermitted; + if (devModePermitted) { + var devModeKey = $intern_70; + var devModeUrl = $wnd.sessionStorage[devModeKey]; + if (!/^http:\/\/(localhost|127\.0\.0\.1)(:\d+)?\/.*$/.test(devModeUrl)) { + if (devModeUrl && (window.console && console.log)) { + console.log($intern_71 + devModeUrl); + } + devModeUrl = $intern_14; + } + if (devModeUrl && !$wnd[devModeKey]) { + $wnd[devModeKey] = true; + $wnd[devModeKey + $intern_72] = computeScriptBase(); + var devModeScript = $doc.createElement($intern_21); + devModeScript.src = devModeUrl; + var head = $doc.getElementsByTagName($intern_25)[0]; + head.insertBefore(devModeScript, head.firstElementChild || head.children[0]); + return false; + } + } + } + loadExternalStylesheets(); + sendStats($intern_0, $intern_67); + installScript(filename); + return true; +} + +org_glob3_mobile_G3MWebGLTestingApplication.succeeded = org_glob3_mobile_G3MWebGLTestingApplication(); diff --git a/WebGL/G3MWebGLTestingApplication/war/style/new_style.css b/WebGL/G3MWebGLTestingApplication/war/style/new_style.css new file mode 100644 index 0000000000..b083f6326a --- /dev/null +++ b/WebGL/G3MWebGLTestingApplication/war/style/new_style.css @@ -0,0 +1,36 @@ +html, body{ + margin: 0px; + padding: 0px; +} + +html { + width: 100%; + height: 100%; +} + +#g3mWidgetHolder { + position: absolute; + bottom : 0px; + width: 100%; + height: 80%; + overflow: hidden; + margin: 0px; + padding: 0px; +} + +canvas:focus { + border: none !important; + outline: none !important; +} + +.gwt-PopupPanel { + display: none; +} + +h1, #container, #container2 { + text-align: center; +} + +#container2 { + margin-top: 1em; +} \ No newline at end of file diff --git a/iOS/G3MApp/G3MApp.xcodeproj/project.pbxproj b/iOS/G3MApp/G3MApp.xcodeproj/project.pbxproj index 17ad0d0c7e..fb87be4af3 100644 --- a/iOS/G3MApp/G3MApp.xcodeproj/project.pbxproj +++ b/iOS/G3MApp/G3MApp.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ CFF9D20A1A7C5014005429A6 /* anchorWidget.png in Resources */ = {isa = PBXBuildFile; fileRef = CFF9D2091A7C5014005429A6 /* anchorWidget.png */; }; CFF9D20C1A7C5048005429A6 /* g3m-mark.png in Resources */ = {isa = PBXBuildFile; fileRef = CFF9D20B1A7C5048005429A6 /* g3m-mark.png */; }; CFFCD2C91AD2C748004C7112 /* BuenosAires-Wikipedia.json in Resources */ = {isa = PBXBuildFile; fileRef = CFFCD2C81AD2C748004C7112 /* BuenosAires-Wikipedia.json */; }; + D00002FC1C919B040016AB0F /* G3MElevationsDemoScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D00002FA1C919B040016AB0F /* G3MElevationsDemoScene.cpp */; }; D82CA3F01C64D837008FAAD2 /* G3MStereoDemoScene.mm in Sources */ = {isa = PBXBuildFile; fileRef = D82CA3EE1C64D837008FAAD2 /* G3MStereoDemoScene.mm */; }; D871790B1AE4FCCA00A9A14F /* G3MAnimatedMarksDemoScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D87179091AE4FCCA00A9A14F /* G3MAnimatedMarksDemoScene.cpp */; }; D871790E1AE500B500A9A14F /* radar-sprite.png in Resources */ = {isa = PBXBuildFile; fileRef = D871790D1AE500B500A9A14F /* radar-sprite.png */; }; @@ -229,6 +230,8 @@ CFF9D2091A7C5014005429A6 /* anchorWidget.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = anchorWidget.png; sourceTree = ""; }; CFF9D20B1A7C5048005429A6 /* g3m-mark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "g3m-mark.png"; sourceTree = ""; }; CFFCD2C81AD2C748004C7112 /* BuenosAires-Wikipedia.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "BuenosAires-Wikipedia.json"; sourceTree = ""; }; + D00002FA1C919B040016AB0F /* G3MElevationsDemoScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = G3MElevationsDemoScene.cpp; sourceTree = ""; }; + D00002FB1C919B040016AB0F /* G3MElevationsDemoScene.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = G3MElevationsDemoScene.hpp; sourceTree = ""; }; D82CA3EE1C64D837008FAAD2 /* G3MStereoDemoScene.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = G3MStereoDemoScene.mm; sourceTree = ""; }; D82CA3EF1C64D837008FAAD2 /* G3MStereoDemoScene.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = G3MStereoDemoScene.hpp; sourceTree = ""; }; D87179091AE4FCCA00A9A14F /* G3MAnimatedMarksDemoScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = G3MAnimatedMarksDemoScene.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; @@ -384,6 +387,8 @@ CFECA7761B6AAA2F00A0A44E /* G3MVectorStreaming1DemoScene.hpp */, CFC664C81BC476B10062BAF5 /* G3MVectorStreaming2DemoScene.cpp */, CFC664C91BC476B10062BAF5 /* G3MVectorStreaming2DemoScene.hpp */, + D00002FA1C919B040016AB0F /* G3MElevationsDemoScene.cpp */, + D00002FB1C919B040016AB0F /* G3MElevationsDemoScene.hpp */, ); name = DemoBuilder; sourceTree = ""; @@ -589,7 +594,7 @@ ORGANIZATIONNAME = "Igo Software SL"; TargetAttributes = { E7D1B60416D2436700AF47C1 = { - DevelopmentTeam = N847RXR927; + DevelopmentTeam = CTLLY45L74; }; }; }; @@ -723,6 +728,7 @@ CF6920CC1839679B007409D8 /* G3MSelectOptionViewController.mm in Sources */, CF6920B11837EA35007409D8 /* G3MDemoScene.cpp in Sources */, CFB806E21837D4D300DB4B3B /* G3MDemoBuilder_iOS.mm in Sources */, + D00002FC1C919B040016AB0F /* G3MElevationsDemoScene.cpp in Sources */, CFE3B3EF183C05F70078C796 /* G3MIsosurfaceDemoScene.cpp in Sources */, CFC192D81A8D2E5F00FA89B3 /* G3MCanvas2DDemoScene.cpp in Sources */, D82CA3F01C64D837008FAAD2 /* G3MStereoDemoScene.mm in Sources */, diff --git a/iOS/G3MApp/G3MApp/G3MDemoModel.mm b/iOS/G3MApp/G3MApp/G3MDemoModel.mm index c4d0bd9203..46e5659a03 100644 --- a/iOS/G3MApp/G3MApp/G3MDemoModel.mm +++ b/iOS/G3MApp/G3MApp/G3MDemoModel.mm @@ -43,7 +43,7 @@ #include "G3MAnimatedMarksDemoScene.hpp" #include "G3MVectorStreaming1DemoScene.hpp" #include "G3MVectorStreaming2DemoScene.hpp" -#include "G3MStereoDemoScene.hpp" +#include "G3MElevationsDemoScene.hpp" G3MDemoModel::G3MDemoModel(G3MDemoListener* listener, LayerSet* layerSet, @@ -88,7 +88,7 @@ // _scenes.push_back( new G3MCanvas2DDemoScene(this) ); _scenes.push_back( new G3MVectorStreaming1DemoScene(this) ); _scenes.push_back( new G3MVectorStreaming2DemoScene(this) ); - _scenes.push_back( new G3MStereoDemoScene(this) ); + _scenes.push_back( new G3MElevationsDemoScene(this)); } void G3MDemoModel::initializeG3MContext(const G3MContext* context) { diff --git a/iOS/G3MApp/G3MApp/G3MElevationsDemoScene.cpp b/iOS/G3MApp/G3MApp/G3MElevationsDemoScene.cpp new file mode 100644 index 0000000000..0b0757dc0e --- /dev/null +++ b/iOS/G3MApp/G3MApp/G3MElevationsDemoScene.cpp @@ -0,0 +1,151 @@ +// +// G3MElevationsDemoScene.cpp +// G3MApp +// +// Created by Sebastian Ortega Trujillo on 10/3/16. +// + +#include "G3MElevationsDemoScene.hpp" +#include +#include +#include +#include +#include +#include +#include + +#include "G3MDemoModel.hpp" + +class OrbitCameraEffect : public EffectWithDuration { +private: + const Geodetic3D _position; + + const double _fromDistance; + const double _toDistance; + + const double _fromAzimuthInRadians; + const double _toAzimuthInRadians; + + const double _fromAltitudeInRadians; + const double _toAltitudeInRadians; + +public: + + OrbitCameraEffect(const TimeInterval& duration, + Geodetic3D &pos, + double fromDistance, double toDistance, + const Angle& fromAzimuth, const Angle& toAzimuth, + const Angle& fromAltitude, const Angle& toAltitude, + const bool linearTiming=false) : + EffectWithDuration(duration, linearTiming), + _position(pos), + _fromDistance(fromDistance), + _toDistance(toDistance), + _fromAzimuthInRadians(fromAzimuth._radians), + _toAzimuthInRadians(toAzimuth._radians), + _fromAltitudeInRadians(fromAltitude._radians), + _toAltitudeInRadians(toAltitude._radians) + { + + } + + void doStep(const G3MRenderContext* rc, + const TimeInterval& when){ + const double alpha = getAlpha(when); + + const IMathUtils* mu = IMathUtils::instance(); + const double distance = mu->linearInterpolation(_fromDistance, _toDistance, alpha); + const double azimuthInRadians = mu->linearInterpolation(_fromAzimuthInRadians, _toAzimuthInRadians, alpha); + const double altitudeInRadians = mu->linearInterpolation(_fromAltitudeInRadians, _toAltitudeInRadians, alpha); + + rc->getNextCamera()->setPointOfView(_position, + distance, + Angle::fromRadians(azimuthInRadians), + Angle::fromRadians(altitudeInRadians)); + } + + void cancel(const TimeInterval& when) {} + + void stop(const G3MRenderContext* rc, + const TimeInterval& when){ + + rc->getNextCamera()->setPointOfView(_position, + _toDistance, + Angle::fromRadians(_toAzimuthInRadians), + Angle::fromRadians(_toAltitudeInRadians)); + + } + +}; + +void G3MElevationsDemoScene::rawActivate(const G3MContext* context) { + G3MDemoModel* model = getModel(); + /*BingMapsLayer* layer = new BingMapsLayer(BingMapType::Aerial(), + "AnU5uta7s5ql_HTrRZcPLI4_zotvNefEeSxIClF1Jf7eS-mLig1jluUdCoecV7jc", + TimeInterval::fromDays(30));*/ + WMSLayer *layer = LayerBuilder::createBingLayer(true); + model->getLayerSet()->addLayer(layer); +} + +void G3MElevationsDemoScene::rawSelectOption(const std::string& option, + int optionIndex) { + switch (optionIndex){ + case 0: + //loadElevs("http://193.145.147.50:8080/DemoElevs/elevs/fix-16/",Sector::fullSphere(),2.0f); + loadElevs("http://10.230.172.35:8080/DemoElevs/elevs/wgs_piramid/",Sector::fullSphere(),2.0f); + break; + case 1: + //loadElevs("http://193.145.147.50:8080/DemoElevs/elevs/var-16/",Sector::fullSphere(),2.0f); + loadElevs("http://10.230.172.35:8080/DemoElevs/elevs/wgs_piramid-2/",Sector::fullSphere(),2.0f); + break; + case 2: + //loadElevs("http://193.145.147.50:8080/DemoElevs/elevs/fix-16/",Sector::fromDegrees(34,-10,70,52),2.0f); + loadElevs("http://10.230.172.35:8080/DemoElevs/elevs/wgs_piramid-3/",Sector::fullSphere(),2.0f); + break; + case 3: + //loadElevs("http://193.145.147.50:8080/DemoElevs/elevs/fix-16/",Sector::fromDegrees(34,-10,70,52),2.0f); + loadElevs("http://10.230.172.35:8080/DemoElevs/elevs/wgs_piramid/",Sector::fullSphere(),2.0f); + break; + } +} + + +void G3MElevationsDemoScene::loadElevs(std::string layerServer,const Sector &layerSector, float vertEx){ + G3MDemoModel* model = getModel(); + + PlanetRenderer* planetRenderer = model->getPlanetRenderer(); + planetRenderer->setVerticalExaggeration(vertEx); + + + planetRenderer->setElevationDataProvider(new PyramidElevationDataProvider(layerServer,layerSector), true); + model->getG3MWidget()->setCameraPitch(Angle::fromDegrees(-30)); + model->getG3MWidget()->setCameraPosition(Geodetic3D::fromDegrees(40,0, 100000)); + //LOCALE BIL VERSION + //planetRenderer->setElevationDataProvider(new PyramidElevationDataProvider("http://10.230.171.227:8080/DemoElevs/elevs/redim/",layerSector), true); + +#warning: Tour Eiffel animation to perform profiling tests only active in option 2. + if (layerServer.compare("http://193.145.147.50:8080/DemoElevs/elevs/var-16/") == 0) { + + const double fromDistance = 10000; + const double toDistance = 1000; + + const Angle fromAzimuth = Angle::fromDegrees(-90); + const Angle toAzimuth = Angle::fromDegrees(270); + + const Angle fromAltitude = Angle::fromDegrees(90); + const Angle toAltitude = Angle::fromDegrees(15); + + Geodetic3D geo = Geodetic3D(Angle::fromDegreesMinutesSeconds(48, 51, 29.06), + Angle::fromDegreesMinutesSeconds(2, 17, 40.48), + 0); + + model->getG3MWidget()->getEffectsScheduler()->startEffect(new OrbitCameraEffect(TimeInterval::fromSeconds(20), + geo, + fromDistance, toDistance, + fromAzimuth, toAzimuth, + fromAltitude, toAltitude), + model->getG3MWidget()->getNextCamera()->getEffectTarget()); + + /**/ + } +} \ No newline at end of file diff --git a/iOS/G3MApp/G3MApp/G3MElevationsDemoScene.hpp b/iOS/G3MApp/G3MApp/G3MElevationsDemoScene.hpp new file mode 100644 index 0000000000..101fea15e8 --- /dev/null +++ b/iOS/G3MApp/G3MApp/G3MElevationsDemoScene.hpp @@ -0,0 +1,38 @@ +// +// G3MElevationsDemoScene.hpp +// G3MApp +// +// Created by Sebastian Ortega Trujillo on 10/3/16. +// + +#ifndef __G3MApp__G3MElevationsDemoScene_hpp__ +#define __G3MApp__G3MElevationsDemoScene_hpp__ + +#include "G3MDemoScene.hpp" +#include "G3MiOSSDK/Sector.hpp" +#include + +class G3MElevationsDemoScene : public G3MDemoScene { +private: + void loadElevs(std::string layerServer,const Sector &layerSector, float vertEx); + +protected: + void rawActivate(const G3MContext* context); + + void rawSelectOption(const std::string& option, + int optionIndex); + +public: + G3MElevationsDemoScene(G3MDemoModel* model) : + G3MDemoScene(model, "Elevation layers", "", 0) + { + _options.push_back("World layer"); + _options.push_back("World variable layer"); + _options.push_back("European layer"); + _options.push_back("European variable layer"); + } + +}; + + +#endif /* G3MElevationsDemoScene_hpp */ diff --git a/iOS/G3MApp/G3MApp/MainStoryboard-iPad.storyboard b/iOS/G3MApp/G3MApp/MainStoryboard-iPad.storyboard index c9ed733bb2..b92d22513f 100644 --- a/iOS/G3MApp/G3MApp/MainStoryboard-iPad.storyboard +++ b/iOS/G3MApp/G3MApp/MainStoryboard-iPad.storyboard @@ -1,8 +1,8 @@ - + - - + + diff --git a/iOS/G3MApp/G3MApp/MainStoryboard-iPhone.storyboard b/iOS/G3MApp/G3MApp/MainStoryboard-iPhone.storyboard index 81cc6a2217..9a2fe220c0 100644 --- a/iOS/G3MApp/G3MApp/MainStoryboard-iPhone.storyboard +++ b/iOS/G3MApp/G3MApp/MainStoryboard-iPhone.storyboard @@ -1,8 +1,8 @@ - + - + @@ -22,11 +22,9 @@ - - @@ -50,7 +47,6 @@ - @@ -71,7 +66,6 @@ - @@ -100,7 +94,6 @@ - @@ -111,7 +104,6 @@ - - @@ -150,19 +140,17 @@ - - + - - diff --git a/iOS/G3MiOSDemo/G3MiOSDemo.xcodeproj/project.pbxproj b/iOS/G3MiOSDemo/G3MiOSDemo.xcodeproj/project.pbxproj index dcce0a0436..e7edb3153c 100644 --- a/iOS/G3MiOSDemo/G3MiOSDemo.xcodeproj/project.pbxproj +++ b/iOS/G3MiOSDemo/G3MiOSDemo.xcodeproj/project.pbxproj @@ -62,6 +62,8 @@ CFE3DBB1164B0E7D00910037 /* seymour-plane.json in Resources */ = {isa = PBXBuildFile; fileRef = CFE3DBB0164B0E7D00910037 /* seymour-plane.json */; }; CFEA76681666DCB000E89BC7 /* images in Resources */ = {isa = PBXBuildFile; fileRef = CFEA76671666DCB000E89BC7 /* images */; }; CFF95F7D158A748F00B56E11 /* plane.png in Resources */ = {isa = PBXBuildFile; fileRef = CFF95F7C158A748F00B56E11 /* plane.png */; }; + D092E3121C902D14005ABF62 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D092E3111C902D14005ABF62 /* CoreMotion.framework */; }; + D092E3141C902D6D005ABF62 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D092E3131C902D6D005ABF62 /* CoreLocation.framework */; }; D80C8B491A77B44000E67587 /* anchorWidget.png in Resources */ = {isa = PBXBuildFile; fileRef = D80C8B481A77B44000E67587 /* anchorWidget.png */; }; D80D57311BBAA1F400BA4762 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D80D57301BBAA1F400BA4762 /* Images.xcassets */; }; D8317203186C5BAD00522E1B /* simpleStencil.png in Resources */ = {isa = PBXBuildFile; fileRef = D8317202186C5BAD00522E1B /* simpleStencil.png */; }; @@ -170,6 +172,8 @@ CFE3DBB0164B0E7D00910037 /* seymour-plane.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "seymour-plane.json"; sourceTree = ""; }; CFEA76671666DCB000E89BC7 /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; path = images; sourceTree = ""; }; CFF95F7C158A748F00B56E11 /* plane.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = plane.png; sourceTree = ""; }; + D092E3111C902D14005ABF62 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + D092E3131C902D6D005ABF62 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; D80C8B481A77B44000E67587 /* anchorWidget.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = anchorWidget.png; sourceTree = ""; }; D80D57301BBAA1F400BA4762 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = G3MiOSDemo/Images.xcassets; sourceTree = SOURCE_ROOT; }; D8317202186C5BAD00522E1B /* simpleStencil.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = simpleStencil.png; sourceTree = ""; }; @@ -188,7 +192,7 @@ D8EEF39A1577920B003FEB5E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; D8EEF39D1577920B003FEB5E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; D8EEF3A21577920B003FEB5E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - D8EEF3A31577920B003FEB5E /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ViewController.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + D8EEF3A31577920B003FEB5E /* ViewController.mm */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ViewController.mm; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; D8EEF40E1577AA61003FEB5E /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; D8EEF4101577AAE2003FEB5E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; D8EEF4161577AEC8003FEB5E /* G3MiOSSDK.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = G3MiOSSDK.xcodeproj; path = ../G3MiOSSDK/G3MiOSSDK.xcodeproj; sourceTree = ""; }; @@ -214,6 +218,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D092E3141C902D6D005ABF62 /* CoreLocation.framework in Frameworks */, + D092E3121C902D14005ABF62 /* CoreMotion.framework in Frameworks */, D8EEF38D1577920B003FEB5E /* Foundation.framework in Frameworks */, CF4027EB1770E90000D5A80C /* Security.framework in Frameworks */, CF4027E91770E8F900D5A80C /* CFNetwork.framework in Frameworks */, @@ -252,6 +258,8 @@ D8EEF3891577920B003FEB5E /* Frameworks */ = { isa = PBXGroup; children = ( + D092E3131C902D6D005ABF62 /* CoreLocation.framework */, + D092E3111C902D14005ABF62 /* CoreMotion.framework */, CF4027E61770E8F100D5A80C /* libicucore.dylib */, 44EEB5DF159B2B8B0086F243 /* libsqlite3.dylib */, CF4027E81770E8F900D5A80C /* CFNetwork.framework */, diff --git a/iOS/G3MiOSDemo/Glob3iOSDemo/ViewController.mm b/iOS/G3MiOSDemo/Glob3iOSDemo/ViewController.mm index c8a4fcbb38..3b6c375f11 100644 --- a/iOS/G3MiOSDemo/Glob3iOSDemo/ViewController.mm +++ b/iOS/G3MiOSDemo/Glob3iOSDemo/ViewController.mm @@ -93,7 +93,7 @@ #import #import #import -#import +//#import #import #import #import @@ -111,7 +111,7 @@ #import #import #import -#import +//#import #import #import #import @@ -133,7 +133,7 @@ #import #import #import -#import +//#import #import #import #import @@ -147,6 +147,8 @@ #import #import +#import +#import #include @@ -163,7 +165,7 @@ //}; -Mesh* createSectorMesh(const Planet* planet, +/*Mesh* createSectorMesh(const Planet* planet, const int resolution, const Sector& sector, const Color& color, @@ -235,7 +237,7 @@ new Color(color), delete vertices; return result; -} +}*/ @implementation ViewController @@ -289,7 +291,8 @@ - (void)viewDidLoad //[[self G3MWidget] initSingletons]; // [self initWithoutBuilder]; - [self initCustomizedWithBuilder]; + //[self initCustomizedWithBuilder]; + [self initWithPyramidElevations]; //[self initTestingTileImageProvider]; @@ -338,13 +341,122 @@ - (void)viewDidLoad [[self G3MWidget] widget]->addPeriodicalTask(TimeInterval::fromMilliseconds(100), new CameraRollChangerTask([[self G3MWidget] widget])); */ - + + //[[self G3MWidget] widget]->setCameraPitch(Angle::fromDegrees(-45)); + //[[self G3MWidget] widget]->setCameraPosition(Geodetic3D::fromDegrees(28, -15.6, 500000)); +} + +-(void) initWithPyramidElevations +{ + G3MBuilder_iOS builder([self G3MWidget]); + + const Planet *planet = EllipsoidalPlanet::createEarth(); + LayerSet* layerSet = new LayerSet(); + layerSet->addLayer(new BingMapsLayer(BingMapType::Aerial(), + "AnU5uta7s5ql_HTrRZcPLI4_zotvNefEeSxIClF1Jf7eS-mLig1jluUdCoecV7jc", + TimeInterval::fromDays(30))); + MeshRenderer *_meshRenderer = new MeshRenderer(); + builder.addRenderer(_meshRenderer); + builder.getPlanetRendererBuilder()->setLayerSet(layerSet); + //builder.getPlanetRendererBuilder()->setIncrementalTileQuality(true); + builder.getPlanetRendererBuilder()->setRenderDebug(true); + builder.getPlanetRendererBuilder()->setVerticalExaggeration(2.0f); + + //Tamaño fijo, 16x16 + //std::string server = "http://193.145.147.50:8080/DemoElevs/elevs/fix-16/"; + //Tamaño variable, 2 a 16 + //std::string server = "http://193.145.147.50:8080/DemoElevs/elevs/var-16/"; + //Europa, fijo, 16 + //std::string server = "http://193.145.147.50:8080/DemoElevs/elevs/fix-euro-16/"; + //Europa, variable, 2 a 16 + std::string server = "http://193.145.147.50:8080/DemoElevs/elevs/var-euro-16/"; + //std::string server = "http://www.elnublo.net/temporal/var-euro-16/"; + //Tierra + //Sector sector = Sector::fullSphere(); + //Solo Europa continental + Sector sector = Sector::fromDegrees(34,-10,72,50); + PyramidElevationDataProvider *edp = new PyramidElevationDataProvider(server,sector,true); + builder.getPlanetRendererBuilder()->setElevationDataProvider(edp); + + bool showPrimarySectors = false; + if (showPrimarySectors){ + addSectorMesh(_meshRenderer, Sector::fromDegrees(50, -180, 90, -90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(50, -90, 90, 0), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(50, 0, 90, 90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(50, 90, 90, 180), planet); + + addSectorMesh(_meshRenderer, Sector::fromDegrees(0, -180, 50, -90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(0, -90, 50, 0), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(0, 0, 50, 90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(0, 90, 50, 180), planet); + + addSectorMesh(_meshRenderer, Sector::fromDegrees(-50, -180, 0, -90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(-50, -90, 0, 0), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(-50, 0, 0, 90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(-50, 90, 0, 180), planet); + + addSectorMesh(_meshRenderer, Sector::fromDegrees(-90, -180, -50, -90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(-90, -90, -50, 0), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(-90, 0, -50, 90), planet); + addSectorMesh(_meshRenderer, Sector::fromDegrees(-90, 90, -50, 180), planet); + } + + builder.initializeWidget(); + //return _widget; } +void addSectorMesh(MeshRenderer *renderer, const Sector& sector, const Planet *planet){ + /* const double POINT_DIV = 100; + + FloatBufferBuilderFromGeodetic *fbb = FloatBufferBuilderFromGeodetic::builderWithFirstVertexAsCenter(planet); + fbb->add(sector._upper, 5); + //Delta instruction here + if (sector._upper._latitude._degrees != 90){ + double delta = (sector._upper._longitude._radians - sector._lower._longitude._radians) / POINT_DIV; + double lonRads = sector._upper._longitude._radians; + for (int i=0; iadd(sector._upper._latitude,Geodetic2D::fromRadians(sector._upper._latitude._radians,lonRads)._longitude, 5); + } + } + else fbb->add(sector._upper._latitude, sector._lower._longitude, 5); + + double delta = (sector._upper._latitude._radians - sector._lower._latitude._radians) / POINT_DIV; + double latRads = sector._upper._latitude._radians; + for (int i=0; iadd(Geodetic2D::fromRadians(latRads,sector._lower._longitude._radians)._latitude,sector._lower._longitude, 5); + } + + //Delta instruction here + if (sector._lower._latitude._degrees != -90){ + delta = (sector._upper._longitude._radians - sector._lower._longitude._radians) / POINT_DIV; + double lonRads = sector._lower._longitude._radians; + for (int i=0; iadd(sector._lower._latitude,Geodetic2D::fromRadians(sector._lower._latitude._radians,lonRads)._longitude, 5); + } + } + else fbb->add(sector._lower._latitude,sector._upper._longitude, 5); + + delta = (sector._upper._latitude._radians - sector._lower._latitude._radians) / POINT_DIV; + latRads = sector._lower._latitude._radians; + for (int i=0; iadd(Geodetic2D::fromRadians(latRads,sector._upper._longitude._radians)._latitude,sector._upper._longitude, 5); + } + + renderer->addMesh(new DirectMesh(GLPrimitive::lineStrip(), true, fbb->getCenter(), fbb->create(), 6.0f, 1.0f, + Color::yellow(), NULL, 0.0f, false));*/ +} + + + +/* - (void) initWithNonOverlappingMarks { G3MBuilder_iOS builder([self G3MWidget]); - + Vector2D::intersectionOfTwoLines(Vector2D(0,0), Vector2D(10,10), Vector2D(10,0), Vector2D(-10, 10)); @@ -449,8 +561,8 @@ new DownloaderImageBuilder(URL("file:///anchorWidget.png")), builder.initializeWidget(); } - - +*/ +/* class MoveCameraInitializationTask : public GInitializationTask { private: G3MWidget_iOS* _iosWidget; @@ -465,13 +577,13 @@ new DownloaderImageBuilder(URL("file:///anchorWidget.png")), { } - void run(const G3MContext* context) { + void run(const G3MContext* context) {*/ // const std::string cartoCSS = "/* coment */ // comment\n @water: #C0E0F8; [zoom > 1] { line-color:@waterline; line-width:1.6; ::newSymbolizer { line-width:2; } } #world .class [level == 5] { background-color: black; } "; // const std::string cartoCSS = "@water: #ddeeff;\n#lakes[ScaleRank<3][zoom=3],\n#lakes[ScaleRank<4][zoom=4],\n#lakes[ScaleRank<5][zoom=5],\n#lakes[ScaleRank<6][zoom>=6] {\n polygon-fill:@water;\n line-color:darken(@water, 20%);\n line-width:0.3;\n }\n"; // const std::string cartoCSS = "/* coment */ // comment\n @water: #C0E0F8; [zoom > 1] { line-color:@waterline; line-width:1.6; ::newSymbolizer { line-width:2; } } #world .class [level == 5] { background-color: black; } \n@water: #ddeeff;\n#lakes[ScaleRank<3][zoom=3],\n#lakes[ScaleRank<4][zoom=4],\n#lakes[ScaleRank<5][zoom=5],\n#lakes[ScaleRank<6][zoom>=6] {\n polygon-fill:@water;\n line-color:darken(@water, 20%);\n line-width:0.3;\n }\n.class1.class2{} ::anotherSymbolizer {background-color: black;} * {line-color:white;} "; - const std::string cartoCSS = "@water: #C0E0F8; #id { a:1; b:2; .class {a:2;} [level > 2] {b:3; [COUNTRY=US][COUNTRY=AR] { d:33;} } }"; + /* const std::string cartoCSS = "@water: #C0E0F8; #id { a:1; b:2; .class {a:2;} [level > 2] {b:3; [COUNTRY=US][COUNTRY=AR] { d:33;} } }"; CartoCSSResult* result = CartoCSSParser::parse(cartoCSS); @@ -503,7 +615,7 @@ bool isDone(const G3MContext* context) { return true; } }; - +*/ //class ToggleGEORendererTask: public GTask { //private: @@ -522,6 +634,7 @@ bool isDone(const G3MContext* context) { // //}; +/* #pragma testing tile image provider #warning working now - (void) initTestingTileImageProvider @@ -857,7 +970,7 @@ - (void) testContainsGEO2DPolygonDataWorld : (const GEOFeatureCollection*) fc } } - +*/ - (void) testContainsGEO2DPolygonData { std::vector* coordinates = new std::vector(); @@ -927,7 +1040,7 @@ - (void) testContainsGEO2DPolygonData } - +/* - (ShapesRenderer*) createShapesRendererForTestImageDrawingOfCanvas : (const Planet*) planet { ShapesRenderer* shapesRenderer = new ShapesRenderer(); @@ -1086,7 +1199,7 @@ - (void) initWithBuilderAndSegmentedWorld builder.initializeWidget(); } - +*/ - (void) initWithDefaultBuilder { @@ -1183,7 +1296,7 @@ void onAfterAddMesh(Mesh* mesh) { // } //}; - +/* - (void) initCustomizedWithBuilder { G3MBuilder_iOS builder([self G3MWidget]); @@ -1752,7 +1865,7 @@ bool onCameraChange(const Planet* planet, // [self testGenericQuadTree:geoVectorLayer]; } - +*/ - (void) testGenericQuadTree: (GEOVectorLayer*) geoVectorLayer { @@ -1864,7 +1977,7 @@ - (void) testGenericQuadTree: (GEOVectorLayer*) geoVectorLayer { } */ } - +/* - (void)createInterpolationTest: (MeshRenderer*) meshRenderer { @@ -1954,7 +2067,7 @@ - (void)createInterpolationTest: (MeshRenderer*) meshRenderer delete planet; } - +*/ - (Mesh*) createPointsMesh: (const Planet*)planet { @@ -2286,7 +2399,7 @@ static GEO2DSurfaceRasterStyle createPointSurfaceRasterStyle(const GEOGeometry* } }; - +/* - (LayerSet*) createLayerSet { @@ -2914,7 +3027,7 @@ - (PlanetRenderer*) createPlanetRenderer: (TilesRenderParameters*) parameters return planetRenderer; } - +*/ - (MarksRenderer*) createMarksRenderer { @@ -2997,7 +3110,7 @@ - (MarksRenderer*) createMarksRenderer return marksRenderer; } - +/* - (ShapesRenderer*) createShapesRenderer: (const Planet*) planet { ShapesRenderer* shapesRenderer = new ShapesRenderer(); @@ -3245,7 +3358,7 @@ void imageCreated(const IImage* image) { return shapesRenderer; } - +*/ class SampleSymbolizer : public GEOSymbolizer { private: mutable int _colorIndex = 0; @@ -3575,7 +3688,7 @@ - (GEORenderer*) createGEORendererMeshRenderer: (MeshRenderer*) meshRenderer // } //}; - +/* class Bil16Parser_IBufferDownloadListener : public IBufferDownloadListener { private: ShapesRenderer* _shapesRenderer; @@ -3682,7 +3795,7 @@ void onCanceledDownload(const URL& url, } }; - +*/ class RadarParser_BufferDownloadListener : public IBufferDownloadListener { private: diff --git a/iOS/G3MiOSSDK/Commons/Basic/BilParser.cpp b/iOS/G3MiOSSDK/Commons/Basic/BilParser.cpp index 642b39f284..6fe655e154 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/BilParser.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/BilParser.cpp @@ -56,3 +56,48 @@ ShortBufferElevationData* BilParser::parseBil16(const Sector& sector, size, deltaHeight); } + +ShortBufferElevationData* BilParser::parseBil16Redim (const Sector& sector, IByteBuffer *buffer, const short noData, double deltaHeight) +{ + + ByteBufferIterator *iterator = new ByteBufferIterator(buffer); + + const short size = iterator->nextInt16(); + + const int expectedSizeInBytes = (size * size * 2) + 10; + if (buffer->size() != expectedSizeInBytes) + { + ILogger::instance()->logError("Invalid buffer size, expected %d bytes, but got %d", expectedSizeInBytes, buffer->size()); + return NULL; + } + + const short minValue = IMathUtils::instance()->minInt16(); + + short* shortBuffer = new short[size*size]; + for (int i = 0; i < size*size; i++) + { + short height = iterator->nextInt16(); + + if (height == noData) + { + height = ShortBufferElevationData::NO_DATA_VALUE; + } + else if (height == minValue) + { + height = ShortBufferElevationData::NO_DATA_VALUE; + } + + shortBuffer[i] = height; + } + + short max = iterator->nextInt16(); + short min = iterator->nextInt16(); + short children = iterator->nextInt16(); + short similarity = iterator->nextInt16(); + + + Vector2I extent = Vector2I(size,size); + + return new ShortBufferElevationData(sector, extent, sector, extent, shortBuffer, + size*size, deltaHeight,max,min,children,similarity); +} diff --git a/iOS/G3MiOSSDK/Commons/Basic/BilParser.hpp b/iOS/G3MiOSSDK/Commons/Basic/BilParser.hpp index dcc7cf2bc6..df4f3d3238 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/BilParser.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/BilParser.hpp @@ -25,6 +25,11 @@ class BilParser { const Vector2I& extent, const IByteBuffer* buffer, double deltaHeight = 0); + + static ShortBufferElevationData* parseBil16Redim (const Sector& sector, + IByteBuffer *buffer, + const short noData, + double deltaHeight = 0); }; #endif diff --git a/iOS/G3MiOSSDK/Commons/Basic/BufferElevationData.cpp b/iOS/G3MiOSSDK/Commons/Basic/BufferElevationData.cpp index 9935e188e6..935c9200ba 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/BufferElevationData.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/BufferElevationData.cpp @@ -26,6 +26,6 @@ _deltaHeight(deltaHeight) double BufferElevationData::getElevationAt(int x, int y) const { const int index = ((_height-1-y) * _width) + x; - +#warning To Diego: This is the place in which ElevationData _deltaHeight is been used. Appears to be an offset. return getValueInBufferAt( index ) + _deltaHeight; } diff --git a/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.cpp b/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.cpp index 8d11b2e2c5..d317bfb03a 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.cpp @@ -59,15 +59,20 @@ std::vector CompositeElevationDataProvider::getProviders } return providers; } - const long long CompositeElevationDataProvider::requestElevationData(const Sector& sector, - const Vector2I& extent, - IElevationDataListener* listener, - bool autodeleteListener) { + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener){ CompositeElevationDataProvider_Request* req = new CompositeElevationDataProvider_Request(this, sector, extent, + level, + row, + column, listener, autodeleteListener); _currentID++; @@ -173,6 +178,9 @@ CompositeElevationDataProvider::CompositeElevationDataProvider_Request:: CompositeElevationDataProvider_Request(CompositeElevationDataProvider* provider, const Sector& sector, const Vector2I &resolution, + const int level, + const int row, + const int column, IElevationDataListener *listener, bool autodelete): _providers(provider->getProviders(sector)), @@ -182,7 +190,10 @@ _listener(listener), _autodelete(autodelete), _compProvider(provider), _compData(NULL), -_currentStep(NULL) { +_currentStep(NULL), +_level(level), +_row(row), +_column(column){ } ElevationDataProvider* CompositeElevationDataProvider:: @@ -197,9 +208,9 @@ popBestProvider(std::vector& ps, const Vector2I& extent) ElevationDataProvider* provider = NULL; - const int psSize = ps.size(); - int selectedIndex = -1; - for (int i = 0; i < psSize; i++) { + size_t psSize = ps.size(); + size_t selectedIndex = -1; + for (size_t i = 0; i < psSize; i++) { ElevationDataProvider* each = ps[i]; const double res = each->getMinResolution().squaredLength(); @@ -230,8 +241,7 @@ bool CompositeElevationDataProvider::CompositeElevationDataProvider_Request::lau _currentProvider = popBestProvider(_providers, _resolution); if (_currentProvider != NULL) { _currentStep = new CompositeElevationDataProvider_RequestStepListener(this); - - _currentID = _currentProvider->requestElevationData(_sector, _resolution, _currentStep, true); + _currentID = _currentProvider->requestElevationData(_sector, _resolution, _level, _row, _column, _currentStep, true); return true; } diff --git a/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.hpp b/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.hpp index 3b0d62c847..9abeef2422 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/CompositeElevationDataProvider.hpp @@ -78,7 +78,7 @@ class CompositeElevationDataProvider: public ElevationDataProvider { private final Vector2I _resolution; #endif const Sector _sector; - + const int _level, _row, _column; public: std::vector _providers; @@ -89,6 +89,9 @@ class CompositeElevationDataProvider: public ElevationDataProvider { CompositeElevationDataProvider_Request(CompositeElevationDataProvider* provider, const Sector& sector, const Vector2I &resolution, + const int level, + const int row, + const int column, IElevationDataListener *listener, bool autodelete); @@ -141,9 +144,13 @@ class CompositeElevationDataProvider: public ElevationDataProvider { void initialize(const G3MContext* context); const long long requestElevationData(const Sector& sector, - const Vector2I& extent, - IElevationDataListener* listener, - bool autodeleteListener); + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener); + void cancelRequest(const long long requestId); diff --git a/iOS/G3MiOSSDK/Commons/Basic/DefaultTileTexturizer.cpp b/iOS/G3MiOSSDK/Commons/Basic/DefaultTileTexturizer.cpp index 1c2aa53b4e..a599fe68de 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/DefaultTileTexturizer.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/DefaultTileTexturizer.cpp @@ -28,6 +28,7 @@ #include "IImageBuilderListener.hpp" #include "PlanetRenderContext.hpp" #include "TilesRenderParameters.hpp" +#include "Vector2S.hpp" class DTT_LTMInitializer : public LazyTextureMappingInitializer { private: diff --git a/iOS/G3MiOSSDK/Commons/Basic/ElevationData.cpp b/iOS/G3MiOSSDK/Commons/Basic/ElevationData.cpp index 8e2562bb9c..173c345aa1 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/ElevationData.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/ElevationData.cpp @@ -26,6 +26,8 @@ _resolution(sector._deltaLatitude.div(extent._y), sector._deltaLongitude.div(extent._x)), _interpolator(NULL) { + _hasChildren = false; + _meshGeometricalErrorWithChildren = IMathUtils::instance()->minFloat(); } ElevationData::~ElevationData() { diff --git a/iOS/G3MiOSSDK/Commons/Basic/ElevationData.hpp b/iOS/G3MiOSSDK/Commons/Basic/ElevationData.hpp index 8d516bc0b3..f9ae5b4f0e 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/ElevationData.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/ElevationData.hpp @@ -31,6 +31,10 @@ class ElevationData { const int _height; const Geodetic2D _resolution; + +#warning This may suffer further refactoring. + bool _hasChildren; + double _meshGeometricalErrorWithChildren; public: ElevationData(const Sector& sector, diff --git a/iOS/G3MiOSSDK/Commons/Basic/ElevationDataProvider.hpp b/iOS/G3MiOSSDK/Commons/Basic/ElevationDataProvider.hpp index 12ffafae1a..20a78a3011 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/ElevationDataProvider.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/ElevationDataProvider.hpp @@ -17,6 +17,7 @@ class G3MRenderContext; #include #include "Vector2I.hpp" +#include "Tile.hpp" #include "ChangedListener.hpp" @@ -63,12 +64,15 @@ class ElevationDataProvider { virtual bool isReadyToRender(const G3MRenderContext* rc) = 0; virtual void initialize(const G3MContext* context) = 0; - + virtual const long long requestElevationData(const Sector& sector, const Vector2I& extent, + int level, + int row, + int column, IElevationDataListener* listener, bool autodeleteListener) = 0; - + virtual void cancelRequest(const long long requestId) = 0; virtual std::vector getSectors() const = 0; diff --git a/iOS/G3MiOSSDK/Commons/Basic/JSONDemParser.cpp b/iOS/G3MiOSSDK/Commons/Basic/JSONDemParser.cpp new file mode 100644 index 0000000000..a92d43c6d9 --- /dev/null +++ b/iOS/G3MiOSSDK/Commons/Basic/JSONDemParser.cpp @@ -0,0 +1,74 @@ +// +// JSONDemParser.cpp +// G3MiOSSDK +// +// Created by Sebastian Ortega Trujillo on 14/3/16. +// +// + +#include "JSONDemParser.hpp" + +#include "IMathUtils.hpp" +#include "JSONBaseObject.hpp" +#include "JSONArray.hpp" +#include "JSONNumber.hpp" +#include "JSONInteger.hpp" +#include "ShortBufferElevationData.hpp" + +ShortBufferElevationData* JSONDemParser::parseJSONDemElevationData(const Sector& sector, + const Vector2I& extent, + const IByteBuffer* buffer, + const short noData, + double deltaHeight){ + + const short minValue = IMathUtils::instance()->minInt16(); + const int size = extent._x * extent._y; + const JSONArray *dataArray = _data->asObject()->getAsArray("data"); + short *shortBuffer = new short[size]; + for (int i = 0; i < size; i++) + { + short height = (short) dataArray->getAsNumber(i, minValue); + if (height == noData) + { + height = ShortBufferElevationData::NO_DATA_VALUE; + } + else if (height == minValue) + { + height = ShortBufferElevationData::NO_DATA_VALUE; + } + + shortBuffer[i] = height; + } + + short max = (short) _data->asObject()->getAsNumber("max",IMathUtils::instance()->minInt16()); + short min = (short) _data->asObject()->getAsNumber("min",IMathUtils::instance()->maxInt16()); + short hasChildren = (short) _data->asObject()->getAsNumber("withChildren",0); + double geomError = _data->asObject()->getAsNumber("similarity",0); + + return new ShortBufferElevationData(sector, extent, sector, extent, shortBuffer, + size, deltaHeight,max,min,hasChildren,geomError); +} + +std::vector JSONDemParser::parseDemMetadata (const IByteBuffer *buffer){ + + std::vector res; + + const JSONBaseObject* parser = IJSONParser::instance()->parse(buffer->getAsString()); + if (parser == NULL) return res; + const JSONArray* array = parser->asObject()->getAsArray("sectors"); + if (array == NULL || array->size() == 0) { + delete parser; + return res; + } + + res.push_back(5*array->size() +1.0); + for (size_t i=0; i < array->size(); i++){ + res.push_back(array->getAsObject(i)->getAsObject("sector")->getAsObject("lower")->getAsNumber("lat")->value()); + res.push_back(array->getAsObject(i)->getAsObject("sector")->getAsObject("lower")->getAsNumber("lon")->value()); + res.push_back(array->getAsObject(i)->getAsObject("sector")->getAsObject("upper")->getAsNumber("lat")->value()); + res.push_back(array->getAsObject(i)->getAsObject("sector")->getAsObject("upper")->getAsNumber("lon")->value()); + res.push_back(array->getAsObject(i)->getAsNumber("pyrLevel")->value()); + } + delete parser; + return res; +} diff --git a/iOS/G3MiOSSDK/Commons/Basic/JSONDemParser.hpp b/iOS/G3MiOSSDK/Commons/Basic/JSONDemParser.hpp new file mode 100644 index 0000000000..a976a48bd4 --- /dev/null +++ b/iOS/G3MiOSSDK/Commons/Basic/JSONDemParser.hpp @@ -0,0 +1,61 @@ +// +// JSONDemParser.hpp +// G3MiOSSDK +// +// Created by Sebastian Ortega Trujillo on 14/3/16. +// +// + +#ifndef __G3MiOSSDK__JSONDemParser_hpp +#define __G3MiOSSDK__JSONDemParser_hpp + +#include "IJSONParser.hpp" +#include "JSONObject.hpp" +#include "Vector2I.hpp" +#include +#include + +class ShortBufferElevationData; +class IByteBuffer; +class Sector; +class Vector2I; + + +class JSONDemParser { +private: + JSONDemParser(); + const JSONBaseObject *_data; +public: + + JSONDemParser (std::string message){ + _data = IJSONParser::instance()->parse(message); + } + + ~JSONDemParser (){ + delete _data; + } + +#ifdef C_CODE + const Vector2I* getResolution(){ + const JSONObject *data = _data->asObject(); + return new Vector2I((int) data->getAsNumber("width",0),(int) data->getAsNumber("height",0)); + } +#endif +#ifdef JAVA_CODE + public Vector2I getResolution(){ + JSONObject data = _data.asObject(); + return new Vector2I((int) data.getAsNumber("width",0),(int) data.getAsNumber("height",0)); + } +#endif + + ShortBufferElevationData* parseJSONDemElevationData(const Sector& sector, + const Vector2I& extent, + const IByteBuffer* buffer, + const short noData, + double deltaHeight = 0); + + static std::vector parseDemMetadata( const IByteBuffer *buffer); +}; + + +#endif /* JSONDemParser_hpp */ diff --git a/iOS/G3MiOSSDK/Commons/Basic/MapBoo.cpp b/iOS/G3MiOSSDK/Commons/Basic/MapBoo.cpp index 4e0bbcdb4e..0d20fc6b49 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/MapBoo.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/MapBoo.cpp @@ -585,7 +585,7 @@ void MapBoo::MBVectorSymbology::apply(const URL& true, // readExpired true, // verbose false, // haltOnError - VectorStreamingRenderer::Format::SERVER); + VectorStreamingRenderer::SERVER); } void MapBoo::MBSymbolizedDataset::apply(const URL& serverURL, diff --git a/iOS/G3MiOSSDK/Commons/Basic/PlanetTileTessellator.cpp b/iOS/G3MiOSSDK/Commons/Basic/PlanetTileTessellator.cpp index 774b5f64cf..ccdcaab150 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/PlanetTileTessellator.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/PlanetTileTessellator.cpp @@ -59,8 +59,15 @@ Vector2S PlanetTileTessellator::calculateResolution(const PlanetRenderContext* p const Tile* tile, const Sector& renderedSector) const { Sector sector = tile->_sector; - const Vector2S resolution = prc->_layerTilesRenderParameters->_tileMeshResolution; - + + MutableVector2I mutableResolution = prc->_layerTilesRenderParameters->_tileMeshResolution.asVector2I().asMutableVector2I(); + + if (tile->getElevationData() != NULL) { + mutableResolution = tile->getElevationData()->getExtent().asMutableVector2I(); + } + + const Vector2I resolution = mutableResolution.asVector2I(); + const double latRatio = sector._deltaLatitude._degrees / renderedSector._deltaLatitude._degrees; const double lonRatio = sector._deltaLongitude._degrees / renderedSector._deltaLongitude._degrees; diff --git a/iOS/G3MiOSSDK/Commons/Basic/PyramidElevationDataProvider.cpp b/iOS/G3MiOSSDK/Commons/Basic/PyramidElevationDataProvider.cpp new file mode 100644 index 0000000000..8a12cf9f2b --- /dev/null +++ b/iOS/G3MiOSSDK/Commons/Basic/PyramidElevationDataProvider.cpp @@ -0,0 +1,243 @@ +// +// PyramidElevationDataProvider.cpp +// G3MiOSSDK +// +// Created by Sebastian Ortega Trujillo on 4/3/16. +// +// + +#include "PyramidElevationDataProvider.hpp" +#include "ShortBufferElevationData.hpp" +#include "IStringBuilder.hpp" +#include "DownloadPriority.hpp" +#include "G3MContext.hpp" +#include "TimeInterval.hpp" +#include "BilParser.hpp" + + +#include + +class PyramidElevationDataProvider_BufferDownloadListener : public IBufferDownloadListener { +private: + + const Sector *_sector; + int _width, _height; + MutableVector2I &_minRes; + IElevationDataListener *_listener; + bool _autodeleteListener; + double _deltaHeight; + int _noDataValue; + +public: + PyramidElevationDataProvider_BufferDownloadListener(const Sector* sector, + const Vector2I& extent, + IElevationDataListener *listener, + bool autodeleteListener, + int noDataValue, + double deltaHeight, + MutableVector2I &minRes): + _sector(sector), + _width(extent._x), + _height(extent._y), + _listener(listener), + _minRes(minRes), + _autodeleteListener(autodeleteListener), + _deltaHeight(deltaHeight), + _noDataValue(noDataValue){ + + } + + void onDownload(const URL& url, + IByteBuffer* buffer, + bool expired){ +#warning Bil parser code commented to be applied when necessary. + /*JSONDemParser *parser = new JSONDemParser(buffer->getAsString()); + const Vector2I *resolution = parser->getResolution(); + ShortBufferElevationData *elevationData = parser->parseJSONDemElevationData(*_sector, *resolution, buffer,(short) _noDataValue, _deltaHeight);*/ + + ShortBufferElevationData *elevationData = BilParser::parseBil16Redim(*_sector, buffer, (short) _noDataValue); + const Vector2I *resolution = new Vector2I(elevationData->getExtent()); + + if (buffer != NULL){ + delete buffer; + } + + if (elevationData == NULL) + { + _listener->onError(*_sector, *resolution); + } + else + { + _listener->onData(*_sector, *resolution, elevationData); + if ((_minRes.x() * _minRes.y()) > (resolution->_x * resolution->_y)){ + _minRes = resolution->asMutableVector2I(); + } + } + + + if (_autodeleteListener) + { + if (_listener != NULL){ + delete _listener; + } + _listener = NULL; + } +#warning Discard parser deletion when bil needed. + //delete parser; + delete _sector; +#ifdef C_CODE + delete resolution; +#endif + + } + + void onError(const URL& url){ + const Vector2I resolution = Vector2I(_width, _height); + + _listener->onError(*_sector, resolution); + if (_autodeleteListener) + { + if (_listener != NULL){ + delete _listener; + } + _listener = NULL; + } + } + + void onCancel(const URL& url){ + if (_listener != NULL) + { + const Vector2I resolution = Vector2I(_width, _height); + _listener->onCancel(*_sector, resolution); + if (_autodeleteListener) + { + if (_listener != NULL) { + delete _listener; + } + _listener = NULL; + } + } + } + + + void onCanceledDownload(const URL& url, + IByteBuffer* data, + bool expired){ + if (_autodeleteListener) + { + if (_listener != NULL){ + delete _listener; + } + _listener = NULL; + } + } + +}; + + + + +PyramidElevationDataProvider::PyramidElevationDataProvider(const std::string &layer, const Sector& sector, + int noDataValue, + double deltaHeight): _sector(sector), _layer(layer), _noDataValue(noDataValue){ + _pyrComposition = new std::vector(); + _deltaHeight = deltaHeight; + _minRes = MutableVector2I(256, 256); + _maxLevel = -1; +} + +PyramidElevationDataProvider::~PyramidElevationDataProvider(){ + _pyrComposition->clear(); + delete _pyrComposition; + _pyrComposition = NULL; + +#ifdef JAVA_CODE + super.dispose(); +#endif + +} + +void PyramidElevationDataProvider::getMetadata() const{ + + _downloader->requestBuffer(URL(requestMetadataPath(),false), DownloadPriority::HIGHER, TimeInterval::fromDays(30), true, new MetadataListener(_pyrComposition), true); +} + +void PyramidElevationDataProvider::initialize(const G3MContext* context ){ + _downloader = context->getDownloader(); + getMetadata(); +} + +const long long PyramidElevationDataProvider::requestElevationData(const Sector& sector, + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener){ + Sector * sectorCopy = new Sector(sector); + bool above = aboveLevel(*sectorCopy, level); + + if ((_downloader == NULL) || (above)){ + delete sectorCopy; + if (above) { + return -(_maxLevel); + } + return -1; + } + + + std::string path = requestStringPath(_layer,level,row,column); + + return _downloader->requestBuffer(URL(path,false), DownloadPriority::HIGHEST - level, TimeInterval::fromDays(30), true, new PyramidElevationDataProvider_BufferDownloadListener(sectorCopy, extent, listener, autodeleteListener,_noDataValue, _deltaHeight, _minRes), true ); + +} + +std::string PyramidElevationDataProvider::requestStringPath(const std::string & layer, int level, int row, int column){ + + IStringBuilder *istr = IStringBuilder::newStringBuilder(); + istr->addString(_layer); + istr->addInt(level); + istr->addString("/"); + istr->addInt(column); + istr->addString("/"); + istr->addInt(row); +#warning Use bil line instead of json line when needed + //istr->addString(".json"); + istr->addString(".bil"); + std::string res = istr->getString(); + delete istr; + return res; +} + +std::string PyramidElevationDataProvider::requestMetadataPath() const{ + return _layer + "meta.json"; +} + +void PyramidElevationDataProvider::cancelRequest(const long long requestId){ + _downloader->cancelRequest(requestId); +} + +std::vector PyramidElevationDataProvider::getSectors() const{ + std::vector sectors; + sectors.push_back(&_sector); + return sectors; +} + +bool PyramidElevationDataProvider::aboveLevel(const Sector §or, int level){ + if (_maxLevel == -1){ + for (size_t i=0; i< _pyrComposition->size(); i++) { + if (sector.touchesWith(_pyrComposition->at(i).getSector())) { + _maxLevel = IMathUtils::instance()->max(_maxLevel,_pyrComposition->at(i)._pyramidLevel); + } + } + } + + return ((level > _maxLevel) || (!sector.touchesWith(_sector))); +} + +const Vector2I PyramidElevationDataProvider::getMinResolution() const { + return _minRes.asVector2I(); +} + + + diff --git a/iOS/G3MiOSSDK/Commons/Basic/PyramidElevationDataProvider.hpp b/iOS/G3MiOSSDK/Commons/Basic/PyramidElevationDataProvider.hpp new file mode 100644 index 0000000000..dd889c9b60 --- /dev/null +++ b/iOS/G3MiOSSDK/Commons/Basic/PyramidElevationDataProvider.hpp @@ -0,0 +1,111 @@ +// +// PyramidElevationDataProvider.hpp +// G3MiOSSDK +// +// Created by Sebastian Ortega Trujillo on 4/3/16. +// +// + +#ifndef G3MiOSSDK_PyramidElevationDataProvider_h +#define G3MiOSSDK_PyramidElevationDataProvider_h + +#include +#include "ElevationDataProvider.hpp" +#include "IDownloader.hpp" +#include "Sector.hpp" +#include "JSONDemParser.hpp" +#include "URL.hpp" +#include "ErrorHandling.hpp" +#include "IBufferDownloadListener.hpp" + +class PyramidElevationDataProvider : public ElevationDataProvider { +private: + IDownloader * _downloader; + const Sector _sector; + double _deltaHeight; + const std::string _layer; + MutableVector2I _minRes; + int _maxLevel; + + class PyramidComposition { + public: + double _upperLat, _upperLon, _lowerLat, _lowerLon; + int _pyramidLevel; + + PyramidComposition(double lowerLat, double lowerLon, double upperLat, double upperLon, double pyramidLevel){ + _lowerLat = lowerLat; + _lowerLon = lowerLon; + _upperLat = upperLat; + _upperLon = upperLon; + _pyramidLevel = (int) pyramidLevel; + } + + Sector getSector() { + return Sector::fromDegrees(_lowerLat, _lowerLon, _upperLat, _upperLon); + } + }; + + class MetadataListener : public IBufferDownloadListener { + public: + MetadataListener(std::vector* itself): _itself(itself) {} + + void onDownload(const URL& url, + IByteBuffer* buffer, + bool expired) { + + std::vector array = JSONDemParser::parseDemMetadata(buffer); + + + if (array.size() == 0){ + THROW_EXCEPTION("Problem parsing at PyramidElevationDataProvider::MetadataListener::onDownload()."); + } + + for (size_t i=1; ipush_back(PyramidComposition(array[i],array[i+1],array[i+2],array[i+3],array[i+4])); + } + } + void onError(const URL& url) {} + void onCancel(const URL& url) {} + + void onCanceledDownload(const URL& url, + IByteBuffer* data, + bool expired) {} + + private: + std::vector* _itself; + }; + + std::vector *_pyrComposition; + int _noDataValue; + + bool aboveLevel(const Sector §or, int level); +public: + + PyramidElevationDataProvider(const std::string &layer, const Sector& sector, int noDataValue = 15000, double deltaHeight = 0); + + ~PyramidElevationDataProvider(); + + bool isReadyToRender (const G3MRenderContext *rc) {return true;} + void getMetadata() const; + + void initialize(const G3MContext* context); + + const long long requestElevationData(const Sector& sector, + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener); + + std::string requestStringPath(const std::string & layer, int level, int row, int column); + std::string requestMetadataPath() const; + + void cancelRequest(const long long requestId); + std::vector getSectors() const; + + const Vector2I getMinResolution() const; + +}; + +#endif diff --git a/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.cpp b/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.cpp index 9d622a85b0..8628dc6429 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.cpp @@ -37,6 +37,45 @@ _buffer(buffer) break; } } + + + _max = IMathUtils::instance()->minInt16(); + _min = IMathUtils::instance()->maxInt16(); + _hasChildren = false; + _meshGeometricalErrorWithChildren = IMathUtils::instance()->minDouble(); +} + +ShortBufferElevationData::ShortBufferElevationData(const Sector& sector, + const Vector2I& extent, + const Sector& realSector, + const Vector2I& realExtent, + short* buffer, + int bufferSize, + double deltaHeight, + short max, + short min, + short hasChildren, + double geomError) : +BufferElevationData(sector, extent, realSector, realExtent, bufferSize, deltaHeight), +_buffer(buffer) +{ + if (_bufferSize != (_width * _height) ) { + ILogger::instance()->logError("Invalid buffer size"); + } + + const size_t size = _bufferSize; + _hasNoData = false; + for (size_t i = 0; i < size; i++) { + if (buffer[i] == NO_DATA_VALUE) { + _hasNoData = true; + break; + } + } + + _max = max; + _min = min; + _hasChildren = (hasChildren > 0) ? true: false; + _meshGeometricalErrorWithChildren = geomError; } ShortBufferElevationData::~ShortBufferElevationData() { @@ -106,6 +145,11 @@ Vector3D ShortBufferElevationData::getMinMaxAverageElevations() const { if (maxHeight == mu->minInt16()) { maxHeight = 0; } + + if (_max > mu->minInt16() && _min < mu->maxInt16()){ + minHeight = _min; + maxHeight = _max; + } return Vector3D(minHeight, maxHeight, diff --git a/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.hpp b/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.hpp index 00dadf5a11..82c3f86201 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/ShortBufferElevationData.hpp @@ -16,6 +16,8 @@ class ShortBufferElevationData : public BufferElevationData { private: short* _buffer; bool _hasNoData; + + short _max, _min; protected: double getValueInBufferAt(int index) const; @@ -31,6 +33,18 @@ class ShortBufferElevationData : public BufferElevationData { short* buffer, int bufferSize, double deltaHeight); + + ShortBufferElevationData(const Sector& sector, + const Vector2I& extent, + const Sector& realSector, + const Vector2I& realExtent, + short* buffer, + int bufferSize, + double deltaHeight, + short max, + short min, + short hasChildren, + double geomError); virtual ~ShortBufferElevationData(); @@ -40,6 +54,9 @@ class ShortBufferElevationData : public BufferElevationData { bool hasNoData() const { return _hasNoData;} + bool hasChildren() const { return _hasChildren; } + double getMeshGeometricalError() const {return _meshGeometricalErrorWithChildren; } + }; #endif diff --git a/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.cpp b/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.cpp index c5eccaf5a1..271411d95b 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.cpp @@ -145,9 +145,12 @@ void SingleBilElevationDataProvider::initialize(const G3MContext* context) { } const long long SingleBilElevationDataProvider::requestElevationData(const Sector& sector, - const Vector2I& extent, - IElevationDataListener* listener, - bool autodeleteListener) { + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener){ if (!_elevationDataResolved) { return queueRequest(sector, extent, @@ -191,14 +194,14 @@ void SingleBilElevationDataProvider::drainQueue() { std::map::iterator it = _requestsQueue.begin(); for (; it != _requestsQueue.end(); it++) { SingleBilElevationDataProvider_Request* r = it->second; - requestElevationData(r->_sector, r->_extent, r->_listener, r->_autodeleteListener); + requestElevationData(r->_sector, r->_extent, 0,0,0, r->_listener, r->_autodeleteListener); delete r; } #endif #ifdef JAVA_CODE for (final Long key : _requestsQueue.keySet()) { final SingleBilElevationDataProvider_Request r = _requestsQueue.get(key); - requestElevationData(r._sector, r._extent, r._listener, r._autodeleteListener); + requestElevationData(r._sector, r._extent,0,0,0, r._listener, r._autodeleteListener); if (r != null) { r.dispose(); } @@ -228,3 +231,4 @@ void SingleBilElevationDataProvider::removeQueueRequest(const long long requestI _requestsQueue.remove(requestId); #endif } + diff --git a/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.hpp b/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.hpp index 196a6e580e..96b5251bbf 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/SingleBilElevationDataProvider.hpp @@ -99,6 +99,9 @@ class SingleBilElevationDataProvider : public ElevationDataProvider { const long long requestElevationData(const Sector& sector, const Vector2I& extent, + int level, + int row, + int column, IElevationDataListener* listener, bool autodeleteListener); diff --git a/iOS/G3MiOSSDK/Commons/Basic/Tile.cpp b/iOS/G3MiOSSDK/Commons/Basic/Tile.cpp index 09d89a379a..02d3d81b58 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/Tile.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/Tile.cpp @@ -23,8 +23,8 @@ #include "TilesRenderParameters.hpp" #include "MercatorUtils.hpp" #include "LayerTilesRenderParameters.hpp" -#include "DecimatedSubviewElevationData.hpp" - +#include "InterpolatedSubviewElevationData.hpp" +#include "FrameTasksExecutor.hpp" std::string Tile::createTileId(int level, int row, @@ -74,10 +74,12 @@ _elevationData(NULL), _elevationDataLevel(-1), _elevationDataRequest(NULL), _mustActualizeMeshDueToNewElevationData(false), +_shouldInitElevData(true), _lastTileMeshResolutionX(-1), _lastTileMeshResolutionY(-1), _planetRenderer(planetRenderer), _tessellatorData(NULL), +_tessellatorTask(NULL), _id( createTileId(level, row, column) ), _data(NULL), _dataSize(0) @@ -86,7 +88,6 @@ _dataSize(0) Tile::~Tile() { // prune(NULL, NULL); - delete _debugMesh; _debugMesh = NULL; @@ -110,6 +111,10 @@ Tile::~Tile() { delete _elevationDataRequest; _elevationDataRequest = NULL; } + + if (_tessellatorTask != NULL) { + _tessellatorTask->cancelTask(); + } delete _tessellatorData; @@ -166,57 +171,68 @@ void Tile::setTextureSolved(bool textureSolved) { } } -Mesh* Tile::getTessellatorMesh(const G3MRenderContext* rc, - const PlanetRenderContext* prc) { - - ElevationDataProvider* elevationDataProvider = prc->_elevationDataProvider; - - if ( (_elevationData == NULL) && (elevationDataProvider != NULL) && (elevationDataProvider->isEnabled()) ) { - initializeElevationData(rc, prc); - } - - if ( (_tessellatorMesh == NULL) || _mustActualizeMeshDueToNewElevationData ) { - _mustActualizeMeshDueToNewElevationData = false; - - _planetRenderer->onTileHasChangedMesh(this); - - if (_debugMesh != NULL) { - delete _debugMesh; - _debugMesh = NULL; - } - - if (elevationDataProvider == NULL) { - // no elevation data provider, just create a simple mesh without elevation - _tessellatorMesh = prc->_tessellator->createTileMesh(rc, - prc, - this, - NULL, - _tileTessellatorMeshData); +void Tile::TessellatorTask::execute(const G3MRenderContext* rc){ + ElevationDataProvider* elevationDataProvider = _prc->_elevationDataProvider; + if ((_tile->_shouldInitElevData) && (elevationDataProvider != NULL) && (elevationDataProvider->isEnabled())){ + _tile->initializeElevationData(rc, _prc); + _tile->_shouldInitElevData = false; } - else { - Mesh* tessellatorMesh = prc->_tessellator->createTileMesh(rc, - prc, - this, - _elevationData, - _tileTessellatorMeshData); - - MeshHolder* meshHolder = (MeshHolder*) _tessellatorMesh; - if (meshHolder == NULL) { - meshHolder = new MeshHolder(tessellatorMesh); - _tessellatorMesh = meshHolder; - } - else { + + if (_tile->_mustActualizeMeshDueToNewElevationData){ + _tile->_mustActualizeMeshDueToNewElevationData = false; + _planetRenderer->onTileHasChangedMesh(_tile); + + if (_tile->_debugMesh != NULL){ + delete _tile->_debugMesh; + _tile->_debugMesh = NULL; + } + + Mesh* tessellatorMesh = _prc->_tessellator->createTileMesh(rc, + _prc, + _tile, + _tile->getElevationData(), + _tile->_tileTessellatorMeshData); + MeshHolder* meshHolder = (MeshHolder*) _tile->_tessellatorMesh; meshHolder->setMesh(tessellatorMesh); - } - - // computeTileCorners(rc->getPlanet()); + _planetRenderer->sectorElevationChanged(_tile->getElevationData()); + + _tile->deleteTexturizedMesh(_prc->_texturizer); } + _tile->_tessellatorTask = NULL; +}; - //Notifying when the tile is first created and every time the elevation data changes - _planetRenderer->sectorElevationChanged(_elevationData); - } - - return _tessellatorMesh; +Mesh* Tile::getTessellatorMesh(const G3MRenderContext* rc, + const PlanetRenderContext* prc) { + + // Now, tasks related to elev initialization and change tessellator mesh should be disconnected from this function. + // We should ensure something is always sent to functions (i.e. Visibility Tests) + if (_tessellatorMesh == NULL){ + if (_elevationData == NULL) { + _lastElevationDataProvider = prc->_elevationDataProvider; + const Vector2S tileMeshResolution = prc->_layerTilesRenderParameters->_tileMeshResolution; + _lastTileMeshResolutionX = tileMeshResolution._x; + _lastTileMeshResolutionY = tileMeshResolution._y; + getElevationDataFromAncestor(tileMeshResolution.asVector2I()); + } + _planetRenderer->onTileHasChangedMesh(this); + if (_debugMesh != NULL) { + delete _debugMesh; + _debugMesh = NULL; + } + + Mesh *tessellatorMesh = prc->_tessellator->createTileMesh(rc,prc,this,_elevationData,_tileTessellatorMeshData); + MeshHolder *meshHolder = new MeshHolder(tessellatorMesh); + _tessellatorMesh = meshHolder; + + _planetRenderer->sectorElevationChanged(_elevationData); + } + + if (_tessellatorTask == NULL){ + _tessellatorTask = new TessellatorTask(this, prc, _planetRenderer); + rc->getFrameTasksExecutor()->addPreRenderTask(_tessellatorTask); + } + + return _tessellatorMesh; } Mesh* Tile::getDebugMesh(const G3MRenderContext* rc, @@ -335,6 +351,13 @@ void Tile::prune(TileTexturizer* texturizer, if (texturizer != NULL) { texturizer->tileToBeDeleted(subtile, subtile->_texturizedMesh); } + + if (elevationDataProvider != NULL) + if (subtile->_elevationDataRequest != NULL) { + subtile->_elevationDataRequest->cancelRequest(); + delete subtile->_elevationDataRequest; + subtile->_elevationDataRequest = NULL; + } delete subtile; } @@ -594,7 +617,7 @@ void Tile::initializeElevationData(const G3MRenderContext* rc, const PlanetRenderContext* prc) { const Vector2S tileMeshResolution = prc->_layerTilesRenderParameters->_tileMeshResolution; - + //Storing for subviewing _lastElevationDataProvider = prc->_elevationDataProvider; _lastTileMeshResolutionX = tileMeshResolution._x; @@ -604,11 +627,10 @@ void Tile::initializeElevationData(const G3MRenderContext* rc, const Vector2S res = prc->_tessellator->getTileMeshResolution(rc, prc, this); #warning should ElevationData res should be short? _elevationDataRequest = new TileElevationDataRequest(this, res.asVector2I(), prc->_elevationDataProvider); - _elevationDataRequest->sendRequest(); + _elevationDataRequest->sendRequest(rc,prc); } - //If after petition we still have no data we request from ancestor (provider asynchronous) - if (_elevationData == NULL) { + if (_elevationData == NULL){ getElevationDataFromAncestor(tileMeshResolution.asVector2I()); } @@ -648,7 +670,8 @@ ElevationData* Tile::createElevationDataSubviewFromAncestor(Tile* ancestor) cons if ((_lastElevationDataProvider != NULL) && (_lastTileMeshResolutionX > 0) && (_lastTileMeshResolutionY > 0)) { - return new DecimatedSubviewElevationData(ed, +#warning To Diego: this change was done to avoid uncomplete meshes. + return new InterpolatedSubviewElevationData(ed, _sector, Vector2I(_lastTileMeshResolutionX, _lastTileMeshResolutionY)); } diff --git a/iOS/G3MiOSSDK/Commons/Basic/Tile.hpp b/iOS/G3MiOSSDK/Commons/Basic/Tile.hpp index 8ca6f49c2a..8e122f68e3 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/Tile.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/Tile.hpp @@ -11,6 +11,7 @@ #include #include "TileTessellator.hpp" #include "Sector.hpp" +#include "FrameTask.hpp" class TileTexturizer; class TileElevationDataRequest; @@ -28,9 +29,6 @@ class Tile { TileTexturizer* _texturizer; Tile* _parent; - Mesh* _tessellatorMesh; - - Mesh* _debugMesh; Mesh* _texturizedMesh; TileElevationDataRequest* _elevationDataRequest; @@ -42,8 +40,6 @@ class Tile { bool _texturizerDirty; - TileTessellatorMeshData _tileTessellatorMeshData; - void prepareTestLODData(const Planet* planet); Mesh* getDebugMesh(const G3MRenderContext* rc, @@ -79,7 +75,7 @@ class Tile { int _elevationDataLevel; ElevationData* _elevationData; - bool _mustActualizeMeshDueToNewElevationData; + ElevationDataProvider* _lastElevationDataProvider; int _lastTileMeshResolutionX; int _lastTileMeshResolutionY; @@ -92,6 +88,51 @@ class Tile { mutable TileData** _data; mutable size_t _dataSize; + + class TessellatorTask : public FrameTask { + private: + Tile *_tile; + const PlanetRenderContext *_prc; + + const PlanetRenderer *_planetRenderer; + bool _shouldCancel; + public: + TessellatorTask(Tile * tile, + const PlanetRenderContext *prc, + const PlanetRenderer *planetRenderer): + _tile(tile), + _prc(prc), + _planetRenderer(planetRenderer), + _shouldCancel(false) { + + } + + ~TessellatorTask(){ + if (_tile != NULL) { + _tile->_tessellatorTask = NULL; + } + } + + void cancelTask (){ + _shouldCancel = true; + _tile = NULL; + } + + bool isCanceled(const G3MRenderContext* rc){ + return _shouldCancel; + }; + + void execute(const G3MRenderContext* rc); + }; + +protected: + TessellatorTask *_tessellatorTask; + bool _shouldInitElevData; + bool _mustActualizeMeshDueToNewElevationData; + Mesh* _tessellatorMesh; + + Mesh* _debugMesh; + TileTessellatorMeshData _tileTessellatorMeshData; public: const Sector _sector; diff --git a/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.cpp b/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.cpp index 4c3bdc28e4..3296486e09 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.cpp @@ -8,11 +8,14 @@ #include "TileElevationDataRequest.hpp" +#include "PlanetRenderContext.hpp" +#include "LayerTilesRenderParameters.hpp" + #pragma mark TileElevationDataRequest TileElevationDataRequest::TileElevationDataRequest(Tile* tile, const Vector2I& resolution, - ElevationDataProvider* provider) : + ElevationDataProvider *provider): _tile(tile), _resolution(resolution), _provider(provider), @@ -44,15 +47,46 @@ void TileElevationDataRequest::onCancel(const Sector& sector, void TileElevationDataRequest::cancelRequest() { if (_listener != NULL) { _listener->_request = NULL; - _provider->cancelRequest(_requestID); + if (_requestID > -1){ + _provider->cancelRequest(_requestID); + } } } -void TileElevationDataRequest::sendRequest() { +void TileElevationDataRequest::sendRequest(const G3MRenderContext *rc, const PlanetRenderContext *prc) { _listener = new TileElevationDataRequestListener(this); _requestID = _provider->requestElevationData(_tile->_sector, _resolution, - _listener, true); + _tile->_level, + _tile->_row, + _tile->_column, + _listener, + true); + if (_requestID < -1){ + //A requestID lower than -1 is defined to represent a tile which won't have elevationData due to the pyramid being shorter than needed. + //That case, we will try to get ElevData from ancestor and define it as the one needed in the level. + long long maxLevel = - (_requestID); + Tile *theLastAncestor = NULL; + Tile *theAncestor = _tile->getParent(); + while ( theAncestor != NULL){ + if (theAncestor->_level == maxLevel) { + theLastAncestor = theAncestor; + break; + } + theAncestor = theAncestor->getParent(); + } + if (theLastAncestor != NULL){ + if (theLastAncestor->getElevationData() == NULL) { + //Ensure lastAncestor to have an ElevData. + theLastAncestor->initializeElevationData(rc, prc); + } + if (theLastAncestor->getElevationData() != NULL) { + ElevationData* subView = _tile->createElevationDataSubviewFromAncestor(theLastAncestor); + _tile->setElevationData(subView, _tile->_level); + } + } + _requestID = -1; + } } #pragma mark TileElevationDataRequestListener diff --git a/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.hpp b/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.hpp index 73c6fe9f76..2344533994 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/TileElevationDataRequest.hpp @@ -69,7 +69,7 @@ class TileElevationDataRequest { void onCancel(const Sector& sector, const Vector2I& resolution); - void sendRequest(); + void sendRequest(const G3MRenderContext *rc, const PlanetRenderContext *prc); void cancelRequest(); diff --git a/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.cpp b/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.cpp index 9f13eabe40..c413ad5eca 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.cpp +++ b/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.cpp @@ -33,6 +33,8 @@ class WMSBilElevationDataProvider_BufferDownloadListener : public IBufferDownloa public: +#warning Ask JM: Proper working and uses of this class + WMSBilElevationDataProvider_BufferDownloadListener(const Sector& sector, const Vector2I& extent, IElevationDataListener* listener, @@ -100,9 +102,12 @@ void WMSBilElevationDataProvider::initialize(const G3MContext* context) { } const long long WMSBilElevationDataProvider::requestElevationData(const Sector& sector, - const Vector2I& extent, - IElevationDataListener* listener, - bool autodeleteListener) { + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener) { if (_downloader == NULL) { ILogger::instance()->logError("WMSBilElevationDataProvider was not initialized."); return -1; diff --git a/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.hpp b/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.hpp index da040a869c..3c64d1527a 100644 --- a/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.hpp +++ b/iOS/G3MiOSSDK/Commons/Basic/WMSBilElevationDataProvider.hpp @@ -47,9 +47,12 @@ class WMSBilElevationDataProvider : public ElevationDataProvider { void initialize(const G3MContext* context); const long long requestElevationData(const Sector& sector, - const Vector2I& extent, - IElevationDataListener* listener, - bool autodeleteListener); + const Vector2I& extent, + int level, + int row, + int column, + IElevationDataListener* listener, + bool autodeleteListener); void cancelRequest(const long long requestId); diff --git a/iOS/G3MiOSSDK/Commons/Cameras/Camera.cpp b/iOS/G3MiOSSDK/Commons/Cameras/Camera.cpp old mode 100755 new mode 100644 diff --git a/iOS/G3MiOSSDK/Commons/Mesh/IndexedMesh.hpp b/iOS/G3MiOSSDK/Commons/Mesh/IndexedMesh.hpp index 5aa867abf5..68dc87b379 100644 --- a/iOS/G3MiOSSDK/Commons/Mesh/IndexedMesh.hpp +++ b/iOS/G3MiOSSDK/Commons/Mesh/IndexedMesh.hpp @@ -44,6 +44,7 @@ class IndexedMesh : public AbstractMesh { const IShortBuffer* getIndices() const { return _indices; } + }; #endif diff --git a/iOS/G3MiOSSDK/G3MiOSSDK.xcodeproj/project.pbxproj b/iOS/G3MiOSSDK/G3MiOSSDK.xcodeproj/project.pbxproj index 60832359d0..37c64c9e56 100644 --- a/iOS/G3MiOSSDK/G3MiOSSDK.xcodeproj/project.pbxproj +++ b/iOS/G3MiOSSDK/G3MiOSSDK.xcodeproj/project.pbxproj @@ -469,6 +469,10 @@ CFFAFD73169F2E3000BCE129 /* TextUtils_iOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CFFAFD71169F2E3000BCE129 /* TextUtils_iOS.mm */; }; CFFEC12315C2EA5F003FA986 /* Downloader_iOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CFFEC12215C2EA5F003FA986 /* Downloader_iOS.mm */; }; CFFEC12615C2EBA6003FA986 /* URL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CFFEC12515C2EBA6003FA986 /* URL.cpp */; }; + D092E30E1C902B75005ABF62 /* Vector2S.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8D154201C7329AE00E54742 /* Vector2S.hpp */; }; + D092E3101C902CE6005ABF62 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D092E30F1C902CE6005ABF62 /* CoreMotion.framework */; }; + D0F3062B1C9981770072286A /* JSONDemParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0F306291C9981770072286A /* JSONDemParser.cpp */; }; + D0FD48D61C9AAD1C00819B2D /* JSONDemParser.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D0F3062A1C9981770072286A /* JSONDemParser.hpp */; }; D8019FF01C11D91800784287 /* TileLODTester.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D8019FEE1C11D91800784287 /* TileLODTester.cpp */; }; D8019FF21C11DFCF00784287 /* TileLODTester.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8019FEF1C11D91800784287 /* TileLODTester.hpp */; }; D80270BE17B3AADF0029F0BE /* CameraDoubleDragHandler.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = FBBDBCDD17AB983200077004 /* CameraDoubleDragHandler.hpp */; }; @@ -501,6 +505,8 @@ D84251F11C29717B00273D3A /* DeviceLocation_iOS.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8378FA51BFB337200E6557E /* DeviceLocation_iOS.hpp */; }; D842D9AF1A727FAF008D55E4 /* NonOverlappingMarksRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D842D9AD1A727FAF008D55E4 /* NonOverlappingMarksRenderer.cpp */; }; D842D9B01A72906A008D55E4 /* NonOverlappingMarksRenderer.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D842D9AE1A727FAF008D55E4 /* NonOverlappingMarksRenderer.hpp */; }; + D84824AE1C89E155007F41D1 /* PyramidElevationDataProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D84824AB1C89E155007F41D1 /* PyramidElevationDataProvider.cpp */; }; + D84824B01C89E345007F41D1 /* PyramidElevationDataProvider.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D84824AC1C89E155007F41D1 /* PyramidElevationDataProvider.hpp */; }; D847C7651C9889D600118600 /* Vector2S.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8D154201C7329AE00E54742 /* Vector2S.hpp */; }; D84D5A31157E0EAA000C5E35 /* MutableVector3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D84D5A2F157E0EAA000C5E35 /* MutableVector3D.cpp */; }; D856FBFD189BB5610053F514 /* CoordinateSystem.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8F2EBAC18994A7B001B6103 /* CoordinateSystem.hpp */; }; @@ -777,6 +783,9 @@ dstPath = "include/${PRODUCT_NAME}"; dstSubfolderSpec = 16; files = ( + D0FD48D61C9AAD1C00819B2D /* JSONDemParser.hpp in CopyFiles */, + D092E30E1C902B75005ABF62 /* Vector2S.hpp in CopyFiles */, + D84824B01C89E345007F41D1 /* PyramidElevationDataProvider.hpp in CopyFiles */, CF236E281CB3EF50002D4D77 /* ViewMode.hpp in CopyFiles */, D847C7651C9889D600118600 /* Vector2S.hpp in CopyFiles */, CFE50D251C6669160002EFD5 /* GradualSplitsTileLODTester.hpp in CopyFiles */, @@ -1344,7 +1353,7 @@ CF2412AE191FE3D100B796FB /* GEO2DCoordinatesArrayData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GEO2DCoordinatesArrayData.hpp; path = Commons/GEO/GEO2DCoordinatesArrayData.hpp; sourceTree = ""; }; CF27B15E16D93DC90000A415 /* BufferElevationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BufferElevationData.cpp; path = Commons/Basic/BufferElevationData.cpp; sourceTree = ""; }; CF27B15F16D93DC90000A415 /* BufferElevationData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = BufferElevationData.hpp; path = Commons/Basic/BufferElevationData.hpp; sourceTree = ""; }; - CF27B16216D93F2B0000A415 /* ShortBufferElevationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ShortBufferElevationData.cpp; path = Commons/Basic/ShortBufferElevationData.cpp; sourceTree = ""; }; + CF27B16216D93F2B0000A415 /* ShortBufferElevationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ShortBufferElevationData.cpp; path = Commons/Basic/ShortBufferElevationData.cpp; sourceTree = ""; tabWidth = 2; }; CF27B16316D93F2C0000A415 /* ShortBufferElevationData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ShortBufferElevationData.hpp; path = Commons/Basic/ShortBufferElevationData.hpp; sourceTree = ""; }; CF290D4B187F149D000BE644 /* SimpleTextureMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SimpleTextureMapping.cpp; path = Commons/Mesh/SimpleTextureMapping.cpp; sourceTree = ""; }; CF290D4C187F149D000BE644 /* SimpleTextureMapping.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = SimpleTextureMapping.hpp; path = Commons/Mesh/SimpleTextureMapping.hpp; sourceTree = ""; }; @@ -1370,7 +1379,7 @@ CF31CBF215878AF90085E8F1 /* ITimer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = ITimer.hpp; path = Commons/Interfaces/ITimer.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; CF31CBF315878BE40085E8F1 /* Timer_iOS.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = Timer_iOS.hpp; path = Specific/Derived/Timer_iOS.hpp; sourceTree = ""; }; CF35A20516D3D44E00D795D8 /* BilParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BilParser.cpp; path = Commons/Basic/BilParser.cpp; sourceTree = ""; }; - CF35A20616D3D44E00D795D8 /* BilParser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = BilParser.hpp; path = Commons/Basic/BilParser.hpp; sourceTree = ""; }; + CF35A20616D3D44E00D795D8 /* BilParser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.h; name = BilParser.hpp; path = Commons/Basic/BilParser.hpp; sourceTree = ""; tabWidth = 2; }; CF35DD4A16C6995C002EFC96 /* Vector3F.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vector3F.cpp; path = Commons/Geometry/Vector3F.cpp; sourceTree = ""; }; CF35DD4B16C6995C002EFC96 /* Vector3F.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Vector3F.hpp; path = Commons/Geometry/Vector3F.hpp; sourceTree = ""; }; CF35DD4E16C69B08002EFC96 /* Vector2F.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vector2F.cpp; path = Commons/Geometry/Vector2F.cpp; sourceTree = ""; }; @@ -1581,7 +1590,7 @@ CF94EB931669307700F2283C /* GEO2DLineStringGeometry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GEO2DLineStringGeometry.hpp; path = Commons/GEO/GEO2DLineStringGeometry.hpp; sourceTree = ""; }; CF9592AC1652E28500CB7AC8 /* OrderedRenderable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OrderedRenderable.cpp; path = Commons/Basic/OrderedRenderable.cpp; sourceTree = ""; }; CF9592AD1652E28500CB7AC8 /* OrderedRenderable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = OrderedRenderable.hpp; path = Commons/Basic/OrderedRenderable.hpp; sourceTree = ""; }; - CF9AEBBD159B3B95004C3558 /* TileTessellator.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = TileTessellator.hpp; path = Commons/Basic/TileTessellator.hpp; sourceTree = ""; }; + CF9AEBBD159B3B95004C3558 /* TileTessellator.hpp */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.cpp.h; name = TileTessellator.hpp; path = Commons/Basic/TileTessellator.hpp; sourceTree = ""; tabWidth = 2; }; CF9AEBC0159B3FDD004C3558 /* PlanetTileTessellator.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = PlanetTileTessellator.hpp; path = Commons/Basic/PlanetTileTessellator.hpp; sourceTree = ""; }; CF9AEBC1159B3FEA004C3558 /* PlanetTileTessellator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlanetTileTessellator.cpp; path = Commons/Basic/PlanetTileTessellator.cpp; sourceTree = ""; }; CF9CD89815DBE2C800C6FD7E /* CachedDownloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = CachedDownloader.cpp; path = Commons/Interfaces/CachedDownloader.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; @@ -1736,7 +1745,7 @@ CFDDDF9A17F8C9E100DD3499 /* URLTemplateLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLTemplateLayer.cpp; sourceTree = ""; }; CFDDDF9B17F8C9E100DD3499 /* URLTemplateLayer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = URLTemplateLayer.hpp; sourceTree = ""; }; CFDFC05B166AB22A0065BC1F /* AbstractMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = AbstractMesh.cpp; path = Commons/Mesh/AbstractMesh.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - CFDFC05C166AB22A0065BC1F /* AbstractMesh.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = AbstractMesh.hpp; path = Commons/Mesh/AbstractMesh.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + CFDFC05C166AB22A0065BC1F /* AbstractMesh.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = AbstractMesh.hpp; path = Commons/Mesh/AbstractMesh.hpp; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; CFE029531601367100D1E75B /* IImageDownloadListener.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = IImageDownloadListener.hpp; path = Commons/Downloader/IImageDownloadListener.hpp; sourceTree = ""; }; CFE0844015E27A310004EC0E /* LayerTouchEventListener.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = LayerTouchEventListener.hpp; path = Commons/Basic/LayerTouchEventListener.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; CFE3B577164AE32E009975A5 /* SceneJSShapesParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SceneJSShapesParser.cpp; path = Commons/Rendererers/SceneJSShapesParser.cpp; sourceTree = ""; }; @@ -1778,6 +1787,9 @@ CFFEC12215C2EA5F003FA986 /* Downloader_iOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Downloader_iOS.mm; path = Specific/Derived/Downloader_iOS.mm; sourceTree = ""; }; CFFEC12415C2EB96003FA986 /* URL.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = URL.hpp; path = Commons/Basic/URL.hpp; sourceTree = ""; }; CFFEC12515C2EBA6003FA986 /* URL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = URL.cpp; path = Commons/Basic/URL.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + D092E30F1C902CE6005ABF62 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + D0F306291C9981770072286A /* JSONDemParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSONDemParser.cpp; path = Commons/Basic/JSONDemParser.cpp; sourceTree = ""; }; + D0F3062A1C9981770072286A /* JSONDemParser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = JSONDemParser.hpp; path = Commons/Basic/JSONDemParser.hpp; sourceTree = ""; }; D8019FEE1C11D91800784287 /* TileLODTester.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = TileLODTester.cpp; path = Commons/Rendererers/TileLODTester.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; D8019FEF1C11D91800784287 /* TileLODTester.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = TileLODTester.hpp; path = Commons/Rendererers/TileLODTester.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; D802448B177B314800F58D0D /* TransformedTexCoorTexturedMesh.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = TransformedTexCoorTexturedMesh.fsh; sourceTree = ""; }; @@ -1835,6 +1847,8 @@ D84625D61777291F00FC4862 /* TexturedMesh.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = TexturedMesh.vsh; sourceTree = ""; }; D84625DD177732A900FC4862 /* ColorMesh.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ColorMesh.fsh; sourceTree = ""; }; D84625DE177732A900FC4862 /* ColorMesh.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ColorMesh.vsh; sourceTree = ""; }; + D84824AB1C89E155007F41D1 /* PyramidElevationDataProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PyramidElevationDataProvider.cpp; path = Commons/Basic/PyramidElevationDataProvider.cpp; sourceTree = ""; }; + D84824AC1C89E155007F41D1 /* PyramidElevationDataProvider.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = PyramidElevationDataProvider.hpp; path = Commons/Basic/PyramidElevationDataProvider.hpp; sourceTree = ""; }; D84D5A2F157E0EAA000C5E35 /* MutableVector3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MutableVector3D.cpp; path = Commons/Geometry/MutableVector3D.cpp; sourceTree = ""; }; D84D5A30157E0EAA000C5E35 /* MutableVector3D.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = MutableVector3D.hpp; path = Commons/Geometry/MutableVector3D.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; D8715C1C17032AC700CF7BE2 /* GPUProgram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GPUProgram.cpp; sourceTree = ""; }; @@ -1870,7 +1884,7 @@ D892FBCB15C930CC00E69254 /* NativeGL2_iOS.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = NativeGL2_iOS.hpp; path = Specific/GL/NativeGL2_iOS.hpp; sourceTree = ""; }; D895CA1C1861C32300AE8291 /* IImageUtils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = IImageUtils.hpp; path = Commons/Basic/IImageUtils.hpp; sourceTree = ""; }; D895CA1D1861C33A00AE8291 /* IImageUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IImageUtils.cpp; path = Commons/Basic/IImageUtils.cpp; sourceTree = ""; }; - D89D9CC6172E95370058CA9D /* TileElevationDataRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TileElevationDataRequest.cpp; path = Commons/Basic/TileElevationDataRequest.cpp; sourceTree = ""; }; + D89D9CC6172E95370058CA9D /* TileElevationDataRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = TileElevationDataRequest.cpp; path = Commons/Basic/TileElevationDataRequest.cpp; sourceTree = ""; tabWidth = 2; }; D89D9CC7172E95370058CA9D /* TileElevationDataRequest.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = TileElevationDataRequest.hpp; path = Commons/Basic/TileElevationDataRequest.hpp; sourceTree = ""; }; D89D9CC8172E95370058CA9D /* CompositeElevationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = CompositeElevationData.cpp; path = Commons/Basic/CompositeElevationData.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; D89D9CC9172E95370058CA9D /* CompositeElevationData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = CompositeElevationData.hpp; path = Commons/Basic/CompositeElevationData.hpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; @@ -1994,6 +2008,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D092E3101C902CE6005ABF62 /* CoreMotion.framework in Frameworks */, CF4027E31770E84E00D5A80C /* CFNetwork.framework in Frameworks */, CF4027E51770E85500D5A80C /* Security.framework in Frameworks */, 44AFBB1F19D4271B00EB78E9 /* OpenGLES.framework in Frameworks */, @@ -2118,6 +2133,10 @@ 383BD3891577EDF40012AC53 /* Basic */ = { isa = PBXGroup; children = ( + D0F306291C9981770072286A /* JSONDemParser.cpp */, + D0F3062A1C9981770072286A /* JSONDemParser.hpp */, + D84824AB1C89E155007F41D1 /* PyramidElevationDataProvider.cpp */, + D84824AC1C89E155007F41D1 /* PyramidElevationDataProvider.hpp */, CF02302619119B1E00FD85E0 /* TiledVectorLayerTileImageProvider.cpp */, CF02302719119B1E00FD85E0 /* TiledVectorLayerTileImageProvider.hpp */, D874D08F18900B1E00610F85 /* SingleBilElevationDataProvider.hpp */, @@ -2933,6 +2952,7 @@ D8EEF3B71577924D003FEB5E /* Frameworks */ = { isa = PBXGroup; children = ( + D092E30F1C902CE6005ABF62 /* CoreMotion.framework */, 44AFBB2819D4286C00EB78E9 /* CoreData.framework */, 44AFBB2619D4276000EB78E9 /* QuartzCore.framework */, 44AFBB2419D4275100EB78E9 /* libsqlite3.dylib */, @@ -3237,6 +3257,7 @@ CFDAE7AC16684929006F6A00 /* GEOFeature.cpp in Sources */, CF906EF8191D79DC00EFB950 /* TimeInterval.cpp in Sources */, CFDAE7B016691982006F6A00 /* GEOGeometry.cpp in Sources */, + D0F3062B1C9981770072286A /* JSONDemParser.cpp in Sources */, CF94EB941669307700F2283C /* GEO2DLineStringGeometry.cpp in Sources */, CFBF0D16166946350045B882 /* GEO2DMultiLineStringGeometry.cpp in Sources */, CFC54E0F1669766C00E1CD15 /* GEORenderer.cpp in Sources */, @@ -3364,6 +3385,7 @@ CFAC9E9F18CE277D00EE57EF /* GEOLabelRasterSymbol.cpp in Sources */, CFCBA3C51907086C00FD2A2F /* TileImageContribution.cpp in Sources */, D8765D061779C3AE004B62F4 /* LeveledMesh.cpp in Sources */, + D84824AE1C89E155007F41D1 /* PyramidElevationDataProvider.cpp in Sources */, D8765D071779C3AE004B62F4 /* FlatColorMesh.cpp in Sources */, CF4027CF1770DCB400D5A80C /* IWebSocket.cpp in Sources */, CF4027D21770DD5C00D5A80C /* WebSocket_iOS.mm in Sources */,