Closed ivanyuT closed 9 years ago
Do the original examples work?
A few comments on your code:
The example in bimview works very well and I can see the model.
However, the example1.html in Bimsurfer does not work and when I run it, it has a few errors.
I suspect it that it may be because of this few lines of missing some parameters:
The code:
o.model = o.bimServerApi.getModel(project.oid, project.lastRevisionId, false, function(model){ // model.getAllOfType("IfcProject", true, function(project){ // buildDecomposedTree(project, $(".tree"), 0); // }); });
the method call, getModel, has been missed the project schema's parameter.
The code:
var geometryLoader = new GeometryLoader(o.bimServerApi, o.viewer);
It may miss the models array in the parameters.
Thank you for your comment.
I comment the "user strict" and change the encoding to UTF-8 but it has only the black canvas.
Fixed the example1 in BIMsurfer.
I have read the example in BIMvie.ws and try to follow its pattern to construct my own example in the BIMsurfer folder. I can extract the ifc data from the bimserver. However, it can only show the black canvas without anything.
I suspect that I may miss something when I try to run "_this.viewer.loadGeometry(geometryLoader);" so when I render the model out, it cannot show anything.
Could you tell me what the problem is? Here are the codes.
myExample0.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Example 0</title>
<script type="text/javascript">
var debug = {};
</script>
<script type="text/javascript"
src="./lib/jquery-1.10.2/jquery-1.10.2.min.js"></script>
<script type="text/javascript"
src="./lib/jquery-1.10.2/jquery.cookie.js"></script>
<script type="text/javascript" src="./api/BIMSURFER.js"></script>
<script type="text/javascript" src="./lib/scenejs-4.0/scenejs.js"></script>
<script type="text/javascript" src="./api/SceneJS.js"></script>
<script type="text/javascript" src="./api/Constants.js"></script>
<script type="text/javascript" src="./api/ProgressLoader.js"></script>
<script type="text/javascript" src="./api/Types/Light.js"></script>
<script type="text/javascript" src="./api/Types/Light/Ambient.js"></script>
<script type="text/javascript" src="./api/Types/Light/Sun.js"></script>
<script type="text/javascript" src="./api/Control.js"></script>
<script type="text/javascript" src="./api/Control.js"></script>
<script type="text/javascript" src="./api/Control/ClickSelect.js"></script>
<script type="text/javascript" src="./api/Control/LayerList.js"></script>
<script type="text/javascript" src="./api/Control/ProgressBar.js"></script>
<script type="text/javascript" src="./api/Control/PickFlyOrbit.js"></script>
<script type="text/javascript" src="./api/Control/ObjectTreeView.js"></script>
<script type="text/javascript" src="./api/Events.js"></script>
<script type="text/javascript" src="./api/StringView.js"></script>
<script type="text/javascript" src="./api/GeometryLoader.js"></script>
<script type="text/javascript" src="./api/AsyncStream.js"></script>
<script type="text/javascript" src="./api/DataInputStream.js"></script>
<script type="text/javascript" src="./api/Viewer.js"></script>
<script type="text/javascript" src="./api/Util.js"></script>
<script type="text/javascript" src="js/bimserverapibootstrap.js"></script>
<script type="text/javascript" src="js/String.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<link rel="stylesheet" href="./css/basic.css" type="text/css" />
<link rel="stylesheet" href="./css/example1.css" type="text/css" />
<link rel="stylesheet"
href="./lib/jquery-ui-1.10.3.custom/css/custom-theme/jquery-ui-1.10.3.custom.css">
<script type="text/javascript"
src="./lib/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"></script>
<script type="text/javascript" src="./js/myExample0.js"></script>
</head>
<body>
<button id="btnTest" onClick="show(); return false;">Test</button>
<p id="consoleP"></p>
<div id="divBim3DView"></div>
</body>
</html>
Here is the javascript file: myExample0.js