void SoFCIndexedFaceSet::renderVisibleFaces(const SbVec3f * coords3d)
{
    //GLint redBits, greenBits, blueBits;

    //glGetIntegerv (GL_RED_BITS, &redBits);
    //glGetIntegerv (GL_GREEN_BITS, &greenBits);
    //glGetIntegerv (GL_BLUE_BITS, &blueBits);
    glDisable (GL_BLEND);
    glDisable (GL_DITHER);
    glDisable (GL_FOG);
    glDisable (GL_LIGHTING);
    glDisable (GL_TEXTURE_1D);
    glDisable (GL_TEXTURE_2D);
    glShadeModel (GL_FLAT);

    uint32_t numfaces = this->coordIndex.getNum()/4;
    const int32_t * cindices = this->coordIndex.getValues(0);

    int32_t v1, v2, v3;
    for (uint32_t index=0; index<numfaces;index++,cindices++) {
        glBegin(GL_TRIANGLES);
            float t;
            SbColor c;
            c.setPackedValue(index<<8,t);
            glColor3f(c[0],c[1],c[2]);
            v1 = *cindices++;
            glVertex3fv((const GLfloat*)(coords3d + v1));
            v2 = *cindices++;
            glVertex3fv((const GLfloat*)(coords3d + v2));
            v3 = *cindices++;
            glVertex3fv((const GLfloat*)(coords3d + v3));
        glEnd();
    }
}
Exemplo n.º 2
0
void
SoMFColor::set1HSVValue(int index, const float hsv[3])
{
    SbColor	c;

    c.setHSVValue(hsv);
    set1Value(index, c);
}
Exemplo n.º 3
0
void
SoMFColor::set1HSVValue(int index, float h, float s, float v)
{
    SbColor	c;

    c.setHSVValue(h, s, v);
    set1Value(index, c);
}
Exemplo n.º 4
0
void
SoMFColor::setHSVValue(const float hsv[3])
{
    SbColor	c;

    c.setHSVValue(hsv);
    setValue(c);
}
Exemplo n.º 5
0
void
SoMFColor::setHSVValue(float h, float s, float v)
{
    SbColor	c;

    c.setHSVValue(h, s, v);
    setValue(c);
}
void SoFCUnifiedSelection::applySettings()
{
    float transparency;
    ParameterGrp::handle hGrp = Gui::WindowParameter::getDefaultParameter()->GetGroup("View");
    bool enablePre = hGrp->GetBool("EnablePreselection", true);
    bool enableSel = hGrp->GetBool("EnableSelection", true);
    if (!enablePre) {
        this->highlightMode = SoFCUnifiedSelection::OFF;
    }
    else {
        // Search for a user defined value with the current color as default
        SbColor highlightColor = this->colorHighlight.getValue();
        unsigned long highlight = (unsigned long)(highlightColor.getPackedValue());
        highlight = hGrp->GetUnsigned("HighlightColor", highlight);
        highlightColor.setPackedValue((uint32_t)highlight, transparency);
        this->colorHighlight.setValue(highlightColor);
    }
    if (!enableSel) {
        this->selectionMode = SoFCUnifiedSelection::OFF;
    }
    else {
        // Do the same with the selection color
        SbColor selectionColor = this->colorSelection.getValue();
        unsigned long selection = (unsigned long)(selectionColor.getPackedValue());
        selection = hGrp->GetUnsigned("SelectionColor", selection);
        selectionColor.setPackedValue((uint32_t)selection, transparency);
        this->colorSelection.setValue(selectionColor);
    }
}
Exemplo n.º 7
0
Gui::SoFCSelection* ViewProviderPoints::createFromSettings() const
{
    Gui::SoFCSelection* sel = new Gui::SoFCSelection();

    float transparency;
    ParameterGrp::handle hGrp = Gui::WindowParameter::getDefaultParameter()->GetGroup("View");
    bool enablePre = hGrp->GetBool("EnablePreselection", true);
    bool enableSel = hGrp->GetBool("EnableSelection", true);
    if (!enablePre) {
        sel->highlightMode = Gui::SoFCSelection::OFF;
    }
    else {
        // Search for a user defined value with the current color as default
        SbColor highlightColor = sel->colorHighlight.getValue();
        unsigned long highlight = (unsigned long)(highlightColor.getPackedValue());
        highlight = hGrp->GetUnsigned("HighlightColor", highlight);
        highlightColor.setPackedValue((uint32_t)highlight, transparency);
        sel->colorHighlight.setValue(highlightColor);
    }
    if (!enableSel || !Selectable.getValue()) {
        sel->selectionMode = Gui::SoFCSelection::SEL_OFF;
    }
    else {
        // Do the same with the selection color
        SbColor selectionColor = sel->colorSelection.getValue();
        unsigned long selection = (unsigned long)(selectionColor.getPackedValue());
        selection = hGrp->GetUnsigned("SelectionColor", selection);
        selectionColor.setPackedValue((uint32_t)selection, transparency);
        sel->colorSelection.setValue(selectionColor);
    }

    return sel;
}