Skip to content

Removing circular dependency with XmlLutReader#1302

Merged
rinkk merged 5 commits intoufz:masterfrom
rinkk:LookupTableFix
Jul 1, 2016
Merged

Removing circular dependency with XmlLutReader#1302
rinkk merged 5 commits intoufz:masterfrom
rinkk:LookupTableFix

Conversation

@rinkk
Copy link
Copy Markdown
Member

@rinkk rinkk commented Jun 29, 2016

Moves Color to DataHolderLib, introduces a new data holder for lookup-tables and removes the circular dependency.

int setColorLookupTable(const std::string &filename)
{ return GeoLib::readColorLookupTable(_colorLookupTable, filename); }
// int setColorLookupTable(const std::string &filename)
// { return GeoLib::readColorLookupTable(_colorLookupTable, filename); }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to remove from 44-46?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep this for now as this is another part of the DE where lookup-tables are used but it would need a complete rewrite. I don't want to make this PR larger than it already is.

@TomFischer
Copy link
Copy Markdown
Member

Apart from small questions: 👍

#include <QSettings>

#include "Applications/DataHolderLib/Color.h"
#include "DetailWindow.h"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include this at top

@norihiro-w
Copy link
Copy Markdown
Collaborator

Changes in this PR are lots compared to just moving XmlLutReader to somewhere under DE (#1284). What is a reason you have to keep it in FileIO? XmlLutReader is used only in DE, isn't it?

@TomFischer
Copy link
Copy Markdown
Member

TomFischer commented Jun 29, 2016

Changes in this PR are lots compared to just moving XmlLutReader to somewhere under DE (#1284). What is a reason you have to keep it in FileIO? XmlLutReader is used only in DE, isn't it?

One reason is to keep IO functionality local. Another is that it is now possible to use it in other utils without introducing new circular dependencies. External tools like Gocad store specifc color tables which could be reused by paraview or DE.

@norihiro-w
Copy link
Copy Markdown
Collaborator

Thanks for the two points. However

  • I'm not sure what you mean "local". Moving XmlLutReader under DE actually improves locality because it is only used there.
  • For keeping quality and maintainability of codes, we should keep codes as simple as possible based on current usage. When it comes in the future that someone really needs another tool using color tables, the code should be modified accordingly.

@TomFischer
Copy link
Copy Markdown
Member

  • By "local" I mean that all IO functionality is grouped together. If you search for a specific interface it should be sufficient to look into the FileIO.
  • I have already a branch for reading Gocad SGrid data and I will use the color lookup table there in the near future.

@norihiro-w
Copy link
Copy Markdown
Collaborator

I don't agree with the first point (because they are not local from a viewpoint of modularity), but the second point gives some reason to keep it in FileIO. thanks

@rinkk rinkk force-pushed the LookupTableFix branch from 1593e7e to 62b7f5e Compare July 1, 2016 13:15
@rinkk rinkk merged commit 0e70160 into ufz:master Jul 1, 2016
@rinkk rinkk deleted the LookupTableFix branch October 15, 2018 13:02
@ogsbot
Copy link
Copy Markdown
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants