Lofton,
I will fix this.
Forrest
From: Lofton Henderson
[mailto:lofton@rockynet.com]
Sent: Saturday, January 10, 2009
1:21 PM
To: WebCGM
Subject: [cgmo-webcgm] threads
also on WG list
All --
Although the spec-edit phase is in the WG now, I think it was not a bad idea
that Benoit put this issue up on the TC list. There are some
knowledgeable people here who are not in the WG.
It is useful for you to keep checking the WG lists [1]. there are other
threads happening and you should speak up if they interest you.
[1] http://lists.w3.org/Archives/Public/public-webcgm-wg/
Note for example that there is an error in the SP text of 2.1, and it leads to
the need to change a test file:
[2] http://lists.w3.org/Archives/Public/public-webcgm-wg/2009Jan/0010.html
Forrest, I believe this would be your test file. Can you take the AI to
fix it? (If the error is not clear, get back to me. But basically,
names for values of things like stroke-type are invalid, only indexes/integers
are valid.
Regards,
-Lofton.
At 11:17 AM 1/10/2009 -0700, Lofton Henderson wrote:
Benoit,
At 10:41 AM 1/9/2009 -0500, Bezaire, Benoit wrote:
Since you used the words 'opinion' and 'guess'...
the working group will have to work on better defining this.
Apologies, I was rushing and my too-casual wording doesn't reflect that I'm
actually quite certain how it works. As I described:
[[[
order does not matter as long as *both* changes happened before the display
redraw (i.e., you might want to delay updates till you set both). If not,
then given the modal nature of CGM attributes, I would: set pattern
index; change interior style to pattern.
]]]
FIRST order of business: this will be on the Thursday telecon, to endorse
as correct or to refute. If the latter, i.e., if I'm wrong, then we need
specific counter-proposal and rationale from someone.
SECOND. Let me explain why it is correct, and then let's think about how
improve the specification might be better.
(Patience please! ... it has gets lengthy...)
Overview:
----------
1.) Though somewhat intricate, it is nevertheless unambiguous in the CGM:1999
specification how all permutations and combinations of fill attributes would
work in static sequences of metafile elements, in various orders etc.
(Forget about interactive SP-setting for the moment.)
2.) I think it is also unambiguous how setRedraw works to allow or suppress the
immediate effect of individual SP-setting calls.
So if we can devise a general statement/rule that relates how a given
SP-setting call affects the modal attribute list of the APS (see CGM:1999
section 6.7), then CGM:1999 defines the exact graphical effect that should
happen at the redraw after each SP-setting call. Combining that with the
setRedraw state, then such a general statement/rule can be used to answer any
detailed question such as yours.
Detailed Explanation:
---------
I think the specification should describe
the relationship between interior-style and other relevant style properties.
CGM:1999 (see section 6.7) is unambiguous about the graphical effect of static
sequences of elements in metafile instances like:
FILL COLOUR 'red'
INTERIOR STYLE 'solid'
PATTERN INDEX '9'
POLYGON
INTERIOR STYLE 'pattern'
POLYGON
(the first polygon is solid red, the second is pattern #9)
or
INTERIOR STYLE 'solid'
INTERIOR STYLE 'pattern'
POLYGON
PATTERN INDEX '9'
POLYGON
(the first polygon is pattern #1 (the default pattern index), the second is
pattern #9)
If we can understand how each SP-setting call alters the "virtual"
metafile element sequence in an APS, then post-SP-setting effects can be
understood from CGM:1999. WebCGM doesn't need to replicate the details, for
example, of how interior-style and pattern-index DOM SP settings interact, if
we make it clear how each SP setting affects the (virtual) metafile-element
sequence in the target.
The way in which the SP-setting calls affect the metafile element sequence of
the APS shouldn't be hard to describe. Here is a fast, off-the-cuff first
cut:
When the metafile is first interpreted, conceptually a virtual copy of the
elements in the APS is made and is initialized from the actual APS content of
the metafile. Call this the display list for the APS. An SP-setting
function like interior-style (e.g., to 'pattern') has the effect of setting the
INTERIOR STYLE to 'pattern' in the modal attribute list (see CGM:1999 sec 6.7)
, throughout the APS. I.e., regardless of the initial interior style(s)
affecting each graphical primitive throughout the APS, the INTERIOR STYLE is
reset to 'pattern' for all primitives as a result of the SP call. The
interpreter knows how to draw this from CGM:1999, and the interpreter
immediately does redraw it unless there has been a call to
setRedraw('disableAll').
So ... does the order matter? Yes. If you do this to an APS that
has one graphical primitive element -- a polygon as its last element:
setRedraw('enableAll')
setSP(interior-style, 'solid')
*** redraw-1 ***
setSP(interior-style, 'pattern')
*** redraw-2 ***
setSP(pattern-index, 11)
*** redraw-3 ***
Then you get: *** redraw-1 *** solid polygon in the current fill color;
then *** redraw-2 *** pattern polygon with current index (default #1, if it has
not otherwise been set in the metafile); then *** redraw-3 *** pattern polygon
with index #11. (On the other hand, if you disable redraw at first and
re-enable at end, you get only #3.)
setRedraw('enableAll')
setSP(interior-style, 'solid')
*** redraw-1 ***
setSP(pattern-index, 11)
*** redraw-2 ***
setSP(interior-style, 'pattern')
*** redraw-3 ***
Then you get: *** redraw-1 *** solid polygon in the current fill
color; then, *** redraw-2 *** [unchanged] solid polygon in the current
fill color; then, *** redraw-3 *** pattern polygon with index #11.
(Note: the interpreter could detect "no change" and
optimize by not redrawing #2).
Summary:
I claim that all specific questions like yours are answered by the existing
rules of CGM:1999, and need not be answered one-by-one in WebCGM, if this model
relating the aftereffect of a DOM SP-setting call to a sequence of static
metafile elements is clearly understood.
Question:
What should be added to the spec? I vote against situation-by-situation
(element-by-element) explanations, if we can draft a general explanation of the
rules that helps each person to answer such specific questions.
Thoughts?
Regards,
-Lofton.
Benoit.
From: Lofton Henderson
[mailto:lofton@rockynet.com]
Sent: Friday, January 09, 2009
10:24 AM
To: Bezaire, Benoit; WebCGM
Subject: Re: [cgmo-webcgm] How
does interior-style work?
My opinions...
At 10:13 AM 1/9/2009 -0500, Bezaire, Benoit wrote:
I'm slightly confused with interior-style, more specifically
the dependency that other style properties have on interior-style.
Let's
say a WebCGM metafile contains an APS (polygon filled with red color). A script
writer wishes to change the fill to a pattern, how does he do that?
He
needs to change the interior-style and the pattern-index, right? Does the order
matter?
My guess: order would not matter as long as *both* changes happened
before the display update (i.e., you might want to delay updates till you set
both). If not, then given the modal nature of CGM attributes, I
would: set pattern index; change interior style to pattern.
Another question is if fill-color only has an impact if interior-style
is set to solid?
Fill color also defines the drawn border when interior style is 'hollow' (as
distinct from the edge, which has its own attributes).
-Lofton.