// TODO SdrCrookMode::Stretch is not implemented yet! enumclass SdrCrookMode {
Rotate,
Slant,
Stretch
};
// #114409#-1 Migrate PageOrigin
class SVXCORE_DLLPUBLIC SdrSnapView : public SdrPaintView
{ protected: // #114409#-1 Migrate PageOrigin class ImplPageOriginOverlay* mpPageOriginOverlay;
// #114409#-2 Migrate HelpLine class ImplHelpLineOverlay* mpHelpLineOverlay;
protected: // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
SdrSnapView(
SdrModel& rSdrModel,
OutputDevice* pOut);
// RecalcLogicSnapMagnetic has to be called for every change of OutputDevices and every change of the MapMode! void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(mnMagnSizPix,mnMagnSizPix))); } void SetActualWin(const OutputDevice* pWin) { SdrPaintView::SetActualWin(pWin); if (pWin!=nullptr) RecalcLogicSnapMagnetic(*pWin); }
// Coordinates referred to the view! // Returnvalues are SdrSnap::NOTSNAPPED,SdrSnap::XSNAPPED, // SdrSnap::YSNAPPED or SdrSnap::XYSNAPPED
SdrSnap SnapPos(Point& rPnt, const SdrPageView* pPV) const;
Point GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const; void CheckSnap(const Point& rPt, tools::Long& nBestXSnap, tools::Long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const;
// All attitudes to snap are persistent. bool IsSnapEnabled() const { return mbSnapEnab; } bool IsGridSnap() const { return mbGridSnap; } // Snap to grid bool IsBordSnap() const { return mbBordSnap; } // Snap to border bool IsHlplSnap() const { return mbHlplSnap; } // Snap to auxiliary line bool IsOFrmSnap() const { return mbOFrmSnap; } // Snap to LogFram from surrounding drawing objects bool IsOPntSnap() const { return mbOPntSnap; } // Snap to distinct points from surrounding drawing objects bool IsOConSnap() const { return mbOConSnap; } // Snap to connectors of the drawing objects void SetSnapEnabled(bool bOn) { mbSnapEnab=bOn; } void SetGridSnap(bool bOn) { mbGridSnap=bOn; } void SetBordSnap(bool bOn) { mbBordSnap=bOn; } void SetHlplSnap(bool bOn) { mbHlplSnap=bOn; } void SetOFrmSnap(bool bOn) { mbOFrmSnap=bOn; } void SetOPntSnap(bool bOn) { mbOPntSnap=bOn; } void SetOConSnap(bool bOn) { mbOConSnap=bOn; }
// Usually every 4 corners of Object-SnapRects are snapped for Move-Dragging. // The following attitudes e.g. if you only want to snap the left corner on the top (e.g. DialogEditor) // persistent, Default=FALSE. void SetMoveSnapOnlyTopLeft(bool bOn) { mbMoveSnapOnlyTopLeft=bOn; } bool IsMoveSnapOnlyTopLeft() const { return mbMoveSnapOnlyTopLeft; }
// HitTest. If sal_True, in rnHelpLineNum is the number of the auxiliary line and in rpPv // the appended PageView. bool PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const;
// Move of an available auxiliary line. Use nHelpLineNum and pPV from PickHelpLine. bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV); // interactive insertion of a new auxiliary line void BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind);
PointerStyle GetDraggedHelpLinePointer() const;
// change the type of auxiliary line while dragging // void SetDraggedHelpLineKind(SdrHelpLineKind eNewKind); void MovDragHelpLine(const Point& rPnt); bool EndDragHelpLine(); void BrkDragHelpLine(); bool IsDragHelpLine() const { return (nullptr != mpHelpLineOverlay); }
// SnapAngle is for angles in circle, RotateDragging, ... // The snapping of an angle is beared down, if it is switched off // with SetAngleSnapEnabled(sal_False) // The snapping angles is independent of snapping coordinates // and so independent of the attitude IsSnapEnabled() // Only values should be specified for them is applied: // 36000 modulo nAngle = 0 // Implemented for: // - Rotate (Dragging) // - Shear (Dragging) // - circular arc/-sector/-section angle (Create and Dragging) // persistent. void SetAngleSnapEnabled(bool bOn) { mbAngleSnapEnab=bOn; } bool IsAngleSnapEnabled() const { return mbAngleSnapEnab; } void SetSnapAngle(Degree100 nAngle) { mnSnapAngle=nAngle; }
Degree100 GetSnapAngle() const { return mnSnapAngle; }
// different effects from Ortho (depending on the context): // - Create // - only lines in 45deg grid // - instead of rectangles squares are created // - instead of ellipse circles are created // - Dragging // - general Dragging // - Move only horizontal, vertical or 45deg // - Resize proportional // - Mirror: nothing // - Shear without Resize // - Crook without Resize // - move handles // - mirror axis only 45deg grid // - object-specific Dragging // - rectangle corner radius: nothing // - circle object angle: nothing // - line keeps while Dragging the angle and is only stretched/ contracted // Default value for Ortho is off. persistent. void SetOrtho(bool bOn) { mbOrtho=bOn; } // incomplete bool IsOrtho() const { return mbOrtho; }
// BigOrtho is only relevant if Ortho is switched on. // Example: rectangle is created and ortho is switched on (--> square) // and the Mouse was dragged from zero to the coordinates // (80,30). Now there are 2 alternatives to determine the edge length // of the square: 30 and 80. // The standard Ortho-Function took 30 (every time the smaller length) // If BigOrtho is switched on, you get a square with edge length of 80. // The same also applies to Resize. // Default value for BigOrtho is on. persistent. void SetBigOrtho(bool bOn) { mbBigOrtho=bOn; } bool IsBigOrtho() const { return mbBigOrtho; }
// If MoveOnlyDragging=sal_True only the center of the marked objects is // transformed when Resize/Rotate/Shear/Mirror/Crook is executed. // Size, form and rotation angle of the objects are conserved only their positions // are changed. persistent. Default=FALSE. (ni) void SetMoveOnlyDragging(bool bOn) { mbMoveOnlyDragging=bOn; } bool IsMoveOnlyDragging() const { return mbMoveOnlyDragging; }
// Special for IBM: While Dragging of a traverse station, it is deleted // if its adjacent lines are almost a solid line. void SetEliminatePolyPoints(bool bOn) { mbEliminatePolyPoints=bOn; } bool IsEliminatePolyPoints() const { return mbEliminatePolyPoints; } void SetEliminatePolyPointLimitAngle(Degree100 nAngle) { mnEliminatePolyPointLimitAngle=nAngle; }
Degree100 GetEliminatePolyPointLimitAngle() const { return mnEliminatePolyPointLimitAngle; }
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.