-
-
Notifications
You must be signed in to change notification settings - Fork 408
Add TIME_STEPS to RequestInformation to AlembicReader #2791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LuTheDog
wants to merge
11
commits into
f3d-app:master
Choose a base branch
from
LuTheDog:timesteps-from-alembic-reader
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+90
−17
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4f763cd
Add TIME_STEPS to RequestInformation to AlembicReader
LuTheDog 1d91472
Fix build and combine FetchTimeSteps and ExtendTimeRange
LuTheDog b52e1a8
Remove FetchTimeSteps
LuTheDog aa8116c
Fix ComputeTimeRangeAndSteps dfs impl
LuTheDog 2a64a12
Correct previous commit, and add error check
LuTheDog a598998
Add test
LuTheDog c6acad2
Remove unnecessary variable
LuTheDog f17eebb
Format code
LuTheDog c91c9bf
Compare exact values for time steps
LuTheDog c5aa5f7
Format
LuTheDog fd88bb6
Remove unused variable
LuTheDog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
plugins/alembic/module/Testing/TestF3DAlembicReaderRequestInformation.cxx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| #include <vtkAlgorithm.h> | ||
| #include <vtkInformation.h> | ||
| #include <vtkInformationVector.h> | ||
| #include <vtkNew.h> | ||
| #include <vtkStreamingDemandDrivenPipeline.h> | ||
| #include <vtkTestUtilities.h> | ||
|
|
||
| #include "vtkF3DAlembicReader.h" | ||
|
|
||
| #include <iostream> | ||
|
|
||
| int TestF3DAlembicReaderRequestInformation(int vtkNotUsed(argc), char* argv[]) | ||
| { | ||
| static int NUMBER_OF_TIME_STEPS = 90; | ||
| static const double expectedTimeSteps[] = { 0.000000, 0.033333, 0.066667, 0.100000, 0.133333, | ||
| 0.166667, 0.200000, 0.233333, 0.266667, 0.300000, 0.333333, 0.366667, 0.400000, 0.433333, | ||
| 0.466667, 0.500000, 0.533333, 0.566667, 0.600000, 0.633333, 0.666667, 0.700000, 0.733333, | ||
| 0.766667, 0.800000, 0.833333, 0.866667, 0.900000, 0.933333, 0.966667, 1.000000, 1.033333, | ||
| 1.066667, 1.100000, 1.133333, 1.166667, 1.200000, 1.233333, 1.266667, 1.300000, 1.333333, | ||
| 1.366667, 1.400000, 1.433333, 1.466667, 1.500000, 1.533333, 1.566667, 1.600000, 1.633333, | ||
| 1.666667, 1.700000, 1.733333, 1.766667, 1.800000, 1.833333, 1.866667, 1.900000, 1.933333, | ||
| 1.966667, 2.000000, 2.033333, 2.066667, 2.100000, 2.133333, 2.166667, 2.200000, 2.233333, | ||
| 2.266667, 2.300000, 2.333333, 2.366667, 2.400000, 2.433333, 2.466667, 2.500000, 2.533333, | ||
| 2.566667, 2.600000, 2.633333, 2.666667, 2.700000, 2.733333, 2.766667, 2.800000, 2.833333, | ||
| 2.866667, 2.900000, 2.933333, 2.966667 }; | ||
| static const double expectedTimeRange[] = { 0.000000, 2.966667 }; | ||
|
|
||
| std::string filename = std::string(argv[1]) + "data/drop.abc"; | ||
| vtkNew<vtkF3DAlembicReader> reader; | ||
| reader->SetFileName(filename); | ||
| reader->UpdateInformation(); | ||
| vtkInformation* readerInfo = reader->GetOutputInformation(0); | ||
| double* readerTimeSteps = nullptr; | ||
| if (readerInfo->Has(vtkStreamingDemandDrivenPipeline::TIME_STEPS())) | ||
| { | ||
| readerTimeSteps = readerInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); | ||
| } | ||
| else | ||
| { | ||
| return EXIT_FAILURE; | ||
| } | ||
| double* readerTimeRange = nullptr; | ||
| if (readerInfo->Has(vtkStreamingDemandDrivenPipeline::TIME_RANGE())) | ||
| { | ||
| readerTimeRange = readerInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); | ||
| } | ||
| else | ||
| { | ||
| return EXIT_FAILURE; | ||
| } | ||
|
|
||
| for (int i = 0; i < 2; i++) | ||
| { | ||
| if (fabs(readerTimeRange[i] - expectedTimeRange[i]) > 1e-6) | ||
| { | ||
| return EXIT_FAILURE; | ||
| } | ||
| } | ||
|
|
||
| for (int i = 0; i < NUMBER_OF_TIME_STEPS; i++) | ||
| { | ||
| if (fabs(readerTimeSteps[i] - expectedTimeSteps[i]) > 1e-6) | ||
| { | ||
| return EXIT_FAILURE; | ||
| } | ||
| } | ||
|
|
||
| return EXIT_SUCCESS; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.