ofxVariableLab/src/LayerComposition.h

50 lines
2 KiB
C
Raw Normal View History

2023-03-25 18:59:58 +01:00
#pragma once
#include "ofMain.h"
2023-04-12 10:58:53 +02:00
#include "AtlasLayerCombo.h"
#include "MsdfAtlasLayerCombo.h"
#include "MsdfLayer.h"
2023-04-12 10:58:53 +02:00
#include "GPUFontAtlasLayerCombo.h"
2023-04-12 09:28:47 +02:00
#include "GPUFontLayer.h"
2023-04-13 17:15:35 +02:00
#include "Utils.h"
2023-03-25 18:59:58 +01:00
namespace ofxVariableLab {
class LayerComposition {
public:
void setup();
void update();
void draw(int width = 0, int height = 0) const;
2023-04-14 16:55:15 +02:00
LayerID addLayer(const Layer::Props & props,
LayerID layerID = "");
2023-04-07 16:17:07 +02:00
LayerID addLayer(const ComboIdentifier & identifier,
const string & text,
2023-04-14 16:55:15 +02:00
const std::vector <FontVariation> & variations,
AtlasLayerComboSettings & s,
2023-04-14 16:55:15 +02:00
LayerID layerID = "");
LayerID addLayer(const ComboIdentifier & identifier,
const Layer::Props & props,
2023-04-14 16:55:15 +02:00
const std::vector <FontVariation> & variations,
AtlasLayerComboSettings & s,
2023-04-14 16:55:15 +02:00
LayerID layerID = "");
void findOrCreateNewMomForLayer(shared_ptr <Layer> layer,
ComboIdentifier idealMom);
2023-04-13 17:15:35 +02:00
void removeLayer(const LayerID & id); // TODO: make bool, to catch nonexisting
2023-04-22 13:48:02 +02:00
const unordered_map <LayerID, shared_ptr <Layer> > & getLayers();
2023-04-13 17:15:35 +02:00
shared_ptr <Layer> getLayer(const LayerID & layerID);
const unordered_map <ComboIdentifier, shared_ptr <AtlasLayerCombo> > & getAtlasLayerCombos() const;
2023-04-11 13:17:30 +02:00
void setVFlip(bool vFlip);
2023-03-25 18:59:58 +01:00
2023-05-14 08:33:23 +02:00
void setLayerOrder(const vector <LayerID> & layerOrder);
2023-03-25 18:59:58 +01:00
private:
2023-04-11 13:17:30 +02:00
VFlipState vFlipState = V_FLIP_UNKNOWN;
2023-04-13 17:15:35 +02:00
unordered_map <LayerID, shared_ptr <Layer> > layers;
2023-05-14 08:33:23 +02:00
unordered_map <LayerID, shared_ptr <AtlasLayerCombo> > layerIDcombos;
unordered_map <ComboIdentifier, shared_ptr <AtlasLayerCombo> > atlasLayerCombos;
2023-05-14 08:33:23 +02:00
vector <LayerID> layerOrder;
2023-04-13 17:15:35 +02:00
//unordered_map <LayerIdentifier, shared_ptr <ofxVariableLab::Layer> > layers;
2023-03-25 18:59:58 +01:00
};
}