LibreOffice Module basegfx (master) 1
b3dpolypolygontools.hxx
Go to the documentation of this file.
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#pragma once
21
24
25namespace com::sun::star::drawing { struct PolyPolygonShape3D; }
26
27namespace basegfx
28{
29 class B3DPolyPolygon;
30 class B3DRange;
31}
32
33namespace basegfx::utils
34{
35 // B3DPolyPolygon tools
36
37 // get size of PolyPolygon. Control vectors are included in that ranges.
38 BASEGFX_DLLPUBLIC B3DRange getRange(const B3DPolyPolygon& rCandidate);
39
42 B3DPolyPolygon const & createUnitCubePolyPolygon();
43
46 B3DPolyPolygon const & createUnitCubeFillPolyPolygon();
47
50 BASEGFX_DLLPUBLIC B3DPolyPolygon createCubePolyPolygonFromB3DRange( const B3DRange& rRange);
51
54 BASEGFX_DLLPUBLIC B3DPolyPolygon createCubeFillPolyPolygonFromB3DRange( const B3DRange& rRange);
55
61 B3DPolyPolygon createUnitSpherePolyPolygon(
62 sal_uInt32 nHorSeg, sal_uInt32 nVerSeg,
63 double fVerStart = M_PI_2, double fVerStop = -M_PI_2,
64 double fHorStart = 0.0, double fHorStop = 2 * M_PI);
65
71 const B3DRange& rRange,
72 sal_uInt32 nHorSeg, sal_uInt32 nVerSeg,
73 double fVerStart = M_PI_2, double fVerStop = -M_PI_2,
74 double fHorStart = 0.0, double fHorStop = 2 * M_PI);
75
80 sal_uInt32 nHorSeg, sal_uInt32 nVerSeg,
81 bool bNormals = false,
82 double fVerStart = M_PI_2, double fVerStop = -M_PI_2,
83 double fHorStart = 0.0, double fHorStop = 2 * M_PI);
84
89 const B3DRange& rRange,
90 sal_uInt32 nHorSeg, sal_uInt32 nVerSeg,
91 bool bNormals = false,
92 double fVerStart = M_PI_2, double fVerStop = -M_PI_2,
93 double fHorStart = 0.0, double fHorStop = 2 * M_PI);
94
99 BASEGFX_DLLPUBLIC B3DPolyPolygon applyDefaultNormalsSphere( const B3DPolyPolygon& rCandidate, const B3DPoint& rCenter);
100
103 BASEGFX_DLLPUBLIC B3DPolyPolygon invertNormals( const B3DPolyPolygon& rCandidate);
104
110 BASEGFX_DLLPUBLIC B3DPolyPolygon applyDefaultTextureCoordinatesParallel( const B3DPolyPolygon& rCandidate, const B3DRange& rRange, bool bChangeX = true, bool bChangeY = true);
111
117 BASEGFX_DLLPUBLIC B3DPolyPolygon applyDefaultTextureCoordinatesSphere( const B3DPolyPolygon& rCandidate, const B3DPoint& rCenter, bool bChangeX = true, bool bChangeY = true);
118
119 // isInside test for B3DPoint. On border is not inside.
120 // It is assumed that the orientations of the given polygon are correct.
121 BASEGFX_DLLPUBLIC bool isInside(const B3DPolyPolygon& rCandidate, const B3DPoint& rPoint);
122
125 const css::drawing::PolyPolygonShape3D& rPolyPolygonShape3DSource);
127 const B3DPolyPolygon& rPolyPolygonSource,
128 css::drawing::PolyPolygonShape3D& rPolyPolygonShape3DRetval);
129
130} // end of namespace basegfx::utils
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASEGFX_DLLPUBLIC
Definition: basegfxdllapi.h:35
B3DPolyPolygon createCubePolyPolygonFromB3DRange(const B3DRange &rRange)
Create a 3D line polyPolygon from a B3DRange which defines a cube.
B3DPolygon applyDefaultTextureCoordinatesSphere(const B3DPolygon &rCandidate, const B3DPoint &rCenter, bool bChangeX, bool bChangeY)
Create/replace texture coordinates for given 3d geometry with spherical one rCenter: the centre of th...
B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange(const B3DRange &rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals, double fVerStart, double fVerStop, double fHorStart, double fHorStop)
same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented) There ...
B3DPolyPolygon createCubeFillPolyPolygonFromB3DRange(const B3DRange &rRange)
Create a 3D fill polyPolygon from a B3DRange which defines a cube.
bool isInside(const B2DPolygon &rCandidate, const B2DPoint &rPoint, bool bWithBorder)
B3DPolygon applyDefaultNormalsSphere(const B3DPolygon &rCandidate, const B3DPoint &rCenter)
Create/replace normals for given 3d geometry with default normals from given center to outside.
B3DPolyPolygon createSpherePolyPolygonFromB3DRange(const B3DRange &rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, double fVerStart, double fVerStop, double fHorStart, double fHorStop)
Create a 3D line polyPolygon from a B3DRange which defines a sphere with the given count of hor and v...
void B3DPolyPolygonToUnoPolyPolygonShape3D(const B3DPolyPolygon &rPolyPolygonSource, css::drawing::PolyPolygonShape3D &rPolyPolygonShape3DRetval)
B3DPolyPolygon const & createUnitCubeFillPolyPolygon()
Create a unit 3D fill polyPolygon which defines a cube.
B3DPolyPolygon createUnitSphereFillPolyPolygon(sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals, double fVerStart, double fVerStop, double fHorStart, double fHorStop)
same as createUnitSpherePolyPolygon, but creates filled polygons (closed and oriented) There is one e...
B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(const css::drawing::PolyPolygonShape3D &rPolyPolygonShape3DSource)
converters for css::drawing::PolyPolygonShape3D
B3DPolyPolygon const & createUnitCubePolyPolygon()
Create a unit 3D line polyPolygon which defines a cube.
B3DPolygon invertNormals(const B3DPolygon &rCandidate)
invert normals for given 3d geometry.
B3DPolygon applyDefaultTextureCoordinatesParallel(const B3DPolygon &rCandidate, const B3DRange &rRange, bool bChangeX, bool bChangeY)
Create/replace texture coordinates for given 3d geometry with parallel projected one rRange: the full...
B3DPolyPolygon createUnitSpherePolyPolygon(sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, double fVerStart, double fVerStop, double fHorStart, double fHorStop)
Create a unit 3D line polyPolygon which defines a sphere with the given count of hor and ver segments...
B2DRange getRange(const B2DPolygon &rCandidate)
Get the range of a polygon.