# Box

Class Box represent bounding box of the shape

## Constructor

#### new Box(xmin, ymin, xmax, ymax)

Source:
  - classes/box.js, line 13

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmin` | `number` | minimal x coordinate
`ymin` | `number` | minimal y coordinate
`xmax` | `number` | maximal x coordinate
`ymax` | `number` | maximal y coordinate

### Classes

Box

### Members

#### box

Return property box like all other shapes

Source:
  - classes/box.js, line 104

#### center

Return center of the box

Source:
  - classes/box.js, line 80

#### height

Return the height of the box

Source:
  - classes/box.js, line 96

#### high

Property high need for interval tree interface

Source:
  - classes/box.js, line 64

#### low

Property low need for interval tree interface

Source:
  - classes/box.js, line 56

#### max

Property max returns the box itself !

Source:
  - classes/box.js, line 72

#### width

Return the width of the box

Source:
  - classes/box.js, line 88

#### xmax :number

Maximal x coordinate

Source:
  - classes/box.js, line 36

##### Type:

- `number`

#### xmin :number

Minimal x coordinate

Source:
  - classes/box.js, line 26

##### Type:

- `number`

#### ymax :number

Maximal y coordinate

Source:
  - classes/box.js, line 41

##### Type:

- `number`

#### ymin :number

Minimal y coordinate

Source:
  - classes/box.js, line 31

##### Type:

- `number`

### Methods

#### clone() → {Box}

Return new cloned instance of box

Source:
  - classes/box.js, line 48

##### Returns:

Type:
  `Box`

#### equal_to(other_box) → {boolean}

Returns true if this box is equal to other box, false otherwise

Source:
  - classes/box.js, line 163

##### Parameters:

Name | Type | Description
--- | --- | ---
`other_box` | `Box` | query box

##### Returns:

Type:
  `boolean`

#### intersect(other_box) → {boolean}

Returns true if intersected with other box

Source:
  - classes/box.js, line 127

##### Parameters:

Name | Type | Description
--- | --- | ---
`other_box` | `Box` | Query box

##### Returns:

Type:
  `boolean`

#### less_than(other_box) → {boolean}

Defines predicate "less than" between two boxes. Need for interval index

Source:
  - classes/box.js, line 150

##### Parameters:

Name | Type | Description
--- | --- | ---
`other_box` | `Box` | other box

##### Returns:

Type:
  `boolean`

- true if this box less than other box, false otherwise

#### merge(other_box) → {Box}

Returns new box merged with other box

Source:
  - classes/box.js, line 136

##### Parameters:

Name | Type | Description
--- | --- | ---
`other_box` | `Box` | Other box to merge with

##### Returns:

Type:
  `Box`

#### not_intersect(other_box) → {boolean}

Returns true if not intersected with other box

Source:
  - classes/box.js, line 113

##### Parameters:

Name | Type | Description
--- | --- | ---
`other_box` | `Box` | other box to test

##### Returns:

Type:
  `boolean`

#### set(xmin, ymin, xmax, ymax)

Set new values to the box object

Source:
  - classes/box.js, line 187

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmin` | `number` | miminal x coordinate
`ymin` | `number` | minimal y coordinate
`xmax` | `number` | maximal x coordinate
`ymax` | `number` | maximal y coordinate

#### svg(attrs) → {string}

Return string to draw box in svg

Source:
  - classes/box.js, line 226

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrs` | `Object` | an object with attributes of svg rectangle element

##### Returns:

Type:
  `string`

#### toPoints() → {Array.<Point>}

Transform box into array of points from low left corner in counter clockwise

Source:
  - classes/box.js, line 198

##### Returns:

Type:
  `Array.<Point>`

#### toSegments() → {Array.<Segment>}

Transform box into array of segments from low left corner in counter clockwise

Source:
  - classes/box.js, line 211

##### Returns:

Type:
  `Array.<Segment>`