[Case 6491] Minor: fixes some coding standard spacing with wantDebug statements.

This commit is contained in:
LaShonda Hopper 2017-09-08 16:31:59 -04:00
parent 2bb76a357a
commit 0deabf54ef

View file

@ -1568,15 +1568,15 @@ SelectionDisplay = (function() {
} }
if (spaceMode != newSpaceMode) { if (spaceMode != newSpaceMode) {
if (wantDebug){ if (wantDebug) {
print(" Updating SpaceMode From: " + spaceMode + " To: " + newSpaceMode); print(" Updating SpaceMode From: " + spaceMode + " To: " + newSpaceMode);
} }
spaceMode = newSpaceMode; spaceMode = newSpaceMode;
that.updateHandles(); that.updateHandles();
} else if(wantDebug){ } else if (wantDebug) {
print("WARNING: entitySelectionTool.setSpaceMode - Can't update SpaceMode. CurrentMode: " + spaceMode + " DesiredMode: " + newSpaceMode); print("WARNING: entitySelectionTool.setSpaceMode - Can't update SpaceMode. CurrentMode: " + spaceMode + " DesiredMode: " + newSpaceMode);
} }
if(wantDebug) { if (wantDebug) {
print("====== SetSpaceMode called. <========"); print("====== SetSpaceMode called. <========");
} }
}; };
@ -1584,21 +1584,21 @@ SelectionDisplay = (function() {
// FUNCTION: TOGGLE SPACE MODE // FUNCTION: TOGGLE SPACE MODE
that.toggleSpaceMode = function() { that.toggleSpaceMode = function() {
var wantDebug = false; var wantDebug = false;
if (wantDebug){ if (wantDebug) {
print("========> ToggleSpaceMode called. ========="); print("========> ToggleSpaceMode called. =========");
} }
if (spaceMode == SPACE_WORLD && SelectionManager.selections.length > 1) { if (spaceMode == SPACE_WORLD && SelectionManager.selections.length > 1) {
if (wantDebug){ if (wantDebug) {
print("Local space editing is not available with multiple selections"); print("Local space editing is not available with multiple selections");
} }
return; return;
} }
if(wantDebug) { if (wantDebug) {
print( "PreToggle: " + spaceMode); print( "PreToggle: " + spaceMode);
} }
spaceMode = spaceMode == SPACE_LOCAL ? SPACE_WORLD : SPACE_LOCAL; spaceMode = spaceMode == SPACE_LOCAL ? SPACE_WORLD : SPACE_LOCAL;
that.updateHandles(); that.updateHandles();
if (wantDebug){ if (wantDebug) {
print( "PostToggle: " + spaceMode); print( "PostToggle: " + spaceMode);
print("======== ToggleSpaceMode called. <========="); print("======== ToggleSpaceMode called. <=========");
} }
@ -1611,7 +1611,7 @@ SelectionDisplay = (function() {
// FUNCTION: UPDATE HANDLES // FUNCTION: UPDATE HANDLES
that.updateHandles = function() { that.updateHandles = function() {
var wantDebug = false; var wantDebug = false;
if(wantDebug){ if (wantDebug) {
print( "======> Update Handles =======" ); print( "======> Update Handles =======" );
print( " Selections Count: " + SelectionManager.selections.length ); print( " Selections Count: " + SelectionManager.selections.length );
print( " SpaceMode: " + spaceMode ); print( " SpaceMode: " + spaceMode );
@ -1855,7 +1855,7 @@ SelectionDisplay = (function() {
var stretchHandlesVisible = !(inModeRotate || inModeTranslate) && (spaceMode == SPACE_LOCAL); var stretchHandlesVisible = !(inModeRotate || inModeTranslate) && (spaceMode == SPACE_LOCAL);
var extendedStretchHandlesVisible = (stretchHandlesVisible && showExtendedStretchHandles); var extendedStretchHandlesVisible = (stretchHandlesVisible && showExtendedStretchHandles);
var cloneHandleVisible = !(inModeRotate || inModeTranslate); var cloneHandleVisible = !(inModeRotate || inModeTranslate);
if(wantDebug){ if (wantDebug) {
print(" Set Non-Light Grabbers Visible - Norm: " + stretchHandlesVisible + " Ext: " + extendedStretchHandlesVisible); print(" Set Non-Light Grabbers Visible - Norm: " + stretchHandlesVisible + " Ext: " + extendedStretchHandlesVisible);
} }
var isSingleSelection = (selectionManager.selections.length == 1); var isSingleSelection = (selectionManager.selections.length == 1);
@ -1864,13 +1864,13 @@ SelectionDisplay = (function() {
var properties = Entities.getEntityProperties(selectionManager.selections[0]); var properties = Entities.getEntityProperties(selectionManager.selections[0]);
var isLightSelection = (properties.type == "Light"); var isLightSelection = (properties.type == "Light");
if ( isLightSelection ) { if ( isLightSelection ) {
if(wantDebug){ if (wantDebug) {
print(" Light Selection revoking Non-Light Grabbers Visibility!"); print(" Light Selection revoking Non-Light Grabbers Visibility!");
} }
stretchHandlesVisible = false; stretchHandlesVisible = false;
extendedStretchHandlesVisible = false; extendedStretchHandlesVisible = false;
cloneHandleVisible = false; cloneHandleVisible = false;
if(properties.isSpotlight) { if (properties.isSpotlight) {
that.setPointLightHandlesVisible( false ); that.setPointLightHandlesVisible( false );
var distance = (properties.dimensions.z / 2) * Math.sin(properties.cutoff * (Math.PI / 180)); var distance = (properties.dimensions.z / 2) * Math.sin(properties.cutoff * (Math.PI / 180));
@ -2247,13 +2247,13 @@ SelectionDisplay = (function() {
rotation: Quat.fromPitchYawRollDegrees(90, 0, 0), rotation: Quat.fromPitchYawRollDegrees(90, 0, 0),
}); });
if(wantDebug){ if (wantDebug) {
print( "====== Update Handles <=======" ); print( "====== Update Handles <=======" );
} }
}; };
function helperSetOverlaysVisibility( handleArray, isVisible ){ function helperSetOverlaysVisibility( handleArray, isVisible ) {
var numHandles = handleArray.length; var numHandles = handleArray.length;
var visibilityUpdate = { visible: isVisible }; var visibilityUpdate = { visible: isVisible };
for (var handleIndex = 0; handleIndex < numHandles; ++handleIndex) { for (var handleIndex = 0; handleIndex < numHandles; ++handleIndex) {
@ -2289,7 +2289,7 @@ SelectionDisplay = (function() {
that.setGrabberToolsVisible = function(isVisible) { that.setGrabberToolsVisible = function(isVisible) {
var visibilityUpdate = { visible: isVisible }; var visibilityUpdate = { visible: isVisible };
for ( var toolKey in grabberTools ) { for ( var toolKey in grabberTools ) {
if ( ! grabberTools.hasOwnProperty( toolKey ) ){ if ( ! grabberTools.hasOwnProperty( toolKey ) ) {
//--EARLY ITERATION EXIT--( On to the next one ) //--EARLY ITERATION EXIT--( On to the next one )
continue; continue;
} }
@ -2327,7 +2327,7 @@ SelectionDisplay = (function() {
startingElevation: 0.0, startingElevation: 0.0,
onBegin: function(event, pickRay, pickResult, doClone) { onBegin: function(event, pickRay, pickResult, doClone) {
var wantDebug = false; var wantDebug = false;
if(wantDebug){ if (wantDebug) {
print("================== TRANSLATE_XZ(Beg) -> ======================="); print("================== TRANSLATE_XZ(Beg) -> =======================");
Vec3.print(" pickRay", pickRay); Vec3.print(" pickRay", pickRay);
Vec3.print(" pickRay.origin", pickRay.origin); Vec3.print(" pickRay.origin", pickRay.origin);
@ -2377,7 +2377,7 @@ SelectionDisplay = (function() {
} }
isConstrained = false; isConstrained = false;
if(wantDebug){ if (wantDebug) {
print("================== TRANSLATE_XZ(End) <- ======================="); print("================== TRANSLATE_XZ(End) <- =======================");
} }
}, },
@ -3076,7 +3076,7 @@ SelectionDisplay = (function() {
function cutoffStretchFunc(vector, change) { function cutoffStretchFunc(vector, change) {
vector = change; vector = change;
var wantDebug = false; var wantDebug = false;
if (wantDebug){ if (wantDebug) {
Vec3.print("Radius stretch: ", vector); Vec3.print("Radius stretch: ", vector);
} }
var length = vector.x + vector.y + vector.z; var length = vector.x + vector.y + vector.z;
@ -3533,7 +3533,7 @@ SelectionDisplay = (function() {
// FUNCTION: UPDATE ROTATION DEGREES OVERLAY // FUNCTION: UPDATE ROTATION DEGREES OVERLAY
function updateRotationDegreesOverlay(angleFromZero, handleRotation, centerPosition) { function updateRotationDegreesOverlay(angleFromZero, handleRotation, centerPosition) {
var wantDebug = false; var wantDebug = false;
if(wantDebug){ if (wantDebug) {
print( "---> updateRotationDegreesOverlay ---" ); print( "---> updateRotationDegreesOverlay ---" );
print(" AngleFromZero: " + angleFromZero ); print(" AngleFromZero: " + angleFromZero );
print(" HandleRotation - X: " + handleRotation.x + " Y: " + handleRotation.y + " Z: " + handleRotation.z ); print(" HandleRotation - X: " + handleRotation.x + " Y: " + handleRotation.y + " Z: " + handleRotation.z );
@ -3546,7 +3546,7 @@ SelectionDisplay = (function() {
y: Math.sin(angle) * outerRadius * ROTATION_DISPLAY_DISTANCE_MULTIPLIER, y: Math.sin(angle) * outerRadius * ROTATION_DISPLAY_DISTANCE_MULTIPLIER,
z: 0, z: 0,
}; };
if(wantDebug){ if (wantDebug) {
print(" Angle: " + angle ); print(" Angle: " + angle );
print(" InitialPos: " + position.x + ", " + position.y + ", " + position.z); print(" InitialPos: " + position.x + ", " + position.y + ", " + position.z);
} }
@ -3562,7 +3562,7 @@ SelectionDisplay = (function() {
lineHeight: innerRadius * ROTATION_DISPLAY_LINE_HEIGHT_MULTIPLIER, lineHeight: innerRadius * ROTATION_DISPLAY_LINE_HEIGHT_MULTIPLIER,
text: normalizeDegrees(angleFromZero) + "°", text: normalizeDegrees(angleFromZero) + "°",
}; };
if(wantDebug){ if (wantDebug) {
print(" TranslatedPos: " + position.x + ", " + position.y + ", " + position.z); print(" TranslatedPos: " + position.x + ", " + position.y + ", " + position.z);
print(" OverlayDim - X: " + overlayProps.dimensions.x + " Y: " + overlayProps.dimensions.y + " Z: " + overlayProps.dimensions.z ); print(" OverlayDim - X: " + overlayProps.dimensions.x + " Y: " + overlayProps.dimensions.y + " Z: " + overlayProps.dimensions.z );
print(" OverlayLineHeight: " + overlayProps.lineHeight ); print(" OverlayLineHeight: " + overlayProps.lineHeight );
@ -3570,7 +3570,7 @@ SelectionDisplay = (function() {
} }
Overlays.editOverlay(rotationDegreesDisplay, overlayProps); Overlays.editOverlay(rotationDegreesDisplay, overlayProps);
if (wantDebug){ if (wantDebug) {
print( "<--- updateRotationDegreesOverlay ---" ); print( "<--- updateRotationDegreesOverlay ---" );
} }
} }
@ -3899,10 +3899,10 @@ SelectionDisplay = (function() {
var intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludes, overlayExcludes); var intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludes, overlayExcludes);
if (wantDebug) { if (wantDebug) {
if ( ! overlayIncludes ){ if ( ! overlayIncludes ) {
print("testRayIntersect - no overlayIncludes provided."); print("testRayIntersect - no overlayIncludes provided.");
} }
if ( ! overlayExcludes ){ if ( ! overlayExcludes ) {
print("testRayIntersect - no overlayExcludes provided."); print("testRayIntersect - no overlayExcludes provided.");
} }
print("testRayIntersect - Hit: " + intersectObj.intersects); print("testRayIntersect - Hit: " + intersectObj.intersects);
@ -3940,7 +3940,7 @@ SelectionDisplay = (function() {
activeTool = null; activeTool = null;
var results = testRayIntersect( pickRay, interactiveOverlays ); var results = testRayIntersect( pickRay, interactiveOverlays );
if ( results.intersects ){ if ( results.intersects ) {
var hitOverlayID = results.overlayID; var hitOverlayID = results.overlayID;
if ( (hitOverlayID == HMD.tabletID) || (hitOverlayID == HMD.tabletScreenID) || (hitOverlayID == HMD.homeButtonID) ) { if ( (hitOverlayID == HMD.tabletID) || (hitOverlayID == HMD.tabletScreenID) || (hitOverlayID == HMD.homeButtonID) ) {
//--EARLY EXIT-(mouse clicks on the tablet should override the edit affordances) //--EARLY EXIT-(mouse clicks on the tablet should override the edit affordances)
@ -3959,7 +3959,7 @@ SelectionDisplay = (function() {
} }
} else { } else {
print("ERROR: entitySelectionTool.mousePressEvent - Hit unexpected object, check interactiveOverlays"); print("ERROR: entitySelectionTool.mousePressEvent - Hit unexpected object, check interactiveOverlays");
}//--End_if( hitTool ) }//--End_if ( hitTool )
}//--End_If( results.intersects ) }//--End_If( results.intersects )
if (wantDebug) { if (wantDebug) {
@ -3975,7 +3975,7 @@ SelectionDisplay = (function() {
// FUNCTION: MOUSE MOVE EVENT // FUNCTION: MOUSE MOVE EVENT
that.mouseMoveEvent = function(event) { that.mouseMoveEvent = function(event) {
var wantDebug = false; var wantDebug = false;
if(wantDebug){ if (wantDebug) {
print( "=============== eST::MouseMoveEvent BEG ======================="); print( "=============== eST::MouseMoveEvent BEG =======================");
} }
if (activeTool) { if (activeTool) {
@ -4115,7 +4115,7 @@ SelectionDisplay = (function() {
} }
} }
if(wantDebug){ if (wantDebug) {
print("=============== eST::MouseMoveEvent END ======================="); print("=============== eST::MouseMoveEvent END =======================");
} }
return false; return false;
@ -4124,24 +4124,24 @@ SelectionDisplay = (function() {
// FUNCTION: MOUSE RELEASE EVENT // FUNCTION: MOUSE RELEASE EVENT
that.mouseReleaseEvent = function(event) { that.mouseReleaseEvent = function(event) {
var wantDebug = false; var wantDebug = false;
if(wantDebug){ if (wantDebug) {
print("=============== eST::MouseReleaseEvent BEG ======================="); print("=============== eST::MouseReleaseEvent BEG =======================");
} }
var showHandles = false; var showHandles = false;
if (activeTool) { if (activeTool) {
if( activeTool.onEnd ) { if ( activeTool.onEnd ) {
if(wantDebug){ if (wantDebug) {
print(" Triggering ActiveTool( " + activeTool.mode + " )'s onEnd"); print(" Triggering ActiveTool( " + activeTool.mode + " )'s onEnd");
} }
activeTool.onEnd(event); activeTool.onEnd(event);
}else if(wantDebug){ }else if (wantDebug) {
print(" ActiveTool( " + activeTool.mode + " )'s missing onEnd"); print(" ActiveTool( " + activeTool.mode + " )'s missing onEnd");
} }
} }
// hide our rotation overlays..., and show our handles // hide our rotation overlays..., and show our handles
if ( isActiveTool(yawHandle) || isActiveTool(pitchHandle) || isActiveTool(rollHandle)) { if ( isActiveTool(yawHandle) || isActiveTool(pitchHandle) || isActiveTool(rollHandle)) {
if(wantDebug){ if (wantDebug) {
print(" Triggering hide of RotateOverlays"); print(" Triggering hide of RotateOverlays");
} }
Overlays.editOverlay(rotateOverlayInner, { Overlays.editOverlay(rotateOverlayInner, {
@ -4162,14 +4162,14 @@ SelectionDisplay = (function() {
// if something is selected, then reset the "original" properties for any potential next click+move operation // if something is selected, then reset the "original" properties for any potential next click+move operation
if (SelectionManager.hasSelection()) { if (SelectionManager.hasSelection()) {
if (showHandles) { if (showHandles) {
if(wantDebug){ if (wantDebug) {
print(" Triggering that.select"); print(" Triggering that.select");
} }
that.select(SelectionManager.selections[0], event); that.select(SelectionManager.selections[0], event);
} }
} }
if(wantDebug){ if (wantDebug) {
print("=============== eST::MouseReleaseEvent END ======================="); print("=============== eST::MouseReleaseEvent END =======================");
} }
}; };