# Box

Class Box represent bounding box of the shape

## Constructor

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

Source:
  - classes/box.js, line 20

##### 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

#### xmin :number

Minimal x coordinate

Source:
  - classes/box.js, line 25

##### Type:

- `number`

#### ymin :number

Minimal y coordinate

Source:
  - classes/box.js, line 30

##### Type:

- `number`

#### xmax :number

Maximal x coordinate

Source:
  - classes/box.js, line 35

##### Type:

- `number`

#### ymax :number

Maximal y coordinate

Source:
  - classes/box.js, line 40

##### Type:

- `number`

#### low

Property low need for interval tree interface

Source:
  - classes/box.js, line 55

#### high

Property high need for interval tree interface

Source:
  - classes/box.js, line 63

#### max

Property max returns the box itself !

Source:
  - classes/box.js, line 71

#### center

Return center of the box

Source:
  - classes/box.js, line 79

#### box

Return property box like all other shapes

Source:
  - classes/box.js, line 87

### Methods

#### clone() → {Box}

Return new cloned instance of box

Source:
  - classes/box.js, line 47

##### Returns:

Type:
  `Box`

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

Returns true if not intersected with other box

Source:
  - classes/box.js, line 96

##### Parameters:

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

##### Returns:

Type:
  `boolean`

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

Returns true if intersected with other box

Source:
  - classes/box.js, line 110

##### Parameters:

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

##### Returns:

Type:
  `boolean`

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

Returns new box merged with other box

Source:
  - classes/box.js, line 119

##### Parameters:

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

##### Returns:

Type:
  `Box`

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

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

Source:
  - classes/box.js, line 133

##### Parameters:

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

##### Returns:

Type:
  `boolean`

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

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

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

Source:
  - classes/box.js, line 146

##### Parameters:

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

##### Returns:

Type:
  `boolean`

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

Set new values to the box object

Source:
  - classes/box.js, line 170

##### Parameters:

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

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

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

Source:
  - classes/box.js, line 181

##### 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 194

##### Returns:

Type:
  `Array.<Segment>`

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

Return string to draw circle in svg

Source:
  - classes/box.js, line 211

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrs` | `Object` | an object with attributes of svg rectangle element, like "stroke", "strokeWidth", "fill" Defaults are stroke:"black", strokeWidth:"1", fill:"none"

##### Returns:

Type:
  `string`