diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-03 09:18:24 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-06 09:21:36 +0200 |
commit | 3b34655cc5ba586a616533e2efe3426d7c4e5aef (patch) | |
tree | e5f8428cd121c4543e74ff6524c27c9399e1d101 /include | |
parent | fd7a21d7ea6dd36d4d9b86ecf38ad798af3fb1df (diff) |
loplugin: cstylecast
Change-Id: Id2b5b2510fb13f77592d7a0455f34ccd8a20c2d7
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/cube3d.hxx | 6 | ||||
-rw-r--r-- | include/svx/extrud3d.hxx | 2 | ||||
-rw-r--r-- | include/svx/lathe3d.hxx | 22 | ||||
-rw-r--r-- | include/svx/polygn3d.hxx | 72 | ||||
-rw-r--r-- | include/svx/scene3d.hxx | 1 | ||||
-rw-r--r-- | include/svx/sdr/contact/viewcontactofe3d.hxx | 7 | ||||
-rw-r--r-- | include/svx/sdr/contact/viewcontactofe3dscene.hxx | 7 | ||||
-rw-r--r-- | include/svx/sphere3d.hxx | 4 |
8 files changed, 96 insertions, 25 deletions
diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx index 378717fac0df..37ae37e126ca 100644 --- a/include/svx/cube3d.hxx +++ b/include/svx/cube3d.hxx @@ -68,13 +68,13 @@ public: // Set local parameters with geometry recreation void SetCubePos(const basegfx::B3DPoint& rNew); - const basegfx::B3DPoint& GetCubePos() { return aCubePos; } + const basegfx::B3DPoint& GetCubePos() const { return aCubePos; } void SetCubeSize(const basegfx::B3DVector& rNew); - const basegfx::B3DVector& GetCubeSize() { return aCubeSize; } + const basegfx::B3DVector& GetCubeSize() const { return aCubeSize; } void SetPosIsCenter(bool bNew); - bool GetPosIsCenter() { return bPosIsCenter; } + bool GetPosIsCenter() const { return bPosIsCenter; } sal_uInt16 GetSideFlags() { return nSideFlags; } diff --git a/include/svx/extrud3d.hxx b/include/svx/extrud3d.hxx index dbb8260e0661..cdade62cedb0 100644 --- a/include/svx/extrud3d.hxx +++ b/include/svx/extrud3d.hxx @@ -91,7 +91,7 @@ public: // set/get local parameters with geometry regeneration void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew); - const basegfx::B2DPolyPolygon &GetExtrudePolygon() { return maExtrudePolygon; } + const basegfx::B2DPolyPolygon &GetExtrudePolygon() const { return maExtrudePolygon; } virtual bool IsBreakObjPossible() SAL_OVERRIDE; virtual SdrAttrObj* GetBreakObj() SAL_OVERRIDE; diff --git a/include/svx/lathe3d.hxx b/include/svx/lathe3d.hxx index 46d0167b2c77..b2138c5089f7 100644 --- a/include/svx/lathe3d.hxx +++ b/include/svx/lathe3d.hxx @@ -52,43 +52,43 @@ private: // HorizontalSegments: sal_uInt32 GetHorizontalSegments() const - { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); } + { return static_cast<const SfxUInt32Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); } // VerticalSegments: sal_uInt32 GetVerticalSegments() const - { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); } + { return static_cast<const SfxUInt32Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); } // PercentDiagonal: 0..100, before 0.0..0.5 sal_uInt16 GetPercentDiagonal() const - { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); } + { return static_cast<const SfxUInt16Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); } // BackScale: 0..100, before 0.0..1.0 sal_uInt16 GetBackScale() const - { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); } + { return static_cast<const SfxUInt16Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); } // EndAngle: 0..10000 sal_uInt32 GetEndAngle() const - { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue(); } + { return static_cast<const SfxUInt32Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue(); } // #107245# GetSmoothNormals() for bLatheSmoothed bool GetSmoothNormals() const - { return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); } + { return static_cast<const Svx3DSmoothNormalsItem&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); } // #107245# GetSmoothLids() for bLatheSmoothFrontBack bool GetSmoothLids() const - { return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); } + { return static_cast<const Svx3DSmoothLidsItem&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); } // #107245# GetCharacterMode() for bLatheCharacterMode bool GetCharacterMode() const - { return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); } + { return static_cast<const Svx3DCharacterModeItem&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); } // #107245# GetCloseFront() for bLatheCloseFront bool GetCloseFront() const - { return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); } + { return static_cast<const Svx3DCloseFrontItem&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); } // #107245# GetCloseBack() for bLatheCloseBack bool GetCloseBack() const - { return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); } + { return static_cast<const Svx3DCloseBackItem&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); } virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE; @@ -102,7 +102,7 @@ private: // set/get local parameters with geometry recreation void SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew); - const basegfx::B2DPolyPolygon& GetPolyPoly2D() { return maPolyPoly2D; } + const basegfx::B2DPolyPolygon& GetPolyPoly2D() const { return maPolyPoly2D; } // break up virtual bool IsBreakObjPossible() SAL_OVERRIDE; diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx new file mode 100644 index 000000000000..3bff65e5945a --- /dev/null +++ b/include/svx/polygn3d.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_POLYGN3D_HXX +#define INCLUDED_SVX_INC_POLYGN3D_HXX + +#include <svx/obj3d.hxx> +#include <svx/svxdllapi.h> + +class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject +{ +private: + // parameters + basegfx::B3DPolyPolygon aPolyPoly3D; + basegfx::B3DPolyPolygon aPolyNormals3D; + basegfx::B2DPolyPolygon aPolyTexture2D; + bool bLineOnly; + + SVX_DLLPRIVATE void CreateDefaultNormals(); + SVX_DLLPRIVATE void CreateDefaultTexture(); + +protected: + virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE; + +public: + void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D); + void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D); + void SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyPoly2D); + + TYPEINFO_OVERRIDE(); + + E3dPolygonObj( + E3dDefaultAttributes& rDefault, + const basegfx::B3DPolyPolygon& rPolyPoly3D, + bool bLinOnly=false); + + E3dPolygonObj(); + virtual ~E3dPolygonObj(); + + const basegfx::B3DPolyPolygon& GetPolyPolygon3D() const { return aPolyPoly3D; } + const basegfx::B3DPolyPolygon& GetPolyNormals3D() const { return aPolyNormals3D; } + const basegfx::B2DPolyPolygon& GetPolyTexture2D() const { return aPolyTexture2D; } + + virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE; + virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE; + + virtual E3dPolygonObj* Clone() const SAL_OVERRIDE; + + // LineOnly? + bool GetLineOnly() const { return bLineOnly; } + void SetLineOnly(bool bNew); +}; + +#endif // INCLUDED_SVX_INC_POLYGN3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index 86c7ecc423ac..332fa2a7fa8d 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -219,6 +219,7 @@ public: // get transformations B3dCamera& GetCameraSet() { return aCameraSet; } + const B3dCamera& GetCameraSet() const { return aCameraSet; } // break up virtual bool IsBreakObjPossible() SAL_OVERRIDE; diff --git a/include/svx/sdr/contact/viewcontactofe3d.hxx b/include/svx/sdr/contact/viewcontactofe3d.hxx index d46a8e5f44fe..d30c3006a7dc 100644 --- a/include/svx/sdr/contact/viewcontactofe3d.hxx +++ b/include/svx/sdr/contact/viewcontactofe3d.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3D_HXX #define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3D_HXX +#include <svx/obj3d.hxx> #include <svx/sdr/contact/viewcontactofsdrobj.hxx> #include <drawinglayer/primitive3d/baseprimitive3d.hxx> @@ -39,8 +40,6 @@ namespace basegfx { class B3DHomMatrix; } -class E3dObject; - namespace sdr @@ -60,9 +59,9 @@ namespace sdr virtual ~ViewContactOfE3d(); // access to E3dObject - E3dObject& GetE3dObject() const + const E3dObject& GetE3dObject() const { - return (E3dObject&)GetSdrObject(); + return static_cast<const E3dObject&>(GetSdrObject()); } // public helpers diff --git a/include/svx/sdr/contact/viewcontactofe3dscene.hxx b/include/svx/sdr/contact/viewcontactofe3dscene.hxx index f0334cb32ad8..dca13e268269 100644 --- a/include/svx/sdr/contact/viewcontactofe3dscene.hxx +++ b/include/svx/sdr/contact/viewcontactofe3dscene.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX #define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX +#include <svx/scene3d.hxx> #include <svx/sdr/contact/viewcontactofsdrobj.hxx> #include <drawinglayer/primitive3d/baseprimitive3d.hxx> #include <drawinglayer/attribute/sdrsceneattribute3d.hxx> @@ -30,8 +31,6 @@ // predeclarations -class E3dScene; - namespace basegfx { class B3DRange; } @@ -55,9 +54,9 @@ namespace sdr explicit ViewContactOfE3dScene(E3dScene& rScene); // access to SdrObject - E3dScene& GetE3dScene() const + const E3dScene& GetE3dScene() const { - return (E3dScene&)GetSdrObject(); + return static_cast<const E3dScene&>(GetSdrObject()); } // React on changes of the object of this ViewContact diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx index 348fbc56b2f7..305260e64aae 100644 --- a/include/svx/sphere3d.hxx +++ b/include/svx/sphere3d.hxx @@ -49,11 +49,11 @@ public: // horizontal segments: sal_uInt32 GetHorizontalSegments() const - { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); } + { return static_cast<const SfxUInt32Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); } // VerticalSegments: sal_uInt32 GetVerticalSegments() const - { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); } + { return static_cast<const SfxUInt32Item&>(GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); } virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE; virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE; |