QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ROrthoGrid Class Reference

Grid representation. More...

#include <ROrthoGrid.h>

Inheritance diagram for ROrthoGrid:
RGrid

List of all members.

Public Member Functions

virtual void clearCache ()
QList< RVectorgetIdealSpacing (int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)
virtual QString getInfoText ()
RS::IsoProjectionType getProjection () const
bool isIsometric () const
virtual void paint ()
 This is called by the graphics view this grid is attached to whenever the grid should be painted.
virtual void paintCursor (const RVector &pos)
virtual void paintGridLines (const RVector &space, const RBox &box, bool meta)
virtual void paintGridPoints (const RVector &space, const RBox &box)
virtual void paintMetaGrid ()
 This is called by the graphics view this grid is attached to whenever the meta grid should be painted.
virtual void paintRuler (RRuler &ruler)
 ROrthoGrid (RGraphicsView &view)
 Copyright (c) 2011-2014 by Andrew Mustun.
void setIsometric (bool on)
void setProjection (RS::IsoProjectionType p)
RVector snapToGrid (const RVector &positionUcs)
 Maps the given model position to the grid.
virtual void update (bool force=false)
 Updates the grid information, in particular the grid spacing and grid region to the current view port.
virtual ~ROrthoGrid ()
- Public Member Functions inherited from RGrid
RDocumentgetDocument () const
int getViewportNumber () const
 Copyright (c) 2011-2014 by Andrew Mustun.
bool isVisible () const
 RGrid (RGraphicsView &view)
void setVisible (bool on)
virtual ~RGrid ()

Static Public Member Functions

static QList< RVectorgetIdealGridSpacing (RGraphicsView &view, int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)
static bool isFractionalFormat (RS::LinearFormat linearFormat)

Static Private Member Functions

static double inchAutoscale (double value, double idealSpacing, RS::Unit unit)

Private Attributes

RVector autoMetaSpacing
RVector autoSpacing
RBox gridBox
QString infoText
int isometric
RBox metaGridBox
RVector metaSpacing
RVector minMetaSpacing
int minPixelSpacing
RVector minSpacing
int projection
bool scaleGrid
RVector spacing
RBox viewBox

Additional Inherited Members

- Protected Attributes inherited from RGrid
RGraphicsViewview
int visible

Detailed Description

Grid representation.

This class is responsible for updating the grid and snapping to the grid.

Scriptable:
This class is wrapped for script environments.

Constructor & Destructor Documentation

ROrthoGrid::ROrthoGrid ( RGraphicsView view)

Copyright (c) 2011-2014 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.

ROrthoGrid::~ROrthoGrid ( )
virtual

Member Function Documentation

void ROrthoGrid::clearCache ( )
virtual

Reimplemented from RGrid.

QList< RVector > ROrthoGrid::getIdealGridSpacing ( RGraphicsView view,
int  minPixelSpacing,
const RVector minSpacing,
const RVector minMetaSpacing 
)
static
QList< RVector > ROrthoGrid::getIdealSpacing ( int  minPixelSpacing,
const RVector minSpacing,
const RVector minMetaSpacing 
)
QString ROrthoGrid::getInfoText ( )
virtual

Implements RGrid.

RS::IsoProjectionType ROrthoGrid::getProjection ( ) const
double ROrthoGrid::inchAutoscale ( double  value,
double  idealSpacing,
RS::Unit  unit 
)
staticprivate
bool ROrthoGrid::isFractionalFormat ( RS::LinearFormat  linearFormat)
static
bool ROrthoGrid::isIsometric ( ) const
void ROrthoGrid::paint ( )
virtual

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

Implements RGrid.

void ROrthoGrid::paintCursor ( const RVector pos)
virtual

Implements RGrid.

void ROrthoGrid::paintGridLines ( const RVector space,
const RBox box,
bool  meta 
)
virtual
void ROrthoGrid::paintGridPoints ( const RVector space,
const RBox box 
)
virtual
void ROrthoGrid::paintMetaGrid ( )
virtual

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

Implements RGrid.

void ROrthoGrid::paintRuler ( RRuler ruler)
virtual

Implements RGrid.

void ROrthoGrid::setIsometric ( bool  on)
void ROrthoGrid::setProjection ( RS::IsoProjectionType  p)
RVector ROrthoGrid::snapToGrid ( const RVector positionUcs)
virtual

Maps the given model position to the grid.

Implements RGrid.

void ROrthoGrid::update ( bool  force = false)
virtual

Updates the grid information, in particular the grid spacing and grid region to the current view port.

Implements RGrid.


Member Data Documentation

RVector ROrthoGrid::autoMetaSpacing
private
RVector ROrthoGrid::autoSpacing
private
RBox ROrthoGrid::gridBox
private
QString ROrthoGrid::infoText
private
int ROrthoGrid::isometric
mutableprivate
RBox ROrthoGrid::metaGridBox
private
RVector ROrthoGrid::metaSpacing
private
RVector ROrthoGrid::minMetaSpacing
private
int ROrthoGrid::minPixelSpacing
private
RVector ROrthoGrid::minSpacing
private
int ROrthoGrid::projection
mutableprivate
bool ROrthoGrid::scaleGrid
private
RVector ROrthoGrid::spacing
private
RBox ROrthoGrid::viewBox
private

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