Primitive management in the construction tree.
More...
#include <sdf.h>
|
| PrimitiveManager () |
| Handle the writing of glsl primitives in an order respecting the dependency.
|
|
bool | insertPrimitive (QString, QString, std::list< QString >=std::list< QString >()) |
| add a primitive in the shader, return true if the primitive is inserted, false otherwise (if the primitive was already in the list)
|
|
void | setDependence (QString, std::list< QString > &) |
| set the dependency of a given primitive
|
|
QString | getUniqueName () |
| get a primitive name that is not in the primitives set yet
|
|
QString | getPRIMITIVE () |
| return a glsl code of all primitives in an order respecting the dependency
|
|
QString | getPRIMITIVE (std::list< QString >) |
| return a glsl code of all primitives in an order respecting the dependency
|
|
QString | printGLSL () |
| Write PRIMITIVE code with identation and newline to help the reading.
|
|
|
QString | getPRIMITIVE (QString, std::map< QString, bool > &) |
| Return the glsl code of a primitive and it's dependency.
|
|
|
std::map< QString, std::pair< QString, std::list< QString > > > | primitives |
| A map with primitive names as key, and a pair of (primitive code, list of primitive dependency) as data.
|
|
Primitive management in the construction tree.
◆ PrimitiveManager()
PrimitiveManager::PrimitiveManager |
( |
| ) |
|
|
explicit |
Handle the writing of glsl primitives in an order respecting the dependency.
- Author
- Hubert-Brierre Pierre
◆ getPRIMITIVE() [1/3]
QString PrimitiveManager::getPRIMITIVE |
( |
| ) |
|
return a glsl code of all primitives in an order respecting the dependency
- Author
- Hubert-Brierre Pierre
◆ getPRIMITIVE() [2/3]
QString PrimitiveManager::getPRIMITIVE |
( |
QString | name, |
|
|
std::map< QString, bool > & | primitivesWritten ) |
|
protected |
Return the glsl code of a primitive and it's dependency.
- Author
- Hubert-Brierre Pierre
- Parameters
-
name | The primitive to write. |
primitivesWritten | A map to manage the primitives (true if the primitive is already written, false if the primitive is encouter but not written, not in the map if the primitive is not encouter yet). |
◆ getPRIMITIVE() [3/3]
QString PrimitiveManager::getPRIMITIVE |
( |
std::list< QString > | names | ) |
|
return a glsl code of all primitives in an order respecting the dependency
- Author
- Hubert-Brierre Pierre
◆ getUniqueName()
QString PrimitiveManager::getUniqueName |
( |
| ) |
|
get a primitive name that is not in the primitives set yet
- Author
- Hubert-Brierre Pierre
◆ insertPrimitive()
bool PrimitiveManager::insertPrimitive |
( |
QString | name, |
|
|
QString | glslCode, |
|
|
std::list< QString > | dependency = std::list<QString>() ) |
add a primitive in the shader, return true if the primitive is inserted, false otherwise (if the primitive was already in the list)
- Author
- Hubert-Brierre Pierre
- Parameters
-
name | Name of the primitive. |
glslCode | Code of the primitive. |
dependency | List of name of primitive that need to be written before this one. |
◆ printGLSL()
QString PrimitiveManager::printGLSL |
( |
| ) |
|
Write PRIMITIVE code with identation and newline to help the reading.
- Author
- Hubert-Brierre Pierre
◆ setDependence()
void PrimitiveManager::setDependence |
( |
QString | name, |
|
|
std::list< QString > & | dependency ) |
set the dependency of a given primitive
- Author
- Hubert-Brierre Pierre
- Parameters
-
name | Name of the primitive. |
dependency | List of name of primitive that need to be written before this one. |