Exemplo n.º 1
0
void VoreenVEPlugin::setParentWindow(VoreenToolWindow* window) {
    tgtAssert(window, "null pointer passed");
    parentWindow_ = window;
}
Exemplo n.º 2
0
void VolumeListingDialog::updateTableRows() {
    tgtAssert(table_->columnCount() == metaDataKeys_.size() + 1 /*+1 for URL*/, "column count mismatch");

    QString filterAttribute;
    if (comboBoxFilterAttribute_->currentIndex() > 0)
        filterAttribute = comboBoxFilterAttribute_->currentText();

    std::vector<VolumeOrigin> filteredOriginsNew = getFilteredOrigins(filterTextBox_->text().trimmed(), filterAttribute);
    if (filteredOrigins_ == filteredOriginsNew)
        return;
    else
        filteredOrigins_ = filteredOriginsNew;
    
    table_->clearContents();
    table_->setRowCount(static_cast<int>(filteredOrigins_.size()));

    // disable sorting during insertion 
    table_->setSortingEnabled(false);  

    // iterate over filter origins create a row for each
    for (size_t i=0; i<filteredOrigins_.size(); i++) {
        VolumeOrigin& origin = filteredOrigins_.at(i);
        // fill row cells with meta data entries
        for (int m=0; m<metaDataKeys_.size(); m++) {
            std::string key = metaDataKeys_.at(m).toStdString();
            std::string cellText;
            const MetaDataBase* metaDate = origin.getMetaDataContainer().getMetaData(key); 
            if (metaDate)
                cellText = metaDate->toString();

            // set cell content type according to type of meta data item
            QTableWidgetItem* cellItem = new QTableWidgetItem(); 
            if (dynamic_cast<const IntMetaData*>(metaDate))
                cellItem->setData(Qt::DisplayRole, static_cast<const IntMetaData*>(metaDate)->getValue());
            else if (dynamic_cast<const SizeTMetaData*>(metaDate))
                cellItem->setData(Qt::DisplayRole, static_cast<qulonglong>(static_cast<const SizeTMetaData*>(metaDate)->getValue())); 
            else if (dynamic_cast<const FloatMetaData*>(metaDate))
                cellItem->setData(Qt::DisplayRole, static_cast<const FloatMetaData*>(metaDate)->getValue()); 
            else if (dynamic_cast<const DoubleMetaData*>(metaDate))
                cellItem->setData(Qt::DisplayRole, static_cast<const DoubleMetaData*>(metaDate)->getValue()); 
            else
                cellItem->setData(Qt::DisplayRole, QString::fromStdString(cellText));

            cellItem->setToolTip(QString::fromStdString(key) + ": " + QString::fromStdString(cellText));
            //cellItem->setTextAlignment(Qt::AlignLeft);
            cellItem->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
            table_->setItem(static_cast<int>(i), m, cellItem);
        }

        // put URL into last cell
        QTableWidgetItem* urlItem = new QTableWidgetItem(QString::fromStdString(origin.getURL())); 
        urlItem->setToolTip("URL: " + QString::fromStdString(origin.getURL()));
        //urlItem->setTextAlignment(Qt::AlignLeft);
        urlItem->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
        table_->setItem(static_cast<int>(i), table_->columnCount()-1, urlItem);
    }

    table_->setSortingEnabled(true);  

    updateGuiState();
}
Exemplo n.º 3
0
void VolumeOctreeNode::serializeContentToBinaryBuffer(char* buffer) const {
    tgtAssert(buffer, "null pointer passed");

    memcpy(buffer, &brickAddress_, sizeof(uint64_t));
}
Exemplo n.º 4
0
bool LinkEvaluatorCameraOrientationId::arePropertiesLinkable(const Property* p1, const Property* p2) const {
    tgtAssert(p1, "null pointer");
    tgtAssert(p2, "null pointer");

    return (dynamic_cast<const CameraProperty*>(p1) && dynamic_cast<const CameraProperty*>(p2));
}
Exemplo n.º 5
0
void EventHandler::addListenerToFront(EventListener* e) {
    tgtAssert(e != 0, "Trying to add null pointer as event listener");
    listeners_.push_front(e);
}
Exemplo n.º 6
0
void Processor::addProgressBar(ProgressReporter* progressReporter) {
    tgtAssert(progressReporter, "null pointer passed");
    progressBars_.push_back(progressReporter);
}
Exemplo n.º 7
0
bool LinkEvaluatorButtonId::arePropertiesLinkable(const Property* p1, const Property* p2) const {
    tgtAssert(p1, "null pointer");
    tgtAssert(p2, "null pointer");

    return (dynamic_cast<const ButtonProperty*>(p1) && dynamic_cast<const ButtonProperty*>(p2));
}
Exemplo n.º 8
0
void PlotSelectionProperty::setPlotData(PlotData* plotData) {
    tgtAssert(plotData, "PlotSelectionProperty::setPlotData(): plotData is NULL");
    plotData_ = plotData;
    applyHighlights();
    updateZoomState();
}
Exemplo n.º 9
0
const PlotSelectionEntry& PlotSelectionProperty::getSelectionAt(size_t index) {
    tgtAssert(index < value_.size(), "PlotSelectionProperty::getSelectionAt(): index out of bounds!");
    return value_[index];
}
Exemplo n.º 10
0
void NetworkConverter11to12::convertVolumeContainer(TiXmlElement* workspaceNode) {
    if (!workspaceNode) {
        LERRORC("voreen.NetworkConverter11to12", "no workspace node");
        return;
    }

    // construct map from Volume-refID to URL
    std::map<std::string, std::string> refToUrl;
    TiXmlElement* volumeContainerNode = workspaceNode->FirstChildElement("VolumeContainer");
    if (!volumeContainerNode)
        return;
    LWARNINGC("voreen.NetworkConverter11to12", "converting volume container ...");
    TiXmlElement* volumeHandlesNode = volumeContainerNode->FirstChildElement("VolumeHandles");
    if (!volumeHandlesNode)
        return;
    for (TiXmlElement* handleNode = volumeHandlesNode->FirstChildElement("VolumeHandle"); handleNode != 0; handleNode = handleNode->NextSiblingElement("VolumeHandle")) {
        const std::string* refID = handleNode->Attribute(std::string("id"));
        if (!refID)
            continue;
        TiXmlElement* originNode = handleNode->FirstChildElement("Origin");
        if (!originNode)
            continue;
        const std::string* url = originNode->Attribute(std::string("url"));
        if (!url)
            url = originNode->Attribute(std::string("filename"));
        if (!url)
            continue;

        tgtAssert(refID, "no refID");
        tgtAssert(url, "no url");
        refToUrl.insert(std::pair<std::string, std::string>(*refID, *url));
    }

    // look for VolumeSource processors and replace their VolumeHandleProperty (with specific refID)
    // with a VolumeURLProperty with the corresponding volume URL
    TiXmlElement* networkNode = workspaceNode->FirstChildElement("ProcessorNetwork");
    if (!networkNode)
        return;
    TiXmlElement* processorsNode = networkNode->FirstChildElement("Processors");
    if (!processorsNode)
        return;
    for (TiXmlElement* procNode = processorsNode->FirstChildElement("Processor"); procNode != 0; procNode = procNode->NextSiblingElement("Processor")) {
        const std::string* type = procNode->Attribute(std::string("type"));
        if (!type || *type != "VolumeSource")
            continue;

        // it's a VolumeSource => extract VolumeHandleProperty node
        TiXmlElement* propertiesNode = procNode->FirstChildElement("Properties");
        if (!propertiesNode)
            continue;
        TiXmlElement* handlePropNode = propertiesNode->FirstChildElement("Property");
        if (!handlePropNode)
            continue;
        const std::string* propName = handlePropNode->Attribute(std::string("name"));
        if (!propName || *propName != "volumeHandle")
            continue;

        // convert VolumeHandleProperty to VolumeURLProperty
        handlePropNode->SetAttribute("name", "volumeURL");

        // retrieve Volume reference
        TiXmlElement* valueNode = handlePropNode->FirstChildElement("value");
        if (!valueNode)
            continue;
        const std::string* refID = valueNode->Attribute(std::string("ref"));
        if (!refID)
            continue;

        // insert referenced URL into converted VolumeHandleProperty
        if (refToUrl.find(*refID) == refToUrl.end())
            LWARNINGC("voreen.NetworkConverter11to12", "convertVolumeContainer(): unknown refID: " << *refID);
        else
            handlePropNode->SetAttribute("url", refToUrl[*refID]);
    }


}
Exemplo n.º 11
0
void AlignedSliceProxyGeometry::alignCamera() {
    const VolumeBase* volh = inport_.getData();
    if(!volh)
        return;

    vec3 urb = volh->getURB();
    vec3 llf = volh->getLLF();

    vec3 center = (urb + llf) / 2.0f;
    vec3 xVec = vec3(llf.x, center.y, center.z);
    vec3 yVec = vec3(center.x, llf.y, center.z);
    vec3 zVec = vec3(center.x, center.y, llf.z);

    tgt::mat4 m = volh->getPhysicalToWorldMatrix();

    center = m * center;
    xVec = m * xVec;
    yVec = m * yVec;
    zVec = m * zVec;

    vec3 mainDir;
    vec3 upDir;
    vec3 strafeDir;

    switch(sliceAlignment_.getValue()) {
        case YZ_PLANE: {
                           mainDir = xVec - center;
                           upDir = -(zVec - center);
                           strafeDir = -(yVec - center);
                       }
                       break;
        case XZ_PLANE: {
                           mainDir = yVec - center;
                           upDir = -(zVec - center);
                           strafeDir = -(xVec - center);
                       }
                       break;
        case XY_PLANE: {
                           mainDir = zVec - center;
                           upDir = (yVec - center);
                           strafeDir = (xVec - center);
                       }
                       break;
        default: tgtAssert(false, "should not get here!");
    }

    //setup camera:
    vec3 pos = center + (mainDir * 1.5f);
    vec3 up = normalize(upDir);

    //setup frustum:
    float size = std::max(length(strafeDir), length(upDir));
    float farDist = length(mainDir) * 3.0f;
    tgt::Frustum f(-size, +size, -size, +size, 0.01f, farDist);

    tgt::Camera cam(pos, center, up);
    cam.setProjectionMode(tgt::Camera::ORTHOGRAPHIC);

    cam.setFrustum(f);

    camera_.set(cam);
}
Exemplo n.º 12
0
VolumeRepresentation* RepresentationConverterDownloadGL::convert(const VolumeRepresentation* source) const {
    const VolumeGL* vgl = dynamic_cast<const VolumeGL*>(source);

    if(vgl) {
        const VolumeTexture* tex = vgl->getTexture();
        tgt::svec3 dims = tex->getDimensions();
        Volume* v = 0;

        switch(tex->getFormat()) {
            case GL_ALPHA:
                switch(tex->getDataType()) {
                    // VolumeUIntX
                    case GL_UNSIGNED_BYTE:
                        v = new VolumeUInt8(dims);
                        //internalFormat = GL_ALPHA8;
                        break;
                    case GL_UNSIGNED_SHORT:
                        v = new VolumeUInt16(dims);
                        //internalFormat = GL_ALPHA16;
                        break;
                    case GL_UNSIGNED_INT:
                        v = new VolumeUInt32(dims);
                        //internalFormat = GL_ALPHA;
                        break;
                        // VolumeIntX
                    case GL_BYTE:
                        v = new VolumeInt8(dims);
                        //internalFormat = GL_ALPHA8;
                        break;
                    case GL_SHORT:
                        v = new VolumeInt16(dims);
                        //internalFormat = GL_ALPHA16;
                        break;
                    case GL_INT:
                        v = new VolumeInt32(dims);
                        //internalFormat = GL_ALPHA;
                        break;
                        // VolumeFloat and VolumeDouble
                    case GL_FLOAT:
                        v = new VolumeFloat(dims);
                        //internalFormat = GL_ALPHA;
                        break;
                    default:
                        //v = new VolumeDouble(dims);
                        LERRORC("voreen.RepresentationConverterDownloadGL", "Unsupported texture format! (GL_ALPHA)");
                }
                break;
            case GL_LUMINANCE_ALPHA:
                switch(tex->getDataType()) {
                    // Volume2x with int16 types
                    case GL_UNSIGNED_SHORT:
                        v = new Volume2xUInt16(dims);
                        //internalFormat = GL_LUMINANCE16_ALPHA16;
                        break;
                    case GL_SHORT:
                        v = new Volume2xInt16(dims);
                        //internalFormat = GL_LUMINANCE16_ALPHA16;
                        break;
                    default:
                        LERRORC("voreen.RepresentationConverterDownloadGL", "Unsupported texture format! (GL_LUMINANCE_ALPHA)");
                        //v = new VolumeDouble(dims);
                }
                break;
            case GL_RGB:
                switch(tex->getDataType()) {
                    // Volume3x with int8 types
                    case GL_UNSIGNED_BYTE:
                        v = new Volume3xUInt8(dims);
                        //internalFormat = GL_RGB8;
                        break;
                    case GL_BYTE:
                        v = new Volume3xInt8(dims);
                        //internalFormat = GL_RGB8;
                        break;
                        // Volume3x with int16 types
                    case GL_UNSIGNED_SHORT:
                        v = new Volume3xUInt16(dims);
                        //internalFormat = GL_RGB16;
                        break;
                    case GL_SHORT:
                        v = new Volume3xInt16(dims);
                        //internalFormat = GL_RGB16;
                        break;
                        // Volume3x with real types
                    case GL_FLOAT:
                        v = new Volume3xFloat(dims);
                        //internalFormat = GL_RGB;
                        break;
                    default:
                        LERRORC("voreen.RepresentationConverterDownloadGL", "Unsupported texture format! (GL_RGB)");
                        //v = new Volume3xDouble(dims);
                }
                break;
            case GL_RGBA:
                switch(tex->getDataType()) {
                    // Volume4x with int8 types
                    case GL_UNSIGNED_BYTE:
                        v = new Volume4xUInt8(dims);
                        //internalFormat = GL_RGBA8;
                        break;
                    case GL_BYTE:
                        v = new Volume4xInt8(dims);
                        //internalFormat = GL_RGBA8;
                        break;
                        // Volume4x with int16 types
                    case GL_UNSIGNED_SHORT:
                        v = new Volume4xUInt16(dims);
                        //internalFormat = GL_RGBA16;
                        break;
                    case GL_SHORT:
                        v = new Volume4xInt16(dims);
                        //internalFormat = GL_RGBA16;
                        break;
                        // Volume4x with real types
                    case GL_FLOAT:
                        v = new Volume4xFloat(dims);
                        //internalFormat = GL_RGBA;
                        break;
                    default:
                        LERRORC("voreen.RepresentationConverterDownloadGL", "Unsupported texture format! (GL_RGBA)");
                        //v = new Volume4xDouble(dims);
                }
                break;
            default:
                tgtAssert(false, "unsupported volume format");
        }

        if(v) {
            tex->downloadTextureToBuffer(static_cast<GLubyte*>(v->getData()), v->getNumBytes());
        }
        return v;
    }
    else {
        //should have checked before...
        //LERROR("Failed to convert!");
        return 0;
    }
}
Exemplo n.º 13
0
void LinkEvaluatorBase::propertiesChanged(Property* src, Property* dst) {
    tgtAssert(src, "No src Property set");
    tgtAssert(dst, "No dst Property set");
}
Exemplo n.º 14
0
void VoreenVEPlugin::setNetworkEvaluator(NetworkEvaluator* evaluator) {
    tgtAssert(evaluator, "null pointer passed");
    evaluator_ = evaluator;
}
Exemplo n.º 15
0
MeshGeometry& MeshListGeometry::getMesh(size_t index) {
    tgtAssert(index < meshes_.size(), "Invalid index");
    return meshes_.at(index);
}
Exemplo n.º 16
0
void PlotSelectionProperty::setHighlight(size_t index, bool value) {
    tgtAssert(index < value_.size(), "PlotSelectionProperty::setHighlight(): index out of bounds!");
    value_[index].highlight_ = value;
    applyHighlights();
    notifyAll();
}
Exemplo n.º 17
0
MeshGeometry& MeshListGeometry::operator[](size_t index) {
    tgtAssert(index < meshes_.size(), "Invalid index");
    return meshes_[index];
}
Exemplo n.º 18
0
void PlotSelectionProperty::setRenderLabel(size_t index, bool value) {
    tgtAssert(index < value_.size(), "PlotSelectionProperty::setRenderLabel(): index out of bounds!");
    value_[index].renderLabel_ = value;
    notifyAll();
}
Exemplo n.º 19
0
void DicomConnectionDialog::refreshPatients() {
    tgtAssert(gdcmReader_, "no gdcm reader");

    //nothing to refresh: return
    if (!connectInfo_->isVisible())
        return;

    setDisabled(true);
    submitButton_->setDisabled(true);
    refreshButton_->setDisabled(true);
    cancelButton_->setDisabled(true);

    update();

#ifdef VRN_GDCM_VERSION_22 // network support

    //clear detail table and set visibility false
    detailTable_->clear();
    detailTable_->setDisabled(true);
    detailTable_->setVisible(false);
    if (detailTable_->rowCount() > 0)
        detailTable_->removeRow(0);

    while (detailTable_->columnCount() > 0)
        detailTable_->removeColumn(0);

    std::vector<PatientInfo> patients;
    tree_->setVisible(false);
    model_->clear();

    try {
        //find all patients
        patients = gdcmReader_->findNetworkPatients(model_->getUrl(),model_->getScpAet(),model_->getScpPort());
    }
    catch (tgt::FileException e) {
        LERROR(e.what());
        QMessageBox::warning(this,"Could not establish connection", e.what());
        submitButton_->setDisabled(false);
        refreshButton_->setDisabled(false);
        cancelButton_->setDisabled(false);
        setDisabled(false);
        return;
    }

    //insert all patients and enable submit button
    AbstractDicomHierarchyNode* root = model_->getInvisibleRoot();

    for (std::vector<PatientInfo>::iterator it = patients.begin(); it != patients.end(); ++it) {
        PatientHierarchyNode *patient = new PatientHierarchyNode(AbstractDicomHierarchyNode::PATIENT, *it);
        patient->parent_ = root;
        root->children_.append(patient);
    }
    tree_->setVisible(true);
    detailTable_->setVisible(true);
    submitButton_->setDisabled(false);
    refreshButton_->setDisabled(false);
    cancelButton_->setDisabled(false);
    setDisabled(false);

#else
    LERROR("No GDCM Network Support!");
    QMessageBox::warning(this,"No GDCM Network Support", "GDCM does not have network support!");
    submitButton_->setDisabled(false);
    refreshButton_->setDisabled(false);
    cancelButton_->setDisabled(false);
    setDisabled(false);
    return;
#endif
}
Exemplo n.º 20
0
void PlotSelectionProperty::setZoomTo(size_t index, bool value) {
    tgtAssert(index < value_.size(), "PlotSelectionProperty::setZoomTo(): index out of bounds!");
    value_[index].zoomTo_ = value;
    updateZoomState();
    notifyAll();
}
Exemplo n.º 21
0
bool LinkEvaluatorLightSourceId::arePropertiesLinkable(const Property* p1, const Property* p2) const {
    tgtAssert(p1, "null pointer");
    tgtAssert(p2, "null pointer");

    return (dynamic_cast<const FloatVec4Property*>(p1) && dynamic_cast<const LightSourceProperty*>(p2));
}
Exemplo n.º 22
0
GLubyte* TransFunc::getPixelData() {
    if (textureInvalid_)
        updateTexture();
    tgtAssert(tex_, "No texture");
    return tex_->getPixelData();
}
Exemplo n.º 23
0
void NumericProperty<T>::setNumDecimals(size_t numDecimals) {
    tgtAssert(numDecimals <= 64, "Invalid number of decimals");
    numDecimals_ = numDecimals;
    this->updateWidgets();
}
Exemplo n.º 24
0
void MultiVolumeRaycaster::process() {
    // compile program if needed
    if (getInvalidationLevel() >= Processor::INVALID_PROGRAM)
        compile();
    LGL_ERROR;

    // bind transfer function
    TextureUnit transferUnit1, transferUnit2, transferUnit3, transferUnit4;
    transferUnit1.activate();
    if (transferFunc1_.get())
        transferFunc1_.get()->bind();

    transferUnit2.activate();
    if (transferFunc2_.get())
        transferFunc2_.get()->bind();

    transferUnit3.activate();
    if (transferFunc3_.get())
        transferFunc3_.get()->bind();

    transferUnit4.activate();
    if (transferFunc4_.get())
        transferFunc4_.get()->bind();

    portGroup_.activateTargets();
    portGroup_.clearTargets();
    LGL_ERROR;

    transferFunc1_.setVolumeHandle(volumeInport1_.getData());
    transferFunc2_.setVolumeHandle(volumeInport2_.getData());
    transferFunc3_.setVolumeHandle(volumeInport3_.getData());
    transferFunc4_.setVolumeHandle(volumeInport4_.getData());

    TextureUnit entryUnit, entryDepthUnit, exitUnit, exitDepthUnit;
    // bind entry params
    entryPort_.bindTextures(entryUnit.getEnum(), entryDepthUnit.getEnum());
    LGL_ERROR;

    // bind exit params
    exitPort_.bindTextures(exitUnit.getEnum(), exitDepthUnit.getEnum());
    LGL_ERROR;

    // vector containing the volumes to bind; is passed to bindVolumes()
    std::vector<VolumeStruct> volumeTextures;
    std::vector<const VolumeHandleBase*> volumeHandles;

    // bind volumes
    TextureUnit volUnit1, volUnit2, volUnit3, volUnit4;
    if (volumeInport1_.isReady()) {
        volumeInport1_.getData()->getRepresentation<VolumeGL>();
        volumeTextures.push_back(VolumeStruct(
                    volumeInport1_.getData(),
                    &volUnit1,
                    "volumeStruct1_",
                    texClampMode1_.getValue(),
                    tgt::vec4(texBorderIntensity_.get()),
                    texFilterMode1_.getValue())
                );
        volumeHandles.push_back(volumeInport1_.getData());
    }
    if (volumeInport2_.isReady()) {
        volumeInport2_.getData()->getRepresentation<VolumeGL>();
        volumeTextures.push_back(VolumeStruct(
                    volumeInport2_.getData(),
                    &volUnit2,
                    "volumeStruct2_",
                    texClampMode2_.getValue(),
                    tgt::vec4(texBorderIntensity_.get()),
                    texFilterMode2_.getValue())
                );
        volumeHandles.push_back(volumeInport2_.getData());
    }
    if (volumeInport3_.isReady()) {
        volumeInport3_.getData()->getRepresentation<VolumeGL>();
        volumeTextures.push_back(VolumeStruct(
                    volumeInport3_.getData(),
                    &volUnit3,
                    "volumeStruct3_",
                    texClampMode3_.getValue(),
                    tgt::vec4(texBorderIntensity_.get()),
                    texFilterMode3_.getValue())
                );
        volumeHandles.push_back(volumeInport3_.getData());
    }
    if (volumeInport4_.isReady()) {
        volumeInport4_.getData()->getRepresentation<VolumeGL>();
        volumeTextures.push_back(VolumeStruct(
                    volumeInport4_.getData(),
                    &volUnit4,
                    "volumeStruct4_",
                    texClampMode4_.getValue(),
                    tgt::vec4(texBorderIntensity_.get()),
                    texFilterMode4_.getValue())
                );
        volumeHandles.push_back(volumeInport4_.getData());
    }

    // initialize shader
    raycastPrg_->activate();

    // set common uniforms used by all shaders
    tgt::Camera cam = camera_.get();
    setGlobalShaderParameters(raycastPrg_, &cam);
    // bind the volumes and pass the necessary information to the shader
    bindVolumes(raycastPrg_, volumeTextures, &cam, lightPosition_.get());

    // pass the remaining uniforms to the shader
    raycastPrg_->setUniform("entryPoints_", entryUnit.getUnitNumber());
    raycastPrg_->setUniform("entryPointsDepth_", entryDepthUnit.getUnitNumber());
    entryPort_.setTextureParameters(raycastPrg_, "entryParameters_");
    raycastPrg_->setUniform("exitPoints_", exitUnit.getUnitNumber());
    raycastPrg_->setUniform("exitPointsDepth_", exitDepthUnit.getUnitNumber());
    exitPort_.setTextureParameters(raycastPrg_, "exitParameters_");

    if (compositingMode_.get() ==  "iso" ||
        compositingMode1_.get() == "iso" ||
        compositingMode2_.get() == "iso")
        raycastPrg_->setUniform("isoValue_", isoValue_.get());

    if(volumeInport1_.isReady())
        transferFunc1_.get()->setUniform(raycastPrg_, "transferFunc_", transferUnit1.getUnitNumber());
    if(volumeInport2_.isReady())
        transferFunc2_.get()->setUniform(raycastPrg_, "transferFunc2_", transferUnit2.getUnitNumber());
    if(volumeInport3_.isReady())
        transferFunc3_.get()->setUniform(raycastPrg_, "transferFunc3_", transferUnit3.getUnitNumber());
    if(volumeInport4_.isReady())
        transferFunc4_.get()->setUniform(raycastPrg_, "transferFunc4_", transferUnit4.getUnitNumber());

    // determine ray step length in world coords
    if (volumeTextures.size() > 0) {
        float voxelSizeWorld = 999.f;
        float voxelSizeTexture = 999.f;
        for(size_t i=0; i<volumeHandles.size(); ++i) {
            const VolumeHandleBase* volume = volumeHandles[i];
            tgtAssert(volume, "No volume");
            tgt::ivec3 volDim = volume->getDimensions();
            tgt::vec3 cubeSizeWorld = volume->getCubeSize() * volume->getPhysicalToWorldMatrix().getScalingPart();

            float tVoxelSizeWorld = tgt::max(cubeSizeWorld / tgt::vec3(volDim));
            if (tVoxelSizeWorld < voxelSizeWorld) {
                voxelSizeWorld = tVoxelSizeWorld;
                voxelSizeTexture = tgt::max(1.f / tgt::vec3(volDim));
            }
        }

        float samplingStepSizeWorld = voxelSizeWorld / samplingRate_.get();
        float samplingStepSizeTexture = voxelSizeTexture / samplingRate_.get();

        if (interactionMode()) {
            samplingStepSizeWorld /= interactionQuality_.get();
            samplingStepSizeTexture /= interactionQuality_.get();
        }

        raycastPrg_->setUniform("samplingStepSize_", samplingStepSizeWorld);
        if (compositingMode_.isSelected("dvr")  ||
            (compositingMode1_.isSelected("dvr") && outport1_.isConnected()) ||
            (compositingMode2_.isSelected("dvr") && outport2_.isConnected()) ) {
            // adapts the compositing of the multivolume RC to the one of the singlevolume RC (see below).
            raycastPrg_->setUniform("mvOpacityCorrectionFactor_", samplingStepSizeTexture / samplingStepSizeWorld);
        }
        LGL_ERROR;
    }
    LGL_ERROR;

    renderQuad();

    raycastPrg_->deactivate();
    portGroup_.deactivateTargets();

    if (outport_.isConnected())
        outport_.validateResult();

    if (outport1_.isConnected())
        outport1_.validateResult();

    if (outport2_.isConnected())
        outport2_.validateResult();

    glActiveTexture(GL_TEXTURE0);
    LGL_ERROR;
}
Exemplo n.º 25
0
void Processor::addEventProperty(EventPropertyBase* prop) {
    tgtAssert(prop, "Null pointer passed");
    addProperty(prop);
    prop->setOwner(this);
    eventProperties_.push_back(prop);
}
Exemplo n.º 26
0
void VolumeCollection::remove(const VolumeCollection* volumeCollection) {
   tgtAssert(volumeCollection, "Unexpected null pointer");
    for (size_t i=0; i<volumeCollection->size(); ++i) {
        remove(volumeCollection->at(i));
    }
}
Exemplo n.º 27
0
uint16_t VolumeOctreeNodeGeneric<C>::getMaxValue(size_t channel /*= 0*/) const {
    tgtAssert(channel < C, "invalid channel id");
    return maxValues_[channel];
}
Exemplo n.º 28
0
VolumeHandle* VolumeCollection::at(size_t i) const {
    tgtAssert(i < volumeHandles_.size(), "Invalid index");
    return volumeHandles_.at(i);
}
Exemplo n.º 29
0
void VolumeOctreeNode::deserializeContentFromBinaryBuffer(const char* buffer) {
    tgtAssert(buffer, "null pointer passed");

    memcpy(const_cast<uint64_t*>(&brickAddress_), buffer, sizeof(uint64_t));
}
Exemplo n.º 30
0
void VoreenVEPlugin::setMainWindow(VoreenMainWindow* mainWindow) {
    tgtAssert(mainWindow, "null pointer passed");
    mainWindow_ = mainWindow;
}