QCAD
Open Source 2D CAD
RSnap Class Referenceabstract

Abstract base class for all grid and object snap implementations. More...

#include <RSnap.h>

Inheritance diagram for RSnap:
RSnapAuto RSnapCoordinate RSnapEntityBase RSnapFree RSnapGrid RSnapIntersection RSnapCoordinatePolar RSnapCenter RSnapDistance RSnapEnd RSnapMiddle RSnapOnEntity RSnapPerpendicular RSnapReference

Public Types

enum  Status {
  Unknown, Free, Grid, Endpoint,
  OnEntity, Center, Middle, Distance,
  Intersection, IntersectionManual, Reference, Perpendicular,
  Coordinate, CoordinatePolar
}
 Snap status, returned by snap tools (most importantly auto snap tool) to indicate what snap was used. More...
 

Public Member Functions

QSet< REntity::IdgetEntityIds ()
 
RVector getLastSnap () const
 
RSnap::Status getStatus () const
 
virtual void hideUiOptions ()
 
void reset ()
 
 RSnap ()
 
virtual void showUiOptions ()
 
virtual RVector snap (const RVector &position, RGraphicsView &view, double range=RNANDOUBLE)=0
 
virtual RVector snap (RMouseEvent &event)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual ~RSnap ()
 

Protected Attributes

QSet< REntity::IdentityIds
 
RVector lastSnap
 
RSnap::Status status
 

Detailed Description

Abstract base class for all grid and object snap implementations.

A snap class implements an object or grid snap tool. For example to snap to end points of objects.

Scriptable:
This class is available in script environments.

Constructor & Destructor Documentation

RSnap::RSnap ( )
inline
virtual RSnap::~RSnap ( )
inlinevirtual

Member Function Documentation

QSet<REntity::Id> RSnap::getEntityIds ( )
inline
Returns
Set of entity IDs that are relevant for the last performed snap, usually used for highlighting.
RVector RSnap::getLastSnap ( ) const
inline
RSnap::Status RSnap::getStatus ( ) const
inline
virtual void RSnap::hideUiOptions ( )
inlinevirtual
void RSnap::reset ( )
inline
virtual void RSnap::showUiOptions ( )
inlinevirtual
virtual RVector RSnap::snap ( const RVector position,
RGraphicsView view,
double  range = RNANDOUBLE 
)
pure virtual
Returns
The snapped position (closest relevant position) for the given mouse position.

Implemented in RSnapIntersection, RSnapAuto, RSnapEntityBase, RSnapFree, and RSnapGrid.

virtual RVector RSnap::snap ( RMouseEvent event)
inlinevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Non-Scriptable:
This function is not available in script environments.

Member Data Documentation

QSet<REntity::Id> RSnap::entityIds
protected
RVector RSnap::lastSnap
protected
RSnap::Status RSnap::status
protected

The documentation for this class was generated from the following file: