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
2e41f8a4
Commit
2e41f8a4
authored
1 month ago
by
Jean Fechter
Browse files
Options
Downloads
Patches
Plain Diff
Add test for HTG FillMaterial
parent
40ba507a
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
Filters/HyperTree/Testing/Cxx/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Filters/HyperTree/Testing/Cxx/CMakeLists.txt
Filters/HyperTree/Testing/Cxx/TestHyperTreeGrid2DGeometryFillMaterial.cxx
+61
-0
61 additions, 0 deletions
...e/Testing/Cxx/TestHyperTreeGrid2DGeometryFillMaterial.cxx
with
62 additions
and
0 deletions
Filters/HyperTree/Testing/Cxx/CMakeLists.txt
+
1
−
0
View file @
2e41f8a4
...
...
@@ -11,6 +11,7 @@
set
(
test_sources
TestHyperTreeGrid2DInterfaceShift.cxx
TestHyperTreeGrid2DGeometryFillMaterial.cxx,NO_VALID,NO_OUTPUT
TestHyperTreeGrid3DAxisCutCoincidentPlane.cxx
TestHyperTreeGrid3DIntercepts.cxx
TestHyperTreeGrid3DInterface.cxx
...
...
This diff is collapsed.
Click to expand it.
Filters/HyperTree/Testing/Cxx/TestHyperTreeGrid2DGeometryFillMaterial.cxx
0 → 100644
+
61
−
0
View file @
2e41f8a4
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
#include
"vtkActor.h"
#include
"vtkCamera.h"
#include
"vtkCellData.h"
#include
"vtkDataArray.h"
#include
"vtkHyperTreeGridGeometry.h"
#include
"vtkLogger.h"
#include
"vtkNew.h"
#include
"vtkPolyData.h"
#include
"vtkTestUtilities.h"
#include
"vtkXMLHyperTreeGridReader.h"
int
TestHyperTreeGrid2DGeometryFillMaterial
(
int
argc
,
char
*
argv
[])
{
// HTG reader
vtkNew
<
vtkXMLHyperTreeGridReader
>
reader
;
// Test data
char
*
fileNameC
=
vtkTestUtilities
::
ExpandDataFileName
(
argc
,
argv
,
"Data/HTG/donut_XZ_shift_2d.htg"
);
reader
->
SetFileName
(
fileNameC
);
delete
[]
fileNameC
;
// Geometry filter
vtkNew
<
vtkHyperTreeGridGeometry
>
geometryFilter
;
geometryFilter
->
SetInputConnection
(
reader
->
GetOutputPort
());
geometryFilter
->
Update
();
vtkPolyData
*
geometry
=
geometryFilter
->
GetPolyDataOutput
();
if
(
!
geometry
)
{
vtkLog
(
ERROR
,
"Unable to retrieve htg geometry."
);
return
EXIT_FAILURE
;
}
if
(
geometry
->
GetNumberOfPoints
()
!=
456
||
geometry
->
GetNumberOfCells
()
!=
114
)
{
vtkLog
(
ERROR
,
"Incorrect number of points or cells."
);
return
EXIT_FAILURE
;
}
geometryFilter
->
FillMaterialOff
();
geometryFilter
->
Update
();
vtkPolyData
*
interfaceLines
=
geometryFilter
->
GetPolyDataOutput
();
if
(
!
interfaceLines
)
{
vtkLog
(
ERROR
,
"Unable to retrieve htg geometry."
);
return
EXIT_FAILURE
;
}
if
(
interfaceLines
->
GetNumberOfPoints
()
!=
282
||
interfaceLines
->
GetNumberOfCells
()
!=
100
)
{
vtkLog
(
ERROR
,
"Incorrect number of points or cells."
);
return
EXIT_FAILURE
;
}
return
EXIT_SUCCESS
;
}
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