mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-19 11:29:08 -06:00
Auto filter property
This commit is contained in:
@@ -45,6 +45,7 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary)
|
||||
:CygnetPlane(dictionary)
|
||||
,_useLog("useLog","Use Logarithm", false)
|
||||
,_useHistogram("useHistogram", "Use Histogram", true)
|
||||
,_autoFilter("autoFilter", "Auto Filter", true)
|
||||
,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0))
|
||||
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
|
||||
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/hot.tf")
|
||||
@@ -59,13 +60,13 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary)
|
||||
|
||||
addProperty(_useLog);
|
||||
addProperty(_useHistogram);
|
||||
addProperty(_autoFilter);
|
||||
addProperty(_normValues);
|
||||
addProperty(_backgroundValues);
|
||||
addProperty(_transferFunctionsFile);
|
||||
addProperty(_dataOptions);
|
||||
|
||||
_type = IswaManager::CygnetType::Data;
|
||||
|
||||
}
|
||||
|
||||
DataPlane::~DataPlane(){}
|
||||
@@ -78,6 +79,7 @@ bool DataPlane::initialize(){
|
||||
}else{
|
||||
OsEng.gui()._iswa.registerProperty(&_useLog);
|
||||
OsEng.gui()._iswa.registerProperty(&_useHistogram);
|
||||
OsEng.gui()._iswa.registerProperty(&_autoFilter);
|
||||
OsEng.gui()._iswa.registerProperty(&_normValues);
|
||||
OsEng.gui()._iswa.registerProperty(&_backgroundValues);
|
||||
OsEng.gui()._iswa.registerProperty(&_transferFunctionsFile);
|
||||
@@ -196,7 +198,8 @@ bool DataPlane::loadTexture() {
|
||||
if(data.empty())
|
||||
return false;
|
||||
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
if(_autoFilter.value())
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
|
||||
bool texturesReady = false;
|
||||
std::vector<int> selectedOptions = _dataOptions.value();
|
||||
|
||||
@@ -58,9 +58,11 @@ friend class IswaGroup;
|
||||
properties::Vec2Property _backgroundValues;
|
||||
|
||||
properties::Vec2Property _normValues;
|
||||
|
||||
properties::BoolProperty _useLog;
|
||||
properties::BoolProperty _useHistogram;
|
||||
|
||||
properties::BoolProperty _autoFilter;
|
||||
|
||||
std::string _dataBuffer;
|
||||
|
||||
std::shared_ptr<DataProcessor> _dataProcessor;
|
||||
|
||||
@@ -40,6 +40,7 @@ DataSphere::DataSphere(const ghoul::Dictionary& dictionary)
|
||||
:CygnetSphere(dictionary)
|
||||
,_useLog("useLog","Use Logarithm", false)
|
||||
,_useHistogram("useHistogram", "Use Histogram", true)
|
||||
,_autoFilter("autoFilter", "Auto Filter", true)
|
||||
,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0))
|
||||
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
|
||||
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/hot.tf")
|
||||
@@ -53,6 +54,7 @@ DataSphere::DataSphere(const ghoul::Dictionary& dictionary)
|
||||
|
||||
addProperty(_useLog);
|
||||
addProperty(_useHistogram);
|
||||
addProperty(_autoFilter);
|
||||
addProperty(_normValues);
|
||||
addProperty(_backgroundValues);
|
||||
addProperty(_transferFunctionsFile);
|
||||
@@ -71,6 +73,7 @@ bool DataSphere::initialize(){
|
||||
}else{
|
||||
OsEng.gui()._iswa.registerProperty(&_useLog);
|
||||
OsEng.gui()._iswa.registerProperty(&_useHistogram);
|
||||
OsEng.gui()._iswa.registerProperty(&_autoFilter);
|
||||
OsEng.gui()._iswa.registerProperty(&_normValues);
|
||||
OsEng.gui()._iswa.registerProperty(&_backgroundValues);
|
||||
OsEng.gui()._iswa.registerProperty(&_transferFunctionsFile);
|
||||
@@ -141,8 +144,9 @@ bool DataSphere::loadTexture(){
|
||||
|
||||
if(data.empty())
|
||||
return false;
|
||||
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
|
||||
if(_autoFilter.value())
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
|
||||
bool texturesReady = false;
|
||||
std::vector<int> selectedOptions = _dataOptions.value();
|
||||
|
||||
@@ -65,8 +65,11 @@ private:
|
||||
properties::Vec2Property _backgroundValues;
|
||||
|
||||
properties::Vec2Property _normValues;
|
||||
|
||||
properties::BoolProperty _useLog;
|
||||
properties::BoolProperty _useHistogram;
|
||||
properties::BoolProperty _autoFilter;
|
||||
|
||||
|
||||
std::string _dataBuffer;
|
||||
std::shared_ptr<DataProcessor> _dataProcessor;
|
||||
|
||||
@@ -51,6 +51,7 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
|
||||
:CygnetPlane(dictionary)
|
||||
,_useLog("useLog","Use Logarithm", false)
|
||||
,_useHistogram("useHistogram", "Use Histogram", false)
|
||||
,_autoFilter("autoFilter", "Auto Filter", true)
|
||||
,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0))
|
||||
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
|
||||
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/hot.tf")
|
||||
@@ -67,6 +68,7 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
|
||||
|
||||
addProperty(_useLog);
|
||||
addProperty(_useHistogram);
|
||||
addProperty(_autoFilter);
|
||||
addProperty(_normValues);
|
||||
addProperty(_backgroundValues);
|
||||
addProperty(_resolution);
|
||||
@@ -139,6 +141,7 @@ bool KameleonPlane::initialize(){
|
||||
}else{
|
||||
OsEng.gui()._iswa.registerProperty(&_useLog);
|
||||
OsEng.gui()._iswa.registerProperty(&_useHistogram);
|
||||
OsEng.gui()._iswa.registerProperty(&_autoFilter);
|
||||
OsEng.gui()._iswa.registerProperty(&_normValues);
|
||||
OsEng.gui()._iswa.registerProperty(&_backgroundValues);
|
||||
OsEng.gui()._iswa.registerProperty(&_resolution);
|
||||
@@ -271,8 +274,9 @@ bool KameleonPlane::loadTexture() {
|
||||
|
||||
if(data.empty())
|
||||
return false;
|
||||
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
|
||||
if(_autoFilter.value())
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
|
||||
bool texturesReady = false;
|
||||
for(int option: selectedOptions){
|
||||
|
||||
@@ -77,8 +77,11 @@
|
||||
properties::Vec2Property _backgroundValues;
|
||||
|
||||
properties::Vec2Property _normValues;
|
||||
|
||||
properties::BoolProperty _useLog;
|
||||
properties::BoolProperty _useHistogram;
|
||||
properties::BoolProperty _autoFilter;
|
||||
|
||||
|
||||
std::shared_ptr<KameleonWrapper> _kw;
|
||||
std::string _kwPath;
|
||||
|
||||
@@ -47,7 +47,6 @@ private:
|
||||
bool gmimage;
|
||||
bool iondata;
|
||||
|
||||
int _cdfOption;
|
||||
std::vector<int> _cdfOptions;
|
||||
std::map<std::string, int> _cdfOptionsMap;
|
||||
};
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace openspace {
|
||||
namespace gui {
|
||||
GuiIswaComponent::GuiIswaComponent()
|
||||
:GuiPropertyComponent()
|
||||
,_cdfOption(-1)
|
||||
{}
|
||||
|
||||
void GuiIswaComponent::render() {
|
||||
|
||||
Reference in New Issue
Block a user