Review Request: Add support for dr3d:scene and its children

Thorsten Zachmann t.zachmann at zagge.de
Tue Jun 19 05:52:53 BST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105292/#review14870
-----------------------------------------------------------


The saved odf is invalid. Please do not commit it like that.

e.g. the loaded dr3d:cube has the following attributes

<dr3d:cube draw:style-name="gr2" draw:layer="layout"/>

When it is saved it saves like

<dr3d:cube draw:style-name="gr1" xml:id="shape-4" draw:id="shape-4" draw:layer="" svg:width="50.00000000000pt" svg:height="50.00000000000pt" svg:x="280.34694236200pt" svg:y="208.34681763000pt" dr3d:min-edge="(0 0 0)" dr3d:max-edge="(1 1 1)"/>

however svd:width, svg:height, svg:x and svg:y are not allowed as attibutes here.

When saving dr3d:vrp and dr3d:vpn you loose precition.
On loading it is dr3d:vrp="(0 0 16885.7142857143)" dr3d:vpn="(0 0 14285.7142857143)" on saving it is dr3d:vrp="(0 0 16885.7)" dr3d:vpn="(0 0 14285.7)"




plugins/staging/threedshape/Objects.h
<http://git.reviewboard.kde.org/r/105292/#comment11679>

    Each class should be put into its own cpp file to follow the coding standard.



plugins/staging/threedshape/Objects.h
<http://git.reviewboard.kde.org/r/105292/#comment11680>

    Please move the implementation to the cpp file.



plugins/staging/threedshape/Objects.cpp
<http://git.reviewboard.kde.org/r/105292/#comment11686>

    The shape does not support most attributes. That is also true for all othere objects you load.



plugins/staging/threedshape/Objects.cpp
<http://git.reviewboard.kde.org/r/105292/#comment11685>

    This generates invalid odf as the sphere does not support the attributes that are saved here.



plugins/staging/threedshape/ThreedShapePlugin.cpp
<http://git.reviewboard.kde.org/r/105292/#comment11681>

    This line gives a compile error as the file is not there.


- Thorsten Zachmann


On June 18, 2012, 4:14 p.m., Inge Wallin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105292/
> -----------------------------------------------------------
> 
> (Updated June 18, 2012, 4:14 p.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Description
> -------
> 
> This patch adds rudimentary support for the dr3d:scene element and its children by introducing a 3D shape. The 3D support in ODF is pretty simple: it just defines 4 different object types: cube, sphere, extrude and rotate as well as a scene element that acts a bit like a group (draw:g).
> 
> I implemented all the object types as KoShapes because they can have styling and the scene object is also a KoShapeContainer. None of the shapes except for the scene itself can be modified now, and for the scene it's only the standard shape parameters (size, position, transform, etc).
> 
> My plan is to work in 3 stages:
> 1. Loading and saving - this prevents data loss
> 2. Rendering - this implements viewing
> 3. Scene and object editing
> This patch implements stage 1 only.
> 
> My goal was to load dr3d:scenes and save them back with full compatibility with OOo and LO. Unfortunately I didn't manage to do that yet. 
> 
> I have tested with Karbon during the development and it loads and savs the scenes nicely. But calling KoShape::loadOdfAttributes(..., OdfAllAttributes) in karbon still loses the layer information. This makes OOo/LO not show the shapes when they are loaded again after a roundtrip through Karbon. I have not been able to analyze why Karbon saves back all shapes with layer="" when the infile clearly has layer="layout".
> 
> And if I want to make it work in Words and presumably also Stage (and Sheets?) I have to integrate it with the KoInlineObjectRegistry in kotext, something that I have also not yet managed to do. Help would be appreciated here.
> 
> But until Karbon is fixed and Words integration is done, I'm happy to receive and integrate feedback here.
> 
> 
> Diffs
> -----
> 
>   plugins/staging/CMakeLists.txt f55b316 
>   plugins/staging/threedshape/CMakeLists.txt PRE-CREATION 
>   plugins/staging/threedshape/Messages.sh PRE-CREATION 
>   plugins/staging/threedshape/Objects.h PRE-CREATION 
>   plugins/staging/threedshape/Objects.cpp PRE-CREATION 
>   plugins/staging/threedshape/PLAN PRE-CREATION 
>   plugins/staging/threedshape/SceneObject.h PRE-CREATION 
>   plugins/staging/threedshape/SceneObject.cpp PRE-CREATION 
>   plugins/staging/threedshape/ThreedShapeFactory.h PRE-CREATION 
>   plugins/staging/threedshape/ThreedShapeFactory.cpp PRE-CREATION 
>   plugins/staging/threedshape/ThreedShapePlugin.h PRE-CREATION 
>   plugins/staging/threedshape/ThreedShapePlugin.cpp PRE-CREATION 
>   plugins/staging/threedshape/threedshape.desktop PRE-CREATION 
>   plugins/staging/threedshape/utils.h PRE-CREATION 
>   plugins/staging/threedshape/utils.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/105292/diff/
> 
> 
> Testing
> -------
> 
> Tested with a simple ODG file containing 3D objects.
> 
> 
> Thanks,
> 
> Inge Wallin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20120619/756fc990/attachment.htm>


More information about the calligra-devel mailing list