# HG changeset patch # User Santeri Piippo # Date 1386279759 -7200 # Node ID 0334789cb4d7d7f91552e345b75602efc7f88767 # Parent 72ad83a67165c84f8979aebbbf8c494af3437261 - Changed the callback parm of PROPERTY to a stock/custom write method argument. diff -r 72ad83a67165 -r 0334789cb4d7 src/addObjectDialog.cpp --- a/src/addObjectDialog.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/addObjectDialog.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -39,7 +39,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- class SubfileListItem : public QTreeWidgetItem -{ PROPERTY (public, Primitive*, PrimitiveInfo, NO_OPS, NO_CB) +{ PROPERTY (public, Primitive*, PrimitiveInfo, NO_OPS, STOCK_WRITE) public: SubfileListItem (QTreeWidgetItem* parent, Primitive* info) : @@ -221,7 +221,7 @@ if (mo) { for (const Axis ax : g_Axes) - dsb_coords[ax]->setValue (mo->position() [ax]); + dsb_coords[ax]->setValue (mo->getPosition() [ax]); defaultMatrix = mo->getTransform(); } diff -r 72ad83a67165 -r 0334789cb4d7 src/colorSelectDialog.h --- a/src/colorSelectDialog.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/colorSelectDialog.h Thu Dec 05 23:42:39 2013 +0200 @@ -28,7 +28,7 @@ class ColorSelector : public QDialog { Q_OBJECT - PROPERTY (private, LDColor*, Selection, NO_OPS, NO_CB) + PROPERTY (private, LDColor*, Selection, NO_OPS, STOCK_WRITE) public: explicit ColorSelector (int defval = -1, QWidget* parent = null); diff -r 72ad83a67165 -r 0334789cb4d7 src/common.h --- a/src/common.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/common.h Thu Dec 05 23:42:39 2013 +0200 @@ -88,10 +88,9 @@ # define DIRSLASH_CHAR '/' #endif // WIN32 -#define PROPERTY( ACCESS, TYPE, NAME, OPS, CALLBACK ) \ +#define PROPERTY( ACCESS, TYPE, NAME, OPS, WRITETYPE ) \ private: \ TYPE m_##NAME; \ - DEFINE_##CALLBACK( NAME ) \ \ public: \ inline TYPE const& GET_READ_METHOD( NAME, OPS ) const \ @@ -99,12 +98,8 @@ } \ \ ACCESS: \ - inline void set##NAME( TYPE const& NAME##_ ) \ - { m_##NAME = NAME##_; \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ - } \ - \ - DEFINE_PROPERTY_##OPS( TYPE, NAME, CALLBACK ) + DEFINE_WRITE_METHOD_##WRITETYPE( TYPE, NAME ) \ + DEFINE_PROPERTY_##OPS( TYPE, NAME ) #define GET_READ_METHOD( NAME, OPS ) \ GET_READ_METHOD_##OPS( NAME ) @@ -114,51 +109,52 @@ #define GET_READ_METHOD_STR_OPS( NAME ) get##NAME() #define GET_READ_METHOD_NUM_OPS( NAME ) get##NAME() +#define DEFINE_WRITE_METHOD_STOCK_WRITE( TYPE, NAME ) \ + inline void set##NAME( TYPE const& NAME##_ ) \ + { m_##NAME = NAME##_; \ + } + +#define DEFINE_WRITE_METHOD_CUSTOM_WRITE( TYPE, NAME ) \ + void set##NAME( TYPE const& NAME##_ ); \ + #define DEFINE_WITH_CB( NAME ) void NAME##Changed(); #define DEFINE_NO_CB( NAME ) -#define DEFINE_PROPERTY_NO_OPS( TYPE, NAME, CALLBACK ) +#define DEFINE_PROPERTY_NO_OPS( TYPE, NAME ) -#define DEFINE_PROPERTY_STR_OPS( TYPE, NAME, CALLBACK ) \ - void append##NAME( TYPE a ) \ - { m_##NAME.append( a ); \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ - } \ - \ - void prepend##NAME( TYPE a ) \ - { m_##NAME.prepend( a ); \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ - } \ - \ - void replaceIn##NAME( TYPE a, TYPE b ) \ - { m_##NAME.replace( a, b ); \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ +#define DEFINE_PROPERTY_STR_OPS( TYPE, NAME ) \ + void append##NAME( TYPE a ) \ + { TYPE tmp( m_##NAME ); \ + tmp.append( a ); \ + set##NAME( tmp ); \ + } \ + \ + void prepend##NAME( TYPE a ) \ + { TYPE tmp( m_##NAME ); \ + tmp.prepend( a ); \ + set##NAME( tmp ); \ + } \ + \ + void replaceIn##NAME( TYPE a, TYPE b ) \ + { TYPE tmp( m_##NAME ); \ + tmp.replace( a, b ); \ + set##NAME( tmp ); \ } -#define DEFINE_PROPERTY_NUM_OPS( TYPE, NAME, CALLBACK ) \ - inline void increase##NAME( TYPE a = 1 ) \ - { m_##NAME += a; \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ - } \ - \ - inline void decrease##NAME( TYPE a = 1 ) \ - { m_##NAME -= a; \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ +#define DEFINE_PROPERTY_NUM_OPS( TYPE, NAME ) \ + inline void increase##NAME( TYPE a = 1 ) \ + { set##NAME( m_##NAME + a ); \ + } \ + \ + inline void decrease##NAME( TYPE a = 1 ) \ + { set##NAME( m_##NAME - a ); \ } -#define DEFINE_PROPERTY_BOOL_OPS( TYPE, NAME, CALLBACK ) \ - inline void toggle##NAME() \ - { m_##NAME = !m_##NAME; \ - TRIGGER_CALLBACK( NAME, CALLBACK ) \ +#define DEFINE_PROPERTY_BOOL_OPS( TYPE, NAME ) \ + inline void toggle##NAME() \ + { set##NAME( !m_##NAME ); \ } -#define TRIGGER_CALLBACK( NAME, CALLBACK ) \ - TRIGGER_CALLBACK_##CALLBACK( NAME ); - -#define TRIGGER_CALLBACK_NO_CB( NAME ) -#define TRIGGER_CALLBACK_WITH_CB( NAME ) \ - NAME##Changed(); - #ifdef null #undef null #endif // null diff -r 72ad83a67165 -r 0334789cb4d7 src/configDialog.h --- a/src/configDialog.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/configDialog.h Thu Dec 05 23:42:39 2013 +0200 @@ -28,8 +28,8 @@ // ============================================================================= class ShortcutListItem : public QListWidgetItem -{ PROPERTY (public, KeySequenceConfig*, KeyConfig, NO_OPS, NO_CB) - PROPERTY (public, QAction*, Action, NO_OPS, NO_CB) +{ PROPERTY (public, KeySequenceConfig*, KeyConfig, NO_OPS, STOCK_WRITE) + PROPERTY (public, QAction*, Action, NO_OPS, STOCK_WRITE) public: explicit ShortcutListItem (QListWidget* view = null, int type = Type) : diff -r 72ad83a67165 -r 0334789cb4d7 src/dialogs.cpp --- a/src/dialogs.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/dialogs.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -250,8 +250,9 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void OpenProgressDialog::NumLinesChanged() -{ ui->progressBar->setRange (0, getNumLines()); +void OpenProgressDialog::setNumLines (int const& a) +{ m_NumLines = a; + ui->progressBar->setRange (0, getNumLines()); updateValues(); } diff -r 72ad83a67165 -r 0334789cb4d7 src/dialogs.h --- a/src/dialogs.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/dialogs.h Thu Dec 05 23:42:39 2013 +0200 @@ -92,8 +92,8 @@ // ============================================================================= class OpenProgressDialog : public QDialog { Q_OBJECT - PROPERTY (public, int, Progress, NUM_OPS, NO_CB) - PROPERTY (public, int, NumLines, NUM_OPS, WITH_CB) + PROPERTY (public, int, Progress, NUM_OPS, STOCK_WRITE) + PROPERTY (public, int, NumLines, NUM_OPS, CUSTOM_WRITE) public: explicit OpenProgressDialog (QWidget* parent = null, Qt::WindowFlags f = 0); diff -r 72ad83a67165 -r 0334789cb4d7 src/download.h --- a/src/download.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/download.h Thu Dec 05 23:42:39 2013 +0200 @@ -36,8 +36,8 @@ // ----------------------------------------------------------------------------- class PartDownloader : public QDialog { Q_OBJECT - PROPERTY (public, LDFile*, PrimaryFile, NO_OPS, NO_CB) - PROPERTY (public, bool, Aborted, BOOL_OPS, NO_CB) + PROPERTY (public, LDFile*, PrimaryFile, NO_OPS, STOCK_WRITE) + PROPERTY (public, bool, Aborted, BOOL_OPS, STOCK_WRITE) public: constexpr static const char* k_UnofficialURL = "http://ldraw.org/library/unofficial/"; @@ -87,7 +87,7 @@ // ----------------------------------------------------------------------------- class PartDownloadRequest : public QObject { Q_OBJECT - PROPERTY (public, int, TableRow, NUM_OPS, NO_CB) + PROPERTY (public, int, TableRow, NUM_OPS, STOCK_WRITE) public: enum State diff -r 72ad83a67165 -r 0334789cb4d7 src/file.h --- a/src/file.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/file.h Thu Dec 05 23:42:39 2013 +0200 @@ -53,15 +53,15 @@ // ============================================================================= class LDFile : public QObject { Q_OBJECT - PROPERTY (private, QList, Objects, NO_OPS, NO_CB) - PROPERTY (private, History*, History, NO_OPS, NO_CB) - PROPERTY (private, QList, Vertices, NO_OPS, NO_CB) - PROPERTY (public, str, Name, STR_OPS, NO_CB) - PROPERTY (public, str, DefaultName, STR_OPS, NO_CB) - PROPERTY (public, bool, Implicit, BOOL_OPS, NO_CB) - PROPERTY (public, QList, Cache, NO_OPS, NO_CB) - PROPERTY (public, long, SavePosition, NUM_OPS, NO_CB) - PROPERTY (public, QListWidgetItem*, ListItem, NO_OPS, NO_CB) + PROPERTY (private, QList, Objects, NO_OPS, STOCK_WRITE) + PROPERTY (private, History*, History, NO_OPS, STOCK_WRITE) + PROPERTY (private, QList, Vertices, NO_OPS, STOCK_WRITE) + PROPERTY (public, str, Name, STR_OPS, STOCK_WRITE) + PROPERTY (public, str, DefaultName, STR_OPS, STOCK_WRITE) + PROPERTY (public, bool, Implicit, BOOL_OPS, STOCK_WRITE) + PROPERTY (public, QList, Cache, NO_OPS, STOCK_WRITE) + PROPERTY (public, long, SavePosition, NUM_OPS, STOCK_WRITE) + PROPERTY (public, QListWidgetItem*, ListItem, NO_OPS, STOCK_WRITE) public: LDFile(); @@ -181,13 +181,13 @@ // ============================================================================= class FileLoader : public QObject { Q_OBJECT - PROPERTY (private, QList, Objects, NO_OPS, NO_CB) - PROPERTY (private, bool, Done, BOOL_OPS, NO_CB) - PROPERTY (private, int, Progress, NUM_OPS, NO_CB) - PROPERTY (private, bool, Aborted, BOOL_OPS, NO_CB) - PROPERTY (public, QStringList, Lines, NO_OPS, NO_CB) - PROPERTY (public, int*, Warnings, NO_OPS, NO_CB) - PROPERTY (public, bool, OnForeground, BOOL_OPS, NO_CB) + PROPERTY (private, QList, Objects, NO_OPS, STOCK_WRITE) + PROPERTY (private, bool, Done, BOOL_OPS, STOCK_WRITE) + PROPERTY (private, int, Progress, NUM_OPS, STOCK_WRITE) + PROPERTY (private, bool, Aborted, BOOL_OPS, STOCK_WRITE) + PROPERTY (public, QStringList, Lines, NO_OPS, STOCK_WRITE) + PROPERTY (public, int*, Warnings, NO_OPS, STOCK_WRITE) + PROPERTY (public, bool, OnForeground, BOOL_OPS, STOCK_WRITE) public slots: void start(); diff -r 72ad83a67165 -r 0334789cb4d7 src/gldraw.cpp --- a/src/gldraw.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/gldraw.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -1290,8 +1290,10 @@ // ============================================================================= // ----------------------------------------------------------------------------- -void GLRenderer::EditModeChanged() -{ switch (getEditMode()) +void GLRenderer::setEditMode (EditMode const& a) +{ m_EditMode = a; + + switch (a) { case Select: { unsetCursor(); setContextMenuPolicy (Qt::DefaultContextMenu); @@ -1326,8 +1328,10 @@ update(); } -void GLRenderer::FileChanged() -{ if (getFile() != null) +void GLRenderer::setFile (LDFile* const& a) +{ m_File = a; + + if (a != null) initOverlaysFromObjects(); } diff -r 72ad83a67165 -r 0334789cb4d7 src/gldraw.h --- a/src/gldraw.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/gldraw.h Thu Dec 05 23:42:39 2013 +0200 @@ -63,11 +63,11 @@ class GLRenderer : public QGLWidget { Q_OBJECT - PROPERTY (public, bool, DrawOnly, BOOL_OPS, NO_CB) - PROPERTY (public, MessageManager*, MessageLog, NO_OPS, NO_CB) - PROPERTY (private, bool, Picking, BOOL_OPS, NO_CB) - PROPERTY (public, LDFile*, File, NO_OPS, WITH_CB) - PROPERTY (public, EditMode, EditMode, NO_OPS, WITH_CB) + PROPERTY (public, bool, DrawOnly, BOOL_OPS, STOCK_WRITE) + PROPERTY (public, MessageManager*, MessageLog, NO_OPS, STOCK_WRITE) + PROPERTY (private, bool, Picking, BOOL_OPS, STOCK_WRITE) + PROPERTY (public, LDFile*, File, NO_OPS, CUSTOM_WRITE) + PROPERTY (public, EditMode, EditMode, NO_OPS, CUSTOM_WRITE) public: enum Camera { Top, Front, Left, Bottom, Back, Right, Free }; diff -r 72ad83a67165 -r 0334789cb4d7 src/gui.cpp --- a/src/gui.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/gui.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -321,7 +321,7 @@ case LDObject::Subfile: { LDSubfile* ref = static_cast (obj); - descr = fmt ("%1 %2, (", ref->getFileInfo()->getName(), ref->position().stringRep (true)); + descr = fmt ("%1 %2, (", ref->getFileInfo()->getName(), ref->getPosition().stringRep (true)); for (int i = 0; i < 9; ++i) descr += fmt ("%1%2", ref->getTransform()[i], (i != 8) ? " " : ""); diff -r 72ad83a67165 -r 0334789cb4d7 src/gui.h --- a/src/gui.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/gui.h Thu Dec 05 23:42:39 2013 +0200 @@ -59,8 +59,8 @@ // ============================================================================= class LDQuickColor -{ PROPERTY (public, LDColor*, Color, NO_OPS, NO_CB) - PROPERTY (public, QToolButton*, ToolButton, NO_OPS, NO_CB) +{ PROPERTY (public, LDColor*, Color, NO_OPS, STOCK_WRITE) + PROPERTY (public, QToolButton*, ToolButton, NO_OPS, STOCK_WRITE) public: LDQuickColor (LDColor* color, QToolButton* toolButton); diff -r 72ad83a67165 -r 0334789cb4d7 src/gui_editactions.cpp --- a/src/gui_editactions.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/gui_editactions.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -457,7 +457,7 @@ { LDMatrixObject* mo = dynamic_cast (obj); // Transform the position - vertex v = mo->position(); + vertex v = mo->getPosition(); rotateVertex (v, rotpoint, transform); mo->setPosition (v); diff -r 72ad83a67165 -r 0334789cb4d7 src/history.h --- a/src/history.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/history.h Thu Dec 05 23:42:39 2013 +0200 @@ -32,9 +32,9 @@ // ============================================================================= class History -{ PROPERTY (private, long, Position, NUM_OPS, NO_CB) - PROPERTY (public, LDFile*, File, NO_OPS, NO_CB) - PROPERTY (public, bool, Ignoring, BOOL_OPS, NO_CB) +{ PROPERTY (private, long, Position, NUM_OPS, STOCK_WRITE) + PROPERTY (public, LDFile*, File, NO_OPS, STOCK_WRITE) + PROPERTY (public, bool, Ignoring, BOOL_OPS, STOCK_WRITE) public: typedef QList Changeset; @@ -78,7 +78,7 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= class AbstractHistoryEntry -{ PROPERTY (public, History*, Parent, NO_OPS, NO_CB) +{ PROPERTY (public, History*, Parent, NO_OPS, STOCK_WRITE) public: virtual ~AbstractHistoryEntry() {} @@ -93,8 +93,8 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= class DelHistory : public AbstractHistoryEntry -{ PROPERTY (private, int, Index, NO_OPS, NO_CB) - PROPERTY (private, str, Code, NO_OPS, NO_CB) +{ PROPERTY (private, int, Index, NO_OPS, STOCK_WRITE) + PROPERTY (private, str, Code, NO_OPS, STOCK_WRITE) public: IMPLEMENT_HISTORY_TYPE (Del) @@ -108,9 +108,9 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= class EditHistory : public AbstractHistoryEntry -{ PROPERTY (private, int, Index, NO_OPS, NO_CB) - PROPERTY (private, str, OldCode, NO_OPS, NO_CB) - PROPERTY (private, str, NewCode, NO_OPS, NO_CB) +{ PROPERTY (private, int, Index, NO_OPS, STOCK_WRITE) + PROPERTY (private, str, OldCode, NO_OPS, STOCK_WRITE) + PROPERTY (private, str, NewCode, NO_OPS, STOCK_WRITE) public: IMPLEMENT_HISTORY_TYPE (Edit) @@ -125,8 +125,8 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= class AddHistory : public AbstractHistoryEntry -{ PROPERTY (private, int, Index, NO_OPS, NO_CB) - PROPERTY (private, str, Code, NO_OPS, NO_CB) +{ PROPERTY (private, int, Index, NO_OPS, STOCK_WRITE) + PROPERTY (private, str, Code, NO_OPS, STOCK_WRITE) public: IMPLEMENT_HISTORY_TYPE (Add) diff -r 72ad83a67165 -r 0334789cb4d7 src/ldtypes.cpp --- a/src/ldtypes.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/ldtypes.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -104,7 +104,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- str LDSubfile::raw() -{ str val = fmt ("1 %1 %2 ", getColor(), position()); +{ str val = fmt ("1 %1 %2 ", getColor(), getPosition()); val += getTransform().stringRep(); val += ' '; val += getFileInfo()->getName(); @@ -299,7 +299,7 @@ case LDObject::Subfile: { LDSubfile* ref = static_cast (obj); matrix newMatrix = transform * ref->getTransform(); - vertex newpos = ref->position(); + vertex newpos = ref->getPosition(); newpos.transform (transform, pos); ref->setPosition (newpos); @@ -324,7 +324,7 @@ for (LDObject * obj : objs) { // Set the parent now so we know what inlined this. obj->setParent (this); - transformObject (obj, getTransform(), position(), getColor()); + transformObject (obj, getTransform(), getPosition(), getColor()); } return objs; @@ -497,7 +497,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- void LDSubfile::move (vertex vect) -{ setPosition (position() + vect); +{ setPosition (getPosition() + vect); } // ============================================================================= @@ -691,11 +691,7 @@ // ============================================================================= // ----------------------------------------------------------------------------- -const int& LDObject::getColor() const -{ return m_Color; -} - -void LDObject::setColor (int val) +void LDObject::setColor (const int& val) { changeProperty (this, &m_Color, val); } diff -r 72ad83a67165 -r 0334789cb4d7 src/ldtypes.h --- a/src/ldtypes.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/ldtypes.h Thu Dec 05 23:42:39 2013 +0200 @@ -63,11 +63,12 @@ // sub-classes based on this enumerator. // ============================================================================= class LDObject -{ PROPERTY (public, bool, Hidden, BOOL_OPS, NO_CB) - PROPERTY (public, bool, Selected, BOOL_OPS, NO_CB) - PROPERTY (public, LDObject*, Parent, NO_OPS, NO_CB) - PROPERTY (public, LDFile*, File, NO_OPS, NO_CB) - PROPERTY (private, int32, ID, NUM_OPS, NO_CB) +{ PROPERTY (public, bool, Hidden, BOOL_OPS, STOCK_WRITE) + PROPERTY (public, bool, Selected, BOOL_OPS, STOCK_WRITE) + PROPERTY (public, LDObject*, Parent, NO_OPS, STOCK_WRITE) + PROPERTY (public, LDFile*, File, NO_OPS, STOCK_WRITE) + PROPERTY (private, int32, ID, NUM_OPS, STOCK_WRITE) + PROPERTY (public, int, Color, NUM_OPS, CUSTOM_WRITE) public: // Object type codes. Codes are sorted in order of significance. @@ -94,7 +95,6 @@ { return 0; // Creates a new LDObject identical to this one. } long getIndex() const; // Index (i.e. line number) of this object - const int& getColor() const; // Color of this object virtual LDObject::Type getType() const; // Type enumerator of this object const vertex& getVertex (int i) const; // Get a vertex by index virtual str getTypeName() const; // Type name of this object @@ -108,7 +108,6 @@ virtual str raw() { return ""; } // This object as LDraw code void replace (LDObject* other); // Replace this LDObject with another LDObject. Object is deleted in the process. void select(); - void setColor (int val); void setVertex (int i, const vertex& vert); // Set a vertex to the given value void setVertexCoord (int i, Axis ax, double value); // Set a single coordinate of a vertex void swap (LDObject* other); // Swap this object with another. @@ -135,7 +134,6 @@ private: LDSharedVertex* m_coords[4]; - int m_Color; }; // ============================================================================= @@ -182,7 +180,9 @@ // this class distinct in case I get new extension ideas. :) // ============================================================================= class LDMatrixObject -{ PROPERTY (public, LDObject*, LinkPointer, NO_OPS, NO_CB) +{ PROPERTY (public, LDObject*, LinkPointer, NO_OPS, STOCK_WRITE) + PROPERTY (public, vertex, Position, NO_OPS, CUSTOM_WRITE) + PROPERTY (public, matrix, Transform, NO_OPS, CUSTOM_WRITE) public: LDMatrixObject() {} @@ -190,27 +190,15 @@ m_Transform (transform), m_position (LDSharedVertex::getSharedVertex (pos)) {} - const vertex& position() const - { return m_position->data(); - } - - void setPosition (const vertex& a); - void setTransform (const matrix& val); - const double& setCoordinate (const Axis ax, double value) - { vertex v = position(); + { vertex v = getPosition(); v[ax] = value; setPosition (v); - return position() [ax]; - } - - inline const matrix& getTransform() const - { return m_Transform; + return getPosition()[ax]; } private: - matrix m_Transform; LDSharedVertex* m_position; }; @@ -229,7 +217,7 @@ LDOBJ_UNCOLORED LDOBJ_SCEMANTIC LDOBJ_NO_MATRIX - PROPERTY (public, str, FileReferenced, STR_OPS, NO_CB) + PROPERTY (public, str, FileReferenced, STR_OPS, STOCK_WRITE) public: LDError(); @@ -327,7 +315,7 @@ LDOBJ_COLORED LDOBJ_SCEMANTIC LDOBJ_HAS_MATRIX - PROPERTY (public, LDFile*, FileInfo, NO_OPS, NO_CB) + PROPERTY (public, LDFile*, FileInfo, NO_OPS, STOCK_WRITE) public: enum InlineFlag @@ -471,12 +459,12 @@ LDOBJ_UNCOLORED LDOBJ_NON_SCEMANTIC LDOBJ_NO_MATRIX - PROPERTY (public, int, Camera, NUM_OPS, NO_CB) - PROPERTY (public, int, X, NUM_OPS, NO_CB) - PROPERTY (public, int, Y, NUM_OPS, NO_CB) - PROPERTY (public, int, Width, NUM_OPS, NO_CB) - PROPERTY (public, int, Height, NUM_OPS, NO_CB) - PROPERTY (public, str, FileName, STR_OPS, NO_CB) + PROPERTY (public, int, Camera, NUM_OPS, STOCK_WRITE) + PROPERTY (public, int, X, NUM_OPS, STOCK_WRITE) + PROPERTY (public, int, Y, NUM_OPS, STOCK_WRITE) + PROPERTY (public, int, Width, NUM_OPS, STOCK_WRITE) + PROPERTY (public, int, Height, NUM_OPS, STOCK_WRITE) + PROPERTY (public, str, FileName, STR_OPS, STOCK_WRITE) }; // Other common LDraw stuff diff -r 72ad83a67165 -r 0334789cb4d7 src/messagelog.h --- a/src/messagelog.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/messagelog.h Thu Dec 05 23:42:39 2013 +0200 @@ -39,7 +39,7 @@ */ class MessageManager : public QObject { Q_OBJECT - PROPERTY (public, GLRenderer*, Renderer, NO_OPS, NO_CB) + PROPERTY (public, GLRenderer*, Renderer, NO_OPS, STOCK_WRITE) public: // Single line of the message log. diff -r 72ad83a67165 -r 0334789cb4d7 src/misc.cpp --- a/src/misc.cpp Thu Dec 05 23:20:50 2013 +0200 +++ b/src/misc.cpp Thu Dec 05 23:42:39 2013 +0200 @@ -188,21 +188,23 @@ switch (edit_rotpoint) { case ObjectOrigin: - - // Calculate center vertex - for (LDObject * obj : objs) + { // Calculate center vertex + for (LDObject* obj : objs) if (obj->hasMatrix()) - box << dynamic_cast (obj)->position(); + box << dynamic_cast (obj)->getPosition(); else box << obj; return box.center(); + } case WorldOrigin: - return g_origin; + { return g_origin; + } case CustomPoint: - return vertex (edit_rotpoint_x, edit_rotpoint_y, edit_rotpoint_z); + { return vertex (edit_rotpoint_x, edit_rotpoint_y, edit_rotpoint_z); + } } return vertex(); diff -r 72ad83a67165 -r 0334789cb4d7 src/primitives.h --- a/src/primitives.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/primitives.h Thu Dec 05 23:42:39 2013 +0200 @@ -33,7 +33,7 @@ }; class PrimitiveCategory -{ PROPERTY (public, str, Name, STR_OPS, NO_CB) +{ PROPERTY (public, str, Name, STR_OPS, STOCK_WRITE) public: enum Type diff -r 72ad83a67165 -r 0334789cb4d7 src/types.h --- a/src/types.h Thu Dec 05 23:20:50 2013 +0200 +++ b/src/types.h Thu Dec 05 23:42:39 2013 +0200 @@ -296,9 +296,9 @@ // v0 is the minimum vertex, v1 is the maximum vertex. // ============================================================================= class LDBoundingBox -{ PROPERTY (private, bool, Empty, BOOL_OPS, NO_CB) - PROPERTY (private, vertex, Vertex0, NO_OPS, NO_CB) - PROPERTY (private, vertex, Vertex1, NO_OPS, NO_CB) +{ PROPERTY (private, bool, Empty, BOOL_OPS, STOCK_WRITE) + PROPERTY (private, vertex, Vertex0, NO_OPS, STOCK_WRITE) + PROPERTY (private, vertex, Vertex1, NO_OPS, STOCK_WRITE) public: LDBoundingBox();