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