Multiple symmetry update
 1-13  14-33  34-39

Previous
Next
 From:  Michael Gibson
7888.34 In reply to 7888.33 
Hi Marco, that's a nice version!

To make a version that would do a preview, you would need to remove the current WaitForDialogDone() event loop at the top of the function and instead make your own event loop (look inside WaitForDialogDone.js for an example), and when any of your UI controls triggers an event you'd need to call factory.cancel() on any factories that you have created.

You would probably want to restructure the code to do that, like keep a list of current factories in a global variable, and move the object generation code into its own separate function so you can call it more easily from different locations because you'll also want to generate things before you go into the event loop so that the use sees the initial result using the initial default values.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
7888.35 In reply to 7888.34 
Hello Michael,

Thank you very much for your suggestions!

Certainly i will try to write a new javascript code that will follow your instructions.

Nice night.

Marco (mkdm).
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  TOM (SIRTOM)
7888.36 In reply to 7888.35 
Very nice - makes handling easier !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
7888.37 In reply to 7888.34 
Hi Michael,

More or less :) i followed your instructions and now here's my 0.2 version of the MirrorRotateHistoryArray2 command.

Now it provides full preview of the resulting geoms and includes also the "Angle" input field.

After some tests it seems that all works fine, but please let me know if you find some bugs.

In your opinion, the javascript code i have written, performs a correct cleanup of the previewed objects, while cancelling the command
or call the main function more then one time (for ex. when the user modify the input values) ?

Here's the code fragment...

code:
	// step 1 : cancel the preview factories, created in the previous call
	if (previewFactories.length > 0) {
		for (i = 0; i < previewFactories.length; i++) {
			previewFactories[i].cancel();
		}
		previewFactories = new Array();
	}


Nice day!

Marco (mkdm).

Image Attachments:
Size: 603.5 KB, Downloaded: 44 times, Dimensions: 1920x1035px
Size: 858 KB, Downloaded: 42 times, Dimensions: 1918x1035px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7888.38 In reply to 7888.37 
Hi Marco,

> In your opinion, the javascript code i have written, performs a correct cleanup of the previewed
> objects, while cancelling the command
> or call the main function more then one time (for ex. when the user modify the input values) ?

Yes that looks correct - calling factory.cancel() like that should make each factory erase the objects that they had generated on previous calls to factory.update().

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  mkdm
7888.39 In reply to 7888.38 
Hi Michael,

> Yes that looks correct - calling factory.cancel() like that should make each factory erase the objects
> that they had generated on previous calls to factory.update().

Ok, Thanks!

Marco (mkdm).
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-13  14-33  34-39