geom/src/GEOMBase/GEOMBase.h

124 lines
5.2 KiB
C
Raw Normal View History

2010-05-14 21:15:28 +06:00
// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
2004-01-07 20:46:21 +05:00
//
2009-02-13 17:16:39 +05:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2004-01-07 20:46:21 +05:00
//
2009-02-13 17:16:39 +05:00
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
2004-01-07 20:46:21 +05:00
//
2009-02-13 17:16:39 +05:00
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
2010-05-14 21:15:28 +06:00
2009-02-13 17:16:39 +05:00
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase.h
// Author : Damien COQUERET, Open CASCADE S.A.S.
2004-01-07 20:46:21 +05:00
//
#ifndef GEOMBASE_H
#define GEOMBASE_H
#include "GEOM_GEOMBase.hxx"
2004-01-07 20:46:21 +05:00
// SALOME Includes
2009-02-13 17:16:39 +05:00
#include <GEOM_AISShape.hxx>
2004-01-07 20:46:21 +05:00
// IDL Headers
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
2004-12-01 15:39:14 +05:00
#include CORBA_SERVER_HEADER(GEOM_Gen)
// QT Includes
2009-02-13 17:16:39 +05:00
#include <QString>
2004-12-01 15:39:14 +05:00
class GEOM_Actor;
class SALOME_ListIO;
class QWidget;
2004-01-07 20:46:21 +05:00
//=================================================================================
// class : GEOMBase
// purpose :
//=================================================================================
class GEOMBASE_EXPORT GEOMBase
2004-01-07 20:46:21 +05:00
{
public :
/* Selection and objects management */
2004-12-01 15:39:14 +05:00
static int GetIndex(const TopoDS_Shape& subshape, const TopoDS_Shape& shape, int ShapeType);
static TopoDS_Shape GetShapeFromIOR(QString IOR);
static bool GetShape(const GEOM::GEOM_Object_ptr&, TopoDS_Shape&,
2009-12-25 16:28:58 +05:00
const TopAbs_ShapeEnum = TopAbs_SHAPE);
static bool GetTopoFromSelection(const SALOME_ListIO& aList, TopoDS_Shape& tds);
static int GetNameOfSelectedIObjects(const SALOME_ListIO& aList, QString& aName,
2009-12-25 16:28:58 +05:00
const bool theShapesOnly = false);
2004-12-01 15:39:14 +05:00
static bool GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString& aTypeString);
2004-01-07 20:46:21 +05:00
/* Convertions */
2004-12-01 15:39:14 +05:00
static GEOM::GEOM_Object_ptr ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO,
2009-12-25 16:28:58 +05:00
Standard_Boolean& testResult);
2004-12-01 15:39:14 +05:00
static Handle(GEOM_AISShape) ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO,
2009-12-25 16:28:58 +05:00
Standard_Boolean& testResult,
bool onlyInActiveView = false);
2004-01-07 20:46:21 +05:00
static Handle(AIS_InteractiveObject) GetAIS(const Handle(SALOME_InteractiveObject)& theIO,
2009-12-25 16:28:58 +05:00
const bool isOnlyInActiveView = false);
2004-12-01 15:39:14 +05:00
static void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList,
2009-12-25 16:28:58 +05:00
GEOM::string_array& listIOR);
2004-12-01 15:39:14 +05:00
static Handle(GEOM_AISShape) ConvertIORinGEOMAISShape(const char * IOR,
2009-12-25 16:28:58 +05:00
Standard_Boolean& testResult,
bool onlyInActiveView = false);
2004-12-01 15:39:14 +05:00
static GEOM_Actor* ConvertIORinGEOMActor(const char * IOR, Standard_Boolean& testResult,
2009-12-25 16:28:58 +05:00
bool onlyInActiveView = false);
2004-01-07 20:46:21 +05:00
2004-12-01 15:39:14 +05:00
static GEOM::GEOM_Object_ptr ConvertIOinGEOMObject(const Handle(SALOME_InteractiveObject)& IO,
2009-12-25 16:28:58 +05:00
Standard_Boolean& testResult);
2004-12-01 15:39:14 +05:00
static void ConvertListOfIOInListOfGO(const SALOME_ListIO& aList,
2009-12-25 16:28:58 +05:00
GEOM::ListOfGO& listGO,
const bool theShapesOnly = false);
2004-12-01 15:39:14 +05:00
static GEOM::GEOM_Object_ptr GetObjectFromIOR(const char* theIOR);
2010-11-25 17:31:41 +05:00
static QString GetIORFromObject(const GEOM::GEOM_Object_ptr& theObject);
2004-12-01 15:39:14 +05:00
2004-01-07 20:46:21 +05:00
/* Geometry */
2004-12-01 15:39:14 +05:00
static bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P);
2004-01-07 20:46:21 +05:00
/* Used just by Plane and Prism */
2004-12-01 15:39:14 +05:00
static bool LinearEdgeExtremities(const TopoDS_Shape& S, gp_Pnt& P1, gp_Pnt& P2);
static void GetBipointDxDyDz(gp_Pnt P1, gp_Pnt P2, double& dx, double& dy, double& dz);
2004-01-07 20:46:21 +05:00
/* Simulation management */
2004-12-01 15:39:14 +05:00
static bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone);
2004-01-07 20:46:21 +05:00
2004-12-01 15:39:14 +05:00
/* Generates default names */
static bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName,
2009-12-25 16:28:58 +05:00
const SALOME_ListIO& aList);
2004-12-01 15:39:14 +05:00
/* Shows message box with error code */
static bool DefineDlgPosition(QWidget* aDlg, int& x, int& y);
2004-01-07 20:46:21 +05:00
2004-06-16 21:24:55 +06:00
/* This method generates default names for results of geometrical operations */
static QString GetDefaultName(const QString& theOperation, const bool extractPrefix = false);
2004-12-01 15:39:14 +05:00
/* Shows message box with error code and comment */
static void ShowErrorMessage(const char* theErrorCode, const char* theComment = 0);
2004-06-16 21:24:55 +06:00
2004-12-01 15:39:14 +05:00
/* Gets name of object */
static QString GetName(GEOM::GEOM_Object_ptr);
2004-01-07 20:46:21 +05:00
static bool IsShape(GEOM::GEOM_Object_ptr theObj);
2004-01-07 20:46:21 +05:00
};
2009-02-13 17:16:39 +05:00
#endif // GEOMBASE_H