Skip to content
Snippets Groups Projects
Commit 2cf2193b authored by Matevz Tadel's avatar Matevz Tadel
Browse files

TGLRnrCtx

---------
Add new member 'Bool_t fHighlightOutline' that is set during the
outline-pass of the highlight.

TGLObject
---------
Disable use of display-lists for multi-colored objects only in the
outline pass of the highlight.

TGLPhysicalShape
----------------
Set HighlightOutline and HighlightOutline of the rnr-ctx during highlight.


git-svn-id: http://root.cern.ch/svn/root/trunk@24444 27541ba8-7e3a-0410-8455-c3a389f83636
parent c289336d
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,8 @@ protected:
Bool_t fHasTimedOut;
// Highlight / Selection stuff
Bool_t fHighlight;
Bool_t fHighlight; // True when in highlight.
Bool_t fHighlightOutline; // True when in highlight-outline.
Bool_t fSelection;
Bool_t fSecSelection;
Int_t fPickRadius;
......@@ -186,6 +187,9 @@ public:
// Highlight / Selection stuff
Bool_t Highlight() const { return fHighlight; }
void SetHighlight(Bool_t hil) { fHighlight = hil; }
Bool_t HighlightOutline() const { return fHighlightOutline; }
void SetHighlightOutline(Bool_t ho) { fHighlightOutline = ho; }
Bool_t Selection() const { return fSelection; }
void SetSelection(Bool_t sel) { fSelection = sel; }
Bool_t SecSelection() const { return fSecSelection; }
......
......@@ -48,7 +48,7 @@ Bool_t TGLObject::ShouldDLCache(const TGLRnrCtx & rnrCtx) const
if (!fDLCache ||
!fScene ||
(rnrCtx.SecSelection() && SupportsSecondarySelect()) ||
(fMultiColor && (rnrCtx.Highlight() || rnrCtx.IsDrawPassOutlineLine())))
(fMultiColor && (rnrCtx.HighlightOutline() || rnrCtx.IsDrawPassOutlineLine())))
{
return kFALSE;
}
......
......@@ -382,6 +382,7 @@ void TGLPhysicalShape::Draw(TGLRnrCtx & rnrCtx) const
// TGLCapabilitySwitch bs(GL_BLEND, kTRUE), lss(GL_LINE_SMOOTH, kTRUE);
rnrCtx.SetHighlight(kTRUE);
rnrCtx.SetHighlightOutline(kTRUE);
TGLUtil::LockColor();
Int_t first_outer = (rnrCtx.CombiLOD() == TGLRnrCtx::kLODHigh) ? 0 : 4;
for (int i = first_outer; i < 8; ++i)
......@@ -391,7 +392,7 @@ void TGLPhysicalShape::Draw(TGLRnrCtx & rnrCtx) const
fLogicalShape->Draw(rnrCtx);
}
TGLUtil::UnlockColor();
rnrCtx.SetHighlight(kFALSE);
rnrCtx.SetHighlightOutline(kFALSE);
SetupGLColors(rnrCtx);
for (int i = 0; i < 4; ++i)
......@@ -401,6 +402,7 @@ void TGLPhysicalShape::Draw(TGLRnrCtx & rnrCtx) const
fLogicalShape->Draw(rnrCtx);
}
glViewport(vp.X(), vp.Y(), vp.Width(), vp.Height());
rnrCtx.SetHighlight(kFALSE);
SetupGLColors(rnrCtx);
Float_t dr[2];
......
......@@ -74,9 +74,8 @@ TGLRnrCtx::TGLRnrCtx(TGLViewerBase* viewer) :
fIsRunning (kFALSE),
fHasTimedOut (kFALSE),
fHighlight (kFALSE),
fSelection (kFALSE),
fSecSelection (kFALSE),
fHighlight (kFALSE), fHighlightOutline (kFALSE),
fSelection (kFALSE), fSecSelection (kFALSE),
fPickRadius (0),
fPickRectangle(0),
fSelectBuffer (0),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment