QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RSnapAuto Class Reference

Auto snapper implementation. More...

#include <RSnapAuto.h>

Inheritance diagram for RSnapAuto:
RSnap

Public Types

enum  Mode {
  None = 0x0000 , Intersections = 0x0001 , EndPoints = 0x0002 , MiddlePoints = 0x0004 ,
  CenterPoints = 0x0008 , PerpendicularPoints = 0x0010 , TangentialPoints = 0x0020 , ReferencePoints = 0x0040 ,
  GridPoints = 0x0080 , PointsOnEntity = 0x0100 , FreePositioning = 0x0200
}
 
- Public Types inherited from RSnap
enum  Status {
  Unknown = 0 , Free = 1 , Grid = 2 , Endpoint = 3 ,
  OnEntity = 4 , Center = 5 , Middle = 6 , Distance = 7 ,
  Intersection = 8 , IntersectionManual = 9 , Reference = 10 , Perpendicular = 11 ,
  Tangential = 12 , Coordinate = 13 , CoordinatePolar = 14
}
 Snap status, returned by snap tools (most importantly auto snap tool) to indicate what snap was used. More...
 

Public Member Functions

virtual void reset ()
 
 RSnapAuto ()
 
virtual RVector snap (const RVector &position, RGraphicsView &view, double range=RNANDOUBLE)
 
virtual ~RSnapAuto ()
 
- Public Member Functions inherited from RSnap
virtual void finishEvent ()
 
QList< RObject::IdgetEntityIds ()
 
RVector getLastSnap () const
 
RSnap::Status getStatus () const
 
virtual void hideUiOptions ()
 
 RSnap (RSnap::Status s=RSnap::Unknown)
 
void setLastSnap (const RVector &v)
 
void setStatus (RSnap::Status s)
 
virtual void showUiOptions ()
 
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.
 
virtual void suspendEvent ()
 
 ~RSnap ()
 

Static Public Member Functions

static bool getCenterPoints ()
 
static bool getEndPoints ()
 
static bool getFreePositioning ()
 
static bool getGridPoints ()
 
static bool getIntersections ()
 
static bool getMiddlePoints ()
 
static bool getMode (RSnapAuto::Mode mode)
 
static RSnapAuto::Modes getModes ()
 
static bool getPerpendicular ()
 
static bool getPointsOnEntity ()
 
static bool getReferencePoints ()
 
static bool getTangential ()
 
static void init (bool force=false)
 
static void setCenterPoints (bool on)
 
static void setEndPoints (bool on)
 
static void setFreePositioning (bool on)
 
static void setGridPoints (bool on)
 
static void setIntersections (bool on)
 
static void setMiddlePoints (bool on)
 
static void setMode (RSnapAuto::Mode mode, bool on)
 
static void setModes (RSnapAuto::Modes m)
 
static void setPerpendicular (bool on)
 
static void setPointsOnEntity (bool on)
 
static void setReferencePoints (bool on)
 
static void setTangential (bool on)
 

Static Private Attributes

static bool initialized = false
 Copyright (c) 2011-2018 by Andrew Mustun.
 
static Modes modes = RSnapAuto::None
 

Additional Inherited Members

- Protected Attributes inherited from RSnap
QList< RObject::IdentityIds
 
RVector lastSnap
 
RSnap::Status status
 

Detailed Description

Auto snapper implementation.

Scriptable:\nThis class is available in script environments.\n

Member Enumeration Documentation

◆ Mode

Enumerator
None 
Intersections 
EndPoints 
MiddlePoints 
CenterPoints 
PerpendicularPoints 
TangentialPoints 
ReferencePoints 
GridPoints 
PointsOnEntity 
FreePositioning 

Constructor & Destructor Documentation

◆ RSnapAuto()

RSnapAuto::RSnapAuto ( )
inline

◆ ~RSnapAuto()

virtual RSnapAuto::~RSnapAuto ( )
inlinevirtual

Member Function Documentation

◆ getCenterPoints()

static bool RSnapAuto::getCenterPoints ( )
inlinestatic

◆ getEndPoints()

static bool RSnapAuto::getEndPoints ( )
inlinestatic

◆ getFreePositioning()

static bool RSnapAuto::getFreePositioning ( )
inlinestatic

◆ getGridPoints()

static bool RSnapAuto::getGridPoints ( )
inlinestatic

◆ getIntersections()

static bool RSnapAuto::getIntersections ( )
inlinestatic

◆ getMiddlePoints()

static bool RSnapAuto::getMiddlePoints ( )
inlinestatic

◆ getMode()

static bool RSnapAuto::getMode ( RSnapAuto::Mode mode)
inlinestatic

◆ getModes()

static RSnapAuto::Modes RSnapAuto::getModes ( )
inlinestatic

◆ getPerpendicular()

static bool RSnapAuto::getPerpendicular ( )
inlinestatic

◆ getPointsOnEntity()

static bool RSnapAuto::getPointsOnEntity ( )
inlinestatic

◆ getReferencePoints()

static bool RSnapAuto::getReferencePoints ( )
inlinestatic

◆ getTangential()

static bool RSnapAuto::getTangential ( )
inlinestatic

◆ init()

void RSnapAuto::init ( bool force = false)
static

◆ reset()

virtual void RSnapAuto::reset ( )
inlinevirtual

Reimplemented from RSnap.

◆ setCenterPoints()

static void RSnapAuto::setCenterPoints ( bool on)
inlinestatic

◆ setEndPoints()

static void RSnapAuto::setEndPoints ( bool on)
inlinestatic

◆ setFreePositioning()

static void RSnapAuto::setFreePositioning ( bool on)
inlinestatic

◆ setGridPoints()

static void RSnapAuto::setGridPoints ( bool on)
inlinestatic

◆ setIntersections()

static void RSnapAuto::setIntersections ( bool on)
inlinestatic

◆ setMiddlePoints()

static void RSnapAuto::setMiddlePoints ( bool on)
inlinestatic

◆ setMode()

static void RSnapAuto::setMode ( RSnapAuto::Mode mode,
bool on )
inlinestatic

◆ setModes()

static void RSnapAuto::setModes ( RSnapAuto::Modes m)
inlinestatic

◆ setPerpendicular()

static void RSnapAuto::setPerpendicular ( bool on)
inlinestatic

◆ setPointsOnEntity()

static void RSnapAuto::setPointsOnEntity ( bool on)
inlinestatic

◆ setReferencePoints()

static void RSnapAuto::setReferencePoints ( bool on)
inlinestatic

◆ setTangential()

static void RSnapAuto::setTangential ( bool on)
inlinestatic

◆ snap()

RVector RSnapAuto::snap ( const RVector & position,
RGraphicsView & view,
double range = RNANDOUBLE )
virtual
Returns
The snapped position (closest relevant position) for the given mouse position.

Reimplemented from RSnap.

Member Data Documentation

◆ initialized

bool RSnapAuto::initialized = false
staticprivate

Copyright (c) 2011-2018 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

◆ modes

RSnapAuto::Modes RSnapAuto::modes = RSnapAuto::None
staticprivate

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