---
name: "tlp_GlBox"
section: "3tulip"
platform: "linux"
package: "tulip-doc"
version: "3.1.2-2.3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/tlp_GlBox"
---

# tlp\_GlBox(3tulip)

General class used to render boxes as GlEntity.

## NAME

tlp::GlBox -

General class used to render boxes as **GlEntity**.

## SYNOPSIS

`#include <GlBox.h>`

Inherits **tlp::GlSimpleEntity**.

### Public Member Functions

**GlBox** ()\
 **GlBox** (const Coord &**position**, const Size &**size**, const Color &**color**)\
 **GlBox** (Coord **points**\[8\], const Color &**color**)\
 **GlBox** (const Coord &frontTopLeft, const Coord &backBottomRight, const Color &**color**)\
 virtual **~GlBox** ()\
 virtual void **draw** (float lod, **Camera** \*camera)\
 void **setSize** (const Size &**size**)\
 void **setPosition** (const Coord &**position**)\
 Size \* **getSize** () const \
 virtual void **translate** (const Coord &mouvement)\
 virtual void **getXML** (xmlNodePtr rootNode)\
 virtual void **setWithXML** (xmlNodePtr rootNode)\

### Protected Member Functions

void **computePoints** ()\
 void **computeFaces** ()\

### Protected Attributes

Coord \* **position**\
 Color \* **color**\
 Size \* **size**\
 Coord \* **points** \[N\_BOX\_POINTS\]\
 **GlPolygon** \* **faces** \[N\_BOX\_FACES\]\

## Detailed Description

General class used to render boxes as **GlEntity**.

This class is a generic class to render boxes as **GlEntity**.

## Constructor & Destructor Documentation

### tlp::GlBox::GlBox () The default constructor

**Attention:**

It's usage is forbidden.

### tlp::GlBox::GlBox (const Coord & position, const Size & size, const Color & color) Constructor from size

**Parameters:**

*position* The center of the box. \
 *size* The length of each dimension of the box. \
 *color* The color of the box.

### tlp::GlBox::GlBox (Coord points\[8\], const Color & color) Constructor from points

**Parameters:**

*points* Each point of the box. c.f. the variable 'points' to know the placement. \
 *color* The color of the box.

### tlp::GlBox::GlBox (const Coord & frontTopLeft, const Coord & backBottomRight, const Color & color) Constructor from bounding box

**Parameters:**

*frontTopLeft* The position of the point at the front-top-left of the box (points\[0\]). \
 *backbottomRight* The position of the point at the back-bottom-right of the box (points\[6\]). \
 *color* The color of the box.

### virtual tlp::GlBox::~GlBox ()` [virtual]` Destructor.

## Member Function Documentation

### void tlp::GlBox::computeFaces ()` [protected]` Function used to compute the GlADQuad from the points of the box.

### void tlp::GlBox::computePoints ()` [protected]` Function used to compute the points of the box from a center and a size.

### virtual void tlp::GlBox::draw (float lod, Camera \* camera)` [virtual]` Virtual function used to draw the box.

Implements **tlp::GlSimpleEntity**.

### Size\* tlp::GlBox::getSize () const Accessor in reading to the size.

### virtual void tlp::GlBox::getXML (xmlNodePtr rootNode)` [virtual]` Function to export data in XML

Implements **tlp::GlSimpleEntity**.

### void tlp::GlBox::setPosition (const Coord & position) Accessor in writing to the position.

### void tlp::GlBox::setSize (const Size & size) Accessor in writing to the size.

### virtual void tlp::GlBox::setWithXML (xmlNodePtr rootNode)` [virtual]` Function to set data with XML

Implements **tlp::GlSimpleEntity**.

### virtual void tlp::GlBox::translate (const Coord & mouvement)` [virtual]` Translate entity

Reimplemented from **tlp::GlSimpleEntity**.

## Member Data Documentation

### Color\* tlp::GlBox::color` [protected]` The color of the box

### GlPolygon\* tlp::GlBox::faces\[N\_BOX\_FACES\]` [protected]` Stores a GlPolygon per face

### Coord\* tlp::GlBox::points\[N\_BOX\_POINTS\]` [protected]` The coordinates of each of the 8 points of the box.

**Attention:**

points\[0\] = front top left

points\[1\] = front top right

points\[2\] = front bottom right

points\[3\] = front bottom left

points\[4\] = back top left

points\[5\] = back top right

points\[6\] = back bottom right

points\[7\] = back bottom left

### Coord\* tlp::GlBox::position` [protected]` The position of the center of the box

### Size\* tlp::GlBox::size` [protected]` size is the 'radius' of the box

## Author

Generated automatically by Doxygen for Tulip Open GL Library from the source code.
