2.2.58 SG

Referenced by: pGuides_complex

The SG record specifies a formula that is used to calculate a value for use in the pGuides_complex property, as defined in section 2.3.6.27, of this shape. Formulas are used to calculate values involved in the geometry of a shape so that a user can adjust some of those values and so that the entire geometry of the shape can adjust appropriately as a result.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

sgf

A

B

C

param1

param2

param3

sgf (13 bits): A set of bits that specifies the formula to use to calculate the value for the guide represented by this record. The formulas specify a combination of param1, param2, and param3 values, although not every formula uses all three of the parameters. The following table lists the values for this field along with the formulas that they represent.

Formula name

Value

Calculation

sgfSum

0x0000

Addition and subtraction:

param1 + param2 - param3

sgfProduct

0x0001

Multiplication and division:

(param1 * param2) / param3

sgfMid

0x0002

Simple average:

(param1 + param2) / 2

sgfAbsolute

0x0003

Absolute value:

abs(param1)

sgfMin

0x0004

Lesser of two values:

min(param1, param2)

sgfMax

0x0005

Greater of two values:

max(param1, param2)

sgfIf

0x0006

Conditional selection:

param1 > 0 ? param2 : param3

sgfMod

0x0007

Modulus:

sqrt(param1^2 + param2^2 + param3^2)

sgfATan2

0x0008

Arctangent, where the result equals the angles, in degrees, and is of type FixedPoint as specified in [MS-OSHARED] section 2.2.1.6:

atan2(param2, param1)

sgfSin

0x0009

Sine, where param2 equals the angles, in degrees, and is of type FixedPoint as specified in [MS-OSHARED] section 2.2.1.6:

param1 * sin(param2)

sgfCos

0x000A

Cosine, where param2 equals the angles, in degrees, and is of type FixedPoint as specified in [MS-OSHARED] section 2.2.1.6:

param1 * cos(param2)

sgfCosATan2

0x000B

Cosine and arctangent in one formula:

param1 * cos(atan2(param3,  param2))

sgfSinATan2

0x000C

Sine and arctangent in one formula:

param1 * sin(atan2(param3,  param2))

sgfSqrt

0x000D

Square root:

sqrt(param1)

sgfSumAngle

0x000E

Addition of an angle, in degrees, of type FixedPoint as specified in [MS-OSHARED] section 2.2.1.6, to two other angles, in degrees, where param2 and param3 are scaled by 2^16:

param1 + param2*2^16 + param3*2^16

sgfEllipse

0x000F

Eccentricity formula for an ellipse, where param1 is the length of the semi-minor axis and param2 is the length of the semi-major axis:

param3 * sqrt(1 - (param1 / param2)^2)

sgfTan

0x0010

Tangent, where param2 equals the angles, in degrees, and is of type FixedPoint as specified in [MS-OSHARED] section 2.2.1.6:

param1 * tan(param2)

A - fCalculatedParam1 (1 bit): A bit that specifies whether this record’s param1 value is a constant or is calculated from another property or formula. The following table specifies the meaning of each value for this bit.

Value

Meaning

0x0

param1 is a constant.

0x1

param1 is calculated from another property or formula.

B - fCalculatedParam2 (1 bit): A bit that specifies whether this record’s param2 value is a constant or is calculated from another property or formula. The following table specifies the meaning of each value for this bit.

Value

Meaning

0x0

param2 is a constant.

0x1

param2 is calculated from another property or formula.

C - fCalculatedParam3 (1 bit): A bit that specifies whether this record’s param3 value is a constant or is calculated from another property or formula. The following table specifies the meaning of each value for this bit.

Value

Meaning

0x0

param3 is a constant.

0x1

param3 is calculated from another property or formula.

param1 (16 bits): A value that is used to calculate the result of this formula. If fCalculatedParam1 equals 0x0, this value is an unsigned integer constant. If fCalculatedParam1 equals 0x1, this value specifies a property or formula to use when calculating the result. The following table specifies the allowed values.

Value

Calculation

0x0140

The x-coordinate of the center of the geometry space of this shape.

0x0141

The y-coordinate of the center of the geometry space of this shape.

0x0142

The width of the geometry space of this shape.

0x0143

The height of the geometry space of this shape.

0x0147

The value of the adjustValue property, as defined in section 2.3.6.10, of this shape.

0x0148

The value of the adjust2Value property, as defined in section 2.3.6.11, of this shape.

0x0149

The value of the adjust3Value property, as defined in section 2.3.6.12, of this shape.

0x014A

The value of the adjust4Value property, as defined in section 2.3.6.13, of this shape.

0x014B

The value of the adjust5Value property, as defined in section 2.3.6.14, of this shape.

0x014C

The value of the adjust6Value property, as defined in section 2.3.6.15, of this shape.

0x014D

The value of the adjust7Value property, as defined in section 2.3.6.16, of this shape.

0x014E

The value of the adjust8Value property, as defined in section 2.3.6.17, of this shape.

0x0153

The value of the xLimo property, as defined in section 2.3.6.22.

0x0154

The value of the yLimo property, as defined in section 2.3.6.23.

0x01FC

The value of the fLine bit from the Line Style Boolean Properties of this shape.

0x0400–0x047F

A value that is calculated from another SG entry in the pGuides_complex array, as defined in section 2.3.6.27, for this shape. The index into the array equals the value minus 0x0400. The index MUST be less than the size of the pGuides_complex array, and it MUST be less than the index of this record in that same array.

0x04F7

The width, in pixels, of a line in this shape.

0x04F8

The width, in pixels, of this shape.

0x04F9

The height, in pixels, of this shape.

0x04FC

The width, in EMUs, of this shape.

0x04FD

The height, in EMUs, of this shape.

0x04FE

The width, in EMUs, of this shape divided by 2.

0x04FF

The height, in EMUs, of this shape divided by 2.

param2 (16 bits): A value that is used to calculate the result of this formula. If fCalculatedParam2 equals 0, this value is an unsigned integer constant. If fCalculatedParam2 equals 1, this value specifies a property or formula according to the table that is documented for param1.

param3 (16 bits): A value that is used to calculate the result of this formula. If fCalculatedParam3 equals 0, this value is an unsigned integer constant. If fCalculatedParam3 equals 1, this value specifies a property or formula according to the table that is documented for param1.