LibreOffice Module drawinglayer (master)
1
drawinglayer
source
processor2d
objectinfoextractor2d.cxx
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
#include <
drawinglayer/processor2d/objectinfoextractor2d.hxx
>
21
#include <
drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
>
22
#include <
drawinglayer/primitive2d/objectinfoprimitive2d.hxx
>
23
24
using namespace
com::sun::star
;
25
26
namespace
drawinglayer::processor2d
27
{
28
void
ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D
(
const
primitive2d::BasePrimitive2D
& rCandidate)
29
{
30
if
(
mpFound
)
31
return
;
32
33
switch
(rCandidate.
getPrimitive2DID
())
34
{
35
case
PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D
:
36
{
37
mpFound
=
dynamic_cast<
const
primitive2d::ObjectInfoPrimitive2D
*
>
(&rCandidate);
38
break
;
39
}
40
default :
41
{
42
// we look for an encapsulated primitive, so do not decompose primitives
43
// based on GroupPrimitive2D, just visit their children. It may be that more
44
// group-like primitives need to be added here, but all primitives with
45
// grouping functionality should be implemented based on the GroupPrimitive2D
46
// class and have their main content accessible as children
47
const
primitive2d::GroupPrimitive2D
* pGroupPrimitive2D =
dynamic_cast<
const
primitive2d::GroupPrimitive2D
*
>
(&rCandidate);
48
49
if
(pGroupPrimitive2D)
50
{
51
// process group children recursively
52
process
(pGroupPrimitive2D->
getChildren
());
53
}
54
else
55
{
56
// do not process recursively, we *only* want to find existing
57
// ObjectInfoPrimitive2D entries
58
}
59
60
break
;
61
}
62
}
63
}
64
65
ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D
(
const
geometry::ViewInformation2D
& rViewInformation)
66
:
BaseProcessor2D
(rViewInformation),
67
mpFound(nullptr)
68
{
69
}
70
71
ObjectInfoPrimitiveExtractor2D::~ObjectInfoPrimitiveExtractor2D
()
72
{
73
}
74
75
}
// end of namespace
76
77
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
drawinglayer::geometry::ViewInformation2D
ViewInformation2D class.
Definition:
viewinformation2d.hxx:64
drawinglayer::primitive2d::BasePrimitive2D
BasePrimitive2D class.
Definition:
baseprimitive2d.hxx:121
drawinglayer::primitive2d::BasePrimitive2D::getPrimitive2DID
virtual sal_uInt32 getPrimitive2DID() const =0
provide unique ID for fast identifying of known primitive implementations in renderers.
drawinglayer::primitive2d::GroupPrimitive2D
GroupPrimitive2D class.
Definition:
groupprimitive2d.hxx:64
drawinglayer::primitive2d::GroupPrimitive2D::getChildren
const Primitive2DContainer & getChildren() const
data read access
Definition:
groupprimitive2d.hxx:74
drawinglayer::primitive2d::ObjectInfoPrimitive2D
ObjectInfoPrimitive2D class.
Definition:
objectinfoprimitive2d.hxx:37
drawinglayer::processor2d::BaseProcessor2D
BaseProcessor2D class.
Definition:
baseprocessor2d.hxx:155
drawinglayer::processor2d::BaseProcessor2D::process
void process(const primitive2d::BasePrimitive2D &rCandidate)
Definition:
baseprocessor2d.cxx:43
drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D
ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D &rViewInformation)
Definition:
objectinfoextractor2d.cxx:65
drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D::~ObjectInfoPrimitiveExtractor2D
virtual ~ObjectInfoPrimitiveExtractor2D() override
Definition:
objectinfoextractor2d.cxx:71
drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D
void processBasePrimitive2D(const primitive2d::BasePrimitive2D &rCandidate) override
tooling methods
Definition:
objectinfoextractor2d.cxx:28
drawinglayer::processor2d::ObjectInfoPrimitiveExtractor2D::mpFound
const primitive2d::ObjectInfoPrimitive2D * mpFound
the target
Definition:
objectinfoextractor2d.hxx:38
drawinglayer_primitivetypes2d.hxx
PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D
#define PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D
Definition:
drawinglayer_primitivetypes2d.hxx:102
com::sun::star
drawinglayer::processor2d
objectinfoextractor2d.hxx
objectinfoprimitive2d.hxx
Generated on Sun Jul 30 2023 04:42:54 for LibreOffice Module drawinglayer (master) by
1.9.3