void PlotDataFitFunction::calculate() { if (!pData_) return; if (fittingValues_.column >= 0) { fitData(); } else { PlotFunction* newPlotData; newPlotData = new PlotFunction(); newPlotData->getPlotExpression().setExpressionName(expressionNameInput_.get()); newPlotData->setExpressionLength(static_cast<PlotFunction::ExpressionDescriptionLengthType>(expressionText_.getValue()), maxLength_.get(),selfDescription_.get()); PlotFunction* oldData; oldData = pDataOut_; pDataOut_ = newPlotData; setOutPortData(); if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } oldData->getPlotExpression().deletePlotExpressionNodes(); delete oldData; } }
void CanvasRenderer::resizeCanvas(tgt::ivec2 newsize) { if (!tgt::hand(tgt::greaterThanEqual(newsize, tgt::ivec2(canvasSize_.getMinValue()))) && tgt::hand(tgt::lessThanEqual(newsize, canvasSize_.getMaxValue()))) { LWARNING("Invalid canvas dimensions: " << newsize << ". Ignoring."); } if (!canvas_) return; if (getProcessorWidget() && getProcessorWidget()->getSize() != newsize) { if (getProcessorWidget()->isVisible()) { getProcessorWidget()->setSize(newsize.x, newsize.y); } newsize = getProcessorWidget()->getSize(); } if (newsize != inport_.getSize()) { canvas_->getGLFocus(); glViewport(0, 0, static_cast<GLint>(newsize.x), static_cast<GLint>(newsize.y)); inport_.requestSize(newsize); } canvasSize_.set(newsize); }
void PlotDataFitFunction::fitData() { if (fittingValues_.regressionType == FunctionLibrary::LINEAR) linearRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::SQRT) sqrtRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::SIMPLESPLINE) simpleSplineRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::CONSTANTSPLINE) constantSpline(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::BSPLINE) bSplineRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::CUBICSPLINE) cubicSplineRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::SQUARE) squareRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::CUBIC) cubicRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::POLYNOMIAL) multiRegression(fittingValues_.dimension,fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::LOGARITHMIC) logarithmicRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::POWER) powerRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::EXPONENTIAL) exponentialRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::SIN) sinRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::COS) cosRegression(fittingValues_.column); else if (fittingValues_.regressionType == FunctionLibrary::INTERPOLATION) interpolRegression(fittingValues_.column); else { if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } } }
void PlotFunctionDiscret::process() { tgtAssert(isInitialized(), "not initialized"); if (inPort_.hasData() && inPort_.hasChanged()) { readData(); calculate(); } else if (!inPort_.hasData()){ pData_ = 0; PlotData* oldPlotData; oldPlotData = pDataOut_; pDataOut_ = new PlotData(0,0); setOutPortData(); if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } delete oldPlotData; } else if (inPort_.hasData() && !inPort_.hasChanged()) { calculate(); } else if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } }
void PlotDataMerge::calculate() { tgtAssert(isInitialized(), "not initialized"); PlotData* oldData; oldData = pDataOut_; if (pFirstData_ && !pSecondData_) pDataOut_ = new PlotData(*pFirstData_); else if (!pFirstData_ && pSecondData_) pDataOut_ = new PlotData(*pSecondData_); else if (!pFirstData_ && !pSecondData_) pDataOut_ = 0; else { pDataOut_ = new PlotData(1,5); if (ignoreColumnLabel_.get()) pFirstData_->mergeWith(*pSecondData_,*pDataOut_,PlotData::IGNORECOLUMNLABELS); else pFirstData_->mergeWith(*pSecondData_,*pDataOut_); } setOutPortData(); if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } delete oldData; }
void OntologyClassificationProcessor::updateView() { if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } }
void PlotDataFitFunction::updateView() { if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } }
void CanvasRenderer::boolPropertyChanged() { if(getProcessorWidget()) getProcessorWidget()->updateFromProcessor(); }
void PlotDataMerge::updateView() { if (getProcessorWidget()){ getProcessorWidget()->updateFromProcessor(); } }