fractorium/Source/Ember/VariationList.h
Person 1dfbd4eff2 --User changes
-Add new preset dimensions to the right click menu of the width and height fields in the editor.
-Change QSS stylesheets to properly handle tabs.
-Make tabs rectangular by default. For some reason, they had always been triangular.

--Bug fixes
 -Incremental rendering times in the editor were wrong.

--Code changes
 -Migrate to Qt6. There is probably more work to be done here.
-Migrate to VS2022.
-Migrate to Wix 4 installer.
-Change installer to install to program files for all users.
-Fix many VS2022 code analysis warnings.
-No longer use byte typedef, because std::byte is now a type. Revert all back to unsigned char.
-Upgrade OpenCL headers to version 3.0 and keep locally now rather than trying to look for system files.
-No longer link to Nvidia or AMD specific OpenCL libraries. Use the generic installer located at OCL_ROOT too.
-Add the ability to change OpenCL grid dimensions. This was attempted for investigating possible performance improvments, but made no difference.

This has not been verified on Linux or Mac yet.
2023-04-25 17:59:54 -06:00

68 lines
2.9 KiB
C++

#pragma once
#include "Variation.h"
/// <summary>
/// VariationList class.
/// </summary>
namespace EmberNs
{
/// <summary>
/// Since the list of variations is numerous, it's convenient to be able to make copies
/// of specific ones. This class holds a list of pointers to variation objects for every
/// variation available. Similar to the PaletteList class, a caller can look up a variation
/// by name or ID and retrieve a copy of it.
/// This class follows the singleton pattern.
/// All variations are deleted upon destruction.
/// Template argument expected to be float or double.
/// </summary>
template <typename T>
class EMBER_API VariationList: public Singleton<VariationList<T>>
{
public:
const Variation<T>* GetVariation(size_t index) const;
const Variation<T>* GetVariation(size_t index, eVariationType varType) const;
Variation<T>* GetVariationCopy(size_t index, T weight = 1) const;
Variation<T>* GetVariationCopy(size_t index, eVariationType varType, T weight = 1) const;
const Variation<T>* GetVariation(eVariationId id) const;
Variation<T>* GetVariationCopy(eVariationId id, T weight = 1) const;
const Variation<T>* GetVariation(const string& name) const;
Variation<T>* GetVariationCopy(const string& name, T weight = 1) const;
const ParametricVariation<T>* GetParametricVariation(size_t index) const;
const ParametricVariation<T>* GetParametricVariation(const string& name) const;
ParametricVariation<T>* GetParametricVariationCopy(eVariationId id, T weight = 1) const;
const Variation<T>* GetPreVariation(const string& name) const;
const Variation<T>* GetPostVariation(const string& name) const;
int GetVariationIndex(const string& name) const;
size_t Size() const;
size_t RegSize() const;
size_t PreSize() const;
size_t PostSize() const;
size_t ParametricSize() const;
size_t NonParametricSize() const;
const vector<const Variation<T>*>& AllVars() const;
const vector<const Variation<T>*>& RegVars() const;
const vector<const Variation<T>*>& PreVars() const;
const vector<const Variation<T>*>& PostVars() const;
const vector<const Variation<T>*>& NonParametricVariations() const;
const vector<const ParametricVariation<T>*>& ParametricVariations() const;
SINGLETON_DERIVED_DECL(VariationList<T>);
private:
VariationList();
Variation<T>* MakeCopyWithWeight(const Variation<T>* var, T weight) const;
template <template <typename> class U>
const U<T>* SearchVarName(const vector<const U<T>*>& vars, const string& name) const;
vector<const Variation<T>*> m_Variations;//A list of pointers to dynamically allocated variation objects.
vector<const Variation<T>*> m_RegVariations;
vector<const Variation<T>*> m_PreVariations;
vector<const Variation<T>*> m_PostVariations;
vector<const Variation<T>*> m_NonParametricVariations;
vector<const ParametricVariation<T>*> m_ParametricVariations;//A list of pointers to elements in m_Variations which are derived from ParametricVariation.
};
}