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

0031698: Visualization, Graphic3d_Aspects - provide stipple line factor parameter

Added Graphic3d_Aspects::LineStippleFactor() property.
Adjusted help for vaspects command suggesting a shorter syntax.
This commit is contained in:
kgv
2020-08-03 17:53:18 +03:00
committed by bugmaster
parent 148820b2a9
commit e0b2443737
5 changed files with 75 additions and 34 deletions

View File

@@ -30,6 +30,7 @@ Graphic3d_Aspects::Graphic3d_Aspects()
myAlphaCutoff (0.5f),
myLineType (Aspect_TOL_SOLID),
myLineWidth (1.0f),
myLineFactor (1),
myLinePattern (0xFFFF),
myMarkerType (Aspect_TOM_POINT),
myMarkerScale (1.0f),

View File

@@ -254,6 +254,19 @@ public:
myLinePattern = thePattern;
}
//! Return a multiplier for each bit in the line stipple pattern within [1, 256] range; 1 by default.
uint16_t LineStippleFactor() const { return myLineFactor; }
//! Set a multiplier for each bit in the line stipple pattern.
void SetLineStippleFactor (uint16_t theFactor)
{
if (theFactor == 0 || theFactor > 256)
{
throw Standard_OutOfRange ("Graphic3d_Aspects::SetLineStippleFactor(), bad factor value");
}
myLineFactor = theFactor;
}
//! Return width for edges in pixels; 1.0 by default.
Standard_ShortReal LineWidth() const { return myLineWidth; }
@@ -503,6 +516,7 @@ public:
&& myLineType == theOther.myLineType
&& myEdgeColor == theOther.myEdgeColor
&& myLineWidth == theOther.myLineWidth
&& myLineFactor == theOther.myLineFactor
&& myLinePattern == theOther.myLinePattern
&& myMarkerType == theOther.myMarkerType
&& myMarkerScale == theOther.myMarkerScale
@@ -548,6 +562,7 @@ protected:
Aspect_TypeOfLine myLineType;
Standard_ShortReal myLineWidth;
uint16_t myLineFactor;
uint16_t myLinePattern;
Aspect_TypeOfMarker myMarkerType;