AIS_ViewCube has been extended by additional properties (previously hard-coded):
- radius of axes of the trihedron
- radius of cones of the axes of the trihedron
- radius of a sphere (central point) of the trihedron
ViewerTest command vviewcube has been extended to support new parameters:
-axesradius, -axesconeradius, -axessphereradius.
myBoxEdgeGap (0.0),
myBoxFacetExtension (1.0),
myAxesPadding (1.0),
+ myAxesRadius (1.0),
+ myAxesConeRadius (3.0),
+ myAxesSphereRadius (4.0),
myCornerMinSize (2.0),
myRoundRadius (0.0),
myToDisplayAxes (true),
anAxisGroup->SetGroupPrimitivesAspect (aDatumAspect->ShadingAspect (aPart)->Aspect());
const Standard_Real anArrowLength = 0.2 * anAxisSize;
- Handle(Graphic3d_ArrayOfTriangles) aTriangleArray = Prs3d_Arrow::DrawShaded (anAx1, 1.0, anAxisSize, 3.0, anArrowLength, THE_NB_ARROW_FACETTES);
+ Handle(Graphic3d_ArrayOfTriangles) aTriangleArray = Prs3d_Arrow::DrawShaded (anAx1, myAxesRadius, anAxisSize, myAxesConeRadius, anArrowLength, THE_NB_ARROW_FACETTES);
anAxisGroup->AddPrimitiveArray (aTriangleArray);
TCollection_AsciiString anAxisLabel;
Handle(Prs3d_ShadingAspect) anAspectCen = new Prs3d_ShadingAspect();
anAspectCen->SetColor (Quantity_NOC_WHITE);
aGroup->SetGroupPrimitivesAspect (anAspectCen->Aspect());
- Prs3d_ToolSphere aTool (4.0, THE_NB_DISK_SLICES, THE_NB_DISK_SLICES);
+ Prs3d_ToolSphere aTool (myAxesSphereRadius, THE_NB_DISK_SLICES, THE_NB_DISK_SLICES);
gp_Trsf aTrsf;
aTrsf.SetTranslation (gp_Vec (gp::Origin(), aLocation));
Handle(Graphic3d_ArrayOfTriangles) aCenterArray;
//! The value should be within [0, 0.5] range.
Standard_EXPORT void SetRoundRadius (const Standard_Real theValue);
+ //! Returns radius of axes of the trihedron; 1.0 by default.
+ Standard_Real AxesRadius() const { return myAxesRadius; }
+
+ //! Sets radius of axes of the trihedron.
+ void SetAxesRadius (const Standard_Real theRadius)
+ {
+ if (Abs (myAxesRadius - theRadius) > Precision::Confusion())
+ {
+ myAxesRadius = theRadius;
+ SetToUpdate();
+ }
+ }
+
+ //! Returns radius of cone of axes of the trihedron; 3.0 by default.
+ Standard_Real AxesConeRadius() const { return myAxesConeRadius; }
+
+ //! Sets radius of cone of axes of the trihedron.
+ void SetAxesConeRadius (Standard_Real theRadius)
+ {
+ if (Abs (myAxesConeRadius - theRadius) > Precision::Confusion())
+ {
+ myAxesConeRadius = theRadius;
+ SetToUpdate();
+ }
+ }
+
+ //! Returns radius of sphere (central point) of the trihedron; 4.0 by default.
+ Standard_Real AxesSphereRadius() const { return myAxesSphereRadius; }
+
+ //! Sets radius of sphere (central point) of the trihedron.
+ void SetAxesSphereRadius (Standard_Real theRadius)
+ {
+ if (Abs (myAxesSphereRadius - theRadius) > Precision::Confusion())
+ {
+ myAxesSphereRadius = theRadius;
+ SetToUpdate();
+ }
+ }
+
//! @return TRUE if trihedron is drawn; TRUE by default.
Standard_Boolean ToDrawAxes() const { return myToDisplayAxes; }
Standard_Real myBoxEdgeGap; //!< gap between box side and box edge
Standard_Real myBoxFacetExtension; //!< box facet extension
Standard_Real myAxesPadding; //!< Padding between box and axes
+ Standard_Real myAxesRadius; //!< radius of axes of the trihedron; 1.0 by default
+ Standard_Real myAxesConeRadius; //!< radius of cone of axes of the trihedron; 3.0 by default
+ Standard_Real myAxesSphereRadius; //!< radius of sphere (central point) of the trihedron; 4.0 by default
Standard_Real myCornerMinSize; //!< minimal size of box corner
Standard_Real myRoundRadius; //!< relative round radius within [0; 0.5] range
Standard_Boolean myToDisplayAxes; //!< trihedron visibility
{
aViewCube->SetDuration (Draw::Atof (theArgVec[++anArgIter]));
}
+ else if (anArgIter + 1 < theNbArgs
+ && anArg == "-axesradius")
+ {
+ aViewCube->SetAxesRadius (Draw::Atof (theArgVec[++anArgIter]));
+ }
+ else if (anArgIter + 1 < theNbArgs
+ && anArg == "-axesconeradius")
+ {
+ aViewCube->SetAxesConeRadius (Draw::Atof (theArgVec[++anArgIter]));
+ }
+ else if (anArgIter + 1 < theNbArgs
+ && anArg == "-axessphereradius")
+ {
+ aViewCube->SetAxesSphereRadius (Draw::Atof (theArgVec[++anArgIter]));
+ }
else
{
std::cout << "Syntax error: unknown argument '" << anArg << "'\n";
"\n\t\t: -boxCornerMinSize Value minimal box corner size"
"\n\t\t: -axesPadding Value padding between box and arrows"
"\n\t\t: -roundRadius Value relative radius of corners of sides within [0.0, 0.5] range"
+ "\n\t\t: -axesRadius Value radius of axes of the trihedron"
+ "\n\t\t: -axesConeRadius Value radius of the cone (arrow) of the trihedron"
+ "\n\t\t: -axesSphereRadius Value radius of the sphere (central point) of trihedron"
"\n\t\t: -fixedanimation {0|1} uninterruptible animation loop"
"\n\t\t: -duration Seconds animation duration in seconds",
__FILE__, VViewCube, group);