none
presetShapeDefinitions.xml does not specify width and height form some autoshapes RRS feed

  • Question

  • Hi,

    I am trying to find the text bounding box size of autoshapes from presetShapeDefinitions.xml. But the problem I am facing is that for many shapes the <path> element does not specify the width and height.

    So my problem is -> How do I scale the guide values given there e.g. following is one of the guide specified for the autoshape  "wedgeRoundRectCallout" 

    <gd name = "adj3" fmla = "val 16667"/>

    but since the width and height are not specified wiht the <path> subelement, Where should I put the guide point if I want to draw this shape in a 100x100 pixel bounding box.

    on the other hand for some shapes the w and h are specified e.g. in lightningBolt  <path w = "21600" h = "21600">

    So in this case I can properly scale the constants given in the formula e.g. for "*/ w 5022 21600", i would scale 5022  w.r.t. 21600.

     

    Let me know if my question is not clear.

    Thanks in Advance

    Rahul


    Rahul
    Thursday, December 16, 2010 9:16 AM

Answers

  • Rahul,

    Here is the list of the guides and their default values:

     

     

    Built-in Guides

    Comment

    3cd4

    3 x 360° / 4 = 270°

    3cd8

    3 x 360° / 8 = 135°

    5cd8

    5 x 360° / 8 = 225°

    7cd8

    7 x 360° / 8 = 315°

    b

    bottom

    cd2

    360° / 2 = 180°

    cd4

    360° / 4 = 90°

    cd8

    360° / 8 = 45°

    hc

    horizontal center

    h

    height

    hd2

    height / 2

    hd4

    height / 4

    hd5

    height / 5

    hd6

    height / 6

    hd8

    height / 8

    l

    left

    ls

    long side

    r

    right

    ss

    short side

    ssd2

    short side / 2

    ssd4

    short side / 4

    ssd6

    short side / 6

    ssd8

    short side / 8

    t

    top

    vc

    vertical center

    w

    width

    wd2

    width / 2

    wd4

    width / 4

    wd5

    width / 5

    wd6

    width / 6

    wd8

    width / 8

    wd10

    width / 10

     

    I hope this answers your question.

    Sincerely, 

    Dominic Salemno
    Escalation Engineer
    Open Specifications

     

    • Proposed as answer by King Salemno Wednesday, January 12, 2011 6:31 PM
    • Marked as answer by rsharma_champ Thursday, January 13, 2011 3:40 AM
    Wednesday, January 12, 2011 6:31 PM
  • Rahul,

     

    The following values should complete the list I provided to you.

     

    The following are defined by the formula:

     

    [IS29500 Part 1 Section 20.1.9.11]

      if (y < x) then value = x

      if (y > z) then value = z

      else value = y

     

    a1 --> adj1 100000

    a2 --> adj2 maxAdj2

     

    List of Guides

    --------------

     

    maxAdj2 --> 100000 / w * ss

    dx2 --> ss * a2 / 100000

    x2 --> l + dx2

    dy1 --> h * a1 / 200000

    y1 --> vc - dy1

    y2 --> vc + dy1

    dx1 --> y1 * dx2 / hd2

    x1 --> x2 - dx1

     

    Also, the guides in the shape definitions are all defined relative to each other. The explicit bounds of the shape are set when a shape is inserted into the canvas. For example:

     

     

    <p:sp>

      <p:nvSpPr>

        <p:cNvPr id="4" name="Rounded Rectangular Callout 3"/>

        <p:cNvSpPr/>

        <p:nvPr/>

      </p:nvSpPr>

      <p:spPr>

        <a:xfrm>

          <a:off x="1905000" y="1600200"/>  - offset

          <a:ext cx="3505200" cy="2514600"/>  - shape bounds

        </a:xfrm>

        <a:prstGeom prst="wedgeRoundRectCallout">

          <a:avLst/>

        </a:prstGeom>

      </p:spPr>

     

    The above snippet from a PPTX file inserts a rounded rectangle callout and defines the explicit offset and bounds of the shape.

     

    With regards to the adjust values, such as the one mentioned in the original forum message:

     

    <gd name="adj3" fmla="val 16667" />

     

    You have to look at the context of how the value is being used. In this case, adj3 is being referred to in:

     

    <gd name="u1" fmla="*/ ss adj3 100000" />

     

    The */ formula is defined as multiply then divide, so in this case:

     

    ss * adj3 / 100000

    = ss * 16667 / 100000

    = ss * 0.16667

     

    This adjust value is being used to determine a percentage, not an absolute value, so there’s no reason to scale it.

     

    I hope this helps you out.

     

    Dominic Salemno

    Escalation Engineer

    Open Specifications

    • Proposed as answer by King Salemno Thursday, January 27, 2011 6:00 PM
    • Marked as answer by rsharma_champ Friday, January 28, 2011 2:47 AM
    Thursday, January 27, 2011 5:59 PM
  • Hi Terlo,

     

    To answer your question: Yes, they are built in guides. The code just translates these particular text patterns (hd# and wd#) to reflect the desired formula (height / # and width / # respectively).

     

    Regards,

    Mark Miller

    Escalation Engineer

    US-CSS DSC PROTOCOL TEAM

    Wednesday, March 9, 2011 8:20 PM

All replies

  • Hi Rahul, thanks for your post regarding the [MS-OE376] (Office Implementation Information for ECMA-376 Standards Support) specification. One of my colleagues on the Open Specification Documentation team will be in touch with you shortly.

    Regards,
    Bill Wesse, US-CSS DSC Protocol Team

    Thursday, December 16, 2010 10:46 AM
  • Hi Bill,

    I have one more doubt, the following xml is taken straight out of presetShapesDefinitions.xml, here you can see that gd 6 (0 based index) uses "dy" in its fmla, But I could not find the meaning of dy anywhere. the ECMA -376 pdf does not say anything about any such predefined constant (liek wd2, hc, etc.)

    So what is "dy" here?

     <leftArrow>

        <avLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">

          <gd name="adj1" fmla="val 50000" />

          <gd name="adj2" fmla="val 50000" />

        </avLst>

        <gdLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">

          <gd name="maxAdj2" fmla="*/ 100000 w ss" />

          <gd name="a1" fmla="pin 0 adj1 100000" />

          <gd name="a2" fmla="pin 0 adj2 maxAdj2" />

          <gd name="dx2" fmla="*/ ss a2 100000" />

          <gd name="x2" fmla="+- l dx2 0" />

          <gd name="dy1" fmla="*/ h a1 200000" />

          <gd name="y1" fmla="+- vc 0 dy" />

          <gd name="y2" fmla="+- vc dy1 0" />

          <gd name="dx1" fmla="*/ y1 dx2 hd2" />

          <gd name="x1" fmla="+- x2  0 dx1" />

        </gdLst>

     


    Rahul
    Thursday, December 16, 2010 11:00 AM
  • Hi Rahul,

     I am the engineer who has taken ownership of your issue. I am currently investigating this and will update you as things progress.

     Dominic Salemno
    Escalation Engineer
    Open Specifications

    Thursday, December 16, 2010 8:54 PM
  • Check the following also which is also taken from presetShapesDefinitions.xml directly.

    The lines in bold uses wd3 and hd3, They are not defined in the ECMA-376 1 pdf, But I assume they mean width/3 and height/3 respectively.

    Please let me know if I am correct, and where do I find such undocumented constants?

     

     <trapezoid>

               <gdLst xmlns = "http://schemas.openxmlformats.org/drawingml/2006/main">

                <gd name = "maxAdj" fmla = "*/ 50000 w ss"/>

                <gd name = "a" fmla = "pin 0 adj maxAdj"/>

                <gd name = "x1" fmla = "*/ ss a 200000"/>

                <gd name = "x2" fmla = "*/ ss a 100000"/>

                <gd name = "x3" fmla = "+- r 0 x2"/>

                <gd name = "x4" fmla = "+- r 0 x1"/>

                <gd name = "il" fmla = "*/ wd3 a maxAdj"/>

                <gd name = "it" fmla = "*/ hd3 a maxAdj"/>

     


    Rahul
    Friday, December 17, 2010 3:38 AM
  • Hi Dominic ,

    Any update on your investigations? I m waiting for ur reply.


    Rahul
    Tuesday, December 21, 2010 3:00 AM
  • Rahul,

    I am still investigating this matter. I have nothing new to report at this time.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Tuesday, December 21, 2010 5:17 AM
  • Rahul,

    I am still looking into this for you. I have nothing new to report at this time.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

     

    Wednesday, January 5, 2011 5:12 PM
  • Ok, I m waiting for your reply as we are stuck at this point. We have written a DrawingML parser to parse presetShapeDefinitions.xml but do not know what those constants mean?

    We need your help in figuring out the things.

     


    Rahul
    Saturday, January 8, 2011 12:52 PM
  • Rahul,

    I am still investigating this for you. I should have some information for you very shortly.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Monday, January 10, 2011 3:22 PM
  • Rahul,

    Here is the list of the guides and their default values:

     

     

    Built-in Guides

    Comment

    3cd4

    3 x 360° / 4 = 270°

    3cd8

    3 x 360° / 8 = 135°

    5cd8

    5 x 360° / 8 = 225°

    7cd8

    7 x 360° / 8 = 315°

    b

    bottom

    cd2

    360° / 2 = 180°

    cd4

    360° / 4 = 90°

    cd8

    360° / 8 = 45°

    hc

    horizontal center

    h

    height

    hd2

    height / 2

    hd4

    height / 4

    hd5

    height / 5

    hd6

    height / 6

    hd8

    height / 8

    l

    left

    ls

    long side

    r

    right

    ss

    short side

    ssd2

    short side / 2

    ssd4

    short side / 4

    ssd6

    short side / 6

    ssd8

    short side / 8

    t

    top

    vc

    vertical center

    w

    width

    wd2

    width / 2

    wd4

    width / 4

    wd5

    width / 5

    wd6

    width / 6

    wd8

    width / 8

    wd10

    width / 10

     

    I hope this answers your question.

    Sincerely, 

    Dominic Salemno
    Escalation Engineer
    Open Specifications

     

    • Proposed as answer by King Salemno Wednesday, January 12, 2011 6:31 PM
    • Marked as answer by rsharma_champ Thursday, January 13, 2011 3:40 AM
    Wednesday, January 12, 2011 6:31 PM
  • Hi Dominic,

     

    Yes that answers. But I would like to know, if this information is listed in any of the open XML specification document (which are available from microsoft website for download)?

    Regards

    Rahul


    Rahul
    Thursday, January 13, 2011 3:40 AM
  • Rahul,

    They will be added in a future release of the documentation.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Thursday, January 13, 2011 4:09 PM
  • Hi Dominic,

     

    My first question is still un-answered. I am repeating the same below

    I am trying to find the text bounding box size of autoshapes from presetShapeDefinitions.xml. But the problem I am facing is that for many shapes the <path> element does not specify the width and height.

    So my problem is -> How do I scale the guide values given there e.g. following is one of the guide specified for the autoshape  "wedgeRoundRectCallout" 

    <gd name = "adj3" fmla = "val 16667"/>

    but since the width and height are not specified wiht the <path> subelement, Where should I put the guide point if I want to draw this shape in a 100x100 pixel bounding box.

    on the other hand for some shapes the w and h are specified e.g. in lightningBolt  <path w = "21600" h = "21600">

    So in this case I can properly scale the constants given in the formula e.g. for "*/ w 5022 21600", i would scale 5022  w.r.t. 21600.

    Regards

    Rahul


    Rahul
    Tuesday, January 18, 2011 11:26 AM
  • Rahul,

    I am investigating this information for you.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Wednesday, January 19, 2011 5:33 AM
  • Hi Dominic,

     

    Did you find anything. My company has msdn subscriptions and authorized support from MS. Will that give me a faster result? should I go through the official channel?

    Regards

     


    Rahul
    Wednesday, January 26, 2011 9:03 AM
  • Rahul,

    You are on the correct forum for the information that you seek. This is the official support channel for support of the Open Specifications Documentation. I am still investigating the information you are looking for, however, I still do not have anything new to report at this time.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Wednesday, January 26, 2011 2:54 PM
  • Rahul,

     

    The following values should complete the list I provided to you.

     

    The following are defined by the formula:

     

    [IS29500 Part 1 Section 20.1.9.11]

      if (y < x) then value = x

      if (y > z) then value = z

      else value = y

     

    a1 --> adj1 100000

    a2 --> adj2 maxAdj2

     

    List of Guides

    --------------

     

    maxAdj2 --> 100000 / w * ss

    dx2 --> ss * a2 / 100000

    x2 --> l + dx2

    dy1 --> h * a1 / 200000

    y1 --> vc - dy1

    y2 --> vc + dy1

    dx1 --> y1 * dx2 / hd2

    x1 --> x2 - dx1

     

    Also, the guides in the shape definitions are all defined relative to each other. The explicit bounds of the shape are set when a shape is inserted into the canvas. For example:

     

     

    <p:sp>

      <p:nvSpPr>

        <p:cNvPr id="4" name="Rounded Rectangular Callout 3"/>

        <p:cNvSpPr/>

        <p:nvPr/>

      </p:nvSpPr>

      <p:spPr>

        <a:xfrm>

          <a:off x="1905000" y="1600200"/>  - offset

          <a:ext cx="3505200" cy="2514600"/>  - shape bounds

        </a:xfrm>

        <a:prstGeom prst="wedgeRoundRectCallout">

          <a:avLst/>

        </a:prstGeom>

      </p:spPr>

     

    The above snippet from a PPTX file inserts a rounded rectangle callout and defines the explicit offset and bounds of the shape.

     

    With regards to the adjust values, such as the one mentioned in the original forum message:

     

    <gd name="adj3" fmla="val 16667" />

     

    You have to look at the context of how the value is being used. In this case, adj3 is being referred to in:

     

    <gd name="u1" fmla="*/ ss adj3 100000" />

     

    The */ formula is defined as multiply then divide, so in this case:

     

    ss * adj3 / 100000

    = ss * 16667 / 100000

    = ss * 0.16667

     

    This adjust value is being used to determine a percentage, not an absolute value, so there’s no reason to scale it.

     

    I hope this helps you out.

     

    Dominic Salemno

    Escalation Engineer

    Open Specifications

    • Proposed as answer by King Salemno Thursday, January 27, 2011 6:00 PM
    • Marked as answer by rsharma_champ Friday, January 28, 2011 2:47 AM
    Thursday, January 27, 2011 5:59 PM
  • Thanks Dominic, that was very helpful.

     

     


    Rahul
    Friday, January 28, 2011 2:47 AM
  • Hi Dominic,

    Actually I am still confused :). So I take an example to explain it.

    The following is selectively taken from the presetShapeDefinition.xml for : flowChartMagneticTape

        <gd name = "ang1" fmla = "at2 w h"/>
    
    
        <path>
            <moveTo>
              <pt x = "hc" y = "b"/>
            </moveTo>
            <arcTo
              wR = "wd2"
              hR = "hd2"
              stAng = "cd4"
              swAng = "cd4"/>
            <arcTo
              wR = "wd2"
              hR = "hd2"
              stAng = "cd2"
              swAng = "cd4"/>
            <arcTo
              wR = "wd2"
              hR = "hd2"
              stAng = "3cd4"
              swAng = "cd4"/>
            <arcTo
              wR = "wd2"
              hR = "hd2"
              stAng = "0"
              swAng = "ang1"/>
            <lnTo>
              <pt x = "r" y = "ib"/>
            </lnTo>
            <lnTo>
              <pt x = "r" y = "b"/>
            </lnTo>
            <close/>
         </path>
    

     

     

    If you look at this path its goes something like this...

      moves to (hc,b)            
      arc to (0,vc)               (since arc's a,b are wd2,hd2)
      arc to (hc,0)
      arc to(r,vc)

    Now the path traverses an swingAngle of ang1 which is arctan(h/w) according to the guide value. This implies that the swingAngle will change with the width, height of the shape drawn. Its easy to see that the shape is proper only when swingAngle=45degree => (w should be equal to h all the time).

    My slide xml has the following

    This is what is present on the slide

            <p:spPr>
              <a:xfrm>
                <a:off x = "0" y = "0"/>
                <a:ext cx = "1828800" cy = "914400"/>
              </a:xfrm>
              <a:prstGeom prst = "flowChartMagneticTape">
                <a:avLst/>
              </a:prstGeom>
            </p:spPr>
    


    Here w=2 and h=1

    Now my question is what is the w and h that we need to take to draw the shape. Should we always take them equal and later scale it w.r.t. cx , cy ?

     

    Hope that this example explains whats confusing me ?

    --

    Manoj

     

    Friday, January 28, 2011 8:58 AM
  • Hi Manoj,

    This question is a duplicate of this post in this thread:  http://social.msdn.microsoft.com/Forums/en-US/os_openXML-ecma/thread/71e7383e-e07d-4d2c-be6c-1390387b4cfe.  Please refer to the link for resolution.

    Thanks

    Alex Morrill, Program Manager, Open Specifications

    Friday, February 11, 2011 5:30 PM
  • would wd3 (width /3) and hd3 (height /3) also be considered a built-in guide as they are in the guide list in trapezoid and not defined elsewhere?
    Monday, February 14, 2011 9:54 PM
  • Terlo,

    One of our engineers will follow up with you soon.

    Thanks,

    Edgar

    Tuesday, February 15, 2011 3:11 AM
    Moderator
  • Hi Terlo,

    I'm still looking into this for you.  I suspect that you are correct but I'm confirming.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

     

    Friday, February 18, 2011 5:26 PM
  • Thanks Tom. I believe I've discovered two more. In stripedRightArrow there are values of ssd16 and ssd32 which are not defined elsewhere. I assume these are shortest side divided by 16 and 32, respectively. Based on my calculations, that should be correct.
    Tuesday, February 22, 2011 7:06 PM
  • Hi Terlo,

     

    To answer your question: Yes, they are built in guides. The code just translates these particular text patterns (hd# and wd#) to reflect the desired formula (height / # and width / # respectively).

     

    Regards,

    Mark Miller

    Escalation Engineer

    US-CSS DSC PROTOCOL TEAM

    Wednesday, March 9, 2011 8:20 PM
  • Great, thanks Mark for the clarification.
    Wednesday, March 9, 2011 11:45 PM