Prs3d_DatumAspect::DrawDatumPart() now handles new flag ToDrawArrows().
vtrihedron - added new option -arrowTip.
Fixed misprint in command description -arrowscolor -> -arrowcolor.
if (myDrawer->Link().IsNull())
return;
+ myDrawer->DatumAspect()->SetDrawArrows (myDrawer->Link()->DatumAspect()->ToDrawArrows());
+ myDrawer->DatumAspect()->SetDrawLabels (myDrawer->Link()->DatumAspect()->ToDrawLabels());
*myDrawer->DatumAspect()->TextAspect()->Aspect() =
*myDrawer->Link()->DatumAspect()->TextAspect()->Aspect();
*myDrawer->DatumAspect()->PointAspect()->Aspect() =
anAxisGroup->AddPrimitiveArray (arrayOfPrimitives (aPart));
// draw arrow
- Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
- anArrowGroup->SetPrimitivesAspect (anAspect->ArrowAspect()->Aspect());
-
Prs3d_DatumParts anArrowPart = anAspect->ArrowPartForAxis (aPart);
if (!anAspect->DrawDatumPart (anArrowPart))
{
continue;
}
+
+ Handle(Graphic3d_Group) anArrowGroup = Prs3d_Root::NewGroup (thePrs);
+ anArrowGroup->SetGroupPrimitivesAspect (anAspect->ArrowAspect()->Aspect());
anArrowGroup->AddPrimitiveArray (arrayOfPrimitives (anArrowPart));
}
}
}
}
+//=======================================================================
+//function : ToDrawArrows
+//purpose :
+//=======================================================================
+Standard_Boolean AIS_Trihedron::ToDrawArrows() const
+{
+ return myDrawer->DatumAspect()->ToDrawArrows();
+}
+
+//=======================================================================
+//function : SetDrawArrows
+//purpose :
+//=======================================================================
+void AIS_Trihedron::SetDrawArrows (const Standard_Boolean theToDraw)
+{
+ setOwnDatumAspect();
+ myDrawer->DatumAspect()->SetDrawArrows (theToDraw);
+}
+
//=======================================================================
//function : createSensitiveEntity
//purpose :
//! Standard_DEPRECATED("This method is deprecated - SetColor() should be called instead")
Standard_EXPORT void SetAxisColor (const Quantity_Color& theColor);
+ //! Returns true if arrows are to be drawn
+ Standard_EXPORT Standard_Boolean ToDrawArrows() const;
+
+ //! Sets whether to draw the arrows in visualization
+ Standard_EXPORT void SetDrawArrows (const Standard_Boolean theToDraw);
+
//! Sets priority of selection for owner of the given type
void SetSelectionPriority (Prs3d_DatumParts thePart,
Standard_Integer thePriority)
// =======================================================================
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);
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)
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;
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;
if (aMapOfArgs.Find ("hidelabels", aValues))
{
- if (aValues->Size() == 0)
+ Standard_Boolean toHideLabels = Standard_True;
+ if (aValues->Size() == 1)
+ {
+ ViewerTest::ParseOnOff (aValues->First().ToCString(), toHideLabels);
+ }
+ else if (aValues->Size() != 0)
{
std::cout << "Syntax error: -hidelabels expects parameter 'on' or 'off' after.\n";
return Standard_False;
}
- Standard_Boolean toHideLabels = Standard_True;
- ViewerTest::ParseOnOff (aValues->Value (1).ToCString(), toHideLabels);
if (!theTrihedron->Attributes()->HasOwnDatumAspect())
- theTrihedron->Attributes()->SetDatumAspect(new Prs3d_DatumAspect());
- theTrihedron->Attributes()->DatumAspect()->SetToDrawLabels (!toHideLabels);
+ {
+ theTrihedron->Attributes()->SetDatumAspect (new Prs3d_DatumAspect());
+ }
+ theTrihedron->Attributes()->DatumAspect()->SetDrawLabels (!toHideLabels);
+ }
+
+ if (aMapOfArgs.Find ("hidearrows", aValues))
+ {
+ Standard_Boolean toHideArrows = Standard_True;
+ if (aValues->Size() == 1)
+ {
+ ViewerTest::ParseOnOff (aValues->First().ToCString(), toHideArrows);
+ }
+ else if (aValues->Size() != 0)
+ {
+ std::cout << "Syntax error: -hidearrows expects parameter 'on' or 'off' after.\n";
+ return Standard_False;
+ }
+
+ if (!theTrihedron->Attributes()->HasOwnDatumAspect())
+ {
+ theTrihedron->Attributes()->SetDatumAspect (new Prs3d_DatumAspect());
+ }
+ theTrihedron->Attributes()->DatumAspect()->SetDrawArrows (!toHideArrows);
}
if (aMapOfArgs.Find ("color", aValues))
"\n\t\t: [-dispMode {wireframe|shading} ]"
"\n\t\t: [-origin x y z ]"
"\n\t\t: [-zaxis u v w -xaxis u v w ]"
- "\n\t\t: [-drawaxes {X|Y|Z|XY|YZ|XZ|XYZ}]"
- "\n\t\t: [-hidelabels {on|off}]"
+ "\n\t\t: [-drawAxes {X|Y|Z|XY|YZ|XZ|XYZ}]"
+ "\n\t\t: [-hideLabels {on|off}]"
+ "\n\t\t: [-hideArrows {on|off}]"
"\n\t\t: [-label {XAxis|YAxis|ZAxis} value]"
"\n\t\t: [-attribute {XAxisLength|YAxisLength|ZAxisLength"
"\n\t\t: |TubeRadiusPercent|ConeRadiusPercent"
"\n\t\t: |ShadingNumberOfFacettes} value]"
"\n\t\t: [-color {Origin|XAxis|YAxis|ZAxis|XOYAxis|YOZAxis"
"\n\t\t: |XOZAxis|Whole} {r g b | colorName}]"
- "\n\t\t: [-textcolor {r g b | colorName}]"
- "\n\t\t: [-arrowscolor {r g b | colorName}]"
+ "\n\t\t: [-textColor {r g b | colorName}]"
+ "\n\t\t: [-arrowColor {r g b | colorName}]"
"\n\t\t: [-priority {Origin|XAxis|YAxis|ZAxis|XArrow"
"\n\t\t: |YArrow|ZArrow|XOYAxis|YOZAxis"
"\n\t\t: |XOZAxis|Whole} value]"
"\n\t\t: -zaxis/-xaxis allows to set trihedron X and Z"
"\n\t\t: directions. The directions should"
"\n\t\t: be orthogonal. Y direction is calculated."
- "\n\t\t: -drawaxes allows to set what axes are drawn in the"
+ "\n\t\t: -drawAxes allows to set what axes are drawn in the"
"\n\t\t: trihedron, default state is XYZ"
- "\n\t\t: -hidelabels allows to hide or show trihedron labels"
+ "\n\t\t: -hideLabels allows to show/hide trihedron labels"
+ "\n\t\t: -hideArrows allows to show/hide trihedron arrows"
"\n\t\t: -labels allows to change default X/Y/Z titles of axes"
"\n\t\t: -attribute sets parameters of trihedron"
"\n\t\t: -color sets color properties of parts of trihedron"
- "\n\t\t: -textcolor sets color properties of trihedron labels"
- "\n\t\t: -arrowscolor sets color properties of trihedron arrows"
+ "\n\t\t: -textColor sets color properties of trihedron labels"
+ "\n\t\t: -arrowColor sets color properties of trihedron arrows"
"\n\t\t: -priority allows to change default selection priority"
"\n\t\t: of trihedron components",
__FILE__,VTrihedron,group);
vselmode t1 2 1
vselmode t1 3 1
-vtrihedron t1 -dispmode shading
+vtrihedron t1 -dispMode shading
vtrihedron t1 -origin -200 -200 -300
vtrihedron t1 -attribute XAxisLength|YAxisLength|ZAxisLength 80
vtrihedron t1 -xaxis 40 60 120 -zaxis -120 0 40
vtrihedron t1 -color YAxis Quantity_NOC_GREEN
vtrihedron t1 -color ZAxis|Origin Quantity_NOC_BLUE1
-vtrihedron t1 -textcolor 1.0 1.0 1.0
-vtrihedron t1 -arrowcolor 0.0 0.0 1.0
+vtrihedron t1 -textColor 1.0 1.0 1.0
+vtrihedron t1 -arrowColor 0.0 0.0 1.0
vtrihedron t2 -origin 0 0 -300
vtrihedron t2 -color Whole Quantity_NOC_PEACHPUFF
vselmode t2 2 1
vselmode t2 3 1
-vtrihedron t3 -dispmode shading -origin 200 200 -300 -color Whole 1.0 0.0 0.0
-vtrihedron t3 -drawaxes XY -hidelabels on
+vtrihedron t3 -dispMode shading -origin 200 200 -300 -color Whole 1.0 0.0 0.0
+vtrihedron t3 -drawAxes XY -hideLabels on
+
+vtrihedron t4 -origin -200 -200 300 -hideArrows
vfit