LCOV - code coverage report
Current view: top level - include/svx - view3d.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 1 4 25.0 %
Date: 2014-04-11 Functions: 1 4 25.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 INCLUDED_SVX_VIEW3D_HXX
      21             : #define INCLUDED_SVX_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             :  * Forward declarations
      31             :  */
      32             : 
      33             : class E3dObject;
      34             : class E3dScene;
      35             : class Impl3DMirrorConstructOverlay;
      36             : 
      37             : /**
      38             :  * Derived class of SdrView to edit 3D objects.
      39             :  */
      40             : 
      41             : class SVX_DLLPUBLIC E3dView : public SdrView
      42             : {
      43             : protected:
      44             :     E3dDefaultAttributes        a3DDefaultAttr;
      45             :     MouseEvent                  aMouseEvent;                    // The parameters of the last Events (Mouse, Keyboard)
      46             :     Color                       aDefaultLightColor;             // The paramaters for the last colors
      47             :     Color                       aDefaultAmbientColor;
      48             : 
      49             :     double                      fDefaultScaleX;                 // Scaling
      50             :     double                      fDefaultScaleY;
      51             :     double                      fDefaultScaleZ;
      52             :     double                      fDefaultRotateX;                // and Rotation
      53             :     double                      fDefaultRotateY;
      54             :     double                      fDefaultRotateZ;
      55             :     double                      fDefaultExtrusionDeepth;        // Extrusion depth
      56             :     double                      fDefaultLightIntensity;         // Intensity of the two (necessary) light sources.
      57             :     double                      fDefaultAmbientIntensity;
      58             :     long                        nHDefaultSegments;              // Amount of HSegments required by the Lathe object
      59             :     long                        nVDefaultSegments;              // Amount of VSegments required by the Lathe object
      60             : 
      61             :     E3dDragConstraint           eDragConstraint;
      62             : 
      63             :     // Migrate selections
      64             :     Impl3DMirrorConstructOverlay*                   mpMirrorOverlay;
      65             : 
      66             :     bool                        bDoubleSided;
      67             : 
      68             :     void InitView();
      69             : 
      70             :     void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
      71             :     void ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
      72             :     void ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj);
      73             :     void ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj);
      74             : 
      75             :     void InitScene(E3dScene* pScene, double fW, double fH, double fCamZ);
      76             :     void ImpIsConvertTo3DPossible(SdrObject* pObj, bool& rAny3D, bool& rGroupSelected) const;
      77             :     void BreakSingle3DObj(E3dObject* pObj);
      78             : 
      79             : public:
      80             :     TYPEINFO_OVERRIDE();
      81             :     E3dView(SdrModel* pModel, OutputDevice* pOut = 0L);
      82             :     virtual ~E3dView();
      83             : 
      84             :     // Output all marked Objects on the given OutputDevice.
      85             :     virtual void DrawMarkedObj(OutputDevice& rOut) const SAL_OVERRIDE;
      86             : 
      87             :     // Access to the default attributes.
      88           0 :     E3dDefaultAttributes& Get3DDefaultAttributes() { return a3DDefaultAttr; }
      89             :     virtual bool BegDragObj(const Point& rPnt, OutputDevice* pOut = NULL, SdrHdl* pHdl = NULL, short nMinMov = -3, SdrDragMethod* pForcedMeth = NULL) SAL_OVERRIDE;
      90             :     virtual void CheckPossibilities() SAL_OVERRIDE;
      91             : 
      92             :     // Get/Set Event
      93           0 :     void SetMouseEvent(const MouseEvent& rNew) { aMouseEvent = rNew; }
      94           0 :     const MouseEvent& GetMouseEvent() { return aMouseEvent; }
      95             : 
      96             :     // Override getting the model, as we need to supply a Scene together with individual 3D Objects.
      97             :     virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE;
      98             : 
      99             :     // On Paste: We need to insert the objects of the Scene, but not the Scene itself
     100             :     using SdrView::Paste;
     101             :     virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
     102             : 
     103             :     // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
     104             :     bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
     105             : 
     106             :     bool IsConvertTo3DObjPossible() const;
     107             :     void ConvertMarkedObjTo3D(bool bExtrude=true, basegfx::B2DPoint aPnt1 = basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint aPnt2 = basegfx::B2DPoint(0.0, 1.0));
     108             : 
     109             :     // Means to create all Extrudes in a certain depth order.
     110             :     void DoDepthArrange(E3dScene* pScene, double fDepth);
     111             :     void ConvertMarkedToPolyObj(bool bLineToArea);
     112             :     E3dScene* SetCurrent3DObj(E3dObject* p3DObj);
     113             :     void Start3DCreation();
     114             : 
     115             :     // Migration of overlay
     116          74 :     bool Is3DRotationCreationActive() const { return (0L != mpMirrorOverlay); }
     117             : 
     118             :     virtual void MovAction(const Point& rPnt) SAL_OVERRIDE;
     119             :     void End3DCreation(bool bUseDefaultValuesForMirrorAxes=false);
     120             :     void ResetCreationActive();
     121             : 
     122             :     double GetDefaultCamPosZ();
     123             : 
     124             :     double &DefaultScaleX ()
     125             :     {
     126             :         return fDefaultScaleX;
     127             :     }
     128             : 
     129             :     double DefaultScaleX () const
     130             :     {
     131             :         return fDefaultScaleX;
     132             :     }
     133             : 
     134             :     double &DefaultScaleY ()
     135             :     {
     136             :         return fDefaultScaleY;
     137             :     }
     138             : 
     139             :     double DefaultScaleY () const
     140             :     {
     141             :         return fDefaultScaleY;
     142             :     }
     143             : 
     144             :     double &DefaultScaleZ ()
     145             :     {
     146             :         return fDefaultScaleZ;
     147             :     }
     148             : 
     149             :     double DefaultScaleZ () const
     150             :     {
     151             :         return fDefaultScaleZ;
     152             :     }
     153             : 
     154             :     double &DefaultRotateX ()
     155             :     {
     156             :         return fDefaultRotateX;
     157             :     }
     158             : 
     159             :     double DefaultRotateX () const
     160             :     {
     161             :         return fDefaultRotateX;
     162             :     }
     163             : 
     164             :     double &DefaultRotateY ()
     165             :     {
     166             :         return fDefaultRotateY;
     167             :     }
     168             : 
     169             :     double DefaultRotateY () const
     170             :     {
     171             :         return fDefaultRotateY;
     172             :     }
     173             : 
     174             :     double &DefaultRotateZ ()
     175             :     {
     176             :         return fDefaultRotateZ;
     177             :     }
     178             : 
     179             :     double DefaultRotateZ () const
     180             :     {
     181             :         return fDefaultRotateZ;
     182             :     }
     183             : 
     184             :     double &DefaultExtrusionDeepth ()
     185             :     {
     186             :         return fDefaultExtrusionDeepth;
     187             :     }
     188             : 
     189             :     double DefaultExtrusionDeepth () const
     190             :     {
     191             :         return fDefaultExtrusionDeepth;
     192             :     }
     193             : 
     194             :     double GetDefaultCamFocal();
     195             : 
     196             :     double &DefaultLightIntensity ()
     197             :     {
     198             :         return fDefaultLightIntensity;
     199             :     }
     200             : 
     201             :     double DefaultLightIntensity () const
     202             :     {
     203             :         return fDefaultLightIntensity;
     204             :     }
     205             : 
     206             :     double &DefaultAmbientIntensity ()
     207             :     {
     208             :         return fDefaultAmbientIntensity;
     209             :     }
     210             : 
     211             :     double DefaultAmbientIntensity () const
     212             :     {
     213             :         return fDefaultAmbientIntensity;
     214             :     }
     215             : 
     216             :     const Color &DefaultLightColor () const
     217             :     {
     218             :         return aDefaultLightColor;
     219             :     }
     220             : 
     221             :     Color DefaultLightColor ()
     222             :     {
     223             :         return aDefaultLightColor;
     224             :     }
     225             : 
     226             :     const Color &DefaultAmbientColor () const
     227             :     {
     228             :         return aDefaultAmbientColor;
     229             :     }
     230             : 
     231             :     Color DefaultAmbientColor ()
     232             :     {
     233             :         return aDefaultAmbientColor;
     234             :     }
     235             : 
     236             :     long GetHDefaultSegments() const { return nHDefaultSegments; }
     237             :     void SetHDefaultSegments(long nSegs) { nHDefaultSegments = nSegs; }
     238             : 
     239             :     long GetVDefaultSegments() const { return nVDefaultSegments; }
     240             :     void SetVDefaultSegments(long nSegs) { nVDefaultSegments = nSegs; }
     241             : 
     242             :     bool IsBreak3DObjPossible() const;
     243             :     void Break3DObj();
     244             : 
     245             :     bool DoubleSided () const { return bDoubleSided; }
     246             : 
     247             :     bool &DoubleSided ()      { return bDoubleSided; }
     248             : 
     249             :     SfxItemSet Get3DAttributes(E3dScene* pInScene = NULL, bool bOnly3DAttr=false) const;
     250             :     void Set3DAttributes(const SfxItemSet& rAttr, E3dScene* pInScene = NULL, bool bOnly3DAttr=false);
     251             : };
     252             : 
     253             : #endif // INCLUDED_SVX_VIEW3D_HXX
     254             : 
     255             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10