Esempio n. 1
0
VRShopEditorDlg::VRShopEditorDlg(QMainWindow *parent) : QMainWindow(parent)
{
    setupUi(this);

    m_SceneEditor.setQVTKWidgets(m_pQVTKWidgetSceneEditorPose);
    m_ObjectEditor.setQVTKWidgets(m_pQVTKWidgetSceneEditorObject);

    setWindowTitle(tr("VR Shop Editor Dialog"));

    connect(actionLoadScene, SIGNAL(triggered()), this, SLOT(slotLoadScene()));
    connect(actionSaveScene, SIGNAL(triggered()), this, SLOT(slotSaveScene()));

    //Exit application
    connect(actionExit,SIGNAL(triggered()), this, SLOT(close()));

    //Calling functions
    updateCategory();
    connect(m_pComboBoxCategoryPose, SIGNAL(highlighted(const QString &)), this, SLOT(updateProduct(const QString &)));
    connect(m_pComboBoxProductPose, SIGNAL(highlighted(const QString &)), this, SLOT(updateProductID(const QString &)));
    connect(m_pComboBoxProductCodePose, SIGNAL(highlighted(const QString &)), this, SLOT(addImage2Widget(const QString &)));

    updateTexture();
    connect(m_pComboBoxTextureMapsName, SIGNAL(highlighted(const QString &)), this, SLOT(addTexture2Widget(const QString &)));

    updatePrimitive();
}
Esempio n. 2
0
void Molecule::removeMesh(Mesh *mesh)
{
    Q_D(Molecule);
    if(mesh) {
        d->meshes[mesh->id()] = 0;
        // 0 based arrays stored/shown to user
        int index = mesh->index();
        d->meshList.removeAt(index);
        for (int i = index; i < d->meshList.size(); ++i)
            d->meshList[i]->setIndex(i);

        mesh->deleteLater();
        disconnect(mesh, SIGNAL(updated()), this, SLOT(updatePrimitive()));
        emit primitiveRemoved(mesh);
    }
}
Esempio n. 3
0
void Molecule::removeCube(Cube *cube)
{
    Q_D(Molecule);
    if(cube) {
        d->cubes[cube->id()] = 0;
        // 0 based arrays stored/shown to user
        int index = cube->index();
        d->cubeList.removeAt(index);
        for (int i = index; i < d->cubeList.size(); ++i)
            d->cubeList[i]->setIndex(i);

        cube->deleteLater();
        disconnect(cube, SIGNAL(updated()), this, SLOT(updatePrimitive()));
        emit primitiveRemoved(cube);
    }
}
Esempio n. 4
0
void Molecule::removeRing(Fragment *ring)
{
    Q_D(Molecule);
    if(ring) {
        d->rings[ring->id()] = 0;
        // 0 based arrays stored/shown to user
        int index = ring->index();
        d->ringList.removeAt(index);
        for (int i = index; i < d->ringList.size(); ++i) {
            d->ringList[i]->setIndex(i);
        }

        ring->deleteLater();
        disconnect(ring, SIGNAL(updated()), this, SLOT(updatePrimitive()));
//      emit primitiveRemoved(ring);
    }
}
Esempio n. 5
0
void Molecule::removeResidue(Residue *residue)
{
    Q_D(Molecule);
    if(residue) {
        d->residues[residue->id()] = 0;
        // 0 based arrays stored/shown to user
        int index = residue->index();
        d->residueList.removeAt(index);
        for (int i = index; i < d->residueList.size(); ++i) {
            d->residueList[i]->setIndex(i);
        }

        residue->deleteLater();
        disconnect(residue, SIGNAL(updated()), this, SLOT(updatePrimitive()));
        emit primitiveRemoved(residue);
    }
}
Esempio n. 6
0
Fragment * Molecule::addRing(unsigned long id)
{
    Q_D(Molecule);

    Fragment *ring = new Fragment(this);

    if (id >= d->rings.size())
        d->rings.resize(id+1,0);
    d->rings[id] = ring;
    d->ringList.push_back(ring);

    ring->setId(id);
    ring->setIndex(d->ringList.size()-1);

    // now that the id is correct, emit the signal
    connect(ring, SIGNAL(updated()), this, SLOT(updatePrimitive()));
//    emit primitiveAdded(ring);
    return(ring);
}
Esempio n. 7
0
Residue * Molecule::addResidue(unsigned long id)
{
    Q_D(Molecule);

    Residue *residue = new Residue(this);

    if (id >= d->residues.size())
        d->residues.resize(id+1,0);
    d->residues[id] = residue;
    d->residueList.push_back(residue);

    residue->setId(id);
    residue->setIndex(d->residueList.size()-1);

    // now that the id is correct, emit the signal
    connect(residue, SIGNAL(updated()), this, SLOT(updatePrimitive()));
    emit primitiveAdded(residue);
    return(residue);
}
Esempio n. 8
0
Mesh * Molecule::addMesh(unsigned long id)
{
    Q_D(Molecule);

    Mesh *mesh = new Mesh(this);

    if (id >= d->meshes.size())
        d->meshes.resize(id+1,0);
    d->meshes[id] = mesh;
    d->meshList.push_back(mesh);

    mesh->setId(id);
    mesh->setIndex(d->meshList.size()-1);

    // now that the id is correct, emit the signal
    connect(mesh, SIGNAL(updated()), this, SLOT(updatePrimitive()));
    emit primitiveAdded(mesh);
    return(mesh);
}
Esempio n. 9
0
Cube *Molecule::addCube(unsigned long id)
{
    Q_D(Molecule);

    Cube *cube = new Cube(this);

    if(id >= d->cubes.size())
        d->cubes.resize(id+1,0);
    d->cubes[id] = cube;
    // Does this still want to have the same index as before somehow?
    d->cubeList.push_back(cube);

    cube->setId(id);
    cube->setIndex(d->cubeList.size()-1);

    // now that the id is correct, emit the signal
    connect(cube, SIGNAL(updated()), this, SLOT(updatePrimitive()));
    emit primitiveAdded(cube);
    return(cube);
}
Esempio n. 10
0
 void BoxPrimitive::setSize(const Ogre::AxisAlignedBox& size)
 {
     mSize = size;
     updatePrimitive();
 }