RViewportData
Class in Core Module
Header: #include <src/core/RViewportData.h>
Inherits: REntityData, RPoint
Description
Section titled “Description”Stores and manages all data that defines the geometry and appearance of a viewport entity.
Scriptable: This class is available in script environments.
Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.
Public Types
Section titled “Public Types”| enum | Status { Off } |
Public Functions
Section titled “Public Functions”RViewportData() |
|
| virtual RShape * | castToShape() |
| virtual bool | flipHorizontal() |
| virtual bool | flipVertical() |
| virtual QList< RVector > | getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) const |
| virtual RBox | getBoundingBox() const |
| virtual RBox | getBoundingBox(bool ignoreEmpty) const |
| RVector | getCenter() const |
| virtual QList< RVector > | getCenterPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| virtual double | getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const |
| QList< RLine > | getEdges() const |
| virtual QList< RVector > | getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| QList< RObject::Id > | getFrozenLayerIds() const |
| double | getHeight() const |
| virtual QList< RRefPoint > | getInternalReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop, QList< RObject::Id > *subEntityIds=NULL) constCan be overwritten to return internal, resolved reference points. |
| virtual QList< RVector > | getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true, QList< QPair< RObject::Id, RObject::Id > > *entityIds=NULL) const |
| virtual QList< RVector > | getIntersectionPoints(const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const |
| virtual QList< RVector > | getMiddlePoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| virtual QList< RVector > | getPointsWithDistanceToEnd(double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| virtual QList< RRefPoint > | getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const |
| double | getRotation() const |
| double | getScale() const |
| virtual QList< QSharedPointer< RShape > > | getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const |
| int | getStatus() const |
| virtual RS::EntityType | getType() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| RVector | getViewCenter() const |
| RVector | getViewOffset() const |
| int | getViewportId() const |
| RVector | getViewTarget() const |
| double | getWidth() const |
| virtual bool | intersectsWith(const RShape &shape) const |
| bool | isOff() const |
| bool | isOverall() const |
| virtual bool | isValid() const |
| virtual bool | mirror(const RLine &axis) |
| virtual bool | mirror(const RVector &axis1, const RVector &axis2) |
| virtual bool | move(const RVector &offset)Moves this entity by the given offset. |
| virtual bool | moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location. |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er) |
| void | setCenter(const RVector &c) |
| void | setFrozenLayerIds(const QList< RObject::Id > &layerIds) |
| void | setHeight(double h) |
| void | setOff(bool v) |
| void | setOverall(bool on) |
| void | setRotation(double r) |
| void | setScale(double s) |
| void | setStatus(int s) |
| void | setViewCenter(const RVector &c) |
| void | setViewportId(int id) |
| void | setViewTarget(const RVector &t) |
| void | setWidth(double w) |
| virtual void | setZ(double z) |
| virtual bool | stretch(const RPolyline &area, const RVector &offset)Stretches the end points of this entity that are inside area by offset. |
| virtual void | to2D() |
Protected Functions
Section titled “Protected Functions”RViewportData(RDocument *document, const RViewportData &data) |
|
| void | setStatusFlag(Status s, bool on) |
| bool | testStatusFlag(Status s) const |
Private Attributes
Section titled “Private Attributes”| QList< RObject::Id > | frozenLayerIds |
| double | height |
| bool | overall |
| double | rotation |
| double | scaleFactor |
| int | status |
| RVector | viewCenter |
| int | viewportId |
| RVector | viewTarget |
| double | width |
Friends
Section titled “Friends”| class | RViewportEntity |
Member Documentation
Section titled “Member Documentation”Status
Section titled “Status”enum Status| Value | Description |
|---|---|
Off = 0x20000 |
RViewportData
Section titled “RViewportData”RViewportData::RViewportData()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.
castToShape
Section titled “castToShape”virtual RShape * RViewportData::castToShape()virtual inline
Reimplemented from castToShape.
flipHorizontal
Section titled “flipHorizontal”virtual bool RViewportData::flipHorizontal()virtual inline
Reimplemented from flipHorizontal.
flipVertical
Section titled “flipVertical”virtual bool RViewportData::flipVertical()virtual inline
Reimplemented from flipVertical.
getArcReferencePoints
Section titled “getArcReferencePoints”virtual QList< RVector > RViewportData::getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) constvirtual inline const
Returns: Vector of reference points of this entity. Used for snap to reference points.
Reimplemented from getArcReferencePoints.
getBoundingBox
Section titled “getBoundingBox”virtual RBox RViewportData::getBoundingBox() constvirtual inline const
Returns: The bounding box of this shape.
Reimplemented from getBoundingBox.
getBoundingBox
Section titled “getBoundingBox”virtual RBox RViewportData::getBoundingBox(bool ignoreEmpty) constvirtual const
Returns: The bounding box that contains this entity.
Reimplemented from getBoundingBox.
getCenter
Section titled “getCenter”RVector RViewportData::getCenter() constinline const
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RViewportData::getCenterPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Vector of center points of this entity. Used for snap to center points.
Reimplemented from getCenterPoints.
getDistanceTo
Section titled “getDistanceTo”virtual double RViewportData::getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) constvirtual const
Returns: The shortest distance from this entity to the given point.
Parameters:
limited: Limit lines, arcs at end points, otherwise the orthogonal distance to the unlimited line / circle is returned.range: This is returned for solid filled entities (solid filled or dense hatches, text entities) if the point is on the entity and the distance would be zero.draft: Calculate based on draft mode representation of the entity.strictRange: If limited, this is the maximum range from either end point of the entity. Zero to only return distances that are strictly orthogonal to the entity.
Reimplemented from getDistanceTo.
getEdges
Section titled “getEdges”QList< RLine > RViewportData::getEdges() constconst
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RViewportData::getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Vector of end points of this entity. Used for snap to end points.
Reimplemented from getEndPoints.
getFrozenLayerIds
Section titled “getFrozenLayerIds”QList< RObject::Id > RViewportData::getFrozenLayerIds() constinline const
getHeight
Section titled “getHeight”double RViewportData::getHeight() constinline const
getInternalReferencePoints
Section titled “getInternalReferencePoints”virtual QList< RRefPoint > RViewportData::getInternalReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop, QList< RObject::Id > *subEntityIds=NULL) constvirtual const
Can be overwritten to return internal, resolved reference points.
This is used for example for block references in combination with snap to reference points. Default implementation returns same as getReferencePoints().
Reimplemented from getInternalReferencePoints.
getIntersectionPoints
Section titled “getIntersectionPoints”virtual QList< RVector > RViewportData::getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true, QList< QPair< RObject::Id, RObject::Id > > *entityIds=NULL) constvirtual inline const
Returns: Points on entity which are intersection points with the given other entity. If same is true, the two datas originate from the same entity.
Reimplemented from getIntersectionPoints.
getIntersectionPoints
Section titled “getIntersectionPoints”virtual QList< RVector > RViewportData::getIntersectionPoints(const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) constvirtual inline const
Returns: Points on entity which are intersection points with the given shape.
Reimplemented from getIntersectionPoints.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RViewportData::getMiddlePoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Vector of middle points of this entity. Used for snap to middle points.
Reimplemented from getMiddlePoints.
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RViewportData::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Points on entity with given distance to either endpoint. Used for snap to points with distance on entity.
Reimplemented from getPointsWithDistanceToEnd.
getReferencePoints
Section titled “getReferencePoints”virtual QList< RRefPoint > RViewportData::getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) constvirtual const
Returns: Vector of reference points of this entity. Reference points can usually be moved around by the user to change the geometry of the entity.
Reimplemented from getReferencePoints.
getRotation
Section titled “getRotation”double RViewportData::getRotation() constinline const
getScale
Section titled “getScale”double RViewportData::getScale() constinline const
getShapes
Section titled “getShapes”virtual QList< QSharedPointer< RShape > > RViewportData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) constvirtual const
Returns: Shapes that represent the geometry of this entity.
Parameters:
queryBox: Limit returned shapes to query boxignoreComplex: Ignore complex shapes and explode those into simple shapessegment: Split up splines into spline segments
Reimplemented from getShapes.
getStatus
Section titled “getStatus”int RViewportData::getStatus() constinline const
getType
Section titled “getType”virtual RS::EntityType RViewportData::getType() constvirtual inline const
Reimplemented from getType.
getVectorTo
Section titled “getVectorTo”virtual RVector RViewportData::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual inline const
Returns: The distance vector from this entity to the given point.
Parameters:
point: the point to which the distance was measuredlimited: If true, an invalid vector is returned if the closest point on the entity is outside of the entity (e.g. in the extension line of a line or outside the start / end angle of an arc).
Reimplemented from getVectorTo.
getViewCenter
Section titled “getViewCenter”RVector RViewportData::getViewCenter() constinline const
getViewOffset
Section titled “getViewOffset”RVector RViewportData::getViewOffset() constconst
Returns: Offset or position of 0/0 of view (model space block) for this viewport.
getViewportId
Section titled “getViewportId”int RViewportData::getViewportId() constinline const
getViewTarget
Section titled “getViewTarget”RVector RViewportData::getViewTarget() constinline const
getWidth
Section titled “getWidth”double RViewportData::getWidth() constinline const
intersectsWith
Section titled “intersectsWith”virtual bool RViewportData::intersectsWith(const RShape &shape) constvirtual inline const
Returns: True if this entity intersects with the given shape, false otherwise.
Reimplemented from intersectsWith.
bool RViewportData::isOff() constinline const
isOverall
Section titled “isOverall”bool RViewportData::isOverall() constinline const
isValid
Section titled “isValid”virtual bool RViewportData::isValid() constvirtual inline const
Reimplemented from isValid.
mirror
Section titled “mirror”virtual bool RViewportData::mirror(const RLine &axis)virtual inline
Reimplemented from mirror.
mirror
Section titled “mirror”virtual bool RViewportData::mirror(const RVector &axis1, const RVector &axis2)virtual inline
Reimplemented from mirror.
virtual bool RViewportData::move(const RVector &offset)virtual inline
Moves this entity by the given offset.
Reimplemented from move.
moveReferencePoint
Section titled “moveReferencePoint”virtual bool RViewportData::moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)virtual
Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.
Returns: True if a reference point has been moved successfully, false otherwise.
Reimplemented from moveReferencePoint.
rotate
Section titled “rotate”virtual bool RViewportData::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual inline
Reimplemented from rotate.
virtual bool RViewportData::scale(const RVector &scaleFactors, const RVector ¢er)virtual
Reimplemented from scale.
setCenter
Section titled “setCenter”void RViewportData::setCenter(const RVector &c)inline
setFrozenLayerIds
Section titled “setFrozenLayerIds”void RViewportData::setFrozenLayerIds(const QList< RObject::Id > &layerIds)inline
setHeight
Section titled “setHeight”void RViewportData::setHeight(double h)inline
setOff
Section titled “setOff”void RViewportData::setOff(bool v)inline
setOverall
Section titled “setOverall”void RViewportData::setOverall(bool on)inline
setRotation
Section titled “setRotation”void RViewportData::setRotation(double r)inline
setScale
Section titled “setScale”void RViewportData::setScale(double s)inline
setStatus
Section titled “setStatus”void RViewportData::setStatus(int s)inline
setViewCenter
Section titled “setViewCenter”void RViewportData::setViewCenter(const RVector &c)inline
setViewportId
Section titled “setViewportId”void RViewportData::setViewportId(int id)inline
setViewTarget
Section titled “setViewTarget”void RViewportData::setViewTarget(const RVector &t)inline
setWidth
Section titled “setWidth”void RViewportData::setWidth(double w)inline
virtual void RViewportData::setZ(double z)virtual inline
Reimplemented from setZ.
stretch
Section titled “stretch”virtual bool RViewportData::stretch(const RPolyline &area, const RVector &offset)virtual inline
Stretches the end points of this entity that are inside area by offset.
Reimplemented from stretch.
virtual void RViewportData::to2D()virtual
Reimplemented from to2D.
RViewportData
Section titled “RViewportData”RViewportData::RViewportData(RDocument *document, const RViewportData &data)protected
setStatusFlag
Section titled “setStatusFlag”void RViewportData::setStatusFlag(Status s, bool on)inline protected
testStatusFlag
Section titled “testStatusFlag”bool RViewportData::testStatusFlag(Status s) constinline const protected
frozenLayerIds
Section titled “frozenLayerIds”QList<RObject::Id> RViewportData::frozenLayerIdsprivate
height
Section titled “height”double RViewportData::heightprivate
overall
Section titled “overall”bool RViewportData::overallprivate
rotation
Section titled “rotation”double RViewportData::rotationprivate
scaleFactor
Section titled “scaleFactor”double RViewportData::scaleFactorprivate
status
Section titled “status”int RViewportData::statusprivate
viewCenter
Section titled “viewCenter”RVector RViewportData::viewCenterprivate
viewportId
Section titled “viewportId”int RViewportData::viewportIdprivate
viewTarget
Section titled “viewTarget”RVector RViewportData::viewTargetprivate
double RViewportData::widthprivate
RViewportEntity
Section titled “RViewportEntity”friend class RViewportEntityprivate