Salome HOME
Hexa6 : Mise ajour des sources
[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
24 #include <SalomeApp_Application.h>
25 #include <SALOME_Actor.h>
26 #include <SALOME_ListIO.hxx>
27 #include <SALOME_ListIteratorOfListIO.hxx>
28 #include <Handle_AIS_InteractiveObject.hxx>
29 #include <Handle_AIS_InteractiveContext.hxx>
30 #include <SelectMgr_IndexedMapOfOwner.hxx>
31 #include <SALOME_Actor.h>
32 #include <SVTK_ViewWindow.h>
33
34 #include <gp_Pnt.hxx>
35 #include <TopoDS_Shape.hxx>
36 #include <TopoDS_Vertex.hxx>
37
38 namespace HEXABLOCK
39 {
40   namespace GUI
41   {
42
43   SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry );
44   _PTR(Study)   GetActiveStudyDocument();
45
46   CORBA::Object_var corbaObj( _PTR(SObject) theSO );
47
48   CORBA::Object_var corbaObj( const Handle(SALOME_InteractiveObject)& theIO );
49
50   int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,/* SVTK_Selector* theSelector,*/
51                                  const Handle(SALOME_InteractiveObject)& theIO,
52                                  QString& theName );
53
54   std::string shape2string( const TopoDS_Shape& aShape );
55
56   void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
57                                const Handle(AIS_InteractiveContext)& theIC,
58                                SelectMgr_IndexedMapOfOwner& theMap );
59
60   void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
61                                const TopoDS_Shape& aMainShape,
62                                const SelectMgr_IndexedMapOfOwner& anAllMap,
63                                SelectMgr_IndexedMapOfOwner& aToHiliteMap );
64
65   TopoDS_Shape getSubShape(const TopoDS_Shape& theShape, const int theIndex);
66   int getSubId(const TopoDS_Shape& theShape, const TopoDS_Shape& theSubShape);
67
68   Standard_Boolean getExtremaSolution(const gp_Pnt& theInitPnt,
69                                                                           const TopoDS_Shape& theRefShape,
70                                                                           gp_Pnt& thePnt);
71
72   TopoDS_Vertex makePoint(const double x, const double y, const double z);
73
74   TopoDS_Vertex makePointWithReference(const TopoDS_Shape& point, const double dx,
75                                                            const double dy,
76                                                            const double dz);
77
78   TopoDS_Vertex makePointOnCurve(const TopoDS_Shape& edge, const double param);
79
80   TopoDS_Vertex makePointOnCurveByLength(const TopoDS_Shape& edge, const TopoDS_Shape& point, const double length);
81
82   TopoDS_Vertex makePointOnCurveByCoord(const TopoDS_Shape& edge, const double x, const double y, const double z);
83
84   TopoDS_Vertex makePointOnLinesIntersection(const TopoDS_Shape& line1, const TopoDS_Shape& line2);
85
86   TopoDS_Vertex makePointOnSurface(const TopoDS_Shape& face, const double param_u, const double param_v);
87
88   TopoDS_Vertex makePointOnSurfaceByCoord(const TopoDS_Shape& face, const double x, const double y, const double z);
89
90   }
91 }
92
93 #endif