#include <CGAL/Three/Primitive_container.h>
Inherited by CGAL::Three::Edge_container, CGAL::Three::Point_container, and CGAL::Three::Triangle_container.
The Primitive_container struct provides a base for the OpenGL data wrappers.
|
|
void | setSelected (bool) |
| | Setter for the "selected" uniform parameter.
|
| |
|
void | setColor (QColor) |
| | Setter for the "color" parameter.
|
| |
|
|
bool | isSelected () const |
| | getter for the "selected" parameter
|
| |
|
QColor | getColor () const |
| | getter for the "color" parameter
|
| |
◆ Primitive_container()
| CGAL::Three::Primitive_container::Primitive_container |
( |
int |
program, |
|
|
bool |
indexed |
|
) |
| |
Primitive_container ructor.
- Parameters
-
| program | the QOpenGLShaderProgram used by the VAOs. |
| indexed | must be true if the data is indexed, false otherwise. |
◆ allocate()
| void CGAL::Three::Primitive_container::allocate |
( |
std::size_t |
vbo_id, |
|
|
void * |
data, |
|
|
int |
datasize |
|
) |
| |
allocate sets the data for a Vbo.
- Parameters
-
| vbo_id | the index of the Vbo in this container vector. |
| data | the data to give to the Vbo. |
| datasize | the size in bytes of data. |
◆ bindUniformValues()
bindUniformValues sets the uniform variables for the concerned shaders.
Such variables are valid at every step of the pipeline. For example, the ModelViewProjection matrix, the uniform color or the is_selected state are uniform values. This function is called in the draw()function.
- Attention
Vbos data should be allocated for this function to be effective.
-
This should only be called once the
Vaos and the Vbos are created, in a valid OpenGL context.
- Parameters
-
◆ draw()
◆ getCenterSize()
| std::size_t CGAL::Three::Primitive_container::getCenterSize |
( |
| ) |
const |
|
protected |
getCenterSize returns the number of instances of the item in this container.
◆ getFlatDataSize()
| std::size_t CGAL::Three::Primitive_container::getFlatDataSize |
( |
| ) |
const |
|
protected |
getFlatDataSize returns the number of un-indexed vertices.
◆ getIdxSize()
| std::size_t CGAL::Three::Primitive_container::getIdxSize |
( |
| ) |
const |
|
protected |
getIdxSize returns the number of indexed vertices.
◆ initGL()
◆ initializeBuffers()
initializeBuffers sends the data to the GPU memory.
It actually fills up the buffers with the data provided by Vbo::allocate();
- Parameters
-
◆ isDataIndexed()
| bool CGAL::Three::Primitive_container::isDataIndexed |
( |
| ) |
|
|
protected |
isDataIndexed specifies if the data is indexed or not.
This matters for the internal drawing functions.
◆ isGLInit()
| bool CGAL::Three::Primitive_container::isGLInit |
( |
Viewer_interface * |
viewer | ) |
const |
Returns true if the container Vaos and Vbos are created in the context of viewer.
◆ isInit()
| bool CGAL::Three::Primitive_container::isInit |
( |
Viewer_interface * |
viewer | ) |
const |
|
protected |
isInit returns true if the container Vbos are filled for viewer.
◆ removeViewer()
removeViewer deletes and removes the Vao assigned to viewer from Vaos.
- Parameters
-
◆ reset_vbos()
reset_vbos de-allocates the Vbos.
It must be called when the Vbos data is updated.
◆ setCenterSize()
| void CGAL::Three::Primitive_container::setCenterSize |
( |
std::size_t |
| ) |
|
setCenterSize sets the number of instances of the item in this container.
If the program of this container is not instanced, you can ignore this function.
◆ setFlatDataSize()
| void CGAL::Three::Primitive_container::setFlatDataSize |
( |
std::size_t |
| ) |
|
setFlatDataSize sets the number of un-indexed vertices of this container.
If the vertices are indexed, you can ignore this function.
◆ setIdxSize()
| void CGAL::Three::Primitive_container::setIdxSize |
( |
std::size_t |
| ) |
|
setIdxDataSize sets the number of indexed vertices of this container.
If the vertices are not indexed, you can ignore this function.
◆ setVbo()
| void CGAL::Three::Primitive_container::setVbo |
( |
std::size_t |
vbo_id, |
|
|
Vbo * |
vbo |
|
) |
| |
|
protected |
setVbo sets the vbo_idth Vbo of this container to vbo.
- Parameters
-
◆ setVbos()
| void CGAL::Three::Primitive_container::setVbos |
( |
std::vector< Vbo *> |
| ) |
|
|
protected |
setVbos sets the vector of Vbos for this container.
It must contain at least all the Vbos that will be used by the Vaos.