1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef INCLUDED_OGLTRANS_TRANSITIONIMPL_HXX_ 28*cdf0e10cSrcweir #define INCLUDED_OGLTRANS_TRANSITIONIMPL_HXX_ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <basegfx/vector/b2dvector.hxx> 31*cdf0e10cSrcweir #include <basegfx/vector/b3dvector.hxx> 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #include <tools/prewin.h> 34*cdf0e10cSrcweir #include <tools/postwin.h> 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir #if defined( WNT ) 37*cdf0e10cSrcweir #include <tools/prewin.h> 38*cdf0e10cSrcweir #include <tools/postwin.h> 39*cdf0e10cSrcweir #elif defined( OS2 ) 40*cdf0e10cSrcweir #elif defined( QUARTZ ) 41*cdf0e10cSrcweir #elif defined( UNX ) 42*cdf0e10cSrcweir #endif 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir #include <vector> 45*cdf0e10cSrcweir #include <GL/gl.h> 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir using namespace std; 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir class Primitive; 50*cdf0e10cSrcweir class Operation; 51*cdf0e10cSrcweir class SceneObject; 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir /** OpenGL 3D Transition class. It implicitly is constructed from XOGLTransition 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir This class is capable of making itself into many difference transitions. It holds Primitives and Operations on those primitives. 57*cdf0e10cSrcweir */ 58*cdf0e10cSrcweir class OGLTransitionImpl 59*cdf0e10cSrcweir { 60*cdf0e10cSrcweir public: 61*cdf0e10cSrcweir OGLTransitionImpl() : 62*cdf0e10cSrcweir mbUseMipMapLeaving( true ), 63*cdf0e10cSrcweir mbUseMipMapEntering( true ), 64*cdf0e10cSrcweir mnRequiredGLVersion( 1.0 ), 65*cdf0e10cSrcweir maLeavingSlidePrimitives(), 66*cdf0e10cSrcweir maEnteringSlidePrimitives(), 67*cdf0e10cSrcweir maSceneObjects(), 68*cdf0e10cSrcweir mbReflectSlides( false ), 69*cdf0e10cSrcweir mVertexObject( 0 ), 70*cdf0e10cSrcweir mFragmentObject( 0 ), 71*cdf0e10cSrcweir mProgramObject( 0 ), 72*cdf0e10cSrcweir maHelperTexture( 0 ), 73*cdf0e10cSrcweir mmPrepare( NULL ), 74*cdf0e10cSrcweir mmPrepareTransition( NULL ), 75*cdf0e10cSrcweir mmClearTransition( NULL ), 76*cdf0e10cSrcweir mmDisplaySlides( NULL ) 77*cdf0e10cSrcweir {} 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir ~OGLTransitionImpl(); 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir void prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex ); 82*cdf0e10cSrcweir void display( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight ); 83*cdf0e10cSrcweir void finish(); 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir void makeOutsideCubeFaceToLeft(); 86*cdf0e10cSrcweir void makeInsideCubeFaceToLeft(); 87*cdf0e10cSrcweir void makeNByMTileFlip( ::sal_uInt16 n, ::sal_uInt16 m ); 88*cdf0e10cSrcweir void makeRevolvingCircles( ::sal_uInt16 nCircles , ::sal_uInt16 nPointsOnCircles ); 89*cdf0e10cSrcweir void makeHelix( ::sal_uInt16 nRows ); 90*cdf0e10cSrcweir void makeFallLeaving(); 91*cdf0e10cSrcweir void makeTurnAround(); 92*cdf0e10cSrcweir void makeTurnDown(); 93*cdf0e10cSrcweir void makeIris(); 94*cdf0e10cSrcweir void makeRochade(); 95*cdf0e10cSrcweir void makeVenetianBlinds( bool vertical, int parts ); 96*cdf0e10cSrcweir void makeStatic(); 97*cdf0e10cSrcweir void makeDissolve(); 98*cdf0e10cSrcweir void makeNewsflash(); 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir /** 2D replacements 101*cdf0e10cSrcweir */ 102*cdf0e10cSrcweir void makeDiamond(); 103*cdf0e10cSrcweir void makeFadeSmoothly(); 104*cdf0e10cSrcweir void makeFadeThroughBlack(); 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir /** Whether to use mipmaping for slides textures 107*cdf0e10cSrcweir */ 108*cdf0e10cSrcweir bool mbUseMipMapLeaving; 109*cdf0e10cSrcweir bool mbUseMipMapEntering; 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir /** which GL version does the transition require 112*cdf0e10cSrcweir */ 113*cdf0e10cSrcweir float mnRequiredGLVersion; 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir private: 116*cdf0e10cSrcweir /** clears all the primitives and operations 117*cdf0e10cSrcweir */ 118*cdf0e10cSrcweir void clear(); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir /** All the primitives that use the leaving slide texture 121*cdf0e10cSrcweir */ 122*cdf0e10cSrcweir vector<Primitive> maLeavingSlidePrimitives; 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir /** All the primitives that use the leaving slide texture 125*cdf0e10cSrcweir */ 126*cdf0e10cSrcweir vector<Primitive> maEnteringSlidePrimitives; 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir /** All the surrounding scene objects 129*cdf0e10cSrcweir */ 130*cdf0e10cSrcweir vector<SceneObject*> maSceneObjects; 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir /** All the operations that should be applied to both leaving and entering slide primitives. These operations will be called in the order they were pushed back in. In OpenGL this effectively uses the operations in the opposite order they were pushed back. 133*cdf0e10cSrcweir */ 134*cdf0e10cSrcweir vector<Operation*> OverallOperations; 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir /** Whether to reflect slides, the reflection happens on flat surface beneath the slides. 137*cdf0e10cSrcweir ** Now it only works with slides which keep their rectangular shape together. 138*cdf0e10cSrcweir */ 139*cdf0e10cSrcweir bool mbReflectSlides; 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir /** GLSL objects, shaders and program 142*cdf0e10cSrcweir */ 143*cdf0e10cSrcweir GLuint mVertexObject, mFragmentObject, mProgramObject; 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir /** various data */ 146*cdf0e10cSrcweir GLuint maHelperTexture; 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir /** When this method is not NULL, it is called in display method to prepare the slides, scene, etc. 149*cdf0e10cSrcweir ** We might later replace this by cleaner derived class. 150*cdf0e10cSrcweir */ 151*cdf0e10cSrcweir void (OGLTransitionImpl::*mmPrepare)( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight ); 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir /** When this method is not NULL, it is called after glx context is ready to let the transition prepare GL related things, like GLSL program. 154*cdf0e10cSrcweir ** We might later replace this by cleaner derived class. 155*cdf0e10cSrcweir */ 156*cdf0e10cSrcweir void (OGLTransitionImpl::*mmPrepareTransition)( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex ); 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir /** When this method is not NULL, it is called when the transition needs to clear after itself, like delete own textures etc. 159*cdf0e10cSrcweir ** We might later replace this by cleaner derived class. 160*cdf0e10cSrcweir */ 161*cdf0e10cSrcweir void (OGLTransitionImpl::*mmClearTransition)(); 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir /** When this method is not NULL, it is called in display method to display the slides. 164*cdf0e10cSrcweir ** We might later replace this by cleaner derived class. 165*cdf0e10cSrcweir */ 166*cdf0e10cSrcweir void (OGLTransitionImpl::*mmDisplaySlides)( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ); 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir void displaySlides( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ); 169*cdf0e10cSrcweir void displaySlide( double nTime, ::sal_Int32 glSlideTex, std::vector<Primitive>& primitives, double SlideWidthScale, double SlideHeightScale ); 170*cdf0e10cSrcweir void displayScene( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight); 171*cdf0e10cSrcweir void applyOverallOperations( double nTime, double SlideWidthScale, double SlideHeightScale ); 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir /** various transitions helper methods 174*cdf0e10cSrcweir */ 175*cdf0e10cSrcweir void prepareDiamond( double nTime, double SlideWidth, double SlideHeight,double DispWidth, double DispHeight ); 176*cdf0e10cSrcweir void displaySlidesFadeSmoothly( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ); 177*cdf0e10cSrcweir void displaySlidesFadeThroughBlack( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ); 178*cdf0e10cSrcweir void displaySlidesRochade( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ); 179*cdf0e10cSrcweir void displaySlidesShaders( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ); 180*cdf0e10cSrcweir void prepareStatic( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex ); 181*cdf0e10cSrcweir void prepareDissolve( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex ); 182*cdf0e10cSrcweir void preparePermShader(); 183*cdf0e10cSrcweir }; 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir class SceneObject 186*cdf0e10cSrcweir { 187*cdf0e10cSrcweir public: 188*cdf0e10cSrcweir SceneObject(); 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir virtual void prepare() {}; 191*cdf0e10cSrcweir virtual void display(double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight); 192*cdf0e10cSrcweir virtual void finish() {}; 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir void pushPrimitive (const Primitive &p); 195*cdf0e10cSrcweir 196*cdf0e10cSrcweir protected: 197*cdf0e10cSrcweir /** All the surrounding scene primitives 198*cdf0e10cSrcweir */ 199*cdf0e10cSrcweir vector<Primitive> maPrimitives; 200*cdf0e10cSrcweir }; 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir class Iris : public SceneObject 203*cdf0e10cSrcweir { 204*cdf0e10cSrcweir public: 205*cdf0e10cSrcweir Iris (); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir virtual void prepare(); 208*cdf0e10cSrcweir virtual void display(double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight); 209*cdf0e10cSrcweir virtual void finish(); 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir private: 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir GLuint maTexture; 214*cdf0e10cSrcweir }; 215*cdf0e10cSrcweir 216*cdf0e10cSrcweir /** This class is a list of Triangles that will share Operations, and could possibly share 217*cdf0e10cSrcweir */ 218*cdf0e10cSrcweir class Primitive 219*cdf0e10cSrcweir { 220*cdf0e10cSrcweir public: 221*cdf0e10cSrcweir Primitive() {} 222*cdf0e10cSrcweir // making copy constructor explicit makes the class un-suitable for use with stl containers 223*cdf0e10cSrcweir Primitive(const Primitive& rvalue); 224*cdf0e10cSrcweir ~Primitive(); 225*cdf0e10cSrcweir 226*cdf0e10cSrcweir void applyOperations(double nTime, double SlideWidthScale, double SlideHeightScale); 227*cdf0e10cSrcweir void display(double nTime, double SlideWidthScale, double SlideHeightScale); 228*cdf0e10cSrcweir const Primitive& operator=(const Primitive& rvalue); 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir /** PushBack a vertex,normal, and tex coord. Each SlideLocation is where on the slide is mapped to this location ( from (0,0) to (1,1) ). This will make sure the correct aspect ratio is used, and helps to make slides begin and end at the correct position. (0,0) is the top left of the slide, and (1,1) is the bottom right. 231*cdf0e10cSrcweir 232*cdf0e10cSrcweir @param SlideLocation0 233*cdf0e10cSrcweir Location of first Vertex on slide 234*cdf0e10cSrcweir 235*cdf0e10cSrcweir @param SlideLocation1 236*cdf0e10cSrcweir Location of second Vertex on slide 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir @param SlideLocation2 239*cdf0e10cSrcweir Location of third Vertex on slide 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir */ 242*cdf0e10cSrcweir void pushTriangle(const basegfx::B2DVector& SlideLocation0,const basegfx::B2DVector& SlideLocation1,const basegfx::B2DVector& SlideLocation2); 243*cdf0e10cSrcweir 244*cdf0e10cSrcweir /** clear all the vertices, normals, tex coordinates, and normals 245*cdf0e10cSrcweir */ 246*cdf0e10cSrcweir void clearTriangles(); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir /** guards against directly changing the vertices 249*cdf0e10cSrcweir 250*cdf0e10cSrcweir @return 251*cdf0e10cSrcweir the list of vertices 252*cdf0e10cSrcweir */ 253*cdf0e10cSrcweir const vector<basegfx::B3DVector>& getVertices() const {return Vertices;} 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir /** guards against directly changing the vertices 256*cdf0e10cSrcweir */ 257*cdf0e10cSrcweir const vector<basegfx::B3DVector>& getNormals() const {return Normals;} 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir /** guards against directly changing the vertices 260*cdf0e10cSrcweir 261*cdf0e10cSrcweir @return 262*cdf0e10cSrcweir the list of Texture Coordinates 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir */ 265*cdf0e10cSrcweir const vector<basegfx::B2DVector>& getTexCoords() const {return TexCoords;} 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir /** list of Operations to be performed on this primitive.These operations will be called in the order they were pushed back in. In OpenGL this effectively uses the operations in the opposite order they were pushed back. 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir @return 270*cdf0e10cSrcweir the list of Operations 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir */ 273*cdf0e10cSrcweir vector<Operation*> Operations; 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir private: 276*cdf0e10cSrcweir /** list of vertices 277*cdf0e10cSrcweir */ 278*cdf0e10cSrcweir vector<basegfx::B3DVector> Vertices; 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir /** list of Normals 281*cdf0e10cSrcweir */ 282*cdf0e10cSrcweir vector<basegfx::B3DVector> Normals; 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir /** list of Texture Coordinates 285*cdf0e10cSrcweir */ 286*cdf0e10cSrcweir vector<basegfx::B2DVector> TexCoords; 287*cdf0e10cSrcweir }; 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir /** This class is to be derived to make any operation (tranform) you may need in order to construct your transitions 290*cdf0e10cSrcweir */ 291*cdf0e10cSrcweir class Operation 292*cdf0e10cSrcweir { 293*cdf0e10cSrcweir public: 294*cdf0e10cSrcweir Operation(){} 295*cdf0e10cSrcweir virtual ~Operation(){} 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir /** Should this operation be interpolated . If TRUE, the transform will smoothly move from making no difference from t = 0.0 to nT0 to being completely transformed from t = nT1 to 1. If FALSE, the transform will be inneffectual from t = 0 to nT0, and completely transformed from t = nT0 to 1. 298*cdf0e10cSrcweir */ 299*cdf0e10cSrcweir bool bInterpolate; 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir /** time to begin the transformation 302*cdf0e10cSrcweir */ 303*cdf0e10cSrcweir double nT0; 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir /** time to finish the transformation 306*cdf0e10cSrcweir */ 307*cdf0e10cSrcweir double nT1; 308*cdf0e10cSrcweir public: 309*cdf0e10cSrcweir /** this is the function that is called to give the Operation to OpenGL. 310*cdf0e10cSrcweir 311*cdf0e10cSrcweir @param t 312*cdf0e10cSrcweir time from t = 0 to t = 1 313*cdf0e10cSrcweir 314*cdf0e10cSrcweir @param SlideWidthScale 315*cdf0e10cSrcweir width of slide divided by width of window 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir @param SlideHeightScale 318*cdf0e10cSrcweir height of slide divided by height of window 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir */ 321*cdf0e10cSrcweir virtual void interpolate(double t,double SlideWidthScale,double SlideHeightScale) = 0; 322*cdf0e10cSrcweir 323*cdf0e10cSrcweir /** return a copy of this operation 324*cdf0e10cSrcweir */ 325*cdf0e10cSrcweir virtual Operation* clone() = 0; 326*cdf0e10cSrcweir }; 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir /** this class is a generic CounterClockWise(CCW) rotation with an axis angle 329*cdf0e10cSrcweir */ 330*cdf0e10cSrcweir class SRotate: public Operation 331*cdf0e10cSrcweir { 332*cdf0e10cSrcweir public: 333*cdf0e10cSrcweir void interpolate(double t,double SlideWidthScale,double SlideHeightScale); 334*cdf0e10cSrcweir virtual SRotate* clone(); 335*cdf0e10cSrcweir 336*cdf0e10cSrcweir /** Constructor 337*cdf0e10cSrcweir 338*cdf0e10cSrcweir @param Axis 339*cdf0e10cSrcweir axis to rotate about 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir @param Origin 342*cdf0e10cSrcweir position that rotation axis runs through 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir @param Angle 345*cdf0e10cSrcweir angle in radians of CCW rotation 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir @param bInter 348*cdf0e10cSrcweir see Operation 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir @param T0 351*cdf0e10cSrcweir transformation starting time 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir @param T1 354*cdf0e10cSrcweir transformation ending time 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir */ 357*cdf0e10cSrcweir SRotate(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1); 358*cdf0e10cSrcweir ~SRotate(){} 359*cdf0e10cSrcweir private: 360*cdf0e10cSrcweir /** axis to rotate CCW about 361*cdf0e10cSrcweir */ 362*cdf0e10cSrcweir basegfx::B3DVector axis; 363*cdf0e10cSrcweir 364*cdf0e10cSrcweir /** position that rotation axis runs through 365*cdf0e10cSrcweir */ 366*cdf0e10cSrcweir basegfx::B3DVector origin; 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir /** angle in radians of CCW rotation 369*cdf0e10cSrcweir */ 370*cdf0e10cSrcweir double angle; 371*cdf0e10cSrcweir }; 372*cdf0e10cSrcweir 373*cdf0e10cSrcweir /** scaling transformation 374*cdf0e10cSrcweir */ 375*cdf0e10cSrcweir class SScale: public Operation 376*cdf0e10cSrcweir { 377*cdf0e10cSrcweir public: 378*cdf0e10cSrcweir void interpolate(double t,double SlideWidthScale,double SlideHeightScale); 379*cdf0e10cSrcweir SScale* clone(); 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir /** Constructor 382*cdf0e10cSrcweir 383*cdf0e10cSrcweir @param Scale 384*cdf0e10cSrcweir amount to scale by 385*cdf0e10cSrcweir 386*cdf0e10cSrcweir @param Origin 387*cdf0e10cSrcweir position that rotation axis runs through 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir @param bInter 390*cdf0e10cSrcweir see Operation 391*cdf0e10cSrcweir 392*cdf0e10cSrcweir @param T0 393*cdf0e10cSrcweir transformation starting time 394*cdf0e10cSrcweir 395*cdf0e10cSrcweir @param T1 396*cdf0e10cSrcweir transformation ending time 397*cdf0e10cSrcweir 398*cdf0e10cSrcweir */ 399*cdf0e10cSrcweir SScale(const basegfx::B3DVector& Scale, const basegfx::B3DVector& Origin,bool bInter, double T0, double T1); 400*cdf0e10cSrcweir ~SScale(){} 401*cdf0e10cSrcweir private: 402*cdf0e10cSrcweir basegfx::B3DVector scale; 403*cdf0e10cSrcweir basegfx::B3DVector origin; 404*cdf0e10cSrcweir }; 405*cdf0e10cSrcweir 406*cdf0e10cSrcweir /** translation transformation 407*cdf0e10cSrcweir */ 408*cdf0e10cSrcweir class STranslate: public Operation 409*cdf0e10cSrcweir { 410*cdf0e10cSrcweir public: 411*cdf0e10cSrcweir void interpolate(double t,double SlideWidthScale,double SlideHeightScale); 412*cdf0e10cSrcweir STranslate* clone(); 413*cdf0e10cSrcweir 414*cdf0e10cSrcweir /** Constructor 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir @param Vector 417*cdf0e10cSrcweir vector to translate 418*cdf0e10cSrcweir 419*cdf0e10cSrcweir @param bInter 420*cdf0e10cSrcweir see Operation 421*cdf0e10cSrcweir 422*cdf0e10cSrcweir @param T0 423*cdf0e10cSrcweir transformation starting time 424*cdf0e10cSrcweir 425*cdf0e10cSrcweir @param T1 426*cdf0e10cSrcweir transformation ending time 427*cdf0e10cSrcweir 428*cdf0e10cSrcweir */ 429*cdf0e10cSrcweir STranslate(const basegfx::B3DVector& Vector,bool bInter, double T0, double T1); 430*cdf0e10cSrcweir ~STranslate(){} 431*cdf0e10cSrcweir private: 432*cdf0e10cSrcweir /** vector to translate by 433*cdf0e10cSrcweir */ 434*cdf0e10cSrcweir basegfx::B3DVector vector; 435*cdf0e10cSrcweir }; 436*cdf0e10cSrcweir 437*cdf0e10cSrcweir /** translation transformation 438*cdf0e10cSrcweir */ 439*cdf0e10cSrcweir class SEllipseTranslate: public Operation 440*cdf0e10cSrcweir { 441*cdf0e10cSrcweir public: 442*cdf0e10cSrcweir void interpolate(double t,double SlideWidthScale,double SlideHeightScale); 443*cdf0e10cSrcweir SEllipseTranslate* clone(); 444*cdf0e10cSrcweir 445*cdf0e10cSrcweir /** Constructor 446*cdf0e10cSrcweir 447*cdf0e10cSrcweir @param Vector 448*cdf0e10cSrcweir vector to translate 449*cdf0e10cSrcweir 450*cdf0e10cSrcweir @param bInter 451*cdf0e10cSrcweir see Operation 452*cdf0e10cSrcweir 453*cdf0e10cSrcweir @param T0 454*cdf0e10cSrcweir transformation starting time 455*cdf0e10cSrcweir 456*cdf0e10cSrcweir @param T1 457*cdf0e10cSrcweir transformation ending time 458*cdf0e10cSrcweir 459*cdf0e10cSrcweir */ 460*cdf0e10cSrcweir SEllipseTranslate(double dWidth, double dHeight, double dStartPosition, double dEndPosition, bool bInter, double T0, double T1); 461*cdf0e10cSrcweir ~SEllipseTranslate(){} 462*cdf0e10cSrcweir private: 463*cdf0e10cSrcweir /** width and length of the ellipse 464*cdf0e10cSrcweir */ 465*cdf0e10cSrcweir double width, height; 466*cdf0e10cSrcweir 467*cdf0e10cSrcweir /** start and end position on the ellipse <0,1> 468*cdf0e10cSrcweir */ 469*cdf0e10cSrcweir double startPosition; 470*cdf0e10cSrcweir double endPosition; 471*cdf0e10cSrcweir }; 472*cdf0e10cSrcweir 473*cdf0e10cSrcweir /** Same as SRotate, except the depth is scaled by the width of the slide divided by the width of the window. 474*cdf0e10cSrcweir */ 475*cdf0e10cSrcweir class RotateAndScaleDepthByWidth: public Operation 476*cdf0e10cSrcweir { 477*cdf0e10cSrcweir public: 478*cdf0e10cSrcweir void interpolate(double t,double SlideWidthScale,double SlideHeightScale); 479*cdf0e10cSrcweir RotateAndScaleDepthByWidth* clone(); 480*cdf0e10cSrcweir 481*cdf0e10cSrcweir RotateAndScaleDepthByWidth(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1); 482*cdf0e10cSrcweir ~RotateAndScaleDepthByWidth(){} 483*cdf0e10cSrcweir private: 484*cdf0e10cSrcweir basegfx::B3DVector axis; 485*cdf0e10cSrcweir basegfx::B3DVector origin; 486*cdf0e10cSrcweir double angle; 487*cdf0e10cSrcweir }; 488*cdf0e10cSrcweir 489*cdf0e10cSrcweir /** Same as SRotate, except the depth is scaled by the width of the slide divided by the height of the window. 490*cdf0e10cSrcweir */ 491*cdf0e10cSrcweir class RotateAndScaleDepthByHeight: public Operation 492*cdf0e10cSrcweir { 493*cdf0e10cSrcweir public: 494*cdf0e10cSrcweir void interpolate(double t,double SlideWidthScale,double SlideHeightScale); 495*cdf0e10cSrcweir RotateAndScaleDepthByHeight* clone(); 496*cdf0e10cSrcweir 497*cdf0e10cSrcweir RotateAndScaleDepthByHeight(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1); 498*cdf0e10cSrcweir ~RotateAndScaleDepthByHeight(){} 499*cdf0e10cSrcweir private: 500*cdf0e10cSrcweir basegfx::B3DVector axis; 501*cdf0e10cSrcweir basegfx::B3DVector origin; 502*cdf0e10cSrcweir double angle; 503*cdf0e10cSrcweir }; 504*cdf0e10cSrcweir 505*cdf0e10cSrcweir #endif // INCLUDED_SLIDESHOW_TRANSITION_HXX_ 506*cdf0e10cSrcweir 507