Skip to content

Commit

Permalink
Merge pull request #48 from amosproj/Basic_API-set-UP
Browse files Browse the repository at this point in the history
Include Basic_API-set-UP in sprint-05-release-candidate (#12)
  • Loading branch information
leonopulos authored May 18, 2021
2 parents 305df01 + 04a882a commit ca63f9f
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 1 deletion.
Binary file added basicSetUp.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,53 @@ function render() {

}

//---------------------changes basic set up 18.05.2021---------------------------------------------
function basicSetUp(){

viewerImageAPI.viewerState=new ViewerState(null,null,null,null,[]) ;

//console.log("----The origin in the 3d diagram: -----",viewerImageAPI.origin);

viewerImageAPI.viewerState.loc=viewerImageAPI.origin;
console.log("----The origin in the 3d diagram: -----");
console.log( viewerImageAPI.viewerState.loc);
//console.log();
//console.log("The ID of the currecntImage: ",viewerImageAPI.currentImageId);


viewerImageAPI.viewerState.imageNum=viewerImageAPI.currentImageId;
console.log("The ID of the currecntImage: ",viewerImageAPI.viewerState.imageNum);

//console.log();
//console.log("The name of the floor map: ",viewerImageAPI.floors[viewerImageAPI.currentFloorId].name);


/*for(let key in viewerImageAPI.floors){
console.log(key);
console.log(viewerImageAPI.floors[key]);
}*/
viewerImageAPI.viewerState.floor=viewerImageAPI.floors[viewerImageAPI.currentFloorId].name;
console.log("The name of the floor map: ",viewerImageAPI.viewerState.floor);

//console.log("The number of the floor: ",viewerImageAPI.floors.z);
//console.log("The mouse moving lon is: ",viewerViewState.lonov * Math.PI / 180.0);
// console.log("The mouse moving lat is: ",viewerViewState.latov * Math.PI / 180.0);

viewerImageAPI.viewerState.view[2]=viewerViewState.latov* Math.PI / 180.0;
viewerImageAPI.viewerState.view[1]=viewerViewState.lonov* Math.PI / 180.0;
viewerImageAPI.viewerState.view[0]=viewerViewState.fov;
console.log("The mouse wheel moving angle is: ", viewerImageAPI.viewerState.view[0]);
console.log("The value of view in viewerState ","lon: "+viewerImageAPI.viewerState.view[1],"lat: "+viewerImageAPI.viewerState.view[2]);

viewerAPI.viewerVersionAPI=new ViewerVersionAPI(viewerAPI.MAJOR, viewerAPI.MINOR, viewerImageAPI.viewerState.view);


console.log("show the value of view value in viewerVersionAPI: ",viewerAPI.viewerVersionAPI.viewer);


}
//---------------------changes basic set up 18.05.2021---------------------------------------------

function getAngle(camera){
var vector = new THREE.Vector3( 0, 0, - 1 );
// Get the direction of the camera
Expand Down
8 changes: 7 additions & 1 deletion src/js/viewer/ViewerAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export class ViewerAPI {
this.viewerPanoAPI = viewerPanoAPI;
this.viewerMapAPI = viewerMapAPI;
this.libs = libraryInfo(); // List of used third party libraries


this.MAJOR =null;//adding in 18.05.2021


this.MINOR =null;// adding in 18.05.2021
}


Expand Down Expand Up @@ -52,4 +58,4 @@ export class ViewerAPI {
}


}
}
22 changes: 22 additions & 0 deletions src/js/viewer/ViewerState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export class ViewerState {

constructor(panoLon, panoLat, imageIdx, name,[fov, lonov,latov] ) {

//this.big =

this.floor = name; // : String // Name of floor which contains this image

this.imageNum = imageIdx; // : Number // Image number

this.loc = [panoLon, panoLat]; // : [Number] // WGS 84 coordinates [longitude, latitude, z] of this image

//this.fov = fov; // : Number // Field of view (in degrees)
// viewerViewState1= new ViewerViewState(DEFAULT_FOV, 0, 0)
this.view=[fov, lonov, latov];




}

}
9 changes: 9 additions & 0 deletions src/js/viewer/ViewerVersionAPI.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

export class ViewerVersionAPI{

constructor(MAJOR, MINOR, [vvfov, vvlatov,vvlonov]){
this.MAJOR=MAJOR;
this.MINOR=MINOR;
this.viewer= [vvfov, vvlatov,vvlonov];
}
}

0 comments on commit ca63f9f

Please sign in to comment.