xref: /AOO41X/main/svx/inc/svx/helperhittest3d.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_SVX_HELPERHITTEST_HXX
29 #define INCLUDED_SVX_HELPERHITTEST_HXX
30 
31 #include "svx/svxdllapi.h"
32 #include <sal/types.h>
33 #include <vector>
34 
35 //////////////////////////////////////////////////////////////////////////////
36 // predefines
37 
38 namespace basegfx {
39     class B2DPoint;
40 }
41 
42 namespace drawinglayer { namespace geometry {
43 	class ViewInformation3D;
44 }}
45 
46 class E3dCompoundObject;
47 class E3dScene;
48 
49 //////////////////////////////////////////////////////////////////////////////
50 
51 /** support for getting a ViewInformation3D for a given CompoudObject3D
52 	with correct ObjectTransformation filled out
53 
54     @param o_rViewInformation3D
55     The ViewInformation3D created which will be overwritten
56 
57     @param rCandidate
58     The E3dCompoundObject for which the ViewInformation3D shall be
59 	prepared
60 
61     @return
62 	A pointer to the found and used root scene. This is also a hint
63 	if the operation succeeded or not, since when object has no root
64 	scene (is not inserted to a model), an empty ViewInformation3D
65 	will be used
66 */
67 E3dScene* fillViewInformation3DForCompoundObject(
68 	drawinglayer::geometry::ViewInformation3D& o_rViewInformation3D,
69 	const E3dCompoundObject& rCandidate);
70 
71 /** support for getting all from a 2d position hit objects in a 3d scene
72     in a depth sorted array
73 
74     @param rPoint
75     2D Point in view coordinates
76 
77     @param rScene
78     The 3D Scene for HitTest
79 
80     @param o_rResult
81     Output parameter which contains all hit 3D objects inside rScene. This
82     vector will be changed in any case. If it's empty, no hit exists. If it's
83     not empty, the first object is the object closest to the viewer
84 
85 */
86 SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack(
87     const basegfx::B2DPoint& rPoint,
88     const E3dScene& rScene,
89     ::std::vector< const E3dCompoundObject* >& o_rResult);
90 
91 /** support for checking if the single given 3d object is hit at position
92 
93     @param rPoint
94     2D Point in view coordinates
95 
96     @param rCandidate
97     The 3D Object which needs checking
98 
99 	@return
100 	true if hit, false if not
101 */
102 bool checkHitSingle3DObject(
103     const basegfx::B2DPoint& rPoint,
104 	const E3dCompoundObject& rCandidate);
105 
106 //////////////////////////////////////////////////////////////////////////////
107 
108 #endif // INCLUDED_SVX_HELPERHITTEST_HXX
109 
110 // eof
111