index2.html 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>四维时代</title>
  6. <meta http-equiv="content-type" content="text/html; charset=UTF8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
  8. <link rel="stylesheet" href="css/wanaplan.min.css" />
  9. <style>
  10. .notFound {
  11. text-align:center;
  12. font-size:18px;
  13. width:100%;
  14. margin-top:100px;
  15. margin-left: 50px;
  16. }
  17. div.planItem {
  18. cursor : pointer;
  19. background:#fafafa;
  20. margin:10px;
  21. border:1px solid #CCC;
  22. position: relative;
  23. }
  24. div.planItem img {
  25. width:288px
  26. }
  27. div.planItem p {
  28. border-top:1px solid #CCC;
  29. padding: 5px;
  30. margin: 0px;
  31. color: #333;
  32. background: #FFF;
  33. }
  34. div.planItem div.toolbarPlan {
  35. display: none;
  36. background: #CCC;
  37. position: absolute;
  38. right: 0px;
  39. top: 0px;
  40. color: #222;
  41. opacity: 0.9;
  42. z-index: 9999;
  43. }
  44. div.planItem div.toolbarPlan .fa {
  45. padding: 5px;
  46. }
  47. div.planItem div.toolbarPlan .fa-times {
  48. padding-left: 15px;
  49. }
  50. div.planItem:hover div.toolbarPlan {
  51. display: block;
  52. }
  53. div.planItem div.overall{
  54. background: #222;
  55. opacity: 0.8;
  56. width:100%;
  57. height:100%;
  58. color:#FFF;
  59. top: 0px;
  60. position:absolute;
  61. text-align:center;
  62. vertical-align:middle;
  63. }
  64. div.planItem div.editForm{
  65. width:100%;
  66. height:100%;
  67. color:#FFF;
  68. top: 60px;
  69. position:absolute;
  70. text-align:center;
  71. vertical-align:middle;
  72. }
  73. div.planItem .editPlanInput{
  74. height:30px;
  75. width:90%;
  76. font-size: 15px;
  77. border: 1px solid #999;
  78. }
  79. div.planItem div.overall span{
  80. font-size:16px;
  81. }
  82. div.planItem .overall-cercle{
  83. opacity: 1;
  84. padding-left: 0;
  85. padding-right: 0;
  86. margin-left: auto;
  87. margin-right: auto;
  88. bottom: 25px;
  89. width:100%;
  90. position:absolute;
  91. }
  92. div.planItem div.editForm .window-action-bar{
  93. margin-top:10px;
  94. text-align: right;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <img src='images/pattern.png' style='display:none' id='imgWall' />
  100. <img src='images/pattern_tmp.png' style='display:none' id='imgTempWall' />
  101. <img src='images/grid2.jpg' style='display:none' id='img' />
  102. <div id="subMenuContainer">
  103. <div id="subMenu">
  104. <ul id="subMenuList">
  105. <li class="menu-item hidden" id="lock-icon"><span class="menu-icon"><i class="fa fa-unlock"></i></span><span class="menu-title">锁/解锁</span></li>
  106. <!--
  107. <li class="menu-item" id="item25"><span class="menu-icon"><i class="fa fa-reply"></i></span><span class="menu-title">Undo</span></li>
  108. <li class="menu-item" id="item26"><span class="menu-icon"><i class="fa fa-share"></i></span><span class="menu-title">Redo</span></li>
  109. -->
  110. <li class="menu-item hidden" id="transparencyButton"><span class="menu-icon"><img src="images/icon-transparency.png" /></span><span class="menu-title">墙体透明</span></li>
  111. <li class="menu-item" id="toolbarScreenshot"><span class="menu-icon"><i class="fa fa-camera"></i></span><span class="menu-title">拍照</span></li>
  112. <li class="menu-item" id="fullscreen-btn"><span class="menu-icon"><i class="fa fa-arrows-alt"></i></span><span class="menu-title">全屏</span></li>
  113. </ul>
  114. </div>
  115. </div>
  116. <section id="main-ui" class="show">
  117. <div id="toolbar">
  118. <div id="toolbar-bar">
  119. <ul id="toolbarMenu">
  120. <li class="menu-item" id="toolbarNew"><span class="menu-icon"><i class="fa fa-file"></i></span><span class="menu-title">新建</span></li>
  121. <li class="menu-item" id="toolbarSave"><span class="menu-icon"><img src="images/save_icon.png" /></span><span class="menu-title">保存</span></li>
  122. <li class="menu-item menu-subitem" id="toolbarOption"><span class="menu-icon"><i class="fa fa-cog"></i></span><span class="menu-title">配置</span>
  123. <ul class="undefined">
  124. <li class="menu-item" id="item27"><span class="menu-title">Increase performances</span></li>
  125. <li class="menu-item" id="2D-options"><span class="menu-title">2D options</span></li>
  126. <li class="menu-item" id="toolbarChangeLanguage"><span class="menu-title">Change language</span></li>
  127. <li class="menu-item" id="item19"><span class="menu-title">
  128. <hr /></span></li>
  129. <li class="menu-item" id="toolbarAbout"><span class="menu-title">About Wanaplan</span></li>
  130. </ul></li>
  131. <li class="menu-item menu-subitem" id="userOption"><span class="menu-icon"><i class="fa fa-user"></i></span><span class="menu-title">用户</span>
  132. <ul class="undefined">
  133. <li class="menu-item" id="user"><span class="menu-title">login</span></li>
  134. </ul></li>
  135. </ul>
  136. </div>
  137. </div>
  138. <section id="mainMenu">
  139. <div id="mainMenuTabsContainer">
  140. <ul id="mainMenuTabs">
  141. <li class="menu-item label-2D selected" id="draw2D"><span class="menu-icon"><img src="images/dessiner.png" /></span><span class="menu-title">设计</span></li>
  142. <li class="menu-item label-3D" id="furnishing3D"><span class="menu-icon"><img src="images/meubler.png" /></span><span class="menu-title">家具</span></li>
  143. <li class="menu-item label-3D" id="decorate3D"><span class="menu-icon"><img src="images/decorer.png" /></span><span class="menu-title">装修</span></li>
  144. </ul>
  145. </div>
  146. <h3 id="mainMenuTitle">绘图</h3>
  147. <div id="mainMenuContent">
  148. <ul id="mainMenuContentList" class="mainList layout-list">
  149. </ul>
  150. </div>
  151. </section>
  152. </section>
  153. <!-- Splashscreen -->
  154. <div style="display: none;" id="splashscreen">
  155. <div id="custom-splash" style="display:none" class="splash-text">
  156. <img src="images/3D.png" style="width:50px;vertical-align:-20px;" /> Kazaplan
  157. <div class="splash-bar">
  158. <div style="animation-duration: 1s;" class="splash-bar-inner"></div>
  159. </div>
  160. <a style="color:black;display:block;text-decoration:none;margin:20px 0 0 0;text-align:right;font-size:14px" href="http://www.wanadev.com"> by <span style="color:#07656D">Wana</span><span style="color:black">dev</span> </a>
  161. </div>
  162. <div id="stock-splash" style="display: block;" class="splash-text">
  163. <img src="images/wanaplan-logo.png" style="width:50px;vertical-align:-15px;" /> Wanaplan
  164. <div class="splash-bar">
  165. <div style="animation-duration: 1s;" class="splash-bar-inner"></div>
  166. </div>
  167. </div>
  168. </div>
  169. <!-- Screenshot Flash -->
  170. <div style="display: none;" id="screenshot-flash"></div>
  171. <!-- Help Bubble -->
  172. <div id="helpbubble" class="">
  173. <div id="helpbubble-close" class="close"></div>
  174. <div class="wrapper">
  175. <div class="image">
  176. <img src="" alt="" id="helpbubble-image" />
  177. </div>
  178. <div id="helpbubble-content" class="content"></div>
  179. </div>
  180. </div>
  181. <!-- Debug view -->
  182. <div id="debugArea"></div>
  183. <!-- Plan2D Area -->
  184. <div style="display:block" class="drawableSurface with-menu" id="container2d">
  185. <canvas height="413" width="1180" id="backgroundcanvas2d" style="position: absolute; z-index: 0"></canvas>
  186. <canvas height="413" width="1180" id="selectcanvas2d" style="position: absolute; z-index: 2"></canvas>
  187. <canvas height="413" width="1180" id="dynamiccanvas2d" style="position: absolute; z-index: 1 ; opacity: 1;"></canvas>
  188. </div>
  189. <!-- Plan3D Area -->
  190. <div style="display:none" class="drawableSurface with-menu" id="container3d">
  191. <canvas height="413" width="1180" id="canvas3d"></canvas>
  192. </div>
  193. <div id="waiter" class="hidden">
  194. Computing, please wait...
  195. </div>
  196. <section id="modalWidgets">
  197. <div class="window window-with-button" id="aboutWindow" style="display: none; position: absolute; top: 96.5px; left: 476.5px;">
  198. <header class="window-title">
  199. <span class="window-close">
  200. </span>
  201. <h1>关于四维时代</h1>
  202. </header>
  203. <div class="window-content">
  204. <div class="tabbed horizontal">
  205. <ul class="tabbed-tabs">
  206. <li rel="tab-0" class="active">
  207. <span class="tab-text">关于</span>
  208. </li>
  209. <li rel="tab-1" class="">
  210. <span class="tab-text">Credits</span>
  211. </li>
  212. </ul>
  213. <div class="tabbed-tabcontent">
  214. <section class="tab-content-0 active">
  215. <div style="width: 432px; text-align: center;">
  216. <img src="./images/wanaplan-logo.png" alt="Wanaplan">
  217. </div>
  218. <div style="text-align: center; font-size: 16pt; font-weight: bold; margin-top: 15px; color: #333;">四维时代家具展示</div>
  219. <div style="text-align: center; margin-top: 30px; color: #555;">版权归四维时代所有
  220. </div>
  221. <div style="text-align: center; margin-top: 10px;">
  222. <a href="http://www.4dage.com/" target="_blank">www.4dage.com</a>
  223. </div>
  224. </section>
  225. <section class="tab-content-1">
  226. <div class="scrollable-content" style="width: 410px; max-height: 300px; min-height: 100px; font-size: 9pt;">
  227. <ul>
  228. <li>
  229. <strong>"seamless" textures:</strong>
  230. <dl>
  231. <dt>Author:</dt>
  232. <dd>~hhh316 Giles</dd>
  233. <dt>License:</dt>
  234. <dd>cc-by 3.0</dd>
  235. <dt>Downloaded from:</dt>
  236. <dd><a href="http://seamless-pixels.blogspot.fr/"> http://seamless-pixels.blogspot.fr/</a></dd>
  237. </dl>
  238. </li>
  239. <li>
  240. <strong>Babylonjs engine:</strong>
  241. <dl>
  242. <dt>Authors:</dt>
  243. <dd>David Catuhe &amp; David Rousset</dd>
  244. <dt>Licence:</dt>
  245. <dd>Apache License 2.0</dd>
  246. <dt>Homepage:</dt>
  247. <dd><a href="http://www.babylonjs.com">http://www.babylonjs.com</a></dd>
  248. </dl>
  249. </li>
  250. </ul>
  251. </div>
  252. </section>
  253. </div>
  254. </div>
  255. </div>
  256. <div class="window-action-bar">
  257. <button rel="">关闭</button>
  258. </div>
  259. </div>
  260. <div style="position: absolute; top: 50px; left: 10px; height: 300px; width: 50px;">
  261. <div style="width: 50px; height: 210px; position: relative; background-image: url(&quot;images/remote-controller/bg.png&quot;);" id="remoteController">
  262. <div style="width:20px;height:150px;position:absolute;top:57px;left:15px;">
  263. <div style="width: 20px; height: 7px; background: none repeat scroll 0% 0% rgb(138, 184, 8); border-radius: 2px; cursor: pointer; border: 1px solid rgb(110, 145, 15); margin-top: 85px;" id="mark"></div>
  264. </div>
  265. <div style="width: 18px; height: 18px; position: absolute; background-size: cover; top: 16px; left: 16px; border-radius: 7px; display: none; background-image: url(&quot;images/remote-controller/green_man.png&quot;);" id="camera-swap-btn"></div>
  266. <div style="width:50px;height:50px;cursor:pointer;position:absolute;"></div>
  267. </div>
  268. </div>
  269. <div class="window" id="productList" style="width: 1062px; height: 652.666666666667px; display: none; position: absolute; top: 1.16666666666669px; left: 265.5px;">
  270. <header class="window-title">
  271. <span class="window-close" id="closeproduct">
  272. </span>
  273. <h1>
  274. <img class="window-title-icon" src="images/productIconTitle.png">
  275. <span class="window-title-text">产品列表 &gt; 卧室</span>
  276. </h1>
  277. </header>
  278. <div class="window-content">
  279. <div class="tabbed vertical">
  280. <ul class="tabbed-tabs">
  281. <li rel="tab-0">
  282. <span class="tab-text"></span>
  283. </li>
  284. <li rel="tab-1" class="active">
  285. <span class="tab-text">所有</span>
  286. </li>
  287. </ul>
  288. <div class="tabbed-tabcontent">
  289. <section class="tab-content-1 active">
  290. <div id="productItems">
  291. </div>
  292. </section>
  293. </div>
  294. </div>
  295. </div>
  296. <div class="window-action-bar">
  297. </div>
  298. </div>
  299. <div class="window window-with-button horizontal" id="configuratorWindow" style="width: 420px; height: 425px; display: none; top: 70px; left: 1346px;">
  300. <header class="window-title" id="editproducttitle"><span class="window-close"></span><h1>产品编辑界面</h1>
  301. </header>
  302. <div class="window-content">
  303. <div class="tabbed horizontal">
  304. <ul class="tabbed-tabs">
  305. <li rel="tab-0" class="active" id="editsize"><span class="tab-text">大小设置</span></li>
  306. <li rel="tab-1" class="" id="editptrot"><span class="tab-text">位置和角度</span></li>
  307. </ul>
  308. <div class="tabbed-tabcontent">
  309. <section class="tab-content-0 active" id="tabSize">
  310. <ul>
  311. <li class="separator" id="item-0"><label>桌子</label><span class="field"><hr></span></li>
  312. <li class="param-item" id="params-width"><label>宽度</label><span class="field"><input type="number" step="1" value="" event-params="{&quot;eventName&quot;:&quot;wnp.contextMenu.propertyChanged&quot;,&quot;property&quot;:&quot;params.mattress.width&quot;}" rel="wnp.contextMenu.propertyChanged"><span class="unit">cm</span></span></li>
  313. <li class="param-item" id="params-length"><label>长度</label><span class="field"><input type="number" step="1" value="" event-params="{&quot;eventName&quot;:&quot;wnp.contextMenu.propertyChanged&quot;,&quot;property&quot;:&quot;params.mattress.length&quot;}" rel="wnp.contextMenu.propertyChanged"><span class="unit">cm</span></span></li>
  314. <li class="param-item" id="params-height"><label>高度</label><span class="field"><input type="number" step="1" value="" event-params="{&quot;eventName&quot;:&quot;wnp.contextMenu.propertyChanged&quot;,&quot;property&quot;:&quot;params.mattress.thickness&quot;}" rel="wnp.contextMenu.propertyChanged"><span class="unit">cm</span></span></li>
  315. </ul>
  316. </section>
  317. <section class="tab-content-1" id="tabPtRot">
  318. <ul>
  319. <li class="separator" id="item-1"><label>角度</label><span class="field"><hr></span></li>
  320. <li class="param-item" id="rotation-y"><label>绕Y轴</label><span class="field"><input id="rangeAngle" type="range" min="0" max="360" step="1" value="" class=" input-range unit"><input id="angleValue" type="number" class="unit" min="0" max="360" value="" step="1" readonly><span class="unit">°</span></span></li>
  321. <li class="separator" id="item-2"><label>位置</label><span class="field"><hr></span></li>
  322. <li class="param-item" id="position-x"><label>X:(左/右)</label><span class="field"><input type="number" min="-10000" max="10000" step="10" value="" event-params="{&quot;eventName&quot;:&quot;wnp.contextMenu.transformChanged&quot;,&quot;property&quot;:&quot;position.x&quot;}" rel="wnp.contextMenu.transformChanged" class=" unit"></span></li>
  323. <li class="param-item" id="position-y"><label>Y:(上/下)</label><span class="field"><input type="number" min="-10000" max="10000" step="10" value="" event-params="{&quot;eventName&quot;:&quot;wnp.contextMenu.transformChanged&quot;,&quot;property&quot;:&quot;position.y&quot;}" rel="wnp.contextMenu.transformChanged" class=" unit"></span></li>
  324. <li class="param-item" id="position-z"><label>Z:(前/后)</label><span class="field"><input type="number" min="-10000" max="10000" step="10" value="" event-params="{&quot;eventName&quot;:&quot;wnp.contextMenu.transformChanged&quot;,&quot;property&quot;:&quot;position.z&quot;}" rel="wnp.contextMenu.transformChanged" class=" unit"></span></li>
  325. </ul>
  326. </section>
  327. </div>
  328. </div>
  329. </div>
  330. <div class="window-action-bar">
  331. <button id="removeMesh" class="remove">移除</button>
  332. <button id="editMesh">提交</button>
  333. </div>
  334. </div>
  335. </section>
  336. <!-- Scripts -->
  337. <section id="scripts">
  338. <script>"use strict"</script>
  339. </section>
  340. <div style="width: 80px; opacity: 0.9; cursor: pointer; position: absolute; bottom: 28px; left: 0px; z-index: 99999; display: none;" id="stats">
  341. <div style="padding: 0px 0px 3px 3px; text-align: left; background-color: rgb(0, 0, 34);" id="fps">
  342. <div style="color: rgb(0, 255, 255); font-family: Helvetica,Arial,sans-serif; font-size: 9px; font-weight: bold; line-height: 15px;" id="fpsText">
  343. FPS
  344. </div>
  345. <div style="position: relative; width: 74px; height: 30px; background-color: rgb(0, 255, 255);" id="fpsGraph">
  346. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  347. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  348. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  349. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  350. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  351. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  352. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  353. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  354. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  355. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  356. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  357. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  358. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  359. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  360. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  361. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  362. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  363. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  364. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  365. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  366. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  367. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  368. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  369. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  370. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  371. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  372. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  373. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  374. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  375. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  376. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  377. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  378. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  379. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  380. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  381. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  382. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  383. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  384. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  385. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  386. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  387. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  388. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  389. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  390. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  391. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  392. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  393. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  394. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  395. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  396. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  397. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  398. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  399. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  400. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  401. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  402. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  403. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  404. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  405. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  406. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  407. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  408. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  409. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  410. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  411. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  412. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  413. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  414. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  415. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  416. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  417. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  418. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  419. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 17, 51);"></span>
  420. </div>
  421. </div>
  422. <div style="padding: 0px 0px 3px 3px; text-align: left; background-color: rgb(0, 34, 0); display: none;" id="ms">
  423. <div style="color: rgb(0, 255, 0); font-family: Helvetica,Arial,sans-serif; font-size: 9px; font-weight: bold; line-height: 15px;" id="msText">
  424. MS
  425. </div>
  426. <div style="position: relative; width: 74px; height: 30px; background-color: rgb(0, 255, 0);" id="msGraph">
  427. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  428. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  429. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  430. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  431. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  432. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  433. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  434. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  435. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  436. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  437. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  438. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  439. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  440. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  441. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  442. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  443. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  444. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  445. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  446. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  447. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  448. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  449. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  450. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  451. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  452. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  453. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  454. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  455. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  456. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  457. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  458. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  459. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  460. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  461. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  462. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  463. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  464. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  465. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  466. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  467. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  468. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  469. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  470. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  471. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  472. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  473. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  474. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  475. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  476. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  477. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  478. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  479. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  480. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  481. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  482. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  483. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  484. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  485. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  486. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  487. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  488. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  489. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  490. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  491. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  492. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  493. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  494. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  495. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  496. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  497. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  498. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  499. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  500. <span style="width: 1px; height: 30px; float: left; background-color: rgb(17, 51, 17);"></span>
  501. </div>
  502. </div>
  503. </div>
  504. <div style="right: 260px; top: 48px;" id="subsubMenuContainer">
  505. 79.73 m2
  506. </div>
  507. <div id="widget-2a02e7a5-c96f-40c1-ad45-b14f5db768c2" style="left: 72px; top: 20.65px; display: none; z-index: 2001;" class="photonui-widget photonui-basewindow photonui-window photonui-active window photonui-window-have-button">
  508. <div class="photonui-window-title">
  509. <button style="display: block;" title="Close" class="photonui-window-title-close-button"></button>
  510. <span class="photonui-window-title-text">Surfaces</span>
  511. </div>
  512. <div style="width: 1152px; height: 330.4px; padding: 0px; min-width: 0px; min-height: 0px;" class="photonui-container photonui-window-content photonui-container-expand-child">
  513. <div id="widget-43a4e730-6d4c-446d-99e8-6ff2cc4aa2d6" style="padding: 5px; overflow: auto;" class="photonui-widget photonui-viewport photonui-container"></div>
  514. </div>
  515. </div>
  516. <div id="loaddiv" style="display:none;opacity: 0.6; z-index: 10000; position: absolute; background-color: rgb(255, 255, 255);">
  517. <img src="images/load.png" style="position: absolute; z-index: 10000;" id="loadimg">
  518. </div>
  519. <!--<script src="js/wanaplan.min.js"></script>-->
  520. <script src = "libs/CanvasSketch.js"></script>
  521. <script type = "text/javascript">
  522. var TESTREFRESH=0;
  523. //var circleStyle = {fillColor:"blue", fill:true, stroke:true, fillOpacity:1, strokeOpacity:1};
  524. var div = document.getElementById("container2d");
  525. var width=window.outerWidth-260;
  526. var height=window.outerHeight;
  527. var stepx=50;
  528. var stepy=50;
  529. var backgroundSize=50;
  530. var startx=-stepx*backgroundSize;
  531. //var starty=-parseInt(stepy*backgroundSize*height/width);
  532. var starty=-stepx*backgroundSize;
  533. var MixZoom=20;
  534. var MixMark=-1;
  535. var MaxMark=139;
  536. var startMarkX=-width/2+150;
  537. var startMarkY=-height/2+150;
  538. var wallleftX=-500;
  539. var wallleftY=400;
  540. var wallrightX=500;
  541. var wallrightY=-400;
  542. var wallThickness=30;
  543. var partitionThickness=15;
  544. var door=80;
  545. var window=50;
  546. var meter=width/20;
  547. var meterpositionX=100;
  548. var redrawCount=0;
  549. var backgroundcanvasMax=5000;
  550. var Sector_r=70;
  551. var slid_r=10;
  552. var point_r=5;
  553. var sysmbolCircleR=10;
  554. var symbolMinLen=10;
  555. var show3D=false;
  556. var three3D;
  557. var center;
  558. var my3DEngine=null;
  559. var wallId=null;
  560. var Overlay;
  561. var vectors=[];
  562. var layer;
  563. var initMesh=0;
  564. var one2d=false;
  565. var one3d=false;
  566. function init() {
  567. layer=new Layer(width,height);
  568. layer.renderer.drawBackGround();
  569. addWall();
  570. //layer.addSymbol2D.wallIds.push(wallId);
  571. if(!one2d)
  572. {
  573. //initRoom();
  574. one2d=true;
  575. }
  576. initLoad();
  577. }
  578. init();
  579. //var parameter=new Parameter();
  580. layer.menu.addWallMenuItem();
  581. layer.menu.addDoorsMenuItem();
  582. layer.menu.addWindowMenuItem();
  583. layer.menu.addBedroomMenuItem();
  584. layer.menu.addOutsideMenuItem();
  585. layer.menu.addFloorMenuItem();
  586. layer.menu.addWallpaperMenuItem();
  587. layer.menu.addsoftDecorationMenuItem();
  588. //layer.menu.addMenuItemEvents();
  589. layer.menu.addMenuTabsEvent();
  590. layer.menu.editProduct();
  591. window.requestAnimationFrame || (window.requestAnimationFrame = function() {
  592. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(a) {
  593. window.setTimeout(a, 1e3 / 60);
  594. };
  595. }());
  596. window.cancelRequestAnimationFrame || (window.cancelRequestAnimationFrame = function() {
  597. return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout
  598. }());
  599. /*
  600. document.getElementById("toolbarMenu").addEventListener("click",function(e){
  601. if(e.target.parentElement.parentElement.id=="toolbarNew")
  602. {
  603. if(confirm("您确定要重新打开网页?"))
  604. {
  605. //如果是true ,那么就把页面刷新
  606. //location.reload();
  607. for(var vectorId in layer.vectors)
  608. {
  609. layer.deleteVector(vectorId);
  610. layer.data2d.wallIds=[];
  611. }
  612. addWall();
  613. initRoom();
  614. }
  615. }
  616. else if(e.target.parentElement.parentElement.id=="toolbarSave")
  617. {
  618. alert("save");
  619. }
  620. else if(e.target.parentElement.parentElement.id=="toolbarOption")
  621. {
  622. var aw=document.getElementById("aboutWindow");
  623. aw.style.display="block";
  624. //alert("option");
  625. }
  626. else if(e.target.parentElement.parentElement.id=="userOption")
  627. {
  628. alert("user");
  629. }
  630. });
  631. */
  632. document.getElementById("closeproduct").addEventListener("click",layer.menu.closeProduct);
  633. window.onresize = function () {
  634. width=window.outerWidth-260;
  635. height=window.outerHeight;
  636. startMarkX=-width/2+50;
  637. startMarkY=-height/2+50;
  638. layer.size = new CanvasSketch.Size(parseInt(width), parseInt(height));
  639. //layer.renderer.setSize(layer.size);
  640. layer.maxBounds = new CanvasSketch.Bounds(-layer.size.w / 2, -layer.size.h / 2, layer.size.w / 2, layer.size.h / 2);
  641. layer.bounds = new CanvasSketch.Bounds(-layer.size.w / 2, -layer.size.h / 2, layer.size.w / 2, layer.size.h / 2);
  642. //layer.renderer.redraw(0);
  643. //layer.renderer.drawBackGround();
  644. layer.control.refreshCanvas=true;
  645. layer.control.refreshBackgroundCanvas=true;
  646. layer.control.refreshSelectCanvas=true;
  647. layer.renderer.autoRedraw();
  648. };
  649. document.getElementById("aboutWindow").addEventListener("click",function(e){
  650. //console.log("aboutWindow");
  651. if(document.getElementById("aboutWindow").style.display=="block")
  652. {
  653. if(e.target.className=="window-close"||e.target.innerText=="关闭")
  654. {
  655. document.getElementById("aboutWindow").style.display="none";
  656. }
  657. }
  658. });
  659. document.getElementById("subMenuContainer").addEventListener("click",function(e){
  660. if(e.target.parentElement.parentElement.id=="toolbarScreenshot")
  661. {
  662. var saveAsLocalImage=function(canvasid,type) {
  663. var canvas = document.getElementById(canvasid);
  664. // 图片导出为 png 格式
  665. var type = 'png';
  666. var imgData = canvas.toDataURL(type);
  667. // 加工image data,替换mime type
  668. imgData = imgData.replace(_fixType(type),'image/octet-stream');
  669. // 下载后的图片名
  670. var filename = '4dage_' + (new Date()).getTime() + '.' + type;
  671. // download
  672. saveFile(imgData,filename);
  673. };
  674. /**
  675. * 获取mimeType
  676. * @param {String} type the old mime-type
  677. * @return the new mime-type
  678. */
  679. var _fixType=function(type) {
  680. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  681. var r = type.match(/png|jpeg|bmp|gif/)[0];
  682. return 'image/' + r;
  683. };
  684. /**
  685. * 在本地进行文件保存
  686. * @param {String} data 要保存到本地的图片数据
  687. * @param {String} filename 文件名
  688. */
  689. var saveFile=function(data, filename){
  690. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  691. save_link.href = data;
  692. save_link.download = filename;
  693. var event = document.createEvent('MouseEvents');
  694. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  695. save_link.dispatchEvent(event);
  696. };
  697. if(show3D)
  698. {
  699. BABYLON.Tools.CreateScreenshot(my3DEngine.scene3D.engine, my3DEngine.scene3D.camera, {width: my3DEngine.scene3D.canvas.width,height: my3DEngine.scene3D.canvas.height});
  700. }
  701. else
  702. {
  703. saveAsLocalImage("dynamiccanvas2d","png");
  704. }
  705. }
  706. else if(e.target.parentElement.parentElement.id=="fullscreen-btn")
  707. {
  708. var element = document.documentElement;
  709. var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
  710. if (requestMethod)
  711. {
  712. requestMethod.call(element);
  713. }
  714. else if (typeof window.ActiveXObject !== "undefined") {
  715. var wscript = new ActiveXObject("WScript.Shell");
  716. if (wscript !== null) {
  717. wscript.SendKeys("{F11}");
  718. }
  719. }
  720. }
  721. else if(e.target.parentElement.parentElement.id=="transparencyButton")
  722. {
  723. //alert("透明");
  724. if(e.target.src.indexOf("icon-transparency.png")>-1)
  725. {
  726. for(var i=0;i<my3DEngine.roomWallMeshes.length;++i)
  727. {
  728. my3DEngine.roomWallMeshes[i].visibility=0.08;
  729. }
  730. e.target.src=e.target.src.replace("icon-transparency.png","icon-opacity.png");
  731. }
  732. else if(e.target.src.indexOf("icon-opacity.png")>-1)
  733. {
  734. for(var i=0;i<my3DEngine.roomWallMeshes.length;++i)
  735. {
  736. my3DEngine.roomWallMeshes[i].visibility=1;
  737. }
  738. e.target.src=e.target.src.replace("icon-opacity.png","icon-transparency.png");
  739. }
  740. }
  741. else if(e.target.parentElement.parentElement.id=="lock-icon")
  742. {
  743. //alert("锁");
  744. if(e.target.className=="fa fa-unlock")
  745. {
  746. my3DEngine.lock=true;
  747. e.target.className="fa fa-lock";
  748. }
  749. else if(e.target.className=="fa fa-lock")
  750. {
  751. my3DEngine.lock=false;
  752. e.target.className="fa fa-unlock";
  753. }
  754. }
  755. });
  756. // Grid..........................................................
  757. function initLoad()
  758. {
  759. var div=document.getElementById("loaddiv");
  760. var img=document.getElementById("loadimg");
  761. var width=window.innerWidth;
  762. var height=window.innerHeight;
  763. var imgwidth=img.width;
  764. var imgheight=img.height;
  765. var ptwidth =(width -imgwidth ) / 2 + "px";
  766. var ptheight=(height-imgheight) / 2 + "px";
  767. div.style.width=width+"px";
  768. div.style.height=height+"px";
  769. div.width=width;
  770. div.height=height;
  771. img.style.marginLeft= ptwidth;
  772. img.style.marginTop = ptheight;
  773. }
  774. /*
  775. function showAdd(e)
  776. {
  777. var div=document.getElementById(this.id);
  778. if(div!=null)
  779. {
  780. div.children[0].className="selected show";
  781. }
  782. }
  783. */
  784. function showPicture()
  785. {
  786. if(my3DEngine==null)
  787. {
  788. my3DEngine=layer.layer3D;
  789. my3DEngine.initialize();
  790. }
  791. var src=this.id.replace("product","")+".babylon";
  792. layer.menu.closeProduct();
  793. my3DEngine.showPicture(src);
  794. }
  795. function showPhoFrame()
  796. {
  797. if(my3DEngine==null)
  798. {
  799. my3DEngine=layer.layer3D;
  800. my3DEngine.initialize();
  801. }
  802. var src=this.id.replace("product","")+".obj";
  803. layer.menu.closeProduct();
  804. my3DEngine.showPhoFrame(src);
  805. }
  806. function showProduct3D()
  807. {
  808. if(my3DEngine==null)
  809. {
  810. my3DEngine=new Symbol3D();
  811. my3DEngine.initialize();
  812. }
  813. var src;
  814. var src=this.id.replace("product","")+".babylon";
  815. layer.menu.closeProduct();
  816. my3DEngine.showProduct(src);
  817. }
  818. function drawGrid( stepx, stepy) {
  819. layer.renderer.addGrid();
  820. }
  821. /*
  822. function addText(name)
  823. {
  824. //var vectors = [];
  825. var points = [];
  826. var point = new Point(startMarkX+15,startMarkY-20);
  827. points.push(point);
  828. var text = new Vector(new Text(points,name),textStyle);
  829. vectors.push(text);
  830. //layer.addVectors(vectors);
  831. //subVector.push(vectors);
  832. }
  833. */
  834. function addMeter()
  835. {
  836. /*
  837. var points = [];
  838. var point1 = new Point(startMarkX,startMarkY);
  839. points.push(point1);
  840. var point2 = new Point(startMarkX,startMarkY-5);
  841. points.push(point2);
  842. var point3 = new Point(startMarkX+meter,startMarkY-5);
  843. points.push(point3);
  844. var point4 = new Point(startMarkX+meter,startMarkY);
  845. points.push(point4);
  846. var onemeter = new Vector(new Meter(points),meterStyle);
  847. vectors.push(onemeter);
  848. */
  849. layer.renderer.addMeter();
  850. }
  851. function initRoom()
  852. {
  853. var vectors = [];
  854. var points1=[];
  855. var point1=new Point(-100,400);
  856. var point2=new Point(-100,-400);
  857. points1.push(point1);
  858. points1.push(point2);
  859. layer.build.firstLines=layer.build.getEndLines(0,1,wallId);
  860. layer.build.endLines=layer.build.getEndLines(2,3,wallId);
  861. var vector1id=layer.build.addOpenWall(points1,"imgWall");
  862. layer.build.adjustEndPoint(vector1id);
  863. var vector1=layer.vectors[vector1id];
  864. vectors.push(vector1);
  865. layer.data2d.wallIds.push(vector1.id);
  866. var points2=[];
  867. var point21=new Point(500,0);
  868. var point22=new Point(100,0);
  869. var point23=new Point(100,-400);
  870. points2.push(point21);
  871. points2.push(point22);
  872. points2.push(point23);
  873. layer.build.firstLines=layer.build.getEndLines(1,2,wallId);
  874. layer.build.endLines=layer.build.getEndLines(2,3,wallId);
  875. var vector2id=layer.build.addOpenWall(points2,"imgWall");
  876. layer.build.adjustEndPoint(vector2id);
  877. var vector2=layer.vectors[vector2id];
  878. vectors.push(vector2);
  879. layer.data2d.wallIds.push(vector2.id);
  880. var doorpoint31=new Point(-100,40);
  881. var doorpoint32=new Point(-100,120);
  882. var door3=new Vector(new OpenDoor(),openStyle);
  883. door3.geometry.point1=doorpoint31;
  884. door3.geometry.point2=doorpoint32;
  885. door3.geometry.contextIndex=0;
  886. door3.update(layer,vector1.id,0,1,null);
  887. var doorpoint41=new Point(-100,-100);
  888. var doorpoint42=new Point(-100,-20);
  889. var door4=new Vector(new OpenDoor(),openStyle);
  890. door4.geometry.point1=doorpoint41;
  891. door4.geometry.point2=doorpoint42;
  892. door4.geometry.contextIndex=0;
  893. door4.update(layer,vector1.id,0,1,null);
  894. vector1.symbol2dsCount=2;
  895. vector1.symbol2Ds[door3.id]=door3;
  896. vector1.symbol2Ds[door4.id]=door4;
  897. var doorpoint51=new Point(100,-300);
  898. var doorpoint52=new Point(100,-220);
  899. var door5=new Vector(new OpenDoor(),openStyle);
  900. door5.geometry.point1=doorpoint51;
  901. door5.geometry.point2=doorpoint52;
  902. door5.geometry.contextIndex=0;
  903. door5.update(layer,vector2.id,1,2,null);
  904. vector2.symbol2dsCount=1;
  905. vector2.symbol2Ds[door5.id]=door5;
  906. var windowpoint1=new Point(-200,400);
  907. var windowpoint2=new Point(-260,400);
  908. var window1=new Vector(new SingleCasement(),singleStyle);
  909. window1.geometry.point1=windowpoint1;
  910. window1.geometry.point2=windowpoint2;
  911. window1.geometry.contextIndex=0;
  912. window1.update(layer,wallId,0,1,null);
  913. var windowpoint21=new Point(-500,-200);
  914. var windowpoint22=new Point(-500,-300);
  915. var window2=new Vector(new SlidingWindow(),slidingStyle);
  916. window2.geometry.point1=windowpoint21;
  917. window2.geometry.point2=windowpoint22;
  918. window2.geometry.contextIndex=0;
  919. window2.update(layer,wallId,0,3,null);
  920. layer.vectors[wallId].symbol2dsCount=2;
  921. layer.vectors[wallId].symbol2Ds[window1.id]=window1;
  922. layer.vectors[wallId].symbol2Ds[window2.id]=window2;
  923. layer.control.refreshCanvas=true;
  924. }
  925. function addWall()
  926. {
  927. var vectors = [];
  928. var points = [];
  929. var point1=new Point(wallleftX,wallleftY);
  930. points.push(point1);
  931. var point2=new Point(wallrightX,wallleftY);
  932. points.push(point2);
  933. var point3=new Point(wallrightX,wallrightY);
  934. points.push(point3);
  935. var point4=new Point(wallleftX,wallrightY);
  936. points.push(point4);
  937. var wall = new Wall(points, document.getElementById("imgWall"));
  938. var vector=new Vector(wall,wallStyle);
  939. wallId=vector.id;
  940. vectors.push(vector);
  941. layer.addVectors(vectors);
  942. layer.data2d.wallIds.push(wallId);
  943. }
  944. function Show3DBase()
  945. {
  946. if(!show3D)
  947. {
  948. if(my3DEngine==null)
  949. {
  950. my3DEngine=layer.layer3D;
  951. my3DEngine.initialize();
  952. }
  953. //my3DEngine.clearSymbol();
  954. GetWallPoints(layer);
  955. if(!one3d)
  956. {
  957. //initRoom3D();
  958. one3d=true;
  959. }
  960. my3DEngine.scene3D.render();
  961. }
  962. show3D=true;
  963. }
  964. function GetWallPoints(layer)
  965. {
  966. var wallIds=layer.data2d.wallIds;
  967. var calculateLine=layer.calculateLine;
  968. for(var i=0;i<wallIds.length;++i)
  969. {
  970. var id=wallIds[i];
  971. var points=layer.vectors[id].geometry.points;
  972. var syms=[];
  973. for(var key in layer.vectors[id].symbol2Ds)
  974. {
  975. var symbol2d=layer.vectors[id].symbol2Ds[key];
  976. var line=calculateLine.createLine(symbol2d.geometry.point1,symbol2d.geometry.point2);
  977. var sym={};
  978. if(line.a!=0)
  979. {
  980. sym.angle=Math.atan(line.a);
  981. }
  982. else if(line.hasOwnProperty('x'))
  983. {
  984. sym.angle=Math.PI/2;
  985. }
  986. else if(line.hasOwnProperty('y'))
  987. {
  988. sym.angle=0;
  989. }
  990. sym.point={x:(symbol2d.geometry.point1.x+symbol2d.geometry.point2.x)/2,y:(symbol2d.geometry.point1.y+symbol2d.geometry.point2.y)/2};
  991. //sym.type=symbol2d.geoType;
  992. sym.type=symbol2d.geometry.geoType;
  993. sym.len=BABYLON.Vector2.Distance(symbol2d.geometry.point1,symbol2d.geometry.point2);
  994. syms.push(sym);
  995. }
  996. if(i==0)
  997. {
  998. var inout=calculateLine.divisionBuildUseWall(layer.vectors[id].geometry.border1,layer.vectors[id].geometry.border2);
  999. var inline=inout.use;
  1000. var outline=inout.build;
  1001. my3DEngine.decorate3D.drawFloor(layer.vectors[id].geometry.points,id);
  1002. my3DEngine.decorate3D.drawCloseWallSymbols(outline,inline,syms,layer.vectors[id].geometry.wallType,id);
  1003. }
  1004. else
  1005. {
  1006. if(layer.vectors[id].geometry.state==0)
  1007. {
  1008. var inout=calculateLine.divisionBuildUseWall(layer.vectors[id].geometry.border1,layer.vectors[id].geometry.border2);
  1009. var inline=inout.use;
  1010. var outline=inout.build;
  1011. my3DEngine.decorate3D.drawFloor(layer.vectors[id].geometry.points,id);
  1012. if(calculateLine.isClockWise(outline)>0)
  1013. {
  1014. outline.reverse();
  1015. inline.reverse();
  1016. }
  1017. my3DEngine.decorate3D.drawCloseWallSymbols(outline,inline,syms,layer.vectors[id].geometry.wallType,id);
  1018. }
  1019. else
  1020. {
  1021. var clockpoints=[];
  1022. var floorpoints=calculateLine.outinwallside(points,layer.vectors[id].geometry.wallType);
  1023. if(floorpoints.side1.length==2)
  1024. {
  1025. var temp1=[];
  1026. var temp2=[];
  1027. temp1[0]=floorpoints.side1[0];
  1028. temp1[1]=floorpoints.side2[0];
  1029. temp2[0]=floorpoints.side1[1];
  1030. temp2[1]=floorpoints.side2[1];
  1031. floorpoints.side1=temp1;
  1032. floorpoints.side2=temp2;
  1033. clockpoints.push(temp1[0]);
  1034. clockpoints.push(temp1[1]);
  1035. clockpoints.push(temp2[1]);
  1036. clockpoints.push(temp2[0]);
  1037. }
  1038. else
  1039. {
  1040. var line1= calculateLine.createLine(floorpoints.side1[0], floorpoints.side1[1]);
  1041. var line2= calculateLine.createLine(floorpoints.side1[floorpoints.side1.length-2], floorpoints.side1[floorpoints.side1.length-1]);
  1042. for(var n=0;n<floorpoints.side1.length;++n)
  1043. {
  1044. clockpoints.push(floorpoints.side1[n]);
  1045. }
  1046. for(var n=floorpoints.side2.length-1;n>-1;--n)
  1047. {
  1048. clockpoints.push(floorpoints.side2[n]);
  1049. }
  1050. }
  1051. if(calculateLine.isClockWise(clockpoints)>0)
  1052. {
  1053. floorpoints.side1.reverse();
  1054. floorpoints.side2.reverse();
  1055. }
  1056. my3DEngine.decorate3D.drawOpenWallSymbols(floorpoints,syms,layer.vectors[id].geometry.wallType,id);
  1057. }
  1058. }
  1059. }
  1060. }
  1061. function animate()
  1062. {
  1063. requestAnimationFrame( animate );
  1064. render();
  1065. update();
  1066. }
  1067. function update()
  1068. {
  1069. three3D.controls.update();
  1070. three3D.stats.update();
  1071. //controls.update();
  1072. //stats.update();
  1073. }
  1074. function render()
  1075. {
  1076. three3D.renderer.render( three3D.scene, three3D.camera );
  1077. //renderer.render( scene, camera );
  1078. }
  1079. function initRoom3D()
  1080. {
  1081. if(my3DEngine==null)
  1082. {
  1083. my3DEngine=layer.layer3D;
  1084. my3DEngine.initialize();
  1085. }
  1086. my3DEngine.scene3D.engine.displayLoadingUI();
  1087. var rotation=new BABYLON.Vector3(0,0,0);
  1088. var p1=new BABYLON.Vector3(-300,0,-320);
  1089. var table1=my3DEngine.model.showProductfirst("gui.babylon",p1,rotation);
  1090. table1.name="cabinet";
  1091. var p2 =new BABYLON.Vector3(-300,0,-120);
  1092. var table2=my3DEngine.model.showProductfirst("gui.babylon",p2,rotation);
  1093. table2.name="cabinet";
  1094. var p3=new BABYLON.Vector3(-300,0,80);
  1095. var table3=my3DEngine.model.showProductfirst("gui.babylon",p3,rotation);
  1096. table3.name="cabinet";
  1097. var p4=new BABYLON.Vector3(-300,0,280);
  1098. var table4=my3DEngine.model.showProductfirst("gui.babylon",p4,rotation);
  1099. table4.name="cabinet";
  1100. var p5=new BABYLON.Vector3(300,0,200);
  1101. var table5=my3DEngine.model.showProductfirst("gui.babylon",p5,rotation);
  1102. table5.name="cabinet";
  1103. var p6=new BABYLON.Vector3(300,0,100);
  1104. var table6=my3DEngine.model.showProductfirst("gui.babylon",p6,rotation);
  1105. table6.name="cabinet";
  1106. var p7=new BABYLON.Vector3(300,0,300);
  1107. var table7=my3DEngine.model.showProductfirst("gui.babylon",p7,rotation);
  1108. table7.name="cabinet";
  1109. var p8=new BABYLON.Vector3(80,0,100);
  1110. var table8=my3DEngine.model.showProductfirst("gui.babylon",p8,rotation);
  1111. table8.name="cabinet";
  1112. var p9=new BABYLON.Vector3(80,0,260);
  1113. var table9=my3DEngine.model.showProductfirst("gui.babylon",p9,rotation);
  1114. table9.name="cabinet";
  1115. var p10=new BABYLON.Vector3(300,0,-130);
  1116. var table10=my3DEngine.model.showProductfirst("gui.babylon",p10,rotation);
  1117. table10.name="cabinet";
  1118. var p11=new BABYLON.Vector3(300,0,-270);
  1119. var table11=my3DEngine.model.showProductfirst("gui.babylon",p11,rotation);
  1120. table11.name="cabinet";
  1121. var mp1=new BABYLON.Vector3(-300,103,-320);
  1122. var model1=my3DEngine.model.showProductfirst("11.babylon",mp1,rotation);
  1123. var mp2 =new BABYLON.Vector3(-300,103,-120);
  1124. var model2=my3DEngine.model.showProductfirst("12.babylon",mp2,rotation);
  1125. var mp3=new BABYLON.Vector3(-300,103,80);
  1126. var model3=my3DEngine.model.showProductfirst("65.babylon",mp3,rotation);
  1127. var mp4=new BABYLON.Vector3(-300,103,280);
  1128. var model4=my3DEngine.model.showProductfirst("15.babylon",mp4,rotation);
  1129. var mp5=new BABYLON.Vector3(300,103,200);
  1130. var model5=my3DEngine.model.showProductfirst("17.babylon",mp5,rotation);
  1131. var mp6=new BABYLON.Vector3(300,103,100);
  1132. var model6=my3DEngine.model.showProductfirst("64.babylon",mp6,rotation);
  1133. var mp7=new BABYLON.Vector3(300,103,300);
  1134. var model7=my3DEngine.model.showProductfirst("37.babylon",mp7,rotation);
  1135. var mp8=new BABYLON.Vector3(80,103,100);
  1136. var model8=my3DEngine.model.showProductfirst("44.babylon",mp8,rotation);
  1137. var mp9=new BABYLON.Vector3(80,103,260);
  1138. var model9=my3DEngine.model.showProductfirst("45.babylon",mp9,rotation);
  1139. var mp10=new BABYLON.Vector3(300,103,-130);
  1140. var model10=my3DEngine.model.showProductfirst("52.babylon",mp10,rotation);
  1141. var mp11=new BABYLON.Vector3(300,103,-270);
  1142. var model11=my3DEngine.model.showProductfirst("54.babylon",mp11,rotation);
  1143. }
  1144. //16509
  1145. </script>
  1146. </body>
  1147. </html>