- Main Page
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

# IpeAttribute Class Reference
[Ipe Attributes]

An attribute of an Ipe object. More...

List of all members.

## Public Types

- enum TKind {
  ELineWidth = 0, EMarkSize, EArrowSize, EGridSize,
  EAngleSize, ETextStretch, EDashStyle, ETextSize,
  EColor, ETextStyle, ETemplate, ELineCap,
  ELineJoin, EWindRule, EMaxKind
  }

## Public Member Functions

- IpeAttribute ()
- IpeAttribute (TKind kind, bool symbolic, int index)
- IpeAttribute (TKind kind, IpeFixed value)
- int IsSymbolic () const
- operator bool () const
- bool IsNull () const
- bool IsAbsolute () const
- int IsValue () const
- int IsNumeric () const
- bool IsVoid () const
- bool IsNullOrVoid () const
- bool IsSolid () const
- bool IsNullOrSolid () const
- bool IsBlack () const
- bool IsWhite () const
- int Index () const
- IpeFixed Number () const
- TKind Kind () const
- bool operator== (const IpeAttribute &rhs) const
- bool operator!= (const IpeAttribute &rhs) const

## Static Public Member Functions

- static IpeAttribute Void ()
- static IpeAttribute Solid ()
- static IpeAttribute Black ()
- static IpeAttribute White ()

## Friends

- class IpeStyleSheet

## Detailed Description

An attribute of an Ipe object.

An attribute is either null (i.e. not defined---it hasn't been set yet), or symbolic (a name that has to be looked up using an IpeStyleSheet), or an absolute value.

A null value is used in higher levels of the hierarchy to defer the setting of the attribute to a lower level. For example, if the pen width is set in an IpeGroup object, all its members have this uniform pen width. To allow the members to have individual pen width, the IpeGroup must have a null pen width.

To make the representation more compact, Ipe objects store attribute values as an index into an IpeRepository. IpeAttribute encapsulates this index. Its meaning is as follows:

- 0 : a null argument, see below,
- 1 : the void color or line style
- 2 : the solid line style
- 3 : the black color
- 4 : the white color
- if IsSymbolic: a symbolic name. Use IpeStyleSheet to map to an absolute value.
- if IsNumeric: an absolute, numeric value. Use Number() to return the number, in the range 0.0 to 16777.215 (with 3 digits fixed point precision).
- if IsValue: an absolute value. Use IpeRepository to map to the absolute value.

An attribute is absolute (IsAbsolute() returns true) if it is neither null nor symbolic.

Furthermore, the attribute stores the type of attribute, such as scalar (a double value), color, dash style, etc.

Note the difference between the null color, which means that the color has not yet been defined (it is left to lower-level objects), and the "void" color, which means that the object should not be filled.

When rendering an object, a null color is interpreted as the void color. This allows leaf objects not to specify the void color.

Note that it is impossible for style sheets to redefine the meaning of "black" and "white". If a user needs a symbolic name that is black or white in some styles, she can always define another symbolic name, e.g. "Black" and "White".

Note also the difference between null and "solid" (the special dash style of a solid line). It is impossible for style sheets to redefine the meaning of "solid".

When rendering an object, a null dash style is interpreted as solid.

## Member Enumeration Documentation

enum IpeAttribute::TKind

The different kinds of attributes.

## Constructor & Destructor Documentation

IpeAttribute::IpeAttribute | ( |  | ) | `[inline, explicit]`

Default constructor creates null object.

IpeAttribute::IpeAttribute | ( | TKind | kind,
|  | bool | symbolic,
|  | int | index |
| ) |  |  | `[explicit]`

Create an attribute of given kind.

IpeAttribute::IpeAttribute | ( | TKind | kind,
|  | IpeFixed | value |
| ) |  |  | `[explicit]`

Create an absolute numeric attribute.

## Member Function Documentation

int IpeAttribute::IsSymbolic | ( |  | ) | const`[inline]`

Is it symbolic?

IpeAttribute::operator bool | ( |  | ) | const`[inline]`

In bool expressions, attribute is false iff it is null.

bool IpeAttribute::IsNull | ( |  | ) | const`[inline]`

Is it null?

bool IpeAttribute::IsAbsolute | ( |  | ) | const`[inline]`

Is it absolute (including the special values `void`, `solid`, `black`, or `white`)?

int IpeAttribute::IsValue | ( |  | ) | const`[inline]`

Is it an (absolute) value (either numeric or in IpeRepository)?

int IpeAttribute::IsNumeric | ( |  | ) | const`[inline]`

Is it a numeric value?

bool IpeAttribute::IsVoid | ( |  | ) | const`[inline]`

Is it void?

bool IpeAttribute::IsNullOrVoid | ( |  | ) | const`[inline]`

Is it null or void (null is interpreted as void when drawing)?

bool IpeAttribute::IsSolid | ( |  | ) | const`[inline]`

Is it solid?

bool IpeAttribute::IsNullOrSolid | ( |  | ) | const`[inline]`

Is it null or solid (null is interpreted as solid when drawing)?

bool IpeAttribute::IsBlack | ( |  | ) | const`[inline]`

Is it black?

bool IpeAttribute::IsWhite | ( |  | ) | const`[inline]`

Is it white?

int IpeAttribute::Index | ( |  | ) | const`[inline]`

Return index into IpeRepository.

IpeFixed IpeAttribute::Number | ( |  | ) | const`[inline]`

Return value of absolute numeric argument.

IpeKind IpeAttribute::Kind | ( |  | ) | const

Return kind of attribute.

bool IpeAttribute::operator== | ( | const IpeAttribute & | rhs | ) | const`[inline]`

Are two values equal (only compares index!).

bool IpeAttribute::operator!= | ( | const IpeAttribute & | rhs | ) | const`[inline]`

Are two values different (only compares index!).

static IpeAttribute IpeAttribute::Void | ( |  | ) | `[inline, static]`

Create void color or pen.

static IpeAttribute IpeAttribute::Solid | ( |  | ) | `[inline, static]`

Create solid dash style.

static IpeAttribute IpeAttribute::Black | ( |  | ) | `[inline, static]`

Create black color.

static IpeAttribute IpeAttribute::White | ( |  | ) | `[inline, static]`

Create white color.

The documentation for this class was generated from the following files:

- ipecolor.h
- ipecolor.cpp