On Thu 01-01-15 17:16:48, Leonardo Zide wrote: > There's a new 'Model' menu where you can create new submodels and switch > between them. Models will also be listed in a 'Models' category in the > Parts List and can be added to the current model and moved as if they were > a simple part.
Hello Leonardo, submodels support is a useful improvement of leocad, thanks for that! I have tested it with my MPD files and it works nicely. I found some issues but they are more general, not about MPD support only: 1. my compiler (gcc 4.7.2 on Debian Linux) cries because of your syntax of '>>' in nested templates; the attached patch solves the problem 2. It seems you try to convert the transformation matrix to a combination of translation and rotation. That's not always possible (mathematically). I have an example MPD file with one submodel used both in usual and mirror image - and the second one is placed incorrectly in leocad. (I know this is not usual but no other CAD or renderer SW has any problem with this). http://atrey.karlin.mff.cuni.cz/~milanek/LEGO/6743-alt2/6743-alt2.mpd 3. After MPD model is saved back to the disk, all comments from original file are lost - this is a major problem because, you know, "comments" are used for many important data in LDR/MPD format: ROTSTEP, LPUB commands etc. 3a. That reminds me my feature request: can you show an editable textarea with the loaded model and sync it with View - like MLCAD or LPUB do? I know it is not easy but it would be the killer feature for me and probably for everybody who uses LPUB for making instructions. So far I need MLCAD (and Windows/Wine) for that :( 4. Showing the model as it is after Step 1 is confusing sometimes. I believe one wants to see the complete model after it is loaded. Can you go to the last step? Thanks again for your work, Milan
>From e67cba1094f19f6a487828040c7d3494b4947a2d Mon Sep 17 00:00:00 2001 From: Milan Vancura <[email protected]> Date: Fri, 31 Oct 2014 23:19:58 +0100 Subject: [PATCH] Make compiler happy even prior the standard c++11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘>>’ should be ‘> >’ within a nested template argument list --- common/camera.h | 6 +++--- common/light.h | 16 ++++++++-------- common/object.h | 12 ++++++------ common/piece.h | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/common/camera.h b/common/camera.h index 97478ad..0f95e52 100644 --- a/common/camera.h +++ b/common/camera.h @@ -309,9 +309,9 @@ public: TiledRender* m_pTR; protected: - lcArray<lcObjectKey<lcVector3>> mPositionKeys; - lcArray<lcObjectKey<lcVector3>> mTargetPositionKeys; - lcArray<lcObjectKey<lcVector3>> mUpVectorKeys; + lcArray<lcObjectKey<lcVector3> > mPositionKeys; + lcArray<lcObjectKey<lcVector3> > mTargetPositionKeys; + lcArray<lcObjectKey<lcVector3> > mUpVectorKeys; void Initialize(); diff --git a/common/light.h b/common/light.h index a2992fd..c1ca981 100644 --- a/common/light.h +++ b/common/light.h @@ -211,14 +211,14 @@ public: float mSpotExponent; protected: - lcArray<lcObjectKey<lcVector3>> mPositionKeys; - lcArray<lcObjectKey<lcVector3>> mTargetPositionKeys; - lcArray<lcObjectKey<lcVector4>> mAmbientColorKeys; - lcArray<lcObjectKey<lcVector4>> mDiffuseColorKeys; - lcArray<lcObjectKey<lcVector4>> mSpecularColorKeys; - lcArray<lcObjectKey<lcVector3>> mAttenuationKeys; - lcArray<lcObjectKey<float>> mSpotCutoffKeys; - lcArray<lcObjectKey<float>> mSpotExponentKeys; + lcArray<lcObjectKey<lcVector3> > mPositionKeys; + lcArray<lcObjectKey<lcVector3> > mTargetPositionKeys; + lcArray<lcObjectKey<lcVector4> > mAmbientColorKeys; + lcArray<lcObjectKey<lcVector4> > mDiffuseColorKeys; + lcArray<lcObjectKey<lcVector4> > mSpecularColorKeys; + lcArray<lcObjectKey<lcVector3> > mAttenuationKeys; + lcArray<lcObjectKey<float> > mSpotCutoffKeys; + lcArray<lcObjectKey<float> > mSpotExponentKeys; void Initialize(const lcVector3& Position, const lcVector3& TargetPosition); diff --git a/common/object.h b/common/object.h index d0898a0..e74d572 100644 --- a/common/object.h +++ b/common/object.h @@ -107,7 +107,7 @@ public: protected: template<typename T> - void SaveKeysLDraw(QTextStream& Stream, const lcArray<lcObjectKey<T>>& Keys, const char* KeyName) const + void SaveKeysLDraw(QTextStream& Stream, const lcArray<lcObjectKey<T> >& Keys, const char* KeyName) const { const int Count = sizeof(T) / sizeof(float); for (int KeyIdx = 0; KeyIdx < Keys.GetSize(); KeyIdx++) @@ -121,7 +121,7 @@ protected: } template<typename T> - void LoadKeysLDraw(QTextStream& Stream, lcArray<lcObjectKey<T>>& Keys) + void LoadKeysLDraw(QTextStream& Stream, lcArray<lcObjectKey<T> >& Keys) { QString Token; Stream >> Token; @@ -139,7 +139,7 @@ protected: } template<typename T> - const T& CalculateKey(const lcArray<lcObjectKey<T>>& Keys, lcStep Step) + const T& CalculateKey(const lcArray<lcObjectKey<T> >& Keys, lcStep Step) { lcObjectKey<T>* PreviousKey = &Keys[0]; @@ -155,7 +155,7 @@ protected: } template<typename T> - void ChangeKey(lcArray<lcObjectKey<T>>& Keys, const T& Value, lcStep Step, bool AddKey) + void ChangeKey(lcArray<lcObjectKey<T> >& Keys, const T& Value, lcStep Step, bool AddKey) { lcObjectKey<T>* Key; @@ -201,7 +201,7 @@ protected: } template<typename T> - void InsertTime(lcArray<lcObjectKey<T>>& Keys, lcStep Start, lcStep Time) + void InsertTime(lcArray<lcObjectKey<T> >& Keys, lcStep Start, lcStep Time) { bool EndKey = false; @@ -230,7 +230,7 @@ protected: } template<typename T> - void RemoveTime(lcArray<lcObjectKey<T>>& Keys, lcStep Start, lcStep Time) + void RemoveTime(lcArray<lcObjectKey<T> >& Keys, lcStep Start, lcStep Time) { for (int KeyIdx = 0; KeyIdx < Keys.GetSize(); KeyIdx++) { diff --git a/common/piece.h b/common/piece.h index 0472001..c54a600 100644 --- a/common/piece.h +++ b/common/piece.h @@ -197,8 +197,8 @@ public: lcVector4 mRotation; protected: - lcArray<lcObjectKey<lcVector3>> mPositionKeys; - lcArray<lcObjectKey<lcVector4>> mRotationKeys; + lcArray<lcObjectKey<lcVector3> > mPositionKeys; + lcArray<lcObjectKey<lcVector4> > mRotationKeys; // Atributes lcGroup* mGroup; -- 1.7.10.4
_______________________________________________ Leocad mailing list [email protected] https://list.gerf.org/listinfo/leocad
