//! Constructs a manipulator object with input location and positions of axes and all parts to be displayed.
Standard_EXPORT AIS_Manipulator (const gp_Ax2& thePosition);
- //! Destructor.
- Standard_EXPORT virtual ~AIS_Manipulator() {}
-
//! Disable or enable visual parts for translation, rotation or scaling for some axis.
//! By default all parts are enabled (will be displayed).
//! @warning Enabling or disabling of visual parts of manipulator does not manage the manipulation (selection) mode.
//! @warning Raises program error if axis index is < 0 or > 2.
Standard_EXPORT void SetPart (const Standard_Integer theAxisIndex, const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled);
+ //! Disable or enable visual parts for translation, rotation or scaling for ALL axes.
+ //! By default all parts are enabled (will be displayed).
+ //! @warning Enabling or disabling of visual parts of manipulator does not manage the manipulation (selection) mode.
+ //! @warning Raises program error if axis index is < 0 or > 2.
+ Standard_EXPORT void SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled);
+
//! Behavior settings to be applied when performing transformation:
//! - FollowTranslation - whether the manipulator will be moved together with an object.
//! - FollowRotation - whether the manipulator will be rotated together with an object.
//! @return true if manipulator is attached to some interactive object (has owning object).
Standard_Boolean IsAttached() const { return HasOwner(); }
- //! @return true if some part of manipulator is selected (tranformation mode is active, and owning object can be rtansformated).
+ //! @return true if some part of manipulator is selected (transformation mode is active, and owning object can be transformed).
Standard_Boolean HasActiveMode() const { return IsAttached() && myCurrentMode != AIS_MM_None; }
Standard_Boolean HasActiveTransformation() { return myHasStartedTransformation; }
- gp_Trsf StartTransformation() const { return myStartTrsfs.Size() < 1 ? gp_Trsf() : myStartTrsfs(1); }
+ gp_Trsf StartTransformation() const { return !myStartTrsfs.IsEmpty() ? myStartTrsfs.First() : gp_Trsf(); }
- gp_Trsf StartTransformation (const Standard_Integer theIndex) const
+ gp_Trsf StartTransformation (Standard_Integer theIndex) const
{
Standard_ProgramError_Raise_if (theIndex < 1 || theIndex > Objects()->Upper(),
"AIS_Manipulator::StartTransformation(): theIndex is out of bounds");
- return myStartTrsfs.Size() < 1 ? gp_Trsf() : myStartTrsfs (theIndex);
+ return !myStartTrsfs.IsEmpty() ? myStartTrsfs (theIndex) : gp_Trsf();
}
public: //! @name Configuration of graphical transformations
//! Redefines transform persistence management to setup transformation for sub-presentation of axes.
//! @warning this interactive object does not support custom transformation persistence when
//! using \sa ZoomPersistence mode. In this mode the transformation persistence flags for
- //! presentations are overriden by this class.
+ //! presentations are overridden by this class.
//! @warning Invokes debug assertion to catch incompatible usage of the method with \sa ZoomPersistence mode,
//! silently does nothing in release mode.
//! @warning revise use of AdjustSize argument of of \sa AttachToObjects method
public: //! @name Presentation computation
//! Fills presentation.
- //! @note Manipulator presentation does not use display mode and for all modes has the same presenatation.
+ //! @note Manipulator presentation does not use display mode and for all modes has the same presentation.
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode = 0) Standard_OVERRIDE;
//! Computes selection sensitive zones (triangulation) for manipulator.
- //! @param theNode [in] Seldction mode that is treated as transformation mode.
+ //! @param theNode [in] Selection mode that is treated as transformation mode.
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
- //! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overriden methods.
- Standard_EXPORT virtual Standard_Boolean IsAutoHilight() const Standard_OVERRIDE
+ //! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overridden methods.
+ virtual Standard_Boolean IsAutoHilight() const Standard_OVERRIDE
{
return Standard_False;
}
//! Method which hilight an owner belonging to
//! this selectable object ( for fast presentation draw ).
Standard_EXPORT virtual void HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Handle(Graphic3d_HighlightStyle)& theStyle,
+ const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner) Standard_OVERRIDE;
protected:
Standard_EXPORT virtual void setLocalTransformation (const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
using AIS_InteractiveObject::SetLocalTransformation; // hide visibility
-protected: //! @name Auxilliary classes to fill presentation with proper primitives
+protected: //! @name Auxiliary classes to fill presentation with proper primitives
class Quadric
{
Handle(Graphic3d_ArrayOfTriangles) myArray;
};
- class Cylinder : public Quadric
- {
- public:
-
- Cylinder()
- : Quadric(),
- myBottomRad(1.0f),
- myTopRad(1.0f),
- myHeight(1.0f)
- { }
-
- virtual ~Cylinder() {}
-
- void Init (const Standard_ShortReal theBotRad, const Standard_ShortReal theTopRad,
- const Standard_ShortReal theHeight,
- const Standard_Integer theSlicesNb, const Standard_Integer theStacksNb,
- const gp_Ax1& thePosition);
-
- protected:
-
- gp_Ax1 myPosition;
- Standard_ShortReal myBottomRad;
- Standard_ShortReal myTopRad;
- Standard_ShortReal myHeight;
- };
-
class Disk : public Quadric
{
public:
const Quantity_Color& theColor = Quantity_Color(),
const Standard_ShortReal theLength = 10.0f);
- void Compute (const Handle_PrsMgr_PresentationManager3d& thePrsMgr,
+ void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Handle(Prs3d_ShadingAspect)& theAspect);
const Handle(Graphic3d_Group)& ScalerGroup() const { return myScalerGroup; }
+ const Handle(Graphic3d_ArrayOfTriangles)& TriangleArray() const { return myTriangleArray; }
+
void SetIndent (const Standard_ShortReal theValue) { myIndent = theValue; }
Standard_ShortReal Size() const { return myLength + myBoxSize + myDiskThickness + myIndent * 2.0f; }
public:
- const Cylinder& TranslatorCylinder() const { return myCylinder; }
- const Cylinder& TranslatorArrow() const { return myArrow; }
const gp_Pnt& TranslatorTipPosition() const { return myArrowTipPos; }
- const Disk& TranslatorArrowBottom() const { return myArrowBottom; }
const Disk& RotatorDisk() const { return myCircle; }
float RotatorDiskRadius() const { return myCircleRadius; }
const Cube& ScalerCube() const { return myCube; }
Standard_Integer myFacettesNumber;
- Cylinder myCylinder;
- Cylinder myArrow;
gp_Pnt myArrowTipPos;
- Disk myArrowBottom;
Disk myCircle;
float myCircleRadius;
Cube myCube;
Handle(Prs3d_Presentation) myHighlightTranslator;
Handle(Prs3d_Presentation) myHighlightScaler;
Handle(Prs3d_Presentation) myHighlightRotator;
+
+ Handle(Graphic3d_ArrayOfTriangles) myTriangleArray;
+
};
protected:
Axis myAxes[3]; //!< Tree axes of the manipulator.
Sphere myCenter; //!< Visual part displaying the center sphere of the manipulator.
- gp_Ax2 myPosition; //!< Position of the manipualtor object. it displayes its location and position of its axes.
+ gp_Ax2 myPosition; //!< Position of the manipulator object. it displays its location and position of its axes.
Standard_Integer myCurrentIndex; //!< Index of active axis.
- AIS_ManipulatorMode myCurrentMode; //!< Name of active manipualtion mode.
+ AIS_ManipulatorMode myCurrentMode; //!< Name of active manipulation mode.
Standard_Boolean myIsActivationOnDetection; //!< Manual activation of modes (not on parts selection).
Standard_Boolean myIsZoomPersistentMode; //!< Zoom persistence mode activation.
BehaviorOnTransform myBehaviorOnTransform; //!< Behavior settings applied on manipulator when transforming an object.
-protected: //! @name Fields for interactive trnasformation. Fields only for internal needs. They do not have public interface.
+protected: //! @name Fields for interactive transformation. Fields only for internal needs. They do not have public interface.
NCollection_Sequence<gp_Trsf> myStartTrsfs; //!< Owning object transformation for start. It is used internally.
Standard_Boolean myHasStartedTransformation; //!< Shows if transformation is processed (sequential calls of Transform()).
gp_Pnt myStartPick; //! 3d point corresponding to start mouse pick.
Standard_Real myPrevState; //! Previous value of angle during rotation.
- //! Aspect used to colour current detected part and current selected part.
+ //! Aspect used to color current detected part and current selected part.
Handle(Prs3d_ShadingAspect) myHighlightAspect;
public: