Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::xgl::Layers Class Reference

Creates and holds the layers of the loaded drawings. More...

#include <Layers.h>

Inheritance diagram for sf::xgl::Layers:
Collaboration diagram for sf::xgl::Layers:

Public Member Functions

 Layers (QObject *parent=nullptr)
 Default Qt constructor.
 
 ~Layers () override
 Overridden destructor.
 
bool load (const QString &filepath, const QStringList &layers={})
 Generic method to load drawings.
 
QStringList getLayerNames (bool loaded=true) const
 Gets the layer names from the file or the ones loaded.
 
VertexArrayBasegetVertexArray (QOpenGLShaderProgram *sp, const QString &layer, const QColor &color={0, 0, 0, 0})
 Gets the vertex array from the specified layer for the given shader program.
 

Detailed Description

Creates and holds the layers of the loaded drawings.

Constructor & Destructor Documentation

◆ Layers()

sf::xgl::Layers::Layers ( QObject *  parent = nullptr)
explicit

Default Qt constructor.

Parameters
parentOwning parent.

◆ ~Layers()

sf::xgl::Layers::~Layers ( )
override

Overridden destructor.

Member Function Documentation

◆ getLayerNames()

QStringList sf::xgl::Layers::getLayerNames ( bool  loaded = true) const

Gets the layer names from the file or the ones loaded.

Parameters
loadedWhen true, only the actual loaded layer names are returned.
Returns
List of layer names.

◆ getVertexArray()

VertexArrayBase * sf::xgl::Layers::getVertexArray ( QOpenGLShaderProgram *  sp,
const QString &  layer,
const QColor &  color = {0, 0, 0, 0} 
)

Gets the vertex array from the specified layer for the given shader program.

Parameters
spRequired shader program.
layerName of the layer.
colorOptional color to override the color given by the graphic file.
Returns
Derived vertex array class.

◆ load()

bool sf::xgl::Layers::load ( const QString &  filepath,
const QStringList &  layers = {} 
)

Generic method to load drawings.

Parameters
filepathPath to the file containing the drawing.
layersLayers to load. When empty, all layers are loaded.
Returns
True on success and false otherwise.

The documentation for this class was generated from the following file: