Archived issue #0025229
Cappings have gray tint if setting color with vclipplane command
Description
DRAW "vclipplane" command is normally used to test cappings with DRAW.
Typing the command below used to set capping color to pure white:
> vclipplane change pln1 capping color 1.0 1.0 1.0
On current version the color remains gray.
The following actions are proposed:
1. Investigate reasons and root of the problem - whether it is only in DRAW command or on the level of capping algorithm.
2. Fix problem by either extending DRAW command or patching algorithm.
3. Prepare new test case to ensure that this problem will be never reproduced.
Typing the command below used to set capping color to pure white:
> vclipplane change pln1 capping color 1.0 1.0 1.0
On current version the color remains gray.
The following actions are proposed:
1. Investigate reasons and root of the problem - whether it is only in DRAW command or on the level of capping algorithm.
2. Fix problem by either extending DRAW command or patching algorithm.
3. Prepare new test case to ensure that this problem will be never reproduced.
Steps to reproduce
pload MODELING AISV
restore data\\occ\\Bottom.brep
vinit
vsetdispmode 1
vdisplay Bottom
vclipplane create pln1
vclipplane change pln1 equation 0 0 -1 20
vclipplane set pln1 object Bottom
vclipplane change pln1 capping on
vclipplane change pln1 capping color 1.0 1.0 1.0
BUG > clip plane remains gray
restore data\\occ\\Bottom.brep
vinit
vsetdispmode 1
vdisplay Bottom
vclipplane create pln1
vclipplane change pln1 equation 0 0 -1 20
vclipplane set pln1 object Bottom
vclipplane change pln1 capping on
vclipplane change pln1 capping color 1.0 1.0 1.0
BUG > clip plane remains gray
Public activity
16 archived notes
Participants are labeled by their role within this record.
The reason is that the capping planes have gray tint is that code of command previously utilized for setting color is changed.
static int VClipPlane (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgVec)
{
...
Graphic3d_MaterialAspect aMat = aClipPlane->CappingMaterial();
aMat->SetColor(Quantity_Color(aRed, aGrn, aBlu, Quantity_TOC_RGB))
aClipPlane->SetCappingMaterial (aMat);
...
"SetColor" now uses coefficient 0.25 to scale the given color and set it instead of ambient combient, while it did not scale the color before.
Thus, we can conclude that patch is required only for DRAW command.
The call to "vclipplane change pln1 capping color" should provide the same results as before changes to "SetColor", e.g. modify ambient and diffuse components either at once or separately by passing new argument.
Another option is also wanted to be able to set material by name instead as it is done by vaspect -setmaterial command.
static int VClipPlane (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgVec)
{
...
Graphic3d_MaterialAspect aMat = aClipPlane->CappingMaterial();
aMat->SetColor(Quantity_Color(aRed, aGrn, aBlu, Quantity_TOC_RGB))
aClipPlane->SetCappingMaterial (aMat);
...
"SetColor" now uses coefficient 0.25 to scale the given color and set it instead of ambient combient, while it did not scale the color before.
Thus, we can conclude that patch is required only for DRAW command.
The call to "vclipplane change pln1 capping color" should provide the same results as before changes to "SetColor", e.g. modify ambient and diffuse components either at once or separately by passing new argument.
Another option is also wanted to be able to set material by name instead as it is done by vaspect -setmaterial command.
Dear Ivan,
Could you please fix this issue?
Could you please fix this issue?
Adding selection of material is an another option. Considering this change it looks like it make sense to rewrite interface of the command - shall be done, of course, in another issue. The color option is enough to test that capping aspects works, so we have no necessity to add the material option right now.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Sep 10 16:14:25 2014 +0400
0025229: Cappings have gray tint if setting color with vclipplane command
-Now Graphic3d_TypeOfMaterial::SetAmbientColor() and
Graphic3d_TypeOfMaterial::SetDiffuseColor() are used instead of
Graphic3d_TypeOfMaterial::SetColor()
-New test case added: tests\bugs\vis\bug25229
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Sep 10 16:14:25 2014 +0400
0025229: Cappings have gray tint if setting color with vclipplane command
-Now Graphic3d_TypeOfMaterial::SetAmbientColor() and
Graphic3d_TypeOfMaterial::SetDiffuseColor() are used instead of
Graphic3d_TypeOfMaterial::SetColor()
-New test case added: tests\bugs\vis\bug25229
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Sep 10 16:45:28 2014 +0400
0025229: Cappings have gray tint if setting color with vclipplane command
-Now in ViewerTest_ViewerCommands's method VClipPlane() Graphic3d_TypeOfMaterial::SetAmbientColor() and
Graphic3d_TypeOfMaterial::SetDiffuseColor() are used instead of
Graphic3d_TypeOfMaterial::SetColor()
-New test case added: tests\bugs\vis\bug25229
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Sep 10 16:45:28 2014 +0400
0025229: Cappings have gray tint if setting color with vclipplane command
-Now in ViewerTest_ViewerCommands's method VClipPlane() Graphic3d_TypeOfMaterial::SetAmbientColor() and
Graphic3d_TypeOfMaterial::SetDiffuseColor() are used instead of
Graphic3d_TypeOfMaterial::SetColor()
-New test case added: tests\bugs\vis\bug25229
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Sep 10 16:59:33 2014 +0400
-Formatting
[revision removed]
Detailed log of new commits:
Author: isz
Date: Wed Sep 10 16:59:33 2014 +0400
-Formatting
Dear apl,
please review my changes in branch CR25229_1.
please review my changes in branch CR25229_1.
Dear Ivan,
I have a minor remark:
- Comment for the second commit does not correspond to the modification you have pushed. Please try to provide more accurate commit messages in future.
I have a minor remark:
- Comment for the second commit does not correspond to the modification you have pushed. Please try to provide more accurate commit messages in future.
Dear Commenter 1,
The branch CR25229_1 is reviewed, please test.
The branch CR25229_1 is reviewed, please test.
Dear Commenter 1,
Branch CR25229_1 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
http://occt-tests/CR25229-1-master-occt/Debian60-64/bugs/vis/bug25229.html
http://occt-tests/CR25229-1-master-occt/Windows-32-VC10/bugs/vis/bug25229.html
bugs vis bug25229: OK - ?
Testing on Linux:
occt component :
Total MEMORY difference: 355305180 / 355209688
Total CPU difference: 46528.75000000005 / 45791.5700000001
products component :
Total MEMORY difference: 109694472 / 109576272
Total CPU difference: 18582.729999999974 / 18117.239999999958
Testing on Windows:
occt component :
Total MEMORY difference: 241667696 / 241837776
Total CPU difference: 33503.765625 / 36476.171875
products component :
Total MEMORY difference: 66412576 / 66458348
Total CPU difference: 13305.375 / 12369.875
There are following differences in images found by testdiff.
http://occt-tests/CR25229-1-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR25229-1-master-occt/Windows-32-VC10/diff-Windows-32-VC10.html
IMAGE bugs vis bug24902_2: bug24902_2_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24224: bug24224_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24902_1: bug24902_1_Driver1_Viewer1_View1.png differs
Branch CR25229_1 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
http://occt-tests/CR25229-1-master-occt/Debian60-64/bugs/vis/bug25229.html
http://occt-tests/CR25229-1-master-occt/Windows-32-VC10/bugs/vis/bug25229.html
bugs vis bug25229: OK - ?
Testing on Linux:
occt component :
Total MEMORY difference: 355305180 / 355209688
Total CPU difference: 46528.75000000005 / 45791.5700000001
products component :
Total MEMORY difference: 109694472 / 109576272
Total CPU difference: 18582.729999999974 / 18117.239999999958
Testing on Windows:
occt component :
Total MEMORY difference: 241667696 / 241837776
Total CPU difference: 33503.765625 / 36476.171875
products component :
Total MEMORY difference: 66412576 / 66458348
Total CPU difference: 13305.375 / 12369.875
There are following differences in images found by testdiff.
http://occt-tests/CR25229-1-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR25229-1-master-occt/Windows-32-VC10/diff-Windows-32-VC10.html
IMAGE bugs vis bug24902_2: bug24902_2_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24224: bug24224_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24902_1: bug24902_1_Driver1_Viewer1_View1.png differs
Dear Commenter 1,
Branch CR25229_1 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested on Debug mode.
[revision removed]
Regressions/Differences:
No regressions/differences
Testing cases:
http://occt-tests/CR25229-1-master-occt-deb/Debian60-64/bugs/vis/bug25229.html
http://occt-tests/CR25229-1-master-occt-deb/Windows-32-VC10/bugs/vis/bug25229.html
bugs vis bug25229: OK - ?
Testing on Linux:
occt component :
Total MEMORY difference: 425506396 / 425750684
Total CPU difference: 135653.62999999872 / 156731.11999999927
products component :
Total MEMORY difference: 127590792 / 127592128
Total CPU difference: 35586.31000000002 / 38503.56999999995
Testing on Windows:
occt component :
Total MEMORY difference: 334600124 / 333611952
Total CPU difference: 116306.5625 / 104843.671875
products component :
Total MEMORY difference: 89115372 / 88954420
Total CPU difference: 22627.40625 / 27886.515625
There are following differences in images found by testdiff.
http://occt-tests/CR25229-1-master-occt-deb/Windows-32-VC10/diff-Windows-32-VC10.html
http://occt-tests/CR25229-1-master-occt-deb/Debian60-64/diff-Debian60-64.html
IMAGE bugs vis bug24902_2: bug24902_2_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24224: bug24224_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24902_1: bug24902_1_Driver1_Viewer1_View1.png differs
Branch CR25229_1 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested on Debug mode.
[revision removed]
Regressions/Differences:
No regressions/differences
Testing cases:
http://occt-tests/CR25229-1-master-occt-deb/Debian60-64/bugs/vis/bug25229.html
http://occt-tests/CR25229-1-master-occt-deb/Windows-32-VC10/bugs/vis/bug25229.html
bugs vis bug25229: OK - ?
Testing on Linux:
occt component :
Total MEMORY difference: 425506396 / 425750684
Total CPU difference: 135653.62999999872 / 156731.11999999927
products component :
Total MEMORY difference: 127590792 / 127592128
Total CPU difference: 35586.31000000002 / 38503.56999999995
Testing on Windows:
occt component :
Total MEMORY difference: 334600124 / 333611952
Total CPU difference: 116306.5625 / 104843.671875
products component :
Total MEMORY difference: 89115372 / 88954420
Total CPU difference: 22627.40625 / 27886.515625
There are following differences in images found by testdiff.
http://occt-tests/CR25229-1-master-occt-deb/Windows-32-VC10/diff-Windows-32-VC10.html
http://occt-tests/CR25229-1-master-occt-deb/Debian60-64/diff-Debian60-64.html
IMAGE bugs vis bug24902_2: bug24902_2_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24224: bug24224_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24902_1: bug24902_1_Driver1_Viewer1_View1.png differs
Dear Mikhail,
The results are OK - exactly as expected to be.
The results are OK - exactly as expected to be.
OK.
CR25229_1 is TESTED.
CR25229_1 is TESTED.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]