LCOV - code coverage report
Current view: top level - libreoffice/svx/inc/svx - view3d.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 3 0.0 %
Date: 2012-12-27 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef _E3D_VIEW3D_HXX
      21             : #define _E3D_VIEW3D_HXX
      22             : 
      23             : #include <svx/svdview.hxx>
      24             : #include <svx/def3d.hxx>
      25             : #include <svx/deflt3d.hxx>
      26             : #include <basegfx/point/b2dpoint.hxx>
      27             : #include "svx/svxdllapi.h"
      28             : 
      29             : //************************************************************
      30             : //   Vorausdeklarationen
      31             : //************************************************************
      32             : 
      33             : class E3dObject;
      34             : class E3dScene;
      35             : class Impl3DMirrorConstructOverlay;
      36             : 
      37             : /*************************************************************************
      38             : |*
      39             : |* Ableitung von SdrView zur Bearbeitung von 3D-Objekten
      40             : |*
      41             : \************************************************************************/
      42             : 
      43             : class SVX_DLLPUBLIC E3dView : public SdrView
      44             : {
      45             : protected:
      46             :     E3dDefaultAttributes        a3DDefaultAttr;
      47             :     MouseEvent                  aMouseEvent;                    // Die Parameter der letzten Events (Mouse, Keyboard)
      48             :     Color                       aDefaultLightColor;             // dito mit den Farben
      49             :     Color                       aDefaultAmbientColor;
      50             : 
      51             :     double                      fDefaultScaleX;                 // Verzerrungen
      52             :     double                      fDefaultScaleY;
      53             :     double                      fDefaultScaleZ;
      54             :     double                      fDefaultRotateX;                // und Drehungen
      55             :     double                      fDefaultRotateY;
      56             :     double                      fDefaultRotateZ;
      57             :     double                      fDefaultExtrusionDeepth;        // Extrusionstiefe
      58             :     double                      fDefaultLightIntensity;         // Intensitaeten der beiden (notwendigen) Licht-
      59             :     double                      fDefaultAmbientIntensity;       // quellen
      60             :     long                        nHDefaultSegments;              // wieviele HSegmente braucht mein Lathe-Ojekt
      61             :     long                        nVDefaultSegments;              // wieviele VSegmente braucht mein Lathe-Ojekt
      62             : 
      63             :     E3dDragConstraint           eDragConstraint;
      64             : 
      65             :     // Migrate selections
      66             :     Impl3DMirrorConstructOverlay*                   mpMirrorOverlay;
      67             : 
      68             :     sal_Bool                        bDoubleSided;
      69             : 
      70             :     void InitView();
      71             : 
      72             :     void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
      73             :     void ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
      74             :     void ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj);
      75             :     void ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj);
      76             : 
      77             :     void InitScene(E3dScene* pScene, double fW, double fH, double fCamZ);
      78             :     void ImpIsConvertTo3DPossible(SdrObject* pObj, sal_Bool& rAny3D, sal_Bool& rGroupSelected) const;
      79             :     void BreakSingle3DObj(E3dObject* pObj);
      80             : 
      81             : public:
      82             :     TYPEINFO();
      83             :     E3dView(SdrModel* pModel, OutputDevice* pOut = 0L);
      84             :     virtual ~E3dView();
      85             : 
      86             :     // Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben.
      87             :     virtual void DrawMarkedObj(OutputDevice& rOut) const;
      88             : 
      89             :     // Zugriff auf die Default-Attribute
      90           0 :     E3dDefaultAttributes& Get3DDefaultAttributes() { return a3DDefaultAttr; }
      91             :     virtual sal_Bool BegDragObj(const Point& rPnt, OutputDevice* pOut = NULL, SdrHdl* pHdl = NULL, short nMinMov = -3, SdrDragMethod* pForcedMeth = NULL);
      92             :     virtual void CheckPossibilities();
      93             : 
      94             :     // Event setzen/rausruecken
      95             :     void SetMouseEvent(const MouseEvent& rNew) { aMouseEvent = rNew; }
      96           0 :     const MouseEvent& GetMouseEvent() { return aMouseEvent; }
      97             : 
      98             :     // Model holen ueberladen, da bei einzelnen 3D Objekten noch eine Szene
      99             :     // untergeschoben werden muss
     100             :     virtual SdrModel* GetMarkedObjModel() const;
     101             : 
     102             :     // Bei Paste muss - falls in eine Scene eingefuegt wird - die
     103             :     // Objekte der Szene eingefuegt werden, die Szene selbst aber nicht
     104             :     using SdrView::Paste;
     105             :     virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
     106             : 
     107             :     // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
     108             :     sal_Bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
     109             : 
     110             :     sal_Bool IsConvertTo3DObjPossible() const;
     111             :     void ConvertMarkedObjTo3D(sal_Bool bExtrude=sal_True, basegfx::B2DPoint aPnt1 = basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint aPnt2 = basegfx::B2DPoint(0.0, 1.0));
     112             : 
     113             :     // Nachtraeglichhe Korrekturmoeglichkeit um alle Extrudes in einer
     114             :     // bestimmten Tiefensortierung anzulegen
     115             :     void DoDepthArrange(E3dScene* pScene, double fDepth);
     116             :     void ConvertMarkedToPolyObj(sal_Bool bLineToArea);
     117             :     E3dScene* SetCurrent3DObj(E3dObject* p3DObj);
     118             :     void Start3DCreation();
     119             : 
     120             :     // migration of overlay
     121           0 :     sal_Bool Is3DRotationCreationActive() const { return (0L != mpMirrorOverlay); }
     122             : 
     123             :     virtual void MovAction(const Point& rPnt);
     124             :     void End3DCreation(sal_Bool bUseDefaultValuesForMirrorAxes=sal_False);
     125             :     void ResetCreationActive();
     126             : 
     127             :     double GetDefaultCamPosZ();
     128             : 
     129             :     double &DefaultScaleX ()
     130             :     {
     131             :         return fDefaultScaleX;
     132             :     }
     133             : 
     134             :     double DefaultScaleX () const
     135             :     {
     136             :         return fDefaultScaleX;
     137             :     }
     138             : 
     139             :     double &DefaultScaleY ()
     140             :     {
     141             :         return fDefaultScaleY;
     142             :     }
     143             : 
     144             :     double DefaultScaleY () const
     145             :     {
     146             :         return fDefaultScaleY;
     147             :     }
     148             : 
     149             :     double &DefaultScaleZ ()
     150             :     {
     151             :         return fDefaultScaleZ;
     152             :     }
     153             : 
     154             :     double DefaultScaleZ () const
     155             :     {
     156             :         return fDefaultScaleZ;
     157             :     }
     158             : 
     159             :     double &DefaultRotateX ()
     160             :     {
     161             :         return fDefaultRotateX;
     162             :     }
     163             : 
     164             :     double DefaultRotateX () const
     165             :     {
     166             :         return fDefaultRotateX;
     167             :     }
     168             : 
     169             :     double &DefaultRotateY ()
     170             :     {
     171             :         return fDefaultRotateY;
     172             :     }
     173             : 
     174             :     double DefaultRotateY () const
     175             :     {
     176             :         return fDefaultRotateY;
     177             :     }
     178             : 
     179             :     double &DefaultRotateZ ()
     180             :     {
     181             :         return fDefaultRotateZ;
     182             :     }
     183             : 
     184             :     double DefaultRotateZ () const
     185             :     {
     186             :         return fDefaultRotateZ;
     187             :     }
     188             : 
     189             :     double &DefaultExtrusionDeepth ()
     190             :     {
     191             :         return fDefaultExtrusionDeepth;
     192             :     }
     193             : 
     194             :     double DefaultExtrusionDeepth () const
     195             :     {
     196             :         return fDefaultExtrusionDeepth;
     197             :     }
     198             : 
     199             :     double GetDefaultCamFocal();
     200             : 
     201             :     double &DefaultLightIntensity ()
     202             :     {
     203             :         return fDefaultLightIntensity;
     204             :     }
     205             : 
     206             :     double DefaultLightIntensity () const
     207             :     {
     208             :         return fDefaultLightIntensity;
     209             :     }
     210             : 
     211             :     double &DefaultAmbientIntensity ()
     212             :     {
     213             :         return fDefaultAmbientIntensity;
     214             :     }
     215             : 
     216             :     double DefaultAmbientIntensity () const
     217             :     {
     218             :         return fDefaultAmbientIntensity;
     219             :     }
     220             : 
     221             :     const Color &DefaultLightColor () const
     222             :     {
     223             :         return aDefaultLightColor;
     224             :     }
     225             : 
     226             :     Color DefaultLightColor ()
     227             :     {
     228             :         return aDefaultLightColor;
     229             :     }
     230             : 
     231             :     const Color &DefaultAmbientColor () const
     232             :     {
     233             :         return aDefaultAmbientColor;
     234             :     }
     235             : 
     236             :     Color DefaultAmbientColor ()
     237             :     {
     238             :         return aDefaultAmbientColor;
     239             :     }
     240             : 
     241             :     long GetHDefaultSegments() const { return nHDefaultSegments; }
     242             :     void SetHDefaultSegments(long nSegs) { nHDefaultSegments = nSegs; }
     243             : 
     244             :     long GetVDefaultSegments() const { return nVDefaultSegments; }
     245             :     void SetVDefaultSegments(long nSegs) { nVDefaultSegments = nSegs; }
     246             : 
     247             :     sal_Bool IsBreak3DObjPossible() const;
     248             :     void Break3DObj();
     249             : 
     250             :     sal_Bool DoubleSided () const
     251             :     {
     252             :         return bDoubleSided;
     253             :     }
     254             : 
     255             :     sal_Bool &DoubleSided ()
     256             :     {
     257             :         return bDoubleSided;
     258             :     }
     259             : 
     260             :     SfxItemSet Get3DAttributes(E3dScene* pInScene = NULL, sal_Bool bOnly3DAttr=sal_False) const;
     261             :     void Set3DAttributes(const SfxItemSet& rAttr, E3dScene* pInScene = NULL, sal_Bool bOnly3DAttr=sal_False);
     262             : };
     263             : 
     264             : #endif          // _E3D_VIEW3D_HXX
     265             : 
     266             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10