Fix mesh info duplication on open/close.

This commit is contained in:
kovacsv 2018-12-16 14:13:11 +01:00
parent b3d06ca5c0
commit dd240120b5
3 changed files with 112 additions and 3 deletions

View File

@ -247,8 +247,9 @@ ImporterApp.prototype.GenerateMenu = function ()
isOpen : false,
open : 'images/info.png',
close : 'images/info.png',
onOpen : function (content, mesh) {
var table = new InfoTable (content);
onOpen : function (contentDiv, mesh) {
contentDiv.empty ();
var table = new InfoTable (contentDiv);
var min = new JSM.Coord (JSM.Inf, JSM.Inf, JSM.Inf);
var max = new JSM.Coord (-JSM.Inf, -JSM.Inf, -JSM.Inf);
@ -281,7 +282,6 @@ ImporterApp.prototype.GenerateMenu = function ()
},
userButton : {
id : 'showhidemesh-' + meshIndex,
isOpen : true,
onCreate : function (image) {
image.attr ('src', 'images/visible.png');
},

View File

@ -0,0 +1,6 @@
newmtl Material0
Kd 0.784314 0 0
newmtl Material1
Kd 0 0.784314 0
newmtl Material2
Kd 0 0 0.784314

View File

@ -0,0 +1,103 @@
mtllib multimesh.mtl
g Mesh10
v -0.5 -0.5 -0.5
v 0.5 -0.5 -0.5
v 0.5 -0.5 0.5
v -0.5 -0.5 0.5
v -0.5 0.5 -0.5
v 0.5 0.5 -0.5
v 0.5 0.5 0.5
v -0.5 0.5 0.5
vn 0 -1 0
vn 0 -1 0
vn 1 0 0
vn 1 0 0
vn 0 1 0
vn 0 1 0
vn -1 0 0
vn -1 0 0
vn 0 0 -1
vn 0 0 -1
vn 0 0 1
vn 0 0 1
usemtl Material0
f 1//1 2//1 3//1
f 1//2 3//2 4//2
f 2//3 6//3 7//3
f 2//4 7//4 3//4
f 6//5 5//5 8//5
f 6//6 8//6 7//6
f 5//7 1//7 4//7
f 5//8 4//8 8//8
f 1//9 5//9 6//9
f 1//10 6//10 2//10
f 4//11 3//11 7//11
f 4//12 7//12 8//12
g Mesh11
v 1.5 -0.5 -0.5
v 2.5 -0.5 -0.5
v 2.5 -0.5 0.5
v 1.5 -0.5 0.5
v 1.5 0.5 -0.5
v 2.5 0.5 -0.5
v 2.5 0.5 0.5
v 1.5 0.5 0.5
vn 0 -1 0
vn 0 -1 0
vn 1 0 0
vn 1 0 0
vn 0 1 0
vn 0 1 0
vn -1 0 0
vn -1 0 0
vn 0 0 -1
vn 0 0 -1
vn 0 0 1
vn 0 0 1
usemtl Material1
f 9//13 10//13 11//13
f 9//14 11//14 12//14
f 10//15 14//15 15//15
f 10//16 15//16 11//16
f 14//17 13//17 16//17
f 14//18 16//18 15//18
f 13//19 9//19 12//19
f 13//20 12//20 16//20
f 9//21 13//21 14//21
f 9//22 14//22 10//22
f 12//23 11//23 15//23
f 12//24 15//24 16//24
g Mesh12
v 3.5 -0.5 -0.5
v 4.5 -0.5 -0.5
v 4.5 -0.5 0.5
v 3.5 -0.5 0.5
v 3.5 0.5 -0.5
v 4.5 0.5 -0.5
v 4.5 0.5 0.5
v 3.5 0.5 0.5
vn 0 -1 0
vn 0 -1 0
vn 1 0 0
vn 1 0 0
vn 0 1 0
vn 0 1 0
vn -1 0 0
vn -1 0 0
vn 0 0 -1
vn 0 0 -1
vn 0 0 1
vn 0 0 1
usemtl Material2
f 17//25 18//25 19//25
f 17//26 19//26 20//26
f 18//27 22//27 23//27
f 18//28 23//28 19//28
f 22//29 21//29 24//29
f 22//30 24//30 23//30
f 21//31 17//31 20//31
f 21//32 20//32 24//32
f 17//33 21//33 22//33
f 17//34 22//34 18//34
f 20//35 19//35 23//35
f 20//36 23//36 24//36