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

MOD: ImportOcaf2::getcolor optimizzazion #14143

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mosfet80
Copy link
Contributor

@mosfet80 mosfet80 commented May 18, 2024

getcolor()
fucntion optimizzazion.
removed duplicated check.

Clean class ImportOCAF2

@mosfet80 mosfet80 force-pushed the patch-4 branch 2 times, most recently from dcdd0ab to e74b3b6 Compare May 18, 2024 22:47
@mosfet80 mosfet80 changed the title MOD: ImportOcaf2::getcolor MOD: ImportOcaf2::getcolor optimizzazion May 19, 2024
@wwmayer
Copy link
Contributor

wwmayer commented May 21, 2024

This PR changes the semantic of the function because the case aColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor) has been removed.

getcolor()
      fucntion optimizzazion.
      removed duplicated check.

Clean class ImportOCAF2
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

.

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

.
@mosfet80
Copy link
Contributor Author

ColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor) has not been removed.
the sequence of operations was changed by inserting if elses.

@wwmayer
Copy link
Contributor

wwmayer commented May 22, 2024

Then search for XCAFDoc_ColorSurf inside https://patch-diff.githubusercontent.com/raw/FreeCAD/FreeCAD/pull/14143.diff and you will see that it's only in the removed line if (aColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor)) { but not in a newly added line.

@wwmayer
Copy link
Contributor

wwmayer commented May 22, 2024

Another thing is that checking for XCAFDoc_ColorSurf, XCAFDoc_ColorGen and XCAFDoc_ColorCurv is not mutual exclusive.
It's possible that for the same input shape if (aColorTool->GetColor(shape, XCAFDoc_ColorSurf, aColor)) and if (aColorTool->GetColor(shape, XCAFDoc_ColorCurv, aColor)) can be true.

@chennes chennes marked this pull request as draft May 27, 2024 16:11
@chennes
Copy link
Member

chennes commented May 27, 2024

Switched to draft pending fixes. Please mark as ready for review when done.

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.

None yet

3 participants