mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-16 10:10:36 +05:00
Porting to Qt4.
This commit is contained in:
parent
310d065b3f
commit
8b645f521e
@ -33,14 +33,7 @@
|
|||||||
#include "GEOM_Client.hxx"
|
#include "GEOM_Client.hxx"
|
||||||
|
|
||||||
//// SALOME Includes
|
//// SALOME Includes
|
||||||
#include "Utils_ORB_INIT.hxx"
|
|
||||||
#include "Utils_SINGLETON.hxx"
|
|
||||||
|
|
||||||
#include "SALOME_LifeCycleCORBA.hxx"
|
|
||||||
|
|
||||||
#include "GEOM_AssemblyBuilder.h"
|
|
||||||
#include "GEOM_Actor.h"
|
#include "GEOM_Actor.h"
|
||||||
#include "SVTK_RenderWindowInteractor.h"
|
|
||||||
#include "SVTK_ViewModel.h"
|
#include "SVTK_ViewModel.h"
|
||||||
#include "SVTK_ViewWindow.h"
|
#include "SVTK_ViewWindow.h"
|
||||||
#include "OCCViewer_ViewPort3d.h"
|
#include "OCCViewer_ViewPort3d.h"
|
||||||
@ -49,9 +42,10 @@
|
|||||||
|
|
||||||
#include "SALOME_ListIO.hxx"
|
#include "SALOME_ListIO.hxx"
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
#include "SALOME_ListIteratorOfListIO.hxx"
|
||||||
#include "GEOM_AISTrihedron.hxx"
|
|
||||||
|
|
||||||
|
#include "SUIT_Desktop.h"
|
||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
|
#include "SUIT_ViewManager.h"
|
||||||
#include "SUIT_ViewWindow.h"
|
#include "SUIT_ViewWindow.h"
|
||||||
#include "SUIT_MessageBox.h"
|
#include "SUIT_MessageBox.h"
|
||||||
#include "SalomeApp_Application.h"
|
#include "SalomeApp_Application.h"
|
||||||
@ -63,33 +57,21 @@
|
|||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
#include <BRepPrimAPI_MakeCone.hxx>
|
#include <BRepPrimAPI_MakeCone.hxx>
|
||||||
|
|
||||||
#include <Geom_Circle.hxx>
|
|
||||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||||
#include <AIS_ListOfInteractive.hxx>
|
#include <AIS_ListOfInteractive.hxx>
|
||||||
|
|
||||||
#include <TopAbs.hxx>
|
#include <TopAbs.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
|
||||||
#include <TopoDS_Iterator.hxx>
|
|
||||||
#include <TopoDS_Compound.hxx>
|
|
||||||
#include <TopTools_MapOfShape.hxx>
|
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
#include <vtkRenderer.h>
|
#include <vtkRenderer.h>
|
||||||
#include <qvaluelist.h>
|
|
||||||
#include <qstringlist.h>
|
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "SALOMEDSClient.hxx"
|
|
||||||
|
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
// function : GetShapeFromIOR()
|
// function : GetShapeFromIOR()
|
||||||
@ -98,10 +80,10 @@ using namespace std;
|
|||||||
TopoDS_Shape GEOMBase::GetShapeFromIOR(QString IOR)
|
TopoDS_Shape GEOMBase::GetShapeFromIOR(QString IOR)
|
||||||
{
|
{
|
||||||
TopoDS_Shape result;
|
TopoDS_Shape result;
|
||||||
if(IOR.stripWhiteSpace().isEmpty())
|
if(IOR.trimmed().isEmpty())
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
CORBA::Object_var obj = SalomeApp_Application::orb()->string_to_object((char*)(IOR.latin1()));
|
CORBA::Object_var obj = SalomeApp_Application::orb()->string_to_object(IOR.toLatin1().data());
|
||||||
if(CORBA::is_nil(obj))
|
if(CORBA::is_nil(obj))
|
||||||
return result;
|
return result;
|
||||||
GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( obj );
|
GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( obj );
|
||||||
@ -227,55 +209,55 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
|
|||||||
{
|
{
|
||||||
case TopAbs_COMPOUND:
|
case TopAbs_COMPOUND:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_COMPOUND"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_COMPOUND").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case TopAbs_COMPSOLID:
|
case TopAbs_COMPSOLID:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_COMPOUNDSOLID")) ;
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_COMPOUNDSOLID").toStdString().c_str()) ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
case TopAbs_SOLID:
|
case TopAbs_SOLID:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SOLID")) ;
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SOLID").toStdString().c_str()) ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
case TopAbs_SHELL:
|
case TopAbs_SHELL:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SHELL")) ;
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SHELL").toStdString().c_str()) ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
case TopAbs_FACE:
|
case TopAbs_FACE:
|
||||||
{
|
{
|
||||||
BRepAdaptor_Surface surf(TopoDS::Face(aShape));
|
BRepAdaptor_Surface surf(TopoDS::Face(aShape));
|
||||||
if(surf.GetType() == GeomAbs_Plane) {
|
if(surf.GetType() == GeomAbs_Plane) {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_PLANE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_PLANE").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if(surf.GetType() == GeomAbs_Cylinder) {
|
else if(surf.GetType() == GeomAbs_Cylinder) {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFCYLINDER"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFCYLINDER").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if(surf.GetType() == GeomAbs_Sphere) {
|
else if(surf.GetType() == GeomAbs_Sphere) {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFSPHERE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFSPHERE").toStdString().c_str());
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
else if(surf.GetType() == GeomAbs_Torus) {
|
else if(surf.GetType() == GeomAbs_Torus) {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFTORUS"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFTORUS").toStdString().c_str());
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
else if(surf.GetType() == GeomAbs_Cone) {
|
else if(surf.GetType() == GeomAbs_Cone) {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFCONE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SURFCONE").toStdString().c_str());
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_FACE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_FACE").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case TopAbs_WIRE:
|
case TopAbs_WIRE:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_WIRE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_WIRE").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case TopAbs_EDGE:
|
case TopAbs_EDGE:
|
||||||
@ -283,31 +265,31 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
|
|||||||
BRepAdaptor_Curve curv(TopoDS::Edge(aShape));
|
BRepAdaptor_Curve curv(TopoDS::Edge(aShape));
|
||||||
if(curv.GetType() == GeomAbs_Line) {
|
if(curv.GetType() == GeomAbs_Line) {
|
||||||
if((Abs(curv.FirstParameter()) >= 1E6) || (Abs(curv.LastParameter()) >= 1E6))
|
if((Abs(curv.FirstParameter()) >= 1E6) || (Abs(curv.LastParameter()) >= 1E6))
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_LINE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_LINE").toStdString().c_str());
|
||||||
else
|
else
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_EDGE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_EDGE").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if(curv.GetType() == GeomAbs_Circle) {
|
else if(curv.GetType() == GeomAbs_Circle) {
|
||||||
if(curv.IsClosed())
|
if(curv.IsClosed())
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_CIRCLE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_CIRCLE").toStdString().c_str());
|
||||||
else
|
else
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_ARC"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_ARC").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_EDGE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_EDGE").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case TopAbs_VERTEX:
|
case TopAbs_VERTEX:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_VERTEX"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_VERTEX").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case TopAbs_SHAPE:
|
case TopAbs_SHAPE:
|
||||||
{
|
{
|
||||||
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SHAPE"));
|
aTypeString = CORBA::string_dup(QObject::tr("GEOM_SHAPE").toStdString().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -332,11 +314,13 @@ Handle(GEOM_AISShape) GEOMBase::ConvertIORinGEOMAISShape(const char * IOR, Stand
|
|||||||
if ( !anObj )
|
if ( !anObj )
|
||||||
return resultShape;
|
return resultShape;
|
||||||
|
|
||||||
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
||||||
|
|
||||||
for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it ) {
|
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
|
||||||
if (it.current()->getViewManager()->getType() == OCCViewer_Viewer::Type()) {
|
while ( it.hasNext() ) {
|
||||||
Handle (AIS_InteractiveContext) ic = ((OCCViewer_Viewer*)it.current()->getViewManager()->getViewModel())->getAISContext();
|
SUIT_ViewWindow* aVW = it.next();
|
||||||
|
if (aVW && aVW->getViewManager()->getType() == OCCViewer_Viewer::Type()) {
|
||||||
|
Handle (AIS_InteractiveContext) ic = ((OCCViewer_Viewer*)aVW->getViewManager()->getViewModel())->getAISContext();
|
||||||
|
|
||||||
AIS_ListOfInteractive List;
|
AIS_ListOfInteractive List;
|
||||||
ic->DisplayedObjects(List);
|
ic->DisplayedObjects(List);
|
||||||
@ -352,7 +336,7 @@ Handle(GEOM_AISShape) GEOMBase::ConvertIORinGEOMAISShape(const char * IOR, Stand
|
|||||||
Handle(SALOME_InteractiveObject) GIO = Handle(SALOME_InteractiveObject)::DownCast(aSh->getIO());
|
Handle(SALOME_InteractiveObject) GIO = Handle(SALOME_InteractiveObject)::DownCast(aSh->getIO());
|
||||||
if(GIO->hasEntry() && strcmp(GIO->getEntry(), anObj->GetID().c_str()) == 0) {
|
if(GIO->hasEntry() && strcmp(GIO->getEntry(), anObj->GetID().c_str()) == 0) {
|
||||||
if(!onlyInActiveView ||
|
if(!onlyInActiveView ||
|
||||||
it.current() == SUIT_Session::session()->activeApplication()->desktop()->activeWindow()) {
|
aVW == SUIT_Session::session()->activeApplication()->desktop()->activeWindow()) {
|
||||||
testResult = true;
|
testResult = true;
|
||||||
resultShape = aSh;
|
resultShape = aSh;
|
||||||
return resultShape;
|
return resultShape;
|
||||||
@ -384,11 +368,13 @@ GEOM_Actor* GEOMBase::ConvertIORinGEOMActor(const char* IOR, Standard_Boolean& t
|
|||||||
if ( !anObj )
|
if ( !anObj )
|
||||||
return GEOM_Actor::New();
|
return GEOM_Actor::New();
|
||||||
|
|
||||||
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
||||||
|
|
||||||
for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it ) {
|
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
|
||||||
if (it.current()->getViewManager()->getType() == SVTK_Viewer::Type()) {
|
while ( it.hasNext() ) {
|
||||||
SVTK_ViewWindow* aVTKViewWindow = dynamic_cast<SVTK_ViewWindow*>( it.current() );
|
SUIT_ViewWindow* aVW = it.next();
|
||||||
|
if (aVW && aVW->getViewManager()->getType() == SVTK_Viewer::Type()) {
|
||||||
|
SVTK_ViewWindow* aVTKViewWindow = dynamic_cast<SVTK_ViewWindow*>( aVW );
|
||||||
if( !aVTKViewWindow )
|
if( !aVTKViewWindow )
|
||||||
continue;
|
continue;
|
||||||
vtkRenderer* Renderer = aVTKViewWindow->getRenderer();
|
vtkRenderer* Renderer = aVTKViewWindow->getRenderer();
|
||||||
@ -402,7 +388,7 @@ GEOM_Actor* GEOMBase::ConvertIORinGEOMActor(const char* IOR, Standard_Boolean& t
|
|||||||
Handle(SALOME_InteractiveObject) GIO = Handle(SALOME_InteractiveObject)::DownCast(anActor->getIO());
|
Handle(SALOME_InteractiveObject) GIO = Handle(SALOME_InteractiveObject)::DownCast(anActor->getIO());
|
||||||
if(GIO->hasEntry() && strcmp(GIO->getEntry(), anObj->GetID().c_str()) == 0) {
|
if(GIO->hasEntry() && strcmp(GIO->getEntry(), anObj->GetID().c_str()) == 0) {
|
||||||
if(!onlyInActiveView ||
|
if(!onlyInActiveView ||
|
||||||
it.current() == SUIT_Session::session()->activeApplication()->desktop()->activeWindow()) {
|
aVW == SUIT_Session::session()->activeApplication()->desktop()->activeWindow()) {
|
||||||
testResult = true;
|
testResult = true;
|
||||||
return anActor;
|
return anActor;
|
||||||
}
|
}
|
||||||
@ -427,12 +413,14 @@ Handle(AIS_InteractiveObject) GEOMBase::GetAIS( const Handle(SALOME_InteractiveO
|
|||||||
if ( theIO.IsNull() || !theIO->hasEntry() )
|
if ( theIO.IsNull() || !theIO->hasEntry() )
|
||||||
return Handle(AIS_InteractiveObject)();
|
return Handle(AIS_InteractiveObject)();
|
||||||
|
|
||||||
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
||||||
|
|
||||||
for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it ) {
|
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
|
||||||
if (it.current()->getViewManager()->getType() != OCCViewer_Viewer::Type())
|
while ( it.hasNext() ) {
|
||||||
|
SUIT_ViewWindow* aVW = it.next();
|
||||||
|
if (!aVW || aVW->getViewManager()->getType() != OCCViewer_Viewer::Type())
|
||||||
continue;
|
continue;
|
||||||
Handle (AIS_InteractiveContext) anIC = ((OCCViewer_Viewer*)it.current()->getViewManager()->getViewModel())->getAISContext();
|
Handle (AIS_InteractiveContext) anIC = ((OCCViewer_Viewer*)aVW->getViewManager()->getViewModel())->getAISContext();
|
||||||
|
|
||||||
AIS_ListOfInteractive aList;
|
AIS_ListOfInteractive aList;
|
||||||
anIC->DisplayedObjects( aList );
|
anIC->DisplayedObjects( aList );
|
||||||
@ -448,7 +436,7 @@ Handle(AIS_InteractiveObject) GEOMBase::GetAIS( const Handle(SALOME_InteractiveO
|
|||||||
{
|
{
|
||||||
if( isOnlyInActiveView )
|
if( isOnlyInActiveView )
|
||||||
{
|
{
|
||||||
if ( it.current() == SUIT_Session::session()->activeApplication()->desktop()->activeWindow() )
|
if ( aVW == SUIT_Session::session()->activeApplication()->desktop()->activeWindow() )
|
||||||
return anIter.Value();
|
return anIter.Value();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -475,11 +463,13 @@ Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_Inte
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
||||||
|
|
||||||
for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it ) {
|
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
|
||||||
if (it.current()->getViewManager()->getType() == OCCViewer_Viewer::Type()) {
|
while ( it.hasNext() ) {
|
||||||
Handle (AIS_InteractiveContext) ic = ((OCCViewer_Viewer*)it.current()->getViewManager()->getViewModel())->getAISContext();
|
SUIT_ViewWindow* aVW = it.next();
|
||||||
|
if (aVW && aVW->getViewManager()->getType() == OCCViewer_Viewer::Type()) {
|
||||||
|
Handle (AIS_InteractiveContext) ic = ((OCCViewer_Viewer*)aVW->getViewManager()->getViewModel())->getAISContext();
|
||||||
|
|
||||||
AIS_ListOfInteractive List;
|
AIS_ListOfInteractive List;
|
||||||
ic->DisplayedObjects(List);
|
ic->DisplayedObjects(List);
|
||||||
@ -499,7 +489,7 @@ Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_Inte
|
|||||||
{
|
{
|
||||||
if(onlyInActiveView)
|
if(onlyInActiveView)
|
||||||
{
|
{
|
||||||
if(it.current() == SUIT_Session::session()->activeApplication()->desktop()->activeWindow())
|
if(aVW == SUIT_Session::session()->activeApplication()->desktop()->activeWindow())
|
||||||
{
|
{
|
||||||
testResult = true;
|
testResult = true;
|
||||||
return aSh;
|
return aSh;
|
||||||
@ -795,13 +785,13 @@ bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectU
|
|||||||
_PTR(Study) ST = appStudy->studyDS();
|
_PTR(Study) ST = appStudy->studyDS();
|
||||||
|
|
||||||
std::vector<_PTR(SObject)> listSO;
|
std::vector<_PTR(SObject)> listSO;
|
||||||
listSO = ST->FindObjectByName(objectUserName.latin1(), "GEOM");
|
listSO = ST->FindObjectByName(objectUserName.toStdString(), "GEOM");
|
||||||
|
|
||||||
if(listSO.size() < 1) {
|
if(listSO.size() < 1) {
|
||||||
const QString caption = QObject::tr("GEOM_WRN_WARNING");
|
const QString caption = QObject::tr("GEOM_WRN_WARNING");
|
||||||
const QString text = QObject::tr("GEOM_NAME_INCORRECT");
|
const QString text = QObject::tr("GEOM_NAME_INCORRECT");
|
||||||
const QString button0 = QObject::tr("GEOM_BUT_OK");
|
const QString button0 = QObject::tr("GEOM_BUT_OK");
|
||||||
SUIT_MessageBox::error1(aWidget, caption, text, button0);
|
SUIT_MessageBox::critical(aWidget, caption, text, button0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* More than one object with same name */
|
/* More than one object with same name */
|
||||||
@ -809,14 +799,14 @@ bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectU
|
|||||||
const QString caption = QObject::tr("GEOM_WRN_WARNING");
|
const QString caption = QObject::tr("GEOM_WRN_WARNING");
|
||||||
const QString text = QObject::tr("GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE");
|
const QString text = QObject::tr("GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE");
|
||||||
const QString button0 = QObject::tr("GEOM_BUT_OK") ;
|
const QString button0 = QObject::tr("GEOM_BUT_OK") ;
|
||||||
SUIT_MessageBox::error1(aWidget, caption, text, button0) ;
|
SUIT_MessageBox::critical(aWidget, caption, text, button0) ;
|
||||||
listSO.clear();
|
listSO.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_PTR(SObject) theObj ( listSO[0] );
|
_PTR(SObject) theObj ( listSO[0] );
|
||||||
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
|
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
|
||||||
char* aCopyobjectUserName = CORBA::string_dup(objectUserName);
|
char* aCopyobjectUserName = CORBA::string_dup(objectUserName.toStdString().c_str());
|
||||||
Handle(SALOME_InteractiveObject) SI = new SALOME_InteractiveObject(theObj->GetID().c_str(), "GEOM", aCopyobjectUserName);
|
Handle(SALOME_InteractiveObject) SI = new SALOME_InteractiveObject(theObj->GetID().c_str(), "GEOM", aCopyobjectUserName);
|
||||||
delete(aCopyobjectUserName);
|
delete(aCopyobjectUserName);
|
||||||
|
|
||||||
@ -873,7 +863,7 @@ QString GEOMBase::GetDefaultName(const QString& theOperation)
|
|||||||
bool isUnique = false;
|
bool isUnique = false;
|
||||||
while (!isUnique) {
|
while (!isUnique) {
|
||||||
aName = theOperation + "_" + QString::number(++aNumber);
|
aName = theOperation + "_" + QString::number(++aNumber);
|
||||||
isUnique = (aSet.count(aName.latin1()) == 0);
|
isUnique = (aSet.count(aName.toStdString()) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return aName;
|
return aName;
|
||||||
@ -891,12 +881,12 @@ void GEOMBase::ShowErrorMessage(const char* theErrorCode, const char* theComment
|
|||||||
|
|
||||||
QString aText = "";
|
QString aText = "";
|
||||||
if (!anErrorCode.isEmpty())
|
if (!anErrorCode.isEmpty())
|
||||||
aText.append("\n" + QObject::tr(anErrorCode));
|
aText.append("\n" + QObject::tr(anErrorCode.toStdString().c_str()));
|
||||||
if (!aComment.isEmpty())
|
if (!aComment.isEmpty())
|
||||||
aText.append("\n" + QString(theComment));
|
aText.append("\n" + QString(theComment));
|
||||||
|
|
||||||
SUIT_MessageBox::error1( SUIT_Session::session()->activeApplication()->desktop(), QObject::tr( "GEOM_ERROR" ),
|
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), QObject::tr( "GEOM_ERROR" ),
|
||||||
QObject::tr("GEOM_PRP_ABORT") + aText, "OK" );
|
QObject::tr("GEOM_PRP_ABORT") + aText, "OK" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,11 +40,10 @@
|
|||||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||||
|
|
||||||
// QT Includes
|
// QT Includes
|
||||||
#include <qstring.h>
|
#include <QString>
|
||||||
|
|
||||||
class GEOM_Actor;
|
class GEOM_Actor;
|
||||||
class SALOME_ListIO;
|
class SALOME_ListIO;
|
||||||
class TColStd_MapOfInteger;
|
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
|
55
src/GEOMBase/GEOMBase.pro
Normal file
55
src/GEOMBase/GEOMBase.pro
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
TEMPLATE = lib
|
||||||
|
TARGET = GEOMBase
|
||||||
|
DESTDIR = ../../lib
|
||||||
|
MOC_DIR = ../../moc
|
||||||
|
OBJECTS_DIR = ../../obj/$$TARGET
|
||||||
|
|
||||||
|
QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
|
||||||
|
|
||||||
|
VTK_INCLUDES = $$(VTKHOME)/include/vtk
|
||||||
|
|
||||||
|
CASROOT = $$(CASROOT)
|
||||||
|
CAS_CPPFLAGS = $${CASROOT}/inc
|
||||||
|
|
||||||
|
PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
|
||||||
|
|
||||||
|
BOOST_CPPFLAGS = $$(BOOSTDIR)/include
|
||||||
|
|
||||||
|
KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
|
||||||
|
|
||||||
|
GUI_CXXFLAGS = $$(GUI_ROOT_DIR)/include/salome
|
||||||
|
|
||||||
|
CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
|
||||||
|
|
||||||
|
KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
|
||||||
|
|
||||||
|
GUI_LDFLAGS = -L$$(GUI_ROOT_DIR)/lib/salome
|
||||||
|
|
||||||
|
CAS_LDPATH = -L$${CASROOT}/Linux/lib
|
||||||
|
|
||||||
|
INCLUDEPATH += $${QT_INCLUDES} $${VTK_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${GUI_CXXFLAGS} $${CORBA_INCLUDES} ../OBJECT ../GEOMClient ../GEOMImpl ../GEOMGUI ../DlgRef $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix
|
||||||
|
|
||||||
|
LIBS += -L$$(GEOM_ROOT_DIR)/idl -lSalomeIDLGEOM -L$$(GEOM_ROOT_DIR)/lib -lGEOM -lDlgRef $${KERNEL_LDFLAGS} -lOpUtil $${GUI_LDFLAGS} -lsuit -lOCCViewer -lVTKViewer -lSVTK -lSalomePrs -lSalomeApp -lCAM $${CAS_LDPATH} -lTKPrim
|
||||||
|
|
||||||
|
CONFIG -= debug release debug_and_release
|
||||||
|
CONFIG += qt thread debug dll shared
|
||||||
|
|
||||||
|
win32:DEFINES += WIN32
|
||||||
|
DEFINES += GEOMBASE_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
|
||||||
|
|
||||||
|
HEADERS = GEOMBase.h
|
||||||
|
HEADERS += GEOMBase_Skeleton.h
|
||||||
|
HEADERS += GEOMBase_Helper.h
|
||||||
|
HEADERS += GEOM_Operation.h
|
||||||
|
HEADERS += GEOM_GEOMBase.hxx
|
||||||
|
|
||||||
|
SOURCES = GEOMBase.cxx
|
||||||
|
SOURCES += GEOMBase_Skeleton.cxx
|
||||||
|
SOURCES += GEOMBase_aParameterDlg.cxx
|
||||||
|
SOURCES += GEOMBase_Helper.cxx
|
||||||
|
SOURCES += GEOM_Operation.cxx
|
||||||
|
|
||||||
|
includes.files = $$HEADERS
|
||||||
|
includes.path = ../../include
|
||||||
|
|
||||||
|
INSTALLS += includes
|
@ -32,10 +32,10 @@
|
|||||||
#include "GEOMBase.h"
|
#include "GEOMBase.h"
|
||||||
#include "GEOM_Operation.h"
|
#include "GEOM_Operation.h"
|
||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
#include "GEOM_Displayer.h"
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
|
||||||
|
|
||||||
|
#include <SUIT_Desktop.h>
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
|
#include <SUIT_ViewManager.h>
|
||||||
#include <SUIT_ViewWindow.h>
|
#include <SUIT_ViewWindow.h>
|
||||||
#include <SUIT_MessageBox.h>
|
#include <SUIT_MessageBox.h>
|
||||||
#include <SUIT_OverrideCursor.h>
|
#include <SUIT_OverrideCursor.h>
|
||||||
@ -46,21 +46,17 @@
|
|||||||
#include <LightApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <LightApp_DataOwner.h>
|
#include <LightApp_DataOwner.h>
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
#include <SalomeApp_DataModel.h>
|
|
||||||
|
#include "SALOME_Prs.h"
|
||||||
|
|
||||||
#include <OCCViewer_ViewModel.h>
|
#include <OCCViewer_ViewModel.h>
|
||||||
#include <SVTK_ViewModel.h>
|
#include <SVTK_ViewModel.h>
|
||||||
|
|
||||||
#include <OB_Browser.h>
|
|
||||||
|
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <SALOMEDSClient.hxx>
|
|
||||||
|
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Function : getActiveView
|
// Function : getActiveView
|
||||||
// Purpose : Get active view window, returns 0 if no open study frame
|
// Purpose : Get active view window, returns 0 if no open study frame
|
||||||
@ -173,7 +169,7 @@ void GEOMBase_Helper::erase( GEOM::GEOM_Object_ptr object, const bool updateView
|
|||||||
if ( !object->_is_nil() ) {
|
if ( !object->_is_nil() ) {
|
||||||
string entry = getEntry( object );
|
string entry = getEntry( object );
|
||||||
getDisplayer()->Erase( new SALOME_InteractiveObject(
|
getDisplayer()->Erase( new SALOME_InteractiveObject(
|
||||||
entry.c_str(), "GEOM", strdup( GEOMBase::GetName( object ) ) ), true, updateView );
|
entry.c_str(), "GEOM", strdup( GEOMBase::GetName( object ).toStdString().c_str() ) ), true, updateView );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +208,7 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
|
|||||||
|
|
||||||
string entry = getEntry( object );
|
string entry = getEntry( object );
|
||||||
getDisplayer()->Redisplay(new SALOME_InteractiveObject
|
getDisplayer()->Redisplay(new SALOME_InteractiveObject
|
||||||
(entry.c_str(), "GEOM", strdup(GEOMBase::GetName(object))), false);
|
(entry.c_str(), "GEOM", strdup(GEOMBase::GetName(object).toStdString().c_str())), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( withChildren ) {
|
if ( withChildren ) {
|
||||||
@ -230,7 +226,7 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
|
|||||||
if ( !aChild->_is_nil() ) {
|
if ( !aChild->_is_nil() ) {
|
||||||
string entry = getEntry( aChild );
|
string entry = getEntry( aChild );
|
||||||
getDisplayer()->Redisplay( new SALOME_InteractiveObject(
|
getDisplayer()->Redisplay( new SALOME_InteractiveObject(
|
||||||
entry.c_str(), "GEOM", strdup( GEOMBase::GetName( aChild ) ) ), false );
|
entry.c_str(), "GEOM", strdup( GEOMBase::GetName( aChild ).toStdString().c_str() ) ), false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -452,7 +448,7 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo
|
|||||||
string aEntry = getEntry( anObj );
|
string aEntry = getEntry( anObj );
|
||||||
if ( aEntry != "" )
|
if ( aEntry != "" )
|
||||||
aListOfIO.Append( new SALOME_InteractiveObject(
|
aListOfIO.Append( new SALOME_InteractiveObject(
|
||||||
aEntry.c_str(), "GEOM", strdup( GEOMBase::GetName( anObj ) ) ) );
|
aEntry.c_str(), "GEOM", strdup( GEOMBase::GetName( anObj ).toStdString().c_str() ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
getDisplayer()->LocalSelection( aListOfIO, theMode );
|
getDisplayer()->LocalSelection( aListOfIO, theMode );
|
||||||
@ -565,13 +561,14 @@ SalomeApp_Study* GEOMBase_Helper::getStudy() const
|
|||||||
if (!aDesktop)
|
if (!aDesktop)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
QPtrList<SUIT_Application> anAppList = SUIT_Session::session()->applications();
|
QList<SUIT_Application*> anAppList = SUIT_Session::session()->applications();
|
||||||
|
|
||||||
SUIT_Application* anApp = 0;
|
SUIT_Application* anApp = 0;
|
||||||
for ( QPtrListIterator<SUIT_Application> it( anAppList ); it.current() ; ++it )
|
QListIterator<SUIT_Application*> it( anAppList );
|
||||||
|
while ( it.hasNext() )
|
||||||
{
|
{
|
||||||
anApp = it.current();
|
anApp = it.next();
|
||||||
if ( anApp->desktop() == aDesktop )
|
if ( anApp && anApp->desktop() == aDesktop )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,10 +719,11 @@ GEOM::GEOM_IOperations_ptr GEOMBase_Helper::getOperation()
|
|||||||
bool GEOMBase_Helper::checkViewWindow()
|
bool GEOMBase_Helper::checkViewWindow()
|
||||||
{
|
{
|
||||||
if ( myViewWindow ){
|
if ( myViewWindow ){
|
||||||
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
QList<SUIT_ViewWindow*> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
|
||||||
for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it )
|
QListIterator<SUIT_ViewWindow*> it( aViewWindowsList );
|
||||||
|
while ( it.hasNext() )
|
||||||
{
|
{
|
||||||
if ( myViewWindow == it.current() )
|
if ( myViewWindow == it.next() )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -748,10 +746,10 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
|
|||||||
bool aLocked = (_PTR(AttributeStudyProperties) (aStudy->GetProperties()))->IsLocked();
|
bool aLocked = (_PTR(AttributeStudyProperties) (aStudy->GetProperties()))->IsLocked();
|
||||||
if ( aLocked ) {
|
if ( aLocked ) {
|
||||||
MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
|
MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
|
||||||
SUIT_MessageBox::warn1 ( (QWidget*)SUIT_Session::session()->activeApplication()->desktop(),
|
SUIT_MessageBox::warning ( (QWidget*)SUIT_Session::session()->activeApplication()->desktop(),
|
||||||
QObject::tr("WRN_WARNING"),
|
QObject::tr("WRN_WARNING"),
|
||||||
QObject::tr("WRN_STUDY_LOCKED"),
|
QObject::tr("WRN_STUDY_LOCKED"),
|
||||||
QObject::tr("BUT_OK") );
|
QObject::tr("BUT_OK") );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -794,7 +792,7 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
|
|||||||
if ( aName.isEmpty() )
|
if ( aName.isEmpty() )
|
||||||
aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
|
aName = GEOMBase::GetDefaultName( getPrefix( *it ) );
|
||||||
}
|
}
|
||||||
addInStudy( *it, aName.latin1() );
|
addInStudy( *it, aName.toLatin1() );
|
||||||
// updateView=false
|
// updateView=false
|
||||||
display( *it, false );
|
display( *it, false );
|
||||||
}
|
}
|
||||||
@ -841,10 +839,10 @@ void GEOMBase_Helper::showError()
|
|||||||
if ( msg.isEmpty() )
|
if ( msg.isEmpty() )
|
||||||
msg = QObject::tr( "GEOM_PRP_ABORT" );
|
msg = QObject::tr( "GEOM_PRP_ABORT" );
|
||||||
|
|
||||||
SUIT_MessageBox::error1( SUIT_Session::session()->activeApplication()->desktop(),
|
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
|
||||||
QObject::tr( "GEOM_ERROR_STATUS" ),
|
QObject::tr( "GEOM_ERROR_STATUS" ),
|
||||||
msg,
|
msg,
|
||||||
QObject::tr( "BUT_OK" ) );
|
QObject::tr( "BUT_OK" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
@ -856,7 +854,7 @@ void GEOMBase_Helper::showError( const QString& msg )
|
|||||||
QString str( QObject::tr( "GEOM_INCORRECT_INPUT" ) );
|
QString str( QObject::tr( "GEOM_INCORRECT_INPUT" ) );
|
||||||
if ( !msg.isEmpty() )
|
if ( !msg.isEmpty() )
|
||||||
str += "\n" + msg;
|
str += "\n" + msg;
|
||||||
SUIT_MessageBox::error1(SUIT_Session::session()->activeApplication()->desktop(), QObject::tr( "GEOM_ERROR" ), str, QObject::tr( "BUT_OK" ) );
|
SUIT_MessageBox::critical(SUIT_Session::session()->activeApplication()->desktop(), QObject::tr( "GEOM_ERROR" ), str, QObject::tr( "BUT_OK" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
@ -32,12 +32,11 @@
|
|||||||
#include "GEOM_GEOMBase.hxx"
|
#include "GEOM_GEOMBase.hxx"
|
||||||
|
|
||||||
#include "GEOM_Displayer.h"
|
#include "GEOM_Displayer.h"
|
||||||
#include "SALOME_Prs.h"
|
|
||||||
#include "SALOME_ListIO.hxx"
|
#include "SALOME_ListIO.hxx"
|
||||||
#include <SALOMEconfig.h>
|
#include <SALOMEconfig.h>
|
||||||
#include CORBA_CLIENT_HEADER(GEOM_Gen)
|
#include CORBA_CLIENT_HEADER(GEOM_Gen)
|
||||||
|
|
||||||
#include <qstring.h>
|
#include <QString>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@ -46,8 +45,8 @@ typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
|
|||||||
class SalomeApp_Study;
|
class SalomeApp_Study;
|
||||||
class SUIT_Desktop;
|
class SUIT_Desktop;
|
||||||
class SUIT_ViewWindow;
|
class SUIT_ViewWindow;
|
||||||
|
class SALOME_Prs;
|
||||||
class GEOM_Operation;
|
class GEOM_Operation;
|
||||||
class TopoDS_Shape;
|
|
||||||
class TColStd_MapOfInteger;
|
class TColStd_MapOfInteger;
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
|
@ -27,16 +27,19 @@
|
|||||||
// $Header$
|
// $Header$
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "GEOMBase.h"
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
|
|
||||||
#include "SalomeApp_Application.h"
|
#include "SalomeApp_Application.h"
|
||||||
#include "LightApp_Application.h"
|
#include "LightApp_Application.h"
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include "LightApp_SelectionMgr.h"
|
||||||
|
#include "SUIT_Desktop.h"
|
||||||
|
#include "SUIT_ResourceMgr.h"
|
||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
#include "SUIT_MessageBox.h"
|
#include "SUIT_MessageBox.h"
|
||||||
|
|
||||||
#include <qpushbutton.h>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -48,23 +51,43 @@ using namespace std;
|
|||||||
// TRUE to construct a modal dialog.
|
// TRUE to construct a modal dialog.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GEOMBase_Skeleton::GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent,
|
GEOMBase_Skeleton::GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, WFlags fl)
|
const char* name, bool modal, Qt::WindowFlags fl)
|
||||||
: DlgRef_Skeleton_QTD( parent, name, modal, WStyle_Customize | WStyle_NormalBorder
|
: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
|
||||||
| WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
|
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
|
||||||
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
|
myGeomGUI( theGeometryGUI ),
|
||||||
myGeomGUI( theGeometryGUI )
|
myRBGroup( 0 )
|
||||||
{
|
{
|
||||||
|
setupUi(this);
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
setName("GEOMBase_Skeleton");
|
setObjectName("GEOMBase_Skeleton");
|
||||||
|
else
|
||||||
|
setObjectName(name);
|
||||||
|
|
||||||
|
setModal( modal );
|
||||||
|
setAttribute( Qt::WA_DeleteOnClose );
|
||||||
|
|
||||||
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
|
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
|
||||||
buttonOk->setText(tr("GEOM_BUT_OK"));
|
buttonOk->setText(tr("GEOM_BUT_OK"));
|
||||||
buttonApply->setText(tr("GEOM_BUT_APPLY"));
|
buttonApply->setText(tr("GEOM_BUT_APPLY"));
|
||||||
buttonHelp->setText(tr("GEOM_BUT_HELP"));
|
buttonHelp->setText(tr("GEOM_BUT_HELP"));
|
||||||
|
|
||||||
GroupMedium->close(TRUE);
|
GroupMedium->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
|
GroupMedium->close();
|
||||||
resize(0, 0);
|
resize(0, 0);
|
||||||
|
|
||||||
|
if ( GroupConstructors != NULL ) {
|
||||||
|
myRBGroup = new QButtonGroup(GroupConstructors);
|
||||||
|
QList<QObject*> aRadioButtons = GroupConstructors->children();
|
||||||
|
QListIterator<QObject*> it( aRadioButtons );
|
||||||
|
int anId = 0;
|
||||||
|
while ( it.hasNext() )
|
||||||
|
if ( QRadioButton* aRB = ::qobject_cast<QRadioButton*>( it.next() ) ) {
|
||||||
|
myRBGroup->addButton( aRB, anId );
|
||||||
|
anId++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +227,7 @@ void GEOMBase_Skeleton::initName( const char* thePrefix )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
const char* GEOMBase_Skeleton::getNewObjectName() const
|
const char* GEOMBase_Skeleton::getNewObjectName() const
|
||||||
{
|
{
|
||||||
return ResultName->text();
|
return ResultName->text().toStdString().c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -213,8 +236,12 @@ const char* GEOMBase_Skeleton::getNewObjectName() const
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
int GEOMBase_Skeleton::getConstructorId() const
|
int GEOMBase_Skeleton::getConstructorId() const
|
||||||
{
|
{
|
||||||
if ( GroupConstructors != NULL && GroupConstructors->selected() != NULL )
|
/*if ( GroupConstructors != NULL && GroupConstructors->selected() != NULL )
|
||||||
return GroupConstructors->id( GroupConstructors->selected() );
|
return GroupConstructors->id( GroupConstructors->selected() );
|
||||||
|
return -1;*/
|
||||||
|
|
||||||
|
if ( myRBGroup != NULL )
|
||||||
|
return myRBGroup->checkedId();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,10 +261,10 @@ void GEOMBase_Skeleton::ClickOnHelp()
|
|||||||
#else
|
#else
|
||||||
platform = "application";
|
platform = "application";
|
||||||
#endif
|
#endif
|
||||||
SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
|
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
|
||||||
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
||||||
arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
|
arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
|
||||||
QObject::tr("BUT_OK"));
|
QObject::tr("BUT_OK"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -260,7 +287,7 @@ void GEOMBase_Skeleton::keyPressEvent( QKeyEvent* e )
|
|||||||
if ( e->isAccepted() )
|
if ( e->isAccepted() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( e->key() == Key_F1 )
|
if ( e->key() == Qt::Key_F1 )
|
||||||
{
|
{
|
||||||
e->accept();
|
e->accept();
|
||||||
ClickOnHelp();
|
ClickOnHelp();
|
||||||
|
@ -31,26 +31,17 @@
|
|||||||
#include "GEOM_GEOMBase.hxx"
|
#include "GEOM_GEOMBase.hxx"
|
||||||
|
|
||||||
#include "DlgRef_Skeleton_QTD.h"
|
#include "DlgRef_Skeleton_QTD.h"
|
||||||
|
|
||||||
#include "GEOMBase.h"
|
|
||||||
#include "GEOMBase_Helper.h"
|
#include "GEOMBase_Helper.h"
|
||||||
#include "GeometryGUI.h"
|
|
||||||
|
|
||||||
#include <qwidget.h>
|
class GeometryGUI;
|
||||||
#include <qgroupbox.h>
|
|
||||||
#include <qlineedit.h>
|
|
||||||
#include <qlayout.h>
|
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qradiobutton.h>
|
|
||||||
#include <qbuttongroup.h>
|
|
||||||
|
|
||||||
class GEOMBASE_EXPORT GEOMBase_Skeleton : public DlgRef_Skeleton_QTD, public GEOMBase_Helper
|
class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public Ui::DlgRef_Skeleton_QTD, public GEOMBase_Helper
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
||||||
const char* name = 0, bool modal = FALSE, WFlags fl = 0);
|
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
||||||
~GEOMBase_Skeleton();
|
~GEOMBase_Skeleton();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -78,6 +69,8 @@ protected:
|
|||||||
GeometryGUI* myGeomGUI; //!< reference GEOM GUI
|
GeometryGUI* myGeomGUI; //!< reference GEOM GUI
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
|
QButtonGroup* myRBGroup;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void ClickOnCancel();
|
virtual void ClickOnCancel();
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
|
@ -27,16 +27,12 @@
|
|||||||
// $Header$
|
// $Header$
|
||||||
|
|
||||||
#include "GEOMBase_aParameterDlg.h"
|
#include "GEOMBase_aParameterDlg.h"
|
||||||
#include "QtxDblSpinBox.h"
|
#include "QtxDoubleSpinBox.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <QGroupBox>
|
||||||
|
#include <QLabel>
|
||||||
#include <qgroupbox.h>
|
#include <QPushButton>
|
||||||
#include <qlabel.h>
|
#include <QGridLayout>
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qlayout.h>
|
|
||||||
#include <qvariant.h>
|
|
||||||
#include <qvalidator.h>
|
|
||||||
|
|
||||||
#ifndef WNT
|
#ifndef WNT
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -60,53 +56,56 @@ using namespace std;
|
|||||||
// TRUE to construct a modal dialog.
|
// TRUE to construct a modal dialog.
|
||||||
//
|
//
|
||||||
//======================================================================================
|
//======================================================================================
|
||||||
GEOMBase_aParameterDlg::GEOMBase_aParameterDlg(const char *aValue1, const char *aTitle1, QWidget* parent, const char* name, bool modal, WFlags fl, const double bottom, const double top, const int decimals)
|
GEOMBase_aParameterDlg::GEOMBase_aParameterDlg(const char *aValue1, const char *aTitle1, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl, const double bottom, const double top, const int decimals)
|
||||||
:QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
|
||||||
{
|
{
|
||||||
if(!name)
|
if(!name)
|
||||||
setName( "MyParameterDialog" );
|
setObjectName( "MyParameterDialog" );
|
||||||
|
else
|
||||||
|
setObjectName( name );
|
||||||
|
|
||||||
|
setModal( modal );
|
||||||
|
|
||||||
resize(288, 81);
|
resize(288, 81);
|
||||||
setCaption(name); /* appears on the title bar */
|
setWindowTitle(name); /* appears on the title bar */
|
||||||
setSizeGripEnabled(TRUE);
|
setSizeGripEnabled(TRUE);
|
||||||
|
|
||||||
QGridLayout* topLayout = new QGridLayout(this);
|
QGridLayout* topLayout = new QGridLayout(this);
|
||||||
topLayout->setSpacing(6);
|
topLayout->setSpacing(6);
|
||||||
topLayout->setMargin(11);
|
topLayout->setMargin(11);
|
||||||
|
|
||||||
QGroupBox* mainGrp = new QGroupBox(this, "mainGrp");
|
QGroupBox* mainGrp = new QGroupBox(this);
|
||||||
mainGrp->setColumnLayout(0, Qt::Vertical);
|
mainGrp->setObjectName("mainGrp");
|
||||||
mainGrp->layout()->setSpacing(0);
|
QGridLayout* mainGrpLayout = new QGridLayout(mainGrp);
|
||||||
mainGrp->layout()->setMargin(0);
|
|
||||||
QGridLayout* mainGrpLayout = new QGridLayout(mainGrp->layout());
|
|
||||||
mainGrpLayout->setAlignment(Qt::AlignTop);
|
mainGrpLayout->setAlignment(Qt::AlignTop);
|
||||||
mainGrpLayout ->setSpacing(6);
|
mainGrpLayout->setSpacing(6);
|
||||||
mainGrpLayout->setMargin(11);
|
mainGrpLayout->setMargin(11);
|
||||||
topLayout->addWidget(mainGrp, 0, 0);
|
topLayout->addWidget(mainGrp, 0, 0);
|
||||||
|
|
||||||
/* aTitle1 : text prompt on left of edit line */
|
/* aTitle1 : text prompt on left of edit line */
|
||||||
QLabel* TextLabel1 = new QLabel(mainGrp, "TextLabel1");
|
QLabel* TextLabel1 = new QLabel(mainGrp);
|
||||||
|
TextLabel1->setObjectName("TextLabel1");
|
||||||
TextLabel1->setText(tr(aTitle1));
|
TextLabel1->setText(tr(aTitle1));
|
||||||
mainGrpLayout->addWidget(TextLabel1, 0, 0);
|
mainGrpLayout->addWidget(TextLabel1, 0, 0);
|
||||||
|
|
||||||
mySpinBox = new QtxDblSpinBox(mainGrp, "mySpinBox");
|
mySpinBox = new QtxDoubleSpinBox(mainGrp);
|
||||||
mySpinBox->setPrecision(12);
|
mySpinBox->setObjectName("mySpinBox");
|
||||||
|
mySpinBox->setDecimals(decimals);
|
||||||
mySpinBox->setRange(bottom, top);
|
mySpinBox->setRange(bottom, top);
|
||||||
((QDoubleValidator*)(mySpinBox->validator()))->setRange(bottom, top, decimals);
|
|
||||||
mySpinBox->setValue(QString(aValue1).toDouble());
|
mySpinBox->setValue(QString(aValue1).toDouble());
|
||||||
mainGrpLayout->addWidget(mySpinBox, 0, 1);
|
mainGrpLayout->addWidget(mySpinBox, 0, 1);
|
||||||
|
|
||||||
QGroupBox* btnGrp = new QGroupBox(this, "btnGrp");
|
QGroupBox* btnGrp = new QGroupBox(this);
|
||||||
btnGrp->setColumnLayout(0, Qt::Vertical);
|
btnGrp->setObjectName("btnGrp");
|
||||||
btnGrp->layout()->setSpacing(0);
|
QGridLayout* btnGrpLayout = new QGridLayout(btnGrp);
|
||||||
btnGrp->layout()->setMargin(0);
|
|
||||||
QGridLayout* btnGrpLayout = new QGridLayout(btnGrp->layout());
|
|
||||||
btnGrpLayout->setAlignment(Qt::AlignTop);
|
btnGrpLayout->setAlignment(Qt::AlignTop);
|
||||||
btnGrpLayout->setSpacing(6);
|
btnGrpLayout->setSpacing(6);
|
||||||
btnGrpLayout->setMargin(11);
|
btnGrpLayout->setMargin(11);
|
||||||
topLayout->addWidget(btnGrp, 1, 0);
|
topLayout->addWidget(btnGrp, 1, 0);
|
||||||
|
|
||||||
/* Ok button */
|
/* Ok button */
|
||||||
myButtonOk = new QPushButton(btnGrp, "buttonOk");
|
myButtonOk = new QPushButton(btnGrp);
|
||||||
|
myButtonOk->setObjectName("buttonOk");
|
||||||
myButtonOk->setText(tr("GEOM_BUT_OK"));
|
myButtonOk->setText(tr("GEOM_BUT_OK"));
|
||||||
myButtonOk->setAutoDefault(TRUE);
|
myButtonOk->setAutoDefault(TRUE);
|
||||||
myButtonOk->setDefault(TRUE);
|
myButtonOk->setDefault(TRUE);
|
||||||
@ -115,7 +114,8 @@ GEOMBase_aParameterDlg::GEOMBase_aParameterDlg(const char *aValue1, const char *
|
|||||||
btnGrpLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
|
btnGrpLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
|
||||||
|
|
||||||
/* Cancel button */
|
/* Cancel button */
|
||||||
myButtonCancel = new QPushButton(btnGrp, "buttonCancel");
|
myButtonCancel = new QPushButton(btnGrp);
|
||||||
|
myButtonCancel->setObjectName("buttonCancel");
|
||||||
myButtonCancel->setText(tr("GEOM_BUT_CANCEL"));
|
myButtonCancel->setText(tr("GEOM_BUT_CANCEL"));
|
||||||
myButtonCancel->setAutoDefault(TRUE);
|
myButtonCancel->setAutoDefault(TRUE);
|
||||||
btnGrpLayout->addWidget(myButtonCancel, 0, 2);
|
btnGrpLayout->addWidget(myButtonCancel, 0, 2);
|
||||||
|
@ -31,10 +31,10 @@
|
|||||||
|
|
||||||
#include "GEOM_GEOMBase.hxx"
|
#include "GEOM_GEOMBase.hxx"
|
||||||
|
|
||||||
#include <qdialog.h>
|
#include <QDialog>
|
||||||
|
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QtxDblSpinBox;
|
class QtxDoubleSpinBox;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GEOMBase_aParameterDlg
|
// class : GEOMBase_aParameterDlg
|
||||||
@ -45,7 +45,7 @@ class GEOMBASE_EXPORT GEOMBase_aParameterDlg : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GEOMBase_aParameterDlg(const char* aValue1 = "25", const char* aTitle1 = "Value :", QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const double bottom = -1E6, const double top = +1E6, const int decimals = 6);
|
GEOMBase_aParameterDlg(const char* aValue1 = "25", const char* aTitle1 = "Value :", QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0, const double bottom = -1E6, const double top = +1E6, const int decimals = 6);
|
||||||
~GEOMBase_aParameterDlg();
|
~GEOMBase_aParameterDlg();
|
||||||
|
|
||||||
void setValue(double val);
|
void setValue(double val);
|
||||||
@ -54,7 +54,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QPushButton* myButtonOk;
|
QPushButton* myButtonOk;
|
||||||
QPushButton* myButtonCancel;
|
QPushButton* myButtonCancel;
|
||||||
QtxDblSpinBox* mySpinBox;
|
QtxDoubleSpinBox* mySpinBox;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,13 +21,11 @@ GUI_CXXFLAGS = $$(GUI_ROOT_DIR)/include/salome
|
|||||||
|
|
||||||
CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
|
CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
|
||||||
|
|
||||||
QWT_INCLUDES = $$(QWTHOME)/include
|
|
||||||
|
|
||||||
KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
|
KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
|
||||||
|
|
||||||
GUI_LDFLAGS = -L$$(GUI_ROOT_DIR)/lib/salome
|
GUI_LDFLAGS = -L$$(GUI_ROOT_DIR)/lib/salome
|
||||||
|
|
||||||
INCLUDEPATH += $${QT_INCLUDES} $${VTK_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${GUI_CXXFLAGS} $${CORBA_CXXFLAGS} $${CORBA_INCLUDES} ../OBJECT ../GEOMFiltersSelection ../GEOMClient ../GEOMImpl $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix
|
INCLUDEPATH += $${QT_INCLUDES} $${VTK_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${GUI_CXXFLAGS} $${CORBA_INCLUDES} ../OBJECT ../GEOMFiltersSelection ../GEOMClient ../GEOMImpl $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix
|
||||||
|
|
||||||
LIBS += -L$$(GEOM_ROOT_DIR)/lib -lGEOMFiltersSelection -lGEOMClient -lGEOMObject $${KERNEL_LDFLAGS} -lSalomeLifeCycleCORBA $${GUI_LDFLAGS} -lOCCViewer -lVTKViewer -lCAM -lSOCC -lSVTK -lEvent
|
LIBS += -L$$(GEOM_ROOT_DIR)/lib -lGEOMFiltersSelection -lGEOMClient -lGEOMObject $${KERNEL_LDFLAGS} -lSalomeLifeCycleCORBA $${GUI_LDFLAGS} -lOCCViewer -lVTKViewer -lCAM -lSOCC -lSVTK -lEvent
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ SUBDIRS += GEOMClient
|
|||||||
SUBDIRS += DlgRef
|
SUBDIRS += DlgRef
|
||||||
SUBDIRS += GEOMFiltersSelection
|
SUBDIRS += GEOMFiltersSelection
|
||||||
SUBDIRS += GEOMGUI
|
SUBDIRS += GEOMGUI
|
||||||
#SUBDIRS += GEOMBase
|
SUBDIRS += GEOMBase
|
||||||
#SUBDIRS += GEOMToolsGUI
|
#SUBDIRS += GEOMToolsGUI
|
||||||
#SUBDIRS += DisplayGUI
|
#SUBDIRS += DisplayGUI
|
||||||
#SUBDIRS += BasicGUI
|
#SUBDIRS += BasicGUI
|
||||||
|
Loading…
Reference in New Issue
Block a user