Ipe documents can use symbolic attributes, such as 'normal', 'fat', or 'thin' for line thickness, or 'red', 'navy', 'turquoise' for color, as well as absolute attributes such as (0.5,0.5,0.5) for medium gray. To avoid storing these very common values hundreds of times, IpeRepository keeps a repository of all the non-scalar attribute values in the document. Inside IpeObject's attributes are represented as integer indices into the repository.
There are currently the following symbolic attributes with values stored in the repository.
The following attributes can be symbolic, but if they are absolute then the scalar value is stored inside the IpeAttribute (not in the repository).
Finally, line join, line cap, and the fill rule cannot be symbolic. They can be null, or have an absolute value stored inside the attribute.
IpeRepository::IpeRepository | ( | ) |
Constructor.
IpeString IpeRepository::ToString | ( | IpeAttribute | attr | ) | const |
Return string with given index.
Both symbolic and absolute values are possible.
IpeColor IpeRepository::ToColor | ( | IpeAttribute | index | ) | const |
Return color with given index.
IpeFixed IpeRepository::ToScalar | ( | IpeAttribute | index | ) | const |
Return value with given index.
IpeAttribute IpeRepository::ToAttribute | ( | const IpeColor & | color | ) |
Lookup a color (add it if it doesn't exist yet), and return index.
IpeAttribute IpeRepository::ToAttribute | ( | IpeKind | kind, | |
IpeFixed | value | |||
) |
Lookup value (add it if it doesn't exist yet), and return index.
IpeAttribute IpeRepository::MakeColor | ( | IpeString | str | ) |
Create an IpeAttribute representing the color described.
Empty string creates null color, string starting with a letter creates a symbolic color (includes special case "void"), otherwise absolute color.
IpeAttribute IpeRepository::MakeString | ( | IpeKind | kind, | |
IpeString | str | |||
) |
Construct absolute value (which is a string).
IpeAttribute IpeRepository::MakeDashStyle | ( | IpeString | str | ) |
Construct dash style attribute from string.
Empty string creates null value, string starting with '[' creates an absolute dash style, otherwise symbolic dash style (including the special case "solid").
IpeAttribute IpeRepository::MakeTextSize | ( | IpeString | str | ) |
Construct text size attribute from string.
Empty string creates null value, string starting with digit creates an numeric absolute value, string starting with letter creates symbolic text size, anything else creates absolute (string) text size.
IpeAttribute IpeRepository::MakeScalar | ( | IpeKind | kind, | |
IpeString | str | |||
) |
Construct scalar attribute from string.
Empty string creates null value, string starting with non-letter creates an absolute value, string starting with letter creates symbolic value.
IpeAttribute IpeRepository::MakeSymbol | ( | IpeKind | kind, | |
IpeString | str | |||
) |
Construct symbolic attribute from string.
Empty string creates null value, anything else creates symbolic value.
IpeAttribute IpeRepository::GetSymbol | ( | IpeKind | kind, | |
IpeString | str | |||
) | const |
Construct symbolic attribute from string.
Like MakeSymbol, but will not create new repository entry.
IpeString IpeRepository::String | ( | IpeAttribute | attr | ) | const |
Return string representation of attribute (symbolic or absolute).