Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
36b3ee7b
Commit
36b3ee7b
authored
11 years ago
by
Timur Pocheptsov
Browse files
Options
Downloads
Patches
Plain Diff
Utility function to draw quadstrips with a radial gradient.
parent
3817b152
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
graf3d/gl/inc/TGLUtil.h
+3
-0
3 additions, 0 deletions
graf3d/gl/inc/TGLUtil.h
graf3d/gl/src/TGLUtil.cxx
+28
-0
28 additions, 0 deletions
graf3d/gl/src/TGLUtil.cxx
with
31 additions
and
0 deletions
graf3d/gl/inc/TGLUtil.h
+
3
−
0
View file @
36b3ee7b
...
...
@@ -1223,6 +1223,9 @@ void DrawBoxFrontTextured(Double_t xMin, Double_t xMax, Double_t yMin,
void
DrawBoxWithGradientFill
(
Double_t
y1
,
Double_t
y2
,
Double_t
x1
,
Double_t
x2
,
const
Double_t
*
rgba1
,
const
Double_t
*
rgba2
);
void
DrawQuadStripWithRadialGradientFill
(
unsigned
nPoints
,
const
Double_t
*
inner
,
const
Double_t
*
innerRGBA
,
const
Double_t
*
outer
,
const
Double_t
*
outerRGBA
);
#ifndef __CINT__
void
DrawTrapezoidTextured
(
const
Double_t
ver
[][
2
],
Double_t
zMin
,
Double_t
zMax
,
...
...
This diff is collapsed.
Click to expand it.
graf3d/gl/src/TGLUtil.cxx
+
28
−
0
View file @
36b3ee7b
...
...
@@ -3102,6 +3102,34 @@ void DrawBoxWithGradientFill(Double_t y1, Double_t y2, Double_t x1, Double_t x2,
glEnd
();
}
//______________________________________________________________________________
void
DrawQuadStripWithRadialGradientFill
(
unsigned
nPoints
,
const
Double_t
*
inner
,
const
Double_t
*
innerRGBA
,
const
Double_t
*
outer
,
const
Double_t
*
outerRGBA
)
{
//TODO: is it possible to use GLdouble to avoid problems with Double_t/GLdouble if they
//are not the same type?
assert
(
nPoints
!=
0
&&
"DrawQuadStripWithRadialGradientFill, invalid number of points"
);
assert
(
inner
!=
0
&&
"DrawQuadStripWithRadialGradientFill, parameter 'inner' is null"
);
assert
(
innerRGBA
!=
0
&&
"DrawQuadStripWithRadialGradientFill, parameter 'innerRGBA' is null"
);
assert
(
outer
!=
0
&&
"DrawQuadStripWithRadialGradientFill, parameter 'outer' is null"
);
assert
(
outerRGBA
!=
0
&&
"DrawQuadStripWithRadialGradientFill, parameter 'outerRGBA' is null"
);
glBegin
(
GL_QUAD_STRIP
);
for
(
UInt_t
j
=
0
;
j
<
nPoints
;
++
j
)
{
glColor4dv
(
innerRGBA
);
glVertex2dv
(
inner
+
j
*
2
);
glColor4dv
(
outerRGBA
);
glVertex2dv
(
outer
+
j
*
2
);
}
glEnd
();
}
//______________________________________________________________________________
void
DrawCylinder
(
TGLQuadric
*
quadric
,
Double_t
xMin
,
Double_t
xMax
,
Double_t
yMin
,
Double_t
yMax
,
Double_t
zMin
,
Double_t
zMax
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment