|
QCAD Application Framework
CAD Application Development and Automation.
|
QImage based 2d graphics view. More...
#include <RGraphicsViewImage.h>
Public Member Functions | |
| void | addToBackground (const RPainterPath &path) |
| void | autoZoom (int margin=RDEFAULT_MIN1) |
| void | clearBackground () |
| virtual void | emitDecorateBackground (QPainter *painter) |
| virtual void | emitDecorateForeground (QPainter *painter) |
| virtual void | emitUpdateSnapInfo (RSnap *snap, RSnapRestriction *restriction) |
| virtual void | emitUpdateTextLabel (const RTextLabel &textLabel) |
| bool | getAntialiasing () |
| QColor | getBackgroundColor () |
| RBox | getBox () const |
| QImage | getBuffer () const |
| bool | getColorCorrectionOverride () const |
| RDocument * | getDocument () |
| RDocumentInterface * | getDocumentInterface () |
| bool | getDraftMode () const |
| double | getFactor (bool includeStepFactor=true) const |
| RGrid * | getGrid () |
| virtual int | getHeight () const |
| RVector | getOffset (bool includeStepOffset=true) const |
| bool | getPanOptimization () |
| RGraphicsScene * | getScene () |
| int | getTextHeightThresholdOverride () const |
| QTransform | getTransform () const |
| virtual int | getWidth () const |
| virtual bool | hasFocus () |
| bool | isPrinting () const |
| bool | isPrintPreview () const |
| virtual double | mapDistanceFromView (double d) const |
| Maps the given view distance in pixels to a model distance. | |
| virtual double | mapDistanceToView (double d) const |
| Maps the given model distance to a screen distance in pixels. | |
| virtual RVector | mapFromView (const RVector &v, double z=0.0) const |
| Maps the given view coordinate in pixels to a model coordinate. | |
| virtual RVector | mapToView (const RVector &v) const |
| Maps the given model coordinate to a view coordinate in pixels. | |
| virtual void | paintEntities (QPainter *painter, const RBox &queryBox) |
| virtual void | paintEntity (QPainter *painter, REntity::Id id) |
| virtual void | paintGridPoint (const RVector &ucsPosition) |
| virtual void | paintMetaGridLine (const RLine &ucsPosition) |
| virtual void | regenerate (bool force=false) |
| Regenerates the view from the underlying scene. | |
| virtual void | removeFocus () |
| virtual void | repaintView () |
| Triggers a paintEvent based on a buffered offscreen bitmap (very fast). | |
| void | resizeImage (int w, int h) |
| void | restoreViewport () |
| RGraphicsViewImage () | |
| void | saveViewport () |
| void | setAntialiasing (bool val) |
| virtual void | setBackgroundColor (const QColor &col) |
| void | setBackgroundTransform (double bgFactor, const RVector &bgOffset) |
| void | setColorCorrectionOverride (bool on) |
| void | setColorMode (RGraphicsView::ColorMode cm) |
| void | setDraftMode (bool on) |
| void | setFactor (double f, bool regen=true) |
| void | setGrid (RGrid *grid) |
| Sets the current grid. | |
| void | setMargin (int m) |
| void | setNavigationAction (RAction *action) |
| Sets an action object that is typically used to handle all navigation interaction (zooming, panning, ...). | |
| void | setOffset (const RVector &offset, bool regen=true) |
| void | setPaintOrigin (bool val) |
| void | setPanOptimization (bool on) |
| void | setPrinting (bool on) |
| void | setPrintPointSize (const RVector &s) |
| void | setPrintPreview (bool on) |
| virtual void | setScene (RGraphicsSceneQt *scene, bool regen=true) |
| void | setTextHeightThresholdOverride (int v) |
| virtual void | simulateMouseMoveEvent () |
| virtual void | updateImage () |
| Repaints the view. | |
| void | zoomTo (const RBox &window, int margin=0) |
| Zooms the view in a way that all entities are within the visible area of the view. | |
| virtual | ~RGraphicsViewImage () |
Public Member Functions inherited from RGraphicsView | |
| void | addTextLabel (const RTextLabel &textLabel) |
| void | clearTextLabels () |
| REntity::Id | getClosestEntity (const RVector &screenPosition, int range, bool includeLockedLayers=true) |
| Finds the entity that is the closest to the given screen coordinate (in pixels). | |
| RVector | getClosestReferencePoint (const RVector &screenPosition, int range) |
| Finds the reference point that is the closest to the given screen coordinate (in pixels). | |
| RVector | getClosestReferencePoint (REntity::Id entityId, const RVector &screenPosition) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| RGraphicsView::ColorMode | getColorMode () |
| RVector | getCurrentStepOffset () const |
| double | getCurrentStepScaleFactor () const |
| virtual QCursor | getCursor () |
| RDocument * | getDocument () const |
| RVector | getLastKnownMousePosition () const |
| int | getMargin () |
| virtual RVector | getMaximum () const |
| virtual RVector | getMinimum () const |
| QList< RTextLabel > | getTextLabels () |
| virtual void | handleKeyPressEvent (QKeyEvent &event) |
| virtual void | handleKeyReleaseEvent (QKeyEvent &event) |
| virtual void | handleMouseDoubleClickEvent (RMouseEvent &event) |
| This should be called by the mouse double click event handler of a higher level GUI toolkit. | |
| virtual void | handleMouseMoveEvent (RMouseEvent &event) |
| This should be called by the mouse move event handler of a higher level GUI toolkit. | |
| virtual void | handleMousePressEvent (RMouseEvent &event) |
| This should be called by the mouse press event handler of a higher level GUI toolkit. | |
| virtual void | handleMouseReleaseEvent (RMouseEvent &event) |
| This should be called by the mouse release event handler of a higher level GUI toolkit. | |
| virtual void | handlePanGestureEvent (QPanGesture &gesture) |
| virtual void | handlePinchGestureEvent (QPinchGesture &gesture) |
| virtual void | handleSwipeGestureEvent (QSwipeGesture &gesture) |
| virtual void | handleTabletEvent (RTabletEvent &event) |
| This should be called by the tablet event handler of a higher level GUI toolkit. | |
| virtual void | handleTerminateEvent (RTerminateEvent &event) |
| virtual void | handleWheelEvent (RWheelEvent &event) |
| This should be called by the mouse wheel event handler of a higher level GUI toolkit. | |
| bool | isGridVisible () const |
| virtual QList< RVector > | mapCornersFromView () const |
| virtual RBox | mapToView (const RBox &box) const |
| Finds the entity that is the closest to the given screen coordinate (in pixels) and inside the current UCS (read floor). | |
| virtual void | pan (const RVector &delta) |
Pans (scrolls) by the given amount delta which is a vector in screen coordinates (pixels). | |
| RGraphicsView (RGraphicsScene *scene=NULL) | |
| void | setCurrentStepOffset (const RVector &s) |
| void | setCurrentStepScaleFactor (double f) |
| virtual void | setCursor (Qt::CursorShape) |
| virtual void | setCursor (const QCursor &) |
| void | setDisplayOnlyCurrentUcs (bool on) |
If on is true, only the current UCS and the entities that are in its range are displayed. | |
| void | setGridVisible (bool on) |
| virtual void | setScene (RGraphicsScene *scene, bool regen=true) |
| void | startPan () |
| virtual void | viewportChangeEvent () |
| virtual void | zoom (const RVector ¢er, double factor) |
| Zooms in / out by the given factor towards / from the given center in scene coordinates. | |
| void | zoomIn () |
| Zooms in by factor 1.2. | |
| void | zoomIn (const RVector ¢er) |
| Zooms in by factor 1.2. | |
| void | zoomOut () |
| Zooms out by factor 1.2. | |
| void | zoomOut (const RVector ¢er) |
| Zooms out by factor 1.0/1.2. | |
| void | zoomPrevious () |
| bool | zoomToSelection () |
| virtual | ~RGraphicsView () |
Protected Member Functions | |
| QPainter * | initPainter (QPaintDevice &device, bool erase, bool screen=false, const QRect &rect=QRect()) |
| void | invalidate (bool force=false) |
| virtual void | paintBackground (QPainter *painter, const QRect &rect=QRect()) |
| virtual void | paintCursor (QPaintDevice &device) |
| virtual void | paintDocument (const QRect &rect=QRect()) |
| virtual void | paintErase (QPaintDevice &device, const QRect &rect=QRect()) |
| virtual void | paintGrid (QPaintDevice &device, const QRect &rect=QRect()) |
| virtual void | paintImage (QPainter *painter, RImageData &image) |
| virtual void | paintMetaGrid (QPaintDevice &device, const QRect &rect=QRect()) |
| virtual void | paintOrigin (QPaintDevice &device) |
| Paints the absolute zero point (origin). | |
| virtual void | paintRelativeZero (QPaintDevice &device) |
| void | updateGraphicsBuffer () |
| Updates the graphics buffer from scratch. | |
| void | updateTransformation () const |
Protected Member Functions inherited from RGraphicsView | |
| virtual void | centerTo (const RBox &box) |
Centers the view on the given box. | |
Protected Attributes | |
| bool | antialiasing |
| QList< RPainterPath > | backgroundDecoration |
| double | backgroundFactor |
| RVector | backgroundOffset |
| int | bgColorLightness |
| RBox | clipBox |
| bool | colorCorrection |
| bool | colorCorrectionOverride |
| int | colorThreshold |
| double | currentScale |
| bool | doPaintOrigin |
| double | drawingScale |
| QImage | graphicsBuffer |
| bool | graphicsBufferNeedsUpdate |
| QImage | graphicsBufferWithPreview |
| QPainter * | gridPainter |
| bool | isSelected |
| double | lastFactor |
| RVector | lastOffset |
| QSize | lastSize |
| QMutex | mutexSi |
| bool | panOptimization |
| QTransform | previousView |
| RGraphicsSceneQt * | sceneQt |
| QSet< RObject::Id > | selectedIds |
| int | textHeightThreshold |
| int | textHeightThresholdOverride |
| QTransform | transform |
Protected Attributes inherited from RGraphicsView | |
| bool | autoScalePatterns |
| QColor | backgroundColor |
| ColorMode | colorMode |
| RVector | currentStepOffset |
| double | currentStepScaleFactor |
| Current scale factor caused by a pinch gesture. | |
| bool | displayOnlyCurrentUcs |
| True to only display entities within the horizontal slice that is defined by the current UCS. | |
| bool | draftMode |
| double | factor |
| Scale factor from model coordinates to view coordinates. | |
| RGrid * | grid |
| Grid that is currently displayed by this view or NULL. | |
| bool | gridVisible |
| RVector | lastKnownModelPosition |
| RVector | lastKnownViewPosition |
| int | margin |
| RAction * | navigationAction |
| The navigation action of this view or NULL if no navigation action has been set. | |
| RVector | offset |
| Offset of the zero point from the lower left corner of the view in model coordinates. | |
| double | previousFactor |
| RVector | previousOffset |
| bool | printing |
| RVector | printPointSize |
| bool | printPreview |
| RGraphicsScene * | scene |
| The scene this view is attached to. | |
| QList< RTextLabel > | textLabels |
| Internal list of text labels that were added to this view. | |
Additional Inherited Members | |
Public Types inherited from RGraphicsView | |
| enum | ColorMode { FullColor, GrayScale, BlackWhite } |
QImage based 2d graphics view.
This graphics view displays a rectangular area of a RGraphicsSceneQt.
| RGraphicsViewImage::RGraphicsViewImage | ( | ) |
|
virtual |
| void RGraphicsViewImage::addToBackground | ( | const RPainterPath & | path | ) |
|
inline |
Reimplemented from RGraphicsView.
| void RGraphicsViewImage::clearBackground | ( | ) |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in RGraphicsViewQt.
|
inlinevirtual |
Reimplemented in RGraphicsViewQt.
| bool RGraphicsViewImage::getAntialiasing | ( | ) |
|
inline |
Reimplemented from RGraphicsView.
|
inlinevirtual |
Reimplemented from RGraphicsView.
| QImage RGraphicsViewImage::getBuffer | ( | ) | const |
|
inline |
|
inline |
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
virtual |
|
inline |
Reimplemented from RGraphicsView.
| bool RGraphicsViewImage::getPanOptimization | ( | ) |
|
inline |
Reimplemented from RGraphicsView.
|
inline |
| QTransform RGraphicsViewImage::getTransform | ( | ) | const |
|
virtual |
|
inlinevirtual |
Implements RGraphicsView.
Reimplemented in RGraphicsViewQt.
|
protected |
\par Non-Scriptable:
This function is not available in script environments.
|
protected |
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
virtual |
Maps the given view distance in pixels to a model distance.
If the view projection is not orthogonal the result is undefined.
Implements RGraphicsView.
|
virtual |
Maps the given model distance to a screen distance in pixels.
If the view projection is not orthogonal the result is undefined.
Implements RGraphicsView.
Maps the given view coordinate in pixels to a model coordinate.
| v | view coordinate in pixels, v.z is always 0 |
| z | known z coordinate in model units |
Implements RGraphicsView.
Maps the given model coordinate to a view coordinate in pixels.
Implements RGraphicsView.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Reimplemented from RGraphicsView.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Reimplemented from RGraphicsView.
|
protectedvirtual |
Paints the absolute zero point (origin).
|
protectedvirtual |
|
virtual |
Regenerates the view from the underlying scene.
Implements RGraphicsView.
|
inlinevirtual |
Implements RGraphicsView.
Reimplemented in RGraphicsViewQt.
|
virtual |
Triggers a paintEvent based on a buffered offscreen bitmap (very fast).
Implements RGraphicsView.
Reimplemented in RGraphicsViewQt.
| void RGraphicsViewImage::resizeImage | ( | int | w, |
| int | h | ||
| ) |
| void RGraphicsViewImage::restoreViewport | ( | ) |
Reimplemented from RGraphicsView.
| void RGraphicsViewImage::saveViewport | ( | ) |
Reimplemented from RGraphicsView.
| void RGraphicsViewImage::setAntialiasing | ( | bool | val | ) |
|
virtual |
Reimplemented from RGraphicsView.
| void RGraphicsViewImage::setBackgroundTransform | ( | double | bgFactor, |
| const RVector & | bgOffset | ||
| ) |
|
inline |
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Sets the current grid.
This graphics view takes ownership of the grid. The previous grid is deleted. Setting the grid to NULL disables the grid.
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Sets an action object that is typically used to handle all navigation interaction (zooming, panning, ...).
All events that are received by this view are first sent to the graphics scene and then to this action if they were not consumed yet.
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
| void RGraphicsViewImage::setPaintOrigin | ( | bool | val | ) |
| void RGraphicsViewImage::setPanOptimization | ( | bool | on | ) |
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
inline |
Reimplemented from RGraphicsView.
|
virtual |
|
inline |
|
inlinevirtual |
Reimplemented from RGraphicsView.
|
protected |
Updates the graphics buffer from scratch.
This can be relatively slow and is only called on view port changes or document changes.
|
virtual |
Repaints the view.
If the view has been invalidated before, the view is redrawn from scratch. Otherwise, only a cached buffer is drawn (very fast).
|
protected |
|
inlinevirtual |
Zooms the view in a way that all entities are within the visible area of the view.
The view is updated.
Reimplemented from RGraphicsView.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Reimplemented in RGraphicsViewQt.
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |