OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cgmo-webcgm message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Initial values, % sub-issue [was: Re[2]: [cgmo-webcgm] Style properties]


Hi Benoit,

In keeping with your request to break down into smaller bits, I'll focus on 
one specific sub-issue here.  The ISO CGM attribute model, what % means, 
and how that affects possible Initial Value (%) specification.  Excuse if 
it got long or if I'm being pedantic, but I threw in a couple examples 
because I sense a confusion between the CGM attribute model and a SVG-like 
model -- they're different.

At 02:58 PM 5/17/2005 -0400, Benoit Bezaire wrote:
>[...]
>LH> In my opinion, the inheritance model for both the APS attributes and
>LH> style properties are similar with one exception: style properties do
>LH> not have an 'Initial Value'. Note: Lofton may or may not agree with
>LH> me, I'm not sure on what we agree on yet.
>
>LH> They do not have an initial value that is inherent or
>LH> explicit in the WebCGM instance (since they are not CGM attributes).
>
>LH> However, IMO it would be perfectly consistent to define
>LH> "Initial value:  100%" for all of them (except text-font).  It is
>LH> a valid value of the style property, and it essentially means,
>LH> "per whatever is in the CGM instance" (I.e., don't change/override
>LH> the current values of the affected CGM attributes).
>I'm not sure it is that simple. I'm not convinced (yet) that
>100% as initial value is fine for all of them. Another problem I see,
>is that in CSS there's a Applies To: notion, which we don't have. I
>don't think it is possible to define an inheritance model without
>specifying the Applies To:.

I'm going to reverse the order of your examples, because background color 
is something of a pathological case in CGM, and differs from the other 
style properties.

>Example 2: what does it mean to have 'stroke-weight' set to 100% at
>the Picture level when the first instance of LINEWIDTH in my CGM file
>is one line above a LINE primitive (i.e., LINEWIDTH is not found under
>BEGPIC or BEGPICBODY; but BEGAPSBODY;)?

The ISO CGM standard makes clear that, at any point in every CGM data 
stream, there is a well-defined value of every CGM attribute.  Even 
immediately after the BegPic element, every attribute has a well defined 
value, because the ISO CGM standard defines a default for every attribute 
(in clause 8).  Example:

BegMet;
...
BegPic;
BegPicBody;
line 0 0 1 1 2 2;
linewidth 50;
line 0 2 1 1 2 0;

ISO CGM clause 8 tells me that the line width of the first line is about 
32.7, which is its clause-8-determined default value (or exactly 32.767 -- 
I'm sweeping some details under the rug here).  The line width of the 
second line is 50, which is explicitly set by that occurrence of the 
attribute.  Modify the example a little bit:

BegMet;
...
BegPic;
BegPicBody;
BegAps obj1;
   BegApsBody;
   line 0 0 1 1 2 2;
   EndAps;
BegAps obj2;
   BegApsBody;
   linewidth 50;
   line 0 2 1 1 2 0;
EndAps;

The values of the line widths for the two lines are the same as 
before.  This is a bit different than SVG objects, where each occurrence of 
a graphical primitive object (e.g., rect) implicitly has an "Initial value" 
(default) of all of its drawing properties attached to it, unless there is 
an explicit occurrence of the attribute on the element.  (CGM is a modal 
stream or state list model, SVG is an object model, is the way I think of it.)

Now, stroke-weight affects CGM line width and CGM edge width.  However, it 
can only be applied to APSs.  Conceptually, I think of it as being applied 
to the BegAps, and then affects everything in that APS, **until the 
matching EndAps**.  Because of the "until matching EndAps", this 
stroke-weight style property behaves differently than CGM attributes.  It 
affects everything within the APS, but does not persist beyond the end of 
the APS.

As I understand our intention, % value of the WebCGM DOM style property 
stroke-weight is applied as follows, where lw is the current value of line 
width and lw' is the new value:
lw' = sw * lw
ew' = sw * ew

So suppose we were to define that every APS in the metafile has a 
stroke-weight Initial Value of 100%.  Then every line-width and every 
edge-width in the CGM is exactly ... unchanged from what ISO CGM standard 
says it should be.

In the example above, the first line thus has line-width 32.7 and the 
second has line-width 50.  Suppose the DOM now sets stroke-weight to 200% 
for obj1.  The the first line width is 65.4 and the second is still 50.

>Does WebCGM clearly define on what LINEWIDTH applies to and where can
>it legally be specified in the CGM file?

Not WebCGM itself, but the ISO CGM standard of which WebCGM is a 
profile.  Yes, ISO CGM clearly defines to what elements LINE WIDTH applies 
(the dozen or so "line" graphical primitives), where LINE WIDTH elements 
can occur (anywhere in the Picture Body outside of APS, or in an APS body 
within APS), and what is the value of every CGM attribute immediately after 
the BEGIN PICTURE element.  WebCGM adheres to the ISO CGM rules.

>Example 1: what does it mean to have 'background-color' set to 100%?
>What does this map to in CGM? And does it have an implied value?

This case is a little more pathological than all the other style 
properties.  Skip if you like, but in brief...

CGM has a BACKGROUND COLOUR element, that applies at the whole-picture 
level (cannot change within pictures).  Sweeping aside some details, at the 
processing of the BEGIN PICTURE element the background color of the picture 
is well-defined.  The WebCGM DOM style property background-color of 100% 
would mean -- the background color of the picture, as determined by ISO CGM 
rules, is unchanged.  If the value were 50%, well ... apply the 
fade-towards-white computation that the spec defines.

All for now,
-Lofton.




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]