bool NumericDomainMerger::merge() { INumericDomain numericDom; Range *newRange = NumericRange::merge(_domain1->range<NumericRange>(), _domain2->range<NumericRange>()); if (!newRange) return false; numericDom.prepare(); numericDom->range(newRange); _mergedDomain = numericDom; return true; }
bool CreateNumericDomain::execute(ExecutionContext *ctx, SymbolTable &symTable) { if (_prepState == sNOTPREPARED) if((_prepState = prepare(ctx, symTable)) != sPREPARED) return false; IIlwisObject obj; Resource res = Resource(itNUMERICDOMAIN); res.prepare(); obj.prepare(res); obj->setDescription(_domaindesc); INumericDomain numdom = obj.as<NumericDomain>(); NumericRange numrange(_vmin,_vmax,_vres); numdom->range(numrange.clone()); if ( _parent.isValid()) numdom->setParent(_parent); QVariant value; value.setValue<IDomain>(numdom); ctx->setOutput(symTable,value,numdom->name(),itDOMAIN,numdom->source()); return true; }