提交 359acf03 编写于 作者: M Mr.doob

Merge pull request #7400 from lxxxvi/dev

Renaming of commands (aesthetics)
...@@ -12,7 +12,7 @@ It would also be possible to only store the difference between the old and the n ...@@ -12,7 +12,7 @@ It would also be possible to only store the difference between the old and the n
**Before implementing your own command you should look if you can't reuse one of the already existing ones.** **Before implementing your own command you should look if you can't reuse one of the already existing ones.**
For numbers, strings or booleans the CmdSet...Value-commands can be used. For numbers, strings or booleans the Set...ValueCommand-commands can be used.
Then there are separate commands for: Then there are separate commands for:
- setting a color property (THREE.Color) - setting a color property (THREE.Color)
- setting maps (THREE.Texture) - setting maps (THREE.Texture)
...@@ -26,12 +26,12 @@ Every command needs a constructor. In the constructor ...@@ -26,12 +26,12 @@ Every command needs a constructor. In the constructor
```javascript ```javascript
CmdXXX = function () { var DoSomethingCommand = function () {
Cmd.call( this ); // Required: Call default constructor Command.call( this ); // Required: Call default constructor
this.type = 'CmdXXX'; // Required: has to match the object-name! this.type = 'DoSomethingCommand'; // Required: has to match the object-name!
this.name = 'Set/Do/Update XXX'; // Required: description of the command, used in Sidebar.History this.name = 'Set/Do/Update Something'; // Required: description of the command, used in Sidebar.History
// TODO: store all the relevant information needed to // TODO: store all the relevant information needed to
// restore the old and the new state // restore the old and the new state
...@@ -46,7 +46,7 @@ And as part of the prototype you need to implement four functions ...@@ -46,7 +46,7 @@ And as part of the prototype you need to implement four functions
- **fromJSON:** which deserializes the command - **fromJSON:** which deserializes the command
```javascript ```javascript
CmdXXX.prototype = { DoSomethingCommand.prototype = {
execute: function () { execute: function () {
...@@ -62,21 +62,21 @@ CmdXXX.prototype = { ...@@ -62,21 +62,21 @@ CmdXXX.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); // Required: Call 'toJSON'-method of prototype 'Cmd' var output = Command.prototype.toJSON.call( this ); // Required: Call 'toJSON'-method of prototype 'Command'
// TODO: serialize all the necessary information as part of 'output' (JSON-format) // TODO: serialize all the necessary information as part of 'output' (JSON-format)
// so that it can be restored in 'fromJSON' // so that it can be restored in 'fromJSON'
return output; return output;
}, },
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); // Required: Call 'fromJSON'-method of prototype 'Cmd' Command.prototype.fromJSON.call( this, json ); // Required: Call 'fromJSON'-method of prototype 'Command'
// TODO: restore command from json // TODO: restore command from json
} }
}; };
...@@ -89,9 +89,9 @@ To execute a command we need an instance of the main editor-object. The editor-o ...@@ -89,9 +89,9 @@ To execute a command we need an instance of the main editor-object. The editor-o
On **editor** we then call **.execute(...)*** with the new command-object which in turn calls **history.execute(...)** and adds the command to the undo-stack. On **editor** we then call **.execute(...)*** with the new command-object which in turn calls **history.execute(...)** and adds the command to the undo-stack.
```javascript ```javascript
editor.execute( new CmdXXX() ); editor.execute( new DoSomethingCommand() );
``` ```
### Updatable commands ### ### Updatable commands ###
...@@ -99,7 +99,7 @@ editor.execute( new CmdXXX() ); ...@@ -99,7 +99,7 @@ editor.execute( new CmdXXX() );
Some commands are also **updatable**. By default a command is not updatable. Making a command updatable means that you Some commands are also **updatable**. By default a command is not updatable. Making a command updatable means that you
have to implement a fifth function 'update' as part of the prototype. In it only the 'new' state gets updated while the old one stays the same. have to implement a fifth function 'update' as part of the prototype. In it only the 'new' state gets updated while the old one stays the same.
Here as an example is the update-function of **CmdSetColor**: Here as an example is the update-function of **SetColorCommand**:
```javascript ```javascript
update: function ( cmd ) { update: function ( cmd ) {
...@@ -112,15 +112,15 @@ update: function ( cmd ) { ...@@ -112,15 +112,15 @@ update: function ( cmd ) {
#### List of updatable commands #### List of updatable commands
- CmdSetColor - SetColorCommand
- CmdSetGeometry - SetGeometryCommand
- CmdSetMaterialColor - SetMaterialColorCommand
- CmdSetMaterialValue - SetMaterialValueCommand
- CmdSetPosition - SetPositionCommand
- CmdSetRotation - SetRotationCommand
- CmdSetScale - SetScaleCommand
- CmdSetValue - SetValueCommand
- CmdSetScriptValue - SetScriptValueCommand
The idea behind 'updatable commands' is that two commands of the same type which occur The idea behind 'updatable commands' is that two commands of the same type which occur
within a short period of time should be merged into one. within a short period of time should be merged into one.
......
...@@ -16,19 +16,19 @@ Each of the listed steps will now be described in detail. ...@@ -16,19 +16,19 @@ Each of the listed steps will now be described in detail.
### 1. Create a new unit test file ### ### 1. Create a new unit test file ###
Create a new file in path `test/unit/editor/TestCmdXXX.js`. Create a new file in path `test/unit/editor/TestDoSomethingCommand.js`.
### 2. Include the new command in the editor test suite ### ### 2. Include the new command in the editor test suite ###
Navigate to the editor test suite `test/unit/unittests_editor.html` and open it. Navigate to the editor test suite `test/unit/unittests_editor.html` and open it.
Within the file, go to the `<!-- command object classes -->` and include the new command: Within the file, go to the `<!-- command object classes -->` and include the new command:
```javascript ```html
// <!-- command object classes --> // <!-- command object classes -->
//... //...
<script src="../../editor/js/CmdSetUuid.js"></script> <script src="../../editor/js/commands/AddScriptCommand.js"></script>
<script src="../../editor/js/CmdSetValue.js"></script> <script src="../../editor/js/commands/DoSomethingCommand.js"></script> // add this line
<script src="../../editor/js/CmdXXX.js"></script> // add this line <script src="../../editor/js/commands/MoveObjectCommand.js"></script>
//... //...
``` ```
...@@ -36,12 +36,12 @@ It is recommended to keep the script inclusions in alphabetical order, if possib ...@@ -36,12 +36,12 @@ It is recommended to keep the script inclusions in alphabetical order, if possib
Next, in the same file, go to `<!-- Undo-Redo tests -->` and include the test file for the new command: Next, in the same file, go to `<!-- Undo-Redo tests -->` and include the test file for the new command:
```javascript ```html
// <!-- Undo-Redo tests --> // <!-- Undo-Redo tests -->
//... //...
<script src="editor/TestCmdSetValue.js"></script> <script src="editor/TestAddScriptCommand.js"></script>
<script src="editor/TestCmdXXX.js"></script> // add this line <script src="editor/TestDoSomethingCommand.js"></script> // add this line
<script src="editor/TestNestedDoUndoRedo.js"></script> <script src="editor/TestMoveObjectCommand.js"></script>
//... //...
``` ```
...@@ -51,12 +51,12 @@ Again, keeping the alphabetical order is recommended. ...@@ -51,12 +51,12 @@ Again, keeping the alphabetical order is recommended.
#### Template #### #### Template ####
Open the unit test file `test/unit/editor/TestCmdXXX.js` and paste following code: Open the unit test file `test/unit/editor/TestDoSomethingCommand.js` and paste following code:
```javascript ```javascript
module( "CmdXXX" ); module( "DoSomethingCommand" );
test("Test CmdXXX (Undo and Redo)", function() { test("Test DoSomethingCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
...@@ -68,19 +68,19 @@ test("Test CmdXXX (Undo and Redo)", function() { ...@@ -68,19 +68,19 @@ test("Test CmdXXX (Undo and Redo)", function() {
// var perspectiveCamera = aPerspectiveCamera( 'Name your perspectiveCamera' ); // var perspectiveCamera = aPerspectiveCamera( 'Name your perspectiveCamera' );
// in most cases you'll need to add the object to work with // in most cases you'll need to add the object to work with
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
// your test begins here... // your test begins here...
}); } );
``` ```
The predefined code is just meant to ease the development, you do not have to stick with it. The predefined code is just meant to ease the development, you do not have to stick with it.
However, the test should cover at least one `editor.execute()`, one `editor.undo()` and one `editor.redo()` call. However, the test should cover at least one `editor.execute()`, one `editor.undo()` and one `editor.redo()` call.
Best practice is to call `editor.execute( new CmdXXX( {custom parameters} ) )` **twice**. Since you'll have to do one undo (go one step back), it is recommended to have a custom state for comparison. Try to avoid assertions `ok()` against default values. Best practice is to call `editor.execute( new DoSomethingCommand( {custom parameters} ) )` **twice**. Since you'll have to do one undo (go one step back), it is recommended to have a custom state for comparison. Try to avoid assertions `ok()` against default values.
#### Assertions #### #### Assertions ####
After performing `editor.execute()` twice, you can do your first assertion to check whether the executes are done correctly. After performing `editor.execute()` twice, you can do your first assertion to check whether the executes are done correctly.
......
...@@ -124,27 +124,27 @@ ...@@ -124,27 +124,27 @@
<script src="js/Toolbar.js"></script> <script src="js/Toolbar.js"></script>
<script src="js/Viewport.js"></script> <script src="js/Viewport.js"></script>
<script src="js/Viewport.Info.js"></script> <script src="js/Viewport.Info.js"></script>
<script src="js/Cmd.js"></script> <script src="js/Command.js"></script>
<script src="js/CmdAddObject.js"></script> <script src="js/commands/AddObjectCommand.js"></script>
<script src="js/CmdRemoveObject.js"></script> <script src="js/commands/RemoveObjectCommand.js"></script>
<script src="js/CmdMoveObject.js"></script> <script src="js/commands/MoveObjectCommand.js"></script>
<script src="js/CmdSetPosition.js"></script> <script src="js/commands/SetPositionCommand.js"></script>
<script src="js/CmdSetRotation.js"></script> <script src="js/commands/SetRotationCommand.js"></script>
<script src="js/CmdSetScale.js"></script> <script src="js/commands/SetScaleCommand.js"></script>
<script src="js/CmdSetValue.js"></script> <script src="js/commands/SetValueCommand.js"></script>
<script src="js/CmdSetUuid.js"></script> <script src="js/commands/SetUuidCommand.js"></script>
<script src="js/CmdSetColor.js"></script> <script src="js/commands/SetColorCommand.js"></script>
<script src="js/CmdSetGeometry.js"></script> <script src="js/commands/SetGeometryCommand.js"></script>
<script src="js/CmdSetGeometryValue.js"></script> <script src="js/commands/SetGeometryValueCommand.js"></script>
<script src="js/CmdMultiCmds.js"></script> <script src="js/commands/MultiCmdsCommand.js"></script>
<script src="js/CmdAddScript.js"></script> <script src="js/commands/AddScriptCommand.js"></script>
<script src="js/CmdRemoveScript.js"></script> <script src="js/commands/RemoveScriptCommand.js"></script>
<script src="js/CmdSetScriptValue.js"></script> <script src="js/commands/SetScriptValueCommand.js"></script>
<script src="js/CmdSetMaterial.js"></script> <script src="js/commands/SetMaterialCommand.js"></script>
<script src="js/CmdSetMaterialValue.js"></script> <script src="js/commands/SetMaterialValueCommand.js"></script>
<script src="js/CmdSetMaterialColor.js"></script> <script src="js/commands/SetMaterialColorCommand.js"></script>
<script src="js/CmdSetMaterialMap.js"></script> <script src="js/commands/SetMaterialMapCommand.js"></script>
<script src="js/CmdSetScene.js"></script> <script src="js/commands/SetSceneCommand.js"></script>
<script> <script>
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
if ( confirm( 'Delete ' + object.name + '?' ) === false ) return; if ( confirm( 'Delete ' + object.name + '?' ) === false ) return;
var parent = object.parent; var parent = object.parent;
if ( parent !== null ) editor.execute( new CmdRemoveObject( object ) ); if ( parent !== null ) editor.execute( new RemoveObjectCommand( object ) );
break; break;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* @constructor * @constructor
*/ */
Cmd = function ( editorRef ) { var Command = function ( editorRef ) {
this.id = - 1; this.id = - 1;
this.inMemory = false; this.inMemory = false;
...@@ -19,15 +19,15 @@ Cmd = function ( editorRef ) { ...@@ -19,15 +19,15 @@ Cmd = function ( editorRef ) {
if ( editorRef !== undefined ) { if ( editorRef !== undefined ) {
Cmd.editor = editorRef; Command.editor = editorRef;
} }
this.editor = Cmd.editor; this.editor = Command.editor;
}; };
Cmd.prototype.toJSON = function () { Command.prototype.toJSON = function () {
var output = {}; var output = {};
output.type = this.type; output.type = this.type;
...@@ -37,7 +37,7 @@ Cmd.prototype.toJSON = function () { ...@@ -37,7 +37,7 @@ Cmd.prototype.toJSON = function () {
}; };
Cmd.prototype.fromJSON = function ( json ) { Command.prototype.fromJSON = function ( json ) {
this.inMemory = true; this.inMemory = true;
this.type = json.type; this.type = json.type;
......
...@@ -14,9 +14,9 @@ History = function ( editor ) { ...@@ -14,9 +14,9 @@ History = function ( editor ) {
this.historyDisabled = false; this.historyDisabled = false;
this.config = editor.config; this.config = editor.config;
//Set editor-reference in Cmd //Set editor-reference in Command
Cmd( editor ); Command( editor );
// signals // signals
...@@ -51,9 +51,9 @@ History.prototype = { ...@@ -51,9 +51,9 @@ History.prototype = {
lastCmd.script === cmd.script && lastCmd.script === cmd.script &&
lastCmd.attributeName === cmd.attributeName; lastCmd.attributeName === cmd.attributeName;
if ( isUpdatableCmd && cmd.type === "CmdSetScriptValue" ) { if ( isUpdatableCmd && cmd.type === "SetScriptValueCommand" ) {
// When the cmd.type is "CmdSetScriptValue" the timeDifference is ignored // When the cmd.type is "SetScriptValueCommand" the timeDifference is ignored
lastCmd.update( cmd ); lastCmd.update( cmd );
cmd = lastCmd; cmd = lastCmd;
......
...@@ -24,7 +24,7 @@ var Loader = function ( editor ) { ...@@ -24,7 +24,7 @@ var Loader = function ( editor ) {
var loader = new THREE.AMFLoader(); var loader = new THREE.AMFLoader();
var amfobject = loader.parse( event.target.result ); var amfobject = loader.parse( event.target.result );
editor.execute( new CmdAddObject( amfobject ) ); editor.execute( new AddObjectCommand( amfobject ) );
}, false ); }, false );
reader.readAsArrayBuffer( file ); reader.readAsArrayBuffer( file );
...@@ -39,7 +39,7 @@ var Loader = function ( editor ) { ...@@ -39,7 +39,7 @@ var Loader = function ( editor ) {
var loader = new THREE.AWDLoader(); var loader = new THREE.AWDLoader();
var scene = loader.parse( event.target.result ); var scene = loader.parse( event.target.result );
editor.execute( new CmdSetScene( scene ) ); editor.execute( new SetSceneCommand( scene ) );
}, false ); }, false );
reader.readAsArrayBuffer( file ); reader.readAsArrayBuffer( file );
...@@ -57,7 +57,7 @@ var Loader = function ( editor ) { ...@@ -57,7 +57,7 @@ var Loader = function ( editor ) {
var loader = new THREE.BabylonLoader(); var loader = new THREE.BabylonLoader();
var scene = loader.parse( json ); var scene = loader.parse( json );
editor.execute( new CmdSetScene( scene ) ); editor.execute( new SetSceneCommand( scene ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -80,7 +80,7 @@ var Loader = function ( editor ) { ...@@ -80,7 +80,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -108,7 +108,7 @@ var Loader = function ( editor ) { ...@@ -108,7 +108,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
...@@ -129,7 +129,7 @@ var Loader = function ( editor ) { ...@@ -129,7 +129,7 @@ var Loader = function ( editor ) {
collada.scene.name = filename; collada.scene.name = filename;
editor.execute( new CmdAddObject( collada.scene ) ); editor.execute( new AddObjectCommand( collada.scene ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -204,7 +204,7 @@ var Loader = function ( editor ) { ...@@ -204,7 +204,7 @@ var Loader = function ( editor ) {
collada.scene.name = filename; collada.scene.name = filename;
editor.execute( new CmdAddObject( collada.scene ) ); editor.execute( new AddObjectCommand( collada.scene ) );
}, false ); }, false );
reader.readAsArrayBuffer( file ); reader.readAsArrayBuffer( file );
...@@ -228,7 +228,7 @@ var Loader = function ( editor ) { ...@@ -228,7 +228,7 @@ var Loader = function ( editor ) {
mesh.mixer = new THREE.AnimationMixer( mesh ) mesh.mixer = new THREE.AnimationMixer( mesh )
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
}, false ); }, false );
reader.readAsArrayBuffer( file ); reader.readAsArrayBuffer( file );
...@@ -245,7 +245,7 @@ var Loader = function ( editor ) { ...@@ -245,7 +245,7 @@ var Loader = function ( editor ) {
var object = new THREE.OBJLoader().parse( contents ); var object = new THREE.OBJLoader().parse( contents );
object.name = filename; object.name = filename;
editor.execute( new CmdAddObject( object ) ); editor.execute( new AddObjectCommand( object ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -263,7 +263,7 @@ var Loader = function ( editor ) { ...@@ -263,7 +263,7 @@ var Loader = function ( editor ) {
var loader = new THREE.PlayCanvasLoader(); var loader = new THREE.PlayCanvasLoader();
var object = loader.parse( json ); var object = loader.parse( json );
editor.execute( new CmdAddObject( object ) ); editor.execute( new AddObjectCommand( object ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -286,7 +286,7 @@ var Loader = function ( editor ) { ...@@ -286,7 +286,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -309,7 +309,7 @@ var Loader = function ( editor ) { ...@@ -309,7 +309,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
}, false ); }, false );
...@@ -338,7 +338,7 @@ var Loader = function ( editor ) { ...@@ -338,7 +338,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
}, false ); }, false );
reader.readAsBinaryString( file ); reader.readAsBinaryString( file );
...@@ -362,7 +362,7 @@ var Loader = function ( editor ) { ...@@ -362,7 +362,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -378,7 +378,7 @@ var Loader = function ( editor ) { ...@@ -378,7 +378,7 @@ var Loader = function ( editor ) {
var result = new THREE.VRMLLoader().parse( contents ); var result = new THREE.VRMLLoader().parse( contents );
editor.execute( new CmdSetScene( result ) ); editor.execute( new SetSceneCommand( result ) );
}, false ); }, false );
reader.readAsText( file ); reader.readAsText( file );
...@@ -422,7 +422,7 @@ var Loader = function ( editor ) { ...@@ -422,7 +422,7 @@ var Loader = function ( editor ) {
var mesh = new THREE.Mesh( result ); var mesh = new THREE.Mesh( result );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} else if ( data.metadata.type.toLowerCase() === 'geometry' ) { } else if ( data.metadata.type.toLowerCase() === 'geometry' ) {
...@@ -469,7 +469,7 @@ var Loader = function ( editor ) { ...@@ -469,7 +469,7 @@ var Loader = function ( editor ) {
mesh.name = filename; mesh.name = filename;
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} else if ( data.metadata.type.toLowerCase() === 'object' ) { } else if ( data.metadata.type.toLowerCase() === 'object' ) {
...@@ -480,11 +480,11 @@ var Loader = function ( editor ) { ...@@ -480,11 +480,11 @@ var Loader = function ( editor ) {
if ( result instanceof THREE.Scene ) { if ( result instanceof THREE.Scene ) {
editor.execute( new CmdSetScene( result ) ); editor.execute( new SetSceneCommand( result ) );
} else { } else {
editor.execute( new CmdAddObject( result ) ); editor.execute( new AddObjectCommand( result ) );
} }
...@@ -495,7 +495,7 @@ var Loader = function ( editor ) { ...@@ -495,7 +495,7 @@ var Loader = function ( editor ) {
var loader = new THREE.SceneLoader(); var loader = new THREE.SceneLoader();
loader.parse( data, function ( result ) { loader.parse( data, function ( result ) {
editor.execute( new CmdSetScene( result.scene ) ); editor.execute( new SetSceneCommand( result.scene ) );
}, '' ); }, '' );
......
...@@ -40,7 +40,7 @@ Menubar.Add = function ( editor ) { ...@@ -40,7 +40,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Group(); var mesh = new THREE.Group();
mesh.name = 'Group ' + ( ++ meshCount ); mesh.name = 'Group ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -67,7 +67,7 @@ Menubar.Add = function ( editor ) { ...@@ -67,7 +67,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.name = 'Plane ' + ( ++ meshCount ); mesh.name = 'Plane ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -91,7 +91,7 @@ Menubar.Add = function ( editor ) { ...@@ -91,7 +91,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'Box ' + ( ++ meshCount ); mesh.name = 'Box ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -110,7 +110,7 @@ Menubar.Add = function ( editor ) { ...@@ -110,7 +110,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'Circle ' + ( ++ meshCount ); mesh.name = 'Circle ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -133,7 +133,7 @@ Menubar.Add = function ( editor ) { ...@@ -133,7 +133,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'Cylinder ' + ( ++ meshCount ); mesh.name = 'Cylinder ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -157,7 +157,7 @@ Menubar.Add = function ( editor ) { ...@@ -157,7 +157,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'Sphere ' + ( ++ meshCount ); mesh.name = 'Sphere ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -176,7 +176,7 @@ Menubar.Add = function ( editor ) { ...@@ -176,7 +176,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'Icosahedron ' + ( ++ meshCount ); mesh.name = 'Icosahedron ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -198,7 +198,7 @@ Menubar.Add = function ( editor ) { ...@@ -198,7 +198,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'Torus ' + ( ++ meshCount ); mesh.name = 'Torus ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -222,7 +222,7 @@ Menubar.Add = function ( editor ) { ...@@ -222,7 +222,7 @@ Menubar.Add = function ( editor ) {
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() ); var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
mesh.name = 'TorusKnot ' + ( ++ meshCount ); mesh.name = 'TorusKnot ' + ( ++ meshCount );
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
} ); } );
options.add( option ); options.add( option );
...@@ -267,7 +267,7 @@ Menubar.Add = function ( editor ) { ...@@ -267,7 +267,7 @@ Menubar.Add = function ( editor ) {
var sprite = new THREE.Sprite( new THREE.SpriteMaterial() ); var sprite = new THREE.Sprite( new THREE.SpriteMaterial() );
sprite.name = 'Sprite ' + ( ++ meshCount ); sprite.name = 'Sprite ' + ( ++ meshCount );
editor.execute( new CmdAddObject( sprite ) ); editor.execute( new AddObjectCommand( sprite ) );
} ); } );
options.add( option ); options.add( option );
...@@ -290,7 +290,7 @@ Menubar.Add = function ( editor ) { ...@@ -290,7 +290,7 @@ Menubar.Add = function ( editor ) {
var light = new THREE.PointLight( color, intensity, distance ); var light = new THREE.PointLight( color, intensity, distance );
light.name = 'PointLight ' + ( ++ lightCount ); light.name = 'PointLight ' + ( ++ lightCount );
editor.execute( new CmdAddObject( light ) ); editor.execute( new AddObjectCommand( light ) );
} ); } );
options.add( option ); options.add( option );
...@@ -314,7 +314,7 @@ Menubar.Add = function ( editor ) { ...@@ -314,7 +314,7 @@ Menubar.Add = function ( editor ) {
light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 ); light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 );
editor.execute( new CmdAddObject( light ) ); editor.execute( new AddObjectCommand( light ) );
} ); } );
options.add( option ); options.add( option );
...@@ -335,7 +335,7 @@ Menubar.Add = function ( editor ) { ...@@ -335,7 +335,7 @@ Menubar.Add = function ( editor ) {
light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 ); light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 );
editor.execute( new CmdAddObject( light ) ); editor.execute( new AddObjectCommand( light ) );
} ); } );
options.add( option ); options.add( option );
...@@ -356,7 +356,7 @@ Menubar.Add = function ( editor ) { ...@@ -356,7 +356,7 @@ Menubar.Add = function ( editor ) {
light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 ); light.position.set( 0.5, 1, 0.75 ).multiplyScalar( 200 );
editor.execute( new CmdAddObject( light ) ); editor.execute( new AddObjectCommand( light ) );
} ); } );
options.add( option ); options.add( option );
...@@ -373,7 +373,7 @@ Menubar.Add = function ( editor ) { ...@@ -373,7 +373,7 @@ Menubar.Add = function ( editor ) {
var light = new THREE.AmbientLight( color ); var light = new THREE.AmbientLight( color );
light.name = 'AmbientLight ' + ( ++ lightCount ); light.name = 'AmbientLight ' + ( ++ lightCount );
editor.execute( new CmdAddObject( light ) ); editor.execute( new AddObjectCommand( light ) );
} ); } );
options.add( option ); options.add( option );
...@@ -392,7 +392,7 @@ Menubar.Add = function ( editor ) { ...@@ -392,7 +392,7 @@ Menubar.Add = function ( editor ) {
var camera = new THREE.PerspectiveCamera( 50, 1, 1, 10000 ); var camera = new THREE.PerspectiveCamera( 50, 1, 1, 10000 );
camera.name = 'PerspectiveCamera ' + ( ++ cameraCount ); camera.name = 'PerspectiveCamera ' + ( ++ cameraCount );
editor.execute( new CmdAddObject( camera ) ); editor.execute( new AddObjectCommand( camera ) );
} ); } );
options.add( option ); options.add( option );
......
...@@ -95,7 +95,7 @@ Menubar.Edit = function ( editor ) { ...@@ -95,7 +95,7 @@ Menubar.Edit = function ( editor ) {
object = object.clone(); object = object.clone();
editor.execute( new CmdAddObject( object ) ); editor.execute( new AddObjectCommand( object ) );
} ); } );
options.add( option ); options.add( option );
...@@ -114,7 +114,7 @@ Menubar.Edit = function ( editor ) { ...@@ -114,7 +114,7 @@ Menubar.Edit = function ( editor ) {
var parent = object.parent; var parent = object.parent;
if ( parent === undefined ) return; // avoid deleting the camera or scene if ( parent === undefined ) return; // avoid deleting the camera or scene
editor.execute( new CmdRemoveObject( object ) ); editor.execute( new RemoveObjectCommand( object ) );
} ); } );
options.add( option ); options.add( option );
...@@ -158,8 +158,8 @@ Menubar.Edit = function ( editor ) { ...@@ -158,8 +158,8 @@ Menubar.Edit = function ( editor ) {
var shader = glslprep.minifyGlsl( [ var shader = glslprep.minifyGlsl( [
material.vertexShader, material.fragmentShader ] ); material.vertexShader, material.fragmentShader ] );
cmds.push( new CmdSetMaterialValue( object, 'vertexShader', shader[ 0 ] ) ); cmds.push( new SetMaterialValueCommand( object, 'vertexShader', shader[ 0 ] ) );
cmds.push( new CmdSetMaterialValue( object, 'fragmentShader', shader[ 1 ] ) ); cmds.push( new SetMaterialValueCommand( object, 'fragmentShader', shader[ 1 ] ) );
++nMaterialsChanged; ++nMaterialsChanged;
...@@ -189,7 +189,7 @@ Menubar.Edit = function ( editor ) { ...@@ -189,7 +189,7 @@ Menubar.Edit = function ( editor ) {
if ( nMaterialsChanged > 0 ) { if ( nMaterialsChanged > 0 ) {
editor.execute( new CmdMultiCmds( cmds ), 'Minify Shaders' ); editor.execute( new MultiCmdsCommand( cmds ), 'Minify Shaders' );
} }
......
...@@ -82,7 +82,7 @@ var Script = function ( editor ) { ...@@ -82,7 +82,7 @@ var Script = function ( editor ) {
if ( value !== currentScript.source ) { if ( value !== currentScript.source ) {
editor.execute( new CmdSetScriptValue( currentObject, currentScript, 'source', value, codemirror.getCursor() ) ); editor.execute( new SetScriptValueCommand( currentObject, currentScript, 'source', value, codemirror.getCursor() ) );
} }
return; return;
...@@ -94,21 +94,21 @@ var Script = function ( editor ) { ...@@ -94,21 +94,21 @@ var Script = function ( editor ) {
if ( JSON.stringify( currentObject.material.defines ) !== JSON.stringify( json.defines ) ) { if ( JSON.stringify( currentObject.material.defines ) !== JSON.stringify( json.defines ) ) {
var cmd = new CmdSetMaterialValue( currentObject, 'defines', json.defines ); var cmd = new SetMaterialValueCommand( currentObject, 'defines', json.defines );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
} }
if ( JSON.stringify( currentObject.material.uniforms ) !== JSON.stringify( json.uniforms ) ) { if ( JSON.stringify( currentObject.material.uniforms ) !== JSON.stringify( json.uniforms ) ) {
var cmd = new CmdSetMaterialValue( currentObject, 'uniforms', json.uniforms ); var cmd = new SetMaterialValueCommand( currentObject, 'uniforms', json.uniforms );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
} }
if ( JSON.stringify( currentObject.material.attributes ) !== JSON.stringify( json.attributes ) ) { if ( JSON.stringify( currentObject.material.attributes ) !== JSON.stringify( json.attributes ) ) {
var cmd = new CmdSetMaterialValue( currentObject, 'attributes', json.attributes ); var cmd = new SetMaterialValueCommand( currentObject, 'attributes', json.attributes );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -74,7 +74,7 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) { ...@@ -74,7 +74,7 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.BoxGeometry( editor.execute( new SetGeometryCommand( object, new THREE.BoxGeometry(
width.getValue(), width.getValue(),
height.getValue(), height.getValue(),
depth.getValue(), depth.getValue(),
......
...@@ -54,7 +54,7 @@ Sidebar.Geometry.CircleGeometry = function ( editor, object ) { ...@@ -54,7 +54,7 @@ Sidebar.Geometry.CircleGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.CircleGeometry( editor.execute( new SetGeometryCommand( object, new THREE.CircleGeometry(
radius.getValue(), radius.getValue(),
segments.getValue(), segments.getValue(),
thetaStart.getValue(), thetaStart.getValue(),
......
...@@ -74,7 +74,7 @@ Sidebar.Geometry.CylinderGeometry = function ( editor, object ) { ...@@ -74,7 +74,7 @@ Sidebar.Geometry.CylinderGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.CylinderGeometry( editor.execute( new SetGeometryCommand( object, new THREE.CylinderGeometry(
radiusTop.getValue(), radiusTop.getValue(),
radiusBottom.getValue(), radiusBottom.getValue(),
height.getValue(), height.getValue(),
......
...@@ -35,7 +35,7 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) { ...@@ -35,7 +35,7 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.IcosahedronGeometry( editor.execute( new SetGeometryCommand( object, new THREE.IcosahedronGeometry(
radius.getValue(), radius.getValue(),
detail.getValue() detail.getValue()
) ) ); ) ) );
......
...@@ -55,7 +55,7 @@ Sidebar.Geometry.PlaneGeometry = function ( editor, object ) { ...@@ -55,7 +55,7 @@ Sidebar.Geometry.PlaneGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.PlaneGeometry( editor.execute( new SetGeometryCommand( object, new THREE.PlaneGeometry(
width.getValue(), width.getValue(),
height.getValue(), height.getValue(),
widthSegments.getValue(), widthSegments.getValue(),
......
...@@ -85,7 +85,7 @@ Sidebar.Geometry.SphereGeometry = function ( editor, object ) { ...@@ -85,7 +85,7 @@ Sidebar.Geometry.SphereGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.SphereGeometry( editor.execute( new SetGeometryCommand( object, new THREE.SphereGeometry(
radius.getValue(), radius.getValue(),
widthSegments.getValue(), widthSegments.getValue(),
heightSegments.getValue(), heightSegments.getValue(),
......
...@@ -65,7 +65,7 @@ Sidebar.Geometry.TorusGeometry = function ( editor, object ) { ...@@ -65,7 +65,7 @@ Sidebar.Geometry.TorusGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.TorusGeometry( editor.execute( new SetGeometryCommand( object, new THREE.TorusGeometry(
radius.getValue(), radius.getValue(),
tube.getValue(), tube.getValue(),
radialSegments.getValue(), radialSegments.getValue(),
......
...@@ -85,7 +85,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( editor, object ) { ...@@ -85,7 +85,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( editor, object ) {
function update() { function update() {
editor.execute( new CmdSetGeometry( object, new THREE.TorusKnotGeometry( editor.execute( new SetGeometryCommand( object, new THREE.TorusKnotGeometry(
radius.getValue(), radius.getValue(),
tube.getValue(), tube.getValue(),
radialSegments.getValue(), radialSegments.getValue(),
......
...@@ -51,7 +51,7 @@ Sidebar.Geometry = function ( editor ) { ...@@ -51,7 +51,7 @@ Sidebar.Geometry = function ( editor ) {
var newPosition = object.position.clone(); var newPosition = object.position.clone();
newPosition.sub( offset ); newPosition.sub( offset );
editor.execute( new CmdSetPosition( object, newPosition ) ); editor.execute( new SetPositionCommand( object, newPosition ) );
editor.signals.geometryChanged.dispatch( object ); editor.signals.geometryChanged.dispatch( object );
...@@ -61,7 +61,7 @@ Sidebar.Geometry = function ( editor ) { ...@@ -61,7 +61,7 @@ Sidebar.Geometry = function ( editor ) {
if ( geometry instanceof THREE.Geometry ) { if ( geometry instanceof THREE.Geometry ) {
editor.execute( new CmdSetGeometry( object, new THREE.BufferGeometry().fromGeometry( geometry ) ) ); editor.execute( new SetGeometryCommand( object, new THREE.BufferGeometry().fromGeometry( geometry ) ) );
} }
...@@ -73,12 +73,12 @@ Sidebar.Geometry = function ( editor ) { ...@@ -73,12 +73,12 @@ Sidebar.Geometry = function ( editor ) {
newGeometry.uuid = geometry.uuid; newGeometry.uuid = geometry.uuid;
newGeometry.applyMatrix( object.matrix ); newGeometry.applyMatrix( object.matrix );
var cmds = [ new CmdSetGeometry( object, newGeometry ), var cmds = [ new SetGeometryCommand( object, newGeometry ),
new CmdSetPosition( object, new THREE.Vector3( 0, 0, 0 ) ), new SetPositionCommand( object, new THREE.Vector3( 0, 0, 0 ) ),
new CmdSetRotation( object, new THREE.Euler( 0, 0, 0 ) ), new SetRotationCommand( object, new THREE.Euler( 0, 0, 0 ) ),
new CmdSetScale( object, new THREE.Vector3( 1, 1, 1 ) ) ]; new SetScaleCommand( object, new THREE.Vector3( 1, 1, 1 ) ) ];
editor.execute( new CmdMultiCmds( cmds ), 'Flatten Geometry' ); editor.execute( new MultiCmdsCommand( cmds ), 'Flatten Geometry' );
break; break;
...@@ -99,7 +99,7 @@ Sidebar.Geometry = function ( editor ) { ...@@ -99,7 +99,7 @@ Sidebar.Geometry = function ( editor ) {
geometryUUID.setValue( THREE.Math.generateUUID() ); geometryUUID.setValue( THREE.Math.generateUUID() );
editor.execute( new CmdSetGeometryValue( editor.selected, 'uuid', geometryUUID.getValue() ) ); editor.execute( new SetGeometryValueCommand( editor.selected, 'uuid', geometryUUID.getValue() ) );
} ); } );
...@@ -114,7 +114,7 @@ Sidebar.Geometry = function ( editor ) { ...@@ -114,7 +114,7 @@ Sidebar.Geometry = function ( editor ) {
var geometryNameRow = new UI.Panel(); var geometryNameRow = new UI.Panel();
var geometryName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () { var geometryName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () {
editor.execute( new CmdSetGeometryValue( editor.selected, 'name', geometryName.getValue() ) ); editor.execute( new SetGeometryValueCommand( editor.selected, 'name', geometryName.getValue() ) );
} ); } );
......
...@@ -42,7 +42,7 @@ Sidebar.Material = function ( editor ) { ...@@ -42,7 +42,7 @@ Sidebar.Material = function ( editor ) {
var materialNameRow = new UI.Panel(); var materialNameRow = new UI.Panel();
var materialName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () { var materialName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () {
editor.execute( new CmdSetMaterialValue( editor.selected, 'name', materialName.getValue() ) ); editor.execute( new SetMaterialValueCommand( editor.selected, 'name', materialName.getValue() ) );
} ); } );
...@@ -402,7 +402,7 @@ Sidebar.Material = function ( editor ) { ...@@ -402,7 +402,7 @@ Sidebar.Material = function ( editor ) {
if ( material.uuid !== undefined && material.uuid !== materialUUID.getValue() ) { if ( material.uuid !== undefined && material.uuid !== materialUUID.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'uuid', materialUUID.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'uuid', materialUUID.getValue() ) );
} }
...@@ -410,7 +410,7 @@ Sidebar.Material = function ( editor ) { ...@@ -410,7 +410,7 @@ Sidebar.Material = function ( editor ) {
material = new THREE[ materialClass.getValue() ](); material = new THREE[ materialClass.getValue() ]();
editor.execute( new CmdSetMaterial( currentObject, material ), 'New Material: ' + materialClass.getValue() ); editor.execute( new SetMaterialCommand( currentObject, material ), 'New Material: ' + materialClass.getValue() );
// TODO Copy other references in the scene graph // TODO Copy other references in the scene graph
// keeping name and UUID then. // keeping name and UUID then.
// Also there should be means to create a unique // Also there should be means to create a unique
...@@ -421,25 +421,25 @@ Sidebar.Material = function ( editor ) { ...@@ -421,25 +421,25 @@ Sidebar.Material = function ( editor ) {
if ( material.color !== undefined && material.color.getHex() !== materialColor.getHexValue() ) { if ( material.color !== undefined && material.color.getHex() !== materialColor.getHexValue() ) {
editor.execute( new CmdSetMaterialColor( currentObject, 'color', materialColor.getHexValue() ) ); editor.execute( new SetMaterialColorCommand( currentObject, 'color', materialColor.getHexValue() ) );
} }
if ( material.emissive !== undefined && material.emissive.getHex() !== materialEmissive.getHexValue() ) { if ( material.emissive !== undefined && material.emissive.getHex() !== materialEmissive.getHexValue() ) {
editor.execute( new CmdSetMaterialColor( currentObject, 'emissive', materialEmissive.getHexValue() ) ); editor.execute( new SetMaterialColorCommand( currentObject, 'emissive', materialEmissive.getHexValue() ) );
} }
if ( material.specular !== undefined && material.specular.getHex() !== materialSpecular.getHexValue() ) { if ( material.specular !== undefined && material.specular.getHex() !== materialSpecular.getHexValue() ) {
editor.execute( new CmdSetMaterialColor( currentObject, 'specular', materialSpecular.getHexValue() ) ); editor.execute( new SetMaterialColorCommand( currentObject, 'specular', materialSpecular.getHexValue() ) );
} }
if ( material.shininess !== undefined && Math.abs( material.shininess - materialShininess.getValue() ) >= 0.01 ) { if ( material.shininess !== undefined && Math.abs( material.shininess - materialShininess.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'shininess', materialShininess.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'shininess', materialShininess.getValue() ) );
} }
...@@ -449,7 +449,7 @@ Sidebar.Material = function ( editor ) { ...@@ -449,7 +449,7 @@ Sidebar.Material = function ( editor ) {
if ( material.vertexColors !== vertexColors ) { if ( material.vertexColors !== vertexColors ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'vertexColors', vertexColors ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'vertexColors', vertexColors ) );
} }
...@@ -457,7 +457,7 @@ Sidebar.Material = function ( editor ) { ...@@ -457,7 +457,7 @@ Sidebar.Material = function ( editor ) {
if ( material.skinning !== undefined && material.skinning !== materialSkinning.getValue() ) { if ( material.skinning !== undefined && material.skinning !== materialSkinning.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'skinning', materialSkinning.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'skinning', materialSkinning.getValue() ) );
} }
...@@ -470,7 +470,7 @@ Sidebar.Material = function ( editor ) { ...@@ -470,7 +470,7 @@ Sidebar.Material = function ( editor ) {
var map = mapEnabled ? materialMap.getValue() : null; var map = mapEnabled ? materialMap.getValue() : null;
if ( material.map !== map ) { if ( material.map !== map ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'map', map ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'map', map ) );
} }
...@@ -491,7 +491,7 @@ Sidebar.Material = function ( editor ) { ...@@ -491,7 +491,7 @@ Sidebar.Material = function ( editor ) {
var alphaMap = mapEnabled ? materialAlphaMap.getValue() : null; var alphaMap = mapEnabled ? materialAlphaMap.getValue() : null;
if ( material.alphaMap !== alphaMap ) { if ( material.alphaMap !== alphaMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'alphaMap', alphaMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'alphaMap', alphaMap ) );
} }
...@@ -512,13 +512,13 @@ Sidebar.Material = function ( editor ) { ...@@ -512,13 +512,13 @@ Sidebar.Material = function ( editor ) {
var bumpMap = bumpMapEnabled ? materialBumpMap.getValue() : null; var bumpMap = bumpMapEnabled ? materialBumpMap.getValue() : null;
if ( material.bumpMap !== bumpMap ) { if ( material.bumpMap !== bumpMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'bumpMap', bumpMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'bumpMap', bumpMap ) );
} }
if ( material.bumpScale !== materialBumpScale.getValue() ) { if ( material.bumpScale !== materialBumpScale.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'bumpScale', materialBumpScale.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'bumpScale', materialBumpScale.getValue() ) );
} }
...@@ -539,7 +539,7 @@ Sidebar.Material = function ( editor ) { ...@@ -539,7 +539,7 @@ Sidebar.Material = function ( editor ) {
var normalMap = normalMapEnabled ? materialNormalMap.getValue() : null; var normalMap = normalMapEnabled ? materialNormalMap.getValue() : null;
if ( material.normalMap !== normalMap ) { if ( material.normalMap !== normalMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'normalMap', normalMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'normalMap', normalMap ) );
} }
...@@ -560,13 +560,13 @@ Sidebar.Material = function ( editor ) { ...@@ -560,13 +560,13 @@ Sidebar.Material = function ( editor ) {
var displacementMap = displacementMapEnabled ? materialDisplacementMap.getValue() : null; var displacementMap = displacementMapEnabled ? materialDisplacementMap.getValue() : null;
if ( material.displacementMap !== displacementMap ) { if ( material.displacementMap !== displacementMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'displacementMap', displacementMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'displacementMap', displacementMap ) );
} }
if ( material.displacementScale !== materialDisplacementScale.getValue() ) { if ( material.displacementScale !== materialDisplacementScale.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'displacementScale', materialDisplacementScale.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'displacementScale', materialDisplacementScale.getValue() ) );
} }
...@@ -587,7 +587,7 @@ Sidebar.Material = function ( editor ) { ...@@ -587,7 +587,7 @@ Sidebar.Material = function ( editor ) {
var specularMap = specularMapEnabled ? materialSpecularMap.getValue() : null; var specularMap = specularMapEnabled ? materialSpecularMap.getValue() : null;
if ( material.specularMap !== specularMap ) { if ( material.specularMap !== specularMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'specularMap', specularMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'specularMap', specularMap ) );
} }
...@@ -607,13 +607,13 @@ Sidebar.Material = function ( editor ) { ...@@ -607,13 +607,13 @@ Sidebar.Material = function ( editor ) {
if ( material.envMap !== envMap ) { if ( material.envMap !== envMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'envMap', envMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'envMap', envMap ) );
} }
if ( material.reflectivity !== materialReflectivity.getValue() ) { if ( material.reflectivity !== materialReflectivity.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'reflectivity', materialReflectivity.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'reflectivity', materialReflectivity.getValue() ) );
} }
...@@ -628,7 +628,7 @@ Sidebar.Material = function ( editor ) { ...@@ -628,7 +628,7 @@ Sidebar.Material = function ( editor ) {
var lightMap = lightMapEnabled ? materialLightMap.getValue() : null; var lightMap = lightMapEnabled ? materialLightMap.getValue() : null;
if ( material.lightMap !== lightMap ) { if ( material.lightMap !== lightMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'lightMap', lightMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'lightMap', lightMap ) );
} }
...@@ -649,13 +649,13 @@ Sidebar.Material = function ( editor ) { ...@@ -649,13 +649,13 @@ Sidebar.Material = function ( editor ) {
var aoMap = aoMapEnabled ? materialAOMap.getValue() : null; var aoMap = aoMapEnabled ? materialAOMap.getValue() : null;
if ( material.aoMap !== aoMap ) { if ( material.aoMap !== aoMap ) {
editor.execute( new CmdSetMaterialMap( currentObject, 'aoMap', aoMap ) ); editor.execute( new SetMaterialMapCommand( currentObject, 'aoMap', aoMap ) );
} }
if ( material.aoMapIntensity !== materialAOScale.getValue() ) { if ( material.aoMapIntensity !== materialAOScale.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'aoMapIntensity', materialAOScale.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'aoMapIntensity', materialAOScale.getValue() ) );
} }
...@@ -672,7 +672,7 @@ Sidebar.Material = function ( editor ) { ...@@ -672,7 +672,7 @@ Sidebar.Material = function ( editor ) {
var side = parseInt( materialSide.getValue() ); var side = parseInt( materialSide.getValue() );
if ( material.side !== side ) { if ( material.side !== side ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'side', side ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'side', side ) );
} }
...@@ -684,7 +684,7 @@ Sidebar.Material = function ( editor ) { ...@@ -684,7 +684,7 @@ Sidebar.Material = function ( editor ) {
var shading = parseInt( materialShading.getValue() ); var shading = parseInt( materialShading.getValue() );
if ( material.shading !== shading ) { if ( material.shading !== shading ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'shading', shading ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'shading', shading ) );
} }
...@@ -695,7 +695,7 @@ Sidebar.Material = function ( editor ) { ...@@ -695,7 +695,7 @@ Sidebar.Material = function ( editor ) {
var blending = parseInt( materialBlending.getValue() ); var blending = parseInt( materialBlending.getValue() );
if ( material.blending !== blending ) { if ( material.blending !== blending ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'blending', blending ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'blending', blending ) );
} }
...@@ -703,31 +703,31 @@ Sidebar.Material = function ( editor ) { ...@@ -703,31 +703,31 @@ Sidebar.Material = function ( editor ) {
if ( material.opacity !== undefined && Math.abs( material.opacity - materialOpacity.getValue() ) >= 0.01 ) { if ( material.opacity !== undefined && Math.abs( material.opacity - materialOpacity.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'opacity', materialOpacity.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'opacity', materialOpacity.getValue() ) );
} }
if ( material.transparent !== undefined && material.transparent !== materialTransparent.getValue() ) { if ( material.transparent !== undefined && material.transparent !== materialTransparent.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'transparent', materialTransparent.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'transparent', materialTransparent.getValue() ) );
} }
if ( material.alphaTest !== undefined && Math.abs( material.alphaTest - materialAlphaTest.getValue() ) >= 0.01 ) { if ( material.alphaTest !== undefined && Math.abs( material.alphaTest - materialAlphaTest.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'alphaTest', materialAlphaTest.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'alphaTest', materialAlphaTest.getValue() ) );
} }
if ( material.wireframe !== undefined && material.wireframe !== materialWireframe.getValue() ) { if ( material.wireframe !== undefined && material.wireframe !== materialWireframe.getValue() ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'wireframe', materialWireframe.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue() ) );
} }
if ( material.wireframeLinewidth !== undefined && Math.abs( material.wireframeLinewidth - materialWireframeLinewidth.getValue() ) >= 0.01 ) { if ( material.wireframeLinewidth !== undefined && Math.abs( material.wireframeLinewidth - materialWireframeLinewidth.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetMaterialValue( currentObject, 'wireframeLinewidth', materialWireframeLinewidth.getValue() ) ); editor.execute( new SetMaterialValueCommand( currentObject, 'wireframeLinewidth', materialWireframeLinewidth.getValue() ) );
} }
......
...@@ -41,15 +41,15 @@ Sidebar.Object3D = function ( editor ) { ...@@ -41,15 +41,15 @@ Sidebar.Object3D = function ( editor ) {
switch ( this.getValue() ) { switch ( this.getValue() ) {
case 'Reset Position': case 'Reset Position':
editor.execute( new CmdSetPosition( object, new THREE.Vector3( 0, 0, 0 ) ) ); editor.execute( new SetPositionCommand( object, new THREE.Vector3( 0, 0, 0 ) ) );
break; break;
case 'Reset Rotation': case 'Reset Rotation':
editor.execute( new CmdSetRotation( object, new THREE.Euler( 0, 0, 0 ) ) ); editor.execute( new SetRotationCommand( object, new THREE.Euler( 0, 0, 0 ) ) );
break; break;
case 'Reset Scale': case 'Reset Scale':
editor.execute( new CmdSetScale( object, new THREE.Vector3( 1, 1, 1 ) ) ); editor.execute( new SetScaleCommand( object, new THREE.Vector3( 1, 1, 1 ) ) );
break; break;
} }
...@@ -69,7 +69,7 @@ Sidebar.Object3D = function ( editor ) { ...@@ -69,7 +69,7 @@ Sidebar.Object3D = function ( editor ) {
objectUUID.setValue( THREE.Math.generateUUID() ); objectUUID.setValue( THREE.Math.generateUUID() );
editor.execute( new CmdSetUuid( editor.selected, objectUUID.getValue() ) ); editor.execute( new SetUuidCommand( editor.selected, objectUUID.getValue() ) );
} ); } );
...@@ -84,7 +84,7 @@ Sidebar.Object3D = function ( editor ) { ...@@ -84,7 +84,7 @@ Sidebar.Object3D = function ( editor ) {
var objectNameRow = new UI.Panel(); var objectNameRow = new UI.Panel();
var objectName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () { var objectName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () {
editor.execute( new CmdSetValue( editor.selected, 'name', objectName.getValue() ) ); editor.execute( new SetValueCommand( editor.selected, 'name', objectName.getValue() ) );
} ); } );
...@@ -373,7 +373,7 @@ Sidebar.Object3D = function ( editor ) { ...@@ -373,7 +373,7 @@ Sidebar.Object3D = function ( editor ) {
if ( object.parent.id !== newParentId && object.id !== newParentId ) { if ( object.parent.id !== newParentId && object.id !== newParentId ) {
editor.execute( new CmdMoveObject( object, editor.scene.getObjectById( newParentId ) ) ); editor.execute( new MoveObjectCommand( object, editor.scene.getObjectById( newParentId ) ) );
} }
...@@ -383,100 +383,100 @@ Sidebar.Object3D = function ( editor ) { ...@@ -383,100 +383,100 @@ Sidebar.Object3D = function ( editor ) {
var newPosition = new THREE.Vector3( objectPositionX.getValue(), objectPositionY.getValue(), objectPositionZ.getValue() ); var newPosition = new THREE.Vector3( objectPositionX.getValue(), objectPositionY.getValue(), objectPositionZ.getValue() );
if ( object.position.distanceTo( newPosition ) >= 0.01 ) { if ( object.position.distanceTo( newPosition ) >= 0.01 ) {
editor.execute( new CmdSetPosition( object, newPosition ) ); editor.execute( new SetPositionCommand( object, newPosition ) );
} }
var newRotation = new THREE.Euler( objectRotationX.getValue(), objectRotationY.getValue(), objectRotationZ.getValue() ); var newRotation = new THREE.Euler( objectRotationX.getValue(), objectRotationY.getValue(), objectRotationZ.getValue() );
if ( object.rotation.toVector3().distanceTo( newRotation.toVector3() ) >= 0.01 ) { if ( object.rotation.toVector3().distanceTo( newRotation.toVector3() ) >= 0.01 ) {
editor.execute( new CmdSetRotation( object, newRotation ) ); editor.execute( new SetRotationCommand( object, newRotation ) );
} }
var newScale = new THREE.Vector3( objectScaleX.getValue(), objectScaleY.getValue(), objectScaleZ.getValue() ); var newScale = new THREE.Vector3( objectScaleX.getValue(), objectScaleY.getValue(), objectScaleZ.getValue() );
if ( object.scale.distanceTo( newScale ) >= 0.01 ) { if ( object.scale.distanceTo( newScale ) >= 0.01 ) {
editor.execute( new CmdSetScale( object, newScale ) ); editor.execute( new SetScaleCommand( object, newScale ) );
} }
if ( object.fov !== undefined && Math.abs( object.fov - objectFov.getValue() ) >= 0.01 ) { if ( object.fov !== undefined && Math.abs( object.fov - objectFov.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'fov', objectFov.getValue() ) ); editor.execute( new SetValueCommand( object, 'fov', objectFov.getValue() ) );
object.updateProjectionMatrix(); object.updateProjectionMatrix();
} }
if ( object.near !== undefined && Math.abs( object.near - objectNear.getValue() ) >= 0.01 ) { if ( object.near !== undefined && Math.abs( object.near - objectNear.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'near', objectNear.getValue() ) ); editor.execute( new SetValueCommand( object, 'near', objectNear.getValue() ) );
} }
if ( object.far !== undefined && Math.abs( object.far - objectFar.getValue() ) >= 0.01 ) { if ( object.far !== undefined && Math.abs( object.far - objectFar.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'far', objectFar.getValue() ) ); editor.execute( new SetValueCommand( object, 'far', objectFar.getValue() ) );
} }
if ( object.intensity !== undefined && Math.abs( object.intensity - objectIntensity.getValue() ) >= 0.01 ) { if ( object.intensity !== undefined && Math.abs( object.intensity - objectIntensity.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'intensity', objectIntensity.getValue() ) ); editor.execute( new SetValueCommand( object, 'intensity', objectIntensity.getValue() ) );
} }
if ( object.color !== undefined && object.color.getHex() !== objectColor.getHexValue() ) { if ( object.color !== undefined && object.color.getHex() !== objectColor.getHexValue() ) {
editor.execute( new CmdSetColor( object, 'color', objectColor.getHexValue() ) ); editor.execute( new SetColorCommand( object, 'color', objectColor.getHexValue() ) );
} }
if ( object.groundColor !== undefined && object.groundColor.getHex() !== objectGroundColor.getHexValue() ) { if ( object.groundColor !== undefined && object.groundColor.getHex() !== objectGroundColor.getHexValue() ) {
editor.execute( new CmdSetColor( object, 'groundColor', objectGroundColor.getHexValue() ) ); editor.execute( new SetColorCommand( object, 'groundColor', objectGroundColor.getHexValue() ) );
} }
if ( object.distance !== undefined && Math.abs( object.distance - objectDistance.getValue() ) >= 0.01 ) { if ( object.distance !== undefined && Math.abs( object.distance - objectDistance.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'distance', objectDistance.getValue() ) ); editor.execute( new SetValueCommand( object, 'distance', objectDistance.getValue() ) );
} }
if ( object.angle !== undefined && Math.abs( object.angle - objectAngle.getValue() ) >= 0.01 ) { if ( object.angle !== undefined && Math.abs( object.angle - objectAngle.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'angle', objectAngle.getValue() ) ); editor.execute( new SetValueCommand( object, 'angle', objectAngle.getValue() ) );
} }
if ( object.exponent !== undefined && Math.abs( object.exponent - objectExponent.getValue() ) >= 0.01 ) { if ( object.exponent !== undefined && Math.abs( object.exponent - objectExponent.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'exponent', objectExponent.getValue() ) ); editor.execute( new SetValueCommand( object, 'exponent', objectExponent.getValue() ) );
} }
if ( object.decay !== undefined && Math.abs( object.decay - objectDecay.getValue() ) >= 0.01 ) { if ( object.decay !== undefined && Math.abs( object.decay - objectDecay.getValue() ) >= 0.01 ) {
editor.execute( new CmdSetValue( object, 'decay', objectDecay.getValue() ) ); editor.execute( new SetValueCommand( object, 'decay', objectDecay.getValue() ) );
} }
if ( object.visible !== objectVisible.getValue() ) { if ( object.visible !== objectVisible.getValue() ) {
editor.execute( new CmdSetValue( object, 'visible', objectVisible.getValue() ) ); editor.execute( new SetValueCommand( object, 'visible', objectVisible.getValue() ) );
} }
if ( object.castShadow !== objectCastShadow.getValue() ) { if ( object.castShadow !== objectCastShadow.getValue() ) {
editor.execute( new CmdSetValue( object, 'castShadow', objectCastShadow.getValue() ) ); editor.execute( new SetValueCommand( object, 'castShadow', objectCastShadow.getValue() ) );
} }
if ( object.receiveShadow !== objectReceiveShadow.getValue() ) { if ( object.receiveShadow !== objectReceiveShadow.getValue() ) {
editor.execute( new CmdSetValue( object, 'receiveShadow', objectReceiveShadow.getValue() ) ); editor.execute( new SetValueCommand( object, 'receiveShadow', objectReceiveShadow.getValue() ) );
object.material.needsUpdate = true; object.material.needsUpdate = true;
} }
...@@ -486,7 +486,7 @@ Sidebar.Object3D = function ( editor ) { ...@@ -486,7 +486,7 @@ Sidebar.Object3D = function ( editor ) {
var userData = JSON.parse( objectUserData.getValue() ); var userData = JSON.parse( objectUserData.getValue() );
if ( JSON.stringify( object.userData ) != JSON.stringify( userData ) ) { if ( JSON.stringify( object.userData ) != JSON.stringify( userData ) ) {
editor.execute( new CmdSetValue( object, 'userData', userData ) ); editor.execute( new SetValueCommand( object, 'userData', userData ) );
} }
......
...@@ -27,7 +27,7 @@ Sidebar.Script = function ( editor ) { ...@@ -27,7 +27,7 @@ Sidebar.Script = function ( editor ) {
newScript.onClick( function () { newScript.onClick( function () {
var script = { name: '', source: 'function update( event ) {}' }; var script = { name: '', source: 'function update( event ) {}' };
editor.execute( new CmdAddScript( editor.selected, script ) ); editor.execute( new AddScriptCommand( editor.selected, script ) );
} ); } );
container.add( newScript ); container.add( newScript );
...@@ -63,7 +63,7 @@ Sidebar.Script = function ( editor ) { ...@@ -63,7 +63,7 @@ Sidebar.Script = function ( editor ) {
var name = new UI.Input( script.name ).setWidth( '130px' ).setFontSize( '12px' ); var name = new UI.Input( script.name ).setWidth( '130px' ).setFontSize( '12px' );
name.onChange( function () { name.onChange( function () {
editor.execute( new CmdSetScriptValue( editor.selected, script, 'name', this.getValue() ) ); editor.execute( new SetScriptValueCommand( editor.selected, script, 'name', this.getValue() ) );
} ); } );
scriptsContainer.add( name ); scriptsContainer.add( name );
...@@ -83,7 +83,7 @@ Sidebar.Script = function ( editor ) { ...@@ -83,7 +83,7 @@ Sidebar.Script = function ( editor ) {
if ( confirm( 'Are you sure?' ) ) { if ( confirm( 'Are you sure?' ) ) {
editor.execute( new CmdRemoveScript( editor.selected, script ) ); editor.execute( new RemoveScriptCommand( editor.selected, script ) );
} }
......
...@@ -82,21 +82,21 @@ var Viewport = function ( editor ) { ...@@ -82,21 +82,21 @@ var Viewport = function ( editor ) {
case 'translate': case 'translate':
if (!objectPositionOnDown.equals(object.position)) { if (!objectPositionOnDown.equals(object.position)) {
editor.execute(new CmdSetPosition( object, object.position, objectPositionOnDown )); editor.execute(new SetPositionCommand( object, object.position, objectPositionOnDown ));
} }
break; break;
case 'rotate': case 'rotate':
if (!objectRotationOnDown.equals(object.rotation)) { if (!objectRotationOnDown.equals(object.rotation)) {
editor.execute(new CmdSetRotation( object, object.rotation, objectRotationOnDown )); editor.execute(new SetRotationCommand( object, object.rotation, objectRotationOnDown ));
} }
break; break;
case 'scale': case 'scale':
if (!objectScaleOnDown.equals(object.scale)) { if (!objectScaleOnDown.equals(object.scale)) {
editor.execute(new CmdSetScale( object, object.scale, objectScaleOnDown )); editor.execute(new SetScaleCommand( object, object.scale, objectScaleOnDown ));
} }
break; break;
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
* @constructor * @constructor
*/ */
CmdAddObject = function ( object ) { var AddObjectCommand = function ( object ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdAddObject'; this.type = 'AddObjectCommand';
this.object = object; this.object = object;
if ( object !== undefined ) { if ( object !== undefined ) {
...@@ -23,7 +23,7 @@ CmdAddObject = function ( object ) { ...@@ -23,7 +23,7 @@ CmdAddObject = function ( object ) {
}; };
CmdAddObject.prototype = { AddObjectCommand.prototype = {
execute: function () { execute: function () {
...@@ -41,7 +41,7 @@ CmdAddObject.prototype = { ...@@ -41,7 +41,7 @@ CmdAddObject.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.object = this.object.toJSON(); output.object = this.object.toJSON();
return output; return output;
...@@ -50,7 +50,7 @@ CmdAddObject.prototype = { ...@@ -50,7 +50,7 @@ CmdAddObject.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.object.object.uuid ); this.object = this.editor.objectByUuid( json.object.object.uuid );
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
* @constructor * @constructor
*/ */
CmdAddScript = function ( object, script ) { var AddScriptCommand = function ( object, script ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdAddScript'; this.type = 'AddScriptCommand';
this.name = 'Add Script'; this.name = 'Add Script';
this.object = object; this.object = object;
...@@ -21,7 +21,7 @@ CmdAddScript = function ( object, script ) { ...@@ -21,7 +21,7 @@ CmdAddScript = function ( object, script ) {
}; };
CmdAddScript.prototype = { AddScriptCommand.prototype = {
execute: function () { execute: function () {
...@@ -55,7 +55,7 @@ CmdAddScript.prototype = { ...@@ -55,7 +55,7 @@ CmdAddScript.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.script = this.script; output.script = this.script;
...@@ -66,7 +66,7 @@ CmdAddScript.prototype = { ...@@ -66,7 +66,7 @@ CmdAddScript.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.script = json.script; this.script = json.script;
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdMoveObject = function ( object, newParent, newBefore ) { var MoveObjectCommand = function ( object, newParent, newBefore ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdMoveObject'; this.type = 'MoveObjectCommand';
this.name = 'Move Object'; this.name = 'Move Object';
this.object = object; this.object = object;
...@@ -42,7 +42,7 @@ CmdMoveObject = function ( object, newParent, newBefore ) { ...@@ -42,7 +42,7 @@ CmdMoveObject = function ( object, newParent, newBefore ) {
}; };
CmdMoveObject.prototype = { MoveObjectCommand.prototype = {
execute: function () { execute: function () {
...@@ -70,7 +70,7 @@ CmdMoveObject.prototype = { ...@@ -70,7 +70,7 @@ CmdMoveObject.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.newParentUuid = this.newParent.uuid; output.newParentUuid = this.newParent.uuid;
...@@ -84,7 +84,7 @@ CmdMoveObject.prototype = { ...@@ -84,7 +84,7 @@ CmdMoveObject.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.oldParent = this.editor.objectByUuid( json.oldParentUuid ); this.oldParent = this.editor.objectByUuid( json.oldParentUuid );
......
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
* @constructor * @constructor
*/ */
CmdMultiCmds = function ( cmdArray ) { var MultiCmdsCommand = function ( cmdArray ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdMultiCmds'; this.type = 'MultiCmdsCommand';
this.name = 'Multiple Changes'; this.name = 'Multiple Changes';
this.cmdArray = ( cmdArray !== undefined ) ? cmdArray : []; this.cmdArray = ( cmdArray !== undefined ) ? cmdArray : [];
}; };
CmdMultiCmds.prototype = { MultiCmdsCommand.prototype = {
execute: function () { execute: function () {
...@@ -53,7 +53,7 @@ CmdMultiCmds.prototype = { ...@@ -53,7 +53,7 @@ CmdMultiCmds.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
var cmds = []; var cmds = [];
for ( var i = 0; i < this.cmdArray.length; i ++ ) { for ( var i = 0; i < this.cmdArray.length; i ++ ) {
...@@ -69,7 +69,7 @@ CmdMultiCmds.prototype = { ...@@ -69,7 +69,7 @@ CmdMultiCmds.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
var cmds = json.cmds; var cmds = json.cmds;
for ( var i = 0; i < cmds.length; i ++ ) { for ( var i = 0; i < cmds.length; i ++ ) {
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
* @constructor * @constructor
*/ */
CmdRemoveObject = function ( object ) { var RemoveObjectCommand = function ( object ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdRemoveObject'; this.type = 'RemoveObjectCommand';
this.name = 'Remove Object'; this.name = 'Remove Object';
this.object = object; this.object = object;
...@@ -25,7 +25,7 @@ CmdRemoveObject = function ( object ) { ...@@ -25,7 +25,7 @@ CmdRemoveObject = function ( object ) {
}; };
CmdRemoveObject.prototype = { RemoveObjectCommand.prototype = {
execute: function () { execute: function () {
...@@ -68,7 +68,7 @@ CmdRemoveObject.prototype = { ...@@ -68,7 +68,7 @@ CmdRemoveObject.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.object = this.object.toJSON(); output.object = this.object.toJSON();
output.index = this.index; output.index = this.index;
output.parentUuid = this.parent.uuid; output.parentUuid = this.parent.uuid;
...@@ -79,7 +79,7 @@ CmdRemoveObject.prototype = { ...@@ -79,7 +79,7 @@ CmdRemoveObject.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.parent = this.editor.objectByUuid( json.parentUuid ); this.parent = this.editor.objectByUuid( json.parentUuid );
if ( this.parent === undefined ) { if ( this.parent === undefined ) {
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
* @constructor * @constructor
*/ */
CmdRemoveScript = function ( object, script ) { var RemoveScriptCommand = function ( object, script ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdRemoveScript'; this.type = 'RemoveScriptCommand';
this.name = 'Remove Script'; this.name = 'Remove Script';
this.object = object; this.object = object;
...@@ -26,7 +26,7 @@ CmdRemoveScript = function ( object, script ) { ...@@ -26,7 +26,7 @@ CmdRemoveScript = function ( object, script ) {
}; };
CmdRemoveScript.prototype = { RemoveScriptCommand.prototype = {
execute: function () { execute: function () {
...@@ -58,7 +58,7 @@ CmdRemoveScript.prototype = { ...@@ -58,7 +58,7 @@ CmdRemoveScript.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.script = this.script; output.script = this.script;
...@@ -70,7 +70,7 @@ CmdRemoveScript.prototype = { ...@@ -70,7 +70,7 @@ CmdRemoveScript.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.script = json.script; this.script = json.script;
this.index = json.index; this.index = json.index;
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetColor = function ( object, attributeName, newValue ) { var SetColorCommand = function ( object, attributeName, newValue ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetColor'; this.type = 'SetColorCommand';
this.name = 'Set ' + attributeName; this.name = 'Set ' + attributeName;
this.updatable = true; this.updatable = true;
...@@ -25,7 +25,7 @@ CmdSetColor = function ( object, attributeName, newValue ) { ...@@ -25,7 +25,7 @@ CmdSetColor = function ( object, attributeName, newValue ) {
}; };
CmdSetColor.prototype = { SetColorCommand.prototype = {
execute: function () { execute: function () {
...@@ -49,7 +49,7 @@ CmdSetColor.prototype = { ...@@ -49,7 +49,7 @@ CmdSetColor.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.attributeName = this.attributeName; output.attributeName = this.attributeName;
...@@ -62,7 +62,7 @@ CmdSetColor.prototype = { ...@@ -62,7 +62,7 @@ CmdSetColor.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.attributeName = json.attributeName; this.attributeName = json.attributeName;
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
* @constructor * @constructor
*/ */
CmdSetGeometry = function ( object, newGeometry ) { var SetGeometryCommand = function ( object, newGeometry ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetGeometry'; this.type = 'SetGeometryCommand';
this.name = 'Set Geometry'; this.name = 'Set Geometry';
this.updatable = true; this.updatable = true;
...@@ -23,7 +23,7 @@ CmdSetGeometry = function ( object, newGeometry ) { ...@@ -23,7 +23,7 @@ CmdSetGeometry = function ( object, newGeometry ) {
}; };
CmdSetGeometry.prototype = { SetGeometryCommand.prototype = {
execute: function () { execute: function () {
...@@ -55,7 +55,7 @@ CmdSetGeometry.prototype = { ...@@ -55,7 +55,7 @@ CmdSetGeometry.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.oldGeometry = this.object.geometry.toJSON(); output.oldGeometry = this.object.geometry.toJSON();
...@@ -67,7 +67,7 @@ CmdSetGeometry.prototype = { ...@@ -67,7 +67,7 @@ CmdSetGeometry.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetGeometryValue = function ( object, attributeName, newValue ) { var SetGeometryValueCommand = function ( object, attributeName, newValue ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetGeometryValue'; this.type = 'SetGeometryValueCommand';
this.name = 'Set Geometry.' + attributeName; this.name = 'Set Geometry.' + attributeName;
this.object = object; this.object = object;
...@@ -24,7 +24,7 @@ CmdSetGeometryValue = function ( object, attributeName, newValue ) { ...@@ -24,7 +24,7 @@ CmdSetGeometryValue = function ( object, attributeName, newValue ) {
}; };
CmdSetGeometryValue.prototype = { SetGeometryValueCommand.prototype = {
execute: function () { execute: function () {
...@@ -46,7 +46,7 @@ CmdSetGeometryValue.prototype = { ...@@ -46,7 +46,7 @@ CmdSetGeometryValue.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.attributeName = this.attributeName; output.attributeName = this.attributeName;
...@@ -59,7 +59,7 @@ CmdSetGeometryValue.prototype = { ...@@ -59,7 +59,7 @@ CmdSetGeometryValue.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.attributeName = json.attributeName; this.attributeName = json.attributeName;
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetMaterialColor = function ( object, attributeName, newValue ) { var SetMaterialColorCommand = function ( object, attributeName, newValue ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetMaterialColor'; this.type = 'SetMaterialColorCommand';
this.name = 'Set Material.' + attributeName; this.name = 'Set Material.' + attributeName;
this.updatable = true; this.updatable = true;
...@@ -25,7 +25,7 @@ CmdSetMaterialColor = function ( object, attributeName, newValue ) { ...@@ -25,7 +25,7 @@ CmdSetMaterialColor = function ( object, attributeName, newValue ) {
}; };
CmdSetMaterialColor.prototype = { SetMaterialColorCommand.prototype = {
execute: function () { execute: function () {
...@@ -49,7 +49,7 @@ CmdSetMaterialColor.prototype = { ...@@ -49,7 +49,7 @@ CmdSetMaterialColor.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.attributeName = this.attributeName; output.attributeName = this.attributeName;
...@@ -62,7 +62,7 @@ CmdSetMaterialColor.prototype = { ...@@ -62,7 +62,7 @@ CmdSetMaterialColor.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.attributeName = json.attributeName; this.attributeName = json.attributeName;
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
* @constructor * @constructor
*/ */
CmdSetMaterial = function ( object, newMaterial ) { var SetMaterialCommand = function ( object, newMaterial ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetMaterial'; this.type = 'SetMaterialCommand';
this.name = 'New Material'; this.name = 'New Material';
this.object = object; this.object = object;
...@@ -22,7 +22,7 @@ CmdSetMaterial = function ( object, newMaterial ) { ...@@ -22,7 +22,7 @@ CmdSetMaterial = function ( object, newMaterial ) {
}; };
CmdSetMaterial.prototype = { SetMaterialCommand.prototype = {
execute: function () { execute: function () {
...@@ -40,7 +40,7 @@ CmdSetMaterial.prototype = { ...@@ -40,7 +40,7 @@ CmdSetMaterial.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.oldMaterial = this.oldMaterial.toJSON(); output.oldMaterial = this.oldMaterial.toJSON();
...@@ -52,7 +52,7 @@ CmdSetMaterial.prototype = { ...@@ -52,7 +52,7 @@ CmdSetMaterial.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.oldMaterial = parseMaterial( json.oldMaterial ); this.oldMaterial = parseMaterial( json.oldMaterial );
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* @constructor * @constructor
*/ */
CmdSetMaterialMap = function ( object, mapName, newMap ) { var SetMaterialMapCommand = function ( object, mapName, newMap ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetMaterialMap'; this.type = 'SetMaterialMapCommand';
this.name = 'Set Material.' + mapName; this.name = 'Set Material.' + mapName;
this.object = object; this.object = object;
...@@ -23,7 +23,7 @@ CmdSetMaterialMap = function ( object, mapName, newMap ) { ...@@ -23,7 +23,7 @@ CmdSetMaterialMap = function ( object, mapName, newMap ) {
}; };
CmdSetMaterialMap.prototype = { SetMaterialMapCommand.prototype = {
execute: function () { execute: function () {
...@@ -43,7 +43,7 @@ CmdSetMaterialMap.prototype = { ...@@ -43,7 +43,7 @@ CmdSetMaterialMap.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.mapName = this.mapName; output.mapName = this.mapName;
...@@ -97,7 +97,7 @@ CmdSetMaterialMap.prototype = { ...@@ -97,7 +97,7 @@ CmdSetMaterialMap.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.mapName = json.mapName; this.mapName = json.mapName;
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetMaterialValue = function ( object, attributeName, newValue ) { var SetMaterialValueCommand = function ( object, attributeName, newValue ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetMaterialValue'; this.type = 'SetMaterialValueCommand';
this.name = 'Set Material.' + attributeName; this.name = 'Set Material.' + attributeName;
this.updatable = true; this.updatable = true;
...@@ -25,7 +25,7 @@ CmdSetMaterialValue = function ( object, attributeName, newValue ) { ...@@ -25,7 +25,7 @@ CmdSetMaterialValue = function ( object, attributeName, newValue ) {
}; };
CmdSetMaterialValue.prototype = { SetMaterialValueCommand.prototype = {
execute: function () { execute: function () {
...@@ -51,7 +51,7 @@ CmdSetMaterialValue.prototype = { ...@@ -51,7 +51,7 @@ CmdSetMaterialValue.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.attributeName = this.attributeName; output.attributeName = this.attributeName;
...@@ -64,7 +64,7 @@ CmdSetMaterialValue.prototype = { ...@@ -64,7 +64,7 @@ CmdSetMaterialValue.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.attributeName = json.attributeName; this.attributeName = json.attributeName;
this.oldValue = json.oldValue; this.oldValue = json.oldValue;
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetPosition = function ( object, newPosition, optionalOldPosition ) { var SetPositionCommand = function ( object, newPosition, optionalOldPosition ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetPosition'; this.type = 'SetPositionCommand';
this.name = 'Set Position'; this.name = 'Set Position';
this.updatable = true; this.updatable = true;
...@@ -34,7 +34,7 @@ CmdSetPosition = function ( object, newPosition, optionalOldPosition ) { ...@@ -34,7 +34,7 @@ CmdSetPosition = function ( object, newPosition, optionalOldPosition ) {
} }
}; };
CmdSetPosition.prototype = { SetPositionCommand.prototype = {
execute: function () { execute: function () {
...@@ -60,7 +60,7 @@ CmdSetPosition.prototype = { ...@@ -60,7 +60,7 @@ CmdSetPosition.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.oldPosition = this.oldPosition.toArray(); output.oldPosition = this.oldPosition.toArray();
...@@ -72,7 +72,7 @@ CmdSetPosition.prototype = { ...@@ -72,7 +72,7 @@ CmdSetPosition.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.oldPosition = new THREE.Vector3().fromArray( json.oldPosition ); this.oldPosition = new THREE.Vector3().fromArray( json.oldPosition );
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetRotation = function ( object, newRotation, optionalOldRotation ) { var SetRotationCommand = function ( object, newRotation, optionalOldRotation ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetRotation'; this.type = 'SetRotationCommand';
this.name = 'Set Rotation'; this.name = 'Set Rotation';
this.updatable = true; this.updatable = true;
...@@ -35,7 +35,7 @@ CmdSetRotation = function ( object, newRotation, optionalOldRotation ) { ...@@ -35,7 +35,7 @@ CmdSetRotation = function ( object, newRotation, optionalOldRotation ) {
}; };
CmdSetRotation.prototype = { SetRotationCommand.prototype = {
execute: function () { execute: function () {
...@@ -61,7 +61,7 @@ CmdSetRotation.prototype = { ...@@ -61,7 +61,7 @@ CmdSetRotation.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.oldRotation = this.oldRotation.toArray(); output.oldRotation = this.oldRotation.toArray();
...@@ -73,7 +73,7 @@ CmdSetRotation.prototype = { ...@@ -73,7 +73,7 @@ CmdSetRotation.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.oldRotation = new THREE.Euler().fromArray( json.oldRotation ); this.oldRotation = new THREE.Euler().fromArray( json.oldRotation );
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetScale = function ( object, newScale, optionalOldScale ) { var SetScaleCommand = function ( object, newScale, optionalOldScale ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetScale'; this.type = 'SetScaleCommand';
this.name = 'Set Scale'; this.name = 'Set Scale';
this.updatable = true; this.updatable = true;
...@@ -35,7 +35,7 @@ CmdSetScale = function ( object, newScale, optionalOldScale ) { ...@@ -35,7 +35,7 @@ CmdSetScale = function ( object, newScale, optionalOldScale ) {
}; };
CmdSetScale.prototype = { SetScaleCommand.prototype = {
execute: function () { execute: function () {
...@@ -61,7 +61,7 @@ CmdSetScale.prototype = { ...@@ -61,7 +61,7 @@ CmdSetScale.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.oldScale = this.oldScale.toArray(); output.oldScale = this.oldScale.toArray();
...@@ -73,7 +73,7 @@ CmdSetScale.prototype = { ...@@ -73,7 +73,7 @@ CmdSetScale.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.object = this.editor.objectByUuid( json.objectUuid ); this.object = this.editor.objectByUuid( json.objectUuid );
this.oldScale = new THREE.Vector3().fromArray( json.oldScale ); this.oldScale = new THREE.Vector3().fromArray( json.oldScale );
......
...@@ -8,25 +8,25 @@ ...@@ -8,25 +8,25 @@
* @constructor * @constructor
*/ */
CmdSetScene = function ( scene ) { var SetSceneCommand = function ( scene ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetScene'; this.type = 'SetSceneCommand';
this.name = 'Set Scene'; this.name = 'Set Scene';
this.cmdArray = []; this.cmdArray = [];
if ( scene !== undefined ) { if ( scene !== undefined ) {
this.cmdArray.push( new CmdSetUuid( this.editor.scene, scene.uuid ) ); this.cmdArray.push( new SetUuidCommand( this.editor.scene, scene.uuid ) );
this.cmdArray.push( new CmdSetValue( this.editor.scene, 'name', scene.name ) ); this.cmdArray.push( new SetValueCommand( this.editor.scene, 'name', scene.name ) );
this.cmdArray.push( new CmdSetValue( this.editor.scene, 'userData', JSON.parse( JSON.stringify( scene.userData ) ) ) ); this.cmdArray.push( new SetValueCommand( this.editor.scene, 'userData', JSON.parse( JSON.stringify( scene.userData ) ) ) );
while ( scene.children.length > 0 ) { while ( scene.children.length > 0 ) {
var child = scene.children.pop(); var child = scene.children.pop();
this.cmdArray.push( new CmdAddObject( child ) ); this.cmdArray.push( new AddObjectCommand( child ) );
} }
...@@ -34,7 +34,7 @@ CmdSetScene = function ( scene ) { ...@@ -34,7 +34,7 @@ CmdSetScene = function ( scene ) {
}; };
CmdSetScene.prototype = { SetSceneCommand.prototype = {
execute: function () { execute: function () {
...@@ -68,7 +68,7 @@ CmdSetScene.prototype = { ...@@ -68,7 +68,7 @@ CmdSetScene.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
var cmds = []; var cmds = [];
for ( var i = 0; i < this.cmdArray.length; i ++ ) { for ( var i = 0; i < this.cmdArray.length; i ++ ) {
...@@ -84,7 +84,7 @@ CmdSetScene.prototype = { ...@@ -84,7 +84,7 @@ CmdSetScene.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
var cmds = json.cmds; var cmds = json.cmds;
for ( var i = 0; i < cmds.length; i ++ ) { for ( var i = 0; i < cmds.length; i ++ ) {
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
* @constructor * @constructor
*/ */
CmdSetScriptValue = function ( object, script, attributeName, newValue, cursorPosition ) { var SetScriptValueCommand = function ( object, script, attributeName, newValue, cursorPosition ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetScriptValue'; this.type = 'SetScriptValueCommand';
this.name = 'Set Script.' + attributeName; this.name = 'Set Script.' + attributeName;
this.updatable = true; this.updatable = true;
...@@ -30,7 +30,7 @@ CmdSetScriptValue = function ( object, script, attributeName, newValue, cursorPo ...@@ -30,7 +30,7 @@ CmdSetScriptValue = function ( object, script, attributeName, newValue, cursorPo
}; };
CmdSetScriptValue.prototype = { SetScriptValueCommand.prototype = {
execute: function () { execute: function () {
...@@ -59,7 +59,7 @@ CmdSetScriptValue.prototype = { ...@@ -59,7 +59,7 @@ CmdSetScriptValue.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.index = this.editor.scripts[ this.object.uuid ].indexOf( this.script ); output.index = this.editor.scripts[ this.object.uuid ].indexOf( this.script );
...@@ -74,7 +74,7 @@ CmdSetScriptValue.prototype = { ...@@ -74,7 +74,7 @@ CmdSetScriptValue.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.oldValue = json.oldValue; this.oldValue = json.oldValue;
this.newValue = json.newValue; this.newValue = json.newValue;
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
* @constructor * @constructor
*/ */
CmdSetUuid = function ( object, newUuid ) { var SetUuidCommand = function ( object, newUuid ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetUuid'; this.type = 'SetUuidCommand';
this.name = 'Update UUID'; this.name = 'Update UUID';
this.object = object; this.object = object;
...@@ -23,7 +23,7 @@ CmdSetUuid = function ( object, newUuid ) { ...@@ -23,7 +23,7 @@ CmdSetUuid = function ( object, newUuid ) {
}; };
CmdSetUuid.prototype = { SetUuidCommand.prototype = {
execute: function () { execute: function () {
...@@ -43,7 +43,7 @@ CmdSetUuid.prototype = { ...@@ -43,7 +43,7 @@ CmdSetUuid.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.oldUuid = this.oldUuid; output.oldUuid = this.oldUuid;
output.newUuid = this.newUuid; output.newUuid = this.newUuid;
...@@ -54,7 +54,7 @@ CmdSetUuid.prototype = { ...@@ -54,7 +54,7 @@ CmdSetUuid.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.oldUuid = json.oldUuid; this.oldUuid = json.oldUuid;
this.newUuid = json.newUuid; this.newUuid = json.newUuid;
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
* @constructor * @constructor
*/ */
CmdSetValue = function ( object, attributeName, newValue ) { var SetValueCommand = function ( object, attributeName, newValue ) {
Cmd.call( this ); Command.call( this );
this.type = 'CmdSetValue'; this.type = 'SetValueCommand';
this.name = 'Set ' + attributeName; this.name = 'Set ' + attributeName;
this.updatable = true; this.updatable = true;
...@@ -25,7 +25,7 @@ CmdSetValue = function ( object, attributeName, newValue ) { ...@@ -25,7 +25,7 @@ CmdSetValue = function ( object, attributeName, newValue ) {
}; };
CmdSetValue.prototype = { SetValueCommand.prototype = {
execute: function () { execute: function () {
...@@ -51,7 +51,7 @@ CmdSetValue.prototype = { ...@@ -51,7 +51,7 @@ CmdSetValue.prototype = {
toJSON: function () { toJSON: function () {
var output = Cmd.prototype.toJSON.call( this ); var output = Command.prototype.toJSON.call( this );
output.objectUuid = this.object.uuid; output.objectUuid = this.object.uuid;
output.attributeName = this.attributeName; output.attributeName = this.attributeName;
...@@ -64,7 +64,7 @@ CmdSetValue.prototype = { ...@@ -64,7 +64,7 @@ CmdSetValue.prototype = {
fromJSON: function ( json ) { fromJSON: function ( json ) {
Cmd.prototype.fromJSON.call( this, json ); Command.prototype.fromJSON.call( this, json );
this.attributeName = json.attributeName; this.attributeName = json.attributeName;
this.oldValue = json.oldValue; this.oldValue = json.oldValue;
......
...@@ -158,12 +158,12 @@ UI.Outliner = function ( editor ) { ...@@ -158,12 +158,12 @@ UI.Outliner = function ( editor ) {
if ( item.nextSibling === null ) { if ( item.nextSibling === null ) {
editor.execute( new CmdMoveObject( object, editor.scene ) ); editor.execute( new MoveObjectCommand( object, editor.scene ) );
} else { } else {
var nextObject = scene.getObjectById( item.nextSibling.value ); var nextObject = scene.getObjectById( item.nextSibling.value );
editor.execute( new CmdMoveObject( object, nextObject.parent, nextObject ) ); editor.execute( new MoveObjectCommand( object, nextObject.parent, nextObject ) );
} }
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdAddObjectAndCmdRemoveObject" ); module( "AddObjectCommandAndRemoveObjectCommand" );
test( "Test CmdAddObject and CmdRemoveObject (Undo and Redo)", function() { test( "Test AddObjectCommand and RemoveObjectCommand (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
...@@ -19,7 +19,7 @@ test( "Test CmdAddObject and CmdRemoveObject (Undo and Redo)", function() { ...@@ -19,7 +19,7 @@ test( "Test CmdAddObject and CmdRemoveObject (Undo and Redo)", function() {
objects.map( function( object ) { objects.map( function( object ) {
// Test Add // Test Add
var cmd = new CmdAddObject( object ); var cmd = new AddObjectCommand( object );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -35,7 +35,7 @@ test( "Test CmdAddObject and CmdRemoveObject (Undo and Redo)", function() { ...@@ -35,7 +35,7 @@ test( "Test CmdAddObject and CmdRemoveObject (Undo and Redo)", function() {
// Test Remove // Test Remove
var cmd = new CmdRemoveObject( object ); var cmd = new RemoveObjectCommand( object );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdAddScript" ); module( "AddScriptCommand" );
test( "Test CmdAddScript (Undo and Redo)", function() { test( "Test AddScriptCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
...@@ -21,7 +21,7 @@ test( "Test CmdAddScript (Undo and Redo)", function() { ...@@ -21,7 +21,7 @@ test( "Test CmdAddScript (Undo and Redo)", function() {
// add objects to editor // add objects to editor
objects.map( function( item ) { objects.map( function( item ) {
editor.execute( new CmdAddObject( item ) ); editor.execute( new AddObjectCommand( item ) );
} ); } );
ok( editor.scene.children.length == 2, "OK, the box and the sphere have been added" ); ok( editor.scene.children.length == 2, "OK, the box and the sphere have been added" );
...@@ -29,7 +29,7 @@ test( "Test CmdAddScript (Undo and Redo)", function() { ...@@ -29,7 +29,7 @@ test( "Test CmdAddScript (Undo and Redo)", function() {
// add scripts to the objects // add scripts to the objects
for ( var i = 0; i < scripts.length; i ++ ) { for ( var i = 0; i < scripts.length; i ++ ) {
var cmd = new CmdAddScript( objects[ i ], scripts[ i ] ); var cmd = new AddScriptCommand( objects[ i ], scripts[ i ] );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -16,7 +16,7 @@ test( "MassUndoAndRedo (stress test)", function() { ...@@ -16,7 +16,7 @@ test( "MassUndoAndRedo (stress test)", function() {
while ( i < MAX_OBJECTS ) { while ( i < MAX_OBJECTS ) {
var object = aSphere( 'Sphere #' + i ); var object = aSphere( 'Sphere #' + i );
var cmd = new CmdAddObject( object ); var cmd = new AddObjectCommand( object );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdMoveObject" ); module( "MoveObjectCommand" );
test( "Test CmdMoveObject (Undo and Redo)", function() { test( "Test MoveObjectCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
...@@ -15,15 +15,15 @@ test( "Test CmdMoveObject (Undo and Redo)", function() { ...@@ -15,15 +15,15 @@ test( "Test CmdMoveObject (Undo and Redo)", function() {
var anakinSkywalker = aSphere( anakinsName ); var anakinSkywalker = aSphere( anakinsName );
var lukeSkywalker = aBox( lukesName ); var lukeSkywalker = aBox( lukesName );
editor.execute( new CmdAddObject( anakinSkywalker ) ); editor.execute( new AddObjectCommand( anakinSkywalker ) );
editor.execute( new CmdAddObject( lukeSkywalker ) ); editor.execute( new AddObjectCommand( lukeSkywalker ) );
ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is 'Scene' " ); ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is 'Scene' " );
ok( lukeSkywalker.parent.name == "Scene", "OK, Luke's parent is 'Scene' " ); ok( lukeSkywalker.parent.name == "Scene", "OK, Luke's parent is 'Scene' " );
// Tell Luke, Anakin is his father // Tell Luke, Anakin is his father
editor.execute( new CmdMoveObject( lukeSkywalker, anakinSkywalker ) ); editor.execute( new MoveObjectCommand( lukeSkywalker, anakinSkywalker ) );
ok( true === true, "(Luke has been told who his father is)" ); ok( true === true, "(Luke has been told who his father is)" );
ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is still 'Scene' " ); ok( anakinSkywalker.parent.name == "Scene", "OK, Anakin's parent is still 'Scene' " );
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdMultiCmds" ); module( "MultiCmdsCommand" );
test( "Test CmdMultiCmds (Undo and Redo)", function() { test( "Test MultiCmdsCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
var box = aBox( 'Multi Command Box' ); var box = aBox( 'Multi Command Box' );
...@@ -13,17 +13,17 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() { ...@@ -13,17 +13,17 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() {
var boxGeometry2 = { geometry: { parameters: { width: 50, height: 51, depth: 52, widthSegments: 7, heightSegments: 8, depthSegments: 9 } } }; var boxGeometry2 = { geometry: { parameters: { width: 50, height: 51, depth: 52, widthSegments: 7, heightSegments: 8, depthSegments: 9 } } };
var boxGeometries = [ getGeometry( "BoxGeometry", boxGeometry1 ), getGeometry( "BoxGeometry", boxGeometry2 ) ]; var boxGeometries = [ getGeometry( "BoxGeometry", boxGeometry1 ), getGeometry( "BoxGeometry", boxGeometry2 ) ];
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
// setup first multi commands // setup first multi commands
var firstMultiCmds = [ var firstMultiCmds = [
new CmdSetGeometry( box, boxGeometries[ 0 ] ), new SetGeometryCommand( box, boxGeometries[ 0 ] ),
new CmdSetPosition( box, new THREE.Vector3( 1, 2, 3 ) ), new SetPositionCommand( box, new THREE.Vector3( 1, 2, 3 ) ),
new CmdSetRotation( box, new THREE.Euler( 0.1, 0.2, 0.2 ) ), new SetRotationCommand( box, new THREE.Euler( 0.1, 0.2, 0.2 ) ),
new CmdSetScale( box, new THREE.Vector3( 1.1, 1.2, 1.3 ) ) new SetScaleCommand( box, new THREE.Vector3( 1.1, 1.2, 1.3 ) )
]; ];
...@@ -33,7 +33,7 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() { ...@@ -33,7 +33,7 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() {
} ); } );
var firstMultiCmd = new CmdMultiCmds( firstMultiCmds ); var firstMultiCmd = new MultiCmdsCommand( firstMultiCmds );
firstMultiCmd.updatable = false; firstMultiCmd.updatable = false;
editor.execute( firstMultiCmd ); editor.execute( firstMultiCmd );
...@@ -41,10 +41,10 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() { ...@@ -41,10 +41,10 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() {
// setup second multi commands // setup second multi commands
var secondMultiCmds = [ var secondMultiCmds = [
new CmdSetGeometry( box, boxGeometries[ 1 ] ), new SetGeometryCommand( box, boxGeometries[ 1 ] ),
new CmdSetPosition( box, new THREE.Vector3( 4, 5, 6 ) ), new SetPositionCommand( box, new THREE.Vector3( 4, 5, 6 ) ),
new CmdSetRotation( box, new THREE.Euler( 0.4, 0.5, 0.6 ) ), new SetRotationCommand( box, new THREE.Euler( 0.4, 0.5, 0.6 ) ),
new CmdSetScale( box, new THREE.Vector3( 1.4, 1.5, 1.6 ) ) new SetScaleCommand( box, new THREE.Vector3( 1.4, 1.5, 1.6 ) )
]; ];
...@@ -54,7 +54,7 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() { ...@@ -54,7 +54,7 @@ test( "Test CmdMultiCmds (Undo and Redo)", function() {
} ); } );
var secondMultiCmd = new CmdMultiCmds( secondMultiCmds ); var secondMultiCmd = new MultiCmdsCommand( secondMultiCmds );
secondMultiCmd.updatable = false; secondMultiCmd.updatable = false;
editor.execute( secondMultiCmd ); editor.execute( secondMultiCmd );
......
...@@ -21,7 +21,7 @@ test( "Test unwanted situations ", function() { ...@@ -21,7 +21,7 @@ test( "Test unwanted situations ", function() {
var box = aBox(); var box = aBox();
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -32,16 +32,16 @@ test( "Test nested Do's, Undo's and Redo's", function() { ...@@ -32,16 +32,16 @@ test( "Test nested Do's, Undo's and Redo's", function() {
mesh.scale.z = initScaleZ ; mesh.scale.z = initScaleZ ;
// let's begin // let's begin
editor.execute( new CmdAddObject( mesh ) ); editor.execute( new AddObjectCommand( mesh ) );
var newPos = new THREE.Vector3( initPosX + 100, initPosY, initPosZ ); var newPos = new THREE.Vector3( initPosX + 100, initPosY, initPosZ );
editor.execute( new CmdSetPosition( mesh, newPos ) ); editor.execute( new SetPositionCommand( mesh, newPos ) );
var newRotation = new THREE.Euler( initRotationX, initRotationY + 1000, initRotationZ ); var newRotation = new THREE.Euler( initRotationX, initRotationY + 1000, initRotationZ );
editor.execute( new CmdSetRotation( mesh, newRotation ) ); editor.execute( new SetRotationCommand( mesh, newRotation ) );
var newScale = new THREE.Vector3( initScaleX, initScaleY, initScaleZ + 10000 ); var newScale = new THREE.Vector3( initScaleX, initScaleY, initScaleZ + 10000 );
editor.execute( new CmdSetScale( mesh, newScale ) ); editor.execute( new SetScaleCommand( mesh, newScale ) );
/* full check */ /* full check */
...@@ -81,7 +81,7 @@ test( "Test nested Do's, Undo's and Redo's", function() { ...@@ -81,7 +81,7 @@ test( "Test nested Do's, Undo's and Redo's", function() {
editor.redo(); // translation redone editor.redo(); // translation redone
editor.redo(); // rotation redone editor.redo(); // rotation redone
editor.execute( new CmdRemoveObject( mesh ) ); editor.execute( new RemoveObjectCommand( mesh ) );
ok( editor.scene.children.length == 0, "OK, object removal was successful" ); ok( editor.scene.children.length == 0, "OK, object removal was successful" );
editor.undo(); // removal undone editor.undo(); // removal undone
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdRemoveScript" ); module( "RemoveScriptCommand" );
test( "Test CmdRemoveScript (Undo and Redo)", function() { test( "Test RemoveScriptCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
...@@ -21,7 +21,7 @@ test( "Test CmdRemoveScript (Undo and Redo)", function() { ...@@ -21,7 +21,7 @@ test( "Test CmdRemoveScript (Undo and Redo)", function() {
// add objects to editor // add objects to editor
objects.map( function( item ) { objects.map( function( item ) {
editor.execute( new CmdAddObject( item ) ); editor.execute( new AddObjectCommand( item ) );
} ); } );
ok( editor.scene.children.length == 2, "OK, the box and the sphere have been added" ); ok( editor.scene.children.length == 2, "OK, the box and the sphere have been added" );
...@@ -29,7 +29,7 @@ test( "Test CmdRemoveScript (Undo and Redo)", function() { ...@@ -29,7 +29,7 @@ test( "Test CmdRemoveScript (Undo and Redo)", function() {
// add scripts to the objects // add scripts to the objects
for ( var i = 0; i < scripts.length; i ++ ) { for ( var i = 0; i < scripts.length; i ++ ) {
var cmd = new CmdAddScript( objects[ i ], scripts[ i ] ); var cmd = new AddScriptCommand( objects[ i ], scripts[ i ] );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -37,7 +37,7 @@ test( "Test CmdRemoveScript (Undo and Redo)", function() { ...@@ -37,7 +37,7 @@ test( "Test CmdRemoveScript (Undo and Redo)", function() {
for ( var i = 0; i < scripts.length; i ++ ) { for ( var i = 0; i < scripts.length; i ++ ) {
var cmd = new CmdRemoveScript( objects[ i ], scripts[ i ] ); var cmd = new RemoveScriptCommand( objects[ i ], scripts[ i ] );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -25,7 +25,7 @@ test( "Test Serialization", function( assert ) { ...@@ -25,7 +25,7 @@ test( "Test Serialization", function( assert ) {
var box = aBox( 'The Box' ); var box = aBox( 'The Box' );
// Test Add // Test Add
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -41,10 +41,10 @@ test( "Test Serialization", function( assert ) { ...@@ -41,10 +41,10 @@ test( "Test Serialization", function( assert ) {
// Test Add // Test Add
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
editor.execute( cmd ); editor.execute( cmd );
var cmd = new CmdAddScript( box, { "name": "test", "source": "console.log(\"hello world\");" } ); var cmd = new AddScriptCommand( box, { "name": "test", "source": "console.log(\"hello world\");" } );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -61,11 +61,11 @@ test( "Test Serialization", function( assert ) { ...@@ -61,11 +61,11 @@ test( "Test Serialization", function( assert ) {
var anakinSkywalker = aSphere( anakinsName ); var anakinSkywalker = aSphere( anakinsName );
var lukeSkywalker = aBox( lukesName ); var lukeSkywalker = aBox( lukesName );
editor.execute( new CmdAddObject( anakinSkywalker ) ); editor.execute( new AddObjectCommand( anakinSkywalker ) );
editor.execute( new CmdAddObject( lukeSkywalker ) ); editor.execute( new AddObjectCommand( lukeSkywalker ) );
// Tell Luke, Anakin is his father // Tell Luke, Anakin is his father
editor.execute( new CmdMoveObject( lukeSkywalker, anakinSkywalker ) ); editor.execute( new MoveObjectCommand( lukeSkywalker, anakinSkywalker ) );
return "moveObject"; return "moveObject";
...@@ -74,15 +74,15 @@ test( "Test Serialization", function( assert ) { ...@@ -74,15 +74,15 @@ test( "Test Serialization", function( assert ) {
var removeScript = function () { var removeScript = function () {
var box = aBox( 'Box with no script' ); var box = aBox( 'Box with no script' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var script = { "name": "test", "source": "console.log(\"hello world\");" } ; var script = { "name": "test", "source": "console.log(\"hello world\");" } ;
var cmd = new CmdAddScript( box, script ); var cmd = new AddScriptCommand( box, script );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
cmd = new CmdRemoveScript( box, script ); cmd = new RemoveScriptCommand( box, script );
editor.execute( cmd ); editor.execute( cmd );
return "removeScript"; return "removeScript";
...@@ -93,8 +93,8 @@ test( "Test Serialization", function( assert ) { ...@@ -93,8 +93,8 @@ test( "Test Serialization", function( assert ) {
var pointLight = aPointlight( "The light Light" ); var pointLight = aPointlight( "The light Light" );
editor.execute( new CmdAddObject( pointLight ) ); editor.execute( new AddObjectCommand( pointLight ) );
var cmd = new CmdSetColor( pointLight, 'color', green ); var cmd = new SetColorCommand( pointLight, 'color', green );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -107,9 +107,9 @@ test( "Test Serialization", function( assert ) { ...@@ -107,9 +107,9 @@ test( "Test Serialization", function( assert ) {
var box = aBox( 'Guinea Pig' ); // default ( 100, 100, 100, 1, 1, 1 ) var box = aBox( 'Guinea Pig' ); // default ( 100, 100, 100, 1, 1, 1 )
var boxGeometry = { geometry: { parameters: { width: 200, height: 201, depth: 202, widthSegments: 2, heightSegments: 3, depthSegments: 4 } } }; var boxGeometry = { geometry: { parameters: { width: 200, height: 201, depth: 202, widthSegments: 2, heightSegments: 3, depthSegments: 4 } } };
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var cmd = new CmdSetGeometry( box, getGeometry( "BoxGeometry", boxGeometry ) ); var cmd = new SetGeometryCommand( box, getGeometry( "BoxGeometry", boxGeometry ) );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -120,9 +120,9 @@ test( "Test Serialization", function( assert ) { ...@@ -120,9 +120,9 @@ test( "Test Serialization", function( assert ) {
var setGeometryValue = function() { var setGeometryValue = function() {
var box = aBox( 'Geometry Value Box' ); var box = aBox( 'Geometry Value Box' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
cmd = new CmdSetGeometryValue( box, 'uuid', THREE.Math.generateUUID() ); cmd = new SetGeometryValueCommand( box, 'uuid', THREE.Math.generateUUID() );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -133,10 +133,10 @@ test( "Test Serialization", function( assert ) { ...@@ -133,10 +133,10 @@ test( "Test Serialization", function( assert ) {
var setMaterial = function () { var setMaterial = function () {
var sphere = aSphere( 'The Sun' ); var sphere = aSphere( 'The Sun' );
editor.execute( new CmdAddObject( sphere ) ); editor.execute( new AddObjectCommand( sphere ) );
var material = new THREE[ 'MeshPhongMaterial' ](); var material = new THREE[ 'MeshPhongMaterial' ]();
var cmd = new CmdSetMaterial( sphere, material ); var cmd = new SetMaterialCommand( sphere, material );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -147,9 +147,9 @@ test( "Test Serialization", function( assert ) { ...@@ -147,9 +147,9 @@ test( "Test Serialization", function( assert ) {
var setMaterialColor = function () { var setMaterialColor = function () {
var box = aBox( 'Box with colored material' ); var box = aBox( 'Box with colored material' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var cmd = new CmdSetMaterialColor( box, 'color', green ); var cmd = new SetMaterialColorCommand( box, 'color', green );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -160,7 +160,7 @@ test( "Test Serialization", function( assert ) { ...@@ -160,7 +160,7 @@ test( "Test Serialization", function( assert ) {
var setMaterialMap = function () { var setMaterialMap = function () {
var sphere = aSphere( 'Sphere with texture' ); var sphere = aSphere( 'Sphere with texture' );
editor.execute( new CmdAddObject( sphere ) ); editor.execute( new AddObjectCommand( sphere ) );
// dirt.png // dirt.png
var data = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDMjYxMEI4MzVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDMjYxMEI4NDVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMyNjEwQjgxNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMyNjEwQjgyNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+txizaQAAABVQTFRFh4eHbGxsdFhEWT0puYVclmxKeVU6ppwr+AAAAHtJREFUeNosjgEWBCEIQplFuP+RB5h9lZn2EZxkLzC3D1YSgSlmk7i0ctzDZNBz/VSoX1KwjlFI8WmA2R7JqUa0LJJcd1rLNWRRaMyi+3Y16qMKHhdE48XLsDyHKJ0nSMazY1fxHyriXxV584tmEedcfGNrA/5cmK8AAwCT9ATehDDyzwAAAABJRU5ErkJggg=='; var data = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDMjYxMEI4MzVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDMjYxMEI4NDVENDMxMUU1OTdEQUY4QkNGNUVENjg4MyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMyNjEwQjgxNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMyNjEwQjgyNUQ0MzExRTU5N0RBRjhCQ0Y1RUQ2ODgzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+txizaQAAABVQTFRFh4eHbGxsdFhEWT0puYVclmxKeVU6ppwr+AAAAHtJREFUeNosjgEWBCEIQplFuP+RB5h9lZn2EZxkLzC3D1YSgSlmk7i0ctzDZNBz/VSoX1KwjlFI8WmA2R7JqUa0LJJcd1rLNWRRaMyi+3Y16qMKHhdE48XLsDyHKJ0nSMazY1fxHyriXxV584tmEedcfGNrA/5cmK8AAwCT9ATehDDyzwAAAABJRU5ErkJggg==';
...@@ -170,7 +170,7 @@ test( "Test Serialization", function( assert ) { ...@@ -170,7 +170,7 @@ test( "Test Serialization", function( assert ) {
var texture = new THREE.Texture( img, 'map' ); var texture = new THREE.Texture( img, 'map' );
texture.sourceFile = 'dirt.png'; texture.sourceFile = 'dirt.png';
var cmd = new CmdSetMaterialMap( sphere, 'map', texture ); var cmd = new SetMaterialMapCommand( sphere, 'map', texture );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -181,9 +181,9 @@ test( "Test Serialization", function( assert ) { ...@@ -181,9 +181,9 @@ test( "Test Serialization", function( assert ) {
var setMaterialValue = function () { var setMaterialValue = function () {
var box = aBox( 'Box with values' ); var box = aBox( 'Box with values' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var cmd = new CmdSetMaterialValue( box, 'name', 'Bravo' ); var cmd = new SetMaterialValueCommand( box, 'name', 'Bravo' );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -194,10 +194,10 @@ test( "Test Serialization", function( assert ) { ...@@ -194,10 +194,10 @@ test( "Test Serialization", function( assert ) {
var setPosition = function () { var setPosition = function () {
var sphere = aSphere( 'Sphere with position' ); var sphere = aSphere( 'Sphere with position' );
editor.execute( new CmdAddObject( sphere ) ); editor.execute( new AddObjectCommand( sphere ) );
var newPosition = new THREE.Vector3( 101, 202, 303 ); var newPosition = new THREE.Vector3( 101, 202, 303 );
var cmd = new CmdSetPosition( sphere, newPosition ); var cmd = new SetPositionCommand( sphere, newPosition );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -208,10 +208,10 @@ test( "Test Serialization", function( assert ) { ...@@ -208,10 +208,10 @@ test( "Test Serialization", function( assert ) {
var setRotation = function () { var setRotation = function () {
var box = aBox( 'Box with rotation' ); var box = aBox( 'Box with rotation' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var newRotation = new THREE.Euler( 0.3, - 1.7, 2 ); var newRotation = new THREE.Euler( 0.3, - 1.7, 2 );
var cmd = new CmdSetRotation( box, newRotation ); var cmd = new SetRotationCommand( box, newRotation );
cmd.updatable = false; cmd.updatable = false;
editor.execute ( cmd ); editor.execute ( cmd );
...@@ -222,10 +222,10 @@ test( "Test Serialization", function( assert ) { ...@@ -222,10 +222,10 @@ test( "Test Serialization", function( assert ) {
var setScale = function () { var setScale = function () {
var sphere = aSphere( 'Sphere with scale' ); var sphere = aSphere( 'Sphere with scale' );
editor.execute( new CmdAddObject( sphere ) ); editor.execute( new AddObjectCommand( sphere ) );
var newScale = new THREE.Vector3( 1.2, 3.3, 4.6 ); var newScale = new THREE.Vector3( 1.2, 3.3, 4.6 );
var cmd = new CmdSetScale( sphere, newScale ); var cmd = new SetScaleCommand( sphere, newScale );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -236,12 +236,12 @@ test( "Test Serialization", function( assert ) { ...@@ -236,12 +236,12 @@ test( "Test Serialization", function( assert ) {
var setScriptValue = function () { var setScriptValue = function () {
var box = aBox( 'Box with script' ); var box = aBox( 'Box with script' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var script = { name: "Alert", source: "alert( null );" }; var script = { name: "Alert", source: "alert( null );" };
editor.execute( new CmdAddScript( box, script ) ); editor.execute( new AddScriptCommand( box, script ) );
var newScript = { name: "Console", source: "console.log( null );" }; var newScript = { name: "Console", source: "console.log( null );" };
var cmd = new CmdSetScriptValue( box, script, 'source', newScript.source, 0 ); var cmd = new SetScriptValueCommand( box, script, 'source', newScript.source, 0 );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -252,9 +252,9 @@ test( "Test Serialization", function( assert ) { ...@@ -252,9 +252,9 @@ test( "Test Serialization", function( assert ) {
var setUuid = function () { var setUuid = function () {
var sphere = aSphere( 'Sphere with UUID' ); var sphere = aSphere( 'Sphere with UUID' );
editor.execute( new CmdAddObject( sphere ) ); editor.execute( new AddObjectCommand( sphere ) );
var cmd = new CmdSetUuid( sphere, THREE.Math.generateUUID() ); var cmd = new SetUuidCommand( sphere, THREE.Math.generateUUID() );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -265,9 +265,9 @@ test( "Test Serialization", function( assert ) { ...@@ -265,9 +265,9 @@ test( "Test Serialization", function( assert ) {
var setValue = function () { var setValue = function () {
var box = aBox( 'Box with value' ); var box = aBox( 'Box with value' );
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var cmd = new CmdSetValue( box, 'intensity', 2.3 ); var cmd = new SetValueCommand( box, 'intensity', 2.3 );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetColor" ); module( "SetColorCommand" );
test( "Test CmdSetColor (Undo and Redo)", function() { test( "Test SetColorCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
var pointLight = aPointlight( "The light Light" ); var pointLight = aPointlight( "The light Light" );
editor.execute( new CmdAddObject( pointLight ) ); editor.execute( new AddObjectCommand( pointLight ) );
var green = 12581843; // bffbd3 var green = 12581843; // bffbd3
var blue = 14152447; // d7f2ff var blue = 14152447; // d7f2ff
...@@ -19,7 +19,7 @@ test( "Test CmdSetColor (Undo and Redo)", function() { ...@@ -19,7 +19,7 @@ test( "Test CmdSetColor (Undo and Redo)", function() {
colors.map( function( color ) { colors.map( function( color ) {
var cmd = new CmdSetColor( pointLight, 'color', color ); var cmd = new SetColorCommand( pointLight, 'color', color );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetGeometry" ); module( "SetGeometryCommand" );
test( "Test CmdSetGeometry (Undo and Redo)", function() { test( "Test SetGeometryCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
...@@ -17,13 +17,13 @@ test( "Test CmdSetGeometry (Undo and Redo)", function() { ...@@ -17,13 +17,13 @@ test( "Test CmdSetGeometry (Undo and Redo)", function() {
// add the object // add the object
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
for ( var i = 0; i < geometryParams.length; i ++ ) { for ( var i = 0; i < geometryParams.length; i ++ ) {
var cmd = new CmdSetGeometry( box, getGeometry( "BoxGeometry", geometryParams[ i ] ) ); var cmd = new SetGeometryCommand( box, getGeometry( "BoxGeometry", geometryParams[ i ] ) );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetGeometryValue" ); module( "SetGeometryValueCommand" );
test( "Test CmdSetGeometryValue (Undo and Redo)", function() { test( "Test SetGeometryValueCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
var box = aBox( 'The Box' ); var box = aBox( 'The Box' );
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -25,7 +25,7 @@ test( "Test CmdSetGeometryValue (Undo and Redo)", function() { ...@@ -25,7 +25,7 @@ test( "Test CmdSetGeometryValue (Undo and Redo)", function() {
keys.map( function( key ) { keys.map( function( key ) {
cmd = new CmdSetGeometryValue( box, key, testData[ i ][ key ] ); cmd = new SetGeometryValueCommand( box, key, testData[ i ][ key ] );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetMaterialColor" ); module( "SetMaterialColorCommand" );
test( "Test for CmdSetMaterialColor (Undo and Redo)", function() { test( "Test for SetMaterialColorCommand (Undo and Redo)", function() {
// Setup scene // Setup scene
var editor = new Editor(); var editor = new Editor();
var box = aBox(); var box = aBox();
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -25,7 +25,7 @@ test( "Test for CmdSetMaterialColor (Undo and Redo)", function() { ...@@ -25,7 +25,7 @@ test( "Test for CmdSetMaterialColor (Undo and Redo)", function() {
colors.map( function ( color ) { colors.map( function ( color ) {
var cmd = new CmdSetMaterialColor( box, attributeName, color ); var cmd = new SetMaterialColorCommand( box, attributeName, color );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetMaterial" ); module( "SetMaterialCommand" );
test( "Test for CmdSetMaterial (Undo and Redo)", function() { test( "Test for SetMaterialCommand (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
var box = aBox( 'Material girl in a material world' ); var box = aBox( 'Material girl in a material world' );
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -31,7 +31,7 @@ test( "Test for CmdSetMaterial (Undo and Redo)", function() { ...@@ -31,7 +31,7 @@ test( "Test for CmdSetMaterial (Undo and Redo)", function() {
materialClasses.map( function( materialClass ) { materialClasses.map( function( materialClass ) {
material = new THREE[ materialClass ](); material = new THREE[ materialClass ]();
editor.execute( new CmdSetMaterial( box, material ) ); editor.execute( new SetMaterialCommand( box, material ) );
} ); } );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetMaterialMap" ); module( "SetMaterialMapCommand" );
test( "Test for CmdSetMaterialMap (Undo and Redo)", function() { test( "Test for SetMaterialMapCommand (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
var box = aBox( 'Material mapped box' ); var box = aBox( 'Material mapped box' );
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -47,7 +47,7 @@ test( "Test for CmdSetMaterialMap (Undo and Redo)", function() { ...@@ -47,7 +47,7 @@ test( "Test for CmdSetMaterialMap (Undo and Redo)", function() {
// apply the textures // apply the textures
textures.map( function( texture ) { textures.map( function( texture ) {
var cmd = new CmdSetMaterialMap( box, mapName, texture ); var cmd = new SetMaterialMapCommand( box, mapName, texture );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetMaterialValue" ); module( "SetMaterialValueCommand" );
test( "Test for CmdSetMaterialValue (Undo and Redo)", function() { test( "Test for SetMaterialValueCommand (Undo and Redo)", function() {
// setup scene // setup scene
var editor = new Editor(); var editor = new Editor();
var box = aBox(); var box = aBox();
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -39,7 +39,7 @@ test( "Test for CmdSetMaterialValue (Undo and Redo)", function() { ...@@ -39,7 +39,7 @@ test( "Test for CmdSetMaterialValue (Undo and Redo)", function() {
testData[ attributeName ].map( function( value ) { testData[ attributeName ].map( function( value ) {
var cmd = new CmdSetMaterialValue( box, attributeName, value ); var cmd = new SetMaterialValueCommand( box, attributeName, value );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetPosition" ); module( "SetPositionCommand" );
test( "Test CmdSetPosition (Undo and Redo)", function() { test( "Test SetPositionCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
var box = aBox(); var box = aBox();
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
editor.execute( cmd ); editor.execute( cmd );
var positions = [ var positions = [
...@@ -23,7 +23,7 @@ test( "Test CmdSetPosition (Undo and Redo)", function() { ...@@ -23,7 +23,7 @@ test( "Test CmdSetPosition (Undo and Redo)", function() {
positions.map( function( position ) { positions.map( function( position ) {
var newPosition = new THREE.Vector3( position.x, position.y, position.z ); var newPosition = new THREE.Vector3( position.x, position.y, position.z );
var cmd = new CmdSetPosition( box, newPosition ); var cmd = new SetPositionCommand( box, newPosition );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetRotation" ); module( "SetRotationCommand" );
test( "Test CmdSetRotation (Undo and Redo)", function() { test( "Test SetRotationCommand (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
var box = aBox(); var box = aBox();
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
var rotations = [ var rotations = [
...@@ -25,7 +25,7 @@ test( "Test CmdSetRotation (Undo and Redo)", function() { ...@@ -25,7 +25,7 @@ test( "Test CmdSetRotation (Undo and Redo)", function() {
rotations.map( function( rotation ) { rotations.map( function( rotation ) {
var newRotation = new THREE.Euler( rotation.x, rotation.y, rotation.z ); var newRotation = new THREE.Euler( rotation.x, rotation.y, rotation.z );
var cmd = new CmdSetRotation( box, newRotation ); var cmd = new SetRotationCommand( box, newRotation );
cmd.updatable = false; cmd.updatable = false;
editor.execute ( cmd ); editor.execute ( cmd );
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetScale" ); module( "SetScaleCommand" );
test( "Test CmdSetScale (Undo and Redo)", function() { test( "Test SetScaleCommand (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
var box = aBox(); var box = aBox();
editor.execute( new CmdAddObject( box ) ); editor.execute( new AddObjectCommand( box ) );
// scales // scales
...@@ -25,7 +25,7 @@ test( "Test CmdSetScale (Undo and Redo)", function() { ...@@ -25,7 +25,7 @@ test( "Test CmdSetScale (Undo and Redo)", function() {
scales.map( function( scale ) { scales.map( function( scale ) {
var newScale = new THREE.Vector3( scale.x, scale.y, scale.z ); var newScale = new THREE.Vector3( scale.x, scale.y, scale.z );
var cmd = new CmdSetScale( box, newScale ); var cmd = new SetScaleCommand( box, newScale );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
module( "TestCmdSetScene" ); module( "TestCmdSetScene" );
test( "Test for CmdSetScene (Undo and Redo)", function() { test( "Test for SetSceneCommand (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
...@@ -16,7 +16,7 @@ test( "Test for CmdSetScene (Undo and Redo)", function() { ...@@ -16,7 +16,7 @@ test( "Test for CmdSetScene (Undo and Redo)", function() {
var scenes = objects.map( function( object ) { var scenes = objects.map( function( object ) {
editor = new Editor(); editor = new Editor();
var cmd = new CmdAddObject( object ); var cmd = new AddObjectCommand( object );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
return { obj: object, exportedData: exportScene( editor ) }; return { obj: object, exportedData: exportScene( editor ) };
...@@ -29,7 +29,7 @@ test( "Test for CmdSetScene (Undo and Redo)", function() { ...@@ -29,7 +29,7 @@ test( "Test for CmdSetScene (Undo and Redo)", function() {
scenes.map( function( scene ) { scenes.map( function( scene ) {
var importedScene = importScene( scene.exportedData ); var importedScene = importScene( scene.exportedData );
var cmd = new CmdSetScene( importedScene ); var cmd = new SetSceneCommand( importedScene );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,20 +3,20 @@ ...@@ -3,20 +3,20 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetScriptValue" ); module( "SetScriptValueCommand" );
test( "Test CmdSetScriptValue for source (Undo and Redo)", function() { test( "Test SetScriptValueCommand for source (Undo and Redo)", function() {
// setup // setup
var editor = new Editor(); var editor = new Editor();
var box = aBox( "The scripted box" ); var box = aBox( "The scripted box" );
var cmd = new CmdAddObject( box ); var cmd = new AddObjectCommand( box );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
var translateScript = { name: "Translate", source: "function( update ) {}" }; var translateScript = { name: "Translate", source: "function( update ) {}" };
cmd = new CmdAddScript( box, translateScript ); cmd = new AddScriptCommand( box, translateScript );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -34,7 +34,7 @@ test( "Test CmdSetScriptValue for source (Undo and Redo)", function() { ...@@ -34,7 +34,7 @@ test( "Test CmdSetScriptValue for source (Undo and Redo)", function() {
testSourceData.map( function( script ) { testSourceData.map( function( script ) {
var cmd = new CmdSetScriptValue( box, translateScript, 'source', script.source, 0 ); var cmd = new SetScriptValueCommand( box, translateScript, 'source', script.source, 0 );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
...@@ -57,7 +57,7 @@ test( "Test CmdSetScriptValue for source (Undo and Redo)", function() { ...@@ -57,7 +57,7 @@ test( "Test CmdSetScriptValue for source (Undo and Redo)", function() {
names.map( function( name ) { names.map( function( name ) {
cmd = new CmdSetScriptValue( box, translateScript, 'name', name ); cmd = new SetScriptValueCommand( box, translateScript, 'name', name );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,20 +3,20 @@ ...@@ -3,20 +3,20 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetUuid" ); module( "SetUuidCommand" );
test( "Test CmdSetUuid (Undo and Redo)", function() { test( "Test SetUuidCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
var object = aBox( 'UUID test box' ); var object = aBox( 'UUID test box' );
editor.execute( new CmdAddObject( object ) ); editor.execute( new AddObjectCommand( object ) );
var uuids = [ THREE.Math.generateUUID(), THREE.Math.generateUUID(), THREE.Math.generateUUID() ]; var uuids = [ THREE.Math.generateUUID(), THREE.Math.generateUUID(), THREE.Math.generateUUID() ];
uuids.map( function( uuid ) { uuids.map( function( uuid ) {
var cmd = new CmdSetUuid( object, uuid ); var cmd = new SetUuidCommand( object, uuid );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch) * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/ */
module( "CmdSetValue" ); module( "SetValueCommand" );
test( "Test CmdSetValue (Undo and Redo)", function() { test( "Test SetValueCommand (Undo and Redo)", function() {
var editor = new Editor(); var editor = new Editor();
...@@ -18,7 +18,7 @@ test( "Test CmdSetValue (Undo and Redo)", function() { ...@@ -18,7 +18,7 @@ test( "Test CmdSetValue (Undo and Redo)", function() {
[ box, light, cam ].map( function( object ) { [ box, light, cam ].map( function( object ) {
editor.execute( new CmdAddObject( object ) ); editor.execute( new AddObjectCommand( object ) );
ok( 0 == 0, "Testing object of type '" + object.type + "'" ); ok( 0 == 0, "Testing object of type '" + object.type + "'" );
...@@ -26,12 +26,12 @@ test( "Test CmdSetValue (Undo and Redo)", function() { ...@@ -26,12 +26,12 @@ test( "Test CmdSetValue (Undo and Redo)", function() {
if ( object[ item ] !== undefined ) { if ( object[ item ] !== undefined ) {
var cmd = new CmdSetValue( object, item, valueBefore ); var cmd = new SetValueCommand( object, item, valueBefore );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
ok( object[ item ] == valueBefore, " OK, the attribute '" + item + "' is correct after first execute (expected: '" + valueBefore + "', actual: '" + object[ item ] + "')" ); ok( object[ item ] == valueBefore, " OK, the attribute '" + item + "' is correct after first execute (expected: '" + valueBefore + "', actual: '" + object[ item ] + "')" );
var cmd = new CmdSetValue( object, item, valueAfter ); var cmd = new SetValueCommand( object, item, valueAfter );
cmd.updatable = false; cmd.updatable = false;
editor.execute( cmd ); editor.execute( cmd );
ok( object[ item ] == valueAfter, " OK, the attribute '" + item + "' is correct after second execute (expected: '" + valueAfter + "', actual: '" + object[ item ] + "')" ); ok( object[ item ] == valueAfter, " OK, the attribute '" + item + "' is correct after second execute (expected: '" + valueAfter + "', actual: '" + object[ item ] + "')" );
......
...@@ -69,52 +69,52 @@ ...@@ -69,52 +69,52 @@
<script src="../../editor/js/History.js"></script> <script src="../../editor/js/History.js"></script>
<!-- command object classes --> <!-- command object classes -->
<script src="../../editor/js/Cmd.js"></script> <script src="../../editor/js/Command.js"></script>
<script src="../../editor/js/CmdAddObject.js"></script> <script src="../../editor/js/commands/AddObjectCommand.js"></script>
<script src="../../editor/js/CmdAddScript.js"></script> <script src="../../editor/js/commands/AddScriptCommand.js"></script>
<script src="../../editor/js/CmdMoveObject.js"></script> <script src="../../editor/js/commands/MoveObjectCommand.js"></script>
<script src="../../editor/js/CmdMultiCmds.js"></script> <script src="../../editor/js/commands/MultiCmdsCommand.js"></script>
<script src="../../editor/js/CmdRemoveObject.js"></script> <script src="../../editor/js/commands/RemoveObjectCommand.js"></script>
<script src="../../editor/js/CmdRemoveScript.js"></script> <script src="../../editor/js/commands/RemoveScriptCommand.js"></script>
<script src="../../editor/js/CmdSetColor.js"></script> <script src="../../editor/js/commands/SetColorCommand.js"></script>
<script src="../../editor/js/CmdSetGeometry.js"></script> <script src="../../editor/js/commands/SetGeometryCommand.js"></script>
<script src="../../editor/js/CmdSetGeometryValue.js"></script> <script src="../../editor/js/commands/SetGeometryValueCommand.js"></script>
<script src="../../editor/js/CmdSetMaterial.js"></script> <script src="../../editor/js/commands/SetMaterialCommand.js"></script>
<script src="../../editor/js/CmdSetMaterialColor.js"></script> <script src="../../editor/js/commands/SetMaterialColorCommand.js"></script>
<script src="../../editor/js/CmdSetMaterialMap.js"></script> <script src="../../editor/js/commands/SetMaterialMapCommand.js"></script>
<script src="../../editor/js/CmdSetMaterialValue.js"></script> <script src="../../editor/js/commands/SetMaterialValueCommand.js"></script>
<script src="../../editor/js/CmdSetPosition.js"></script> <script src="../../editor/js/commands/SetPositionCommand.js"></script>
<script src="../../editor/js/CmdSetRotation.js"></script> <script src="../../editor/js/commands/SetRotationCommand.js"></script>
<script src="../../editor/js/CmdSetScale.js"></script> <script src="../../editor/js/commands/SetScaleCommand.js"></script>
<script src="../../editor/js/CmdSetScene.js"></script> <script src="../../editor/js/commands/SetSceneCommand.js"></script>
<script src="../../editor/js/CmdSetScriptValue.js"></script> <script src="../../editor/js/commands/SetScriptValueCommand.js"></script>
<script src="../../editor/js/CmdSetUuid.js"></script> <script src="../../editor/js/commands/SetUuidCommand.js"></script>
<script src="../../editor/js/CmdSetValue.js"></script> <script src="../../editor/js/commands/SetValueCommand.js"></script>
<!-- add class-based unit tests below --> <!-- add class-based unit tests below -->
<script src="editor/CommonUtilities.js"></script> <script src="editor/CommonUtilities.js"></script>
<!-- Undo-Redo tests --> <!-- Undo-Redo tests -->
<script src="editor/TestCmdAddObjectAndCmdRemoveObject.js"></script> <script src="editor/TestAddObjectCommandAndRemoveObjectCommand.js"></script>
<script src="editor/TestCmdAddScript.js"></script> <script src="editor/TestAddScriptCommand.js"></script>
<script src="editor/TestCmdMoveObject.js"></script> <script src="editor/TestMoveObjectCommand.js"></script>
<script src="editor/TestCmdMultiCmds.js"></script> <script src="editor/TestMultiCmdsCommand.js"></script>
<script src="editor/TestCmdRemoveScript.js"></script> <script src="editor/TestRemoveScriptCommand.js"></script>
<script src="editor/TestCmdSetColor.js"></script> <script src="editor/TestSetColorCommand.js"></script>
<script src="editor/TestCmdSetGeometry.js"></script> <script src="editor/TestSetGeometryCommand.js"></script>
<script src="editor/TestCmdSetGeometryValue.js"></script> <script src="editor/TestSetGeometryValueCommand.js"></script>
<script src="editor/TestCmdSetMaterial.js"></script> <script src="editor/TestSetMaterialCommand.js"></script>
<script src="editor/TestCmdSetMaterialColor.js"></script> <script src="editor/TestSetMaterialColorCommand.js"></script>
<script src="editor/TestCmdSetMaterialMap.js"></script> <script src="editor/TestSetMaterialMapCommand.js"></script>
<script src="editor/TestCmdSetMaterialValue.js"></script> <script src="editor/TestSetMaterialValueCommand.js"></script>
<script src="editor/TestCmdSetPosition.js"></script> <script src="editor/TestSetPositionCommand.js"></script>
<script src="editor/TestCmdSetRotation.js"></script> <script src="editor/TestSetRotationCommand.js"></script>
<script src="editor/TestCmdSetScale.js"></script> <script src="editor/TestSetScaleCommand.js"></script>
<script src="editor/TestCmdSetScene.js"></script> <script src="editor/TestSetSceneCommand.js"></script>
<script src="editor/TestCmdSetScriptValue.js"></script> <script src="editor/TestSetScriptValueCommand.js"></script>
<script src="editor/TestCmdSetUuid.js"></script> <script src="editor/TestSetUuidCommand.js"></script>
<script src="editor/TestCmdSetValue.js"></script> <script src="editor/TestSetValueCommand.js"></script>
<script src="editor/TestNestedDoUndoRedo.js"></script> <script src="editor/TestNestedDoUndoRedo.js"></script>
<script src="editor/TestSerialization.js"></script> <script src="editor/TestSerialization.js"></script>
<script src="editor/TestNegativeCases.js"></script> <script src="editor/TestNegativeCases.js"></script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册