1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030623: Draw Harness - support hex color codes within ViewerTest::ParseColor()

ViewerTest::ParseColor() function is improved to be able to parse the following set of input arguments:
  - "Red Green Blue [Alpha]", where Red, Green, Blue, Alpha must be integers within the range [0, 255] or reals within the range [0.0, 1.0]. Note that "0 0 1" triple is parsed as "0.0 0.0 1.0" and will be interpreted as a blue color.
  - "ColorName [Alpha]", where ColorName is one of WHITE, BLACK, RED, GREEN, BLUE, etc. (look at Quantity_NameOfColor enumeration for all possible variants). Alpha may be integer or real, as described at the previous list item.
  - #HHH, [#]HHH[H], [#]HHHHHH[HH], where H is a hexadecimal digit (0 .. 9, a .. f, or A .. F). There are a short hexadecimal RGB, RGBA formats, and a usual RGB[A], respectively.
This commit is contained in:
tiv
2019-04-12 10:45:25 +03:00
committed by bugmaster
parent a5278fc126
commit f9b30c0db3
13 changed files with 583 additions and 66 deletions

View File

@@ -49,6 +49,17 @@ public:
InitIdentity();
}
//! Conversion constructor (explicitly converts some 4 x 4 matrix with other element type
//! to a new 4 x 4 matrix with the element type Element_t,
//! whose elements are static_cast'ed corresponding elements of theOtherMat4 matrix)
//! @tparam OtherElement_t the element type of the other 4 x 4 matrix theOtherVec4
//! @param theOtherMat4 the 4 x 4 matrix that needs to be converted
template <typename OtherElement_t>
explicit NCollection_Mat4 (const NCollection_Mat4<OtherElement_t>& theOtherMat4)
{
ConvertFrom (theOtherMat4);
}
//! Get element at the specified row and column.
//! @param theRow [in] the row.to address.
//! @param theCol [in] the column to address.

View File

@@ -57,6 +57,18 @@ public:
v[1] = theY;
}
//! Conversion constructor (explicitly converts some 2-component vector with other element type
//! to a new 2-component vector with the element type Element_t,
//! whose elements are static_cast'ed corresponding elements of theOtherVec2 vector)
//! @tparam OtherElement_t the element type of the other 2-component vector theOtherVec2
//! @param theOtherVec2 the 2-component vector that needs to be converted
template <typename OtherElement_t>
explicit NCollection_Vec2 (const NCollection_Vec2<OtherElement_t>& theOtherVec2)
{
v[0] = static_cast<Element_t> (theOtherVec2[0]);
v[1] = static_cast<Element_t> (theOtherVec2[1]);
}
//! Assign new values to the vector.
void SetValues (const Element_t theX,
const Element_t theY)

View File

@@ -73,6 +73,19 @@ public:
v[2] = theZ;
}
//! Conversion constructor (explicitly converts some 3-component vector with other element type
//! to a new 3-component vector with the element type Element_t,
//! whose elements are static_cast'ed corresponding elements of theOtherVec3 vector)
//! @tparam OtherElement_t the element type of the other 3-component vector theOtherVec3
//! @param theOtherVec3 the 3-component vector that needs to be converted
template <typename OtherElement_t>
explicit NCollection_Vec3 (const NCollection_Vec3<OtherElement_t>& theOtherVec3)
{
v[0] = static_cast<Element_t> (theOtherVec3[0]);
v[1] = static_cast<Element_t> (theOtherVec3[1]);
v[2] = static_cast<Element_t> (theOtherVec3[2]);
}
//! Assign new values to the vector.
void SetValues (const Element_t theX,
const Element_t theY,

View File

@@ -73,6 +73,20 @@ public:
v[3] = theW;
}
//! Conversion constructor (explicitly converts some 4-component vector with other element type
//! to a new 4-component vector with the element type Element_t,
//! whose elements are static_cast'ed corresponding elements of theOtherVec4 vector)
//! @tparam OtherElement_t the element type of the other 4-component vector theOtherVec4
//! @param theOtherVec4 the 4-component vector that needs to be converted
template <typename OtherElement_t>
explicit NCollection_Vec4 (const NCollection_Vec4<OtherElement_t>& theOtherVec4)
{
v[0] = static_cast<Element_t> (theOtherVec4[0]);
v[1] = static_cast<Element_t> (theOtherVec4[1]);
v[2] = static_cast<Element_t> (theOtherVec4[2]);
v[3] = static_cast<Element_t> (theOtherVec4[3]);
}
//! Assign new values to the vector.
void SetValues (const Element_t theX,
const Element_t theY,