namespace oox
{ class Scene3DHelper
{ public: /** Creates extrusion properties in rPropertyMap from the 3D information in p3DProperties and givesvalueswhichhavetobesetasshapeproperties. @param[in]p3DPropertiesapointertoShape3DProperties @param[in]rnMSOShapeRotationaMSOshaperotationanglein1/60000deg @param[in,out]rPropertyMapamapthatisfilledwithpropertiesdirectlyusablein CustomShapeProperties.pushToPropSet()forpropertyExtrusion. @param[out]rRotZtheangleforshaperotationaroundz-axisinrad,withorientation sameasAPIshapepropertyRotateAngle.IthastheshaperotationfromrnMSOShapeRotation integrated. @param[out]rExtrusionColoracomplexcolorfromwhichthecoloroftheextrudedfacescan becreated.Theextrusioncolorisnothandledasextrusionpropertybutassecondary colorinthestyleoftheshape.Ifno3Dexistorthecameraisinvalid,theparameter valueisunchanged. @param[in]ThisoptionalparameterbBlockExtrusioncanberemovedwhentdf#159912is fixed.Fordetailsseethebugreport. @returnReturnstrueifextrusionpropertiesaregenerated.Returnsfalseifthereisno3D orifrenderingwithout3Discurrentlybetter.rPropertyMapisunchangedinsuchcase.
*/ bool setExtrusionProperties(const oox::drawingml::Shape3DPropertiesPtr p3DProperties, const sal_Int32& rnMSOShapeRotation, oox::PropertyMap& rPropertyMap, double& rRotZ, oox::drawingml::Color& rExtrusionColor, constbool bBlockExtrusion = false);
/** Creates lighting properties in rPropertyMap from MSO preset and shape rotation @param[in]p3DPropertiesapointertoShape3DProperties @param[in]rRotZtheshaperotationinclusivecameraz-rotationascalculatedby setExtrusionProperties()
@param [in, out] rPropertyMap the map, that was already filled by setExtrusionProperties()*/ void setLightingProperties(const oox::drawingml::Shape3DPropertiesPtr p3DProperties, constdouble& rRotZ, oox::PropertyMap& rPropertyMap);
/** Puts the material properties of the 3D-shape into the property map @detailsOOXMLandMSOdescribethematerialpropertiesusingSpecularColor(RGBA),Diffuse Color(RGBA),AmbientColor(RGBA),EmissiveColor(RGBA),SpecularPower(positiveint), DiffuseFresnel(int),AlphaFresnel(int),Metal(bool)andBlinnHighlight(bool).ODF andAPIhaveDiffusion(double),Specularity(double),Shininess(double),Metal(bool), MetalType(enum).ThusadirectlyuseoftheMSOvaluesisnotpossibleandsomematerial typescannotberendered.Themethodusesworkaroundsandapproximations. @param[in]p3DPropertiescontainsbesidesotherpropertiesthematerialpresetname @param[in,out]rPropertyMaphaspropertiesdirectlyusablein
CustomShapeProperties.pushToPropSet() for property Extrusion.*/ staticvoid setMaterialProperties(const oox::drawingml::Shape3DPropertiesPtr p3DProperties,
oox::PropertyMap& rPropertyMap);
private: /** Calculates angles suitable for API from OOXML scene3d angles. @param[in]nLat,nLon,nRevinunit1/60000degwithsameorientationastheattributeslat, lonandrevofthe<rot>childelementofthe<scene3d>elementinOOXMLmarkup. @param[out]fX,fY,fZvaluesinunitradianswithcorrectorientationforAPIproperties
EnhancedCustomShapeExtrusion::RotateAngle and RotationDescriptor::RotateAngle*/ staticvoid getAPIAnglesFromOOXAngle(const sal_Int32 nLat, const sal_Int32 nLon, const sal_Int32 nRev, double& fX, double& fY, double& fZ);
/** Calculates angles suitable for API from Shape3DProperties. @detailsItconsidersthepresetcameraincasetheoptional,directrotationangleshaveno value.ItintegratesthegivenrnMSOShapeRotationintofZ. @param[in]p3DPropertiesapointertoShape3DProperties @param[in]rnMSOShapeRotationrotationin1/60000degasgivenin'rot'attributeof'xfrm' elementinOOXML. @param[out]fX,fY,fZvaluesinunitradianswithcorrectorientationforAPIproperties
EnhancedCustomShapeExtrusion::RotateAngle and RotationDescriptor::RotateAngle*/ void getAPIAnglesFrom3DProperties(const oox::drawingml::Shape3DPropertiesPtr p3DProperties, const sal_Int32& rnMSOShapeRotation, double& fX, double& fY, double& fZ);
/** Adds the rotation angles fX and fY as property RotateAngle to the map. @param[in,out]rPropertyMapamaptoaddtheRotateAngleproperty
@param [in] fX, fY rotation angle in unit rad with correct orientation for the property.*/ staticvoid addRotateAngleToMap(oox::PropertyMap& rPropertyMap, constdouble fX, constdouble fY);
/** Adds the Depth property to the map. @detailsThesecondcomponentisrelative,whereasthez-positioninOOXMLisabsolute.Uses 360EMUdepthincaseofzeroDepthasotherwisenorelativepositionispossible. @param[in]p3DPropertiesapointertoShape3DProperties
@param [in, out] rPropertyMap a map to add the Depth property*/ staticvoid addExtrusionDepthToMap(const oox::drawingml::Shape3DPropertiesPtr p3DProperties,
oox::PropertyMap& rPropertyMap);
/** Adds the projection mode itself and the associated camera parameters to the map. @detailsBothmodesaddProjectionModeandOriginproperties.AddsSkewpropertyincaseof modePARALLELandViewPointpropertyincaseofmodePERSPECTIVE.TheSkewanglesincludesthe shaperotationbecauseMSOfficerotatesaftercreatingtheprojectionandODFbefore. @param[in]p3DPropertiesapointertoShape3DProperties @param[in,out]rPropertyMapamaptoaddProjectMode,OriginandSkeworViewPoint properties. @param[in]bIsParalleltrueformodePARALLEL,falseforPERSPECTIVE
@param [in] rnMSOShapeRotation shape rotation in 1/60000 degree*/ void addProjectionGeometryToMap(const oox::drawingml::Shape3DPropertiesPtr p3DProperties,
oox::PropertyMap& rPropertyMap, constbool bIsParallel, const sal_Int32 rnMSOShapeRotation);
// Index into array aPrstCameraValuesArray.
sal_Int16 mnPrstCameraIndex = -1; // '-1' means invalid or not yet searched
}; // end class Scene3DHelper
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.