QCAD
Open Source 2D CAD
RGrid Class Referenceabstract

Abstract base class for grid implementations. More...

#include <RGrid.h>

Inheritance diagram for RGrid:
ROrthoGrid

Public Member Functions

virtual void clearCache ()
 
RDocumentgetDocument () const
 
virtual QString getInfoText ()=0
 
virtual RS::IsoProjectionType getProjection () const
 
int getViewportNumber () const
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 
virtual bool isIsometric () const
 
bool isVisible () const
 
virtual void paint ()=0
 This is called by the graphics view this grid is attached to whenever the grid should be painted. More...
 
virtual void paintCursor (const RVector &pos)=0
 
virtual void paintMetaGrid ()=0
 This is called by the graphics view this grid is attached to whenever the meta grid should be painted. More...
 
virtual void paintRuler (RRuler &ruler, qreal devicePixelRatio=1.0)=0
 
 RGrid (RGraphicsView &view)
 
void setVisible (bool on)
 
virtual RVector snapToGrid (const RVector &positionUcs)=0
 Snaps the given UCS position to the grid. More...
 
virtual void update (bool force=false)=0
 This is called by the graphics view this grid is attached to whenever the view port changes and the grid needs to be updated. More...
 
virtual ~RGrid ()
 

Protected Attributes

RGraphicsViewview
 
int visible
 

Detailed Description

Abstract base class for grid implementations.

A grid class can for example implement an orthogonal grid or a polar grid.

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

Constructor & Destructor Documentation

◆ RGrid()

RGrid::RGrid ( RGraphicsView view)
inline

◆ ~RGrid()

virtual RGrid::~RGrid ( )
inlinevirtual

Member Function Documentation

◆ clearCache()

void RGrid::clearCache ( )
virtual

Reimplemented in ROrthoGrid.

◆ getDocument()

RDocument * RGrid::getDocument ( ) const

◆ getInfoText()

virtual QString RGrid::getInfoText ( )
pure virtual

Implemented in ROrthoGrid.

◆ getProjection()

virtual RS::IsoProjectionType RGrid::getProjection ( ) const
inlinevirtual

Reimplemented in ROrthoGrid.

◆ getViewportNumber()

int RGrid::getViewportNumber ( ) const

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.

◆ isIsometric()

virtual bool RGrid::isIsometric ( ) const
inlinevirtual

Reimplemented in ROrthoGrid.

◆ isVisible()

bool RGrid::isVisible ( ) const

◆ paint()

virtual void RGrid::paint ( )
pure virtual

This is called by the graphics view this grid is attached to whenever the grid should be painted.

Implemented in ROrthoGrid.

◆ paintCursor()

virtual void RGrid::paintCursor ( const RVector pos)
pure virtual

Implemented in ROrthoGrid.

◆ paintMetaGrid()

virtual void RGrid::paintMetaGrid ( )
pure virtual

This is called by the graphics view this grid is attached to whenever the meta grid should be painted.

Implemented in ROrthoGrid.

◆ paintRuler()

virtual void RGrid::paintRuler ( RRuler ruler,
qreal  devicePixelRatio = 1.0 
)
pure virtual

Implemented in ROrthoGrid.

◆ setVisible()

void RGrid::setVisible ( bool  on)

◆ snapToGrid()

virtual RVector RGrid::snapToGrid ( const RVector positionUcs)
pure virtual

Snaps the given UCS position to the grid.

Implemented in ROrthoGrid.

◆ update()

virtual void RGrid::update ( bool  force = false)
pure virtual

This is called by the graphics view this grid is attached to whenever the view port changes and the grid needs to be updated.

Implemented in ROrthoGrid.

Member Data Documentation

◆ view

RGraphicsView& RGrid::view
protected

◆ visible

int RGrid::visible
mutableprotected

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