1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_SVX_HELPERHITTEST_HXX 25 #define INCLUDED_SVX_HELPERHITTEST_HXX 26 27 #include "svx/svxdllapi.h" 28 #include <sal/types.h> 29 #include <vector> 30 31 ////////////////////////////////////////////////////////////////////////////// 32 // predefines 33 34 namespace basegfx { 35 class B2DPoint; 36 } 37 38 namespace drawinglayer { namespace geometry { 39 class ViewInformation3D; 40 }} 41 42 class E3dCompoundObject; 43 class E3dScene; 44 45 ////////////////////////////////////////////////////////////////////////////// 46 47 /** support for getting a ViewInformation3D for a given CompoudObject3D 48 with correct ObjectTransformation filled out 49 50 @param o_rViewInformation3D 51 The ViewInformation3D created which will be overwritten 52 53 @param rCandidate 54 The E3dCompoundObject for which the ViewInformation3D shall be 55 prepared 56 57 @return 58 A pointer to the found and used root scene. This is also a hint 59 if the operation succeeded or not, since when object has no root 60 scene (is not inserted to a model), an empty ViewInformation3D 61 will be used 62 */ 63 E3dScene* fillViewInformation3DForCompoundObject( 64 drawinglayer::geometry::ViewInformation3D& o_rViewInformation3D, 65 const E3dCompoundObject& rCandidate); 66 67 /** support for getting all from a 2d position hit objects in a 3d scene 68 in a depth sorted array 69 70 @param rPoint 71 2D Point in view coordinates 72 73 @param rScene 74 The 3D Scene for HitTest 75 76 @param o_rResult 77 Output parameter which contains all hit 3D objects inside rScene. This 78 vector will be changed in any case. If it's empty, no hit exists. If it's 79 not empty, the first object is the object closest to the viewer 80 81 */ 82 SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack( 83 const basegfx::B2DPoint& rPoint, 84 const E3dScene& rScene, 85 ::std::vector< const E3dCompoundObject* >& o_rResult); 86 87 /** support for checking if the single given 3d object is hit at position 88 89 @param rPoint 90 2D Point in view coordinates 91 92 @param rCandidate 93 The 3D Object which needs checking 94 95 @return 96 true if hit, false if not 97 */ 98 bool checkHitSingle3DObject( 99 const basegfx::B2DPoint& rPoint, 100 const E3dCompoundObject& rCandidate); 101 102 ////////////////////////////////////////////////////////////////////////////// 103 104 #endif // INCLUDED_SVX_HELPERHITTEST_HXX 105 106 // eof 107