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
ef41022c
Kaydet (Commit)
ef41022c
authored
Ock 06, 2012
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unusedcode: remove Plotter
üst
6be6357c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
347 deletions
+0
-347
CppunitTest_basegfx.mk
basegfx/CppunitTest_basegfx.mk
+0
-6
Executable_basegfx_cppunittester_all.mk
basegfx/Executable_basegfx_cppunittester_all.mk
+0
-1
testtools.cxx
basegfx/test/testtools.cxx
+0
-235
testtools.hxx
basegfx/test/testtools.hxx
+0
-101
unusedcode.easy
unusedcode.easy
+0
-4
No files found.
basegfx/CppunitTest_basegfx.mk
Dosyayı görüntüle @
ef41022c
...
...
@@ -36,7 +36,6 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx_test, \
basegfx/test/basegfxtools \
basegfx/test/clipstate \
basegfx/test/genericclipper \
basegfx/test/testtools \
))
$(eval $(call gb_CppunitTest_add_linked_libs,basegfx_test, \
...
...
@@ -47,11 +46,6 @@ $(eval $(call gb_CppunitTest_add_linked_libs,basegfx_test, \
$(gb_STDLIBS) \
))
$(eval $(call gb_CppunitTest_set_include,basegfx_test,\
$$(INCLUDE) \
-I$(OUTDIR)/inc/offuh \
))
$(eval $(call gb_CppunitTest_add_api,basegfx_test,\
offapi \
udkapi \
...
...
basegfx/Executable_basegfx_cppunittester_all.mk
Dosyayı görüntüle @
ef41022c
...
...
@@ -61,7 +61,6 @@ $(eval $(call gb_Executable_add_exception_objects,basegfx_cppunittester_all, \
basegfx/test/basegfxtools \
basegfx/test/clipstate \
basegfx/test/genericclipper \
basegfx/test/testtools \
))
$(eval $(call gb_Executable_add_api,basegfx_cppunittester_all, \
...
...
basegfx/test/testtools.cxx
deleted
100644 → 0
Dosyayı görüntüle @
6be6357c
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include "testtools.hxx"
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/curve/b2dcubicbezier.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <algorithm>
namespace
basegfx
{
namespace
testtools
{
Plotter
::
Plotter
(
::
std
::
ostream
&
rOutputStream
)
:
mrOutputStream
(
rOutputStream
),
maPoints
(),
mbFirstElement
(
true
)
{
// output gnuplot setup. We switch gnuplot to parametric
// mode, therefore every plot has at least _two_
// functions: one for the x and one for the y value, both
// depending on t.
mrOutputStream
<<
"#!/usr/bin/gnuplot -persist"
<<
::
std
::
endl
<<
"#"
<<
::
std
::
endl
<<
"# automatically generated by basegfx::testtools::Plotter, don't change!"
<<
::
std
::
endl
<<
"#"
<<
::
std
::
endl
<<
"set parametric"
<<
::
std
::
endl
// This function plots a cubic bezier curve. P,q,r,s
// are the control point elements of the corresponding
// output coordinate component (i.e. x components for
// the x plot, and y components for the y plot)
<<
"cubicBezier(p,q,r,s,t) = p*(1-t)**3+q*3*(1-t)**2*t+r*3*(1-t)*t**2+s*t**3"
<<
::
std
::
endl
// This function plots the derivative of a cubic
// bezier curve. P,q,r,s are the control point
// components of the _original_ curve
<<
"cubicBezDerivative(p,q,r,s,t) = 3*(q-p)*(1-t)**2+6*(r-q)*(1-t)*t+3*(s-r)*t**2"
<<
::
std
::
endl
// Plot a line's x component of a line in implicit
// form ax + by + c = 0
<<
"implicitLineX(a,b,c,t) = a*-c + t*-b"
<<
::
std
::
endl
// Plot a line's y component of a line in implicit
// form ax + by + c = 0
<<
"implicitLineY(a,b,c,t) = b*-c + t*a"
<<
::
std
::
endl
// Plot a line's component of a line between a and b
// (where a and b should be the corresponding
// components of the line's start and end point,
// respectively)
<<
"line(a,b,t) = a*(1-t) + b*t"
<<
::
std
::
endl
<<
::
std
::
endl
<<
"# end of setup"
<<
::
std
::
endl
<<
::
std
::
endl
// Start the actual plot line
<<
"plot [t=0:1] "
;
}
namespace
{
class
PointWriter
{
public
:
PointWriter
(
::
std
::
ostream
&
rOutputStream
)
:
mrOutputStream
(
rOutputStream
)
{
}
void
operator
()(
const
B2DPoint
&
rPoint
)
const
{
mrOutputStream
<<
rPoint
.
getX
()
<<
"
\t
"
<<
rPoint
.
getY
()
<<
::
std
::
endl
;
mrOutputStream
<<
"e"
<<
::
std
::
endl
;
}
private
:
::
std
::
ostream
&
mrOutputStream
;
};
}
Plotter
::~
Plotter
()
{
// End the plot line
mrOutputStream
<<
::
std
::
endl
;
// write stored data points. Cannot write before, since
// this is an inline dataset, which must be after the plot <...>
// line
::
std
::
for_each
(
maPoints
.
begin
(),
maPoints
.
end
(),
PointWriter
(
mrOutputStream
)
);
}
void
Plotter
::
plot
(
const
B2DPolygon
&
rPoly
)
{
const
sal_uInt32
pointCount
(
rPoly
.
count
()
);
if
(
pointCount
<
1
)
return
;
if
(
pointCount
==
1
)
{
plot
(
rPoly
.
getB2DPoint
(
0
)
);
return
;
}
sal_uInt32
i
;
for
(
i
=
0
;
i
<
pointCount
-
1
;
++
i
)
{
if
(
rPoly
.
isNextControlPointUsed
(
i
)
||
rPoly
.
isPrevControlPointUsed
(
i
+
1
))
{
const
B2DCubicBezier
aBezierPlot
(
rPoly
.
getB2DPoint
(
i
),
rPoly
.
getNextControlPoint
(
i
),
rPoly
.
getPrevControlPoint
(
i
+
1
),
rPoly
.
getB2DPoint
(
i
+
1
));
plot
(
aBezierPlot
);
}
else
{
plot
(
rPoly
.
getB2DPoint
(
i
),
rPoly
.
getB2DPoint
(
i
+
1
)
);
}
}
}
void
Plotter
::
plot
(
const
B2DPolyPolygon
&
rPolyPoly
)
{
const
sal_uInt32
nPolyCount
(
rPolyPoly
.
count
()
);
sal_uInt32
i
;
for
(
i
=
0
;
i
<
nPolyCount
;
++
i
)
{
plot
(
rPolyPoly
.
getB2DPolygon
(
i
)
);
}
}
void
Plotter
::
plot
(
const
B2DPoint
&
rPoint
)
{
maPoints
.
push_back
(
rPoint
);
writeSeparator
();
mrOutputStream
<<
"'-' using ($1):($2) title
\"
Point "
<<
maPoints
.
size
()
<<
"
\"
with points"
;
}
void
Plotter
::
plot
(
const
B2DRange
&
rRect
)
{
// TODO: do that also as a data file plot. maPoints must
// then become polymorph, but WTF.
// decompose into four lines
plot
(
B2DPoint
(
rRect
.
getMinX
(),
rRect
.
getMinY
()),
B2DPoint
(
rRect
.
getMaxX
(),
rRect
.
getMinY
())
);
plot
(
B2DPoint
(
rRect
.
getMaxX
(),
rRect
.
getMinY
()),
B2DPoint
(
rRect
.
getMaxX
(),
rRect
.
getMaxY
())
);
plot
(
B2DPoint
(
rRect
.
getMaxX
(),
rRect
.
getMaxY
()),
B2DPoint
(
rRect
.
getMinX
(),
rRect
.
getMaxY
())
);
plot
(
B2DPoint
(
rRect
.
getMinX
(),
rRect
.
getMaxY
()),
B2DPoint
(
rRect
.
getMinX
(),
rRect
.
getMinY
())
);
}
void
Plotter
::
plot
(
const
B2DPoint
&
rStartPoint
,
const
B2DPoint
&
rEndPoint
)
{
writeSeparator
();
mrOutputStream
<<
"line("
<<
rStartPoint
.
getX
()
<<
","
<<
rEndPoint
.
getX
()
<<
",t), "
<<
"line("
<<
rStartPoint
.
getY
()
<<
","
<<
rEndPoint
.
getY
()
<<
",t)"
;
}
void
Plotter
::
plot
(
const
B2DCubicBezier
&
rCurve
)
{
writeSeparator
();
mrOutputStream
<<
"cubicBezier("
<<
rCurve
.
getStartPoint
().
getX
()
<<
","
<<
rCurve
.
getControlPointA
().
getX
()
<<
","
<<
rCurve
.
getControlPointB
().
getX
()
<<
","
<<
rCurve
.
getEndPoint
().
getX
()
<<
",t), "
<<
"cubicBezier("
<<
rCurve
.
getStartPoint
().
getY
()
<<
","
<<
rCurve
.
getControlPointA
().
getY
()
<<
","
<<
rCurve
.
getControlPointB
().
getY
()
<<
","
<<
rCurve
.
getEndPoint
().
getY
()
<<
",t)"
;
}
void
Plotter
::
writeSeparator
()
{
if
(
mbFirstElement
)
{
mbFirstElement
=
false
;
}
else
{
mrOutputStream
<<
", "
;
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx/test/testtools.hxx
deleted
100644 → 0
Dosyayı görüntüle @
6be6357c
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _BASEGFX_TESTTOOLS_HXX
#define _BASEGFX_TESTTOOLS_HXX
#include <basegfx/point/b2dpoint.hxx>
#include <vector>
#include <iostream>
namespace
basegfx
{
class
B2DCubicBezier
;
class
B2DPolygon
;
class
B2DPolyPolygon
;
class
B2DRange
;
namespace
testtools
{
class
Plotter
{
public
:
/** Create a plotter for the given output stream
This class can be used to generate gnuplot scripts for
a number of basegfx graphics primitives, useful for
debugging, regression-testing and comparing basegfx.
*/
Plotter
(
::
std
::
ostream
&
rOutputStream
);
/** Delete the plotter
This implicitely flushes all potential pending writes
to the output stream
*/
~
Plotter
();
/** Plot a 2d polygon into the current graph
*/
void
plot
(
const
B2DPolygon
&
rPoly
);
/** Plot a 2d polyPolygon into the current graph
*/
void
plot
(
const
B2DPolyPolygon
&
rPolyPoly
);
/** Plot a 2d point into the current graph
*/
void
plot
(
const
B2DPoint
&
rPoint
);
/** Plot a 2d rectangle into the current graph
*/
void
plot
(
const
B2DRange
&
rRect
);
/** Plot a 2d line into the current graph
*/
void
plot
(
const
B2DPoint
&
rStartPoint
,
const
B2DPoint
&
rEndPoint
);
/** Plot a 2d cubic bezier curve into the current graph
*/
void
plot
(
const
B2DCubicBezier
&
rCurve
);
private
:
void
writeSeparator
();
::
std
::
ostream
&
mrOutputStream
;
::
std
::
vector
<
B2DPoint
>
maPoints
;
bool
mbFirstElement
;
};
}
}
#endif
/* _BASEGFX_TESTTOOLS_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
unusedcode.easy
Dosyayı görüntüle @
ef41022c
...
...
@@ -1110,10 +1110,6 @@ basegfx::maximum(basegfx::B2DHomPoint const&, basegfx::B2DHomPoint const&)
basegfx::maximum(basegfx::B2ITuple const&, basegfx::B2ITuple const&)
basegfx::minimum(basegfx::B2DHomPoint const&, basegfx::B2DHomPoint const&)
basegfx::minimum(basegfx::B2ITuple const&, basegfx::B2ITuple const&)
basegfx::testtools::Plotter::Plotter(std::basic_ostream<char, std::char_traits<char> >&)
basegfx::testtools::Plotter::plot(basegfx::B2DPolyPolygon const&)
basegfx::testtools::Plotter::plot(basegfx::B2DRange const&)
basegfx::testtools::Plotter::~Plotter()
basegfx::tools::B2DClipState::B2DClipState(basegfx::B2DPolygon const&)
basegfx::tools::B2DClipState::B2DClipState(basegfx::B2DRange const&)
basegfx::tools::B2DClipState::intersectClipState(basegfx::tools::B2DClipState 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