Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
Spiros Tsalikis
VTK
Commits
cac32a10
Commit
cac32a10
authored
8 months ago
by
Arnaud Farcy
Browse files
Options
Downloads
Patches
Plain Diff
Extend scalar bar testing for conflicting swatches
parent
9e1f3fb9
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
Rendering/Annotation/Testing/Cxx/TestScalarBar.cxx
+36
-0
36 additions, 0 deletions
Rendering/Annotation/Testing/Cxx/TestScalarBar.cxx
Rendering/Annotation/Testing/Data/Baseline/TestScalarBar.png.sha512
+1
-1
1 addition, 1 deletion
...Annotation/Testing/Data/Baseline/TestScalarBar.png.sha512
with
37 additions
and
1 deletion
Rendering/Annotation/Testing/Cxx/TestScalarBar.cxx
+
36
−
0
View file @
cac32a10
...
...
@@ -7,6 +7,7 @@
#include
"vtkActor.h"
#include
"vtkCamera.h"
#include
"vtkDoubleArray.h"
#include
"vtkLookupTable.h"
#include
"vtkMultiBlockDataSet.h"
#include
"vtkMultiBlockPLOT3DReader.h"
#include
"vtkNew.h"
...
...
@@ -171,6 +172,39 @@ int TestScalarBar(int argc, char* argv[])
scalarBar6
->
SetDrawFrame
(
1
);
scalarBar6
->
SetTextureGridWidth
(
20
);
// Need a vtkLookupTable to test GetIndex with problematic values
double
range_min
=
1.0
;
double
range_max
=
6.019831813928703
;
vtkNew
<
vtkLookupTable
>
lut2
;
lut2
->
SetRange
(
range_min
,
range_max
);
lut2
->
SetNumberOfColors
(
4
);
lut2
->
Build
();
vtkNew
<
vtkScalarBarActor
>
scalarBar7
;
scalarBar7
->
SetTitle
(
"distinct linear"
);
scalarBar7
->
SetLookupTable
(
lut2
);
scalarBar7
->
SetWidth
(
0.15
);
scalarBar7
->
SetHeight
(
0.4
);
scalarBar7
->
GetPositionCoordinate
()
->
SetCoordinateSystemToNormalizedViewport
();
scalarBar7
->
GetPositionCoordinate
()
->
SetValue
(
.6
,
.6
);
scalarBar7
->
SetMaximumNumberOfColors
(
4
);
double
range_max_log
=
pow
(
10.0
,
range_max
);
vtkNew
<
vtkLookupTable
>
lut3
;
lut3
->
SetRange
(
range_min
,
range_max_log
);
lut3
->
SetNumberOfColors
(
4
);
lut3
->
SetScaleToLog10
();
lut3
->
Build
();
vtkNew
<
vtkScalarBarActor
>
scalarBar8
;
scalarBar8
->
SetTitle
(
"distinct log"
);
scalarBar8
->
SetLookupTable
(
lut3
);
scalarBar8
->
SetWidth
(
0.15
);
scalarBar8
->
SetHeight
(
0.4
);
scalarBar8
->
GetPositionCoordinate
()
->
SetCoordinateSystemToNormalizedViewport
();
scalarBar8
->
GetPositionCoordinate
()
->
SetValue
(
.8
,
.6
);
scalarBar8
->
SetMaximumNumberOfColors
(
4
);
vtkNew
<
vtkCamera
>
camera
;
camera
->
SetFocalPoint
(
8
,
0
,
30
);
camera
->
SetPosition
(
6
,
0
,
50
);
...
...
@@ -183,6 +217,8 @@ int TestScalarBar(int argc, char* argv[])
ren1
->
AddActor
(
scalarBar4
);
ren1
->
AddActor
(
scalarBar5
);
ren1
->
AddActor
(
scalarBar6
);
ren1
->
AddActor
(
scalarBar7
);
ren1
->
AddActor
(
scalarBar8
);
ren1
->
GradientBackgroundOn
();
ren1
->
SetBackground
(
.5
,
.5
,
.5
);
ren1
->
SetBackground2
(
.0
,
.0
,
.0
);
...
...
This diff is collapsed.
Click to expand it.
Rendering/Annotation/Testing/Data/Baseline/TestScalarBar.png.sha512
+
1
−
1
View file @
cac32a10
d69f01560a5fd6
1ac
d
eb
d17d7ef1e90156e2b1f5c2bda9a75f3be7daac7f570acd6d4bf7a32ae168dccd636912a0b925b550ea58e6f9deb9890bc203cfb96ea4
521b72243285dd
1aceb
c99215568290ec0463a72ccc21e615eed48dec49e6f88dc649895db6081477af95dd77d023ce475c6b9dac048950a25c7e0b9da2f7122
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