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
78bec2b6
Kaydet (Commit)
78bec2b6
authored
Nis 03, 2013
tarafından
Thomas Arnhold
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#62525: use cow_wrapper for ViewInformation3D
Change-Id: I4f304febfedfa4a5a89d996fe276a9413d0ef855
üst
0c85109e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
66 deletions
+20
-66
viewinformation3d.hxx
drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
+5
-1
viewinformation3d.cxx
drawinglayer/source/geometry/viewinformation3d.cxx
+15
-65
No files found.
drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
Dosyayı görüntüle @
78bec2b6
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <sal/config.h>
#include <sal/config.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <o3tl/cow_wrapper.hxx>
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// predefines
// predefines
...
@@ -56,9 +57,12 @@ namespace drawinglayer
...
@@ -56,9 +57,12 @@ namespace drawinglayer
*/
*/
class
DRAWINGLAYER_DLLPUBLIC
ViewInformation3D
class
DRAWINGLAYER_DLLPUBLIC
ViewInformation3D
{
{
public
:
typedef
o3tl
::
cow_wrapper
<
ImpViewInformation3D
,
o3tl
::
ThreadSafeRefCountingPolicy
>
ImplType
;
private
:
private
:
/// pointer to private implementation class
/// pointer to private implementation class
Imp
ViewInformation3D
*
mpViewInformation3D
;
Imp
lType
mpViewInformation3D
;
public
:
public
:
/** Constructor: Create a ViewInformation3D
/** Constructor: Create a ViewInformation3D
...
...
drawinglayer/source/geometry/viewinformation3d.cxx
Dosyayı görüntüle @
78bec2b6
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <com/sun/star/geometry/AffineMatrix3D.hpp>
#include <com/sun/star/geometry/AffineMatrix3D.hpp>
#include <com/sun/star/geometry/RealRectangle3D.hpp>
#include <com/sun/star/geometry/RealRectangle3D.hpp>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <rtl/instance.hxx>
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
...
@@ -43,9 +44,6 @@ namespace drawinglayer
...
@@ -43,9 +44,6 @@ namespace drawinglayer
// two memory regions for pairs of ViewInformation3D/ImpViewInformation3D
// two memory regions for pairs of ViewInformation3D/ImpViewInformation3D
friend
class
::
drawinglayer
::
geometry
::
ViewInformation3D
;
friend
class
::
drawinglayer
::
geometry
::
ViewInformation3D
;
// the refcounter. 0 means exclusively used
sal_uInt32
mnRefCount
;
// the 3D transformations
// the 3D transformations
// Object to World. This may change and being adapted when entering 3D transformation
// Object to World. This may change and being adapted when entering 3D transformation
// groups
// groups
...
@@ -351,8 +349,7 @@ namespace drawinglayer
...
@@ -351,8 +349,7 @@ namespace drawinglayer
const
basegfx
::
B3DHomMatrix
&
rDeviceToView
,
const
basegfx
::
B3DHomMatrix
&
rDeviceToView
,
double
fViewTime
,
double
fViewTime
,
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rExtendedParameters
)
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rExtendedParameters
)
:
mnRefCount
(
0
),
:
maObjectTransformation
(
rObjectTransformation
),
maObjectTransformation
(
rObjectTransformation
),
maOrientation
(
rOrientation
),
maOrientation
(
rOrientation
),
maProjection
(
rProjection
),
maProjection
(
rProjection
),
maDeviceToView
(
rDeviceToView
),
maDeviceToView
(
rDeviceToView
),
...
@@ -364,8 +361,7 @@ namespace drawinglayer
...
@@ -364,8 +361,7 @@ namespace drawinglayer
}
}
explicit
ImpViewInformation3D
(
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rViewParameters
)
explicit
ImpViewInformation3D
(
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rViewParameters
)
:
mnRefCount
(
0
),
:
maObjectTransformation
(),
maObjectTransformation
(),
maOrientation
(),
maOrientation
(),
maProjection
(),
maProjection
(),
maDeviceToView
(),
maDeviceToView
(),
...
@@ -377,8 +373,7 @@ namespace drawinglayer
...
@@ -377,8 +373,7 @@ namespace drawinglayer
}
}
ImpViewInformation3D
()
ImpViewInformation3D
()
:
mnRefCount
(
0
),
:
maObjectTransformation
(),
maObjectTransformation
(),
maOrientation
(),
maOrientation
(),
maProjection
(),
maProjection
(),
maDeviceToView
(),
maDeviceToView
(),
...
@@ -433,21 +428,6 @@ namespace drawinglayer
...
@@ -433,21 +428,6 @@ namespace drawinglayer
&&
mfViewTime
==
rCandidate
.
mfViewTime
&&
mfViewTime
==
rCandidate
.
mfViewTime
&&
mxExtendedInformation
==
rCandidate
.
mxExtendedInformation
);
&&
mxExtendedInformation
==
rCandidate
.
mxExtendedInformation
);
}
}
static
ImpViewInformation3D
*
get_global_default
()
{
static
ImpViewInformation3D
*
pDefault
=
0
;
if
(
!
pDefault
)
{
pDefault
=
new
ImpViewInformation3D
();
// never delete; start with RefCount 1, not 0
pDefault
->
mnRefCount
++
;
}
return
pDefault
;
}
};
};
}
// end of anonymous namespace
}
// end of anonymous namespace
}
// end of namespace drawinglayer
}
// end of namespace drawinglayer
...
@@ -458,6 +438,12 @@ namespace drawinglayer
...
@@ -458,6 +438,12 @@ namespace drawinglayer
{
{
namespace
geometry
namespace
geometry
{
{
namespace
{
struct
theGlobalDefault
:
public
rtl
::
Static
<
ViewInformation3D
::
ImplType
,
theGlobalDefault
>
{};
}
ViewInformation3D
::
ViewInformation3D
(
ViewInformation3D
::
ViewInformation3D
(
const
basegfx
::
B3DHomMatrix
&
rObjectObjectTransformation
,
const
basegfx
::
B3DHomMatrix
&
rObjectObjectTransformation
,
const
basegfx
::
B3DHomMatrix
&
rOrientation
,
const
basegfx
::
B3DHomMatrix
&
rOrientation
,
...
@@ -465,81 +451,45 @@ namespace drawinglayer
...
@@ -465,81 +451,45 @@ namespace drawinglayer
const
basegfx
::
B3DHomMatrix
&
rDeviceToView
,
const
basegfx
::
B3DHomMatrix
&
rDeviceToView
,
double
fViewTime
,
double
fViewTime
,
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rExtendedParameters
)
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rExtendedParameters
)
:
mpViewInformation3D
(
new
ImpViewInformation3D
(
:
mpViewInformation3D
(
ImpViewInformation3D
(
rObjectObjectTransformation
,
rOrientation
,
rProjection
,
rObjectObjectTransformation
,
rOrientation
,
rProjection
,
rDeviceToView
,
fViewTime
,
rExtendedParameters
))
rDeviceToView
,
fViewTime
,
rExtendedParameters
))
{
{
}
}
ViewInformation3D
::
ViewInformation3D
(
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rViewParameters
)
ViewInformation3D
::
ViewInformation3D
(
const
uno
::
Sequence
<
beans
::
PropertyValue
>&
rViewParameters
)
:
mpViewInformation3D
(
new
ImpViewInformation3D
(
rViewParameters
))
:
mpViewInformation3D
(
ImpViewInformation3D
(
rViewParameters
))
{
{
}
}
ViewInformation3D
::
ViewInformation3D
()
ViewInformation3D
::
ViewInformation3D
()
:
mpViewInformation3D
(
ImpViewInformation3D
::
get_global_defaul
t
())
:
mpViewInformation3D
(
theGlobalDefault
::
ge
t
())
{
{
mpViewInformation3D
->
mnRefCount
++
;
}
}
ViewInformation3D
::
ViewInformation3D
(
const
ViewInformation3D
&
rCandidate
)
ViewInformation3D
::
ViewInformation3D
(
const
ViewInformation3D
&
rCandidate
)
:
mpViewInformation3D
(
rCandidate
.
mpViewInformation3D
)
:
mpViewInformation3D
(
rCandidate
.
mpViewInformation3D
)
{
{
::
osl
::
Mutex
m_mutex
;
mpViewInformation3D
->
mnRefCount
++
;
}
}
ViewInformation3D
::~
ViewInformation3D
()
ViewInformation3D
::~
ViewInformation3D
()
{
{
::
osl
::
Mutex
m_mutex
;
if
(
mpViewInformation3D
->
mnRefCount
)
{
mpViewInformation3D
->
mnRefCount
--
;
}
else
{
delete
mpViewInformation3D
;
}
}
}
bool
ViewInformation3D
::
isDefault
()
const
bool
ViewInformation3D
::
isDefault
()
const
{
{
return
mpViewInformation3D
==
ImpViewInformation3D
::
get_global_default
(
);
return
mpViewInformation3D
.
same_object
(
theGlobalDefault
::
get
()
);
}
}
ViewInformation3D
&
ViewInformation3D
::
operator
=
(
const
ViewInformation3D
&
rCandidate
)
ViewInformation3D
&
ViewInformation3D
::
operator
=
(
const
ViewInformation3D
&
rCandidate
)
{
{
::
osl
::
Mutex
m_mutex
;
if
(
mpViewInformation3D
->
mnRefCount
)
{
mpViewInformation3D
->
mnRefCount
--
;
}
else
{
delete
mpViewInformation3D
;
}
mpViewInformation3D
=
rCandidate
.
mpViewInformation3D
;
mpViewInformation3D
=
rCandidate
.
mpViewInformation3D
;
mpViewInformation3D
->
mnRefCount
++
;
return
*
this
;
return
*
this
;
}
}
bool
ViewInformation3D
::
operator
==
(
const
ViewInformation3D
&
rCandidate
)
const
bool
ViewInformation3D
::
operator
==
(
const
ViewInformation3D
&
rCandidate
)
const
{
{
if
(
rCandidate
.
mpViewInformation3D
==
mpViewInformation3D
)
return
rCandidate
.
mpViewInformation3D
==
mpViewInformation3D
;
{
return
true
;
}
if
(
rCandidate
.
isDefault
()
!=
isDefault
())
{
return
false
;
}
return
(
*
rCandidate
.
mpViewInformation3D
==
*
mpViewInformation3D
);
}
}
const
basegfx
::
B3DHomMatrix
&
ViewInformation3D
::
getObjectTransformation
()
const
const
basegfx
::
B3DHomMatrix
&
ViewInformation3D
::
getObjectTransformation
()
const
...
...
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