Subject:
|
Re: Undo/Redo Information META Tags? Or Options Buttons?
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Fri, 19 Feb 2010 16:08:58 GMT
|
Viewed:
|
19542 times
|
| |
| |
In lugnet.cad.dev, Kevin L. Clague wrote:
> In lugnet.cad.dev, Tore Eriksson wrote:
> > I've been thinking hoe nice it would be if there was some kind of system of tags
> > that enabled the user to store undo and redo information in a model after the
> > model building application is closed. Now, there are a great number of LCAD
> > apps of which I use very few. So maybe there already is a system out there for
> > my wish.
> >
> > What I'm really after (I think...) is a good system to store all LDBoxer
> > simplification options in the same model file, something like:
> >
> > 0 !LDBOXER LEVEL A
> > 0 // The line above tells program and user which level is in use
> >
> > 0 !LDBOXER LEVEL 0 BEGIN
> > 0 !LDBOXER LABEL No simplifiaction
> > 0 1 15 0 0 0 1 0 0 0 1 0 0 0 1 3001.dat
> > 0 1 15 0 -24 0 1 0 0 0 1 0 0 0 1 3001.dat
> > 0 1 15 0 -48 0 1 0 0 0 1 0 0 0 1 3001.dat
> > 0 !LDBOXER LEVEL 0 END
> > 0 !LDBOXER LEVEL A BEGIN
> > 0 !LDBOXER LABEL Harmless simplifiaction
> > 1 15 0 0 0 1 0 0 0 1 0 0 0 1 3001.dat
> > 1 15 0 -24 0 1 0 0 0 1 0 0 0 1 B\3001.dat
> > 1 15 0 -48 0 1 0 0 0 1 0 0 0 1 3001.dat
> > 0 !LDBOXER LEVEL A END
> > 0 !LDBOXER LEVEL D BEGIN
> > 0 !LDBOXER LABEL Crude simplifiaction
> > 0 1 15 0 -48 0 4 0 0 0 9 0 0 0 2 B\3024.dat
> > 0 !LDBOXER LEVEL D END
> >
> > 0
>
> Well, you could easily do the above using the C preprocessor and #ifdefs, but
> that would be outside any LCAD application (and make the original file hard to
> work with in any modeler).
>
> #ifdef LDBOXTER_LEVEL_D /* crude simplification */
> 1 15 0 -48 0 4 0 0 0 9 0 0 0 2 B\3024.dat
> #elsif defined(LDBOXTER_LEVEL_A) /* Harmless simplification */
> 1 15 0 0 0 1 0 0 0 1 0 0 0 1 3001.dat
> 1 15 0 -24 0 1 0 0 0 1 0 0 0 1 B\3001.dat
> 1 15 0 -48 0 1 0 0 0 1 0 0 0 1 3001.dat
> #else /* No simplfication */
> 1 15 0 0 0 1 0 0 0 1 0 0 0 1 3001.dat
> 1 15 0 -24 0 1 0 0 0 1 0 0 0 1 3001.dat
> 1 15 0 -48 0 1 0 0 0 1 0 0 0 1 3001.dat
> #endif
>
> Maybe for this, you want C preprocessor meta commands in all the CAD programs:
>
> 0 #define <blah>
> 0 #undef <blah>
> 0 #ifdef <blah>
> 0 #ifndef <blah>
> 0 #if <blah>
> 0 #else
> 0 #elsif
> 0 #endif
>
> I'm not sure I'd like to have to add this support to LPub :^)
And I'm not sure this would be the optimal solution either. This options thing
is more like a case switch than a series of if statements.
>
> >
> > ... or a more generic, not LDBoxer specific OPTIONBUTTON system(?) would be
> > interesting for anybody? With labels and maybe multiple line info. Name it what
> > you like.
> >
> > But for now, I'm wondering if there's an Undo/Redo system in any existing LCAD
> > modelling program, as I'd rather adopt an existing practice than create yet
> > another.
>
> Some prominent LCAD modeling applications don't have undo/redo.....
>
> The order of lines in the ldraw file tell us what order the parts are added to
> the design, which is unrelated to the order in which the editor makes changes to
> the lines.
>
> Any undo/redo information would have to be put separate from the model itself
> (maybe in a special file in an MPD?), or if put intermixed as you have above,
> would have to have some kind of sequencing information.
>
> >
> > /Tore
>
> Kevin
Thanks for your input, Kevin. I am looking for a friendly solution that won't
output any code that will wreck any LCAD program not supporting this new
commands. That leaves the raw C preprocessor #ifdefs undesirable. Those
beginning with 0, like "0 #ifdef <blah>", that is standard LDraw META-command
syntax, are a bit interesting, because they would meet my wish for a more
generic approach.
But when it comes to different LDBoxer Level options, I like that MPD idea best!
(How come I never thought of that myself!) I think it would be sensible, easily
managable, and hopefully not that hard to implement.
The downside is that it has nothing to do with undo/redo - or maybe it has! You
lift out the block of lines you have altered into new files, "backup" files with
the old data, and one with the new. Then you make references to them from the
parent (here: model_01.ldr) file:
0 !UNDO EVENT 0001
1 16 0 0 0 1 0 0 0 1 0 0 0 1 model01_edit0001.ldr
0 1 16 0 0 0 1 0 0 0 1 0 0 0 1 model01_edit0001.003
0 1 16 0 0 0 1 0 0 0 1 0 0 0 1 model01_edit0001.002
0 1 16 0 0 0 1 0 0 0 1 0 0 0 1 model01_edit0001.001
0 !UNDO END
This would of course not be automatically active by default as it would create
zillions of backup files. Yes, I think it can be worth taking an extra look at!
/Tore
|
|
Message is in Reply To:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|