29#include <com/sun/star/drawing/PointSequenceSequence.hpp>
30#include <com/sun/star/drawing/LineStyle.hpp>
39using ::com::sun::star::uno::Reference;
40using ::com::sun::star::uno::Sequence;
46 Sequence< double >
P0;
47 Sequence< double >
P1;
48 Sequence< double >
P2;
50 GridLinePoints(
const PlottingPositionHelper* pPosHelper, sal_Int32 nDimensionIndex
54 void update(
double fScaledTickValue );
61GridLinePoints::GridLinePoints(
const PlottingPositionHelper* pPosHelper, sal_Int32 nDimensionIndex
67 double MinX = pPosHelper->getLogicMinX();
68 double MinY = pPosHelper->getLogicMinY();
69 double MinZ = pPosHelper->getLogicMinZ();
70 double MaxX = pPosHelper->getLogicMaxX();
71 double MaxY = pPosHelper->getLogicMaxY();
72 double MaxZ = pPosHelper->getLogicMaxZ();
74 pPosHelper->doLogicScaling( &MinX,&MinY,&MinZ );
75 pPosHelper->doLogicScaling( &MaxX,&MaxY,&MaxZ );
77 if(!pPosHelper->isMathematicalOrientationX())
78 std::swap( MinX, MaxX );
79 if(!pPosHelper->isMathematicalOrientationY())
80 std::swap( MinY, MaxY );
81 if(pPosHelper->isMathematicalOrientationZ())
82 std::swap( MinZ, MaxZ );
83 bool bSwapXY = pPosHelper->isSwapXAndY();
92 P0 =
P1 =
P2 = { v0, v1, v2 };
122void GridLinePoints::update(
double fScaledTickValue )
127static void addLine2D( drawing::PointSequenceSequence& rPoints, sal_Int32 nIndex
128 ,
const GridLinePoints& rScaledLogicPoints
135 rPoints.getArray()[
nIndex]
136 = { {
static_cast<sal_Int32
>(aPA.PositionX),
static_cast<sal_Int32
>(aPA.PositionY) },
137 {
static_cast<sal_Int32
>(aPB.PositionX),
static_cast<sal_Int32
>(aPB.PositionY) } };
140static void addLine3D( std::vector<std::vector<css::drawing::Position3D>>& rPoints, sal_Int32 nIndex
141 ,
const GridLinePoints& rBasePoints
144 drawing::Position3D aPoint =rTransformation.
transform( rBasePoints.P0 );
146 aPoint = rTransformation.
transform( rBasePoints.P1 );
148 aPoint = rTransformation.
transform( rBasePoints.P2 );
152VCartesianGrid::VCartesianGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
155 , m_aGridPropertiesList(
std::move(aGridPropertiesList) )
169 rLinePropertiesList.clear();
170 if( rGridPropertiesList.empty() )
174 for(
const auto & rxPropSet : rGridPropertiesList )
177 aLineProperties.
LineStyle <<= drawing::LineStyle_NONE;
180 rLinePropertiesList.push_back(aLineProperties);
194 if(!xGroupShape_Shapes.is())
197 std::vector<VLineProperties> aLinePropertiesList;
208 if(aAllTickInfos.empty())
211 TickInfoArraysType::iterator aDepthIter = aAllTickInfos.begin();
212 const TickInfoArraysType::const_iterator aDepthEnd = aAllTickInfos.end();
214 sal_Int32 nLinePropertiesCount = aLinePropertiesList.size();
215 for( sal_Int32 nDepth=0
216 ; aDepthIter != aDepthEnd && nDepth < nLinePropertiesCount
217 ; ++aDepthIter, nDepth++ )
219 if( !aLinePropertiesList[nDepth].isLineVisible() )
237 sal_Int32 nPointCount = (*aDepthIter).size();
238 drawing::PointSequenceSequence aPoints(nPointCount);
240 sal_Int32 nRealPointCount = 0;
241 for (
auto const& tick : *aDepthIter)
245 aGridLinePoints.update( tick.fScaledTickValue );
249 aPoints.realloc(nRealPointCount);
253 drawing::PointSequenceSequence aHandlesPoints(1);
254 auto pHandlesPoints = aHandlesPoints.getArray();
255 pHandlesPoints[0].realloc(nRealPointCount);
256 auto pHandlesPoints0 = pHandlesPoints[0].getArray();
257 for( sal_Int32 nN = 0; nN<nRealPointCount; nN++)
258 pHandlesPoints0[nN] = aPoints[nN][1];
262 aHandleLineProperties.
LineStyle <<= drawing::LineStyle_NONE;
271 sal_Int32 nPointCount = (*aDepthIter).size();
272 std::vector<std::vector<css::drawing::Position3D>> aPoints;
273 aPoints.resize(nPointCount);
275 sal_Int32 nRealPointCount = 0;
276 sal_Int32 nPolyIndex = 0;
277 for (
auto const& tick : *aDepthIter)
285 aGridLinePoints.update( tick.fScaledTickValue );
290 aPoints.resize(nRealPointCount);
sal_Int32 m_nDimensionIndex
static bool isGridVisible(const rtl::Reference< ::chart::GridProperties > &xGridProperties)
static OUString createChildParticleWithIndex(ObjectType eObjectType, sal_Int32 nIndex)
static OUString addChildParticle(std::u16string_view rParticle, std::u16string_view rChildParticle)
rtl::Reference< SvxShapeGroupAnyD > m_xLogicTarget
PlottingPositionHelper * m_pPosHelper
const sal_Int32 m_nDimension
rtl::Reference< SvxShapeGroupAnyD > createGroupShape(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const OUString &rName=OUString())
virtual ::chart::XTransformation2 * getTransformationScaledLogicToScene() const
static void setShapeName(const rtl::Reference< SvxShape > &xShape, const OUString &rName)
static rtl::Reference< Svx3DPolygonObject > createLine3D(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const std::vector< std::vector< css::drawing::Position3D > > &rPoints, const VLineProperties &rLineProperties)
static rtl::Reference< SvxShapePolyPolygon > createLine2D(const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::drawing::PointSequenceSequence &rPoints, const VLineProperties *pLineProperties=nullptr)
void getAllTicks(TickInfoArraysType &rAllTickInfos) const
CuboidPlanePosition m_eBottomPos
CuboidPlanePosition m_eLeftWallPos
virtual TickFactory * createTickFactory()
sal_Int32 m_nDimensionIndex
CuboidPlanePosition m_eBackWallPos
virtual void createShapes() override
static void fillLinePropertiesFromGridModel(std::vector< VLineProperties > &rLinePropertiesList, const std::vector< rtl::Reference< ::chart::GridProperties > > &rGridPropertiesList)
virtual ~VCartesianGrid() override
std::vector< rtl::Reference< ::chart::GridProperties > > m_aGridPropertiesList
Reference< XInterface > xTarget
OOO_DLLPUBLIC_CHARTTOOLS void AddPointToPoly(css::drawing::PolyPolygonShape3D &rPoly, const css::drawing::Position3D &rPos, sal_Int32 nSequenceIndex=0)
PolyPolygonShape3D + drawing::Position3D -> PolyPolygonShape3D.
static void addLine3D(std::vector< std::vector< css::drawing::Position3D > > &rPoints, sal_Int32 nIndex, const GridLinePoints &rBasePoints, const XTransformation2 &rTransformation)
std::vector< TickInfoArrayType > TickInfoArraysType
static void addLine2D(drawing::PointSequenceSequence &rPoints, sal_Int32 nIndex, const GridLinePoints &rScaledLogicPoints, const XTransformation2 &rTransformation)
@ CuboidPlanePosition_Left
@ CuboidPlanePosition_Back
@ CuboidPlanePosition_Bottom
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D SequenceToPosition3D(const css::uno::Sequence< double > &rSeq)
Sequence<double> -> drawing::Position3D.
void initFromPropertySet(const css::uno::Reference< css::beans::XPropertySet > &xProp)