cgmo-webcgm message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: RE: [cgmo-webcgm] How does interior-style work?
- From: "Bezaire, Benoit" <bbezaire@ptc.com>
- To: "WebCGM" <cgmo-webcgm@lists.oasis-open.org>
- Date: Mon, 12 Jan 2009 09:24:03 -0500
A general explanation should suffice. However, I wonder if
interior-style is required at all... should we consider an approach where
setting one of the following SP: fill-color, pattern-index, hatch-index
automatically overrides interior-style? It seems awkward for the script writer
to always have to make two calls, first to set the color or index, the second to
change the interior style.
Please note that in WebCGM 2.0, we added fill-color and
there's no mentioning at all of interior-style?!
Test cases should also cover the general
explanation.
Benoit.
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.
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]