MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032071Community[OCCT] OCCT:Visualizationpublic2021-01-21 08:472021-02-15 13:41
Reporterxuweibin 
Assigned Tobugmaster 
PrioritynormalSeverityjust a question 
StatusclosedResolutionno change required 
PlatformWindowsOSVC++ 2013OS Version64 bit
Product Version[OCCT] 7.4.0 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0032071: Visualization - does AIS_Shape::SetColor() affect the FaceBoundaryAspect of other AIS_Shape?
DescriptionI have two AIS_Shape,and each of them have own FaceBoundaryAspect.
When I SetColor for one,the other's FaceBoundaryAspect's color is changed.
And the faceboundary's color is the set color.
This is a bug for occ7.5?
Occ7.3 is right.
TagsNo tags attached.
Test case number
Attached Files

- Relationships
child of 0029988closedbugmaster AIS_Shape - SetWidth() and SetColor() has no effect for FaceBoundary 

-  Notes
(0098383)
kgv (developer)
2021-01-25 02:03

I can barely see in code any reason for described misbehavior.
Could you please share a reproducing code / script?
(0098384)
xuweibin (reporter)
2021-01-25 04:19

auto topo_box = BRepPrimAPI_MakeBox(gp_Pnt(0,0,0), gp_Pnt(10,10,10));
Handle(AIS_Shape) ais_box = new AIS_Shape(topo_box);
myContext->Display(ais_box,true);
auto aspect = new Prs3d_LineAspect(Quantity_NOC_BLACK,Aspect_TOL_SOLID, 1.0);
ais_box->Attributes()->SetFaceBoundaryAspect(aspect);
ais_box->Attributes()->SetFaceBoundaryDraw(true);
ais_box->SetColor(Quantity_NOC_RED1);
mycontext->Redisplay(ais_box,true);

The boundary color is red not black!
The methond SetColor() changes the color of boundary!
(0098387)
kgv (developer)
2021-01-25 10:30
edited on: 2021-01-25 10:32

Well, this is different from what one may guess from issue description.
AIS_Shape::SetColor()/SetTransparency()/SetMaterial() are just convenient short-cuts implementing some general behavior.
As long as you are using only these methods, it might provide more or less convenient behavior, but modifying attributes manually might easily break the logic.

AIS_Shape::SetColor() indeed sets color to FaceBoundaryAspect() aspect, which is an expected behavior.
As there is no AIS_Shape::hasOwnBoundary color similar to AIS_Shape::hasOwnColor/AIS_Shape::hasOwnMaterial and similar, method is unaware if currently set face boundary color was intentional or should be overridden.

As long as your application sets attributes directly - it is better not using AIS_Shape::SetColor() and similar methods at all, or override them to implement desired behavior.

(0098390)
xuweibin (reporter)
2021-01-25 11:00

okay,thank you!
(0098391)
kgv (developer)
2021-01-25 11:21

Dear bugmaster,

please close the issue.

- Issue History
Date Modified Username Field Change
2021-01-21 08:47 xuweibin New Issue
2021-01-21 08:47 xuweibin Assigned To => kgv
2021-01-21 17:47 kgv Severity minor => just a question
2021-01-21 17:47 kgv Summary AIS_Shape::SetColor() affect the FaceBoundaryAspect of other AIS_Shape? => Visualization - does AIS_Shape::SetColor() affect the FaceBoundaryAspect of other AIS_Shape?
2021-01-25 02:03 kgv Note Added: 0098383
2021-01-25 02:03 kgv Assigned To kgv => xuweibin
2021-01-25 02:03 kgv Severity just a question => minor
2021-01-25 02:03 kgv Product Version => 7.5.0
2021-01-25 02:03 kgv Target Version => 7.6.0*
2021-01-25 02:03 kgv Status new => feedback
2021-01-25 04:19 xuweibin Note Added: 0098384
2021-01-25 10:30 kgv Note Added: 0098387
2021-01-25 10:30 kgv Severity minor => just a question
2021-01-25 10:30 kgv Resolution open => no change required
2021-01-25 10:31 kgv Note Edited: 0098387 View Revisions
2021-01-25 10:32 kgv Note Edited: 0098387 View Revisions
2021-01-25 11:00 xuweibin Note Added: 0098390
2021-01-25 11:21 kgv Note Added: 0098391
2021-01-25 11:21 kgv Assigned To xuweibin => bugmaster
2021-01-25 14:52 kgv Relationship added child of 0029988
2021-01-25 14:53 kgv Product Version 7.5.0 => 7.4.0
2021-02-15 13:41 bugmaster Status feedback => closed


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker