MantisBT - Community
View Issue Details
0023596Community[OCCT] OCCT:Data Exchangepublic2012-11-28 13:492018-05-25 19:18
Roman Lygin 
Roman Lygin 
normalintegration request 
[OCCT] 6.5.4 
[OCCT] 6.6.0[OCCT] 6.6.0 
Not needed
0023596: Extending XCAFPrs_AISObject to enable customization of default color
Added a virtual method DefaultStyle() which can be redefined in subclasses to provide a custom default style.
The default style object has not been made a data member of a base class (XCAFPrs_AISObject) to avoid memory consumption, it is returned via an output parameter.

For easier subclassing the Compute() method has been made protected.
No tags attached.
has duplicate 0022570closed bugmaster Community Extending XCAFPrs_AISObject to enable customization of default color 
Issue History
2012-11-28 13:49Roman LyginNew Issue
2012-11-28 13:49Roman LyginAssigned To => gka
2012-11-28 13:51Roman LyginNote Added: 0022408
2012-11-28 13:51Roman LyginStatusnew => resolved
2012-11-28 17:24gkaNote Added: 0022417
2012-11-28 17:24gkaStatusresolved => reviewed
2012-11-28 18:27mkvAssigned Togka => mkv
2012-11-29 06:25abvNote Added: 0022427
2012-11-29 10:49Roman LyginNote Added: 0022432
2012-11-29 11:00abvNote Added: 0022433
2012-11-29 11:24Roman LyginNote Added: 0022435
2012-12-03 14:49mkvNote Added: 0022517
2012-12-03 14:49mkvTest case number => Not needed
2012-12-03 14:49mkvAssigned Tomkv => bugmaster
2012-12-03 14:49mkvStatusreviewed => tested
2012-12-10 17:16Roman LyginChangeset attached => occt master 576ab394
2012-12-10 17:16Roman LyginAssigned Tobugmaster => Roman Lygin
2012-12-10 17:16Roman LyginStatustested => verified
2012-12-10 17:16Roman LyginResolutionopen => fixed
2012-12-10 17:47bugmasterTarget Version => 6.6.0
2013-03-01 21:39abvRelationship addedhas duplicate 0022570
2013-04-23 13:35aivStatusverified => closed
2013-04-29 15:23aivFixed in Version => 6.6.0
2018-05-25 19:18kgvRelationship addedrelated to 0029788

Roman Lygin   
2012-11-28 13:51   
Pushed branch CR23596 into the git repository
2012-11-28 17:24   
Branch CR23596 is ready to be tested
2012-11-29 06:25   
In my opinion, it would be more convenient to have default color a member of the class, i.e. customizeable without subclassing. Does minor memory saving take sense in this case?
Roman Lygin   
2012-11-29 10:49   
Default style is per-application, not per-object. For setting the object's style one has to use XDE attributes, otherwise availability of member field to achieve the same creates ambiguity and hence confusion on when to use what.

In 90%+ cases developers will unlikely redefine the defaults, so wasting memory for *every* object (which can be numerous, of course limited by OpenGL performance) does not look reasonable. Hence the subclassing approach makes most sense, imho.
2012-11-29 11:00   
Ok, I see your point; why not static field then? Not a big problem anyway...
Roman Lygin   
2012-11-29 11:24   
The point against a static object would be for instance a lost possibility to have several kinds of 'default' styles in one application (e.g. solids would have one default style, sheets/shells - the other, wireframes - third and so on). Of course, a corner case but still a valid point which can be easily addressed by subclassing, without any extra global data.
2012-12-03 14:49   
Dear BugMaster,
Branch CR23596 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Not detected

Not detected

Testing cases:
Not needed