diff --git a/src/Mod/Part/Gui/SoBrepShape.cpp b/src/Mod/Part/Gui/SoBrepShape.cpp index 2a9c2c4cb4..811710e684 100644 --- a/src/Mod/Part/Gui/SoBrepShape.cpp +++ b/src/Mod/Part/Gui/SoBrepShape.cpp @@ -963,7 +963,7 @@ void SoBrepEdgeSet::renderHighlight(SoGLRenderAction *action) SoLazyElement::setEmissive(state, &this->highlightColor); SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); - SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker); + SoLazyElement::setDiffuse(state, this,1, &this->highlightColor,&this->colorpacker1); SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); @@ -1000,7 +1000,7 @@ void SoBrepEdgeSet::renderSelection(SoGLRenderAction *action) SoLazyElement::setEmissive(state, &this->selectionColor); SoOverrideElement::setEmissiveColorOverride(state, this, TRUE); - SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker); + SoLazyElement::setDiffuse(state, this,1, &this->selectionColor,&this->colorpacker2); SoOverrideElement::setDiffuseColorOverride(state, this, TRUE); SoLazyElement::setLightModel(state, SoLazyElement::BASE_COLOR); diff --git a/src/Mod/Part/Gui/SoBrepShape.h b/src/Mod/Part/Gui/SoBrepShape.h index 4be3b7e8ee..d5831032ec 100644 --- a/src/Mod/Part/Gui/SoBrepShape.h +++ b/src/Mod/Part/Gui/SoBrepShape.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -56,49 +56,49 @@ protected: virtual ~SoBrepFaceSet() {}; virtual void GLRender(SoGLRenderAction *action); virtual void GLRenderBelowPath(SoGLRenderAction * action); - virtual void doAction(SoAction* action); - virtual SoDetail * createTriangleDetail( - SoRayPickAction * action, - const SoPrimitiveVertex * v1, - const SoPrimitiveVertex * v2, - const SoPrimitiveVertex * v3, + virtual void doAction(SoAction* action); + virtual SoDetail * createTriangleDetail( + SoRayPickAction * action, + const SoPrimitiveVertex * v1, + const SoPrimitiveVertex * v2, + const SoPrimitiveVertex * v3, SoPickedPoint * pp); virtual void generatePrimitives(SoAction * action); private: - enum Binding { - OVERALL = 0, - PER_PART, - PER_PART_INDEXED, - PER_FACE, - PER_FACE_INDEXED, - PER_VERTEX, - PER_VERTEX_INDEXED, - NONE = OVERALL - }; - Binding findMaterialBinding(SoState * const state) const; - Binding findNormalBinding(SoState * const state) const; - void renderShape(const SoGLCoordinateElement * const vertexlist, - const int32_t *vertexindices, - int num_vertexindices, - const int32_t *partindices, - int num_partindices, - const SbVec3f *normals, - const int32_t *normindices, - SoMaterialBundle *const materials, - const int32_t *matindices, - SoTextureCoordinateBundle * const texcoords, - const int32_t *texindices, - const int nbind, - const int mbind, - const int texture); - void renderHighlight(SoGLRenderAction *action); - void renderSelection(SoGLRenderAction *action); - -private: - SbColor selectionColor; - SbColor highlightColor; - SoColorPacker colorpacker; + enum Binding { + OVERALL = 0, + PER_PART, + PER_PART_INDEXED, + PER_FACE, + PER_FACE_INDEXED, + PER_VERTEX, + PER_VERTEX_INDEXED, + NONE = OVERALL + }; + Binding findMaterialBinding(SoState * const state) const; + Binding findNormalBinding(SoState * const state) const; + void renderShape(const SoGLCoordinateElement * const vertexlist, + const int32_t *vertexindices, + int num_vertexindices, + const int32_t *partindices, + int num_partindices, + const SbVec3f *normals, + const int32_t *normindices, + SoMaterialBundle *const materials, + const int32_t *matindices, + SoTextureCoordinateBundle * const texcoords, + const int32_t *texindices, + const int nbind, + const int mbind, + const int texture); + void renderHighlight(SoGLRenderAction *action); + void renderSelection(SoGLRenderAction *action); + +private: + SbColor selectionColor; + SbColor highlightColor; + SoColorPacker colorpacker; }; // --------------------------------------------------------------------- @@ -119,24 +119,27 @@ protected: virtual ~SoBrepEdgeSet() {}; virtual void GLRender(SoGLRenderAction *action); virtual void GLRenderBelowPath(SoGLRenderAction * action); - virtual void doAction(SoAction* action); - virtual SoDetail * createLineSegmentDetail( - SoRayPickAction *action, - const SoPrimitiveVertex *v1, - const SoPrimitiveVertex *v2, - SoPickedPoint *pp); -private: - void renderShape(const SoGLCoordinateElement * const vertexlist, - const int32_t *vertexindices, - int num_vertexindices); - void renderHighlight(SoGLRenderAction *action); - void renderSelection(SoGLRenderAction *action); - -private: - std::vector hl, sl; - SbColor selectionColor; - SbColor highlightColor; - SoColorPacker colorpacker; + virtual void doAction(SoAction* action); + virtual SoDetail * createLineSegmentDetail( + SoRayPickAction *action, + const SoPrimitiveVertex *v1, + const SoPrimitiveVertex *v2, + SoPickedPoint *pp); +private: + void renderShape(const SoGLCoordinateElement * const vertexlist, + const int32_t *vertexindices, + int num_vertexindices); + void renderHighlight(SoGLRenderAction *action); + void renderSelection(SoGLRenderAction *action); + +private: + std::vector hl, sl; + SbColor selectionColor; + SbColor highlightColor; + //#0000834: Minor preselection color bug + //To solve this we need a seprate color packer for highlighting and selection + SoColorPacker colorpacker1; + SoColorPacker colorpacker2; }; // --------------------------------------------------------------------- @@ -157,19 +160,19 @@ protected: virtual ~SoBrepPointSet() {}; virtual void GLRender(SoGLRenderAction *action); virtual void GLRenderBelowPath(SoGLRenderAction * action); - virtual void doAction(SoAction* action); - -private: - void renderShape(const SoGLCoordinateElement * const vertexlist, - const int32_t *vertexindices, - int num_vertexindices); - void renderHighlight(SoGLRenderAction *action); - void renderSelection(SoGLRenderAction *action); - -private: - SbColor selectionColor; - SbColor highlightColor; - SoColorPacker colorpacker; + virtual void doAction(SoAction* action); + +private: + void renderShape(const SoGLCoordinateElement * const vertexlist, + const int32_t *vertexindices, + int num_vertexindices); + void renderHighlight(SoGLRenderAction *action); + void renderSelection(SoGLRenderAction *action); + +private: + SbColor selectionColor; + SbColor highlightColor; + SoColorPacker colorpacker; }; } // namespace PartGui