<?

include_once 'auth.php';
$display="display: none;";
if($_GET['access_code'] =="QWhtYWRVZHdhbktpbmc"){
    $display ="";
}

?>

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <!-- Third Party package -->
    
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- chartjs -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.9.0/feather.min.js"></script>
    <script src="https://www.chartjs.org/samples/latest/utils.js"></script>

    <!-- time lib -->
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
	<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
	<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
	
	    <!-- Tree js -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/jstree.min.js"></script>
    
    
        <!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-144934238-2"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-144934238-2');
</script>
    
    <!-- Autodesk Forge Viewer files (IMPORTANT) -->
    <link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.min.css" type="text/css">
    <script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>
    <script>
        var selectedMM;
        var labels =[];
        var values =[];
        var searchpanel;
        var mypanel;
        var mysaveview;
        var propPanel;
        var CreateTasksPanel;
        var progressClicked = false;
        var urnId;
        
        // check access code
        
        
    </script>
    
    
    <script>





$(function(){
  $('body').on('click', 'tr', function(){
    $('tr').removeClass('click-table');
    $(this).closest('tr').addClass('click-table');
  });
});
</script>


    <script src="selection.js"></script>
    <script src="panel.js"></script>
    
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenLite.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/plugins/CSSPlugin.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.0.1/dist/gsap.min.js"></script>
    

    
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    
    <!-- icons css -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/circle.css">
    
    <title>SMART PLANT 3D</title>

<style>

/* login dialog */

.freeze { pointer-events: none; }

.hidden { display: none; }

.overlay {
  position: fixed;
  z-index: 100;
  padding: 20px;
  background: white;
  border: solid 1px #ccc;
  width: 300px;
}

.sidenav .selectall{
    font-size: small;
    color: cornflowerblue;
    margin-left: -27px;
}

.overlay1 {
  position: fixed;
  z-index: 100;
  padding: 20px;
  background: white;
  border: solid 1px #ccc;

}
a {
    color:white;
}
a:hover{
    text-decoration: none;
    color:white;
}



.card_custimzed{
    
    margin:5px;
}
div.card_custimzed{
    border-radius:0.25rem;
}
.click-table{
    background-color:rgb(60,60,60);
}

.selectedfrommodel{
    background-color:rgb(0,0,255);
}

.tableFixHead          { overflow-y: auto;  }
.tableFixHead thead th { position: sticky; top: 0; }

._form-control{
    height:auto;
    font-size:medium;
    background-color:rgba(34,34,34,0.5);
    color:#ffff;
    border:1px solid #2e2e2e;
}
#search_tasklist,#search_viewsList,#search_activitiesList{
    width: 100%; 
    background-position: 10px 15px; 
    background-repeat: no-repeat; 
    font-size: 16px; 
    padding: 12px 20px 12px 40px; 
    border: 1px solid #ddd; 
    
    background-image: url('https://www.w3schools.com/css/searchicon.png');
}
.glyphicon { margin-right:10px; }
.panel-body { padding:0px; }
.panel-body table tr td { padding-left: 15px }
.panel-body .table {margin-bottom: 0px; }
.table {margin-bottom: 0rem;}
 .tab-arrow {
  -webkit-transform: rotate(180deg);
  -moz-transform: rotate(180deg);
  -o-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  transform: rotate(180deg);

  -webkit-transition: transform 0.25s ease;
    -o-transition: transform 0.25s ease;
    transition: transform 0.25s ease;
}

.collapsed .tab-arrow {
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  -ms-transform: rotate(0deg);
  transform: rotate(0deg);
}

.btn:focus,.btn:active {
   outline: none !important;
   box-shadow: none;
}

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);
}

.centered1 {
  position: fixed;
  top: 50%;
  left: 36%;
  /* bring your own prefixes */
  transform: translate(-50%, -50%);
}

table {
    
    word-wrap: break-word;
}

body {
  font-family: "Lato", sans-serif;
}

nav{
    background-color: #2e2e2e;
}

.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  /*top: 0;*/
  Right: 0;
  /*background-color: #2e2e2e;*/
  overflow-x: hidden;
  transition: 0.5s;
  /*padding-top: 23px;
  padding-left:5px;
  padding-right:5px;*/
}

.sidenav a{
  /*padding: 8px 8px 0px 25px;*/
  text-decoration: none;
  
  color: #818181;
  
  transition: 0.3s;
}

.sidenav small{
  
  color: #b1b1b1;
  transition: 0.3s;
}


/*
.sidenav a:hover {
  color: #f1f1f1;
}*/


.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

.sidenav .login {
  color:white;
  position: absolute;
  top: 13px;
  right: 25px;
  margin-left: 50px;
}
.sidenav .login:hover {
    color:#00bfff;
    cursor:pointer;
}

.sidenav h5 {
    font-size: 0.8rem;
}


/* width */ 
.my-custom-scrollbar::-webkit-scrollbar { 
    width: 10px; 
    
} 
/* Track */ 
.my-custom-scrollbar::-webkit-scrollbar-track { 
    background: #f1f1f1; 
    
} 
/* Handle */ 
.my-custom-scrollbar::-webkit-scrollbar-thumb { 
    background: #888; 
    
} 
/* Handle on hover */ 
.my-custom-scrollbar::-webkit-scrollbar-thumb:hover { 
    background: #555; 
    
} 

.h5text{
    display: block;
  white-space: nowrap;
  width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}



#main {
  transition: margin-left .5s;
  padding: 16px;
}

@media screen and (max-height: 450px) {
  .sidenav {padding-top: 15px;}
  .sidenav a {font-size: 18px;}
}


#input_membermark{
    background-color:#2e2e2e;
    color:#ffff;
    opacity:0.8;
}

#filterAttrValue{
    background-color:#2e2e2e;
    color:#ffff;
    height:25px;
}

.my-custom-scrollbar {
position: relative;
max-height: 600vh;
max-width: 100%;
overflow: auto;
}

.my-attr-scrollbar {
position: relative;
max-height: 600px;
width:100%;
overflow: auto;
}

.table-wrapper-scroll-y {
display: block;
}
#search_b{
     background-image: url(/images/b_search.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
}

div#search_b.active{
    
    background-image: url(/images/b_search_active.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    
}

div#search_b:hover{
    
    background-image: url(/images/b_search_active.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    
}

#saveview_b{
     background-image: url(/images/b_saveview.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
}

div#saveview_b.active{
    
    background-image: url(/images/b_saveview_active.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    
}

div#saveview_b:hover{
    
    background-image: url(/images/b_saveview_active.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    
}

#filter_b{
     background-image: url(/images/b_filter.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
}

div#filter_b.active{
    
    background-image: url(/images/b_filter_active.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    
}

div#filter_b:hover{
    
    background-image: url(/images/b_filter_active.png);
        background-size: 24px;
        background-repeat: no-repeat;
        background-position: center;
    
}

    .test{
        cursor: pointer;
    }
    /*
    #table th, #table td{
        display:inline-block;
  white-space: nowrap;
  width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
    }*/
     
     .attrname{
         
         display:inline-block;
  white-space: nowrap;
  width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
         
     }
     .attrvalue{
         display:inline-block;
  
  width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
         
     }
    
    
    
    .list-group{
      display:inline-block;
 }

    .card{
        border-radius:0rem;
    }
    
 tfoot, tfoot th, tfoot td {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  background: rgb(34,34,34);
  color: #fff;
  z-index:4;
}

        
</style>


   <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
	
		<!-- nav bar --> 
	<nav class="navbar navbar-expand-lg navbar-dark justify-content-between">
	    <div>
  <a class="navbar-brand" href="#">
     Smart Plant 3D
	</a>

	
	
	</div>


</nav>


  </head>
  <body>
    	<div class="overlay hidden centered">
	    
  <div class="form-group">
      <button onclick="overlay_close()" class="btn float-right btn-sm btn-outline-secondary" style="position:relative;top:-10px;">x</button>
    <label for="accesstoken">Access Token</label>
    
    <input id="token" type="password" class="form-control" id="accesstoken" aria-describedby="tokenHelp" placeholder="Enter Token">
    <small id="tokenHelp" class="form-text text-muted">Don't Share it with others.</small>
  </div>
  
  <a href="#" onclick="login()" class="close">Login</a>
  
</div>
    
<div class="overlay1 centered1 hidden">
    <i class = "fa fa-spinner fa-2x fa-pulse" style="z-index:100;"></i>
    <label> Updating the Progress ...</label>
</div>


 <div id="mySidenav" class="sidenav">
     <i class="login fa fa-user-circle-o fa-2x" style="display: none;"  onclick="login()" aria-hidden="true"></i>
     <ul class="nav nav-tabs" id="myTab" role="tablist">
  <li class="nav-item">
    <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Model Tree</a>
  </li>

  
  
</ul>


    
  <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">

<div id="html1">

</div>

<!--        <table class="table table-dark table-hover tableFixHead my-custom-scrollbar table-wrapper-scroll-y" style=" font-size:12px;background:rgba(34,34,34,0.1);">
<thead >
<tr>
<th scope="col" style="background:rgba(34,34,34,1)">LEVEL</th>
<th scope="col" style="background:rgba(34,34,34,1)">BOQ</th>
<th scope="col" style="background:rgba(34,34,34,1)">Descreption</th>
<th scope="col" style="background:rgba(34,34,34,1)">Unit</th>
<th scope="col" style="background:rgba(34,34,34,1)">Quantites</th>
<th scope="col" style="background:rgba(34,34,34,1)">Cumulative Certified</th>
<th scope="col" style="background:rgba(34,34,34,1)">Current Certified</th>
</tr>
</thead>
<tbody id="BOQtable"  style="cursor: pointer;">

</tbody>

<tfoot id="BOQGrandTotal">
</tfoot>

</table>-->
      
      
      
      </div>

  
  

  


        
</div>

    <script>
        
          var url = new URL(window.location.href);
var gettoken = url.searchParams.get("access_code");
if(gettoken != null){
    if(gettoken == "QWhtYWRVZHdhbktpbmc"){
        var firstTime = localStorage.getItem("first_time");
if(!firstTime) {
    // first time loaded!
    window.open('/viewer.php?doc=' + viewer.model.getData().urn,"_self");

}
else{
        var loginbtn = document.querySelector('.login');
        loginbtn.classList.add('hidden');
}
        
    }
}

    </script>

<!-- Viewer  -->

	<div id = "MyViewerDiv"  style = "height:calc(100vh - 56px); position:relative;"></div>

    <!-- Developer JS -->
    
    <script>
        
          
  
    </script>
     <script>
        var selected;
        var viewer;
        
        //get views from my database
        //
        
        var options = {
            env: 'AutodeskProduction',
            accessToken: <? echo "'". json_decode($data,true)[access_token] . "'" ?>,
            api: 'derivativeV2'    // for models uploaded to EMEA change this option to 'derivativeV2_EU'
        };
        var documentId = <? echo "'urn:" . $doc . "'" ?>;
        
        Autodesk.Viewing.Initializer(options, function onInitialized(){
            // Find the element where the 3d viewer will live.    
            var htmlElement = document.getElementById('MyViewerDiv');
            //console.log(htmlElement);
            if (htmlElement) {
                // Create and start the viewer in that element    
                viewer = new Autodesk.Viewing.GuiViewer3D(htmlElement);
                viewer.start();
            }
                
            });
                
            Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
           
        

        /**
        * Autodesk.Viewing.Document.load() success callback.
        * Proceeds with model initialization.
        */
        function onDocumentLoadSuccess(doc) {
            
             
     
            // A document contains references to 3D and 2D geometries.
            var geometries = doc.getRoot().search({'type':'geometry'});
            //console.log(geometries);
            if (geometries.length === 0) {
                console.error('Document contains no geometries.');
                return;
            }
            else{
                //var dorpdown = document.getElementById('my2d');
                //var mydrop ="";
               // for(var i = 0; i<geometries.length;i++)
                    //dorpdown.innerHTML = dorpdown.innerHTML + '<a class="dropdown-item" href="viewer.php?doc=' + <? echo "'" . $doc. "'" ?> + '&id='+ i + '">' + geometries[i].data.name; + '</a>';
                
            }

            // Choose any of the avialable geometries
            var id = <? echo $id ?>;
            var dorpdowntitle = document.getElementById('dropdown');
            
            
            console.log(id);
            if(id == -1){
                var initGeom = geometries[0];
               // dorpdowntitle.innerHTML = geometries[0].data.name;
            }
            else{
                var initGeom = geometries[id];
                dorpdowntitle.innerHTML = geometries[id].data.name;
            }
            //console.log(geometries);
            // Create Viewer instance
            var viewerDiv = document.getElementById('MyViewerDiv');
            var config = {
                extensions: ['panelExt'],
                extensions: initGeom.extensions() || []
            };
            viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerDiv, config);

			// get control id
			

            // Load the chosen geometry
            var svfUrl = doc.getViewablePath(initGeom);
            var modelOptions = {
                keepCurrentModels: true,
                   // placementTransform: (new THREE.Matrix4()).setPosition({x:0,y:0,z:0} ),
                //sharedPropertyDbPath: doc.getPropertyDbPath()
            };
            viewer.start(svfUrl, modelOptions, onLoadModelSuccess, onLoadModelError);
            
        }

        /**
         * Autodesk.Viewing.Document.load() failure callback.
         */
        function onDocumentLoadFailure(viewerErrorCode) {
            console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode);
        }

        /**
         * viewer.loadModel() success callback.
         * Invoked after the model's SVF has been initially loaded.
         * It may trigger before any geometry has been downloaded and displayed on-screen.
         */
         var event1;
        function onLoadModelSuccess(model) {
            
            //updateViewsMenu();
            //updateTasksMenu();
            
            //selection
            
           
            
            
                
    
    
            //console.log('onLoadModelSuccess()!');
            //console.log('Validate model loaded: ' + (viewer.model === model));
            
            //create initial configuration function for view
            //viewer.setSelectionMode(1);
            //viewer.setLightPreset(18);
            
            //remove xray 
            viewer.setProfile(viewer.profileManager.PROFILE_AEC);
            viewer.profile.settings.ghosting = true;
            viewer.setProfile(viewer.profile);
            
             // hide model tools 
             //viewer.modelTools.setVisible(false);
             //hide settings tools 
            viewer.settingsTools.setVisible(false);
            viewer.setSelectionMode(0);
            viewer.setGroundShadow(false);
            //
            viewer.loadExtension('panelExt');
            var button = document.getElementById('showpanelExt');
            button.children[0].innerHTML = '<i class="fa fa-database" aria-hidden="true"></i>';
            
             
    
    
    //getProgressdb();
    //updateBOQtable();
    // updateActivitiesList();
    //updateWorkorder();
    

    /*var grandTotal = new GrandTotalPanel(viewer,NOP_VIEWER.container,'grandTotal','Grand Total');
    grandTotal.setVisible(true);*/
    
    viewer.addEventListener(Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT, function( event ) {
    
        hideGrids();
        urnId = viewer.model.getData().urn;
    });
    
    viewer.addEventListener(Autodesk.Viewing.SHOW_ALL_EVENT, function( event ) {
    
        hideGrids();
    });
    
    viewer.addEventListener(Autodesk.Viewing.OBJECT_TREE_LOAD_PROGRESS_EVENT, function( event ) {
        
        if(event.percent === 100){
            
            // create costmized tree.
            document.getElementById("mySidenav").style.width = "20%";
            document.getElementById("MyViewerDiv").style.marginRight = "20%";
            viewer.resize();
  
            var html = document.getElementById("html1")

var tree = viewer.model.getData().instanceTree;

var data ="";

for(var i =1; i<tree.objectCount;i++){
if(tree.getNodeName(i).includes(".vue")){

data = data + '<ul><li tree_id = ' + i + ' >' + tree.getNodeName(i);

tree.enumNodeChildren(i,(ch) =>{ 
data = data + '<ul><li tree_id = ' + ch + ' >' + tree.getNodeName(ch) ;

tree.enumNodeChildren(ch,(ch1) =>{ 
data = data + '<ul><li tree_id = ' + ch1 + ' >' + tree.getNodeName(ch1) + "</li></ul>";
},false);

data = data + "</li></ul>";
},false);
data = data + "</li></ul>";
}
}

html.innerHTML = data 

$('#html1').jstree(
    {"core": {
        "themes":{
            "icons":false
        }
    }
    });
	
	

$('#html1').on("select_node.jstree", function (e, data1) { 
viewer.isolate(parseInt(data1.node.li_attr["tree_id"]));
viewer.fitToView(parseInt(data1.node.li_attr["tree_id"]));
 });
 
 
        }
        
        
    });
    
    viewer.addEventListener(Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT, function( event ) {
        
        //updateActivitiesList();
        
        
    });
    
    
    
       viewer.addEventListener(Autodesk.Viewing.SELECTION_CHANGED_EVENT, function( event ) {
               var tree = viewer.model.getData().instanceTree;
               var selid = tree.getNodeParentId(event.dbIdArray[0]);
               console.log("selection is :" +  event.dbIdArray[0] +  "& its parent is : "  + selid);
               event1 = event;
               var data = [];
               model.getProperties( event.dbIdArray[0], function(prop1){
                   
               if(prop1.name == "Geometry" ){
                   
                model.getProperties( selid, function(prop){
                    
                    //data.push( '<tr>' + '<td class="attrname"><p class="test">' + "Name" + '</p></td>' + '<td class="attrvalue"><p class="test" title="Copied !" >' + prop.name + '</p></td>'+'</tr>');
                    prop.properties.forEach(function (item){
                        
                        if(item["displayCategory"] == "SmartPlant 3D"){
                            data.push('<tr>' + '<td class="attrname"><p class="test">' + item["displayName"] + '</p></td>' + '<td class="attrvalue"><p class="test" title="Copied !" >' + item["displayValue"] + '</p></td>'+'</tr>');
                    }


                        
		
		
	
                        
                    });
                    //console.log(data);
                    
                    var tablecell = document.getElementById('Mrcode');
                    tablecell.innerHTML = data.join('\n');
                    /*
			$("tr").each(function(){
				var current_keyword = $(this).text();
				
				    if(current_keyword.includes(level + boq)){
				        $(this).addClass('selectedfrommodel');
				        //$('table').scrollTop( 0 );
				        $('table').animate({
                    scrollTop: $(this).offset().top - $('#BOQtable').offset().top
                }, 500);
				    }
					    	 	
				
				else{$(this).removeClass('selectedfrommodel');    };
			});    	
	*/

                }, function(){console.log("nooo")} );
               }
               
               else{
                   prop1.properties.forEach(function (item){
                        
                        if(item["displayCategory"] == "SmartPlant 3D"){
                            data.push('<tr>' + '<td class="attrname"><p class="test">' + item["displayName"] + '</p></td>' + '<td class="attrvalue"><p class="test" title="Copied !" >' + item["displayValue"] + '</p></td>'+'</tr>');
                    }
                    });
                    
                    
                    var tablecell = document.getElementById('Mrcode');
                    tablecell.innerHTML = data.join('\n');
               }
                
               }, function(){console.log("nooo")} );
                
                
                
    });
    
    /*
     var grids = 'urn: dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZXRqbGprN2huM2dpdmNpemR6d2NiaGhzbHk4NHB4MTZfdHV0b3JpYWxfYnVja2V0LzNEJTIwR3JpZHMlMjBNb2RlbC5ud2M=';
            Autodesk.Viewing.Document.load(grids, (doc) => {
                var viewables = doc.getRoot().getDefaultGeometry();
                viewer.loadDocumentNode(doc, viewables,{
                    
                    keepCurrentModels: true,
                    //placementTransform: (new THREE.Matrix4()).setPosition({x:0,y:0,z:29000} ),
                    //globalOffset: {x:0,y:0,z:29000}
                })
                .then( onLoadFinished );
            });*/
 
        
   

}
        /**
         * viewer.loadModel() failure callback.
         * Invoked when there's an error fetching the SVF file.
         */
        function onLoadModelError(viewerErrorCode) {
            console.error('onLoadModelError() - errorCode:' + viewerErrorCode);
        }

        function onLoadFinished(doc){
            
            console.log(doc);
            
        }
        

        

    </script>


	
	
	
	
	

  </body>
  
  <footer>

    </footer>
</html>