MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030969Open CASCADE[OCCT] OCCT:Codingpublic2019-09-16 18:322019-10-09 12:03
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityintegration request 
StatusreviewedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
DescriptionQuantity_Color.cxx defines a large table of standard colors.
It is desired refactoring this table to be better aligned.

static Standard_Integer VColTable (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** 
theArgVec)
{
  FILE* aFile = OSD_OpenFile ("col.hxx", "wb");
  if (aFile == NULL) { std::cerr << "FAILED\n";  return 1; }
  for (int aColIter = 0; aColIter <= Quantity_NOC_WHITE; ++aColIter)
  {
    Quantity_Color aColor ((Quantity_NameOfColor )aColIter);
    TCollection_AsciiString aHex = Quantity_Color::ColorToHex(aColor).SubString (2, 7);
    Fprintf (aFile, "RawColor(%-20s, 0x%s, %f, %f, %f),\n",
             Quantity_Color::StringName ((Quantity_NameOfColor )aColIter), aHex.ToCString(),
             aColor.Red(), aColor.Green(), aColor.Blue());
  }
  fclose(aFile);
  return 0;
}
Steps To ReproduceN/A
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0029528reviewedbugmaster Visualization, TKOpenGl - allow defining sRGB textures 
related to 0031035newkgv Coding - uninitialized class fields reported by Visual Studio Code Analysis 

-  Notes
(0087170)
git (administrator)
2019-09-16 23:10

Branch CR30969 has been created by kgv.

SHA-1: 5e78b60bdfeb5b945e26d5a1b3d389ff8b80298a


Detailed log of new commits:

Author: kgv
Date: Mon Sep 16 23:06:38 2019 +0300

    0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
    
    The table of named colors has been compressed and moved out
    from Quantity_Color.cxx into Quantity_ColorTable.pxx.
    
    Quantity_NameOfColor - grayscale enumeration values
    have been re-ordered to fix discontinuity.
    
    Quantity_Color class definition has been cleaned to follow OCCT coding style.
    Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
    New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
    converting RGB components from linear to non-linear sRGB colorspace and vice versa.
(0087172)
git (administrator)
2019-09-16 23:38

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 5dd6fc82b69a0dd7dbfafb41d37de578fca51b78
(0087177)
abv (manager)
2019-09-17 06:47

Let's postpone it till 7.5.0. Minor remark: there is no sense in prefixing calls to the class' own methods by its name within the class definition, like calls to Quantity_Color::valuesOf() in Quantity_Color.hxx.
(0087180)
git (administrator)
2019-09-17 08:16

Branch CR30969 has been updated forcibly by kgv.

SHA-1: abc49f0cf69a952fe8e497527f3f3b5aee27240c
(0087190)
git (administrator)
2019-09-17 11:00

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 4e7c85af208f3a674522ef67abef4a09e88fc8be
(0087199)
git (administrator)
2019-09-17 13:33

Branch CR30969 has been updated forcibly by kgv.

SHA-1: bbb2ea5994d354eae7a4c278b13d3d24e9dddac8
(0087202)
git (administrator)
2019-09-17 14:47

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 409493504f6e5e3902395bf911cc1cbe9069f707
(0087206)
git (administrator)
2019-09-17 16:59

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 5ca6bad5b67c06b546ced95ef804ed14d623483c
(0087215)
git (administrator)
2019-09-17 18:06

Branch CR30969 has been updated forcibly by kgv.

SHA-1: ecf8bbdf0765943afef2f875d8574cdec17233b6
(0087219)
git (administrator)
2019-09-17 19:05

Branch CR30969 has been updated forcibly by kgv.

SHA-1: d568d0063886ed6a29c2797d606215cf3eb231e1
(0087221)
git (administrator)
2019-09-17 19:27

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 2d094b0fee4147857fa6ae646e58db644e293a54
(0087227)
git (administrator)
2019-09-18 01:39

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 96fbac030a3ab57bd45301a79d5b8e5d8f2374ab
(0087229)
git (administrator)
2019-09-18 01:46

Branch CR30969 has been updated forcibly by kgv.

SHA-1: 7744d1c9efd94d0b5d20a3c3f5efacdf6a542397
(0087231)
git (administrator)
2019-09-18 02:49

Branch CR30969_1 has been created by kgv.

SHA-1: 2601dc86ee1b8300faf34ac9e90122d4600a489c


Detailed log of new commits:

Author: kgv
Date: Mon Sep 16 23:06:38 2019 +0300

    0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
    
    The table of named colors has been compressed and moved out
    from Quantity_Color.cxx into Quantity_ColorTable.pxx.
    
    Quantity_NameOfColor - grayscale enumeration values have been re-ordered to fix discontinuity.
    Duplicating colors has been merged within enumeration:
      CHARTREUSE=CHARTREUSE1, GOLD=GOLD1, GREEN=GREEN1, ORANGE=ORANGE1,
      ORANGERED=ORANGERED1, RED=RED1, TOMATO=TOMATO1, YELLOW=YELLOW1.
    Added aliases to several other common colors:
      BLUE=BLUE1, CYAN=CYAN1, LIGHTCYAN=LIGHTCYAN1, MAGENTA=MAGENTA1.
    
    Quantity_Color::ColorToHex() now rounds-up float values to closest integer.
    Quantity_ColorRGBA::ColorToHex() - added method formatting color into hex with alpha component.
    
    Quantity_Color class definition has been cleaned to follow OCCT coding style.
    Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
    Removed unused class Quantity_ColorDefinitionError.
    
    New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
    converting RGB components from linear to non-linear sRGB colorspace and vice versa.
    Image_PixMap::PixelColor() and Image_PixMap::SetPixelColor() methods have been extended
    with an optional argument for performing linearization/delinearization of 8-bit sRGB pixel formats.
    
    Draw Harness command AISColor has been corrected to take color name instead of enumeration index.
    
    vdrawtext command now uses ViewerTest::ParseColor() for parsing color argument, so that it accepts hex.
    vreadpixel command now has been extended with -hex argument for printing color in hex format.
(0087245)
git (administrator)
2019-09-18 10:28

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: 42b44884c0ab63df0318e60a937562bb4cdb9598
(0087247)
git (administrator)
2019-09-18 13:07

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: 0fc5dcdf983882fed0fe91b1fcb89b9feef05304
(0087257)
git (administrator)
2019-09-18 15:18

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: 89edcc39bb6a1862ec7ed68d4c96c0a3eecb27c7
(0087262)
git (administrator)
2019-09-18 17:27

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: c3cd55c2b103a534a693fc5ce5290ddb6b55957c
(0087291)
git (administrator)
2019-09-19 10:18

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: 577a52d6b2a6f1bbc6d715f02497ebfd07763e8e
(0087294)
git (administrator)
2019-09-19 11:54

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: f7a060ddd93fc4f9d6ae1bbcc3945b004d588cd3
(0087329)
git (administrator)
2019-09-19 21:03

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: b0bef43c8d36216984dc958bc11a5702b1de64fd
(0087358)
git (administrator)
2019-09-20 13:07

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: 0c7d27551fa1190bb57889334c973dc9e859da70
(0087361)
git (administrator)
2019-09-20 13:23

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: f2f06fbc45cbf2d9afb6ad802d2567c50ed889a2
(0087400)
git (administrator)
2019-09-21 22:20

Branch CR30969_1 has been updated forcibly by kgv.

SHA-1: 56f2e2c03afb96709cf68e5357f12bcaf345f658
(0087447)
git (administrator)
2019-09-23 12:32

Branch CR30969_2 has been created by kgv.

SHA-1: 15385fd0c0ef75c3113dabac07a9b683fb89dcc3


No new revisions were added by this update.
(0087450)
kgv (developer)
2019-09-23 14:52

Patch is ready for review.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR29528_4-CR29528_4-KGV/ [^]
(0087464)
osa (developer)
2019-09-24 11:47

The patches were reviewed without remarks
(0087664)
git (administrator)
2019-10-01 15:36

Branch CR30969_2 has been updated forcibly by kgv.

SHA-1: 11047e453c261cbd7e01920f350920d65bdfd6bb

- Issue History
Date Modified Username Field Change
2019-09-16 18:32 kgv New Issue
2019-09-16 18:32 kgv Assigned To => kgv
2019-09-16 18:33 kgv Relationship added related to 0029528
2019-09-16 23:10 git Note Added: 0087170
2019-09-16 23:38 git Note Added: 0087172
2019-09-17 06:47 abv Note Added: 0087177
2019-09-17 06:47 abv Target Version 7.4.0 => 7.5.0*
2019-09-17 08:16 git Note Added: 0087180
2019-09-17 11:00 git Note Added: 0087190
2019-09-17 13:33 git Note Added: 0087199
2019-09-17 14:47 git Note Added: 0087202
2019-09-17 16:59 git Note Added: 0087206
2019-09-17 18:06 git Note Added: 0087215
2019-09-17 19:05 git Note Added: 0087219
2019-09-17 19:27 git Note Added: 0087221
2019-09-18 01:39 git Note Added: 0087227
2019-09-18 01:46 git Note Added: 0087229
2019-09-18 02:49 git Note Added: 0087231
2019-09-18 10:28 git Note Added: 0087245
2019-09-18 13:07 git Note Added: 0087247
2019-09-18 15:18 git Note Added: 0087257
2019-09-18 17:27 git Note Added: 0087262
2019-09-19 10:18 git Note Added: 0087291
2019-09-19 11:54 git Note Added: 0087294
2019-09-19 21:03 git Note Added: 0087329
2019-09-20 13:07 git Note Added: 0087358
2019-09-20 13:23 git Note Added: 0087361
2019-09-21 22:20 git Note Added: 0087400
2019-09-23 12:32 git Note Added: 0087447
2019-09-23 14:52 kgv Note Added: 0087450
2019-09-23 14:52 kgv Assigned To kgv => osa
2019-09-23 14:52 kgv Status new => resolved
2019-09-24 11:47 osa Note Added: 0087464
2019-09-24 11:47 osa Assigned To osa => bugmaster
2019-09-24 11:47 osa Status resolved => reviewed
2019-10-01 15:36 git Note Added: 0087664
2019-10-06 00:35 kgv Relationship added related to 0031035


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker