break
fi
done
+
+ # workaround a problem with libGL library location
+ for idir in $dirs; do
+ if test -r "${idir}/libGLU.la"; then
+ GLU_LA_PATH="${idir}/libGLU.la"
+ GL_LA_PATH_TO_CHECK=`cat ${GLU_LA_PATH} | awk '{ for(i=1;i<NF;i++){ if(gsub("libGL.la","&",$i)>0) print $i } }'`
+ if test -z ${GL_LA_PATH_TO_CHECK} || test -r ${GL_LA_PATH_TO_CHECK}; then
+ # nothing to do
+ break
+ fi
+ for jdir in $dirs; do
+ if test -r "${jdir}/libGL.la"; then
+ GL_LA_PATH="${jdir}/libGL.la"
+ # copy the libGLU.la file and set correct libGL.la path in it
+ NEW_GLU_LA_PATH=${ROOT_BUILDDIR}
+ NEW_GLU_LA_FILE="${NEW_GLU_LA_PATH}/libGLU.la"
+ sed -e "s%${GL_LA_PATH_TO_CHECK}%${GL_LA_PATH}%" ${GLU_LA_PATH} > "${NEW_GLU_LA_FILE}"
+ chmod -f --reference=${GLU_LA_PATH} "${NEW_GLU_LA_FILE}"
+ # set a new libGLU.la path
+ GLU_LIB_PATH="-L${NEW_GLU_LA_PATH}"
+ # create a simbolic link to libGLU.so
+ for kdir in $dirs; do
+ if test -r "${kdir}/libGLU.so"; then
+ cp -fs "${kdir}/libGLU.so" "${NEW_GLU_LA_PATH}/libGLU.so"
+ break
+ fi
+ done
+ break
+ fi
+ done
+ break
+ fi
+ done
+
LDFLAGS_old="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${OGL_LIBS} ${GLU_LIB_PATH}"
AC_CHECK_LIB([GLU],
AC_LANG_RESTORE
])dnl
+
#define OCCVIEWER_VIEWWINDOW_H
#include "OCCViewer_ViewModel.h"
+#include "OCCViewer_ViewSketcher.h"
#include "SUIT_ViewWindow.h"
class SUIT_Desktop;
class OCCViewer_ViewPort3d;
-class OCCViewer_ViewSketcher;
class OCCViewer_ClippingDlg;
class OCCViewer_SetRotationPointDlg;
* will have the same __builtin__ module
*/
+ if(!builtinmodule) // PAL18041: deepcopy function don't work in Salome
+ {
+ //builtinmodule is static member of PyInterp class
+ //If it is not NULL (initialized to the builtin module of the main interpreter
+ //all the sub interpreters will have the same builtin
+ //_interp is a static member and is the main interpreter
+ //The first time we initialized it to the builtin of main interpreter
+ builtinmodule=PyDict_GetItemString(_interp->modules, "__builtin__");
+ }
+
if(builtinmodule)
{
PyObject *m = PyImport_GetModuleDict();
myCurrentItem(0),
myHilightedItem(0),
mySelectedItem(0),
- myMovingDone(false)
+ myMovingDone(false),
+ myCenter(0,0)
{
printf("Construct QxGraph_CanvasView\n");
setName("QxGraph_CanvasView");
QPixmap zoomPixmap (imageZoomCursor);
QCursor zoomCursor (zoomPixmap);
setCursor(zoomCursor);
+
+ // the center of the view before zooming
+ int aXVCenter = viewport()->width()/2;
+ int aYVCenter = viewport()->height()/2;
+ myCenter = viewportToContents(QPoint(aXVCenter,aYVCenter));
}
return;
}
scrollBy(myGlobalPoint.x() - aGlobalPoint.x(),
myGlobalPoint.y() - aGlobalPoint.y());
myGlobalPoint = aGlobalPoint;
+ myMovingDone = true;
return;
}
if ( myOperation == ZOOMVIEW )
{ // Zoom
+ QCanvasItemList aList = canvas()->allItems();
+ for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it)
+ (*it)->hide();
+
+ int aXContCenter = myCenter.x();
+ int aYContCenter = myCenter.y();
+
QWMatrix m = worldMatrix();
double dx = aGlobalPoint.x() - myGlobalPoint.x();
double s = 1. + fabs(dx)*( (m.m11() < 1) ? m.m11() : 1. )/70.;
if (dx < 0) s = 1./s;
+ int aXContCenterScaled = aXContCenter*s;
+ int aYContCenterScaled = aYContCenter*s;
+
m.scale(s, s);
setWorldMatrix(m);
+ center(aXContCenterScaled,aYContCenterScaled);
+
+ myCenter.setX(aXContCenterScaled);
+ myCenter.setY(aYContCenterScaled);
+
// remember the canvas view's current transformation matrix in all canvas items
- QCanvasItemList aList = canvas()->allItems();
+ aList = canvas()->allItems();
for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
if ( anActItem ) anActItem->setTMatrix(m);
+ (*it)->show();
}
myGlobalPoint = aGlobalPoint;
+ myMovingDone = true;
+
return;
}
myOperation = NOTHING;
viewport()->setMouseTracking(true);
setCursor(myCursor);
+
+ emit viewOperationDone();
}
if ( myOperation == PANGLOBAL )
myOperation = NOTHING;
center( theEvent->x(), theEvent->y() );
setCursor(myCursor);
+
+ emit viewOperationDone();
}
if ( myOperation == WINDOWFIT )
viewport()->setMouseTracking(true);
setCursor(myCursor);
+
+ emit viewOperationDone();
}
if ( myOperation == ZOOMVIEW )
myOperation = NOTHING;
viewport()->setMouseTracking(true);
setCursor(myCursor);
+
+ emit viewOperationDone();
}
if ( theEvent->button() == RightButton )
canvas()->update();
//myOperation = NOTHING;
+
+ emit viewOperationDone();
}
void QxGraph_CanvasView::activateFitRect()
}
//myOperation = NOTHING;
+
+ emit viewOperationDone();
}
void QxGraph_CanvasView::onTimeout()
void setSelectedItem( QxGraph_ActiveItem* theItem );
QxGraph_ActiveItem* getSelectedItem() const;
+ signals:
+ void viewOperationDone();
+
public slots:
void onTimeout();
//void changeBackground();
QPoint myPoint;
QPoint myGlobalPoint;
bool myMovingDone;
+ QPoint myCenter;
// for control toolbar actions
OperationType myOperation;
%Import qtmod.sip
-//%ExportedHeaderCode
-//#include <SalomePyQt.h>
-//%End
+%ExportedHeaderCode
+#include <SalomePyQt.h>
+%End
class SALOME_Selection : QObject
{
::onCursorMove(QPoint mousePos)
{
// processing highlighting
- SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
+ SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
this->FindPokedRenderer(aSelectionEvent->myX,aSelectionEvent->myY);
bool anIsChanged = false;
{
myHighlightRotationPointActor->SetVisibility( false );
- SALOME_Actor *anCurrActor;
- if ( anActor ) anCurrActor = anActor;
- else if ( myLastPreHighlitedActor.GetPointer()
- &&
- myLastPreHighlitedActor.GetPointer() != anActor )
- anCurrActor = myLastPreHighlitedActor.GetPointer();
- if ( anCurrActor )
+ if ( anActor )
{
myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() );
int aVtkId = myPointPicker->GetPointId();
fd->setFilters( aFilters );
fd->myPublishChk->setChecked( true );
fd->mySaveGUIChk->setChecked( true );
- fd->exec();
- QString aFileName = fd->selectedFile();
+ QString aFileName;
+ while (1) {
+ fd->exec();
+ fd->raise();
+ aFileName = fd->selectedFile();
+ if (!aFileName.isEmpty()) {
+ if ( (aFileName.find('-', 0) == -1) && (aFileName.find('!', 0) == -1) && (aFileName.find('?', 0) == -1) &&
+ (aFileName.find('#', 0) == -1) && (aFileName.find('*', 0) == -1) && (aFileName.find('&', 0) == -1)) {
+ break;
+ }
+ else {
+ SUIT_MessageBox::warn1 ( desktop(),
+ QObject::tr("WRN_WARNING"),
+ tr("WRN_FILE_NAME_BAD"),
+ QObject::tr("BUT_OK") );
+ }
+ }
+ else {
+ break;
+ }
+ }
bool toPublish = fd->myPublishChk->isChecked();
bool toSaveGUI = fd->mySaveGUIChk->isChecked();
delete fd;
msgid "SalomeApp_Application::WRN_DUMP_STUDY_FAILED"
msgstr "Dump study failed"
+msgid "SalomeApp_Application::WRN_FILE_NAME_BAD"
+msgstr "Please enter correct file name"
+
msgid "SAVE_POINT_OBJECT_TOOLTIP"
msgstr "Saved GUI state: %1"
cmd += QString("[ m.update(i) for i in pids ]; ");
cmd += QString("pids=filter(lambda a: 'notifd' in m[a], m.keys()); ");
cmd += QString("[ os.kill(pid, 9) for pid in pids ]; ");
- cmd = QString("python -c \"%1\"").arg(cmd);
+ cmd += QString("os.remove(filedict); ");
+ cmd = QString("python -c \"%1\" > /dev/null").arg(cmd);
system( cmd.latin1() );
}
// unlock Session mutex
_SessionMutex.unlock();
- if ( shutdown ) {
+ if ( shutdown )
shutdownServers( _NS );
- killOmniNames();
- }
if ( myServerLauncher )
myServerLauncher->KillAll(); // kill embedded servers
}
catch(...)
{
- std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
+ //////////////////////////////////////////////////////////////
+ // VSR: silently skip exception:
+ // CORBA.BAD_INV_ORDER.BAD_INV_ORDER_ORBHasShutdown
+ // exception is raised when orb->destroy() is called and
+ // cpp continer is launched in the embedded mode
+ //////////////////////////////////////////////////////////////
+ // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
}
- // if ( shutdown )
- // killOmniNames();
+ if ( shutdown )
+ killOmniNames();
return result;
}
(bnd[5]-bnd[4])*(bnd[5]-bnd[4]));
}else{
aLength = bnd[1]-bnd[0];
- aLength = QMAX((bnd[3]-bnd[2]),aLength);
- aLength = QMAX((bnd[5]-bnd[4]),aLength);
+ aLength = std::max((bnd[3]-bnd[2]),aLength);
+ aLength = std::max((bnd[5]-bnd[4]),aLength);
}
static vtkFloatingPointType aSizeInPercents = 105;