drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx | 30 + drawinglayer/source/dumper/EnhancedShapeDumper.cxx | 325 ++++++++++++++++++ 2 files changed, 355 insertions(+)
New commits: commit 4a42710b8da84c77e75c091bd27d3dc91b52e987 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 21:26:01 2012 +0200 Added dumping ExtrusionColor property Change-Id: I5df2f997494c399921a6657aecbb0d9a40977e93 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index ed35546..eaf7e9e 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -76,6 +76,7 @@ public: void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint); void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); + void dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 152e1fa..51caccc 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -170,6 +170,12 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aOrigin) dumpOriginAsElement(aOrigin); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ExtrusionColor"); + sal_Bool bExtrusionColor; + if(anotherAny >>= bExtrusionColor) + dumpExtrusionColorAsAttribute(bExtrusionColor); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -375,4 +381,11 @@ void EnhancedShapeDumper::dumpOriginAsElement(drawing::EnhancedCustomShapeParame xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpExtrusionColorAsAttribute(sal_Bool bExtrusionColor) +{ + if(bExtrusionColor) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionColor"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("extrusionColor"), "%s", "false"); +} commit 778a433b1942320c557b40378f77cbf7f06cb75f Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 21:23:31 2012 +0200 Added properties ViewPoint & Origin Change-Id: I87deba7504eff3feb6671835b33768045f502ba5 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 5a5fbf8..ed35546 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -33,6 +33,7 @@ #include <com/sun/star/drawing/Direction3D.hpp> #include <com/sun/star/drawing/ShadeMode.hpp> #include <com/sun/star/drawing/ProjectionMode.hpp> +#include <com/sun/star/drawing/Position3D.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -73,6 +74,8 @@ public: void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); void dumpSpecularityAsAttribute(double aSpecularity); void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); + void dumpViewPointAsElement(com::sun::star::drawing::Position3D aViewPoint); + void dumpOriginAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aOrigin); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 5b9b5ac..152e1fa 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -158,6 +158,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= eProjectionMode) dumpProjectionModeAsAttribute(eProjectionMode); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ViewPoint"); + drawing::Position3D aViewPoint; + if(anotherAny >>= aViewPoint) + dumpViewPointAsElement(aViewPoint); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Origin"); + drawing::EnhancedCustomShapeParameterPair aOrigin; + if(anotherAny >>= aOrigin) + dumpOriginAsElement(aOrigin); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -347,4 +359,20 @@ void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode } } +void EnhancedShapeDumper::dumpViewPointAsElement(drawing::Position3D aViewPoint) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "ViewPoint" )); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionX"), "%f", aViewPoint.PositionX); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionY"), "%f", aViewPoint.PositionY); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("positionZ"), "%f", aViewPoint.PositionZ); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpOriginAsElement(drawing::EnhancedCustomShapeParameterPair aOrigin) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Origin" )); + dumpEnhancedCustomShapeParameterPair(aOrigin); + xmlTextWriterEndElement( xmlWriter ); +} + commit e32745f3009189d408fadf3cf2c6c92a402d2925 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 21:10:05 2012 +0200 Added properties Specularity & ProjectionMode Change-Id: I9e614c571f8d8db1cf00d3251cc4b09ff1dde278 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 51ab821..5a5fbf8 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/Direction3D.hpp> #include <com/sun/star/drawing/ShadeMode.hpp> +#include <com/sun/star/drawing/ProjectionMode.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -70,6 +71,8 @@ public: void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); void dumpShininessAsAttribute(double aShininess); void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); + void dumpSpecularityAsAttribute(double aSpecularity); + void dumpProjectionModeAsAttribute(com::sun::star::drawing::ProjectionMode eProjectionMode); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 85c5787..5b9b5ac 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -146,6 +146,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSkew) dumpSkewAsElement(aSkew); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Specularity"); + double aSpecularity; + if(anotherAny >>= aSpecularity) + dumpSpecularityAsAttribute(aSpecularity); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ProjectionMode"); + drawing::ProjectionMode eProjectionMode; + if(anotherAny >>= eProjectionMode) + dumpProjectionModeAsAttribute(eProjectionMode); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -315,4 +327,24 @@ void EnhancedShapeDumper::dumpSkewAsElement(drawing::EnhancedCustomShapeParamete xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpSpecularityAsAttribute(double aSpecularity) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("specularity"), "%f", aSpecularity); +} + +void EnhancedShapeDumper::dumpProjectionModeAsAttribute(drawing::ProjectionMode eProjectionMode) +{ + switch(eProjectionMode) + { + case drawing::ProjectionMode_PARALLEL: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("projectionMode"), "%s", "PARALLEL"); + break; + case drawing::ProjectionMode_PERSPECTIVE: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("projectionMode"), "%s", "PERSPECTIVE"); + break; + default: + break; + } +} + commit 5075d2b217379de3c770e72259a49ab26f071fa5 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 21:04:52 2012 +0200 Added properties Shininess & Skew Change-Id: I8a78b918c94d769b71cc336f461318099db7b877 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 6e25dc9..51ab821 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -68,6 +68,8 @@ public: void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle); void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); + void dumpShininessAsAttribute(double aShininess); + void dumpSkewAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkew); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index dc92e42..85c5787 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -134,6 +134,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aRotationCenter) dumpRotationCenterAsElement(aRotationCenter); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Shininess"); + double aShininess; + if(anotherAny >>= aShininess) + dumpShininessAsAttribute(aShininess); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Skew"); + drawing::EnhancedCustomShapeParameterPair aSkew; + if(anotherAny >>= aSkew) + dumpSkewAsElement(aSkew); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -291,4 +303,16 @@ void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRota xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpShininessAsAttribute(double aShininess) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shininess"), "%f", aShininess); +} + +void EnhancedShapeDumper::dumpSkewAsElement(drawing::EnhancedCustomShapeParameterPair aSkew) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Skew" )); + dumpEnhancedCustomShapeParameterPair(aSkew); + xmlTextWriterEndElement( xmlWriter ); +} + commit fc8df34fab95df1ec4d1c5283b985bc96d5a1487 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 21:01:40 2012 +0200 Added properties RotateAngle & RotationCenter Change-Id: I97d52be4904657eacb7cea4ebec789e6dd9a4722 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index aca302b..6e25dc9 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -66,6 +66,8 @@ public: void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); void dumpMetalAsAttribute(sal_Bool bMetal); void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); + void dumpRotateAngleAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngle); + void dumpRotationCenterAsElement(com::sun::star::drawing::Direction3D aRotationCenter); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 527115f..dc92e42 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -122,6 +122,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= eShadeMode) dumpShadeModeAsAttribute(eShadeMode); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RotateAngle"); + drawing::EnhancedCustomShapeParameterPair aRotateAngle; + if(anotherAny >>= aRotateAngle) + dumpRotateAngleAsElement(aRotateAngle); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("RotationCenter"); + drawing::Direction3D aRotationCenter; + if(anotherAny >>= aRotationCenter) + dumpRotationCenterAsElement(aRotationCenter); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -265,4 +277,18 @@ void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode } } +void EnhancedShapeDumper::dumpRotateAngleAsElement(drawing::EnhancedCustomShapeParameterPair aRotateAngle) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RotateAngle" )); + dumpEnhancedCustomShapeParameterPair(aRotateAngle); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpRotationCenterAsElement(drawing::Direction3D aRotationCenter) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "RotationCenter" )); + dumpDirection3D(aRotationCenter); + xmlTextWriterEndElement( xmlWriter ); +} + commit 0f847ffb56bd47832a017c2e840597e6d5b5b33c Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 20:57:08 2012 +0200 Added properties Metal & ShadeMode Change-Id: I254a9089d78b97dde331812f77ad7977631b0d12 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index bc2e713..aca302b 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/Direction3D.hpp> +#include <com/sun/star/drawing/ShadeMode.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -63,6 +64,8 @@ public: void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); + void dumpMetalAsAttribute(sal_Bool bMetal); + void dumpShadeModeAsAttribute(com::sun::star::drawing::ShadeMode eShadeMode); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index a4eafb6..527115f 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -110,6 +110,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSecondLightDirection) dumpSecondLightDirectionAsElement(aSecondLightDirection); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Metal"); + sal_Bool bMetal; + if(anotherAny >>= bMetal) + dumpMetalAsAttribute(bMetal); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("ShadeMode"); + drawing::ShadeMode eShadeMode; + if(anotherAny >>= eShadeMode) + dumpShadeModeAsAttribute(eShadeMode); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -224,4 +236,33 @@ void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D xmlTextWriterEndElement( xmlWriter ); } +void EnhancedShapeDumper::dumpMetalAsAttribute(sal_Bool bMetal) +{ + if(bMetal) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("metal"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpShadeModeAsAttribute(drawing::ShadeMode eShadeMode) +{ + switch(eShadeMode) + { + case drawing::ShadeMode_FLAT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "FLAT"); + break; + case drawing::ShadeMode_PHONG: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "PHONG"); + break; + case drawing::ShadeMode_SMOOTH: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "SMOOTH"); + break; + case drawing::ShadeMode_DRAFT: + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("shadeMode"), "%s", "DRAFT"); + break; + default: + break; + } +} + commit b8a59ccabc5974562d868aa7d239aaf87d7f618c Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 20:52:32 2012 +0200 Added properties FirstLightDirection & SecondLightDirection Change-Id: I7236ac0df42765e351b75a75fa2fa66422a72277 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 2265a52..bc2e713 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -61,6 +61,8 @@ public: void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); void dumpFirstLightLevelAsAttribute(double aFirstLightLevel); void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); + void dumpFirstLightDirectionAsElement(com::sun::star::drawing::Direction3D aFirstLightDirection); + void dumpSecondLightDirectionAsElement(com::sun::star::drawing::Direction3D aSecondLightDirection); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 5cfb035..a4eafb6 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -98,6 +98,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aSecondLightLevel) dumpSecondLightLevelAsAttribute(aSecondLightLevel); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FirstLightDirection"); + drawing::Direction3D aFirstLightDirection; + if(anotherAny >>= aFirstLightDirection) + dumpFirstLightDirectionAsElement(aFirstLightDirection); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SecondLightDirection"); + drawing::Direction3D aSecondLightDirection; + if(anotherAny >>= aSecondLightDirection) + dumpSecondLightDirectionAsElement(aSecondLightDirection); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -198,4 +210,18 @@ void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionZ"), "%f", aDirection3D.DirectionZ); } +void EnhancedShapeDumper::dumpFirstLightDirectionAsElement(drawing::Direction3D aFirstLightDirection) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "FirstLightDirection" )); + dumpDirection3D(aFirstLightDirection); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpSecondLightDirectionAsElement(drawing::Direction3D aSecondLightDirection) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "SecondLightDirection" )); + dumpDirection3D(aSecondLightDirection); + xmlTextWriterEndElement( xmlWriter ); +} + commit c5b9d9c5ea6b4235b3b8e6a750dacf91b869c974 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 20:29:38 2012 +0200 Added auxiliary method for dumping Direction3D Change-Id: Id237d6c233857f83400c1aac0965f59ebc8daf4b diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 412c337..2265a52 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -30,6 +30,7 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> +#include <com/sun/star/drawing/Direction3D.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -46,6 +47,7 @@ public: // auxiliary functions void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); + void dumpDirection3D(com::sun::star::drawing::Direction3D aDirection3D); // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 15f65b9..5cfb035 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -191,4 +191,11 @@ void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLev xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel); } +void EnhancedShapeDumper::dumpDirection3D(drawing::Direction3D aDirection3D) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionX"), "%f", aDirection3D.DirectionX); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionY"), "%f", aDirection3D.DirectionY); + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("directionZ"), "%f", aDirection3D.DirectionZ); +} + commit 4eaf66e3c465b1ebe7424ae904bebc7ed8fd6664 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 20:25:52 2012 +0200 Added properties FirstLightLevel & SecondLightLevel Change-Id: Ia7ff7cd84c5b26d1a2f7898a271a800d9731b65f diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index b11666f..412c337 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -57,6 +57,8 @@ public: void dumpLightFaceAsAttribute(sal_Bool bLightFace); void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh); void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); + void dumpFirstLightLevelAsAttribute(double aFirstLightLevel); + void dumpSecondLightLevelAsAttribute(double aSecondLightLevel); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index b12a34b..15f65b9 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -86,6 +86,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= bSecondLightHarsh) dumpSecondLightHarshAsAttribute(bSecondLightHarsh); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FirstLightLevel"); + double aFirstLightLevel; + if(anotherAny >>= aFirstLightLevel) + dumpFirstLightLevelAsAttribute(aFirstLightLevel); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SecondLightLevel"); + double aSecondLightLevel; + if(anotherAny >>= aSecondLightLevel) + dumpSecondLightLevelAsAttribute(aSecondLightLevel); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -169,4 +181,14 @@ void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightH xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightHarsh"), "%s", "false"); } +void EnhancedShapeDumper::dumpFirstLightLevelAsAttribute(double aFirstLightLevel) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("firstLightLevel"), "%f", aFirstLightLevel); +} + +void EnhancedShapeDumper::dumpSecondLightLevelAsAttribute(double aSecondLightLevel) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightLevel"), "%f", aSecondLightLevel); +} + commit a3e8e6aecb52b9d663d44938c56d300497baf190 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 20:20:13 2012 +0200 Added properties FirstLightHarsh & SecondLightHarsh Change-Id: I628b5f390c9eb99542254f814b6b34a0b30dab57 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 99b4f34..b11666f 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -55,6 +55,8 @@ public: void dumpDiffusionAsAttribute(double aDiffusion); void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments); void dumpLightFaceAsAttribute(sal_Bool bLightFace); + void dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh); + void dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 8bf533f..b12a34b 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -74,6 +74,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= bLightFace) dumpLightFaceAsAttribute(bLightFace); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("FirstLightHarsh"); + sal_Bool bFirstLightHarsh; + if(anotherAny >>= bFirstLightHarsh) + dumpFirstLightHarshAsAttribute(bFirstLightHarsh); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("SecondLightHarsh"); + sal_Bool bSecondLightHarsh; + if(anotherAny >>= bSecondLightHarsh) + dumpSecondLightHarshAsAttribute(bSecondLightHarsh); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -141,4 +153,20 @@ void EnhancedShapeDumper::dumpLightFaceAsAttribute(sal_Bool bLightFace) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lightFace"), "%s", "false"); } +void EnhancedShapeDumper::dumpFirstLightHarshAsAttribute(sal_Bool bFirstLightHarsh) +{ + if(bFirstLightHarsh) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("firstLightHarsh"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("firstLightHarsh"), "%s", "false"); +} + +void EnhancedShapeDumper::dumpSecondLightHarshAsAttribute(sal_Bool bSecondLightHarsh) +{ + if(bSecondLightHarsh) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightHarsh"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("secondLightHarsh"), "%s", "false"); +} + commit e2da0df7e18d64ccebbc8c1399f13a6efeabdc3c Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 16:10:31 2012 +0200 Added properties NumberOfLineSegments & { Change-Id: I04e6db01c14344b1f7a71b587b7437fd87e72d99 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index f328a94..99b4f34 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -53,6 +53,8 @@ public: void dumpBrightnessAsAttribute(double aBrightness); void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); void dumpDiffusionAsAttribute(double aDiffusion); + void dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments); + void dumpLightFaceAsAttribute(sal_Bool bLightFace); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index aee479e..8bf533f 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -62,6 +62,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aDiffusion) dumpDiffusionAsAttribute(aDiffusion); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("NumberOfLineSegments"); + sal_Int32 aNumberOfLineSegments; + if(anotherAny >>= aNumberOfLineSegments) + dumpNumberOfLineSegmentsAsAttribute(aNumberOfLineSegments); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("LightFace"); + sal_Bool bLightFace; + if(anotherAny >>= bLightFace) + dumpLightFaceAsAttribute(bLightFace); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -115,3 +127,18 @@ void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion) { xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("diffusion"), "%f", aDiffusion); } + +void EnhancedShapeDumper::dumpNumberOfLineSegmentsAsAttribute(sal_Int32 aNumberOfLineSegments) +{ + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("numberOfLineSegments"), "%" SAL_PRIdINT32, aNumberOfLineSegments); +} + +void EnhancedShapeDumper::dumpLightFaceAsAttribute(sal_Bool bLightFace) +{ + if(bLightFace) + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lightFace"), "%s", "true"); + else + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("lightFace"), "%s", "false"); +} + + commit ada6409b8e43e9e6813b39801d81cfc8063fdfb2 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 16:04:32 2012 +0200 Added properties Depth & Diffusion Change-Id: If9aaf021bcdd0a43bbc32e08236f8bc39c7cda82 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index aecb856..f328a94 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -51,6 +51,8 @@ public: void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpExtrusionAsAttribute(sal_Bool bExtrusion); void dumpBrightnessAsAttribute(double aBrightness); + void dumpDepthAsElement(com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepth); + void dumpDiffusionAsAttribute(double aDiffusion); private: xmlTextWriterPtr xmlWriter; diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 85bfd27..aee479e 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -50,6 +50,18 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeExtrusionService(uno::Reference if(anotherAny >>= aBrightness) dumpBrightnessAsAttribute(aBrightness); } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Depth"); + drawing::EnhancedCustomShapeParameterPair aDepth; + if(anotherAny >>= aDepth) + dumpDepthAsElement(aDepth); + } + { + uno::Any anotherAny = xPropSet->getPropertyValue("Diffusion"); + double aDiffusion; + if(anotherAny >>= aDiffusion) + dumpDiffusionAsAttribute(aDiffusion); + } } void EnhancedShapeDumper::dumpExtrusionAsAttribute(sal_Bool bExtrusion) { @@ -92,3 +104,14 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::Enhanced } } +void EnhancedShapeDumper::dumpDepthAsElement(drawing::EnhancedCustomShapeParameterPair aDepth) +{ + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Depth" )); + dumpEnhancedCustomShapeParameterPair(aDepth); + xmlTextWriterEndElement( xmlWriter ); +} + +void EnhancedShapeDumper::dumpDiffusionAsAttribute(double aDiffusion) +{ + xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("diffusion"), "%f", aDiffusion); +} commit 79f8b224d961abf83acf9a934daca05f6b519667 Author: Artur Dorda <artur.dorda+l...@gmail.com> Date: Tue Jul 3 15:36:35 2012 +0200 Added auxiliary method for dumping EnhancedCustomShapeParameterPair Change-Id: I3e0eca4f042565e8b64ab3e7286f66033c0e75a3 diff --git a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx index 6c30dda..aecb856 100644 --- a/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx +++ b/drawinglayer/inc/drawinglayer/EnhancedShapeDumper.hxx @@ -29,6 +29,7 @@ #include <libxml/xmlwriter.h> #include <drawinglayer/drawinglayerdllapi.h> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #ifndef EnhancedShapeDumper_hxx #define EnhancedShapeDumper_hxx @@ -43,6 +44,9 @@ public: } + // auxiliary functions + void dumpEnhancedCustomShapeParameterPair(com::sun::star::drawing::EnhancedCustomShapeParameterPair aParameterPair); + // EnhancedCustomShapeExtrusion.idl void dumpEnhancedCustomShapeExtrusionService(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xPropSet); void dumpExtrusionAsAttribute(sal_Bool bExtrusion); diff --git a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx index 542a687..85bfd27 100644 --- a/drawinglayer/source/dumper/EnhancedShapeDumper.cxx +++ b/drawinglayer/source/dumper/EnhancedShapeDumper.cxx @@ -64,3 +64,31 @@ void EnhancedShapeDumper::dumpBrightnessAsAttribute(double aBrightness) xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("brightness"), "%f", aBrightness); } +void EnhancedShapeDumper::dumpEnhancedCustomShapeParameterPair(drawing::EnhancedCustomShapeParameterPair aParameterPair) +{ + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "First" )); + uno::Any aAny = aParameterPair.First.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.First.Type); + xmlTextWriterEndElement( xmlWriter ); + } + { + xmlTextWriterStartElement(xmlWriter, BAD_CAST( "Second" )); + uno::Any aAny = aParameterPair.Second.Value; + rtl::OUString sValue; + if(aAny >>= sValue) + { + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s", + rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr()); + } + xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.Second.Type); + xmlTextWriterEndElement( xmlWriter ); + } +} + _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits