FilterNode* TagTreeNodeRadioGroup::filter() const { tracer->invoked(__func__); FilterNode* rootFilter = new FilterNodeOpAnd(0); FilterNode* andFilter = new FilterNodeOpAnd(rootFilter); FilterNode* orFilter = new FilterNodeOpOr(rootFilter); // loop over all radio children and add them to the filterRootNode TagTreeNodeRadio* child = dynamic_cast<TagTreeNodeRadio*>(this->firstChild()); while( child ) { // get the filter of the current child FilterNode* childFilter = child->subfilter(); if (childFilter) { if (child->filterState() == TagTreeNode::FILTERSTATE_INCLUDE) { orFilter->addChild(childFilter); } else if (child->filterString() == TagTreeNode::FILTERSTATE_EXCLUDE) { andFilter->addChild(childFilter); } } // get next child child = dynamic_cast<TagTreeNodeRadio*>(child->nextSibling()); } return rootFilter; }
void CVertexDeclFilter::RenderEx(void) { if (m_RenderList.empty()) return; CRenderList::iterator it = m_RenderList.begin(); CRenderList::iterator eit = m_RenderList.end(); CRenderPipeline* crp = CRenderPipeline::GetInst(); FilterNode* fn = 0; for(;;) { SQR_TRY { for (;it!=eit;) { fn = (FilterNode*)*(it++); fn->param_render(*fn); m_pParentFilter->UpdateRenderStyle(fn->m_RP); crp->RenderEx(fn); } break; } SQR_CATCH(exp) { exp.AppendType("CVertexDeclFilter::RenderEx发生结构化异常"); GfkLogExp(exp); fn->Release(); } SQR_TRY_END } crp->SetTextureMatrixImmediate(0, NULL);//fix a d3d error }
void FilterEditor::channelChanged (int channel, bool /*newState*/) { FilterNode* fn = (FilterNode*) getProcessor(); highCutValue->setText (String (fn->getHighCutValueForChannel (channel)), dontSendNotification); lowCutValue->setText (String (fn->getLowCutValueForChannel (channel)), dontSendNotification); applyFilterOnChan->setToggleState (fn->getBypassStatusForChannel (channel), dontSendNotification); }
ExecutionNode* FilterNode::getCopy() const { FilterNode* node = new FilterNode(); if(NULL!=m_validator) { node->setValidator(m_validator->getCopy()); } if(NULL!=m_nextNode) { node->setNextNode(m_nextNode->getCopy()); } return node; }
void FilterEditor::labelTextChanged(Label* label) { FilterNode* fn = (FilterNode*) getProcessor(); Value val = label->getTextValue(); double requestedValue = double(val.getValue()); if (requestedValue < 0.01 || requestedValue > 10000) { sendActionMessage("Value out of range."); if (label == highCutValue) { label->setText(lastHighCutString, dontSendNotification); } else { label->setText(lastLowCutString, dontSendNotification); } return; } Array<int> chans = getActiveChannels(); // This needs to change, since there's not enough feedback about whether // or not individual channel settings were altered: for (int n = 0; n < chans.size(); n++) { if (label == highCutValue) { double minVal = fn->getLowCutValueForChannel(n); if (requestedValue > minVal) { fn->setCurrentChannel(n); fn->setParameter(1, requestedValue); } lastHighCutString = label->getText(); } else { double maxVal = fn->getHighCutValueForChannel(n); if (requestedValue < maxVal) { fn->setCurrentChannel(n); fn->setParameter(0, requestedValue); } lastLowCutString = label->getText(); } } }
Grantlee::Node* FilterNodeFactory::getNode( const QString& tagContent, Grantlee::Parser* p ) const { QStringList expr = tagContent.split( QLatin1Char( ' ' ), QString::SkipEmptyParts ); expr.removeFirst(); QString expression = expr.join( QChar::fromLatin1( ' ' ) ); FilterExpression fe( QStringLiteral( "var|%1" ).arg( expression ), p ); QStringList filters = fe.filters(); if ( filters.contains( QStringLiteral( "safe" ) ) || filters.contains( QStringLiteral( "escape" ) ) ) { throw Grantlee::Exception( TagSyntaxError, QStringLiteral( "Use the \"autoescape\" tag instead." ) ); } FilterNode *n = new FilterNode( fe, p ); NodeList filterNodes = p->parse( n, QStringLiteral( "endfilter" ) ); p->removeNextToken(); n->setNodeList( filterNodes ); return n; }
void CShadowFilter::Render(void) { this->Begin(); if (!m_RenderList.empty()) { CRenderPipeline::GetInst()->SetRenderStyle(m_ShadowRs); CRenderList::iterator it = m_RenderList.begin(); CRenderList::iterator eit = m_RenderList.end(); CRenderPipeline* crp = CRenderPipeline::GetInst(); for(;;) { FilterNode* fn = 0; SQR_TRY { for(; it!=eit;) { fn = (FilterNode*)*(it++);//st_arpFilterNode[*it]; if( gIsZero( fn->m_RP.m_RS.m_Material.Diffuse.a , 0.004f ) ) continue; fn->param_render(*fn); UpdateRenderStyle(fn->m_RP); crp->RenderEx(fn); } break; } SQR_CATCH(exp) { exp.AppendType(GetRefInfo().c_str()); GfkLogExp(exp); fn->Release(); } SQR_TRY_END; } }
void FilterEditor::buttonEvent(Button* button) { if (button == applyFilterOnADC) { FilterNode* fn = (FilterNode*) getProcessor(); fn->setApplyOnADC(applyFilterOnADC->getToggleState()); } else if (button == applyFilterOnChan) { FilterNode* fn = (FilterNode*) getProcessor(); Array<int> chans = getActiveChannels(); for (int n = 0; n < chans.size(); n++) { float newValue = button->getToggleState() ? 1.0 : 0.0; fn->setCurrentChannel(chans[n]); fn->setParameter(2, newValue); } } }