Salome HOME
af2a4a64bcac68a6e5eb488eabab6eff51e2f092
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_SalomeTools.hxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _HEXABLOCKGUI_SALOMETOOLS_HXX_
21 #define _HEXABLOCKGUI_SALOMETOOLS_HXX_
22
23 #include "HEXABLOCKGUI_Export.hxx"
24
25 #include <SalomeApp_Application.h>
26 #include <SALOME_Actor.h>
27 #include <SALOME_ListIO.hxx>
28 #include <SALOME_ListIteratorOfListIO.hxx>
29 #include <Handle_AIS_InteractiveObject.hxx>
30 #include <Handle_AIS_InteractiveContext.hxx>
31 #include <SelectMgr_IndexedMapOfOwner.hxx>
32 #include <SALOME_Actor.h>
33 #include <SVTK_ViewWindow.h>
34
35 #include <gp_Pnt.hxx>
36 #include <TopoDS_Shape.hxx>
37 #include <TopoDS_Vertex.hxx>
38
39 namespace HEXABLOCK
40 {
41   namespace GUI
42   {
43
44   HEXABLOCK_EXPORT SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry );
45   HEXABLOCK_EXPORT _PTR(Study) GetActiveStudyDocument();
46
47   HEXABLOCK_EXPORT int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,/* SVTK_Selector* theSelector,*/
48                                                   const Handle(SALOME_InteractiveObject)& theIO,
49                                                   QString& theName );
50
51   HEXABLOCK_EXPORT std::string shape2string( const TopoDS_Shape& aShape );
52
53   HEXABLOCK_EXPORT void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
54                                          const Handle(AIS_InteractiveContext)& theIC,
55                                          SelectMgr_IndexedMapOfOwner& theMap );
56
57   HEXABLOCK_EXPORT void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
58                                          const TopoDS_Shape& aMainShape,
59                                          const SelectMgr_IndexedMapOfOwner& anAllMap,
60                                          SelectMgr_IndexedMapOfOwner& aToHiliteMap );
61
62   HEXABLOCK_EXPORT TopoDS_Shape getSubShape(const TopoDS_Shape& theShape, const int theIndex);
63   HEXABLOCK_EXPORT int getSubId(const TopoDS_Shape& theShape, const TopoDS_Shape& theSubShape);
64
65   HEXABLOCK_EXPORT Standard_Boolean getExtremaSolution(const gp_Pnt& theInitPnt,
66                                                                           const TopoDS_Shape& theRefShape,
67                                                                           gp_Pnt& thePnt);
68
69   HEXABLOCK_EXPORT TopoDS_Vertex makePoint(const double x, const double y, const double z);
70
71   HEXABLOCK_EXPORT TopoDS_Vertex makePointWithReference(const TopoDS_Shape& point, const double dx,
72                                                            const double dy,
73                                                            const double dz);
74
75   HEXABLOCK_EXPORT TopoDS_Vertex makePointOnCurve(const TopoDS_Shape& edge, const double param);
76
77   HEXABLOCK_EXPORT TopoDS_Vertex makePointOnCurveByLength(const TopoDS_Shape& edge, const TopoDS_Shape& point, const double length);
78
79   HEXABLOCK_EXPORT TopoDS_Vertex makePointOnCurveByCoord(const TopoDS_Shape& edge, const double x, const double y, const double z);
80
81   HEXABLOCK_EXPORT TopoDS_Vertex makePointOnLinesIntersection(const TopoDS_Shape& line1, const TopoDS_Shape& line2);
82
83   HEXABLOCK_EXPORT TopoDS_Vertex makePointOnSurface(const TopoDS_Shape& face, const double param_u, const double param_v);
84
85   HEXABLOCK_EXPORT TopoDS_Vertex makePointOnSurfaceByCoord(const TopoDS_Shape& face, const double x, const double y, const double z);
86
87   }
88 }
89
90 #endif