Ejemplo n.º 1
0
bool RenderPort::doesSizeOriginConnectFailWithPort(Port* inport) const {
    tgtAssert(inport, "passed null pointer");

    RenderPort* rin = dynamic_cast<RenderPort*>(inport);
    if (!rin)
        return false;

    bool unEqual = this != rin;
    bool outIsOutport = isOutport();
    bool inIsInport = rin->isInport();
    bool processorUnEqual = getProcessor() != rin->getProcessor();
    bool isNotConnected = !isConnectedTo(rin);
    bool thisIsConnected = rin->isConnected();
    bool thisAllowsMultiple = rin->allowMultipleConnections();

    return rin && unEqual && outIsOutport && inIsInport && processorUnEqual && isNotConnected && (!thisIsConnected || thisAllowsMultiple);
}
Ejemplo n.º 2
0
void RenderPort::resize(const tgt::ivec2& newsize) {
    if (isOutport()) {
        if (size_ == newsize)
            return;
        if (newsize == tgt::ivec2(0)) {
            LWARNING("resize(): invalid size " << newsize);
            return;
        }
        if (renderTarget_) {
            renderTarget_->resize(newsize);
        }
        validResult_ = false;
        size_ = newsize;
    }
    else {
        size_ = newsize;
        if (!getSizeOrigin())
            return;
        for (size_t i = 0; i < connectedPorts_.size(); ++i) {
            RenderPort* rp = static_cast<RenderPort*>(connectedPorts_[i]);
            static_cast<RenderProcessor*>(rp->getProcessor())->portResized(rp, newsize);
        }
    }
}