QCAD
Open Source 2D CAD
RUcs Class Reference

Represents a user coordinate system (UCS) in a drawing. More...

#include <RUcs.h>

Inheritance diagram for RUcs:
RObject

Public Member Functions

virtual RUcsclone () const
 
virtual QPair< QVariant, RPropertyAttributesgetProperty (RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
 
RVector getZAxisDirection ()
 
virtual bool isSelectedForPropertyEditing ()
 
RVector mapFromUcs (const RVector &positionUcs)
 Maps the given UCS (user coordinate system) position to an absolute WCS (world coordinate system) position. More...
 
RVector mapToUcs (const RVector &positionWcs)
 Maps the given WCS position to a UCS position. More...
 
 RUcs ()
 
 RUcs (RDocument *document, const QString &name, const RVector &origin, const RVector &xAxisDirection, const RVector &yAxisDirection)
 
void setOrigin (const RVector &o)
 
virtual bool setProperty (RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
 Sets the given property to the given value. More...
 
void setXAxisDirection (const RVector &x)
 
void setYAxisDirection (const RVector &y)
 
virtual ~RUcs ()
 
- Public Member Functions inherited from RObject
void dump ()
 
virtual int getComplexity () const
 
QMap< QString, QVariantMap > getCustomProperties () const
 
QVariant getCustomProperty (const QString &title, const QString &key, const QVariant &defaultValue=RDEFAULT_QVARIANT)
 
QStringList getCustomPropertyKeys (const QString &title) const
 
QStringList getCustomPropertyTitles () const
 
virtual QSet< RPropertyTypeIdgetCustomPropertyTypeIds () const
 
RDocumentgetDocument ()
 
const RDocumentgetDocument () const
 
RObject::Handle getHandle () const
 
RObject::Id getId () const
 
virtual QSet< RPropertyTypeIdgetPropertyTypeIds () const
 
virtual bool hasPropertyType (RPropertyTypeId propertyTypeId)
 
bool isProtected () const
 
bool isUndone () const
 
void removeCustomProperty (const QString &title, const QString &key)
 Removes the custom property with the given name. More...
 
 RObject (RDocument *document=NULL, Id id=INVALID_ID)
 
void setCustomProperty (const QString &title, const QString &key, const QVariant &value)
 Sets a custom property with the given name. More...
 
void setDocument (RDocument *document)
 
void setProtected (bool on)
 
virtual void setUndone (bool on)
 
virtual ~RObject ()
 

Static Public Member Functions

static void init ()
 
- Static Public Member Functions inherited from RObject
static void init ()
 
template<class T >
static bool setMember (T &variable, const QVariant &value, bool condition=true)
 

Public Attributes

QString name
 
RVector origin
 
RVector xAxisDirection
 
RVector yAxisDirection
 

Static Public Attributes

static RPropertyTypeId PropertyName
 Copyright (c) 2011-2015 by Andrew Mustun. More...
 
static RPropertyTypeId PropertyOriginX
 
static RPropertyTypeId PropertyOriginY
 
static RPropertyTypeId PropertyOriginZ
 
static RPropertyTypeId PropertyXAxisDirectionX
 
static RPropertyTypeId PropertyXAxisDirectionY
 
static RPropertyTypeId PropertyXAxisDirectionZ
 
static RPropertyTypeId PropertyYAxisDirectionX
 
static RPropertyTypeId PropertyYAxisDirectionY
 
static RPropertyTypeId PropertyYAxisDirectionZ
 
- Static Public Attributes inherited from RObject
static const Handle INVALID_HANDLE = -1
 
static const Id INVALID_ID = -1
 Copyright (c) 2011-2015 by Andrew Mustun. More...
 
static RPropertyTypeId PropertyCustom
 
static RPropertyTypeId PropertyHandle
 
static RPropertyTypeId PropertyProtected
 

Additional Inherited Members

- Public Types inherited from RObject
typedef int Handle
 
typedef int Id
 
enum  XYZ { X, Y, Z }
 
- Protected Member Functions inherited from RObject
virtual void print (QDebug dbg) const
 Stream operator for QDebug. More...
 
void setHandle (RObject::Handle h)
 
void setId (RObject::Id id)
 
- Static Protected Member Functions inherited from RObject
static bool setMember (QString &variable, const QVariant &value, bool condition=true)
 Sets the given property. More...
 
static bool setMember (double &variable, const QVariant &value, bool condition=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static bool setMember (int &variable, const QVariant &value, bool condition=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static bool setMember (bool &variable, const QVariant &value, bool condition=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static bool setMember (QList< double > &variable, const QVariant &value, bool condition)
 
static bool setMemberVector (QList< RVector > &variable, const QVariant &value, RObject::XYZ xyz)
 
static bool setMemberX (QList< RVector > &variable, const QVariant &value, bool condition=true)
 
static bool setMemberY (QList< RVector > &variable, const QVariant &value, bool condition=true)
 
static bool setMemberZ (QList< RVector > &variable, const QVariant &value, bool condition=true)
 

Detailed Description

Represents a user coordinate system (UCS) in a drawing.

The current UCS of a drawing defines the current workplane and coordinate system that is being used for all input.

Scriptable:
This class is available in script environments.
Shared Pointer Support:
Objects can be used in QSharedPointer.

Constructor & Destructor Documentation

RUcs::RUcs ( )
inline
RUcs::RUcs ( RDocument document,
const QString &  name,
const RVector origin,
const RVector xAxisDirection,
const RVector yAxisDirection 
)
inline
virtual RUcs::~RUcs ( )
inlinevirtual

Member Function Documentation

virtual RUcs* RUcs::clone ( ) const
inlinevirtual

Implements RObject.

QPair< QVariant, RPropertyAttributes > RUcs::getProperty ( RPropertyTypeId propertyTypeId,
bool  humanReadable = false,
bool  noAttributes = false 
)
virtual
Returns
The value and attributes of the given property or an invalid property if this property owner has no property with the given ID.

Reimplemented from RObject.

RVector RUcs::getZAxisDirection ( )
Returns
Vector that indicates the direction of the Z-Axis (orthogonal to the XY plane).
void RUcs::init ( )
static
virtual bool RUcs::isSelectedForPropertyEditing ( )
inlinevirtual
Returns
True if this object is selected for editing. This means that the properties of this object should for example be shown in a property editor.

Implements RObject.

RVector RUcs::mapFromUcs ( const RVector positionUcs)

Maps the given UCS (user coordinate system) position to an absolute WCS (world coordinate system) position.

RVector RUcs::mapToUcs ( const RVector positionWcs)

Maps the given WCS position to a UCS position.

void RUcs::setOrigin ( const RVector o)
inline
bool RUcs::setProperty ( RPropertyTypeId  propertyTypeId,
const QVariant &  value,
RTransaction transaction = NULL 
)
virtual

Sets the given property to the given value.

If this property owner does not know a property with that ID, it is up to the property owner what happens. The property might be added into a list of dynamic properties or dropped.

Returns
True if the property owner was modified in any way, false otherwise.

Reimplemented from RObject.

void RUcs::setXAxisDirection ( const RVector x)
inline
void RUcs::setYAxisDirection ( const RVector y)
inline

Member Data Documentation

QString RUcs::name
RVector RUcs::origin
RPropertyTypeId RUcs::PropertyName
static

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

RPropertyTypeId RUcs::PropertyOriginX
static
RPropertyTypeId RUcs::PropertyOriginY
static
RPropertyTypeId RUcs::PropertyOriginZ
static
RPropertyTypeId RUcs::PropertyXAxisDirectionX
static
RPropertyTypeId RUcs::PropertyXAxisDirectionY
static
RPropertyTypeId RUcs::PropertyXAxisDirectionZ
static
RPropertyTypeId RUcs::PropertyYAxisDirectionX
static
RPropertyTypeId RUcs::PropertyYAxisDirectionY
static
RPropertyTypeId RUcs::PropertyYAxisDirectionZ
static
RVector RUcs::xAxisDirection
RVector RUcs::yAxisDirection

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