Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
aa4649b8
Kaydet (Commit)
aa4649b8
authored
Agu 15, 2012
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#120569# Enhanced 3D visualisation of line custom shapes
üst
e4578fcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
10 deletions
+68
-10
sdrattributecreator.hxx
svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
+3
-2
EnhancedCustomShape3d.cxx
svx/source/customshapes/EnhancedCustomShape3d.cxx
+65
-8
No files found.
svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
Dosyayı görüntüle @
aa4649b8
...
...
@@ -25,6 +25,7 @@
#define INCLUDED_SDR_PRIMITIVE2D_SDRATTRIBUTECREATOR_HXX
#include <sal/types.h>
#include <svx/svxdllapi.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
...
...
@@ -59,10 +60,10 @@ namespace drawinglayer
namespace
primitive2d
{
// SdrAttribute creators
attribute
::
SdrLineAttribute
createNewSdrLineAttribute
(
attribute
::
SdrLineAttribute
SVX_DLLPUBLIC
createNewSdrLineAttribute
(
const
SfxItemSet
&
rSet
);
attribute
::
SdrLineStartEndAttribute
createNewSdrLineStartEndAttribute
(
attribute
::
SdrLineStartEndAttribute
SVX_DLLPUBLIC
createNewSdrLineStartEndAttribute
(
const
SfxItemSet
&
rSet
,
double
fWidth
);
...
...
svx/source/customshapes/EnhancedCustomShape3d.cxx
Dosyayı görüntüle @
aa4649b8
...
...
@@ -56,6 +56,12 @@
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drange.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <drawinglayer/attribute/sdrlineattribute.hxx>
#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xfltrit.hxx>
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
using
namespace
com
::
sun
::
star
;
...
...
@@ -394,14 +400,60 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
sal_Bool
bIsPlaceholderObject
=
(((
XFillStyleItem
&
)
pNext
->
GetMergedItem
(
XATTR_FILLSTYLE
)).
GetValue
()
==
XFILL_NONE
)
&&
(((
XLineStyleItem
&
)
pNext
->
GetMergedItem
(
XATTR_LINESTYLE
)).
GetValue
()
==
XLINE_NONE
);
basegfx
::
B2DPolyPolygon
aPolyPoly
;
SfxItemSet
aLocalSet
(
aSet
);
XFillStyle
aLocalFillStyle
(
eFillStyle
);
if
(
pNext
->
ISA
(
SdrPathObj
)
)
{
aPolyPoly
=
((
SdrPathObj
*
)
pNext
)
->
GetPathPoly
();
const
SfxItemSet
&
rSet
=
pNext
->
GetMergedItemSet
();
const
drawinglayer
::
attribute
::
SdrLineAttribute
aLine
(
drawinglayer
::
primitive2d
::
createNewSdrLineAttribute
(
rSet
));
bool
bNeedToConvertToContour
(
0.0
<=
aLine
.
getWidth
()
||
0.0
!=
aLine
.
getFullDotDashLen
());
if
(
aPolyPoly
.
areControlPointsUsed
())
if
(
!
bNeedToConvertToContour
&&
!
aLine
.
isDefault
())
{
aPolyPoly
=
basegfx
::
tools
::
adaptiveSubdivideByAngle
(
aPolyPoly
);
const
drawinglayer
::
attribute
::
SdrLineStartEndAttribute
aLineStartEnd
(
drawinglayer
::
primitive2d
::
createNewSdrLineStartEndAttribute
(
rSet
,
aLine
.
getWidth
()));
if
((
aLineStartEnd
.
getStartWidth
()
&&
aLineStartEnd
.
isStartActive
())
||
(
aLineStartEnd
.
getEndWidth
()
&&
aLineStartEnd
.
isEndActive
()))
{
bNeedToConvertToContour
=
true
;
}
}
if
(
bNeedToConvertToContour
)
{
SdrObject
*
pNewObj
=
pNext
->
ConvertToContourObj
(
const_cast
<
SdrObject
*
>
(
pNext
));
SdrPathObj
*
pNewPathObj
=
dynamic_cast
<
SdrPathObj
*
>
(
pNewObj
);
if
(
pNewPathObj
)
{
aPolyPoly
=
pNewPathObj
->
GetPathPoly
();
if
(
aPolyPoly
.
isClosed
())
{
// correct item properties from line to fill style
aLocalSet
.
Put
(
XLineWidthItem
(
0
));
aLocalSet
.
Put
(
XLineStyleItem
(
XLINE_NONE
));
aLocalSet
.
Put
(
XFillColorItem
(
XubString
(),
((
const
XLineColorItem
&
)(
aLocalSet
.
Get
(
XATTR_LINECOLOR
))).
GetColorValue
()));
aLocalSet
.
Put
(
XFillStyleItem
(
XFILL_SOLID
));
aLocalSet
.
Put
(
XFillTransparenceItem
(((
const
XLineTransparenceItem
&
)(
aLocalSet
.
Get
(
XATTR_LINETRANSPARENCE
))).
GetValue
()));
aLocalFillStyle
=
XFILL_SOLID
;
}
else
{
// correct item properties to hairlines
aLocalSet
.
Put
(
XLineWidthItem
(
0
));
aLocalSet
.
Put
(
XLineStyleItem
(
XLINE_SOLID
));
}
}
SdrObject
::
Free
(
pNewObj
);
}
else
{
aPolyPoly
=
((
SdrPathObj
*
)
pNext
)
->
GetPathPoly
();
}
}
else
...
...
@@ -415,13 +467,18 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
if
(
aPolyPoly
.
count
()
)
{
if
(
aPolyPoly
.
areControlPointsUsed
())
{
aPolyPoly
=
basegfx
::
tools
::
adaptiveSubdivideByAngle
(
aPolyPoly
);
}
const
basegfx
::
B2DRange
aTempRange
(
basegfx
::
tools
::
getRange
(
aPolyPoly
));
const
Rectangle
aBoundRect
(
basegfx
::
fround
(
aTempRange
.
getMinX
()),
basegfx
::
fround
(
aTempRange
.
getMinY
()),
basegfx
::
fround
(
aTempRange
.
getMaxX
()),
basegfx
::
fround
(
aTempRange
.
getMaxY
()));
aBoundRect2d
.
Union
(
aBoundRect
);
E3dCompoundObject
*
p3DObj
=
new
E3dExtrudeObj
(
a3DDefaultAttr
,
aPolyPoly
,
bUseTwoFillStyles
?
10
:
fDepth
);
p3DObj
->
NbcSetLayer
(
pShape2d
->
GetLayer
()
);
p3DObj
->
SetMergedItemSet
(
aSet
);
p3DObj
->
SetMergedItemSet
(
a
Local
Set
);
if
(
bIsPlaceholderObject
)
aPlaceholderObjectList
.
push_back
(
p3DObj
);
else
if
(
bUseTwoFillStyles
)
...
...
@@ -465,7 +522,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pScene
->
Insert3DObj
(
p3DObj
);
p3DObj
=
new
E3dExtrudeObj
(
a3DDefaultAttr
,
aPolyPoly
,
fDepth
);
p3DObj
->
NbcSetLayer
(
pShape2d
->
GetLayer
()
);
p3DObj
->
SetMergedItemSet
(
aSet
);
p3DObj
->
SetMergedItemSet
(
a
Local
Set
);
if
(
bUseExtrusionColor
)
p3DObj
->
SetMergedItem
(
XFillColorItem
(
String
(),
((
XSecondaryFillColorItem
&
)
pCustomShape
->
GetMergedItem
(
XATTR_SECONDARYFILLCOLOR
)).
GetColorValue
()
)
);
p3DObj
->
SetMergedItem
(
XFillStyleItem
(
XFILL_SOLID
)
);
...
...
@@ -474,18 +531,18 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pScene
->
Insert3DObj
(
p3DObj
);
p3DObj
=
new
E3dExtrudeObj
(
a3DDefaultAttr
,
aPolyPoly
,
10
);
p3DObj
->
NbcSetLayer
(
pShape2d
->
GetLayer
()
);
p3DObj
->
SetMergedItemSet
(
aSet
);
p3DObj
->
SetMergedItemSet
(
a
Local
Set
);
basegfx
::
B3DHomMatrix
aFrontTransform
(
p3DObj
->
GetTransform
()
);
aFrontTransform
.
translate
(
0.0
,
0.0
,
fDepth
);
p3DObj
->
NbcSetTransform
(
aFrontTransform
);
if
(
(
e
FillStyle
==
XFILL_BITMAP
)
&&
!
aFillBmp
.
IsEmpty
()
)
if
(
(
aLocal
FillStyle
==
XFILL_BITMAP
)
&&
!
aFillBmp
.
IsEmpty
()
)
{
p3DObj
->
SetMergedItem
(
XFillBitmapItem
(
String
(),
Graphic
(
aFillBmp
)));
}
}
else
if
(
e
FillStyle
==
XFILL_NONE
)
else
if
(
aLocal
FillStyle
==
XFILL_NONE
)
{
XLineColorItem
&
rLineColor
=
(
XLineColorItem
&
)
p3DObj
->
GetMergedItem
(
XATTR_LINECOLOR
);
p3DObj
->
SetMergedItem
(
XFillColorItem
(
String
(),
rLineColor
.
GetColorValue
()
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment