mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0029109: Visualization, AIS_Trihedron - add option hiding arrows tips
Prs3d_DatumAspect::DrawDatumPart() now handles new flag ToDrawArrows(). vtrihedron - added new option -arrowTip. Fixed misprint in command description -arrowscolor -> -arrowcolor.
This commit is contained in:
@@ -22,9 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
|
||||
// =======================================================================
|
||||
Prs3d_DatumAspect::Prs3d_DatumAspect()
|
||||
: myAxes (Prs3d_DA_XYZAxis),
|
||||
myToDrawLabels (Standard_True)
|
||||
myToDrawLabels (Standard_True),
|
||||
myToDrawArrows (Standard_True)
|
||||
{
|
||||
Standard_Real aDefaultLength = 100.0; // default axis lenght, the same as in context
|
||||
Standard_Real aDefaultLength = 100.0; // default axis length, the same as in context
|
||||
Quantity_Color aDefaultColor(Quantity_NOC_LIGHTSTEELBLUE4); // default axis color
|
||||
|
||||
myAttributes.Bind (Prs3d_DA_XAxisLength, aDefaultLength);
|
||||
@@ -118,12 +119,12 @@ bool Prs3d_DatumAspect::DrawDatumPart (Prs3d_DatumParts thePart) const
|
||||
switch (thePart)
|
||||
{
|
||||
case Prs3d_DP_Origin: return true;
|
||||
case Prs3d_DP_XAxis:
|
||||
case Prs3d_DP_XArrow: return (myAxes & Prs3d_DA_XAxis) != 0;
|
||||
case Prs3d_DP_YAxis:
|
||||
case Prs3d_DP_YArrow: return (myAxes & Prs3d_DA_YAxis) != 0;
|
||||
case Prs3d_DP_ZAxis:
|
||||
case Prs3d_DP_ZArrow: return (myAxes & Prs3d_DA_ZAxis) != 0;
|
||||
case Prs3d_DP_XAxis: return (myAxes & Prs3d_DA_XAxis) != 0;
|
||||
case Prs3d_DP_XArrow: return (myAxes & Prs3d_DA_XAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DP_YAxis: return (myAxes & Prs3d_DA_YAxis) != 0;
|
||||
case Prs3d_DP_YArrow: return (myAxes & Prs3d_DA_YAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DP_ZAxis: return (myAxes & Prs3d_DA_ZAxis) != 0;
|
||||
case Prs3d_DP_ZArrow: return (myAxes & Prs3d_DA_ZAxis) != 0 && myToDrawArrows;
|
||||
case Prs3d_DP_XOYAxis: return DrawDatumPart (Prs3d_DP_XAxis)
|
||||
&& DrawDatumPart (Prs3d_DP_YAxis);
|
||||
case Prs3d_DP_YOZAxis: return DrawDatumPart (Prs3d_DP_YAxis)
|
||||
|
@@ -128,11 +128,18 @@ public:
|
||||
Standard_DEPRECATED("This method is deprecated - AxisLength() should be called instead")
|
||||
Standard_Real ThirdAxisLength() const { return myAttributes.Find (Prs3d_DA_ZAxisLength); }
|
||||
|
||||
//! @return true if axes labels are drawn; TRUE by default.
|
||||
Standard_Boolean ToDrawLabels() const { return myToDrawLabels; }
|
||||
|
||||
//! Sets option to draw or not to draw text labels for axes
|
||||
void SetDrawLabels (Standard_Boolean theToDraw) { myToDrawLabels = theToDraw; }
|
||||
void SetToDrawLabels (Standard_Boolean theToDraw) { myToDrawLabels = theToDraw; }
|
||||
|
||||
//! @return true if axes labels are drawn
|
||||
Standard_Boolean ToDrawLabels() const { return myToDrawLabels; }
|
||||
//! @return true if axes arrows are drawn; TRUE by default.
|
||||
Standard_Boolean ToDrawArrows() const { return myToDrawArrows; }
|
||||
|
||||
//! Sets option to draw or not arrows for axes
|
||||
void SetDrawArrows (Standard_Boolean theToDraw) { myToDrawArrows = theToDraw; }
|
||||
|
||||
//! Returns type of arrow for a type of axis
|
||||
Standard_EXPORT Prs3d_DatumParts ArrowPartForAxis (Prs3d_DatumParts thePart) const;
|
||||
@@ -140,6 +147,7 @@ public:
|
||||
private:
|
||||
Prs3d_DatumAxes myAxes;
|
||||
Standard_Boolean myToDrawLabels;
|
||||
Standard_Boolean myToDrawArrows;
|
||||
NCollection_DataMap<Prs3d_DatumAttribute, Standard_Real> myAttributes;
|
||||
|
||||
NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_ShadingAspect)> myShadedAspects;
|
||||
|
Reference in New Issue
Block a user