Validation of a CGM Graphic Against the Web CGM Profile PowerPoint PPT Presentation

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

Title: Validation of a CGM Graphic Against the Web CGM Profile


1
Validation of a CGM Graphic Against the Web CGM
Profile
  • Stuart Galt
  • The Boeing Company

2
Agenda
  • What is the WebCGM profile
  • The process
  • Hard parts

3
WebCGM
  • CGM (ISO 8632) vector and composite vector/raster
    graphic format.
  • WebCGM is a profile used to specify the subset of
    the CGM standard that will be used to exchange
    data on the web.

4
WebCGM History
  • 1987 - ISO approved CGM as a Standard
  • 1995 - CGM became a registered mime type
  • 1996 - W3C published Scalable Graphics
    Requirements
  • 1997 - W3C published Use of CGM as a Scalable
    Graphic Format
  • 1999 - WebCGM 1.0 approved in January

5
WebCGM is intelligent
  • Contains graphic primitives
  • Lines, polylines, polygons
  • Rectangles, circles, ellipses, arcs
  • Graphical text
  • Non graphical content
  • Metadata
  • Hierarchies objects
  • Links

6
The Process
7
CGM to XML
  • CGM graphic primitives are converted directly
  • Containers are used to represent internal state
    changes

8
CGM primitives
  • Circle centered (4252, 2385) radius 150
  • Binary CGM
  • 41 86 10 9c 09 51 00 96
  • XML
  • ltCirclegtltPoint x4252 y2385/gtltRadius
    r150/gtlt/Circlegt

9
CGM primitives (contd)
  • Restricted Text
  • ltRestrictedText final"yes"gtltDeltaBox dx"400"
    dy"97"/gtltPoint x"914" y"1953"/gtltStringFixedgtN
    OTElt/StringFixedgtlt/RestrictedTextgt

10
CGM primitives (contd)
  • Polygon
  • ltPolygongtltPoint x"3175" y"3879"/gtltPoint
    x"3085" y"3833"/gtltPoint x"3075"
    y"3866"/gtlt/Polygongt

11
CGM States
  • Container elements used to mark state changes
  • Metafile defaults
  • ltMetafileDefaultsReplacementgt defaults go here
    lt/MetafileDefaultsReplacementgt

12
CGM States (contd)
  • Picture Descriptor and Picture Open State
  • ltPicturegtltStringFixedgtPicture
    Descriptionlt/StringFixedgt
  • Picture descriptor data here
  • ltBeginPictureBody/gtPicture data
    herelt/Picturegt

13
CGM
States
Metafile Descriptor
Picture
Picture
Picture Descriptor
Picture Body
EndPic
Picture Body
Picture Open
14
Metafile Decsriptor
Metafile
Descriptor
opt rep
MFVersion
IntegerPrec
MFDesc
VDCType
RealPrec
IndexPrec
ColrIndexPrec
MaxColrIndex
ColrValueExt
MFElemlist
ColrPrec
CharSetList
CharCoding
NamePrec
MaxVDCExt
FontList
SetPriExt
ColrModel
GlyphMap
SymLibList
ColrCalib
FontProp
15
Validating WebCGM
  • Current state
  • Profile validation tool exists for WebCGM in
    binary encoding
  • Metacheck
  • With a WebCGM schema defined
  • General purpose tools would be available

16
The Schema
  • Some elements are easy to represent
  • Some are hard

17
Metafile Version
  • ltelement name"MetafileDescriptor"gt
  • ltcomplexTypegt
  • ltsequencegt
  • ltelement name"MetafileVersion"gt
  • ltattribute nameversion userequired
  • typeinteger minInclusive1
  • maxInclusive4/gt
  • lt/elementgt
  • ltallgt
  • ltelement name"MetafileDescription"
    type"string"/gt
  • ...other required elements go here...
  • lt/allgtlt/sequencegtlt/complexTypegtlt/elementgt

18
Non Graphical Text String
  • ltsimpleType nameNonGraphicTextgt
  • ltrestriction basestringgt
  • ltminlength value0/gt
  • ltmaxlength value254/gt
  • lt/restrictiongt
  • lt/simpleTypegt

19
The Hard
  • Some elements are restricted (or required based
    on the value of the metafile version
  • If version 3 then a RestrictedTextType
    element must appear before the first
    RestrictedText element
  • If ColorSelectionMode is indexed color is index
    value, else color is RGB values

20
The Hard Part
  • Branching logic
  • If (condition a) then foo else bar

21
Conclusion
  • Creation of a schema that enforces WebCGM profile
    allows simple XML schema validator to validate
    conformance of CGM graphics.
  • This approach could also be used to simplify
    validation of other binary structured formats.

22
Whats Ahead
  • Complete mapping CGM binary to XML
  • Finish WebCGM schema
  • Work to continue in CGM Open Consortium
    http//www.cgmopen.org
Write a Comment
User Comments (0)
About PowerShow.com