Skip to content
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

Expanded shape output to write scalar arrays to shape attribute table #2436

Merged
merged 1 commit into from Mar 21, 2019

Conversation

@rinkk
Copy link
Member

commented Mar 20, 2019

  • works only for 2D meshes
  • works only for int/double arrays
  • works only for cell-arrays (because the shape format can only assign value to shape-entities, i.e. polygons but not points ... this can be easily fixed via VTK point 2 cell, though)

@rinkk rinkk force-pushed the rinkk:shapeexportarrays branch from 0c8788b to 61f3266 Mar 20, 2019

@endJunction

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

when green.

@codecov

This comment has been minimized.

Copy link

commented Mar 20, 2019

Codecov Report

Merging #2436 into master will increase coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2436      +/-   ##
==========================================
+ Coverage   32.63%   32.81%   +0.17%     
==========================================
  Files         549      549              
  Lines       20311    20301      -10     
  Branches     9583     9578       -5     
==========================================
+ Hits         6628     6661      +33     
+ Misses      10207    10196      -11     
+ Partials     3476     3444      -32
Impacted Files Coverage Δ
Applications/ApplicationsLib/ProjectData.cpp 0% <0%> (ø) ⬆️
NumLib/NamedFunctionCaller.cpp 57.77% <0%> (+0.74%) ⬆️
MeshLib/Mesh.cpp 42% <0%> (+0.91%) ⬆️
MeshLib/MeshEditing/MeshRevision.cpp 43.56% <0%> (+0.94%) ⬆️
NumLib/DOF/LocalToGlobalIndexMap.cpp 49.73% <0%> (+1.05%) ⬆️
MeshLib/MeshSurfaceExtraction.cpp 32.07% <0%> (+1.25%) ⬆️
GeoLib/Polyline.cpp 37.18% <0%> (+1.87%) ⬆️
GeoLib/MinimalBoundingSphere.cpp 43.13% <0%> (+1.96%) ⬆️
...ng/Algorithms/IterationNumberBasedTimeStepping.cpp 79.06% <0%> (+2.32%) ⬆️
...eStepping/Algorithms/EvolutionaryPIDcontroller.cpp 71.21% <0%> (+3.03%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e2354d...4c25d65. Read the comment docs.

properties.getPropertyVectorNames(MeshLib::MeshItemType::Cell);
int const n_recs = DBFGetRecordCount(hDBF);

for (std::string name : array_names)

This comment has been minimized.

Copy link
@TomFischer

TomFischer Mar 21, 2019

Member

Why not for (std::string const& name : array_names)?

std::size_t const shp_record)
{
unsigned const nNodes(e.getNumberOfBaseNodes());
double* padfX = new double[nNodes + 1];

This comment has been minimized.

Copy link
@TomFischer

TomFischer Mar 21, 2019

Member

New memory allocation - who deletes it?

This comment has been minimized.

Copy link
@TomFischer

TomFischer Mar 21, 2019

Member

Just now I saw the removed comment (previous line 287) that says that shapelib crashes when deleting the memory. Please, insert the comment somewhere in the method.

@TomFischer
Copy link
Member

left a comment

Minor things. When tests are green:

@rinkk

This comment has been minimized.

Copy link
Member Author

commented Mar 21, 2019

@TomFischer - Re: Mem Allocation:

  • padfX/Y/Z are parameters handed over to SHPCreateObject and are afterwards handled by said object (as you would assume, I guess)
  • the object itself (to which the old comment referred) is now correctly handled after the changes by calling SHPDestroyObject

So I guess no additional comment is necessary.

@rinkk rinkk force-pushed the rinkk:shapeexportarrays branch from cd439e1 to af7654e Mar 21, 2019

@rinkk rinkk force-pushed the rinkk:shapeexportarrays branch from af7654e to 4c25d65 Mar 21, 2019

@rinkk rinkk merged commit 6aa70b9 into ufz:master Mar 21, 2019

3 of 4 checks passed

continuous-integration/jenkins/pr-merge The build of this commit was aborted
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
deploy/netlify Deploy preview ready!
Details
ufz.ogs #20190321.4 succeeded
Details

@rinkk rinkk deleted the rinkk:shapeexportarrays branch Apr 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.