eDrawings
Components
Sheets
Layers
Tables
Configuration
Hide/Show
Transparent/Solid
Hide Others
Show All
Remove
Clear
Model viewing failed. Please reload to try again. If the failure persists, please report the information below to customer support.
Server:
Model ID:
Drop your content here
Or

Connection timed-out. Reload the page to continue.

EEmUGSASAkzhCtdF0fhmfNbYvzIxNr3Pp/GEGK3b0VSItaRduqxGvA2tNcKhsSYzfhA2JvZ5UHqpKPMgahGyygatRR36JDUzGPZGDS8MeyMGn7GowacRg8BEOJhjR6Kj0ixoRhWm7B7IkZ2kI2O4tXJEW1PFxPxGQGD3WnMTXTw4MGFjiQgXVrbmJuuD646gfEHxxPIAG1LXnEWPM5Nbyhm+OyQ2HXzytNjOvQtC6nxta0sYUjm/iGj1KLSrzX4jvdhukD+d6U0PHNayHSPJJ9VnauMyN1P2UVcixHubSNajCAOwfJMChGhNpTFOEFKk3lTYf1gpFx0Vl1zrfy9QsOZ+BltmjJ2PuuT183o+Xq9Y6S1ePUMJu/nGy8/14x6fl6a6Nm4XJY65dJ7bCRhFlnlIYiG0COU4MUcqK7VxFZOTjtJOyrYll5eIK2CNgrMmxKJ2RKmxVdjn0CuVOAyY9inBXKmxSysBrhYCqd4zsZWVp8jd2LXn0/wD1neVYfiID67LTeekXlpYGqFpDXndRebEugwtRDgC07qbBrXxtQ8tkpfIlaWFmiR3KPk5W7i5XbH+Yce6XyuUpckcki0vlWhxZQu+9GDR4M9sZ3NpYnUjq1P7RwU5B9Avy2MlMsjqHKqQr052SR+p6oGMstBVyM7XaaVAMeFrSBsE5EWrThvavGVqP6IQiQE4Ru0H0TGIOaL4QMN2/JBl2fJAN2+yAnG0oB3BABlAKArPbugGA3QBY+EEOjAdvKCqaCO1AEbwgkygyQDoCcYLnAIH69H+HOn3I2Qi91UTa9agHhxAAeivGdqfO6aNeF9iDEjYUBJ7PKUGozRnuJQaMLaNFAXYIyQgC9iCRcxBo9nyCYTYxTIcSLRauQBzFkYt52VJtYGudTafpoLnuBr5IkRXPR/FXQ2SGM91/Jp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BF2p5xG+S9IQI6hludvKSmrU26hlB3+8QuUpc/KJrxPRLDtVpMmZw3elidCMsh/pJ4PqkZH3ylg2ph7q5RitLvd7pYNLxHe6rBpu93ujC2kHu90YWm8RyMGnD3e6Bp/Ef7oFqLpHXyhNpNe5CKT3FEJG1UXDOVGIx7mR201/8A1RRK6HTuptawscRY2a+NnsFNkaTqrQ6v6hr/ALRkUWRp9UzusOof3jIl8wfVDd1f1B+8ZEvmC90w6u6g/eMqfzEfdS/a3X/3hIj5ip3THq3qD94yo+Yr6pv2t6g/eMiPmH9U/wC1vUH7xkT+YPql+1vUH7xkR8wfVRPVvUH7xlR8wfVL9reoP3jKj5g+qX7W9QfvGVHzE/VL9rNfr/tGVHzB9Uzuq9eI/wC0JUrzC+6E7qnXj/5jKp+IPukOqdd/eEqfxB90/wC1WvfvCVL4g+6X7Va9+8JE/iJ+qk3qrXrH/wCQlR8RP1Uv2s1794SJ/MOdUv2t6gHGoyo+Y0+qX7XdQj/zKVP5hXqr+mfEDq/EcPw+tZEf0KqSJ+q3ovi18QWsAb1Jljb3VYn6qJ+L3xDDv+8mV908T9U//XD8RK/7yZX3Sw9Tb8YPiLX/AHly/ulZBqJ+MHxEv/vJlfdT8wab/rf+If8A6kyvung0v+t/4h/+pMr7pfMGpD4vfESv+8uX908LUD8YPiJdftJlfdGHpv8Arf8AiH/6kyvul8waX/W/8Q//AFJlfdHzBr//2Q==";return eDwSVGUtil}();var eDwRedlineDivElement=function(){function eDwRedlineDivElement(){this.mDivId=eDwRedlineUtils.uniqueIdGenerator();var div="
";$(eDwRedlineDivElement.parentId).append(div)}eDwRedlineDivElement.prototype.addContent=function(iContent){$("#"+this.mDivId).append(iContent)};eDwRedlineDivElement.prototype.setSize=function(iSize){$("#"+this.mDivId).height(iSize.y);$("#"+this.mDivId).width(iSize.x)};eDwRedlineDivElement.prototype.setPosition=function(iPos){$("#"+this.mDivId).css({top:iPos.y,left:iPos.x})};eDwRedlineDivElement.prototype.getPosition=function(){var w=$("#"+this.mDivId).width();var h=$("#"+this.mDivId).height();return new eDwTypes_15.HC.Point2(w,h)};eDwRedlineDivElement.prototype.setCss=function(iKey,iVal){$("#"+this.mDivId).css(iKey,iVal)};eDwRedlineDivElement.prototype.getSize=function(){var h=$("#"+this.mDivId).height();var w=$("#"+this.mDivId).width();return new eDwTypes_15.HC.Point2(w,h)};eDwRedlineDivElement.prototype.showElement=function(iShow){var target=$("#"+this.mDivId);if(iShow){target.show()}else{target.css("display","none")}};eDwRedlineDivElement.prototype.remove=function(){$("#"+this.mDivId).remove()};eDwRedlineDivElement.parentId="#edrawings-canvas-redline";return eDwRedlineDivElement}();var eDwSVGElementBase=function(){function eDwSVGElementBase(iTag,iAttrs){this.mTag=iTag;this.mAttrs=iAttrs}eDwSVGElementBase.prototype.draw=function(){eDwSVGUtil.drawSVGElment(this.mTag,this.mAttrs)};return eDwSVGElementBase}();var eDwSVGImage=function(_super){__extends(eDwSVGImage,_super);function eDwSVGImage(iImageLink,iPos,iSize){var _this=_super.call(this,"image",{href:iImageLink,x:iPos.x,y:iPos.y,height:iSize.y,width:iSize.x,preserveAspectRatio:"none"})||this;_this.mPos=eDwTypes_15.HC.Point2.zero();_this.mSize=eDwTypes_15.HC.Point2.zero();_this.mPos=iPos.copy();_this.mSize=iSize.copy();return _this}eDwSVGImage.prototype.setPosition=function(iPos){this.mPos=iPos.copy();this.mAttrs["x"]=iPos.x;this.mAttrs["y"]=iPos.y};eDwSVGImage.prototype.setSize=function(iSize){this.mSize=iSize.copy();this.mAttrs["height"]=iSize.y;this.mAttrs["width"]=iSize.x};return eDwSVGImage}(eDwSVGElementBase);var eDwRedlineDivText=function(_super){__extends(eDwRedlineDivText,_super);function eDwRedlineDivText(){var _this=_super.call(this)||this;_this.mTextId="";_this.mTextId=eDwRedlineUtils.uniqueIdGenerator();var inputHtml="";_this.addContent(inputHtml);return _this}eDwRedlineDivText.prototype.getFocus=function(){$("#"+this.mTextId).focus()};eDwRedlineDivText.prototype.getBlur=function(){$("#"+this.mTextId).blur()};eDwRedlineDivText.prototype.setText=function(iText){$("#"+this.mTextId).val(iText)};eDwRedlineDivText.prototype.getText=function(){return $("#"+this.mTextId).val()};return eDwRedlineDivText}(eDwRedlineDivElement);var eDwRedlineItemBase=function(_super){__extends(eDwRedlineItemBase,_super);function eDwRedlineItemBase(iViewer){var _this=_super.call(this)||this;_this.mWPoints=[];_this.mSPoints=[];_this.mTransing=false;_this.mEditing=false;_this.mRegisterId="";_this.mActive=1;_this.mEditHandle=[];_this.mEditIdx=-1;_this.mSelected=false;_this.mStrokeWidthRegular=3;_this.mStrokeWidthHighlight=5;_this.mTransStart=eDwTypes_15.HC.Point3.zero();_this.mColor=eDwTypes_15.HC.Color.red();_this.mViewerHC=iViewer;return _this}eDwRedlineItemBase.prototype.draw=function(){if(!this.mSelected)return;var renderer=this.mViewerHC.getMarkupManager().getRenderer();for(var i=0;i=0;--i){var c=this.mEditHandle[i].getCenter();var r=this.mEditHandle[i].getRadius();var w=this.mEditHandle[i].getStrokeWidth();var dist=eDwTypes_15.HC.Point2.subtract(iPos,c).length();if(dist3&&eDwTypes_15.HC.Point3.subtract(this.mWPoints[0],wpos).length()<.001;if(overlap){this.mWPoints.splice(-1,1);this.mSPoints.splice(-1,1);this.mEditHandle.splice(-1,1)}return overlap||this.mIsClose};eDwRedlineBezier.prototype.onInitialEditStart=function(iPos){_super.prototype.onInitialEditStart.call(this,iPos);this.mInitializing=true};eDwRedlineBezier.prototype.onEditEnd=function(iPos){_super.prototype.onEditEnd.call(this,iPos);this.mInitializing=false};eDwRedlineBezier.prototype.onEditStart=function(iPos){_super.prototype.onEditStart.call(this,iPos);var n=this.mWPoints.length;if(this.mIsClose&&this.mEditIdx==n-1){this.mEditIdx=0}};eDwRedlineBezier.prototype.getClassName=function(){return"eDwRedlineBezier"};eDwRedlineBezier.prototype.forJson=function(){var basic=_super.prototype.forJson.call(this);basic.isclose=this.mIsClose;return basic};eDwRedlineBezier.constructInView=function(iJSONObj,iViewer,iMarkupView){var item=new eDwRedlineBezier(iViewer,eDwTypes_15.HC.Point3.zero());item.setWPoints(iJSONObj.anchors);iMarkupView.addMarkupItem(item);item.initializeId();item.setViewID(iMarkupView.getUniqueId());item.setCamera(iMarkupView.getCamera());item.mIsClose=iJSONObj.isclose;return item};eDwRedlineBezier.prototype.updateGeometry=function(){_super.prototype.updateGeometry.call(this);if(this.mIsClose){var n=this.mSPoints.length;this.mSPoints[n-1].assign(this.mSPoints[0].copy());this.mEditHandle[n-1].setCenter(this.mSPoints[0].copy())}this.mPolyline.clearPoints();var bPoints=this.cBezierPoints(this.mSPoints);for(var i=0;i2;++i){this.mTangents.push({TL:eDwTypes_15.HC.Point2.zero(),TR:eDwTypes_15.HC.Point2.zero()});var vecL=eDwTypes_15.HC.Point2.subtract(iPnt[i-1],iPnt[i]);var vecR=eDwTypes_15.HC.Point2.subtract(iPnt[i+1],iPnt[i]);var origStrength=.4;var lenL=vecL.length()*origStrength;var lenR=vecR.length()*origStrength;eDwRedlineUtils.normalizePoint2(vecL);eDwRedlineUtils.normalizePoint2(vecR);var bisec=eDwTypes_15.HC.Point2.add(vecL,vecR);eDwRedlineUtils.normalizePoint2(bisec);if(0===bisec.x&&0===bisec.y){continue}var vec0=new eDwTypes_15.HC.Point2(-1*bisec.y,bisec.x);var vec1=new eDwTypes_15.HC.Point2(bisec.y,-1*bisec.x);if(vec0.x*vecL.x+vec0.y*vecL.y>0){vec0.scale(lenL);vec1.scale(lenR);this.mTangents[i].TL=vec0;this.mTangents[i].TR=vec1}else{vec0.scale(lenR);vec1.scale(lenL);this.mTangents[i].TR=vec0;this.mTangents[i].TL=vec1}}this.mTangents.push({TL:eDwTypes_15.HC.Point2.zero(),TR:eDwTypes_15.HC.Point2.zero()});if(2==n)return;var pB0=this.pBisectorDir(iPnt[0],iPnt[1]);this.mTangents[0].TR=this.symmetricVec(pB0,this.mTangents[1].TL);var pBn=this.pBisectorDir(iPnt[n-1],iPnt[n-2]);this.mTangents[n-1].TL=this.symmetricVec(pBn,this.mTangents[n-2].TR)};eDwRedlineBezier.prototype.computTangentDirsClose=function(iPnt){this.mTangents=[];var n=iPnt.length-1;for(var i=0;i0){vec0.scale(lenL);vec1.scale(lenR);this.mTangents[i].TL=vec0;this.mTangents[i].TR=vec1}else{vec0.scale(lenR);vec1.scale(lenL);this.mTangents[i].TR=vec0;this.mTangents[i].TL=vec1}}this.mTangents.push(this.mTangents[0])};eDwRedlineBezier.prototype.symmetricVec=function(iAxis,iSource){if(0===iAxis.x&&0===iAxis.y)return iSource.copy();var a=iAxis.copy();eDwRedlineUtils.normalizePoint2(a);var proj=eDwRedlineUtils.dotPoint2(a,iSource);a.scale(2*proj);var output=eDwTypes_15.HC.Point2.subtract(a,iSource);return output};eDwRedlineBezier.prototype.pBisectorDir=function(iPos0,iPos1){var p01=eDwTypes_15.HC.Point2.subtract(iPos1,iPos0);if(0===p01.x&&0===p01.y){return eDwTypes_15.HC.Point2.zero()}eDwRedlineUtils.normalizePoint2(p01);var output=new eDwTypes_15.HC.Point2(p01.y,-1*p01.x);return output};return eDwRedlineBezier}(eDwRedlineItemBase);var eDwRedlineCircle=function(_super){__extends(eDwRedlineCircle,_super);function eDwRedlineCircle(iViewer,iPoint){var _this=_super.call(this,iViewer)||this;_this.mCircle=new eDwTypes_15.HC.Markup.Shape.Circle;_this.mCircle.setFillOpacity(0);_this.addPoint(iPoint);_this.addPoint(iPoint);return _this}eDwRedlineCircle.prototype.draw=function(){this.updateGeometry();var renderer=this.mViewerHC.getMarkupManager().getRenderer();this.mCircle.setStrokeWidth(this.getStrokeWidth());this.mCircle.setStrokeColor(this.getCurColor());renderer.drawCircle(this.mCircle);_super.prototype.draw.call(this)};eDwRedlineCircle.prototype.hit=function(iPos){var r=this.mCircle.getRadius();var center=this.mCircle.getCenter();var w=this.mCircle.getStrokeWidth();var dist=eDwTypes_15.HC.Point2.subtract(iPos,center).length();if(dist>r-w&&dist=xMin&&iPos.y<=yMax&&iPos.y>=yMin)return true;if(-1!==this.hitEditHandle(iPos))return true;return false};eDwRedlineImage.prototype.onSelect=function(){_super.prototype.onSelect.call(this)};eDwRedlineImage.prototype.getClassName=function(){return"eDwRedlineImage"};eDwRedlineImage.prototype.forJson=function(){var basic=_super.prototype.forJson.call(this);return basic};eDwRedlineImage.prototype.setImage=function(iData){this.mImageSVG=new eDwSVGImage(iData,eDwTypes_15.HC.Point2.zero(),eDwTypes_15.HC.Point2.zero())};eDwRedlineImage.constructInView=function(iJSONObj,iViewer,iMarkupView){var item=new eDwRedlineImage(iViewer,eDwTypes_15.HC.Point3.zero());item.setWPoints(iJSONObj.anchors);iMarkupView.addMarkupItem(item);item.initializeId();item.setViewID(iMarkupView.getUniqueId());item.setCamera(iMarkupView.getCamera());return item};eDwRedlineImage.prototype.updateGeometry=function(){_super.prototype.updateGeometry.call(this);var p0=this.mSPoints[0];var p1=this.mSPoints[1];var diff=eDwTypes_15.HC.Point2.subtract(p0,p1);var pos=new eDwTypes_15.HC.Point2(Math.min(p0.x,p1.x),Math.min(p0.y,p1.y));var sides=new eDwTypes_15.HC.Point2(Math.abs(diff.x),Math.abs(diff.y));this.mRectangle.setPosition(pos);this.mRectangle.setSize(sides);this.mImageSVG.setPosition(pos);this.mImageSVG.setSize(sides)};eDwRedlineImage.prototype.deActivate=function(){_super.prototype.deActivate.call(this)};return eDwRedlineImage}(eDwRedlineItemBase);var eDwRedlineTextBox=function(_super){__extends(eDwRedlineTextBox,_super);function eDwRedlineTextBox(iViewer,iPoint){var _this=_super.call(this,iViewer)||this;_this.mBox=new eDwTypes_15.HC.Markup.Shape.Rectangle;_this.mTextHtml=new eDwRedlineDivText;_this.mLeader=new eDwTypes_15.HC.Markup.Shape.Line;_this.addPoint(iPoint);_this.addPoint(iPoint);return _this}eDwRedlineTextBox.prototype.draw=function(){this.updateGeometry();var renderer=this.mViewerHC.getMarkupManager().getRenderer();this.mBox.setStrokeWidth(this.getStrokeWidth());this.mBox.setStrokeColor(this.getCurColor());this.mLeader.setStrokeWidth(1);renderer.drawRectangle(this.mBox);renderer.drawLine(this.mLeader);_super.prototype.draw.call(this)};eDwRedlineTextBox.prototype.setText=function(str){this.mTextHtml.setText(str)};eDwRedlineTextBox.prototype.getText=function(){return this.mTextHtml.getText()};eDwRedlineTextBox.prototype.hit=function(iPos){var renderer=this.mViewerHC.getMarkupManager().getRenderer();var boxPos=this.mBox.getPosition();var boxSize=this.mBox.getSize();var xMin=boxPos.x;var xMax=boxPos.x+boxSize.x;var yMin=boxPos.y;var yMax=boxPos.y+boxSize.y;var A=new eDwTypes_15.HC.Point2(xMin,yMin);var B=new eDwTypes_15.HC.Point2(xMin,yMax);var C=new eDwTypes_15.HC.Point2(xMax,yMax);var D=new eDwTypes_15.HC.Point2(xMax,yMin);var w=this.mBox.getStrokeWidth();var output=false;output=output||eDwTypes_15.HCI.pointOnLineSegment2d(iPos,A,B,w);output=output||eDwTypes_15.HCI.pointOnLineSegment2d(iPos,B,C,w);output=output||eDwTypes_15.HCI.pointOnLineSegment2d(iPos,C,D,w);output=output||eDwTypes_15.HCI.pointOnLineSegment2d(iPos,D,A,w);var hitText=iPos.xxMin&&iPos.yyMin;if(hitText){this.mTextHtml.getFocus()}output=output||hitText;if(output)return true;if(-1!==this.hitEditHandle(iPos))return true;return false};eDwRedlineTextBox.prototype.getClassName=function(){return"eDwRedlineTextBox"};eDwRedlineTextBox.prototype.onDeselect=function(){_super.prototype.onDeselect.call(this);this.mTextHtml.getBlur()};eDwRedlineTextBox.prototype.activateWithId=function(id){_super.prototype.activateWithId.call(this,id);this.mTextHtml.showElement(true)};eDwRedlineTextBox.prototype.deActivate=function(){_super.prototype.deActivate.call(this);this.mTextHtml.showElement(false)};eDwRedlineTextBox.prototype.forJson=function(){var basic=_super.prototype.forJson.call(this);basic.textContent=this.getText();return basic};eDwRedlineTextBox.constructInView=function(iJSONObj,iViewer,iMarkupView){var item=new eDwRedlineTextBox(iViewer,eDwTypes_15.HC.Point3.zero());item.setWPoints(iJSONObj.anchors);iMarkupView.addMarkupItem(item);item.initializeId();item.setViewID(iMarkupView.getUniqueId());item.setCamera(iMarkupView.getCamera());item.setText(iJSONObj.textContent);return item};eDwRedlineTextBox.prototype.updateGeometry=function(){_super.prototype.updateGeometry.call(this);var p0=this.mSPoints[0];var p1=this.mSPoints[1];var diff=eDwTypes_15.HC.Point2.subtract(p0,p1);this.mLeader.setP1(p0.copy());this.mLeader.setP2(p1.copy());this.mBox.setPosition(p1.copy());this.mTextHtml.setPosition(p1.copy());var size=this.mTextHtml.getSize();this.mBox.setSize(size)};return eDwRedlineTextBox}(eDwRedlineItemBase);var eDwRedlineOperator=function(_super){__extends(eDwRedlineOperator,_super);function eDwRedlineOperator(iViewer){var _this=_super.call(this,iViewer.HCViewer)||this;_this.mPoints=[];_this.mLeaglePointNum=2;_this.mViewer=iViewer;_this.mViewerHC=_this.mViewer.HCViewer;_this.mModel=_this.mViewer.HCViewer.getModel();_this.mMarkupMode=eDwTypes_15.MarkupMode.None;return _this}eDwRedlineOperator.prototype.onMouseMove=function(iEvent){var markupMgr=this.mViewerHC.getMarkupManager();if(!this.mCurMarkup)return;var pos=iEvent.getPosition();var wpos=eDwBaseOperator.screenToWorld(iEvent.getPosition(),this.mViewerHC.getView());if(this.mCurMarkup.isTransing()){this.mCurMarkup.onTransMove(pos)}if(this.mCurMarkup.isEditing()){this.mCurMarkup.onEditMove(pos)}markupMgr.refreshMarkup()};eDwRedlineOperator.prototype.onMouseDown=function(iEvent){var pos=iEvent.getPosition();var view=this.mViewerHC.getView();var camera=this.mViewerHC.getView().getCamera();var wpos=camera.getCameraPlaneIntersectionPoint(pos,view);var markupMgr=this.mViewerHC.getMarkupManager();if(this.mCurMarkup){if(this.mCurMarkup.finialize(iEvent.getPosition())){this.mCurMarkup.onEditEnd(iEvent.getPosition());this.mCurMarkup=null;this.mViewerHC.getMarkupManager().refreshMarkup()}else{this.mCurMarkup.addPoint(wpos)}return}var pickItem=markupMgr.pickMarkupItem(iEvent.getPosition());this.mCurMarkup=pickItem;markupMgr.selectMarkup(this.mCurMarkup);var activeView=markupMgr.getActiveMarkupView();if(activeView&&this.mCurMarkup&&activeView.getUniqueId()!=this.mCurMarkup.getViewID()){this.mCurMarkup=null;markupMgr.selectMarkup(null)}if(!this.mCurMarkup){this.createItem(pos)}else{this.mCurMarkup.onSelect();this.mViewerHC.getMarkupManager().refreshMarkup();this.mCurMarkup.onTransOrEditStart(pos)}this.onItemSelected()};eDwRedlineOperator.prototype.onMouseUp=function(iEvent){if(this.mCurMarkup&&this.mCurMarkup.isTransing()){this.mCurMarkup.onTransEnd(iEvent.getPosition());this.mCurMarkup=null}};eDwRedlineOperator.prototype.onItemSelected=function(){};eDwRedlineOperator.prototype.setCurAnnotation=function(iStr){var selected=this.mViewerHC.getMarkupManager().getSelectedMarkup();if(selected&&selected instanceof eDwRedlineTextBox){selected.setText(iStr);this.mViewerHC.getMarkupManager().refreshMarkup()}};eDwRedlineOperator.prototype.getCurAnnotation=function(){if(this.mCurMarkup&&this.mCurMarkup instanceof eDwRedlineTextBox){return this.mCurMarkup.getText()}return""};eDwRedlineOperator.prototype.getClassName=function(){return"eDwMarkupRedlineOperator"};eDwRedlineOperator.prototype.setMarkupMode=function(iMode){this.mMarkupMode=iMode};eDwRedlineOperator.prototype.getMarkupMode=function(){return this.mMarkupMode};eDwRedlineOperator.activateMarkups=function(iMkView,iViewer){var markupMgr=iViewer.getMarkupManager();var markups=iMkView.getMarkup();for(var i=0;i1e3){this.onUp(ioTouchEvent.getPosition(),eDwTypes_16.HC.Button.Right)}else{this.onUp(ioTouchEvent.getPosition(),eDwTypes_16.HC.Button.Left)}ioTouchEvent.setHandled(true)}else{ioTouchEvent.setHandled(false)}}_super.prototype.onTouchEnd.call(this,ioTouchEvent)};eDwSelectionOperator.prototype.doPick=function(iCoords){var viewerFeatureOpts=this.mViewer.ViewerFeatureOpts;if(this.mViewer.getModel().isDrawing()){this.doPickInDrawing(iCoords)}else{this.doPickIn3D(iCoords)}};eDwSelectionOperator.prototype.updateCallout=function(iNodeHCID){var name="";if(iNodeHCID>0&&iNodeHCID===this.mPickedHCID){var model=this.mViewer.getModel();var hierNode=model.getHierarchyNode(iNodeHCID);name=hierNode&&hierNode.Name?hierNode.Name:"Unamed model"}if(this.mCurMouse){name=""}this.mNameCallout.setText(name);var offset=new eDwTypes_16.HC.Point2(10,20);var pos=this.mCurMousePos.copy();this.mNameCallout.setPosition(eDwTypes_16.HC.Point2.add(pos,offset));this.mViewer.HCViewer.getMarkupManager().refreshMarkup()};eDwSelectionOperator.prototype.updatePos=function(pos){return __awaiter(this,void 0,void 0,function(){var viewerHC,markupMgrHC,config,sectionMgrHC,selItem,op;return __generator(this,function(_a){switch(_a.label){case 0:this.mCurMousePos=pos.copy();viewerHC=this.mViewer.HCViewer;markupMgrHC=viewerHC.getMarkupManager();config=new eDwTypes_16.HC.PickConfig(eDwTypes_16.HC.SelectionMask.Face);sectionMgrHC=this.mViewer.XSectionMgr.HCXSectionMgr;return[4,viewerHC.getView().pickFromPoint(pos,config)];case 1:selItem=_a.sent();this.mPickedHCID=selItem?selItem.getNodeId():cUnselectableItem;op=this;setTimeout(function(){op.updateCallout(op.mPickedHCID)},1e3);return[2]}})})};eDwSelectionOperator.prototype.doPickIn3D=function(iCoords){if(!eDwKeyMgr.get().isDown("Control")){this.mViewer.SelectionMgr.select(iCoords)}else{this.mViewer.SelectionMgr.select(iCoords,undefined,eDwTypes_16.HC.SelectionMode.Add)}};eDwSelectionOperator.prototype.doPickInDrawing=function(iCoords){return __awaiter(this,void 0,void 0,function(){var viewerHC,model,modelHC,pickConfig,activeSheet,childHierarchy,children,viewIDs,i,currentNode,selItem,hierNode;return __generator(this,function(_a){switch(_a.label){case 0:viewerHC=this.mViewer.HCViewer;model=this.mViewer.getModel();modelHC=model.getHCModel();pickConfig=new eDwTypes_16.HC.PickConfig(eDwTypes_16.HC.SelectionMask.All);activeSheet=model.getActiveModelView();childHierarchy=activeSheet.Hierarchy.getChildren();children=Object.keys(childHierarchy);viewIDs=[];for(i=0;i-1){this.mViewer.SelectionMgr.selectByID(hierNode.HOOPSID)}}return[2]}})})};eDwSelectionOperator.prototype.clearPickTimeOut=function(){if(this.mDoPickTimeOutHandle){clearTimeout(this.mDoPickTimeOutHandle);this.mDoPickTimeOutHandle=null}};eDwSelectionOperator.prototype.onUp=function(iCoord,iButton){var _this=this;var eventMgr=eDwEventMgr.get();if(iButton===eDwTypes_16.HC.Button.Left){this.doPick(iCoord);if(!this.mDoPickTimeOutHandle){this.mDoPickTimeOutHandle=setTimeout(function(){_this.clearPickTimeOut();eventMgr.fireEvents("LeftClick",_this.mViewer,iCoord)},500)}else{this.clearPickTimeOut();eventMgr.fireEvents("LeftDoubleClick",this.mViewer,iCoord)}return true}else if(iButton===eDwTypes_16.HC.Button.Right){this.clearPickTimeOut();this.doPick(iCoord);eventMgr.fireEvents("RightClick",this.mViewer,iCoord);return true}return false};eDwSelectionOperator.prototype.onDown=function(iCoord,iButton){var handled=false;var isDrawing=this.mViewer.getModel().isDrawing();if(!isDrawing||isDrawing&&iButton==eDwTypes_16.HC.Button.Right){this.mDragPt=eDwBaseOperator.screenToWorld(iCoord,this.mViewer.getHCView())}else{handled=true}return handled};eDwSelectionOperator.prototype.onMove=function(iCoord){return!this.mCurMouse};return eDwSelectionOperator}(eDwBaseSelOperator);function isLeft(iP0,iP1,iP2){return(iP1.x-iP0.x)*(iP2.y-iP0.y)-(iP2.x-iP0.x)*(iP1.y-iP0.y)}return eDwSelectionOperator});define("eDwSelIsolateCmd",["require","exports","eDwTypes","eDwSupportsHistoryCmd","eDrawingsBase"],function(require,exports,eDwTypes_17,eDwSupportsHistoryCmd){"use strict";var eDwSelIsolateCmd=function(_super){__extends(eDwSelIsolateCmd,_super);function eDwSelIsolateCmd(iViewer){return _super.call(this,iViewer)||this}eDwSelIsolateCmd.prototype.undo=function(){if(!_super.prototype.undo.call(this))return false;this.setHierarchyNodeIDsAttribs(this.mInitialNodeIDsAttribs);this.mViewer.ViewMgr.setCamera(this.mInitialViewCamera);return true};eDwSelIsolateCmd.prototype.redo=function(){if(!_super.prototype.redo.call(this))return false;this.setHierarchyNodeIDsAttribs(this.mFinalNodeIDsAttribs);this.mViewer.ViewMgr.setCamera(this.mFinalViewCamera);return true};eDwSelIsolateCmd.prototype.commit=function(){var _this=this;_super.prototype.commit.call(this);this.mInitialNodeIDsAttribs=this.getHierarchyNodesAttribs();var viewHC=this.mViewer.getHCView();this.mInitialViewCamera=viewHC.getCamera().copy();(function(){return __awaiter(_this,void 0,void 0,function(){var selMgr,selHierNodes,model,modelView,hierNodes,invisHierNodes,selHCIDs,modelHC,bbox;return __generator(this,function(_a){switch(_a.label){case 0:selMgr=this.mViewer.SelectionMgr;selHierNodes=selMgr.getSelHierarchyNodes();model=this.mViewer.getModel();modelView=model.getActiveModelView();hierNodes=modelView.getNodes();hierNodes.shift();invisHierNodes=hierNodes.filter(function(hierNode){return selHierNodes.indexOf(hierNode)===-1});return[4,model.setAttribOnHierNodes(invisHierNodes,{Visible:false})];case 1:_a.sent();selHCIDs=selMgr.getSelectableHCIDs();modelHC=this.mViewer.getModel().getHCModel();return[4,modelHC.getNodesBounding(selHCIDs)];case 2:bbox=_a.sent();if(!(bbox&&eDwTypes_17.HC.Point3.distance(bbox.max,bbox.min)>.001))return[3,4];return[4,this.mViewer.getHCView().isolateNodes(selHCIDs)];case 3:_a.sent();_a.label=4;case 4:this.mFinalNodeIDsAttribs=this.getHierarchyNodesAttribs();this.mFinalViewCamera=viewHC.getCamera().copy();return[2]}})})})()};eDwSelIsolateCmd.prototype.isCommitted=function(){return _super.prototype.isCommitted.call(this)&&!!this.mInitialViewCamera&&!!this.mFinalNodeIDsAttribs};Object.defineProperty(eDwSelIsolateCmd.prototype,"Aggregable",{get:function(){return true},enumerable:true,configurable:true});return eDwSelIsolateCmd}(eDwSupportsHistoryCmd);return eDwSelIsolateCmd});define("eDwSelMgr",["require","exports","eDwSelectionOperator","eDwEventMgr","eDwKeyMgr","eDrawingsBase"],function(require,exports,eDwSelectionOperator,eDwEventMgr,eDwKeyMgr){"use strict";var eDwSelMgr=function(){function eDwSelMgr(iViewer){iViewer.SelectionMgr=this;this.mViewer=iViewer;this.mHCSelMgr=iViewer.HCViewer.getSelectionManager();this.mSelectableHCObjs=[];var selectOp=new eDwSelectionOperator(iViewer,this);var opMgr=this.mViewer.OperatorMgr;this.mSelectOperatorID=opMgr.registerCustomOperator(selectOp,true);this.mSelectOverlayNotifiers={}}eDwSelMgr.prototype.setColorForViewMode=function(mode){var nodeSelColor;var nodeSelOutlineColor=new Communicator.Color(0,255,0);var nodeElmtSelColor;var nodeElmtSelOutlineColor=new Communicator.Color(255,255,0);var beautifulGreen=new Communicator.Color(4,200,5);switch(mode){case Communicator.DrawMode.WireframeOnShaded:nodeSelColor=beautifulGreen;nodeElmtSelColor=beautifulGreen;break;case Communicator.DrawMode.Shaded:nodeSelColor=beautifulGreen;nodeElmtSelColor=beautifulGreen;break;case Communicator.DrawMode.Wireframe:case Communicator.DrawMode.HiddenLine:nodeSelColor=Communicator.Color.white();nodeElmtSelColor=Communicator.Color.white();break;default:var msg="Unknown draw mode: "+mode;console.debugLog("Selection",msg);throw new Error(msg)}this.mHCSelMgr.setNodeSelectionColor(nodeSelColor);this.mHCSelMgr.setNodeSelectionOutlineColor(nodeSelOutlineColor);this.mHCSelMgr.setNodeElementSelectionColor(nodeElmtSelColor);this.mHCSelMgr.setNodeElementSelectionOutlineColor(nodeElmtSelOutlineColor);if(this.mViewer.getModel().isDrawing()&&!this.mViewer.ViewerFeatureOpts.Debug){this.mHCSelMgr.setNodeSelectionHighlightMode(Communicator.SelectionHighlightMode.OutlineOnly);this.mHCSelMgr.setHighlightNodeSelection(false)}};eDwSelMgr.prototype.unregister=function(){this.mViewer.OperatorMgr.unregisterCustomOperatorByID(this.mSelectOperatorID);this.mViewer.SelectionMgr=null};eDwSelMgr.prototype.addSelectOverlayNotifier=function(iTypeIndex,iNotifier){if(!this.mSelectOverlayNotifiers[iTypeIndex]){this.mSelectOverlayNotifiers[iTypeIndex]=[]}this.mSelectOverlayNotifiers[iTypeIndex].push(iNotifier)};eDwSelMgr.prototype.onSelection=function(iPartSelectionEvent){var ctrlKeyDown=eDwKeyMgr.get().isDown("Control");var existingIdx=-1;var selObj=this.getHCSelectionObj(iPartSelectionEvent.getSelection());if(selObj){var idx=0;for(var _i=0,_a=this.mSelectableHCObjs;_i<_a.length;_i++){var existingSelObj=_a[_i];if(selObj===existingSelObj||selObj.equals(existingSelObj)){existingIdx=idx;break}idx++}}var isDrawing=this.mViewer.getModel().isDrawing();if(this.mSelectableHCObjs.length>0&&!ctrlKeyDown){this.unSelectObjs(this.mSelectableHCObjs,isDrawing);this.mSelectableHCObjs=[]}else if(ctrlKeyDown&&existingIdx>-1&&selObj){this.mSelectableHCObjs.splice(existingIdx,1);this.unSelectObjs([selObj],isDrawing);return}if(selObj){var modelView=this.mViewer.getModel().getActiveModelView();var node=modelView.Nodes[selObj.getNodeId()];if(node&&isDrawing){this.mHCSelMgr.remove(selObj);node.selectBoundingBox(this.mViewer)}this.mSelectableHCObjs.push(selObj);eDwEventMgr.get().fireEvents("Select",this.mViewer,selObj)}};eDwSelMgr.prototype.selectByID=function(iID){var ret=true;try{if(!eDwKeyMgr.get().isDown("Control")){this.mHCSelMgr.selectNode(iID)}else{this.mHCSelMgr.selectNode(iID,Communicator.SelectionMode.Add)}}catch(iErr){console.log("eDwSelMgr.selectByID failed");ret=false}return ret};eDwSelMgr.prototype.select=function(iCoords,iPickConfig,iSelMode){var _this=this;if(iSelMode===void 0){iSelMode=Communicator.SelectionMode.Set}var pickCfg=iPickConfig?iPickConfig:new Communicator.PickConfig(Communicator.SelectionMask.Face);var viewHC=this.mViewer.getHCView();(function(){return __awaiter(_this,void 0,void 0,function(){var selItem;return __generator(this,function(_a){switch(_a.label){case 0:return[4,viewHC.pickFromPoint(iCoords,pickCfg)];case 1:selItem=_a.sent();if(this.isSelectionHandled(selItem)){return[2]}if(iSelMode===Communicator.SelectionMode.Set){this.mHCSelMgr.set(selItem)}else if(iSelMode===Communicator.SelectionMode.Add){this.mHCSelMgr.add(selItem)}return[2]}})})})()};eDwSelMgr.prototype.isSelected=function(iHCNodeID){return this.getSelectableHCIDs().indexOf(iHCNodeID)<0?false:true};eDwSelMgr.prototype.append=function(iSelObj){this.mHCSelMgr.add(iSelObj)};eDwSelMgr.prototype.unSelectAllObjects=function(){if(this.mSelectableHCObjs.length>0){var viewer=this.mViewer;var selMgr=this;for(var _i=0,_a=this.mSelectableHCObjs;_i<_a.length;_i++){var selObj=_a[_i];eDwEventMgr.get().fireEvents("Unselect",viewer,selMgr.getHCSelectionObj(selObj))}this.mHCSelMgr.selectNode(null);this.mSelectableHCObjs=[]}};eDwSelMgr.prototype.setViewToSelectedFace=function(){var camera=null;var selObjs=this.mHCSelMgr.getResults();for(var _i=0,selObjs_1=selObjs;_i0){return selHCIDs[selHCIDs.length-1]}return new RangeError("nothing selected")};eDwSelMgr.prototype.getSelHierarchyNodes=function(){var selHierNodes=[];var modelView=this.mViewer.getModel().getActiveModelView();var selHCIDs=this.getSelectableHCIDs();for(var _i=0,selHCIDs_1=selHCIDs;_i0){this.mFiveArea=this.mFiveArea/(curLevel/2+1)}};eDwTouchExplodeOperator.prototype.onTouchMove=function(ioTouchEvent){_super.prototype.onTouchMove.call(this,ioTouchEvent);var area=this.getTouchArea();if(this.mFiveArea>0){var curLevel=this.mViewer.getExplosionLevel();var ratio=area/this.mFiveArea;var nxtLevel=2*(ratio-1);nxtLevel=Math.min(nxtLevel,10);nxtLevel=Math.max(nxtLevel,0);this.mExplodeCmd.setLevel(nxtLevel)}};eDwTouchExplodeOperator.prototype.onTouchEnd=function(ioTouchEvent){eDwCommandMgr.get().remove(this.mExplodeCmd,"commit");this.mExplodeCmd=null;this.mFiveArea=0;_super.prototype.onTouchEnd.call(this,ioTouchEvent)};eDwTouchExplodeOperator.prototype.getTouchArea=function(){var coords=[];for(var i=0;ioutput)output=temp}}}return output};eDwTouchExplodeOperator.prototype.circleArea=function(p0,p1,p2){var center=eDwTypes_19.HC.Point2.add(p0,eDwTypes_19.HC.Point2.add(p1,p2));center.scale(1/3);var r=eDwTypes_19.HC.Point2.subtract(p0,center).length();return r*r};return eDwTouchExplodeOperator}(eDwBaseOperator);function isLeft(iP0,iP1,iP2){return(iP1.x-iP0.x)*(iP2.y-iP0.y)-(iP2.x-iP0.x)*(iP1.y-iP0.y)}var eDwTouchUtils=function(_super){__extends(eDwTouchUtils,_super);function eDwTouchUtils(iVewer){var _this=_super.call(this)||this;_this.mViewer=iVewer;_this.mViewerHC=iVewer.HCViewer;return _this}eDwTouchUtils.prototype.draw=function(){var renderer=this.mViewerHC.getMarkupManager().getRenderer();renderer.drawPolygon(this.mTouchPolygon);renderer.drawPolygon(this.mConvex);for(var _i=0,_a=this.mTouchPoss;_i<_a.length;_i++){var c=_a[_i];renderer.drawCircle(c)}};eDwTouchUtils.prototype.getTouchArea=function(iPoss){this.mTouchPoss=[];this.mTouchPolygon=new eDwTypes_19.HC.Markup.Shape.Polygon;this.mTouchPolygon.setFillOpacity(0);this.mTouchPolygon.setStrokeColor(eDwTypes_19.HC.Color.blue());this.mTouchPolygon.setStrokeWidth(2);for(var _i=0,iPoss_1=iPoss;_i=0;i--){if(iPoss[i].x!=xmax)break}maxmin=i+1;h[++top]=iPoss[minmin];i=minmax;while(++i<=maxmin){if(isLeft(iPoss[minmin],iPoss[maxmin],iPoss[i])>=0&&i0){if(isLeft(h[top-1],h[top],iPoss[i])>0){break}else{top--}}h[++top]=iPoss[i]}if(maxmax!=maxmin){h[++top]=iPoss[maxmax]}bot=top;i=maxmin;while(--i>=minmax){if(isLeft(iPoss[maxmax],iPoss[minmax],iPoss[i])>=0&&i>minmax){continue}while(top>bot){if(isLeft(h[top-1],h[top],iPoss[i])>0){break}else{top--}}if(iPoss[i].x==h[0].x&&iPoss[i].y==h[0].y){return h}h[++top]=iPoss[i]}if(minmax!=minmin){h[++top]=iPoss[minmin]}return h};eDwTouchUtils.convexArea=function(iPoss){if(iPoss.length<4)return 0;var n=iPoss.length;var area=0;for(var i=1;i1){var configTabBar=$("#edrawings-config-bar");var configTabList=$("#edrawings-config-tab-list");var configNavButton=$("#edrawings-button-sheets");if(configTabList[0].scrollWidth>configTabBar.width()){eDwUIUtils.hide("#edrawings-button-sheets",true);configTabList.removeClass("fullwidth");configTabList.addClass("compressed")}else{eDwUIUtils.hide("#edrawings-button-sheets",true);configTabList.removeClass("compressed");configTabList.addClass("fullwidth")}}};eDwUI.prototype.hideAllPanels=function(){this.hideActiveHUDMenu();this.hideActiveSubmenu();this.mUIEventHandlers.hideContextMenu()};eDwUI.changeStyle=function(iStyleClassName){var eDwViewerJQ=$("#"+l_ViewerID);if(eDwViewerJQ){eDwViewerJQ.removeClass("edrawings-viewer-regular");eDwViewerJQ.removeClass("edrawings-viewer-ondrop");eDwViewerJQ.removeClass("edrawings-viewer-dropsuccess");eDwViewerJQ.removeClass("edrawings-viewer-dropfail");eDwViewerJQ.removeClass("edrawings-viewer-timeout");if(iStyleClassName)eDwViewerJQ.addClass(iStyleClassName)}var eDwDropDiv=$("#edrawings-drop-block");if(eDwDropDiv&&(iStyleClassName==="edrawings-viewer-ondrop"||iStyleClassName==="edrawings-viewer-regular")){eDwDropDiv.removeClass("edrawings-viewer-regular");eDwDropDiv.removeClass("edrawings-viewer-ondrop");eDwDropDiv.addClass(iStyleClassName)}};eDwUI.prototype.registerHTMLEvents=function(){var _this=this;this.mUIEventHandlers.addHTMLEventHandlers(this.mViewerFeatureOpts);this.mResizeProxy=function(iEvent){_this.mUIEventHandlers.onResize(iEvent,_this.mViewer)};window.addEventListener("resize",this.mResizeProxy,true);this.mBeforeUnloadProxy=function(iEvent){_this.unregister()};window.addEventListener("beforeunload",this.mBeforeUnloadProxy,true);this.mTimeoutProxy=function(iEvent){_this.unregister()};window.addEventListener("Timeout",this.mTimeoutProxy,true);this.mAddViewerEventsHandler=function(iEvent,iViewer){eDwUIBaseEventHandlers.addViewerEventHandlers(_this.mUIEventHandlers)};$("#"+l_ViewerID).on("edw:AddViewerEvents",this.mAddViewerEventsHandler);var self=this;if(this.mViewerFeatureOpts.Move){$("#edrawings-button-move").on("click.edw",function(){var moveBtn=$("#edrawings-button-move");var isMoveActive=moveBtn.hasClass("active-button");_this.hideAllPanels();if(!isMoveActive){_this.setActiveSubmenu("edrawings-button-move","")}});this.mItemActiveCallbacks["edrawings-button-move"]=function(){activateMoveMode_1(true)};this.mItemDeactiveCallbacks["edrawings-button-move"]=function(){activateMoveMode_1(false)};var activateMoveMode_1=function(iActivate){var moveBtn=$("#edrawings-button-move");if(iActivate){moveBtn.addClass("active-button");self.mViewer.CompXformMgr.activateMoveOp();$("#edrawings-canvas")[0].style.cursor="pointer"}else{moveBtn.removeClass("active-button");moveBtn.removeClass("active-button-bottom-cover");self.mViewer.CompXformMgr.deactivateMoveOp();$("#edrawings-canvas")[0].style.cursor="default"}}}if(this.mViewerFeatureOpts.Section){$("#edrawings-button-section").on("click.edw",function(){if(!_this.mViewer.getModel().isDrawing()){_this.setActiveSubmenu("edrawings-button-section","edrawings-section-menu")}});this.registerButtonForClickEffect("edrawings-section-flip-button",function(){var sectionFlipCmd=new eDwSectionFlipCmd(_this.mViewer);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(sectionFlipCmd);cmdMgr.remove(sectionFlipCmd,"commit")});this.registerButtonForClickEffect("edrawings-section-normal-button",function(){var setViewNormalToSectionCmd=new eDwSetViewNormalToSectionCmd(_this.mViewer);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(setViewNormalToSectionCmd);cmdMgr.remove(setViewNormalToSectionCmd,"commit")});$("#edrawings-section-xz-button").on("click.edw",function(){_this.setXSectionOrientation(eDwTypes_21.SectionPlaneOrientation.ZX)});$("#edrawings-section-yz-button").on("click.edw",function(){_this.setXSectionOrientation(eDwTypes_21.SectionPlaneOrientation.YZ)});$("#edrawings-section-xy-button").on("click.edw",function(){_this.setXSectionOrientation(eDwTypes_21.SectionPlaneOrientation.XY)});$("#edrawings-section-capping-button").on("click.edw",function(){var button=$("#edrawings-section-capping-button");var visibility=!button.hasClass("active-button");_this.showSectionCaps(visibility)});this.mSubmenuShownCallbacks["edrawings-section-menu"]=function(){_this.mCompositeXSectionCmd=new eDwCompositeCmd(_this.mViewer);eDwCommandMgr.get().add(_this.mCompositeXSectionCmd);_this.mCompositeXSectionCmd.initCmdActionImplementation({compositeInit:function(ioCmd){},compositeUndo:function(ioCmd){return true},compositeRedo:function(ioCmd){return true},compositeCommit:function(ioCmd){ioCmd.clearSubCmds()},compositeCancel:function(ioCmd){ioCmd.clearSubCmds()}});_this.mViewer.XSectionMgr.turnOnSectionPlane(true);_this.setXSectionOrientation();_this.mViewer.XSectionMgr.activateCurrent()};this.mSubmenuHiddenCallbacks["edrawings-section-menu"]=function(){_this.mViewer.XSectionMgr.deactivateCurrent();_this.mViewer.XSectionMgr.turnOnSectionPlane(false);var cmdMgr=eDwCommandMgr.get();cmdMgr.remove(_this.mCompositeXSectionCmd,"cancel");var explodeHandle=$("#edrawings-explode-slider .ui-slider-handle");explodeHandle.off("touchmove.edw");explodeHandle.off("touchstart.edw");explodeHandle.off("touchend.edw")}}if(this.mViewerFeatureOpts.AR&&this.mViewerFeatureOpts.Exp){$("#edrawings-button-AR").on("click.edw",function(){var mgrAR=_this.ARMgr;var video=document.querySelector("#webcam");var canvasAR=document.querySelector("#arcanvas");var btnAR=$("#edrawings-button-AR");var isARActive=btnAR.hasClass("active-button");if(isARActive){$(video).css("visibility","visible");$(canvasAR).css("visibility","visible");_this.setActiveSubmenu("edrawings-button-AR","edrawings-section-AR");if(mgrAR)mgrAR.startAR(video,canvasAR)}else{if(mgrAR)mgrAR.stopAR(video,canvasAR);$(video).css("visibility","hidden");$(canvasAR).css("visibility","hidden");_this.hideAllPanels()}})}$("#edrawings-button-configurations").on("click.edw",function(){togglePanel("edrawings-button-configurations","edrawings-configurations-menu",".edw.config",_this.mUIEventHandlers)});this.mSubmenuHiddenCallbacks["edrawings-configurations-menu"]=function(){eDwUIUtils.deactivateMoveInput(".edw.config")};if(this.mViewerFeatureOpts.Tree){$("#edrawings-button-component-tree").on("click.edw",function(){togglePanel("edrawings-button-component-tree","edrawings-component-tree-menu",".edw.tree",_this.mUIEventHandlers);_this.mUIEventHandlers.updateComponentCount(_this.mViewer)});this.mSubmenuHiddenCallbacks["edrawings-component-tree-menu"]=function(){eDwUIUtils.deactivateMoveInput(".edw.tree")}}if(this.mViewerFeatureOpts.Tabs){$("#edrawings-button-confignav").on("click.edw",function(){var button=$("#edrawings-button-confignav");if(!button.hasClass("active-button")){_this.setActiveSubmenu("edrawings-button-confignav","edrawings-config-navigation")}else{_this.hideAllPanels()}});$(document).on("click.edw","#edrawings-config-navigation .edrawings-submenu-list-item",function(iEvent){var modelViewName=eDwUIUtils.getSpanText($(iEvent.target));if(!modelViewName)return;var activeModelView=_this.mViewer.getModel().getActiveModelView();if(modelViewName===activeModelView.Name)return;activateModelView(_this.mViewer,modelViewName,_this.mViewer.getInitCamera())});$(document).on("click.edw","#edrawings-config-bar .edrawings-config-tab",function(iEvent){var target=eDwUIUtils.getTarget($(iEvent.target));if(target.hasClass("active-modelview")){return}var modelViewName=eDwUIUtils.getSpanText($(iEvent.target));if(!modelViewName)return;activateModelView(_this.mViewer,modelViewName,_this.mViewer.getInitCamera())});$(document).on("mouseover.edw","#edrawings-config-bar .edrawings-config-tab",function(iEvent){var leaveEarly=true;if(leaveEarly)return;var modelViewName=eDwUIUtils.getSpanText($(iEvent.target));if(!modelViewName)return;var model=_this.mViewer.getModel();var modelView=model.getModelView(modelViewName);var imagePath=modelView.getPreviewImagePath();if(imagePath==="")return;var target=eDwUIUtils.getTarget($(iEvent.target));var offset={left:target.offset().left,top:target.parent().offset().top};var x=offset.left,y=offset.top;var canvasWidth=$("#"+l_CanvasID).width();var img=$("#edrawings-preview-img");img.attr("src",imagePath);var wImg=img.width(),hImg=img.height();var wTab=target.width(),hTab=target.height();var adjust={x:0,y:8};var xImg=x+wTab/2-wImg/2;var yImg=y-hImg-adjust.y;xImg=Math.min(xImg,canvasWidth-wImg);xImg=Math.max(0,xImg);var wnd=$("#edrawings-preview-window");wnd.css({width:wImg+"px",height:hImg+"px"});wnd.css({top:yImg+"px",left:xImg+"px"});eDwUIUtils.hide("#edrawings-preview-window",false)});$(document).on("mouseout.edw","#edrawings-config-bar .edrawings-config-tab",function(iEvent){eDwUIUtils.hide("#edrawings-preview-window",true)})}if(this.mViewerFeatureOpts.Annot){$("#edrawings-button-annot-control").on("click.edw",function(){togglePanel("edrawings-button-annot-control","edrawings-annot-control-menu",".edw.annot",_this.mUIEventHandlers)});this.mSubmenuHiddenCallbacks["edrawings-annot-control-menu"]=function(){eDwUIUtils.deactivateMoveInput(".edw.annot")}}$("#edrawings-button-tables-control").on("click.edw",function(){togglePanel("edrawings-button-tables-control","edrawings-tables-menu",".edw.tables",_this.mUIEventHandlers)});this.mSubmenuHiddenCallbacks["edrawings-tables-menu"]=function(){eDwUIUtils.deactivateMoveInput(".edw.tables")};if(this.mViewerFeatureOpts.Debug){$("#edrawings-button-debug").on("click.edw",function(){togglePanel("edrawings-button-debug","edrawings-debug-menu",".edw.debug",_this.mUIEventHandlers);_this.mUIEventHandlers.updateComponentCount(_this.mViewer)})}var keyMgr=eDwKeyMgr.get();if(this.mViewerFeatureOpts.Exp){keyMgr.add({key:"z",ctrlKey:true},"keydown",function(iEvent){eDwHistoryMgr.get().undo()});keyMgr.add({key:"y",ctrlKey:true},"keydown",function(iEvent){eDwHistoryMgr.get().redo()})}if(this.mViewerFeatureOpts.Explode){$("#edrawings-button-explode").on("click.edw",function(){var cmdMgr=eDwCommandMgr.get();if(_this.setActiveSubmenu("edrawings-button-explode","edrawings-explode-menu")){_this.mCompositeExplodeCmd=new eDwCompositeCmd(_this.mViewer);cmdMgr.add(_this.mCompositeExplodeCmd);_this.mCompositeExplodeCmd.initCmdActionImplementation({compositeInit:function(ioCmd){ioCmd.InitialState=_this.mViewer.getExplosionLevel()},compositeUndo:function(ioCmd){ioCmd.undoSubCmds();_this.mViewer.setExplosionLevel(ioCmd.InitialState);return true},compositeRedo:function(ioCmd){ioCmd.redoSubCmds();_this.mViewer.setExplosionLevel(ioCmd.FinalState);return true},compositeCommit:function(ioCmd){ioCmd.FinalState=_this.mViewer.getExplosionLevel()},compositeCancel:function(ioCmd){ioCmd.FinalState=ioCmd.InitialState=undefined}})}else{cmdMgr.remove(_this.mCompositeExplodeCmd,"commit");_this.mCompositeExplodeCmd=null}});this.mSubmenuShownCallbacks["edrawings-explode-menu"]=function(){var cmdMgr=eDwCommandMgr.get();function start(iUI){iUI.mExplodeCmd=new eDwExplodeCmd(iUI.mViewer);cmdMgr.add(iUI.mExplodeCmd)}function stop(iUI){cmdMgr.remove(iUI.mExplodeCmd,"commit");iUI.mExplodeCmd=null}function setLevel(iLevel){start(this);this.mExplodeCmd.setLevel(iLevel);stop(this)}var viewer=_this.mViewer;var explodeSlider=$("#edrawings-explode-slider");try{explodeSlider.slider("option")}catch(iException){explodeSlider.slider({orientation:"vertical",range:"min",min:0,max:10,step:.1,value:viewer.getExplosionLevel(),slide:function(iEvent,iSliderParams){_this.mExplodeCmd.setLevel(iSliderParams.value)},start:function(iEvent,iUI){start(_this)},stop:function(iEvent,iUI){stop(_this)}});$("#edrawings-explode-up").on("click.edw",function(){setLevel(10)});$("#edrawings-explode-down").on("click.edw",function(){setLevel(0)});if(_this.mViewer.ViewerFeatureOpts.Exp){var explodeHandle=$("#edrawings-explode-slider .ui-slider-handle");explodeHandle.on("touchmove.edw",function(iEvent){var total=explodeSlider.width();var touchEvent=iEvent.originalEvent;if(!(touchEvent instanceof TouchEvent))return;var xPos=touchEvent.touches[0].clientX;var val=10*(xPos-60)/total;val=val>1?1:val;val=val<0?0:val;explodeSlider.slider("value",val);_this.mExplodeCmd.setLevel(val)});explodeHandle.on("touchstart.edw",function(iEvent){start(_this)});explodeHandle.on("touchend.edw",function(iEvent){stop(_this)})}}};this.mSubmenuHiddenCallbacks["edrawings-explode-menu"]=function(){}}if(this.mViewerFeatureOpts.Measure){$("#edrawings-button-measure").on("click.edw",function(){_this.setActiveSubmenu("edrawings-button-measure","edrawings-measure-menu");eDwUIUtils.syncMeasureModeUI(_this.mViewer.MeasureMgr)});this.mSubmenuShownCallbacks["edrawings-measure-menu"]=function(){_this.mViewer.MeasureMgr.activateMeasure(_this.mViewer.MeasureMgr.getMeasureMode())};this.mSubmenuHiddenCallbacks["edrawings-measure-menu"]=function(){_this.mViewer.MeasureMgr.deactivateMeasure()}}if(this.mViewerFeatureOpts.Markup){$("#edrawings-button-markup").on("click.edw",function(){_this.setActiveSubmenu("edrawings-button-markup","edrawings-markup-menu");eDwUIUtils.syncMarkupModeUI(_this.mViewer.MarkupMgr)});this.mSubmenuShownCallbacks["edrawings-markup-menu"]=function(){_this.mViewer.MarkupMgr.activateMarkup()};this.mSubmenuHiddenCallbacks["edrawings-markup-menu"]=function(){_this.mViewer.MarkupMgr.deactivateMarkup()}}$("#edrawings-button-reset").on("click.edw",function(){var resetCmd=new eDwResetCmd(_this.mViewer);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(resetCmd);cmdMgr.remove(resetCmd,"commit");_this.hideAllPanels();$("#edrawings-button-reset").addClass("active-button");window.setTimeout(function(){$("#edrawings-button-reset").removeClass("active-button")},1e3)});$("#edrawings-button-zoomtofit").on("click.edw",function(){var viewHC=_this.mViewer.getHCView();var curModelView=_this.mViewer.getModel().getActiveModelView();var nodeID=curModelView.Hierarchy.HOOPSID;var zoomToFitCmd=new eDwZoomToFitCmd(_this.mViewer,nodeID,viewHC.getCamera());var cmdMgr=eDwCommandMgr.get();cmdMgr.add(zoomToFitCmd);cmdMgr.remove(zoomToFitCmd,"commit");$("#edrawings-button-zoomtofit").addClass("active-button");window.setTimeout(function(){$("#edrawings-button-zoomtofit").removeClass("active-button")},1e3)});$(document).on(l_fullScreenChange,function(iEvent){_this.mUIEventHandlers.onToggleFullScreenUI(iEvent,_this.mViewer)});$("#edrawings-button-fs").on("click.edw",function(){_this.toggleFullScreen()});function clickDrawMode(iUI,iMode){iUI.setDrawMode(iMode);iUI.hideActiveHUDMenu()}$("#edrawings-button-shaded-hlrr").on("click.edw",function(){clickDrawMode(_this,"HiddenLinesRemoved")});$("#edrawings-button-shaded-hlrv").on("click.edw",function(){clickDrawMode(_this,"HiddenLinesVisible")});$("#edrawings-button-shaded-wireframe").on("click.edw",function(){clickDrawMode(_this,"Wireframe")});$("#edrawings-button-shaded-full").on("click.edw",function(){clickDrawMode(_this,"ShadedWithEdges")});$("#edrawings-button-shaded-noedges").on("click.edw",function(){clickDrawMode(_this,"Shaded")});$("#edrawings-button-animate").on("click.edw",function(){var animateCmd=new eDwAnimateCmd(_this.mViewer);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(animateCmd);cmdMgr.remove(animateCmd,"commit")});$("#edrawings-button-frame-file-open").on("click.edw",function(){_this.hideActiveHUDMenu()});$("#edrawings-button-view").on("click.edw",function(){_this.setActiveHUDMenu("edrawings-button-view","edrawings-hud-view-menu")});$("#edrawings-button-help").on("click.edw",function(){var version=eDrawingsWVUtils.getViewerVersion();if(_this.mViewerFeatureOpts.Debug){version+=" HC Version:"+_this.mViewer.HCViewer.getViewerVersionString()}$("#edrawings-version").text("Version #: "+version);_this.setActiveHUDMenu("edrawings-button-help","edrawings-hud-help-menu")});$("#edrawings-button-controls").on("click.edw",function(){_this.setActiveHUDMenu("edrawings-button-controls","edrawings-hud-controls-menu")});$("#edrawings-button-zoom").on("click.edw",function(){_this.setActiveHUDMenu("edrawings-button-zoom","edrawings-hud-zoom-menu")});$("#edrawings-button-shaded").on("click.edw",function(){_this.setActiveHUDMenu("edrawings-button-shaded","edrawings-hud-shaded-menu")});$("#edrawings-sheets-foreward").on("click.edw",function(){var model=_this.mViewer.getModel();var currModelView=model.getActiveModelView();var modelViews=model.getModelViews();var curTab=l_getTabIndexOut(model,"right");var nxtIdx=0;if(curTab.Pos<0){nxtIdx=curTab.Idx-1}else{nxtIdx=curTab.Idx}if(nxtIdx>modelViews.length-1){nxtIdx=modelViews.length-1}if(nxtIdx<0)nxtIdx=0;pageConfigTab(modelViews[nxtIdx].Name,"right")});$("#edrawings-sheets-backward").on("click.edw",function(){var model=_this.mViewer.getModel();var modelViews=model.getModelViews();var curTab=l_getTabIndexOut(model,"left");var prvIdx=curTab.Idx-1;if(prvIdx>modelViews.length-1){prvIdx=modelViews.length-1}if(prvIdx<0)prvIdx=0;pageConfigTab(modelViews[prvIdx].Name,"left")});function togglePanel(iButtonID,iPanelID,iInputEventIDSuffix,iHandlers){if(self.setActiveSubmenu(iButtonID,iPanelID)){eDwUIUtils.activatePanelResizeInput("#"+iPanelID,iInputEventIDSuffix,iHandlers)}else{eDwUIUtils.deactivateMoveInput(iInputEventIDSuffix)}}$("#edrawings-button-sheet-tree").on("click.edw",function(){togglePanel("edrawings-button-sheet-tree","edrawings-sheet-tree-menu",".edw.sheet",_this.mUIEventHandlers)});$("#edrawings-button-layer-control").on("click.edw",function(){togglePanel("edrawings-button-layer-control","edrawings-layer-control-menu",".edw.layer",_this.mUIEventHandlers)});keyMgr.add({key:"F11"},"keydown",function(iEvent){iEvent.preventDefault();_this.toggleFullScreen();iEvent.stopPropagation()});$("#edrawings-button-view-settings").on("click.edw",function(){_this.setActiveHUDMenu("edrawings-button-view-settings","edrawings-hud-view-settings-menu")});var ambientOcc=$("#edrawings-button-view-ambient-occlusion");ambientOcc.on("click.edw",function(){var buttonActive=ambientOcc.hasClass("state-on-button");_this.hideActiveHUDMenu();if(buttonActive)ambientOcc.removeClass("state-on-button");else ambientOcc.addClass("state-on-button");var ambientOcclCmd=new eDwAmbientOcclusionCmd(_this.mViewer,!buttonActive);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(ambientOcclCmd);cmdMgr.remove(ambientOcclCmd,"commit")});$("#edrawings-button-view-perspective").on("click.edw",function(){_this.hideActiveHUDMenu();var perspectiveMode=!_this.mViewer.getPerspectiveMode();_this.setPerspectiveMode(perspectiveMode)});this.mSubmenuHiddenCallbacks["edrawings-sheet-tree-menu"]=function(){eDwUIUtils.deactivateMoveInput(".edw.sheet")};this.mSubmenuHiddenCallbacks["edrawings-layer-control-menu"]=function(){eDwUIUtils.deactivateMoveInput(".edw.layer")};this.registerButtonForClickEffect("edrawings-button-view-top",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Top)});this.registerButtonForClickEffect("edrawings-button-view-bottom",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Bottom)});this.registerButtonForClickEffect("edrawings-button-view-left",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Left)});this.registerButtonForClickEffect("edrawings-button-view-right",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Right)});this.registerButtonForClickEffect("edrawings-button-view-front",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Front)});this.registerButtonForClickEffect("edrawings-button-view-back",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Back)});this.registerButtonForClickEffect("edrawings-button-view-iso",function(){_this.setViewOrientation(eDwTypes_20.HC.ViewOrientation.Iso)})};eDwUI.prototype.unregisterHTMLEvents=function(){this.mUIEventHandlers.removeHTMLEventHandlers();window.removeEventListener("resize",this.mResizeProxy,true);window.removeEventListener("beforeunload",this.mBeforeUnloadProxy,true);window.removeEventListener("Timeout",this.mTimeoutProxy,true);$("#"+l_ViewerID).off("edw:AddViewerEvents",this.mAddViewerEventsHandler);$("#edrawings-button-reset").off("click.edw");$("#edrawings-section-xz-button").off("click.edw");$("#edrawings-section-yz-button").off("click.edw");$("#edrawings-section-xy-button").off("click.edw");$("#edrawings-section-capping-button").off("click.edw");$("#edrawings-button-fs").off("click.edw");$("#edrawings-button-shaded-hlrr").off("click.edw");$("#edrawings-button-shaded-hlrv").off("click.edw");$("#edrawings-button-shaded-wireframe").off("click.edw");$("#edrawings-button-shaded-full").off("click.edw");$("#edrawings-button-shaded-noedges").off("click.edw");$("#edrawings-button-section").off("click.edw");$("#edrawings-button-AR").off("click.edw");$("#edrawings-button-animate").off("click.edw");$("#edrawings-button-view").off("click.edw");$("#edrawings-button-help").off("click.edw");$("#edrawings-button-controls").off("click.edw");$("#edrawings-button-zoom").off("click.edw");$("#edrawings-button-shaded").off("click.edw");$("#edrawings-button-configurations").off("click.edw");$("#edrawings-button-sheets").off("click.edw");$("#edrawings-button-component-tree").off("click.edw");$("#edrawings-button-debug").off("click.edw");$("#edrawings-button-sheet-tree").off("click.edw");$("#edrawings-button-layer-control").off("click.edw");$("#edrawings-button-annot-control").off("click.edw");$("#edrawings-button-tables-control").off("click.edw");$("#edrawings-button-move").off("click.edw");$("#edrawings-button-confignav").off("click.edw");$("#edrawings-button-frame-file-open").off("click.edw");$(document).off(l_fullScreenChange);$(document).off("click.edw");$(document).off("mousedown.edw");$(document).off("dblclick.edw");$("#edrawings-button-explode").off("click.edw");$("#edrawings-button-measure").off("click.edw");$("#edrawings-button-markup").off("click.edw");$("#edrawings-button-view-settings").off("click.edw");$("#edrawings-button-view-ambient-occlusion").off("click.edw");$("#edrawings-button-view-perspective").off("click.edw");$("#edrawings-sheets-foreward").off("click.edw");$("#edrawings-sheets-backward").off("click.edw");this.unregisterButtonForClickEffect("edrawings-section-flip-button");this.unregisterButtonForClickEffect("edrawings-section-normal-button");this.unregisterButtonForClickEffect("edrawings-face-normal-button");this.unregisterButtonForClickEffect("edrawings-button-view-top");this.unregisterButtonForClickEffect("edrawings-button-view-bottom");this.unregisterButtonForClickEffect("edrawings-button-view-left");this.unregisterButtonForClickEffect("edrawings-button-view-right");this.unregisterButtonForClickEffect("edrawings-button-view-front");this.unregisterButtonForClickEffect("edrawings-button-view-back");this.unregisterButtonForClickEffect("edrawings-button-view-iso")};eDwUI.prototype.setActiveSubmenu=function(iButtonID,iMenuId){var active=$(".edrawings-tool-button.active-button");this.hideAllPanels();if(active.length>0&&active.attr("id")===iButtonID)return false;eDwUIUtils.hide("#"+iMenuId,false).addClass("active");var button=$("#"+iButtonID);button.addClass("active-button");if(this.mItemActiveCallbacks[iButtonID]){this.mItemActiveCallbacks[iButtonID].call()}if(iMenuId==="edrawings-section-menu"||iMenuId==="edrawings-explode-menu"||iMenuId==="edrawings-measure-menu"||iMenuId==="edrawings-configurations-menu"||iMenuId==="edrawings-component-tree-menu"||iMenuId==="edrawings-debug-menu"||iMenuId==="edrawings-sheet-tree-menu"||iMenuId==="edrawings-layer-control-menu"||iMenuId==="edrawings-annot-control-menu"||iMenuId==="edrawings-tables-menu"){button.addClass("active-button-top-cover")}if(this.mSubmenuShownCallbacks[iMenuId]){this.mSubmenuShownCallbacks[iMenuId].call()}return true};eDwUI.prototype.hideActiveSubmenu=function(){var active=$(".edrawings-tool-button.active-button");if(active.length>0){var menuId=$(".edrawings-submenu.active").attr("id");eDwUIUtils.hide("#"+menuId,true).removeClass("active");var edw=$(".active-button");var button=$("#"+edw[0].id);button.removeClass("active-button");if(this.mItemDeactiveCallbacks[edw[0].id]){this.mItemDeactiveCallbacks[edw[0].id].call()}if(button.hasClass("active-button-top-cover")){button.removeClass("active-button-top-cover")}if(this.mSubmenuHiddenCallbacks[menuId]){this.mSubmenuHiddenCallbacks[menuId].call()}}};eDwUI.prototype.centerBottomBar=function(iWidth,iHeight){var edwbar=$(".tool-bar");var h=52;var b=52;edwbar.css({height:"auto"});var bar=$(".tool-bar");var viewerElem=$("#"+l_ViewerID);var leftbuttons=$(".edrawings-icon-set.left");var rightbuttons=$(".edrawings-icon-set.right");var centerbuttons=$(".edrawings-icon-set.center");var x=(iWidth?iWidth:viewerElem.width())-1;if(navigator.userAgent.indexOf("Trident")>=0){x=viewerElem[0].clientWidth-1}bar.css({position:"absolute"});leftbuttons.css({left:1+"px",position:"absolute"});rightbuttons.css({right:1+"px",position:"absolute"});centerbuttons.css({left:x/2-b/2+"px",position:"absolute"})};eDwUI.prototype.hideViewer=function(){var activeID="#"+l_ViewerID;var active=$(activeID);if(active.length>0){active.removeClass("active");eDwUIUtils.hide(activeID,true)}eDwUIUtils.hide("#list",true)};eDwUI.prototype.setActiveHUDMenu=function(iButtonID,iMenuID){var active=$(".edrawings-hud-button.active-button");this.hideActiveHUDMenu();if(active.length>0&&active.attr("id")===iButtonID)return;var button=$("#"+iButtonID);button.addClass("active-button");var menu=$("#"+iMenuID);if(iButtonID==="edrawings-button-help"){var w=window.innerWidth;var h=window.innerHeight;menu.css({left:(w-279)/2+"px",top:(h-251)/2+"px"})}else{var offset=button.offset();var posx=offset.left;var posy=offset.top+button.height();var W=$("#edrawings-canvas").width();var w=menu.width();if(posx+w>W)posx=W-w-10;menu.css({top:posy+"px",left:posx+"px"});button.addClass("active-button-bottom-cover")}menu.addClass("active");eDwUIUtils.hide("#"+iMenuID,false);if(this.mSubmenuShownCallbacks[iMenuID]){this.mSubmenuShownCallbacks[iMenuID].call()}};eDwUI.prototype.hideActiveHUDMenu=function(){var active=$(".edrawings-hud-button.active-button");var menu=$("#edrawings-hud-help-menu");menu.removeClass("active");eDwUIUtils.hide("#edrawings-hud-help-menu",true);if(active.length>0){var button=$("#"+active[0].id);button.removeClass("active-button");if(button.hasClass("active-button-bottom-cover")){button.removeClass("active-button-bottom-cover")}eDwUIUtils.hide(".edrawings-hud-menu.active",true).remove("active")}};eDwUI.prototype.changeMouseCursor=function(iArg){var elemID="";if(iArg==="pan")elemID="#edrawings-custom-cursor-pan";else if(iArg==="zoom")elemID="#edrawings-custom-cursor-zoom";else if(iArg==="rotate")elemID="#edrawings-custom-cursor-rotate";eDwUIUtils.hide("#edrawings-custom-cursor-pan",true);eDwUIUtils.hide("#edrawings-custom-cursor-zoom",true);eDwUIUtils.hide("#edrawings-custom-cursor-rotate",true);eDwUIUtils.hide("#edrawings-custom-cursor-pan",true);eDwUIUtils.hide("#edrawings-custom-cursor-zoom",true);eDwUIUtils.hide("#edrawings-custom-cursor-rotate",true);$(document).off("mouseenter","#edrawings-canvas");$(document).off("mouseout","#edrawings-canvas");$(document).off("mousemove","#edrawings-canvas");if(iArg==="select"){$("#edrawings-canvas").css("cursor","default");return}$("#edrawings-canvas").css("cursor","none");$(document).on("mouseenter","#edrawings-canvas",function(){eDwUIUtils.hide(elemID,false);return false});$(document).on("mouseout","#edrawings-canvas",function(){if(elemID)eDwUIUtils.hide(elemID,true);return false});$(document).on(["mousemove"],"#edrawings-canvas",function(iEvent){if(elemID){$(elemID).css("left",iEvent.clientX).css("top",iEvent.clientY)}return false})};eDwUI.prototype.registerButtonForClickEffect=function(iButtonID,iHandler){var but=$("#"+iButtonID);but.on("mousedown.edw",function(){but.addClass("edrawings-on-state")});but.on("mouseup.edw",function(){but.removeClass("edrawings-on-state");iHandler()})};eDwUI.prototype.unregisterButtonForClickEffect=function(iButtonID){var but=$("#"+iButtonID);but.off("mousedown.edw");but.off("mouseup.edw")};eDwUI.prototype.setViewOrientation=function(iOrientation){var setViewCmd=new eDwSetViewCmd(this.mViewer,iOrientation);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(setViewCmd);cmdMgr.remove(setViewCmd,"commit");this.hideActiveHUDMenu()};eDwUI.prototype.showSectionCaps=function(iShow){var showCapsCmd=new eDwShowSectionCapCmd(this.mViewer,iShow);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(showCapsCmd);cmdMgr.remove(showCapsCmd,"commit");var sectionCapVisibility=this.mViewer.XSectionMgr.SectionCapVisibility;var button=$("#edrawings-section-capping-button");if(iShow&&!button.hasClass("active-button")){button.addClass("active-button")}else if(!iShow&&button.hasClass("active-button")){button.removeClass("active-button")}};eDwUI.prototype.setXSectionOrientation=function(iNewSection){function setActive(buttonID,isActive){if(isActive&&!$(buttonID).hasClass("active-button")){$(buttonID).addClass("active-button")}else if(!isActive&&$(buttonID).hasClass("active-button")){$(buttonID).removeClass("active-button")}}var sectionMgr=this.mViewer.XSectionMgr;var sectionIndex=iNewSection?iNewSection.Index:sectionMgr.SectionIndex;var planeFromEnum=null;switch(sectionIndex){case eDwTypes_21.SectionPlaneOrientation.YZ.Index:setActive("#edrawings-section-xy-button",false);setActive("#edrawings-section-yz-button",true);setActive("#edrawings-section-xz-button",false);planeFromEnum=eDwTypes_21.SectionPlaneOrientation.YZ;break;case eDwTypes_21.SectionPlaneOrientation.ZX.Index:setActive("#edrawings-section-xy-button",false);setActive("#edrawings-section-yz-button",false);setActive("#edrawings-section-xz-button",true);planeFromEnum=eDwTypes_21.SectionPlaneOrientation.ZX;break;case eDwTypes_21.SectionPlaneOrientation.XY.Index:eDwUIUtils.hide("#edrawings-section-xy-button-on",false);eDwUIUtils.hide("#edrawings-section-yz-button",false);eDwUIUtils.hide("#edrawings-section-xz-button",false);setActive("#edrawings-section-xy-button",true);setActive("#edrawings-section-yz-button",false);setActive("#edrawings-section-xz-button",false);planeFromEnum=eDwTypes_21.SectionPlaneOrientation.XY;break;default:console.debugLog("UI","Unsupported section plane orientation");break}var origPlaneEnum=null;if(sectionIndex!==sectionMgr.SectionIndex){switch(sectionMgr.SectionIndex){case eDwTypes_21.SectionPlaneOrientation.YZ.Index:origPlaneEnum=eDwTypes_21.SectionPlaneOrientation.YZ;break;case eDwTypes_21.SectionPlaneOrientation.ZX.Index:origPlaneEnum=eDwTypes_21.SectionPlaneOrientation.ZX;break;case eDwTypes_21.SectionPlaneOrientation.XY.Index:origPlaneEnum=eDwTypes_21.SectionPlaneOrientation.XY;break;default:console.debugLog("UI","Unsupported initial section plane orientation");break}}if(planeFromEnum){var changeSectionPlaneCmd=new eDwChangeSectionPlaneCmd(this.mViewer,origPlaneEnum,planeFromEnum);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(changeSectionPlaneCmd);cmdMgr.remove(changeSectionPlaneCmd,"commit")}};eDwUI.prototype.awfulUIHacks=function(){var _this=this;l_init=function(){$("#edrawings-face-normal-button").css("pointer-events","auto");_this.registerButtonForClickEffect("edrawings-face-normal-button",function(){var setViewCameraCmd=new eDwSetViewCameraCmd(_this.mViewer);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(setViewCameraCmd);cmdMgr.remove(setViewCameraCmd,"commit");_this.hideActiveHUDMenu()})};l_uninit=function(){$("#edrawings-face-normal-button").css("pointer-events","none");_this.unregisterButtonForClickEffect("edrawings-face-normal-button")}};return eDwUI}();exports.eDwUI=eDwUI;var UIEventHandlers=function(_super){__extends(UIEventHandlers,_super);function UIEventHandlers(iUI,iViewerHTMLID,iViewerHTMLCanvasID){var _this=_super.call(this,iViewerHTMLID,iViewerHTMLCanvasID)||this;_this.mUI=iUI;return _this}UIEventHandlers.prototype.addHTMLEventHandlers=function(iViewerFeatOpts){var _this=this;_super.prototype.addHTMLEventHandlers.call(this,iViewerFeatOpts);$(".edrawings-menu-close").on("click.edw",function(){_this.mUI.hideAllPanels()})};UIEventHandlers.prototype.removeHTMLEventHandlers=function(){_super.prototype.removeHTMLEventHandlers.call(this);$(".edrawings-menu-close").off("click.edw")};UIEventHandlers.removeViewerEventHandlers=function(){eDwUIBaseEventHandlers.removeViewerEventHandlers()};UIEventHandlers.prototype.onResize=function(iEvent,iViewer){this.mUI.adjustTabs()};UIEventHandlers.prototype.onToggleFullScreenUI=function(iEvent,iViewer){var fullScreenState=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;if(fullScreenState){$("#edrawings-button-fs").addClass("edrawings-button-fs-restore");if($("#edrawings-button-AR-w .active-button").length===0){$("#edrawings-canvas-canvas-container").css({"background-color":"white"})}}else{$("#edrawings-button-fs").removeClass("edrawings-button-fs-restore");$("#edrawings-canvas-canvas-container").css({"background-color":""})}};UIEventHandlers.prototype.onInit=function(iViewer){this.removeHTMLEventHandlers();this.addHTMLEventHandlers(iViewer.ViewerFeatureOpts);var viewerFeatureOpts=iViewer.ViewerFeatureOpts;var model=iViewer.getModel();var modelViews=iViewer.getModel().getModelViews();eDwUIUtils.hide("#edrawings-button-measure",!viewerFeatureOpts.Measure);var measureButton=$("#edrawings-button-measure");if(viewerFeatureOpts.Measure){if(!measureButton.hasClass("disabled-button")){measureButton.addClass("disabled-button")}if(model.getMeasureable()){$("#edrawings-button-measure").removeClass("disabled-button")}}var isDrawing=model.isDrawing();var isAssembly=model.isAssembly();eDwUIUtils.hide("edrawings-button-AR-g",true);eDwUIUtils.hide("#edrawings-button-reset",false);eDwUIUtils.hide("#edrawings-button-shaded",isDrawing);eDwUIUtils.hide("#edrawings-button-view-settings",isDrawing);eDwUIUtils.hide("#edrawings-button-animate",isDrawing);eDwUIUtils.hide("#edrawings-button-section",isDrawing);eDwUIUtils.hide("#edrawings-button-view",isDrawing||!viewerFeatureOpts.Section);eDwUIUtils.hide("#edrawings-button-debug",!viewerFeatureOpts.Debug);eDwUIUtils.hide("#edrawings-button-markup",!viewerFeatureOpts.Markup);eDwUIUtils.hide("#edrawings-button-tables-control",isDrawing||iViewer.TableMgr.numTables()===0);eDwUIUtils.hide("#edrawings-button-sheets",!isDrawing);eDwUIUtils.hide("#edrawings-button-sheet-tree",!isDrawing);eDwUIUtils.hide("#edrawings-button-layer-control",!isDrawing);eDwUIUtils.hide("#edrawings-button-configurations",isDrawing);eDwUIUtils.hide("#edrawings-button-explode",isDrawing||!viewerFeatureOpts.Explode||!isAssembly);eDwUIUtils.hide("#edrawings-button-move",isDrawing||!viewerFeatureOpts.Move||!isAssembly);eDwUIUtils.hide("#edrawings-button-component-tree",isDrawing||!viewerFeatureOpts.Tree||!isAssembly);eDwUIUtils.hide("#edrawings-button-annot-control",isDrawing||!viewerFeatureOpts.Annot||!isAssembly);eDwUIUtils.hide("#edrawings-button-frame-file-open",!viewerFeatureOpts.DragDrop);eDwUIUtils.hide("#edrawings-config-bar",!(viewerFeatureOpts.Tabs&&modelViews.length>1));eDwUIUtils.hide(".edrawings-icon-set.center",isDrawing);_super.prototype.onInit.call(this,iViewer);var featOpts=this.mViewer.ViewerFeatureOpts;if(!model.isDrawing()&&(featOpts.Measure||!featOpts.Tabs)||featOpts.Debug){this.mUITriad=new eDwUITriad(iViewer);iViewer.SelectionMgr.addSelectOverlayNotifier(eDwTypes_20.HC.BuiltinOverlayIndex.AxisTriad,this.mUITriad);this.mUITriad.activate()}this.mUI.init(iViewer);eDwUIUtils.hide("#WaitBanner",true)};UIEventHandlers.prototype.onSelect=function(iViewer,iSelObj){_super.prototype.onSelect.call(this,iViewer,iSelObj);if(l_init)l_init()};UIEventHandlers.prototype.onUnselect=function(iViewer,iSelObj){_super.prototype.onUnselect.call(this,iViewer,iSelObj);if(l_uninit)l_uninit()};UIEventHandlers.prototype.onTimeout=function(iViewer){eDwUIUtils.hide("#TimeoutBanner",false);eDwUI.changeStyle("edrawings-viewer-timeout")};UIEventHandlers.prototype.onStartAnimation=function(iViewer){var eDwViewer=iViewer;$("#edrawings-canvas").on("click.edw",function(){eDwViewer.ViewMgr.stop()});eDwUIUtils.hide("#edrawings-button-animate-play-icon",true);eDwUIUtils.hide("#edrawings-button-animate-stop-icon",false)};UIEventHandlers.prototype.onStopAnimation=function(iViewer){eDwUIUtils.hide("#edrawings-button-animate-play-icon",false);eDwUIUtils.hide("#edrawings-button-animate-stop-icon",true)};UIEventHandlers.prototype.onModelLoadFailed=function(iViewer,iModelName,iReason){alert("Model "+iModelName+" failed to load: "+iReason);eDwUIUtils.hide("#WaitBanner",true);eDwUIUtils.hide("#ErrorBanner",false)};UIEventHandlers.prototype.onAmbientOcclusionChange=function(iViewer,iAmbientOcclusionOn){var ambientOccButton=$("#edrawings-button-view-ambient-occlusion");var perspectiveButton=$("#edrawings-button-view-perspective");if(iAmbientOcclusionOn){if(!ambientOccButton.hasClass("state-on-button")){ambientOccButton.addClass("state-on-button")}}else{if(ambientOccButton.hasClass("state-on-button")){ambientOccButton.removeClass("state-on-button")}}};UIEventHandlers.prototype.onProjectionModeChange=function(iViewer,iPerspectiveOn){var perspectiveButton=$("#edrawings-button-view-perspective");if(iPerspectiveOn){if(!perspectiveButton.hasClass("state-on-button")){perspectiveButton.addClass("state-on-button")}}else{if(perspectiveButton.hasClass("state-on-button")){perspectiveButton.removeClass("state-on-button")}}};UIEventHandlers.prototype.onDrawModeChange=function(iViewer,iDrawMode){function setActive(iButtonID,iIsActive){if(iIsActive&&!$(iButtonID).hasClass("active-button")){$(iButtonID).addClass("active-button")}else if(!iIsActive&&$(iButtonID).hasClass("active-button")){$(iButtonID).removeClass("active-button")}}function setActiveInGroup(iButtonID){setActive("#edrawings-button-shaded-full",false);setActive("#edrawings-button-shaded-noedges",false);setActive("#edrawings-button-shaded-wireframe",false);setActive("#edrawings-button-shaded-hlrr",false);setActive("#edrawings-button-shaded-hlrv",false);setActive(iButtonID,true)}switch(iDrawMode){case"ShadedWithEdges":setActiveInGroup("#edrawings-button-shaded-full");break;case"Shaded":setActiveInGroup("#edrawings-button-shaded-noedges");break;case"HiddenLinesRemoved":setActiveInGroup("#edrawings-button-shaded-hlrr");break;case"HiddenLinesVisible":setActiveInGroup("#edrawings-button-shaded-hlrv");break;case"Wireframe":setActiveInGroup("#edrawings-button-shaded-wireframe");break;default:throw new Error("Unknown draw mode in UI:"+iDrawMode)}};UIEventHandlers.prototype.onModelViewChange=function(iViewer,iNewModelView,iIsAssembly){_super.prototype.onModelViewChange.call(this,iViewer,iNewModelView,iIsAssembly);$("[class~='edrawings-config-tab']").removeClass("active-modelview");var elements=$("#edrawings-config-navigation").find(".edrawings-submenu-list-item");elements.removeClass("edrawings-list-selected");eDwUIUtils.updateModelViewTargets(iNewModelView,"[class~='config-tab-text']","active-modelview");eDwUIUtils.updateModelViewTargets(iNewModelView,"[class~='config-nav-text']","edrawings-list-selected")};UIEventHandlers.prototype.onResetScene=function(){this.onExplodeLevelChange()};UIEventHandlers.prototype.onExplodeLevelChange=function(){var explodeSlider=$("#edrawings-explode-slider");try{explodeSlider.slider("value",this.mViewer.getExplosionLevel())}catch(iException){}};UIEventHandlers.prototype.onDone=function(iViewer){if(this.mUITriad)this.mUITriad.activate(false);$("#edrawings-config-tab-list").empty();_super.prototype.onDone.call(this,iViewer)};return UIEventHandlers}(eDwUIBaseEventHandlers);var l_fullScreenChange="fullscreenchange.edw MSFullscreenChange.edw "+"mozfullscreenchange.edw webkitfullscreenchange.edw";var l_ViewerID="edrawings-viewer";var l_CanvasID="edrawings-canvas";var l_init;var l_uninit;function l_getTabIndexOut(iModel,iSide){var modelViews=iModel.getModelViews();var tabPos=[];var i=0;for(var _i=0,modelViews_3=modelViews;_i0){var configTab=targetSpan.filter('[class~="config-tab-text"]');if(configTab.length>0){var tabDivJQ=configTab.parent();var scrollParentJQ=eDwUIUtils.getScrollParent(tabDivJQ);var tabDivPos=tabDivJQ.position().left;var pos=iSide==="right"&&scrollParentJQ?scrollParentJQ.width()-tabDivPos:tabDivPos;tabPos.push({Pos:pos,Idx:i++})}}}for(var i_2=0;i_20:tabPos[i_2].Pos<0;if(pos){continue}else{return tabPos[i_2]}}return iSide==="right"?tabPos[tabPos.length-1]:tabPos[0]}function pageConfigTab(iConfigName,iDir){var targetSpan=$("span:contains("+JSON.stringify(iConfigName)+")");if(targetSpan.length>0){var configTab=targetSpan.filter('[class~="config-tab-text"]');var tabDivJQ=configTab.parent();var scrollParentJQ=eDwUIUtils.getScrollParent(tabDivJQ);if(configTab.length>0&&scrollParentJQ){var tabDivPos=tabDivJQ.position().left;var pos=scrollParentJQ.scrollLeft()+(iDir==="left"?tabDivPos-scrollParentJQ.width()-tabDivJQ.width():tabDivPos);eDwUIUtils.scrollToTarget(scrollParentJQ,pos,"fast","scrollLeft")}}}function activateModelView(iViewer,iModelViewName,iCamera){var changeModelViewCmd=new eDwChangeModelViewCmd(iViewer,iModelViewName,iCamera);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(changeModelViewCmd);cmdMgr.remove(changeModelViewCmd,"commit")}});define("eDwUIAnnotHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUIAnnotHTMLGenerator=function(_super){__extends(eDwUIAnnotHTMLGenerator,_super);function eDwUIAnnotHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUIAnnotHTMLGenerator.prototype.generateHTML=function(iAdditionalClasses){return __awaiter(this,void 0,void 0,function(){var generatedHTML,modelHC,annotViews,viewID;return __generator(this,function(_a){generatedHTML="";modelHC=this.mViewer.getModel().getHCModel();annotViews=modelHC.getCADViews();for(viewID in annotViews){generatedHTML+="
"+"
"+""+annotViews[viewID]+"
"}return[2,generatedHTML]})})};return eDwUIAnnotHTMLGenerator}(eDwUIHTMLGenerator);return eDwUIAnnotHTMLGenerator});define("eDwUIBaseEventHandlers",["require","exports","eDwUIContextMenu","eDwEventMgr","eDwUIHTMLEventMgr","eDwCommandMgr","eDwChangeModelViewCmd","eDwZoomToFitCmd","eDwCompositeCmd","eDwSetNodeVisibilityCmd","eDwRedlineOperator","eDwKeyMgr","eDwUIUtils","eDwTypes"],function(require,exports,eDwUIContextMenu,eDwEventMgr,eDwUIHTMLEventMgr,eDwCommandMgr,eDwChangeModelViewCmd,eDwZoomToFitCmd,eDwCompositeCmd,eDwSetNodeVisibilityCmd,eDwRedlineOperator,eDwKeyMgr,eDwUIUtils,eDwTypes_22){"use strict";var eDwUIBaseEventHandlers=function(){function eDwUIBaseEventHandlers(iViewerHTMLID,iViewerHTMLCanvasID){this.mViewerHTMLID=iViewerHTMLID;this.mViewerHTMLCanvasID=iViewerHTMLCanvasID;this.mUIHTMLEventMgr=new eDwUIHTMLEventMgr}eDwUIBaseEventHandlers.prototype.setViewer=function(iViewer){this.mViewer=iViewer;this.setContextMenu(iViewer)};eDwUIBaseEventHandlers.prototype.addHTMLEventHandlers=function(iViewerFeatOpts){var _this=this;this.mViewerFeatureOpts=iViewerFeatOpts;var eventMgrHTML=this.mUIHTMLEventMgr;eventMgrHTML.addEventHandler("#"+this.mViewerHTMLID,"contextmenu",eDwUIUtils.inhibitEventBehavior);eventMgrHTML.addEventHandler("window","resize",function(iEvent){if(_this.mViewer)_this.mViewer.HCViewer.resizeCanvas()});this.addSubTreeArrowEventHandler("#edrawings-sheet-tree-menu");var eventHandlers=this;function selectElement(ioTarget,iX,iY){var selIDHC=getHCID(ioTarget);if(isNaN(selIDHC))return false;eventHandlers.mViewer.SelectionMgr.selectByID(selIDHC);return true}function selectElementWithContextMenu(ioTarget,iX,iY){if(selectElement(ioTarget,iX,iY)){eventHandlers.updateContextMenu(iX,iY)}}eventMgrHTML.addDelegatedEventHandler("#edrawings-sheet-tree-menu .edrawings-submenu-list-item-button","click",function(iEvent){var target=$(iEvent.target);if(!target)return;selectElementWithContextMenu(target.parent(),iEvent.clientX,iEvent.clientY)});eventMgrHTML.addDelegatedEventHandler("#edrawings-sheet-tree-menu .edrawings-submenu-list-item","click",function(iEvent){if($(iEvent.target).hasClass("edrawings-root")){switchModelView(iEvent.target,_this.mViewer);return}selectElement($(iEvent.target),iEvent.clientX,iEvent.clientY)});function isTreeExpandElement(iTarget){return iTarget?iTarget.hasClass("edrawings-tree-arrow")||iTarget.hasClass("edrawings-tree-expanded")||iTarget.hasClass("edrawings-tree-icon"):false}eventMgrHTML.addDelegatedEventHandler("#edrawings-sheet-tree-menu .edrawings-submenu-list-item","mousedown",function(iEvent){if($(iEvent.target).hasClass("edrawings-root")){return}if(isTreeExpandElement($(iEvent.target)))return;_this.onMouseDown(iEvent)});eventMgrHTML.addDelegatedEventHandler("#edrawings-sheet-tree-menu .edrawings-submenu-list-item","dblclick",function(iEvent){var target=$(iEvent.target);if(target.hasClass("edrawings-root")){return}var id=getHCID(target);if(isNaN(id)||id<0){return}var cmdMgr=eDwCommandMgr.get();var zoomToViewCmd=new eDwCompositeCmd(_this.mViewer);zoomToViewCmd.initCmdActionImplementation();cmdMgr.add(zoomToViewCmd);var targetModelView=_this.getModelViewFromID(id);var activeModelView=_this.mViewer.getModel().getActiveModelView();if(targetModelView&&targetModelView!==activeModelView){_this.mViewer.SelectionMgr.selectByID(id);var changeModelViewCmd=new eDwChangeModelViewCmd(_this.mViewer,targetModelView.Name,_this.mViewer.getInitCamera());cmdMgr.add(changeModelViewCmd);cmdMgr.remove(changeModelViewCmd,"commit")}_this.onLeftDoubleClick(_this.mViewer);cmdMgr.remove(zoomToViewCmd,"commit")});function switchModelView(iElement,iViewer){var modelViewName=eDwUIUtils.getText(iElement);var changeModelViewCmd=new eDwChangeModelViewCmd(iViewer,modelViewName,iViewer.getInitCamera());var cmdMgr=eDwCommandMgr.get();cmdMgr.add(changeModelViewCmd);cmdMgr.remove(changeModelViewCmd,"commit")}if(this.mViewerFeatureOpts.Tree){this.addSubTreeArrowEventHandler("#edrawings-component-tree-menu");eventMgrHTML.addDelegatedEventHandler("#edrawings-component-tree-menu .edrawings-submenu-list-item","click",function(iEvent){selectElement($(iEvent.target),iEvent.clientX,iEvent.clientY)});eventMgrHTML.addDelegatedEventHandler("#edrawings-configurations-menu .edrawings-submenu-list-item","click",function(iEvent){switchModelView(iEvent.target,_this.mViewer)});eventMgrHTML.addDelegatedEventHandler("#edrawings-component-tree-menu .edrawings-submenu-list-item","dblclick",function(iEvent){var id=getHCID($(iEvent.target));if(isNaN(id))return;_this.onLeftDoubleClick(_this.mViewer)});eventMgrHTML.addDelegatedEventHandler("#edrawings-component-tree-menu .edrawings-submenu-list-item","mousedown",function(iEvent){if(isTreeExpandElement($(iEvent.target)))return;_this.onMouseDown(iEvent)});eventMgrHTML.addEventHandler("#component-search-cancel","click",function(iEvent){$("#edrawings-component-tree-menu "+".edrawings-menu-search-input").val("");_this.searchPanelList($(iEvent.target))});eventMgrHTML.addDelegatedEventHandler("#edrawings-configurations-menu .item-text","click",function(iEvent){switchModelView(iEvent.target,_this.mViewer)});var selectorName="#edrawings-component-tree-menu "+".edrawings-submenu-list-item-button";eventMgrHTML.addDelegatedEventHandler(selectorName,"click",function(iEvent){var target=$(iEvent.target);if(!target)return;selectElementWithContextMenu(target.parent(),iEvent.clientX,iEvent.clientY)});eventMgrHTML.addEventHandler("#edrawings-search-component-input","keyup",function(iEvent){_this.searchPanelList($(iEvent.target))})}if(this.mViewerFeatureOpts.Debug){this.addSubTreeArrowEventHandler("#edrawings-debug-menu");var inputSelectorName="#edrawings-console-debug-categories "+".edrawings-menu-search-input";eventMgrHTML.addDelegatedEventHandler(inputSelectorName,"blur",function(iEvent){var inputElem=iEvent.target;var categories=inputElem.value.split(",");if(categories.length===0)return;for(var _i=0,categories_1=categories;_i-1){console.excludeDebugLogCategories.slice(pos,1)}}});var selectorName_1="#edrawings-debug-menu .edrawings-submenu-list-item";eventMgrHTML.addDelegatedEventHandler(selectorName_1,"click",function(iEvent){var id=getHCID($(iEvent.target));if(isNaN(id))return;$(selectorName_1).removeClass("edrawings-list-selected");$(iEvent.target).addClass("edrawings-list-selected");_this.mViewer.SelectionMgr.selectByID(id)});eventMgrHTML.addDelegatedEventHandler("#edrawings-debug-menu .edrawings-submenu-list-item","dblclick",function(iEvent){var id=getHCID($(iEvent.target));if(isNaN(id))return;_this.onLeftDoubleClick(_this.mViewer)});eventMgrHTML.addEventHandler("#edrawings-debug-menu .edrawings-menu-search-cancel","click",function(iEvent){$("#edrawings-debug-menu "+".edrawings-menu-search-input").val("");_this.searchPanelList($(iEvent.target))});eventMgrHTML.addEventHandler("#edrawings-debug-menu .edrawings-menu-search-input","keyup",function(iEvent){_this.searchPanelList($(iEvent.target))})}if(this.mViewerFeatureOpts.Measure){eventMgrHTML.addDelegatedEventHandler("#edrawings-measure-menu .edrawings-measure-entities-remove","click",function(iEvent){var target=$(iEvent.target);var idxStr=target.parent().attr("index");if(!idxStr)return;var idx=parseInt(idxStr,10);_this.mViewer.MeasureMgr.removeMeasureEntityAt(idx)});var selectorName_2="#edrawings-measure-menu .edrawings-measure-entities-list-item";eventMgrHTML.addDelegatedEventHandler(selectorName_2,"click",function(iEvent){_this.mContextMenu.hide();var target=$(iEvent.target);var idxStr=target.attr("index");if(!idxStr){return}var idx=parseInt(idxStr,10);$(selectorName_2).removeClass("edrawings-list-selected");_this.mViewer.MeasureMgr.dehighlightAllSelectEntity();target.addClass("edrawings-list-selected");_this.mViewer.MeasureMgr.highlightSelectEntityAt(idx)});eventMgrHTML.addDelegatedEventHandler("#edrawings-measure-menu .edrawings-measure-entities-list-item","mousedown",function(iEvent){if(!eDwKeyMgr.get().isRMBPressed(iEvent)){return}var target=$(iEvent.target);var idxStr=target.attr("index");if(!idxStr)return;target.addClass("edrawings-list-selected");var measureMgr=_this.mViewer.MeasureMgr;measureMgr.dehighlightAllSelectEntity();var idx=parseInt(idxStr,10);measureMgr.highlightSelectEntityAt(idx);_this.updateContextMenu(iEvent.pageX,iEvent.pageY,"#measure")});eventMgrHTML.addDelegatedEventHandler("#edrawings-measure-menu .measure-filter-button","click",function(iEvent){var target=$(iEvent.target);if(target.hasClass("active-button")){target.removeClass("active-button")}else{target.addClass("active-button")}_this.mViewer.MeasureMgr.setMeasureMode(eDwUIUtils.getCurrentMeasureMode())});eventMgrHTML.addDelegatedEventHandler("#edrawings-measure-menu .edrawings-measure-delta-button","click",function(iEvent){var target=$(iEvent.target);if(target.hasClass("active-button")){target.removeClass("active-button");_this.mViewer.MeasureMgr.setMeasureDelta(false)}else{target.addClass("active-button");_this.mViewer.MeasureMgr.setMeasureDelta(true)}});eventMgrHTML.addDelegatedEventHandler("#edrawings-measure-menu .edrawings-measure-pickpoint-button","click",function(iEvent){var target=$(iEvent.target);if(target.hasClass("active-button")){target.removeClass("active-button");_this.mViewer.MeasureMgr.setMeasurePickPoint(false)}else{target.addClass("active-button");_this.mViewer.MeasureMgr.setMeasurePickPoint(true)}});eventMgrHTML.addDelegatedEventHandler("#edrawings-measure-menu .measure-unit-selector","change",function(iEvent){var unitMultiplier=$("#edrawings-measure-distant-unit").val();var angleUnit=$("#edrawings-measure-angle-unit").val();_this.mViewer.MeasureMgr.setMeasureUnits(unitMultiplier,angleUnit)})}function addListClickEventHandler(iEventMgrHTML,iSelectorName,iViewAttrName){var _this=this;iEventMgrHTML.addDelegatedEventHandler(iSelectorName,"click",function(iEvent){var items=$(iSelectorName);items.removeClass("edrawings-list-selected");var target=$(iEvent.target);var viewID=parseInt(target.data(iViewAttrName),10);if(isNaN(viewID))return;var modelHC=_this.mViewer.getModel().getHCModel();modelHC.activateCADView(viewID);var pmiIds=[];var cadViews=modelHC.getCADViews();for(var idStr in cadViews){var id=parseInt(idStr,10);var name_1=cadViews[idStr];Array.prototype.push.apply(pmiIds,modelHC.getCADViewPMIs(id))}var setNodeVisCmd=new eDwSetNodeVisibilityCmd(_this.mViewer,pmiIds,true);var cmdMgr=eDwCommandMgr.get();cmdMgr.add(setNodeVisCmd);cmdMgr.remove(setNodeVisCmd,"commit");$(iEvent.target).addClass("edrawings-list-selected")})}if(this.mViewerFeatureOpts.Annot){addListClickEventHandler(eventMgrHTML,"#edrawings-annot-control-menu "+".edrawings-submenu-list-item","viewid")}eventMgrHTML.addDelegatedEventHandler("#edrawings-tables-menu .edrawings-submenu-list-item","click",function(iEvent){selectElementWithContextMenu($(iEvent.target),iEvent.clientX,iEvent.clientY)});eventMgrHTML.addDelegatedEventHandler("#edrawings-tables-menu .edrawings-submenu-list-item","mousedown",function(iEvent){if(!eDwKeyMgr.get().isRMBPressed(iEvent))return;selectElementWithContextMenu($(iEvent.target),iEvent.clientX,iEvent.clientY)});eventMgrHTML.addDelegatedEventHandler("#edrawings-tables-menu "+".edrawings-submenu-list-item-button","click",function(iEvent){var target=$(iEvent.target);if(!target)return;selectElementWithContextMenu(target.parent(),iEvent.clientX,iEvent.clientY)});if(this.mViewerFeatureOpts.Markup){eventMgrHTML.addDelegatedEventHandler("#edrawings-markup-menu .edrawings-submenu-list-item","click",function(iEvent){$(".edrawings-submenu-list-item").removeClass("edrawings-list-selected");var target=$(iEvent.target);var viewKey=target.attr("key");target.addClass("edrawings-list-selected");var markupMgr=_this.mViewer.HCViewer.getMarkupManager();markupMgr.activateMarkupView(viewKey,400);var markupView=markupMgr.getMarkupView(viewKey);eDwRedlineOperator.activateMarkups(markupView,_this.mViewer.HCViewer)});eventMgrHTML.addDelegatedEventHandler("#edrawings-markup-menu .edrawings-submenu-list-item","dblclick",function(iEvent){$(".edrawings-submenu-list-item").removeClass("edrawings-list-selected");var target=$(iEvent.target);var viewKey=target.attr("key");var markupMgr=_this.mViewer.HCViewer.getMarkupManager();markupMgr.deleteMarkupView(viewKey)});eventMgrHTML.addEventHandler("#markup-text-editor","keyup",function(iEvent){var input=$("#markup-text-editor").val();var op=_this.mViewer.MarkupMgr.getOperator();op.setCurAnnotation(input)});eventMgrHTML.addDelegatedEventHandler("#edrawings-markup-menu .markup-mode-button","click",function(iEvent){var target=$(iEvent.target);if(!target.hasClass("active-button")){var button=$("#edrawings-markup-menu .markup-mode-button");button.removeClass("active-button");target.addClass("active-button")}else{target.removeClass("active-button")}_this.mViewer.MarkupMgr.setMarkupMode(eDwUIUtils.getCurrentMarkupMode())});if(this.mViewerFeatureOpts.Exp){eDwUIUtils.hide(".edrawings-markup-io",false);eventMgrHTML.addDelegatedEventHandler("#edrawings-markup-menu .markup-op-button","click",function(iEvent){var target=$(iEvent.target);if(target[0].id==="edrawings-markup-read"){_this.mViewer.MarkupMgr.readFromCache()}if(target[0].id==="edrawings-markup-save"){_this.mViewer.MarkupMgr.saveToCache()}})}}eventMgrHTML.addDelegatedEventHandler("#edrawings-layer-control-menu .item-layer-checkbox","click",function(iEvent){var targetJQ=eDwUIUtils.getTarget($(iEvent.target));var layerName=eDwUIUtils.getSpanText(targetJQ.next("span.item-tree-text"));var isVisible=targetJQ.prop("checked");_this.setOneLayerVisibility(layerName,isVisible)});eventMgrHTML.addDelegatedEventHandler("#edrawings-layer-control-menu .layer-all","click",function(iEvent){var isVisible=$(iEvent.target).prop("checked");_this.setAllLayerVisibility(isVisible)})};eDwUIBaseEventHandlers.prototype.addDefaultHTMLPanelCloseEventHandlers=function(){var eventMgrHTML=this.mUIHTMLEventMgr;function addCloseEventHandler(iPanelID){eventMgrHTML.addDelegatedEventHandler(iPanelID+" .edrawings-menu-close","click",function(iEvent){eDwUIUtils.hide(iPanelID,true)})}if(this.mViewerFeatureOpts.Tree){addCloseEventHandler("#edrawings-component-tree-menu")}addCloseEventHandler("#edrawings-configurations-menu");if(this.mViewerFeatureOpts.Debug){addCloseEventHandler("#edrawings-debug-menu")}addCloseEventHandler("#edrawings-sheet-tree-menu");addCloseEventHandler("#edrawings-layer-control-menu");if(this.mViewerFeatureOpts.Annot){addCloseEventHandler("#edrawings-annot-control-menu")}addCloseEventHandler("#edrawings-tables-menu")};eDwUIBaseEventHandlers.addViewerEventHandlers=function(iEventHandlerObj){var handlerObj=iEventHandlerObj;var eventMgr=eDwEventMgr.get();eventMgr.addEventHandlerObj("Init",handlerObj,"onInit");eventMgr.addEventHandlerObj("Select",handlerObj,"onSelect");eventMgr.addEventHandlerObj("Unselect",handlerObj,"onUnselect");eventMgr.addEventHandlerObj("StartAnimation",handlerObj,"onStartAnimation");eventMgr.addEventHandlerObj("StopAnimation",handlerObj,"onStopAnimation");eventMgr.addEventHandlerObj("LeftClick",handlerObj,"onLeftClick");eventMgr.addEventHandlerObj("RightClick",handlerObj,"onRightClick");eventMgr.addEventHandlerObj("LeftDoubleClick",handlerObj,"onLeftDoubleClick");eventMgr.addEventHandlerObj("ModelLoadFailure",handlerObj,"onModelLoadFailed");eventMgr.addEventHandlerObj("Timeout",handlerObj,"onTimeout");eventMgr.addEventHandlerObj("DrawModeChange",handlerObj,"onDrawModeChange");eventMgr.addEventHandlerObj("ProjModeChange",handlerObj,"onProjectionModeChange");eventMgr.addEventHandlerObj("NodeAttribChange",handlerObj,"onNodeAttribChanged");eventMgr.addEventHandlerObj("CameraChange",handlerObj,"onCameraChange");eventMgr.addEventHandlerObj("ResetScene",handlerObj,"onResetScene");eventMgr.addEventHandlerObj("AmbientOcclChange",handlerObj,"onAmbientOcclusionChange");eventMgr.addEventHandlerObj("ExplodeLevelChange",handlerObj,"onExplodeLevelChange");eventMgr.addEventHandlerObj("Done",handlerObj,"onDone");eventMgr.addEventHandlerObj("ModelViewChange",handlerObj,"onModelViewChange");if(handlerObj.mViewerFeatureOpts.Measure){eventMgr.addEventHandlerObj("MeasurementRefresh",handlerObj,"onMeasurementRefresh");eventMgr.addEventHandlerObj("MeasurementSelection",handlerObj,"onMeasurementSelected");eventMgr.addEventHandlerObj("MeasurementDeselectAll",handlerObj,"onMeasurementDeselectAll")}if(handlerObj.mViewerFeatureOpts.Markup){eventMgr.addEventHandlerObj("ViewCreated",handlerObj,"onViewCreated");eventMgr.addEventHandlerObj("ViewLoaded",handlerObj,"onViewLoaded");eventMgr.addEventHandlerObj("ViewDeleted",handlerObj,"onViewDeleted")}};eDwUIBaseEventHandlers.prototype.removeHTMLEventHandlers=function(){this.mUIHTMLEventMgr.removeAllEventHandlers();if(this.mContextMenu)this.mContextMenu.removeAllEventHandlers();this.mContextMenu=undefined};eDwUIBaseEventHandlers.removeViewerEventHandlers=function(){eDwEventMgr.get().removeAllEventHandlers()};eDwUIBaseEventHandlers.prototype.onInit=function(iViewer){this.mViewer=iViewer;this.setContextMenu(this.mViewer);eDwUIUtils.createUIGenerators(iViewer);if(iViewer.ViewerFeatureOpts.Annot){this.populateMBDNotes(iViewer)}};eDwUIBaseEventHandlers.prototype.onDone=function(iViewer){iViewer.destroy()};eDwUIBaseEventHandlers.prototype.onMouseDown=function(iEvent){if(!this.mContextMenu){return}var jqSelObj=$(iEvent.target);jqSelObj.attr("inhibitScroll","true");if(eDwKeyMgr.get().isRMBPressed(iEvent)){var id=getHCID($(iEvent.target));if(isNaN(id)){jqSelObj.removeAttr("inhibitScroll");return}this.mViewer.SelectionMgr.selectByID(id);this.updateContextMenu(iEvent.pageX,iEvent.pageY)}else{this.mContextMenu.hide()}};eDwUIBaseEventHandlers.prototype.onSelect=function(iViewer,iSelObj){this.handleSelectionChange(iViewer,iSelObj,true);this.updateComponentCount(iViewer)};eDwUIBaseEventHandlers.prototype.onUnselect=function(iViewer,iSelObj){this.handleSelectionChange(iViewer,iSelObj,false);this.updateComponentCount(iViewer)};eDwUIBaseEventHandlers.prototype.onResizePanel=function(iEvent,iMenuID,mouseXOrig,menuWidthOrig){$(iMenuID).width(menuWidthOrig+iEvent.clientX-mouseXOrig)};eDwUIBaseEventHandlers.prototype.onLeftDoubleClick=function(iViewer){var nodeHCID;var result=iViewer.SelectionMgr.getLastSelHCID();if(result instanceof RangeError){var activeModelView=iViewer.getModel().getActiveModelView();if(activeModelView)nodeHCID=activeModelView.Hierarchy.HOOPSID}else{nodeHCID=result}var zoomToFitCmd=new eDwZoomToFitCmd(iViewer,nodeHCID,iViewer.getHCView().getCamera());var cmdMgr=eDwCommandMgr.get();cmdMgr.add(zoomToFitCmd);cmdMgr.remove(zoomToFitCmd,"commit");if(this.mContextMenu)this.mContextMenu.hide()};eDwUIBaseEventHandlers.prototype.onRightClick=function(iViewer,iCoords){this.updateContextMenu(iCoords.x,iCoords.y)};eDwUIBaseEventHandlers.prototype.updateContextMenu=function(iX,iY,iSelector){if(iSelector===void 0){iSelector=""}var selector=iSelector;if(!selector){var isDrawing=this.mViewer.getModel().isDrawing();selector="#display"+(isDrawing?" .edw-context-transp-solid":"")}if(this.mViewer.getModel().isPart()){selector+=" #display"}this.mContextMenu.show(iX,iY,selector)};eDwUIBaseEventHandlers.prototype.hideContextMenu=function(){if(this.mContextMenu)this.mContextMenu.hide()};eDwUIBaseEventHandlers.prototype.onLeftClick=function(iViewer,iCoords){this.hideContextMenu()};eDwUIBaseEventHandlers.prototype.onModelViewChange=function(iViewer,iNewModelView,iIsAssembly){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,eDwUIUtils.updateUI(iViewer,iNewModelView)];case 1:_a.sent();eDwUIUtils.setModelView(iNewModelView);return[2]}})})})()};eDwUIBaseEventHandlers.prototype.onNodeAttribChanged=function(iViewer,iHierNodesAndAttribs){if(iViewer.ViewerFeatureOpts.Debug){for(var _i=0,iHierNodesAndAttribs_3=iHierNodesAndAttribs;_i0));eDwUIUtils.hide(".edrawings-menu-search-cancel",true)}};eDwUIBaseEventHandlers.prototype.getModelViewFromID=function(iNodeHCID){var model=this.mViewer.getModel();var modelHC=model.getHCModel();var modelViews=model.getModelViews();for(var _i=0,modelViews_4=modelViews;_icanvasWidth){posx=canvasWidth-menuWidth-5}var posy=iY;if(posy+menuHeight>canvasHeight){posy=canvasHeight-menuHeight-5}contextMenu.css({top:posy+"px",left:posx+"px"});eDwUIUtils.hide("#edrawings-context-menu",false)};eDwUIContextMenu.prototype.hide=function(){eDwUIUtils.hide("#edrawings-context-menu",true)};return eDwUIContextMenu}();return eDwUIContextMenu});define("eDwUIDebugHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUIDebugHTMLGenerator=function(_super){__extends(eDwUIDebugHTMLGenerator,_super);function eDwUIDebugHTMLGenerator(iViewer,iPanelUIID){var _this=_super.call(this,iViewer,iPanelUIID)||this;_this.mHCModel=iViewer.getModel().getHCModel();return _this}eDwUIDebugHTMLGenerator.prototype.getNodeFromID=function(iNodeID){return getHCNode(iNodeID)};eDwUIDebugHTMLGenerator.prototype.getPostSpanHTML=function(iAdditionalClasses){return""};eDwUIDebugHTMLGenerator.prototype.forNodeGetName=function(iNode){return this.mHCModel.getNodeName(getHCNode(iNode))};eDwUIDebugHTMLGenerator.prototype.forNodeGetID=function(iNode){return getHCNode(iNode)};eDwUIDebugHTMLGenerator.prototype.forNodeGetParentID=function(iNode){return this.mHCModel.getNodeParent(getHCNode(iNode))};eDwUIDebugHTMLGenerator.prototype.forNodeGetChildren=function(iNode){return this.mHCModel.getNodeChildren(getHCNode(iNode))};eDwUIDebugHTMLGenerator.prototype.forNodeHasChildren=function(iNode){return this.forNodeGetChildren(iNode).length>0};eDwUIDebugHTMLGenerator.prototype.forNodeGetDataAttributes=function(iNode){return _super.prototype.forNodeGetDataAttributes.call(this,iNode)};eDwUIDebugHTMLGenerator.prototype.forNodeGetElementContent=function(iNode){var nodeHCID=this.forNodeGetID(iNode);return this.forNodeGetName(iNode)+" ID: "+nodeHCID+" TYPE: "+this.mHCModel.getNodeType(nodeHCID)};eDwUIDebugHTMLGenerator.prototype.forNodeGetDisplayStateCSSClass=function(iNode){return"edrawings-body-visible"};return eDwUIDebugHTMLGenerator}(eDwUIHTMLGenerator);function isHCNode(iNode){return!isNaN(iNode)}function getHCNode(iNode){if(!isHCNode(iNode)){throw new Error("Not an HC node:\n"+JSON.stringify(iNode))}return iNode}return eDwUIDebugHTMLGenerator});define("eDwUIHTMLEventMgr",["require","exports"],function(require,exports){"use strict";var eDwUIHTMLEventMgr=function(){function eDwUIHTMLEventMgr(){this.mEventHandlerData={}}eDwUIHTMLEventMgr.prototype.addDelegatedEventHandler=function(iElemSelector,iEventName,iEventHandler){if(!iElemSelector||!iEventName||!iEventHandler)return false;var selectors=iElemSelector.split(" ");if(selectors.length<2)return false;var ancestorElementID=selectors.shift();var ancestorElementJQ=$(ancestorElementID);if(!ancestorElementJQ)return false;var ancestorElement=$(ancestorElementJQ)[0];if(!ancestorElement)return false;return this.commonAddEventHandler(ancestorElementJQ,iEventName,iEventHandler,selectors.join().replace(".",""))};eDwUIHTMLEventMgr.prototype.addEventHandler=function(iElemID,iEventName,iEventHandler){if(!iElemID||!iEventName||!iEventHandler)return false;var elementJQ;if(iElemID==="window"){elementJQ=$(window);elementJQ[0].id="window";elementJQ[0].className="";elementJQ[0].nodeType=Node.ELEMENT_NODE}else if(iElemID==="document"){elementJQ=$(document);elementJQ[0].id="document";elementJQ[0].className=""}else{elementJQ=$(iElemID)}if(!elementJQ)return false;var element=$(elementJQ)[0];if(!element)return false;return this.commonAddEventHandler(elementJQ,iEventName,iEventHandler)};eDwUIHTMLEventMgr.prototype.removeAllEventHandlers=function(){for(var eventName in this.mEventHandlerData){if(this.mEventHandlerData.hasOwnProperty(eventName)){var handlersOfEvent=this.mEventHandlerData[eventName];for(var elemID in handlersOfEvent){if(handlersOfEvent.hasOwnProperty(elemID)){this.removeEventHandlersByID(elemID,eventName,handlersOfEvent)}}this.mEventHandlerData[eventName]={}}}this.mEventHandlerData={}};eDwUIHTMLEventMgr.prototype.removeEventHandlers=function(iElemID,iEventName){var handlersRemoved=false;if(this.mEventHandlerData.hasOwnProperty(iEventName)){var handlersOfEvent=this.mEventHandlerData[iEventName];if(handlersOfEvent.hasOwnProperty(iElemID)){handlersRemoved=this.removeEventHandlersByID(iElemID,iEventName,handlersOfEvent)}}return handlersRemoved};eDwUIHTMLEventMgr.prototype.commonAddEventHandler=function(iElementJQ,iEventName,iEventHandler,iElemClasses){if(iElemClasses===void 0){iElemClasses=""}if(!iElementJQ||!$(iElementJQ))return false;var element=$(iElementJQ)[0];if(!element)return false;var eventHandlerData=this.mEventHandlerData;var handlersOfEvent=eventHandlerData[iEventName];if(!handlersOfEvent){handlersOfEvent=eventHandlerData[iEventName]={}}var elemHandlers=handlersOfEvent[element.id];if(!elemHandlers){elemHandlers=handlersOfEvent[element.id]={MainDispatcher:null,Handlers:[]}}if(elemHandlers.MainDispatcher){element.removeEventListener(iEventName,elemHandlers.MainDispatcher,true)}elemHandlers.MainDispatcher=function(ioEvent){eventDispatcher(ioEvent,elemHandlers.Handlers)};element.addEventListener(iEventName,elemHandlers.MainDispatcher,true);elemHandlers.Handlers.push({Element:element,TargetElemClasses:iElemClasses,Handler:iEventHandler});console.debugLog("UIEvents","Event name = "+iEventName+", id = "+element.id+", classes = "+iElemClasses+", Num handlers = "+elemHandlers.Handlers.length);return true};eDwUIHTMLEventMgr.prototype.removeEventHandlersByID=function(iElemID,iEventName,ioHandlersOfEvent){var handlersRemoved=false;var elemHandlers=ioHandlersOfEvent[iElemID];if(!elemHandlers){elemHandlers=ioHandlersOfEvent[iElemID]={MainDispatcher:null,Handlers:[]}}if(elemHandlers.Handlers.length){var handler=elemHandlers.Handlers[0];handler.Element.removeEventListener(iEventName,elemHandlers.MainDispatcher,true);handlersRemoved=true}return handlersRemoved};return eDwUIHTMLEventMgr}();function eventDispatcher(ioEvent,iHandlerObjs){var handlers=iHandlerObjs;if(!iHandlerObjs||!iHandlerObjs.length)return;console.debugLog("UIEvents","Event = "+ioEvent.type+", Num handlers = "+iHandlerObjs.length);var runHandler=false;var eventTarget=ioEvent.target;while(eventTarget&&!runHandler){for(var i=0;i-1?"":" edrawings-list-option ";var highlight=this.getHighlightClass(iNode);var currOffset=iLeftPaddingInPX===undefined?this.mInitialLeftPaddingInPX+"px":iLeftPaddingInPX+"px";var generatedHTML="
";generatedHTML+=this.getPreSpanHTML(iNode,additionalClasses,expanded,iIgnoreChildren);generatedHTML+=""+this.forNodeGetElementContent(iNode)+"";generatedHTML+=this.getPostSpanHTML(nonRootClass+" "+additionalClasses);generatedHTML+="
";return generatedHTML};eDwUIHTMLGenerator.prototype.getNodeFromID=function(iNodeID){var modelViews=this.mViewer.getModel().getModelViews();for(var _i=0,modelViews_6=modelViews;_i
";return generatedHTML};eDwUIHTMLGenerator.prototype.getPostSpanHTML=function(iAdditionalClasses){return"
"};eDwUIHTMLGenerator.prototype.forNodeGetName=function(iNode){return getHierarchyNode(iNode).Name};eDwUIHTMLGenerator.prototype.forNodeGetID=function(iNode){return getHierarchyNode(iNode).HOOPSID};eDwUIHTMLGenerator.prototype.forNodeGetParentID=function(iNode){var parentHierNode=getHierarchyNode(iNode).ParentNode;return parentHierNode?parentHierNode.HOOPSID:undefined};eDwUIHTMLGenerator.prototype.forNodeGetChildren=function(iNode){var childrenObj=getHierarchyNode(iNode).getChildren();return Object.keys(childrenObj).map(function(key){return childrenObj[key]})};eDwUIHTMLGenerator.prototype.forNodeHasChildren=function(iNode){return this.forNodeGetChildren(iNode).length>0};eDwUIHTMLGenerator.prototype.forNodeGetDataAttributes=function(iNode){var parentNodeID=this.forNodeGetParentID(iNode);return" data-hoopsid='"+this.forNodeGetID(iNode)+"' "+(parentNodeID!==undefined?"data-hoopsparentid='"+parentNodeID+"' ":"")};eDwUIHTMLGenerator.prototype.forNodeGetElementContent=function(iNode){return this.forNodeGetName(iNode)};eDwUIHTMLGenerator.prototype.forNodeGetDisplayStateCSSClass=function(iNode){return eDwUIHTMLGenerator.getDisplayStateCSSClass(getHierarchyNode(iNode))};return eDwUIHTMLGenerator}();function isHierarchyNode(iNode){return iNode.Name}function getHierarchyNode(iNode){if(!isHierarchyNode(iNode)){throw new Error("Not a hierarchy node:\n"+JSON.stringify(iNode))}return iNode}return eDwUIHTMLGenerator});define("eDwUILayerHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUILayerHTMLGenerator=function(_super){__extends(eDwUILayerHTMLGenerator,_super);function eDwUILayerHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUILayerHTMLGenerator.prototype.generateHTML=function(iAdditionalClasses){return __awaiter(this,void 0,void 0,function(){var generatedHTML,activeModelView,layerNodes,_i,layerNodes_1,layerNode;return __generator(this,function(_a){generatedHTML="";activeModelView=this.mViewer.getModel().getActiveModelView();if(activeModelView&&activeModelView.Hierarchy){layerNodes=activeModelView.Hierarchy.findNodes("Category","layer");if(layerNodes.length){generatedHTML+="
"+" "+""+"Select all
"}for(_i=0,layerNodes_1=layerNodes;_i"};eDwUILayerHTMLGenerator.prototype.getPostSpanHTML=function(iAdditionalClasses){return""};return eDwUILayerHTMLGenerator}(eDwUIHTMLGenerator);return eDwUILayerHTMLGenerator});define("eDwUIMarkupHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUIMarkupHTMLGenerator=function(_super){__extends(eDwUIMarkupHTMLGenerator,_super);function eDwUIMarkupHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUIMarkupHTMLGenerator.prototype.generateHTML=function(iAdditionalClasses){return __awaiter(this,void 0,void 0,function(){var generatedHTML,markupMgr,keys,i,view;return __generator(this,function(_a){generatedHTML="";markupMgr=this.mViewer.HCViewer.getMarkupManager();keys=markupMgr.getMarkupViewKeys();for(i=0;i"+"
"+""+view.getName()+""}return[2,generatedHTML]})})};return eDwUIMarkupHTMLGenerator}(eDwUIHTMLGenerator);return eDwUIMarkupHTMLGenerator});define("eDwUIMeasureHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUIMeasureHTMLGenerator=function(_super){__extends(eDwUIMeasureHTMLGenerator,_super);function eDwUIMeasureHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUIMeasureHTMLGenerator.prototype.setMeasureResult=function(iMeasureResult){this.mMeasureResult=iMeasureResult};eDwUIMeasureHTMLGenerator.prototype.generateHTML=function(iAdditionalClasses){return __awaiter(this,void 0,void 0,function(){var generatedHTML,model,fCount,lCount,pCount,i,obj,faceEntity,lineEntity,pointEntity,nodeId,eType,count,highlight,status_1;return __generator(this,function(_a){switch(_a.label){case 0:generatedHTML="";model=this.mViewer.getModel().getHCModel();fCount=0,lCount=0,pCount=0;i=0;_a.label=1;case 1:if(!(i"+"
"+""+eType+" -"+count+"\n"+""+""+this.mMeasureResult.Descriptions[i]+"
"+" ";_a.label=9;case 9:++i;return[3,1];case 10:return[2,generatedHTML]}})})};return eDwUIMeasureHTMLGenerator}(eDwUIHTMLGenerator);return eDwUIMeasureHTMLGenerator});define("eDwUIMessageReporter",["require","exports","jquery","eDwEventMgr","eDwUIUtils","utils"],function(require,exports,$,eDwEventMgr,eDwUIUtils,utils){"use strict";var _this=this;var eDwUIMessageReporter=function(){function eDwUIMessageReporter(){}eDwUIMessageReporter.showServerLoadErrorPanel=function(iServerID,iModelCacheName){l_addParagraphToPanelText({},"edrawings-server-load-failure-1");l_addParagraphToPanelText({"server-id":iServerID},"edrawings-server-load-failure-2");l_addParagraphToPanelText({"model-cache-name":iModelCacheName},"edrawings-server-load-failure-3");eDwUIMessageReporter.showMessagePanel("",true,false,"edrawings-error-title edrawings-dialog-no-close")};eDwUIMessageReporter.showResultPanel=function(iResult){var showButtons=false;if(utils.isOfType(iResult,"ServerID")){showButtons=eDwUIMessageReporter.showConversionResultPanel(iResult)}else{switch(iResult.ErrorCode){default:showButtons=eDwUIMessageReporter.showPanelGeneric(iResult);break}}return showButtons};eDwUIMessageReporter.showMessagePanel=function(iMsg,iModal,iShowButtons,iDlgClasses){if(iMsg===void 0){iMsg=""}if(iModal===void 0){iModal=true}if(iShowButtons===void 0){iShowButtons=false}if(iDlgClasses===void 0){iDlgClasses="edrawings-info-title edrawings-dialog-no-close"}var msgPanelText=$("#edrawings-dialog-panel-text");if(iMsg)msgPanelText.html(iMsg);var opts={modal:iModal,width:window.innerWidth*.6,minWidth:200,dialogClass:iDlgClasses,closeOnEscape:iShowButtons};var msgPanel=$("#edrawings-dialog-panel");if(iShowButtons){$.extend(opts,{buttons:{Ok:function(){msgPanel.dialog("close")}},close:function(iEvent){$(".edrawings-dialog-content").remove()}})}msgPanel.dialog(opts);if(iDlgClasses.indexOf("edrawings")>-1&&iDlgClasses.indexOf("title")>-1){var msgPanelTitle=msgPanel.prev().find(".ui-dialog-title");msgPanelTitle.text(eDwUIUtils.getCSSContent(msgPanelTitle))}};eDwUIMessageReporter.showConversionResultPanel=function(iResult){var showButtons=l_shouldShowButtons();switch(iResult.ErrorCode){case"URLNotAccessible":l_addParagraphToPanelText({"file-url":iResult.ErrorData[0]},"edrawings-server-url-inaccessible");eDwUIMessageReporter.showMessagePanel("",true,false,"edrawings-error-title edrawings-dialog-no-close");break;case"UnsupportedFileType":l_addParagraphToPanelText({file:iResult.FileName},"edrawings-server-unsupported-file-type");eDwUIMessageReporter.showMessagePanel("",true,showButtons,"edrawings-error-title edrawings-dialog-no-close");break;default:if(l_isDebug()){eDwUIMessageReporter.showPanelGeneric(iResult)}else{eDwUIMessageReporter.showServerLoadErrorPanel(iResult.ServerID,iResult.ModelCacheName)}break}return showButtons};eDwUIMessageReporter.showPanelGeneric=function(iResult){var showButtons=l_shouldShowButtons();switch(iResult.ErrorCode){case"AJAXFailure":l_addParagraphToPanelText({},"edrawings-server-ajax-failure");eDwUIMessageReporter.showMessagePanel("",true,false,"edrawings-error-title edrawings-dialog-no-close");break;case"IncompleteFileProcessing":l_addParagraphToPanelText({},"edrawings-unable-process-file");eDwUIMessageReporter.showMessagePanel("",true,true,"edrawings-error-title edrawings-dialog-no-close");break;default:var msg="
"+iResult.ErrorCode+"
";for(var _i=0,_a=iResult.ErrorData;_i<_a.length;_i++){var data=_a[_i];msg+="
"+data+"
"}eDwUIMessageReporter.showMessagePanel(msg,true);break}return showButtons};return eDwUIMessageReporter}();eDwEventMgr.get().addEventHandlerFunc("LoadUIPanel",function(){(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){eDwUIUtils.loadPanel("#edrawings-dialog-panel","dialogpanel.html");return[2]})})})()});function l_addParagraphToPanelText(iOptions,iTextClass){var msgPanelText=$("#edrawings-dialog-panel-text");var elemJQ=$("
");msgPanelText.append(elemJQ);elemJQ.attr(iOptions)}function l_shouldShowButtons(){var viewerFeatOpts={DragDrop:false};eDwUIUtils.getRequestedQueryStringParams(location.href,viewerFeatOpts,false);return viewerFeatOpts.DragDrop}function l_isDebug(){var viewerFeatOpts={Debug:false};eDwUIUtils.getRequestedQueryStringParams(location.href,viewerFeatOpts,false);return viewerFeatOpts.Debug}return eDwUIMessageReporter});define("eDwUIModelViewHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUIModelViewHTMLGenerator=function(_super){__extends(eDwUIModelViewHTMLGenerator,_super);function eDwUIModelViewHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUIModelViewHTMLGenerator.prototype.generateHTML=function(iAdditionalClasses){return __awaiter(this,void 0,void 0,function(){var generatedHTML,modelViews,_i,modelViews_7,modelView,modelViewHierNode;return __generator(this,function(_a){generatedHTML="";modelViews=this.mViewer.getModel().getModelViews();for(_i=0,modelViews_7=modelViews;_i"+""+modelView.Name+""}return generatedHTML};eDwUIModelViewTabHTMLGenerator.prototype.shouldIncludeNode=function(iHierNode){if(iHierNode.Category==="layer"||iHierNode.Category==="table"){return false}return _super.prototype.shouldIncludeNode.call(this,iHierNode)};return eDwUIModelViewTabHTMLGenerator}(eDwUIHTMLGenerator);return eDwUIModelViewTabHTMLGenerator});define("eDwUISheetTreeHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUISheetTreeHTMLGenerator=function(_super){__extends(eDwUISheetTreeHTMLGenerator,_super);function eDwUISheetTreeHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUISheetTreeHTMLGenerator.prototype.shouldIncludeNode=function(iHierNode){if(iHierNode.Category==="layer")return false;return _super.prototype.shouldIncludeNode.call(this,iHierNode)};return eDwUISheetTreeHTMLGenerator}(eDwUIHTMLGenerator);return eDwUISheetTreeHTMLGenerator});define("eDwUITableHTMLGenerator",["require","exports","eDwUIHTMLGenerator"],function(require,exports,eDwUIHTMLGenerator){"use strict";var eDwUITableHTMLGenerator=function(_super){__extends(eDwUITableHTMLGenerator,_super);function eDwUITableHTMLGenerator(iViewer,iPanelUIID){return _super.call(this,iViewer,iPanelUIID)||this}eDwUITableHTMLGenerator.prototype.generateHTML=function(iAdditionalClasses){return __awaiter(this,void 0,void 0,function(){var generatedHTML,activeModelView,tableNodes,_i,tableNodes_1,tableNode;return __generator(this,function(_a){generatedHTML="";activeModelView=this.mViewer.getModel().getActiveModelView();if(activeModelView&&activeModelView.Hierarchy){tableNodes=activeModelView.Hierarchy.findNodes("Category","table");for(_i=0,tableNodes_1=tableNodes;_i-1){var hierNode=iViewer.getModel().getHierarchyNode(iID);if(hierNode){return{node:$("span[data-hoopsid='"+hierNode.HOOPSID+"']"),ownerDiv:$("div[data-hoopsid='"+hierNode.HOOPSID+"']")}}}return null}exports.getListElements=getListElements;function createUIGenerators(iViewer){var panelID="#edrawings-component-tree-menu";l_generators[panelID]=new eDwUICompTreeHTMLGenerator(iViewer,panelID);panelID="#edrawings-sheet-tree-menu";l_generators[panelID]=new eDwUISheetTreeHTMLGenerator(iViewer,panelID);panelID="#edrawings-layer-control-menu";l_generators[panelID]=new eDwUILayerHTMLGenerator(iViewer,panelID);panelID="#edrawings-tables-menu";l_generators[panelID]=new eDwUITableHTMLGenerator(iViewer,panelID);panelID="#edrawings-config-navigation";l_generators[panelID]=new eDwUIModelViewHTMLGenerator(iViewer,panelID);panelID="#edrawings-configurations-menu";l_generators[panelID]=new eDwUIModelViewHTMLGenerator(iViewer,panelID);panelID="#edrawings-config-tab-list";l_generators[panelID]=new eDwUIModelViewTabHTMLGenerator(iViewer,panelID);panelID="#edrawings-debug-menu";l_generators[panelID]=new eDwUIDebugHTMLGenerator(iViewer,panelID);panelID="#edrawings-annot-control-menu";l_generators[panelID]=new eDwUIAnnotHTMLGenerator(iViewer,panelID);panelID="#edrawings-markup-menu";l_generators[panelID]=new eDwUIMarkupHTMLGenerator(iViewer,panelID);panelID="#edrawings-measure-menu";l_generators[panelID]=new eDwUIMeasureHTMLGenerator(iViewer,panelID)}exports.createUIGenerators=createUIGenerators;function getUIGenerator(iName){return l_generators[iName]}exports.getUIGenerator=getUIGenerator;function getUIPanelID(iTarget){var panelJQ=iTarget.closest(".edrawings-submenu");return panelJQ?"#"+panelJQ[0].id:""}exports.getUIPanelID=getUIPanelID;function updateUI(iViewer,iModelView){return __awaiter(this,void 0,void 0,function(){function regenList(iList,iHTML){iList.empty();iList.append(iHTML)}var list,gen,listHTML,list,gen,modelViews,_i,modelViews_9,modelView;return __generator(this,function(_a){switch(_a.label){case 0:if(!iViewer)return[3,7];return[4,l_populateLayerPanel(iViewer)];case 1:_a.sent();return[4,populateModelViewPanel(iViewer,"#edrawings-configurations-menu","config-tree-text")];case 2:_a.sent();if(iViewer.ViewerFeatureOpts.Debug)l_populateDebugPanel(iViewer);if(!iViewer.ViewerFeatureOpts.Annot)return[3,4];return[4,l_populateAnnotPanel(iViewer)];case 3:_a.sent();_a.label=4;case 4:if(!iViewer.TableMgr.numTables())return[3,6];return[4,l_populateTablesPanel(iViewer)];case 5:_a.sent();_a.label=6;case 6:if(iModelView){if(iModelView.Category==="config"){list=$("#edrawings-component-tree-menu .edrawings-submenu-list");gen=getUIGenerator("#edrawings-component-tree-menu");regenList(list,gen.generateHTMLForChildNodes(iModelView.Hierarchy,false))}else{listHTML="";list=$("#edrawings-sheet-tree-menu .edrawings-submenu-list");gen=getUIGenerator("#edrawings-sheet-tree-menu");modelViews=iViewer.getModel().getModelViews();for(_i=0,modelViews_9=modelViews;_i0){var viewTab=targetSpans.filter(iFilter);if(viewTab.length>0){viewTab.parent().addClass(iTargetClass)}}}exports.updateModelViewTargets=updateModelViewTargets;function activatePanelResizeInput(iPanelID,iInputEventIDSuffix,iHandlers){var mouseDown="mousedown"+iInputEventIDSuffix;var mouseMove="mousemove"+iInputEventIDSuffix;var mouseUp="mouseup"+iInputEventIDSuffix;$(document).on(mouseDown,".edrawings-menu-resizer",function(iEvent){var msg="Panel resize: "+mouseDown;console.debugLog("UIPanelResize",msg);iEvent.preventDefault();var origMouseX=iEvent.clientX;var origMenuWidth=$(iPanelID).width();$(document).on(mouseMove,function(iEvent){var pressedLMB=eDwKeyMgr.get().isLMBPressed(iEvent);var msg="Panel resize LMB "+mouseMove+": ";msg+=pressedLMB?"true":"false";console.debugLog("UIPanelResize",msg);if(!pressedLMB)return;iEvent.preventDefault();iHandlers.onResizePanel(iEvent,iPanelID,origMouseX,origMenuWidth);iEvent.stopImmediatePropagation()});iEvent.stopImmediatePropagation()});$(document).on(mouseUp,function(iEvent){var msg="Panel resize: "+mouseUp;console.debugLog("UIPanelResize",msg);iEvent.preventDefault();$(document).off(mouseMove)})}exports.activatePanelResizeInput=activatePanelResizeInput;function deactivateMoveInput(iInputEventIDSuffix){$(document).off("mousemove"+iInputEventIDSuffix);$(document).off("mousedown"+iInputEventIDSuffix);$(document).off("mouseup"+iInputEventIDSuffix)}exports.deactivateMoveInput=deactivateMoveInput;function loadComponentHTML(iViewerOpts){l_loadContextMenu();l_loadSheetTreePanel();l_loadLayerPanel();l_loadAnnotPanel();l_loadTablesPanel();l_loadDebugPanel();if(iViewerOpts.Tree){l_loadComponentTreePanel()}l_loadConfigPanel();if(iViewerOpts.Measure){l_loadMeasurePanel()}l_loadMarkupPanel();eDwEventMgr.get().fireEvents("LoadUIPanel")}exports.loadComponentHTML=loadComponentHTML;function inhibitEventBehavior(iEvent){iEvent.preventDefault();iEvent.stopPropagation()}exports.inhibitEventBehavior=inhibitEventBehavior;function getCurrentMeasureMode(){var vertexEnabled=l_isActive("#edrawings-measure-vertex-button")?eDwTypes_24.MeasureMode.VERTEX:0;var edgeEnabled=l_isActive("#edrawings-measure-edge-button")?eDwTypes_24.MeasureMode.EDGE:0;var faceEnabled=l_isActive("#edrawings-measure-face-button")?eDwTypes_24.MeasureMode.FACE:0;var holeEnabled=l_isActive("#edrawings-measure-hole-button")?eDwTypes_24.MeasureMode.HOLE:0;return vertexEnabled|edgeEnabled|faceEnabled|holeEnabled}exports.getCurrentMeasureMode=getCurrentMeasureMode;function syncMeasureModeUI(iMeasureMgr){function setMeasureButton(iID,iMeasureModes,iTargetModes){var method=iMeasureModes&iTargetModes?"addClass":"removeClass";$(iID)[method]("active-button")}$("#edrawings-measure-distant-unit").val(iMeasureMgr.getDistanceUnit());$("#edrawings-measure-angle-unit").val(iMeasureMgr.getAngleUnit());var measureMode=iMeasureMgr.getMeasureMode();setMeasureButton("#edrawings-measure-vertex-button",measureMode,eDwTypes_24.MeasureMode.VERTEX);setMeasureButton("#edrawings-measure-edge-button",measureMode,eDwTypes_24.MeasureMode.EDGE);setMeasureButton("#edrawings-measure-face-button",measureMode,eDwTypes_24.MeasureMode.FACE)}exports.syncMeasureModeUI=syncMeasureModeUI;function getCurrentMarkupMode(){if(l_isActive("#edrawings-markup-text-button"))return eDwTypes_24.MarkupMode.Text;if(l_isActive("#edrawings-markup-circle-button"))return eDwTypes_24.MarkupMode.Circle;if(l_isActive("#edrawings-markup-rectangle-button")){return eDwTypes_24.MarkupMode.Rectangle}if(l_isActive("#edrawings-markup-polyline-button")){return eDwTypes_24.MarkupMode.Polyline}if(l_isActive("#edrawings-markup-bezier-button"))return eDwTypes_24.MarkupMode.Bezier;if(l_isActive("#edrawings-markup-image-button"))return eDwTypes_24.MarkupMode.Image;return eDwTypes_24.MarkupMode.None}exports.getCurrentMarkupMode=getCurrentMarkupMode;function syncMarkupModeUI(iMarkupMgr){function setMarkupButton(iID,iMeasureModes,iTargetModes){var method=iMeasureModes===iTargetModes?"addClass":"removeClass";$(iID)[method]("active-button")}var markupmode=iMarkupMgr.getMarkupMode();setMarkupButton("#edrawings-markup-text-button",markupmode,eDwTypes_24.MarkupMode.Text);setMarkupButton("#edrawings-markup-rectangle-button",markupmode,eDwTypes_24.MarkupMode.Rectangle);setMarkupButton("#edrawings-markup-circle-button",markupmode,eDwTypes_24.MarkupMode.Circle);setMarkupButton("#edrawings-markup-polyline-button",markupmode,eDwTypes_24.MarkupMode.Polyline)}exports.syncMarkupModeUI=syncMarkupModeUI;function populateModelViewPanel(iViewer,iPanelUIID,iTextClass){return __awaiter(this,void 0,void 0,function(){var listModelViewMenu,gen,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:listModelViewMenu=$(iPanelUIID+" .edrawings-submenu-list");listModelViewMenu.empty();gen=getUIGenerator(iPanelUIID);_b=(_a=listModelViewMenu).append;return[4,gen.generateHTML(iTextClass)];case 1:_b.apply(_a,[_c.sent()]);return[2]}})})}exports.populateModelViewPanel=populateModelViewPanel;function populateModelViewTabs(iViewer){var panelUIID="#edrawings-config-tab-list";var modelViewTabs=$(panelUIID);modelViewTabs.empty();var gen=getUIGenerator(panelUIID);modelViewTabs.append(gen.generateHTML(""))}exports.populateModelViewTabs=populateModelViewTabs;function getText(iElement){return $(iElement).text().trim()}exports.getText=getText;function getTarget(iTarget){return iTarget.hasClass("config-tab-text")?iTarget.parent():iTarget}exports.getTarget=getTarget;function getSpanText(iTarget){var target=getTarget(iTarget);if(!target.is("span")){target=target.find("span")}if(!target||!target.length)return"";return target[0].innerText}exports.getSpanText=getSpanText;function loadPanel(iElemOrClassID,iPanelHTML){return __awaiter(this,void 0,void 0,function(){var iExcp_14;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);return[4,eDwServiceMgr.get().load(iElemOrClassID,iPanelHTML)];case 1:_a.sent();return[3,3];case 2:iExcp_14=_a.sent();console.debugLog("PanelLoad","Failed to load "+iPanelHTML+": "+iExcp_14.message);return[3,3];case 3:return[2]}})})}exports.loadPanel=loadPanel;function hide(iSelector,iOff){var selJQ=$(iSelector);selJQ[iOff?"addClass":"removeClass"]("edrawings-ui-hide");return selJQ}exports.hide=hide;function getCSSContent(iJQElem){if(iJQElem){return iJQElem.css("content").replace(/^['"]+|\s+|\\|(;\s?})+|['"]$/g,"")}return""}exports.getCSSContent=getCSSContent;function getRequestedQueryStringParams(iURL,ioViewerFeatOpts,iWarnOfOtherParams){if(iWarnOfOtherParams===void 0){iWarnOfOtherParams=true}var hashes=iURL.slice(iURL.indexOf("?")+1).split("&");for(var i=0;i1){var strVal=hash[1];var val=strVal==="true"?true:strVal==="false"?false:strVal;if(ioViewerFeatOpts.hasOwnProperty(hash[0])){ioViewerFeatOpts[hash[0]]=val}else if(iWarnOfOtherParams){console.warn(hash[0]+" is not a valid query parameter.")}}}}exports.getRequestedQueryStringParams=getRequestedQueryStringParams;function getScrollParent(iTargetJQ){return iTargetJQ&&iTargetJQ.scrollParent?iTargetJQ.scrollParent():null}exports.getScrollParent=getScrollParent;function getPosition(iTargetJQ){var ret={top:0,left:0};if(iTargetJQ)ret=iTargetJQ.position();return ret}exports.getPosition=getPosition;function scrollToTarget(iTargetJQ,iPos,iAnimationSpeed,iStartPos){if(iAnimationSpeed===void 0){iAnimationSpeed="slow"}if(iStartPos===void 0){iStartPos="scrollTop"}if(!iTargetJQ)return;if(iAnimationSpeed==="none"){iTargetJQ[iStartPos](iPos)}else{iTargetJQ.animate((_a={},_a[iStartPos]=iPos,_a),iAnimationSpeed)}var _a}exports.scrollToTarget=scrollToTarget;var l_generators={};function l_loadContextMenu(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-context-menu","contextmenu.html")];case 1:_a.sent();return[2]}})})})()}function l_loadSheetTreePanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-sheet-tree-menu","sheetspanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadLayerPanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-layer-control-menu","layerspanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadAnnotPanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-annot-control-menu","annotpanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadTablesPanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-tables-menu","tablespanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadDebugPanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-debug-menu","debugpanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadComponentTreePanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){var viewerFeatOpts;return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-component-tree-menu","componentpanel.html")];case 1:_a.sent();viewerFeatOpts={Exp:false};getRequestedQueryStringParams(location.href,viewerFeatOpts,false);if(viewerFeatOpts.Exp){hide("#edrawings-component-tree-menu .edrawings-menu-info",false)}return[2]}})})})()}function l_loadConfigPanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-configurations-menu","configpanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadMeasurePanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-measure-menu","measurepanel.html")];case 1:_a.sent();return[2]}})})})()}function l_loadMarkupPanel(){var _this=this;(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,loadPanel("#edrawings-markup-menu","markuppanel.html")];case 1:_a.sent();return[2]}})})})()}function m_makePair(iFirst,iSecond){return{First:iFirst,Second:iSecond}}function l_isActive(iID){return $(iID).hasClass("active-button")}function l_getAllDisplayStateCSSClasses(iHierNode){var classes="";for(var displayState in eDwNodeAttributes_2.NodeDisplayState){classes+="edrawings-"+iHierNode.Category+"-"+displayState.toLowerCase()+" "}return classes}function l_populatePanel(iViewer,iCategoryName,iListID,iPanelUIID,iAdditionalClasses){if(iAdditionalClasses===void 0){iAdditionalClasses=""}return __awaiter(this,void 0,void 0,function(){var activeModelView,nodes,list,gen,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:activeModelView=iViewer.getModel().getActiveModelView();if(!activeModelView||!activeModelView.Hierarchy)return[2];nodes=activeModelView.Hierarchy.findNodes("Category",iCategoryName);list=$(iListID);list.empty();gen=getUIGenerator(iPanelUIID);_b=(_a=list).append;return[4,gen.generateHTML(iAdditionalClasses)];case 1:_b.apply(_a,[_c.sent()]);return[2]}})})}function l_populateAnnotPanel(iViewer){return __awaiter(this,void 0,void 0,function(){var activeModelView,list,gen,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:activeModelView=iViewer.getModel().getActiveModelView();if(!activeModelView||!activeModelView.Hierarchy)return[2];list=$("#edrawings-annot-control-list");list.empty();gen=getUIGenerator("#edrawings-annot-control-menu");_b=(_a=list).append;return[4,gen.generateHTML("")];case 1:_b.apply(_a,[_c.sent()]);return[2]}})})}function l_populateLayerPanel(iViewer){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,l_populatePanel(iViewer,"layer","#edrawings-layer-control-list","#edrawings-layer-control-menu")];case 1:_a.sent();return[2]}})})}function l_populateTablesPanel(iViewer){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,l_populatePanel(iViewer,"table","#edrawings-tables-control-list","#edrawings-tables-menu")];case 1:_a.sent();return[2]}})})}function l_populateDebugPanel(iViewer){var list=$("#edrawings-debug-menu .edrawings-submenu-list");list.empty();var gen=getUIGenerator("#edrawings-debug-menu");var modelView=iViewer.getModel().getActiveModelView();list.append(gen.generateHTMLForChildNodes(modelView.Hierarchy.HOOPSID,false))}});define("eDwView",["require","exports","eDwSelMgr","eDwMeasureMgr","eDwMarkupMgr","eDwXSectionMgr","eDwViewMgr","eDwTimer","eDwOperatorMgr","eDwCompXformMgr","eDwEventMgr","eDwHistoryMgr","eDwModel","eDwTypes","eDwMBDNoteMgr","eDwTouchOpsMgr","eDwTableMgr","eDrawingsBase"],function(require,exports,eDwSelMgr,eDwMeasureMgr,eDwMarkupMgr,eDwXSectionMgr,eDwViewMgr,eDwTimer,eDwOperatorMgr,eDwCompXformMgr,eDwEventMgr,eDwHistoryMgr,eDwModel,eDwTypes_25,eDwMBDNoteMgr,eDwTouchOpsMgr,eDwTableMgr){"use strict";var eDwView=function(){function eDwView(iViewerInfo,iFeatureOptions){this.mElemID=iViewerInfo.containerId;this.HCViewer=new eDwTypes_25.HC.WebViewer(iViewerInfo);this.mTimer=new eDwTimer;this.ViewerFeatureOpts=iFeatureOptions;this.mDrawMode=iFeatureOptions.RenderType;this.OperatorMgr=new eDwOperatorMgr(this);this.TableMgr=new eDwTableMgr(this);var streamAll=this.HCViewer.getStreamingMode()===eDwTypes_25.HC.StreamingMode.All;var timeBeforeTimeout=streamAll?14400:120;var timeBeforeWarnTimeout=timeBeforeTimeout-10;this.HCViewer.setClientTimeout(timeBeforeTimeout,timeBeforeWarnTimeout);this.mFitCamera=null;this.mModelKey=iViewerInfo.model;this.setupWebViewer()}eDwView.prototype.getHCView=function(){return this.HCViewer.getView()};eDwView.prototype.getModel=function(){if(!this.mModel){this.mModel=new eDwModel(this)}return this.mModel};eDwView.prototype.processProductStructure=function(){this.MBDNoteMgr=new eDwMBDNoteMgr(this);this.mFitCamera=this.getHCView().getCamera();var bbox=this.mModel.getBoundingBox();if(bbox.extents().equals(eDwTypes_25.HC.Point3.zero())){this.mModel.calculateBoundingBox()}$("#"+this.mElemID).trigger("edw:AddViewerEvents",this);this.finishInit()};eDwView.prototype.setupWebViewer=function(){var _this=this;var processingSelection=false;var eventMgr=eDwEventMgr.get();this.mHCCallbacksObj={sceneReady:function(){console.debugLog("ViewerLoad","Scene ready");_this.HCViewer.resizeCanvas()},streamingActivated:function(){console.debugLog("Viewer","Streaming activated")},streamingDeactivated:function(){var streamMode=_this.HCViewer.getStreamingMode();if(streamMode===eDwTypes_25.HC.StreamingMode.All){setTimeout(function(){console.debugLog("Viewer","Streaming finished. Closing connection...");_this.HCViewer.closeConnection()},5e3)}console.debugLog("Viewer","Streaming deactivated")},selection:function(iSelEvent){if(!processingSelection){processingSelection=true;try{_this.SelectionMgr.onSelection(iSelEvent)}catch(iException){}processingSelection=false}},timeoutWarning:function(iRemainingMinutes){console.debugLog("Viewer","Inactivity timeout pending in "+iRemainingMinutes+" minutes.");_this.mTimer.ellapsed();_this.mTimer.dumpToConsole()},timeout:function(){console.debugLog("Viewer","Inactivity timeout");_this.mTimer.ellapsed();_this.mTimer.dumpToConsole();eventMgr.fireEvents("Timeout",_this)},modelLoadFailure:function(iModelName,iReason){console.warn("Model "+iModelName+" load failed: "+iReason);eventMgr.fireEvents("ModelLoadFailure",_this,iModelName,iReason)},deprecated:function(iDeprecatedFuncName){console.debugLog("Debug",iDeprecatedFuncName)},info:function(iInfoType,iMsg){console.debugLog("Debug",iInfoType.toString()+" "+iMsg)},missingModel:function(iModelPath){console.debugLog("Debug","Missing model: "+iModelPath)},webGlContextLost:function(){console.debugLog("Debug","Browser lost GL context! Render incomplete!!")},click:function(iMousePos,iEvent){console.debugLog("Debug","Mouse clicked")},modelStructureReady:function(){console.debugLog("ViewerLoad","Model structure ready.");$("#"+_this.mElemID).trigger("edw:ModelLoaded",_this)},modelSwitched:function(){console.debugLog("ViewerLoad","Model switch done.");$("#"+_this.mElemID).trigger("edw:ModelLoaded",_this)},viewCreated:function(iView){eventMgr.fireEvents("ViewCreated",iView)},viewLoaded:function(iView){eventMgr.fireEvents("ViewLoaded",iView)},viewDeleted:function(iView){eventMgr.fireEvents("ViewDeleted",iView)},camera:function(iCamera){eventMgr.fireEvents("CameraChange",iCamera)}};this.HCViewer.setCallbacks(this.mHCCallbacksObj);this.HCViewer.start()};eDwView.prototype.getInitCamera=function(){return this.mFitCamera};eDwView.prototype.getCurrModelKey=function(){return this.mModelKey};eDwView.prototype.unregister=function(){if(this.HCViewer)this.HCViewer.unsetCallbacks(this.mHCCallbacksObj);this.OperatorMgr.unregisterAll();eDwEventMgr.get().fireEvents("Done",this)};eDwView.prototype.destroy=function(){this.HCViewer.shutdown()};eDwView.prototype.setExplosionLevel=function(iLevel){this.HCViewer.getExplodeManager().setMagnitude(iLevel);eDwEventMgr.get().fireEvents("ExplodeLevelChange",this,iLevel)};eDwView.prototype.getExplosionLevel=function(){return this.HCViewer.getExplodeManager().getMagnitude()};eDwView.prototype.getDrawMode=function(){return this.mDrawMode};eDwView.prototype.setDrawMode=function(iValue){var view=this.getHCView();var settings=view.getHiddenLineSettings();switch(iValue){case"ShadedWithEdges":view.setDrawMode(eDwTypes_25.HC.DrawMode.WireframeOnShaded);this.SelectionMgr.setColorForViewMode(eDwTypes_25.HC.DrawMode.WireframeOnShaded);break;case"Shaded":view.setDrawMode(eDwTypes_25.HC.DrawMode.Shaded);this.SelectionMgr.setColorForViewMode(eDwTypes_25.HC.DrawMode.Shaded);break;case"HiddenLinesRemoved":settings.setObscuredLineTransparency(0);view.setDrawMode(eDwTypes_25.HC.DrawMode.HiddenLine);this.SelectionMgr.setColorForViewMode(eDwTypes_25.HC.DrawMode.HiddenLine);break;case"HiddenLinesVisible":settings.setObscuredLineTransparency(.5);view.setDrawMode(eDwTypes_25.HC.DrawMode.HiddenLine);this.SelectionMgr.setColorForViewMode(eDwTypes_25.HC.DrawMode.HiddenLine);break;case"Wireframe":settings.setObscuredLineTransparency(1);view.setDrawMode(eDwTypes_25.HC.DrawMode.HiddenLine);this.SelectionMgr.setColorForViewMode(eDwTypes_25.HC.DrawMode.HiddenLine);break;default:throw new Error("Unknown draw mode: "+iValue)}this.mDrawMode=iValue;eDwEventMgr.get().fireEvents("DrawModeChange",this,iValue)};eDwView.prototype.getPerspectiveMode=function(){return this.getHCView().getProjectionMode()===eDwTypes_25.HC.Projection.Perspective};eDwView.prototype.setPerspectiveMode=function(iValue){if(!iValue){this.getHCView().setProjectionMode(eDwTypes_25.HC.Projection.Orthographic)}else{this.getHCView().setProjectionMode(eDwTypes_25.HC.Projection.Perspective)}eDwEventMgr.get().fireEvents("ProjModeChange",this,iValue);return iValue};eDwView.prototype.resetDrawMode=function(){this.setDrawMode(this.ViewerFeatureOpts.RenderType)};eDwView.prototype.initializeManagers=function(){new eDwSelMgr(this);new eDwMeasureMgr(this);new eDwMarkupMgr(this);new eDwXSectionMgr(this);new eDwViewMgr(this);new eDwCompXformMgr(this);if(eDwTouchOpsMgr.isTouchEnabled()&&this.ViewerFeatureOpts.Exp){new eDwTouchOpsMgr(this)}};eDwView.prototype.drawDebugBoundingBox=function(bbox){return __awaiter(this,void 0,void 0,function(){var modelHC,beautifulGreen,width,height,length,vmin,vmax,p0,p1,p2,p3,p4,p5,p6,p7,polylineData0,polylineData1,polylineData2,polylineData3,rgba,i,tmp,boxMesh,key,meshInstance;return __generator(this,function(_a){switch(_a.label){case 0:modelHC=this.getModel().getHCModel();beautifulGreen=new Communicator.Color(0,255,0);width=bbox.max.x-bbox.min.x;height=bbox.max.y-bbox.min.y;length=Math.max(width,height);vmin=bbox.min;vmax=bbox.max;p0=new Communicator.Point3(vmin.x,vmin.y,vmax.z);p1=new Communicator.Point3(vmin.x,vmax.y,vmax.z);p2=new Communicator.Point3(vmax.x,vmax.y,vmax.z);p3=new Communicator.Point3(vmax.x,vmin.y,vmax.z);p4=new Communicator.Point3(vmin.x,vmin.y,vmin.z);p5=new Communicator.Point3(vmin.x,vmax.y,vmin.z);p6=new Communicator.Point3(vmax.x,vmax.y,vmin.z);p7=new Communicator.Point3(vmax.x,vmin.y,vmin.z);polylineData0=[p0.x,p0.y,p0.z,p1.x,p1.y,p1.z,p2.x,p2.y,p2.z,p3.x,p3.y,p3.z,p0.x,p0.y,p0.z];polylineData1=[p4.x,p4.y,p4.z,p5.x,p5.y,p5.z,p6.x,p6.y,p6.z,p7.x,p7.y,p7.z,p4.x,p4.y,p4.z];polylineData2=[p4.x,p4.y,p4.z,p0.x,p0.y,p0.z,p1.x,p1.y,p1.z,p5.x,p5.y,p5.z,p4.x,p4.y,p4.z];polylineData3=[p7.x,p7.y,p7.z,p3.x,p3.y,p3.z,p2.x,p2.y,p2.z,p6.x,p6.y,p6.z,p7.x,p7.y,p7.z];rgba=[];for(i=0;i<5;i++){tmp=[beautifulGreen.r,beautifulGreen.g,beautifulGreen.b,255];rgba=rgba.concat(tmp)}boxMesh=new Communicator.MeshData;boxMesh.addPolyline(polylineData0,rgba);boxMesh.addPolyline(polylineData1,rgba);boxMesh.addPolyline(polylineData2,rgba);boxMesh.addPolyline(polylineData3,rgba);return[4,modelHC.createMesh(boxMesh)];case 1:key=_a.sent();meshInstance=new Communicator.MeshInstanceData(key);return[2,modelHC.createMeshInstance(meshInstance)]}})})};eDwView.prototype.finishInit=function(){eDwEventMgr.get().fireEvents("Init",this);this.mModel.notifyDataChange(this.mModel.getActiveModelView());this.HCViewer.enableBackgroundSheet(false);eDwHistoryMgr.get().clear()};return eDwView}();return eDwView});define("eDwViewMgr",["require","exports","eDwEventMgr","eDwTypes","eDrawingsBase"],function(require,exports,eDwEventMgr,eDwTypes_26){"use strict";var eDwViewMgr=function(){function eDwViewMgr(iViewer){if(!iViewer)throw new Error("Must have viewer object");iViewer.ViewMgr=this;this.mViewAnimationIndex=0;this.mViewAnimationActive=false;this.mAnimationTimeOutID=-1;this.mViewer=iViewer}eDwViewMgr.prototype.start=function(){if(this.mViewer.getModel().isDrawing())return;eDwEventMgr.get().fireEvents("StartAnimation",this.mViewer);this.mViewAnimationActive=true;this.animateNextView()};eDwViewMgr.prototype.stop=function(){this.mViewAnimationActive=false;if(this.mAnimationTimeOutID>-1){window.clearTimeout(this.mAnimationTimeOutID);this.mAnimationTimeOutID=-1}eDwEventMgr.get().fireEvents("StopAnimation",this.mViewer)};eDwViewMgr.prototype.isActive=function(){return this.mViewAnimationActive};eDwViewMgr.prototype.setViewOrientation=function(iEyeDir,iDuration){if(iDuration===void 0){iDuration=400}var center=this.mViewer.getModel().getBoundingBox().center();var viewHC=this.mViewer.getHCView();var camera=viewHC.getCamera().copy();var pos=camera.getPosition().copy();var target=camera.getTarget();var up=camera.getUp();pos=pos.subtract(target);var dist=pos.length();switch(iEyeDir){case Communicator.ViewOrientation.Front:pos.set(0,0,1).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Back:pos.set(0,0,-1).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Left:pos.set(-1,0,0).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Right:pos.set(1,0,0).scale(dist).add(center);up.set(0,1,0);break;case Communicator.ViewOrientation.Top:pos.set(0,1,0).scale(dist).add(center);up.set(0,0,-1);break;case Communicator.ViewOrientation.Bottom:pos.set(0,-1,0).scale(dist).add(center);up.set(0,0,1);break;case Communicator.ViewOrientation.Iso:pos.set(1,1,1).normalize().scale(dist).add(center);up.set(-.408204,.816541,-.408204);break;default:throw new Error("Unsupported orientation: "+iEyeDir)}camera.setPosition(pos);camera.setTarget(center);camera.setUp(up);viewHC.fitWorld(iDuration,camera);return camera};eDwViewMgr.prototype.setViewOrientationToDirection=function(normal){var camera=this.mViewer.getHCView().getCamera();var position=camera.getPosition();var target=camera.getTarget();var up=camera.getUp();var delta=target.subtract(position);var distance=delta.length();var bbox=this.mViewer.getModel().getBoundingBox();var bbox_min=bbox.min;var bbox_max=bbox.max;target=Communicator.Point3.add(bbox_max,bbox_min).scale(.5);var eyeVec=Communicator.Point3.scale(normal,distance);position=Communicator.Point3.add(target,eyeVec);var vTest=new Communicator.Point3(1,0,0);var isParallel=Communicator.Point3.dot(vTest,normal);if(Math.abs(Math.abs(isParallel)-1)<.001){vTest.set(0,1,0);var vec=Communicator.Point3.cross(normal,vTest);vec=vec.normalize();up=Communicator.Point3.cross(vec,normal);up=up.normalize()}else{up=Communicator.Point3.cross(normal,vTest);up=up.normalize()}var dotProd=Communicator.Point3.dot(up,new Communicator.Point3(1,0,0));if(Math.abs(Math.abs(dotProd)-1)<.001&&dotProd<0){up=up.negate()}dotProd=Communicator.Point3.dot(up,new Communicator.Point3(0,1,0));if(Math.abs(Math.abs(dotProd)-1)<.001&&dotProd<0){up=up.negate()}dotProd=Communicator.Point3.dot(up,new Communicator.Point3(0,0,1));if(Math.abs(Math.abs(dotProd)-1)<.001&&dotProd<0){up=up.negate()}camera.setPosition(position);camera.setTarget(target);camera.setUp(up);this.setCamera(camera,500);return camera};eDwViewMgr.prototype.setCamera=function(iCamera,iTimeInMS){if(iTimeInMS===void 0){iTimeInMS=400}this.mViewer.getHCView().setCamera(iCamera,iTimeInMS)};eDwViewMgr.prototype.enableAmbientOcclusion=function(iEnable){this.mViewer.getHCView().setAmbientOcclusionEnabled(iEnable);eDwEventMgr.get().fireEvents("AmbientOcclChange",this,iEnable)};eDwViewMgr.prototype.fitScreenToNodes=function(iNodeHCIDs,ioCamera){return __awaiter(this,void 0,void 0,function(){var modelHC,bbox,subtract,viewVec,center,add,ratio,boxMaxLen;return __generator(this,function(_a){switch(_a.label){case 0:if(!ioCamera)return[2];modelHC=this.mViewer.getModel().getHCModel();return[4,modelHC.getNodesBounding(iNodeHCIDs)];case 1:bbox=_a.sent();subtract=eDwTypes_26.HC.Point3.subtract;viewVec=subtract(ioCamera.getPosition(),ioCamera.getTarget());center=bbox.center().copy();ioCamera.setTarget(center);add=eDwTypes_26.HC.Point3.add;ioCamera.setPosition(add(center,viewVec));ratio=ioCamera.getWidth()/ioCamera.getHeight();if(this.mViewer.getModel().isDrawing()){bbox.min.z=bbox.max.z=0}boxMaxLen=bbox.extents().length();ioCamera.setHeight(boxMaxLen);ioCamera.setWidth(boxMaxLen*ratio);this.setCamera(ioCamera,400);return[2]}})})};eDwViewMgr.prototype.onCameraUpdate=function(){this.mViewAnimationIndex+=1;if(this.mViewAnimationIndex>=eDwViewMgr.viewAnimations.length){this.mViewAnimationIndex=0;this.mViewAnimationActive=false;this.stop()}if(this.mViewAnimationActive){this.animateNextView()}};eDwViewMgr.prototype.animateNextView=function(){var _this=this;if(this.mViewAnimationActive){this.setViewOrientation(eDwViewMgr.viewAnimations[this.mViewAnimationIndex],2e3);var self_1=this;this.mAnimationTimeOutID=window.setTimeout(function(){_this.onCameraUpdate()},2e3)}};eDwViewMgr.viewAnimations=[Communicator.ViewOrientation.Front,Communicator.ViewOrientation.Back,Communicator.ViewOrientation.Left,Communicator.ViewOrientation.Right,Communicator.ViewOrientation.Bottom,Communicator.ViewOrientation.Top,Communicator.ViewOrientation.Iso];return eDwViewMgr}();return eDwViewMgr});define("eDwXSectionMgr",["require","exports","eDwXSectionOperator","eDwGeomUtils","eDwTypes","eDwTypes","eDrawingsBase"],function(require,exports,eDwXSectionOperator,eDwGeomUtils,eDwTypes_27,eDwTypes_28){"use strict";var cSectionCapFaceColor=new eDwTypes_28.HC.Color(128,128,128);var cSectionCapOutlineColor=new eDwTypes_28.HC.Color(255,0,0);var eDwXSectionMgr=function(){function eDwXSectionMgr(iViewer){iViewer.XSectionMgr=this;this.mViewer=iViewer;var xSectionOp=new eDwXSectionOperator(iViewer);this.mXSectionOpID=iViewer.OperatorMgr.registerCustomOperator(xSectionOp);this.HCXSectionMgr=iViewer.HCViewer.getCuttingManager();this.SectionCapVisibility=false;this.mXSectionIndex=eDwTypes_27.SectionPlaneOrientation.XY.Index}eDwXSectionMgr.prototype.unregister=function(){this.mViewer.OperatorMgr.unregisterCustomOperatorByID(this.mXSectionOpID);this.mViewer.XSectionMgr=null};eDwXSectionMgr.prototype.turnOnSectionPlane=function(iOn){if(this.getHCXSection()){if(iOn){var ret=this.mViewer.OperatorMgr.push(this.mXSectionOpID);console.debugLog("Section","Section plane operator push ret = "+ret);this.HCXSectionMgr.setCappingGeometryVisibility(true)}else{var opID=this.mViewer.OperatorMgr.pop();console.debugLog("Section","Popped op ID = "+opID+" xSection op ID = "+this.mXSectionOpID)}}};eDwXSectionMgr.prototype.activateCurrent=function(){this.getHCXSection().activate()};eDwXSectionMgr.prototype.deactivateCurrent=function(){this.getHCXSection().deactivate()};eDwXSectionMgr.prototype.isCurrentActive=function(){return this.getHCXSection().isActive()};Object.defineProperty(eDwXSectionMgr.prototype,"SectionIndex",{get:function(){return this.mXSectionIndex},enumerable:true,configurable:true});eDwXSectionMgr.prototype.setSectionPlane=function(ioSection,iAllowActivation){if(iAllowActivation===void 0){iAllowActivation=true}return __awaiter(this,void 0,void 0,function(){var bbox,bboxExtents,needsActivation,sectionHC,numActive,boxCenter,sectionPlane,minPlanePt,maxPlanePt,vec,centerPt,dir,mirrorPlaneNormal,mirrorPlane,maxOnPlnPt,minOnPlnPt,mirrorPlaneDist,distDir,revDistDir,pts;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.mViewer.getModel().calculateBoundingBox()];case 1:bbox=_a.sent();bboxExtents=bbox.extents();if(!ioSection||bboxExtents.equals(eDwTypes_28.HC.Point3.zero()))return[2];needsActivation=false;sectionHC=this.getHCXSection();if(ioSection.Index!==this.mXSectionIndex){if(sectionHC){needsActivation=sectionHC.isActive();sectionHC.deactivate();this.HCXSectionMgr.refreshPlaneGeometry()}this.mXSectionIndex=ioSection.Index;sectionHC=this.getHCXSection()}numActive=this.HCXSectionMgr.getActiveCuttingSectionCount();boxCenter=bbox.center();if(sectionHC.getCount()<1){sectionPlane=ioSection.Plane.copy();sectionPlane.d=-sectionPlane.distanceToPoint(boxCenter);minPlanePt=eDwGeomUtils.dropPointOnPlane(bbox.min,sectionPlane);maxPlanePt=eDwGeomUtils.dropPointOnPlane(bbox.max,sectionPlane);vec=maxPlanePt.copy().subtract(minPlanePt);vec=vec.scale(.55);centerPt=eDwGeomUtils.dropPointOnPlane(boxCenter,sectionPlane);dir=sectionPlane.normal.copy();centerPt=centerPt.add(dir.scale(sectionPlane.d));mirrorPlaneNormal=eDwTypes_28.HC.Point3.zero();eDwTypes_28.HC.MeasureUtils.oneVectorCross(sectionPlane.normal.copy(),mirrorPlaneNormal);mirrorPlane=eDwTypes_28.HC.Plane.createFromPointAndNormal(centerPt,mirrorPlaneNormal);maxOnPlnPt=eDwTypes_28.HC.Point3.add(centerPt,vec);minOnPlnPt=eDwTypes_28.HC.Point3.add(centerPt,vec.scale(-1));mirrorPlaneDist=mirrorPlane.distanceToPoint(maxOnPlnPt);distDir=mirrorPlaneNormal.copy().scale(2*mirrorPlaneDist);revDistDir=distDir.copy().scale(-1);pts=[];pts.push(minOnPlnPt);pts.push(eDwTypes_28.HC.Point3.add(maxOnPlnPt,revDistDir));pts.push(maxOnPlnPt);pts.push(eDwTypes_28.HC.Point3.add(minOnPlnPt,distDir));sectionHC=this.getHCXSection();sectionHC.addPlane(sectionPlane,pts);sectionHC.setColor(eDwTypes_28.HC.Color.createFromFloat(0,1,0));sectionHC.setTransparency(.3);needsActivation=true}if(sectionHC&&needsActivation&&iAllowActivation){sectionHC.activate()}this.HCXSectionMgr.setStandinGeometryPickable(true);return[2]}})})};eDwXSectionMgr.prototype.flipSectionPlane=function(){var sectionHC=this.getHCXSection();if(!sectionHC)return;var sectionPlane=sectionHC.getPlane(0);if(!sectionPlane)return;sectionPlane.normal.negate();sectionPlane.d=-sectionPlane.d;sectionHC.updatePlane(0,sectionPlane)};eDwXSectionMgr.prototype.setViewToSectionPlane=function(){var sectionHC=this.getHCXSection();if(!sectionHC)return null;var sectionPlane=sectionHC.getPlane(0);if(!sectionPlane)return null;return this.mViewer.ViewMgr.setViewOrientationToDirection(sectionPlane.normal.copy())};eDwXSectionMgr.prototype.moveCurrentAlongNormal=function(iDistVec){var camera=this.mViewer.getHCView().getCamera();var camPosition=camera.getPosition();var camTarget=camera.getTarget();var camUp=camera.getUp();var camZ=camTarget.subtract(camPosition);camZ=camZ.normalize();var camY=camUp.normalize();var camX=eDwTypes_28.HC.Point3.cross(camZ,camY);var realVec=camX.scale(iDistVec.x).add(camY.scale(iDistVec.y)).add(camZ.scale(iDistVec.z));var sectionHC=this.getHCXSection();var sectionPlane=sectionHC.getPlane(0);var normal=sectionPlane.normal.copy();normal=normal.normalize();var distance=eDwTypes_28.HC.Point3.dot(realVec,normal);if(Math.abs(distance)<1e-6)return;sectionPlane.d-=distance;sectionHC.updatePlane(0,sectionPlane)};Object.defineProperty(eDwXSectionMgr.prototype,"SectionCapVisibility",{get:function(){return this.mEnableSectionCaps},set:function(iEnable){this.mEnableSectionCaps=iEnable;this.setSectionCapVisibility(iEnable)},enumerable:true,configurable:true});eDwXSectionMgr.prototype.disableSectionCapVisibility=function(iDisable){this.setSectionCapVisibility(iDisable?false:this.mEnableSectionCaps)};eDwXSectionMgr.prototype.projectPoint=function(iPnt){var sectionHC=this.getHCXSection();var sectionPlane=sectionHC.getPlane(0);return eDwGeomUtils.dropPointOnPlane(iPnt,sectionPlane)};eDwXSectionMgr.prototype.getHCXSection=function(){return this.HCXSectionMgr.getCuttingSection(this.mXSectionIndex)};eDwXSectionMgr.prototype.setSectionCapVisibility=function(iEnable){var enable=iEnable;var drawMode=this.mViewer.getDrawMode();if(drawMode!=="Shaded"&&drawMode!=="ShadedWithEdges"){enable=false}this.HCXSectionMgr.setCappingFaceColor(enable?cSectionCapFaceColor:null);this.HCXSectionMgr.setCappingLineColor(enable?null:cSectionCapOutlineColor)};return eDwXSectionMgr}();return eDwXSectionMgr});define("eDwXSectionOperator",["require","exports","eDwTypes","eDwBaseOperator","eDwCommandMgr","eDwMoveSectionPlaneCmd","eDrawingsBase"],function(require,exports,eDwTypes_29,eDwBaseOperator,eDwCommandMgr,eDwMoveSectionPlaneCmd){"use strict";var eDwXSectionOperator=function(_super){__extends(eDwXSectionOperator,_super);function eDwXSectionOperator(iViewer){return _super.call(this,iViewer)||this}eDwXSectionOperator.prototype.onActivate=function(){_super.prototype.onActivate.call(this);this.mViewer.XSectionMgr.activateCurrent()};eDwXSectionOperator.prototype.onDeactivate=function(){this.mViewer.XSectionMgr.deactivateCurrent();_super.prototype.onDeactivate.call(this)};eDwXSectionOperator.prototype.onMouseDown=function(ioMouseEvent){if(!ioMouseEvent||!this.mViewer.XSectionMgr.isCurrentActive()){ioMouseEvent.setHandled(true);return}var selObj=eDwBaseOperator.getPickResult(ioMouseEvent);var selID=selObj.getNodeId();if(!selObj||selObj.getNodeId()>=0){ioMouseEvent.setHandled(false);return}_super.prototype.onMouseDown.call(this,ioMouseEvent);var sectionMgr=this.mViewer.XSectionMgr;sectionMgr.disableSectionCapVisibility(true);if(selObj){var typeOfSel=selObj.getSelectionType();selObj=typeOfSel===eDwTypes_29.HC.SelectionType.None?null:selObj}ioMouseEvent.setHandled(true);var selNodeID=selObj.getNodeId();if(selNodeID){console.debugLog("Section","sel obj = "+JSON.stringify(selObj));var sectionMgrHC=this.mViewer.XSectionMgr.HCXSectionMgr;if(sectionMgrHC.getCuttingSectionFromNodeId(selNodeID)){this.mSectionDragPt=this.screenToWorld(ioMouseEvent.getPosition())}}if(this.mMoveSectionCmd)this.mMoveSectionCmd.cancel();this.mMoveSectionCmd=new eDwMoveSectionPlaneCmd(this.mViewer)};eDwXSectionOperator.prototype.onMouseMove=function(ioMouseEvent){ioMouseEvent.setHandled(false);var crossSectionMgr=this.mViewer.XSectionMgr;if(!crossSectionMgr.isCurrentActive()){return}if(this.mCurMouse&&this.mSectionDragPt){var coords=ioMouseEvent.getPosition();var current=this.screenToWorld(coords);var delta=eDwTypes_29.HC.Point3.subtract(current,this.mSectionDragPt);this.mViewer.XSectionMgr.moveCurrentAlongNormal(delta);this.mSectionDragPt=current;ioMouseEvent.setHandled(true)}};eDwXSectionOperator.prototype.onMouseUp=function(ioMouseEvent){_super.prototype.onMouseUp.call(this,ioMouseEvent);this.mViewer.XSectionMgr.disableSectionCapVisibility(false);ioMouseEvent.setHandled(false);this.mSectionDragPt=null;var cmdMgr=eDwCommandMgr.get();cmdMgr.add(this.mMoveSectionCmd);cmdMgr.remove(this.mMoveSectionCmd,"commit");this.mMoveSectionCmd=null};eDwXSectionOperator.prototype.onTouchStart=function(ioTouchEvent){var _this=this;this.wrapAndCallAsMouseEvent(ioTouchEvent,eDwTypes_29.HC.MouseInputType.Down,function(ioMouseEvent){_this.onMouseDown(ioMouseEvent)})};eDwXSectionOperator.prototype.onTouchMove=function(ioTouchEvent){var _this=this;this.wrapAndCallAsMouseEvent(ioTouchEvent,eDwTypes_29.HC.MouseInputType.Move,function(ioMouseEvent){_this.onMouseMove(ioMouseEvent)})};eDwXSectionOperator.prototype.onTouchEnd=function(ioTouchEvent){var _this=this;this.wrapAndCallAsMouseEvent(ioTouchEvent,eDwTypes_29.HC.MouseInputType.Up,function(ioMouseEvent){_this.onMouseUp(ioMouseEvent)})};eDwXSectionOperator.prototype.needsSelection=function(iEventType){return iEventType===eDwTypes_29.HC.EventType.MouseDown||iEventType===eDwTypes_29.HC.EventType.TouchStart};eDwXSectionOperator.prototype.screenToWorld=function(iScrPt){var view=this.mViewer.getHCView();var normScrPt=view.pointToWindowPosition(iScrPt);var input=new Communicator.Point3(normScrPt.x,normScrPt.y,0);var projMatrix=view.getProjectionMatrix();projMatrix.m[15]=1;var invMat=Communicator.Matrix.inverse(projMatrix).transpose();var worldPt=new Communicator.Point3(0,0,0);var div=input.x*invMat.m[3]+input.y*invMat.m[7]+input.z*invMat.m[11]+invMat.m[15];worldPt.x=(input.x*invMat.m[0]+input.y*invMat.m[1]+input.z*invMat.m[2]+invMat.m[3])/div;worldPt.y=(input.x*invMat.m[4]+input.y*invMat.m[5]+input.z*invMat.m[6]+invMat.m[7])/div;worldPt.z=(input.x*invMat.m[8]+input.y*invMat.m[9]+input.z*invMat.m[10]+invMat.m[11])/div;return worldPt};return eDwXSectionOperator}(eDwBaseOperator);return eDwXSectionOperator});define("eDwZoomToFitCmd",["require","exports","eDwSupportsHistoryCmd"],function(require,exports,eDwSupportsHistoryCmd){"use strict";var eDwZoomToFitCmd=function(_super){__extends(eDwZoomToFitCmd,_super);function eDwZoomToFitCmd(iViewer,iNodeID,iCamera){var _this=_super.call(this,iViewer)||this;_this.mInitialCamera=iCamera.copy();_this.mFinalCamera=iCamera.copy();_this.mNodeHCID=iNodeID;return _this}eDwZoomToFitCmd.prototype.undo=function(){if(!_super.prototype.undo.call(this))return false;this.mViewer.ViewMgr.setCamera(this.mInitialCamera);return true};eDwZoomToFitCmd.prototype.redo=function(){if(!_super.prototype.redo.call(this))return false;this.mViewer.ViewMgr.setCamera(this.mFinalCamera);return true};eDwZoomToFitCmd.prototype.commit=function(){_super.prototype.commit.call(this);this.mViewer.ViewMgr.fitScreenToNodes([this.mNodeHCID],this.mFinalCamera)};Object.defineProperty(eDwZoomToFitCmd.prototype,"Aggregable",{get:function(){return true},enumerable:true,configurable:true});return eDwZoomToFitCmd}(eDwSupportsHistoryCmd);return eDwZoomToFitCmd});requirejs.config({baseUrl:"./js/3rdParty",paths:{eDrawingsBase:"eDrawingsBase.min",jquery:"jquery-2.1.4.min","jquery-ui":"jquery-ui-1.11.4.min","jquery.fullscreen":"jquery.fullscreen.min","jquery.iframe-transport":"jquery.iframe-transport","jquery.fileupload":"jquery.fileupload","solidworks.web":"solidworks.web"},map:{"jquery.fileupload":{"jquery-ui/ui/widget":"jquery-ui"}},shim:{eDrawingsBase:{deps:["jquery"]},"jquery-ui":{deps:["jquery"]},"jquery.fullscreen":{deps:["jquery"]}}});requirejs(["eDrawingsWebViewer"],function(eDwWebViewer){console.excludeDebugLogCategories=["UIEvents","BaseSelOp","Operator"];eDwWebViewer.start()});define("utils",["require","exports"],function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function forAll(iFunc,iDictionary){if(!iDictionary)return;Object.keys(iDictionary).forEach(function(iKeyString){var key=parseInt(iKeyString,10);iFunc(key,iDictionary[key])})}exports.forAll=forAll;function getUint8Array(iBase64EncodedString){var binString=window.atob(iBase64EncodedString);var len=binString.length;var bytes=new Uint8Array(len);for(var i=0;i