<b>Rotate clockwise</b> - rotates view 90 @htmlonly ° @endhtmlonly clockwise.
<hr>
+\image html occ_view_orthographic.png
+
+<b>Ortographic projection</b> - default OCC viewer projection mode.
+<hr>
+
+\image html occ_view_perspective.png
+
+<b>Perspective projection</b> - perspective OCC viewer projection mode.
+<hr>
+
+\image html occ_view_stereo.png
+
+<b>Stereo projection</b> - stereoscopic rendering of the view.
+\note Activation of this mode also switches the view to perpective projection
+in case if orthographic one has been active.
+\note By default, quad-buffered stereo is activated, if it is supported by graphic card.
+If no stereo capabilities are available, an error message is shown.
+\note Settigs of stereoscopic view take place in
+\ref occ_preferences "OCC 3D Viewer" preferences.
+
+<hr>
+
\image html occ_view_reset.png
<b>Reset</b> - restores the default position (isometric) of objects in
- \b Short - shows the file name only.
- \b Auto - shows full paths to the files only if some files from
different locations have the same name.
+- <b>Full-screen</b> - options concerned full-screen mode:
+ - <b>Hide object browser and viewers toolbars</b> - switches automatic hiding of
+ Object Browser and OCC viewer toolbar in full-screen mode.
<h2>3D Viewer Preferences</h2>
\image html pref_salome_occviewer.png
+- <b>Projection mode</b> - sets the default projection mode for the viewers: Orthogonal or Perpective.
+- <b>Stereo render</b> - group of stereoscopic view settings:
+ - <b>Stereo type</b> - specifies a stereo pair type:
+ - Shutter glasses (OpenGL quad-buffer)
+ - Anaglyph
+ - Row-interlaced
+ - Column-interlaced
+ - Chess-board stereo for DLP TVs
+ - Horizontal-anamorphic (side-by-side)
+ - Vertical-anamorphic (Half OverUnder)
+ \note The stereo pair type selected in this combobox is applied
+ for all existing OCC 3D views with stereo rendering already turned on
+ within the same SALOME GUI session. It is not possible to use
+ different stereo modes in several OCC 3D views at the same time
+ within the same SALOME GUI session.
+ - <b>Anaglyph filter</b> - specifies format of anaglyph stereo pair:
+ - Red-Cyan (default)
+ - Yellow-Blue
+ - Green-Magenta
+ - <b>Convergence distance type</b>: Absolute or Relative (default).
+ - <b>Stereographic focus value</b> - 1 by default.
+ - <b>IOD type</b> - Absolute or Relative (default).
+ - <b>Interocular distance (IOD) value</b> - 0.05 by default.
+ - <b>Reverse stereo</b> - option to swap left and right frames.
+ - <b>Enable V-Sync</b> - activates vertical synchronization.
+ - <b>Enable quad-buffer support</b> - allows quad-buffered rendering.
+ \note It is neccessary to enable quad-buffered stereoscopic rendering
+ manually in graphic driver settings. SALOME does not do it automatically.
+ \note All existing OCC 3D views should be re-created for quad-buffer support.
+
- <b>Background</b> - specifies the default background for the viewers,
separately for (for more details, refer to the \ref viewer_background
"this page"):
or [-] keyboard buttons.
- <b>Modification Mode</b> - allows choosing between \b Arithmetic
and \b Geometrical progression used for zooming.
+- <b>Stereo render</b> - group of stereoscopic view settings:
+ - <b>Stereo type</b> - specifies a stereo pair type:
+ - Crystal Eyes
+ - Red-Blue
+ - Interlaced
+ - Left
+ - Right
+ - Dresden
+ - Anaglyph
+ - Checkerboard
+ - Split View Port Horizontal
+ \note The stereo pair type selected in this combobox is applied
+ for all existing VTK 3D views with stereo rendering already turned on
+ within the same SALOME GUI session. It is not possible to use
+ different stereo modes in several VTK 3D views at the same time
+ within the same SALOME GUI session.
+ - <b>Anaglyph filter</b> - specifies format of anaglyph stereo pair:
+ - Red-Cyan (default)
+ - Yellow-Blue
+ - Green-Magenta
+ - <b>Enable quad-buffer support</b> - allows quad-buffered rendering.
+ \note It is neccessary to enable quad-buffered stereoscopic rendering
+ manually in graphic driver settings. SALOME does not do it automatically.
+ \note All existing VTK 3D views should be re-created for quad-buffer support.
- <b>Selection</b>
- <b>Preselection</b> - allows to choose among three possible preselection modes:
- <b>Standard</b> - this mode works quickly, by checking only
}
return info;
}
+
+/*!
+ \brief Abort active operations if there are any
+
+ Iterates through all modules and asks each of them if there are pending operations that cannot be aborted.
+
+ \return \c false if some operation cannot be aborted
+*/
+bool CAM_Application::abortAllOperations()
+{
+ bool aborted = true;
+ for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end() && aborted; ++it )
+ {
+ aborted = (*it)->abortAllOperations();
+ }
+ return aborted;
+}
static QString moduleLibrary( const QString&, const bool = true );
+ virtual bool abortAllOperations();
+
private:
void readModuleList();
\fn void CAM_Module::updateCommandsStatus();
\brief Update menu/toolbar actions.
*/
+
+
+bool CAM_Module::abortAllOperations()
+{
+ return true;
+}
// after activate/deactivate modules
QMap<QPair<int, QAction*>, QKeySequence> myActionShortcutMap; //!< copy actions shortcut map
+ virtual bool abortAllOperations();
+
private:
CAM_Application* myApp; //!< parent application object
QString myName; //!< module title (user name)
vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
vm->setStereoType( resMgr->integerValue( "VTKViewer", "stereo_type", vm->stereoType() ) );
vm->setAnaglyphFilter( resMgr->integerValue( "VTKViewer", "anaglyph_filter", vm->anaglyphFilter() ) );
+ vm->setQuadBufferSupport( resMgr->booleanValue( "VTKViewer", "enable_quad_buffer_support", vm->isQuadBufferSupport() ) );
vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
vm->setTrihedronSize( resMgr->doubleValue( "3DViewer", "trihedron_size", vm->trihedronSize() ),
resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ) );
}
#endif
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "enable_quad_buffer_support" ) )
+ {
+ int enable = resMgr->booleanValue( "VTKViewer", "enable_quad_buffer_support", false );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setQuadBufferSupport( enable );
+ }
+#endif
+ }
+#endif
+
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && param == QString( "preselection" ) )
{
#include "LightApp_SelectionMgr.h"
#include "LightApp_Selection.h"
+#include "SUIT_OverrideCursor.h"
+
#ifndef DISABLE_SALOMEOBJECT
#include <SALOME_ListIO.hxx>
#endif
objEntries.append( study->referencedToEntry( *it ) );
if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY ) {
+ SUIT_OverrideCursor wc;
d->Display( objEntries, false, 0 );
mgr->setSelectedObjects(selObjs);
}
return;
if ( on ) {
- myAISContext->Display( myTrihedron );
- myAISContext->Deactivate(myTrihedron);
+ myAISContext->Display( myTrihedron,
+ 0 /*wireframe*/,
+ -1 /* selection mode */,
+ Standard_True /* update viewer*/,
+ Standard_False /* allow decomposition */,
+ AIS_DS_Displayed /* display status */);
+ myAISContext->Deactivate( myTrihedron );
}
else {
myAISContext->Erase( myTrihedron );
ic->HilightPreviousDetected( myViewPort->getView() );
}
}
- } else {
+ }
+ else {
+ emit vpTransformationStarted ( ZOOMVIEW );
myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() );
double delta = (double)( aEvent->delta() ) / ( 15 * 8 );
int x = aEvent->x();
int y1 = (int)( aEvent->y() + height()*delta/100 );
myViewPort->zoom( x, y, x1, y1 );
myViewPort->getView()->ZFitAll();
+ emit vpTransformationFinished ( ZOOMVIEW );
}
}
return true;
}
/* notify that we start a transformation */
if ( transformRequested() )
- emit vpTransformationStarted ( myOperation );
+ emit vpTransformationStarted ( myOperation );
}
if ( transformRequested() )
setTransformInProcess( true );
tr( "MNU_ORTHOGRAPHIC_MODE" ), 0, this);
aAction->setStatusTip(tr("DSC_ORTHOGRAPHIC_MODE"));
aAction->setCheckable(true);
- //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
toolMgr()->registerAction( aAction, OrthographicId );
// - perspective projection
tr( "MNU_PERSPECTIVE_MODE" ), 0, this);
aAction->setStatusTip(tr("DSC_PERSPECTIVE_MODE"));
aAction->setCheckable(true);
- //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
toolMgr()->registerAction( aAction, PerspectiveId );
#if OCC_VERSION_LARGE > 0x06090000
// - stereo projection
aAction->setStatusTip(tr("DSC_STEREO_MODE"));
aAction->setCheckable(true);
toolMgr()->registerAction( aAction, StereoId );
- //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
+ connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onStereoType(bool)));
#endif
// - add exclusive action group
QActionGroup* aProjectionGroup = new QActionGroup( this );
aProjectionGroup->addAction( toolMgr()->action( OrthographicId ) );
aProjectionGroup->addAction( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
- aProjectionGroup->addAction( toolMgr()->action( StereoId ) );
-#endif
- connect(aProjectionGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionType()));
-
+ connect(aProjectionGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionType(QAction*)));
+
// Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
toolMgr()->append( OrthographicId, tid );
toolMgr()->append( PerspectiveId, tid );
+#if OCC_VERSION_LARGE > 0x06090000
toolMgr()->append( StereoId, tid );
+#endif
toolMgr()->append( ResetId, tid );
}
}
/*!
- \brief Perform "reset view" transformation.
+ \brief Set the given projection mode.
- Sets default orientation of the viewport camera.
+ Set the given projection mode: Orthographic or Perspective.
+*/
+void OCCViewer_ViewWindow::onProjectionType( QAction* theAction )
+{
+ Handle(V3d_View) aView3d = myViewPort->getView();
+ if ( !aView3d.IsNull() ) {
+ Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
+ if (theAction == toolMgr()->action( OrthographicId )) {
+ myModel->setProjectionType(Orthographic);
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Orthographic );
+ aCamera->SetFOVy(45.0);
+ }
+ else if (theAction == toolMgr()->action( PerspectiveId )) {
+ myModel->setProjectionType(Perspective);
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
+ aCamera->SetFOVy(30.0);
+ }
+#if OCC_VERSION_LARGE > 0x06090000
+ if (toolMgr()->action( StereoId )->isChecked()) {
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
+ aCamera->SetFOVy(30.0);
+ }
+#endif
+ aView3d->Redraw();
+ onViewFitAll();
+ }
+}
+
+/*!
+ \brief Sets Stereo projection mode.
+
+ Sets Stereo projection mode.
+*/
+void OCCViewer_ViewWindow::onStereoType( bool activate )
+{
+#if OCC_VERSION_LARGE > 0x06090000
+ Handle(V3d_View) aView3d = myViewPort->getView();
+ if ( !aView3d.IsNull() ) {
+ Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
+ if (activate) {
+ toolMgr()->action( PerspectiveId )->setChecked(true);
+ aCamera->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
+ toolMgr()->action( PerspectiveId )->actionGroup()->setEnabled(false);
+
+ aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ setStereoType( aResMgr->integerValue( "OCCViewer", "stereo_type", 0 ) );
+ setAnaglyphFilter( aResMgr->integerValue( "OCCViewer", "anaglyph_filter", 0 ) );
+ setReverseStereo( aResMgr->booleanValue( "OCCViewer", "reverse_stereo", false ) );
+ setVSync( aResMgr->booleanValue( "OCCViewer", "enable_vsync", true ) );
+ setQuadBufferSupport( aResMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", false ) );
+ }
+ else {
+ toolMgr()->action( PerspectiveId )->actionGroup()->setEnabled(true);
+ if (myModel->projectionType() == Orthographic) {
+ toolMgr()->action( OrthographicId )->setChecked(true);
+ aCamera->SetProjectionType(Graphic3d_Camera::Projection_Orthographic);
+ }
+ else if (myModel->projectionType() == Perspective) {
+ toolMgr()->action( PerspectiveId )->setChecked(true);
+ aCamera->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
+ }
+ }
+ aView3d->Redraw();
+ onViewFitAll();
+ }
+
+ if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
+ toolMgr()->action( StereoId )->isChecked() )
+ SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+#endif
+}
+
+/*!
+ \brief Restore the view.
+
+ Restore the projection mode based on tool-buttons states.
*/
void OCCViewer_ViewWindow::onProjectionType()
{
emit vpTransformationStarted( PROJECTION );
if (toolMgr()->action( OrthographicId )->isChecked())
- setProjectionType( Orthographic);
+ setProjectionType( Orthographic );
if (toolMgr()->action( PerspectiveId )->isChecked())
- setProjectionType( Perspective);
+ setProjectionType( Perspective );
#if OCC_VERSION_LARGE > 0x06090000
if (toolMgr()->action( StereoId )->isChecked())
- setProjectionType( Stereo);
+ setProjectionType( Stereo );
#endif
emit vpTransformationFinished( PROJECTION );
}
+void OCCViewer_ViewWindow::setProjectionType( int mode )
+{
+ QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
+ QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
+#if OCC_VERSION_LARGE > 0x06090000
+ QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
+#endif
+ switch ( mode ) {
+ case Orthographic:
+ onProjectionType( anOrthographicAction );
+ break;
+ case Perspective:
+ onProjectionType( aPerspectiveAction );
+ break;
+ case Stereo:
+ onStereoType( true );
+ break;
+ }
+ // update action state if method is called outside
+ if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
+ anOrthographicAction->setChecked( true );
+ #if OCC_VERSION_LARGE > 0x06090000
+ aStereoAction->setChecked( false );
+ #endif
+ }
+ if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
+ aPerspectiveAction->setChecked( true );
+ #if OCC_VERSION_LARGE > 0x06090000
+ aStereoAction->setChecked( false );
+ #endif
+ }
+#if OCC_VERSION_LARGE > 0x06090000
+ if ( mode == Stereo ) {
+ aStereoAction->setChecked( true );
+ if ( anOrthographicAction->isEnabled() ) {
+ anOrthographicAction->setEnabled( false );
+ anOrthographicAction->setChecked( false );
+ aStereoAction->setChecked( false );
+ }
+ else {
+ anOrthographicAction->setEnabled( true );
+ aStereoAction->setChecked( false );
+ anOrthographicAction->setChecked(myModel->projectionType() == Orthographic);
+ }
+ if ( aPerspectiveAction->isEnabled() ) {
+ aPerspectiveAction->setEnabled( false );
+ aPerspectiveAction->setChecked( true );
+ if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
+ toolMgr()->action( StereoId )->isChecked() )
+ SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+ }
+ else {
+ aPerspectiveAction->setEnabled( true );
+ aStereoAction->setChecked( false );
+ aPerspectiveAction->setChecked(myModel->projectionType() == Perspective);
+ onProjectionType();
+ }
+ }
+ else {
+ if ( !anOrthographicAction->isEnabled() )
+ anOrthographicAction->setEnabled( true );
+ if ( !aPerspectiveAction->isEnabled() )
+ aPerspectiveAction->setEnabled( true );
+ }
+#endif
+}
+
/*!
\brief Perform "fit all" transformation.
*/
my2dMode = theType;
}
-void OCCViewer_ViewWindow::setProjectionType( int mode )
-{
- Handle(V3d_View) aView3d = myViewPort->getView();
- if ( !aView3d.IsNull() ) {
- Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
- if (mode == Perspective) {
- myModel->setProjectionType(Perspective);
- aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
- }
- if (mode == Orthographic) {
- myModel->setProjectionType(Orthographic);
- aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Orthographic );
- }
- #if OCC_VERSION_LARGE > 0x06090000
- if (mode == Stereo) {
- aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- setStereoType( aResMgr->integerValue( "OCCViewer", "stereo_type", 0 ) );
- setAnaglyphFilter( aResMgr->integerValue( "OCCViewer", "anaglyph_filter", 0 ) );
- setReverseStereo( aResMgr->booleanValue( "OCCViewer", "reverse_stereo", false ) );
- setVSync( aResMgr->booleanValue( "OCCViewer", "enable_vsync", true ) );
- setQuadBufferSupport( aResMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", false ) );
- }
- #endif
- aView3d->Redraw();
- onViewFitAll();
- }
- // update action state if method is called outside
- QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
- QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
- QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
-#endif
- if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
- anOrthographicAction->setChecked( true );
- #if OCC_VERSION_LARGE > 0x06090000
- aStereoAction->setChecked( false );
- #endif
- }
- if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
- aPerspectiveAction->setChecked( true );
- #if OCC_VERSION_LARGE > 0x06090000
- aStereoAction->setChecked( false );
- #endif
- }
-#if OCC_VERSION_LARGE > 0x06090000
- if ( mode == Stereo ) {
- aStereoAction->setChecked( true );
- if ( anOrthographicAction->isEnabled() ) {
- anOrthographicAction->setEnabled( false );
- anOrthographicAction->setChecked( false );
- aStereoAction->setChecked( false );
- }
- else {
- anOrthographicAction->setEnabled( true );
- aStereoAction->setChecked( false );
- anOrthographicAction->setChecked(myModel->projectionType() == Orthographic);
- }
- if ( aPerspectiveAction->isEnabled() ) {
- aPerspectiveAction->setEnabled( false );
- aPerspectiveAction->setChecked( true );
- #if OCC_VERSION_LARGE > 0x06090000
- if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
- SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
- #endif
- }
- else {
- aPerspectiveAction->setEnabled( true );
- aStereoAction->setChecked( false );
- aPerspectiveAction->setChecked(myModel->projectionType() == Perspective);
- onProjectionType();
- }
- }
- else {
- if ( !anOrthographicAction->isEnabled() )
- anOrthographicAction->setEnabled( true );
- if ( !aPerspectiveAction->isEnabled() )
- aPerspectiveAction->setEnabled( true );
- }
-#endif
-}
-
int OCCViewer_ViewWindow::projectionType() const
{
int mode = Orthographic;
virtual void onRightView();
virtual void onClockWiseView();
virtual void onAntiClockWiseView();
+ virtual void onProjectionType( QAction* theAction );
+ virtual void onStereoType( bool activate );
virtual void onProjectionType();
virtual void onResetView();
virtual void onFitAll();
)
ADD_DEFINITIONS(
+ ${OMNIORB_DEFINITIONS}
${KERNEL_DEFINITIONS}
)
--- /dev/null
+// Copyright (C) 2010-2015 CEA/DEN, EDF R&D
+//
+// 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, or (at your option) any later version.
+//
+// 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
+//
+
+#ifndef PVSERVERSERVICELOADER_H
+#define PVSERVERSERVICELOADER_H
+
+#ifdef WIN32
+#if defined PVServerServiceLoader_EXPORTS
+#define PVSERVERSERVICELOADER_EXPORT __declspec(dllexport)
+#else
+#define PVSERVERSERVICELOADER_EXPORT __declspec(dllimport)
+#endif
+#else
+#define PVSERVERSERVICELOADER_EXPORT
+#endif
+
+#endif //PVSERVERSERVICELOADER_H
#ifndef PVSERVERSERVICELOADER_H_
#define PVSERVERSERVICELOADER_H_
-#include "PVServerService.h"
+#include "PVServerServiceLoader.h"
#include <SALOME_ContainerManager.hxx>
class SALOME_LifeCycleCORBA;
class SALOME_NamingService;
-class PVSERVERSERVICE_EXPORT PVServer_ServiceLoader
+class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader
{
public:
PVServer_ServiceLoader();
#include <AIS_TypeOfIso.hxx>
#include <Precision.hxx>
+#include <algorithm>
+
// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
// SALOMEDS::StudyManager - no linkage with SalomeApp.
bool allObjects = thePrs == 0 || thePrs->IsNull();
if ( !ic->HasOpenedContext() ) {
ic->ClearCurrents( false );
- ic->OpenLocalContext( allObjects, true, true );
+ ic->OpenLocalContext( Standard_False, Standard_True, Standard_True );
}
AIS_ListOfInteractive anObjs;
else
anOCCPrs->GetObjects( anObjs );
+ std::list<int> sel_modes;
+ for ( int i = TopAbs_COMPOUND; i < TopAbs_SHAPE; i++ )
+ if ( std::find(modes.begin(), modes.end(), (int)TopAbs_SHAPE) != modes.end() || std::find(modes.begin(), modes.end(), i) != modes.end())
+ sel_modes.push_back(i);
+
// Activate selection of objects from prs
AIS_ListIteratorOfListOfInteractive aIter( anObjs );
for ( ; aIter.More(); aIter.Next() ) {
if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
{
ic->Load( anAIS, -1, false );
- for( it = modes.begin(); it != modes.end(); ++it )
+ for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) );
}
else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) )
{
ic->Load( anAIS, -1, false );
- for( it = modes.begin(); it != modes.end(); ++it )
+ for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
ic->Activate( anAIS, *it );
}
}
/*! \retval true, if document was opened successful, else false.*/
bool STD_Application::onOpenDoc( const QString& aName )
{
+ if ( !abortAllOperations() )
+ return false;
+
QApplication::setOverrideCursor( Qt::WaitCursor );
bool res = openAction( openChoice( aName ), aName );
// update views / windows / status bar / title
clearViewManagers();
setActiveStudy( 0 );
- updateDesktopTitle();
- updateCommandsStatus();
// delete study
delete study;
// post closing actions
afterCloseDoc();
+ int aNbStudies = 0;
+ QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+ for ( int i = 0; i < apps.count(); i++ )
+ aNbStudies += apps.at( i )->getNbStudies();
+
// reload study from the file
res = useFile( studyName ) && activeStudy();
// if reloading is failed, close the desktop
- if ( !res ) {
- setDesktop( 0 );
+ if ( aNbStudies && !res )
closeApplication();
+ else
+ {
+ updateDesktopTitle();
+ updateCommandsStatus();
}
}
return res;
if ( !activeStudy() )
return;
+ if ( !abortAllOperations() )
+ return;
+
bool isOk = false;
if ( activeStudy()->isSaved() )
{
if ( !study )
return false;
+ if ( !abortAllOperations() )
+ return false;
+
bool isOk = false;
while ( !isOk )
{
return myViewMgrs.indexOf(const_cast<SUIT_ViewManager*>(theManager));
}
+/*!
+ \brief Abort active operations if there are any
+ \return \c false if some operation cannot be aborted
+*/
+bool STD_Application::abortAllOperations()
+{
+ return true;
+}
virtual bool closeDoc( bool ask = true );
virtual bool closeActiveDoc( bool permanently = true );
+ virtual bool abortAllOperations();
+
private:
ViewManagerList myViewMgrs;
SUIT_ViewManager* myActiveViewMgr;
}
myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight );
}
+ myHighlightActor->SetMarkerEnabled( mySelectionMode == NodeSelection );
}
highlight(theIsHighlight);
if ( !theIsHighlight )
return true;
- myHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
-
double x = theSelectionEvent->myX;
double y = theSelectionEvent->myY;
if ( this->FlyMode == VTK_FLY_CLOSEST_TRIAD )
{
// Loop over points and find the closest point to the camera
- min = VTK_LARGE_FLOAT;
+ min = VTK_FLOAT_MAX;
for (i=0; i < 8; i++)
{
if ( pts[i][2] < min )
double e1[2], e2[2], e3[2];
// Find distance to origin
- d2Min = VTK_LARGE_FLOAT;
+ d2Min = VTK_FLOAT_MAX;
for (i=0; i < 8; i++)
{
d2 = pts[i][0]*pts[i][0] + pts[i][1]*pts[i][1];
// find minimum slope point connected to closest point and on
// right side (in projected coordinates). This is the first edge.
- minSlope = VTK_LARGE_FLOAT;
+ minSlope = VTK_FLOAT_MAX;
for (xIdx=0, i=0; i<3; i++)
{
num = (pts[Conn[idx][i]][1] - pts[idx][1]);
QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox);
TextLabelX->setObjectName("TextLabelX");
TextLabelX->setFixedWidth(15);
- m_sbXcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+ m_sbXcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox);
m_sbXcoeff->setMinimumWidth(80);
m_sbXcoeff->setValue(1.0);
QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox);
TextLabelY->setObjectName("TextLabelY");
TextLabelY->setFixedWidth(15);
- m_sbYcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+ m_sbYcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox);
m_sbYcoeff->setMinimumWidth(80);
m_sbYcoeff->setValue(1.0);
QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox);
TextLabelZ->setObjectName("TextLabelZ");
TextLabelZ->setFixedWidth(15);
- m_sbZcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+ m_sbZcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox);
m_sbZcoeff->setMinimumWidth(80);
m_sbZcoeff->setValue(1.0);
bool
CheckBndBox(const double theBounds[6])
{
- if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT &&
- theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT &&
- theBounds[4] > -VTK_LARGE_FLOAT && theBounds[5] < VTK_LARGE_FLOAT)
+ if(theBounds[0] > -VTK_FLOAT_MAX && theBounds[1] < VTK_FLOAT_MAX &&
+ theBounds[2] > -VTK_FLOAT_MAX && theBounds[3] < VTK_FLOAT_MAX &&
+ theBounds[4] > -VTK_FLOAT_MAX && theBounds[5] < VTK_FLOAT_MAX)
return true;
return false;
}
bool aCDisplayed = IsCubeAxesDisplayed();
double aNewBndBox[6];
- aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
- aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
+ aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX;
+ aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX;
int aVisibleNum = myTrihedron->GetVisibleActorCount(GetDevice());
if(aVisibleNum){
#include <vtkDataSet.h>
static double OFF_UPDATE_RATE = 0.00001;
-static double FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
+static double FLOAT_TOLERANCE = 1.0 / VTK_FLOAT_MAX;
namespace
{
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
aGridLayout->addWidget(aLabel, 0, 0);
- QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+ QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox);
aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
aGridLayout->addWidget(aDblSpinBox, 0, 1);
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
aGridLayout->addWidget(aLabel, 1, 0);
- QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+ QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox);
aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
aGridLayout->addWidget(aDblSpinBox, 1, 1);
mySpaceBtn[1] = 2;
mySpaceBtn[2] = 9;
myDefaultBackground = Qtx::BackgroundData( Qt::black );
+ myQuadBufferSupport = false;
}
/*!
aViewWindow->SetProjectionMode( projectionMode() );
aViewWindow->SetStereoType( stereoType() );
aViewWindow->SetAnaglyphFilter( anaglyphFilter() );
+ aViewWindow->SetQuadBufferSupport( isQuadBufferSupport() );
aViewWindow->SetInteractionStyle( interactionStyle() );
aViewWindow->SetZoomingStyle( zoomingStyle() );
aViewWindow->SetPreSelectionMode( preSelectionMode() );
{
if ( myProjMode != theMode ) {
if ( theMode != SVTK_ViewWindow::Stereo )
- myProjMode = theMode;
+ myProjMode = theMode;
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
for ( uint i = 0; i < aViews.count(); i++ )
}
}
+/*!
+ \return support quad-buffered stereo
+*/
+bool SVTK_Viewer::isQuadBufferSupport() const
+{
+ return myQuadBufferSupport;
+}
+
+/*!
+ Set support quad-buffered stereo
+ \param theEnable - enable/disable support quad-buffered stereo
+*/
+void SVTK_Viewer::setQuadBufferSupport( const bool theEnable )
+{
+ if ( myQuadBufferSupport != theEnable ) {
+ myQuadBufferSupport = theEnable;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetQuadBufferSupport( theEnable );
+ }
+ }
+ }
+}
/*!
\return interaction style
*/
//! Sets anaglyph filter
void setAnaglyphFilter( const int );
+ //! Get support quad-buffered stereo
+ bool isQuadBufferSupport() const;
+
+ //! Set support quad-buffered stereo
+ void setQuadBufferSupport( const bool );
+
//! Gets interaction style
int interactionStyle() const;
int myProjMode;
int myStereoType;
int myAnaglyphFilter;
+ bool myQuadBufferSupport;
int myStyle;
int myZoomingStyle;
Preselection_Mode myPreSelectionMode;
*/
void SVTK_ViewWindow::SetProjectionMode(const int theMode)
{
- SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
+ QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
+ QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
- if ( theMode != Stereo ) {
- aViewer->setProjectionMode(theMode);
- bool anIsParallelMode = (theMode == Parallel);
- vtkCamera* aCamera = getRenderer()->GetActiveCamera();
- aCamera->SetParallelProjection(anIsParallelMode);
- GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
- getRenderWindow()->SetStereoRender(0);
- }
- else {
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- SetStereoType( aResMgr->integerValue( "VTKViewer", "stereo_type", 0 ) );
- getRenderWindow()->SetStereoRender(1);
+ switch ( theMode ) {
+ case Parallel:
+ onProjectionMode( aParallelAction );
+ break;
+ case Projection:
+ onProjectionMode( aProjectionAction );
+ break;
+ case Stereo:
+ onStereoMode( true );
+ break;
}
- Repaint();
// update action state if method is called outside
- QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
- QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
- QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
QtxAction* aSwitchZoomingStyle = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
if ( theMode == Parallel && !aParallelAction->isChecked() ) {
aParallelAction->setChecked( true );
aProjectionAction->setEnabled( false );
aProjectionAction->setChecked( true );
if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
- strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 ){
+ strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 &&
+ toolMgr()->action( StereoModeId )->isChecked() ) {
SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
}
}
aProjectionAction->setEnabled( true );
aStereoAction->setChecked( false );
aProjectionAction->setChecked( aViewer->projectionMode() == Projection );
- onPerspectiveMode();
+ onProjectionMode();
}
}
else {
}
}
+/*!
+ Set support quad-buffered stereo
+ \param theEnable - enable/disable support quad-buffered stereo
+*/
+void SVTK_ViewWindow::SetQuadBufferSupport(const bool theEnable)
+{
+ vtkRenderWindow* aWindow = getRenderWindow();
+ aWindow->SetStereoCapableWindow((int)theEnable);
+}
+
/*!
\return OpenGl stereo support
*/
myEventDispatcher->InvokeEvent(SVTK::StartPointSelection,0);
}
+/*!
+ \brief Set the given projection mode.
+
+ Set the given projection mode: Orthographic or Perspective.
+*/
+void SVTK_ViewWindow::onProjectionMode( QAction* theAction )
+{
+ int aMode = Parallel;
+ if (theAction == toolMgr()->action( ProjectionModeId ))
+ aMode = Projection;
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ aViewer->setProjectionMode(aMode);
+ bool anIsParallelMode = (aMode == Parallel);
+ vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+ aCamera->SetParallelProjection(anIsParallelMode);
+ GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+ getRenderWindow()->SetStereoRender(0);
+ Repaint();
+}
+
+/*!
+ \brief Sets Stereo projection mode.
+
+ Sets Stereo projection mode.
+*/
+void SVTK_ViewWindow::onStereoMode( bool activate )
+{
+ if (activate) {
+ toolMgr()->action( ProjectionModeId )->setChecked(true);
+ vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+ aCamera->SetParallelProjection(false);
+ toolMgr()->action( ProjectionModeId )->actionGroup()->setEnabled(false);
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ SetStereoType( aResMgr->integerValue( "VTKViewer", "stereo_type", 0 ) );
+ getRenderWindow()->SetStereoRender(1);
+ Repaint();
+ }
+ else {
+ toolMgr()->action( ProjectionModeId )->actionGroup()->setEnabled(true);
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+ if (aViewer->projectionMode() == Parallel) {
+ toolMgr()->action( ParallelModeId )->setChecked(true);
+ onProjectionMode(toolMgr()->action( ParallelModeId ));
+ }
+ else if (aViewer->projectionMode() == Projection) {
+ toolMgr()->action( ProjectionModeId )->setChecked(true);
+ onProjectionMode(toolMgr()->action( ProjectionModeId ));
+ }
+ }
+ if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
+ strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 &&
+ toolMgr()->action( StereoModeId )->isChecked() )
+ SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+}
+
/*!
Set the view projection mode: orthogonal or perspective
*/
-void SVTK_ViewWindow::onPerspectiveMode()
+void SVTK_ViewWindow::onProjectionMode()
{
if (toolMgr()->action( ParallelModeId )->isChecked())
SetProjectionMode( Parallel);
tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
anAction->setCheckable(true);
- //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
mgr->registerAction( anAction, ParallelModeId );
anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"),
tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
anAction->setCheckable(true);
- //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
mgr->registerAction( anAction, ProjectionModeId );
anAction = new QtxAction(tr("MNU_SVTK_STEREO_MODE"),
tr( "MNU_SVTK_STEREO_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_STEREO_MODE"));
anAction->setCheckable(true);
- //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+ connect(anAction, SIGNAL(triggered(bool)), this, SLOT(onStereoMode(bool)));
mgr->registerAction( anAction, StereoModeId );
QActionGroup* aPerspectiveGroup = new QActionGroup( this );
aPerspectiveGroup->addAction( mgr->action( ParallelModeId ) );
aPerspectiveGroup->addAction( mgr->action( ProjectionModeId ) );
- aPerspectiveGroup->addAction( mgr->action( StereoModeId ) );
- connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onPerspectiveMode()));
+ connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionMode(QAction*)));
// View Parameters
anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"),
//! Sets anaglyph filter
virtual void SetAnaglyphFilter( const int );
+ //! Set support quad-buffered stereo
+ virtual void SetQuadBufferSupport( const bool );
+
//! Set interactive style
virtual void SetInteractionStyle( const int );
void activatePanning();
void activateGlobalPanning();
- void onPerspectiveMode();
+ void onProjectionMode( QAction* theAction );
+ void onStereoMode( bool activate );
+ void onProjectionMode();
void activateProjectionMode(int);
// Description:
// Set/get the radius of the pieces of the axes actor
- vtkSetClampMacro(ConeRadius, float, 0, VTK_LARGE_FLOAT);
+ vtkSetClampMacro(ConeRadius, float, 0, VTK_FLOAT_MAX);
vtkGetMacro(ConeRadius, float);
- vtkSetClampMacro(SphereRadius, float, 0, VTK_LARGE_FLOAT);
+ vtkSetClampMacro(SphereRadius, float, 0, VTK_FLOAT_MAX);
vtkGetMacro(SphereRadius, float);
- vtkSetClampMacro(CylinderRadius, float, 0, VTK_LARGE_FLOAT);
+ vtkSetClampMacro(CylinderRadius, float, 0, VTK_FLOAT_MAX);
vtkGetMacro(CylinderRadius, float);
// Description:
mm = study.FindObjectID(objId).GetObject()
mesh = None
try:
- mesh = mm.Load()
+ mm.Load()
+ mesh = mm
except:
- #print "No mesh selected"
self.clearLineEdit()
mesh = None
pass
if mesh:
+ name = smeshBuilder.GetName( mm )
self.ui.mesh.setStyleSheet("")
- self.ui.mesh.setText(mesh.getName())
- #print "Mesh selected: ", mesh.getName()
+ self.ui.mesh.setText( name )
self.mm = mm
e = self.mm.NbEdges()
f = self.mm.NbFaces()
v = self.mm.NbVolumes()
- #print "NbEdges: ",e
- #print "NbFaces: ",f
- #print "NbVolumes: ",v
controls = []
if e:
controls += controls_1d
pass
def compute_minmax(self):
- if self.mm:
- control = self.ui.control.currentText()
- #print "Compute control: ",control
+ control = self.ui.control.currentText()
+ if self.mm and control:
fun = smesh.GetFunctor(controls_dict[str(control)])
- fun.SetMesh(self.mm.GetMesh())
- hist = fun.GetHistogram(1)
+ fun.SetMesh(self.mm)
+ hist = fun.GetHistogram(1,False)
maxVal = hist[0].max
minVal = hist[0].min
- #print "Max value for %s: %f"%(control, maxVal)
- #print "Min value for %s: %f"%(control, minVal)
self.ui.maxvalue.setText("%f"%(maxVal))
self.ui.minvalue.setText("%f"%(minVal))
else:
- print "Pas de maillage"
pass
pass
pass
if(myIsInfinite)
return true;
- static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+ static double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX;
double aBounds[6];
GetBounds(aBounds);
for(int i = 0; i < 6; i++)
if(fabs(aBounds[i]) > MAX_DISTANCE)
return true;
- static double MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0/VTK_FLOAT_MAX;
if(GetLength() < MIN_DISTANCE)
return true;
/*!Constructor*/
VTKViewer_UnScaledActor::VTKViewer_UnScaledActor()
{
- Bounds[0] = Bounds[2] = Bounds[4] = VTK_LARGE_FLOAT;
- Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT;
+ Bounds[0] = Bounds[2] = Bounds[4] = VTK_FLOAT_MAX;
+ Bounds[1] = Bounds[3] = Bounds[5] = -VTK_FLOAT_MAX;
}
/*!
int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
if(theUsingZeroFocalPoint || aCount){
- static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX;
double aLength = aBounds[1]-aBounds[0];
aLength = std::max((aBounds[3]-aBounds[2]),aLength);
{
int aCount = 0;
- theBounds[0] = theBounds[2] = theBounds[4] = VTK_LARGE_FLOAT;
- theBounds[1] = theBounds[3] = theBounds[5] = -VTK_LARGE_FLOAT;
+ theBounds[0] = theBounds[2] = theBounds[4] = VTK_FLOAT_MAX;
+ theBounds[1] = theBounds[3] = theBounds[5] = -VTK_FLOAT_MAX;
// loop through all props
theCollection->InitTraversal();
if(anActor->IsInfinitive())
continue;
double *aBounds = aProp->GetBounds();
- static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT;
- static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1./VTK_FLOAT_MAX;
+ static double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX;
if(fabs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) {
aBounds[0]-=0.001;
return false;
double aNewBndBox[6];
- aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
- aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
+ aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX;
+ aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX;
// iterate through displayed objects and set size if necessary
VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
if(anActor->GetVisibility() && !anActor->IsInfinitive())
{
double *aBounds = anActor->GetBounds();
- if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
- aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
- aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+ if(aBounds[0] > -VTK_FLOAT_MAX && aBounds[1] < VTK_FLOAT_MAX &&
+ aBounds[2] > -VTK_FLOAT_MAX && aBounds[3] < VTK_FLOAT_MAX &&
+ aBounds[4] > -VTK_FLOAT_MAX && aBounds[5] < VTK_FLOAT_MAX)
isAny = true;
}
return false;
double aNewBndBox[6];
- aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
- aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
+ aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX;
+ aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX;
// iterate through displayed objects and set size if necessary
VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
//Ignore invalid bounds
if(!isBoundValid(aBounds)) continue;
- if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
- aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
- aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+ if(aBounds[0] > -VTK_FLOAT_MAX && aBounds[1] < VTK_FLOAT_MAX &&
+ aBounds[2] > -VTK_FLOAT_MAX && aBounds[3] < VTK_FLOAT_MAX &&
+ aBounds[4] > -VTK_FLOAT_MAX && aBounds[5] < VTK_FLOAT_MAX)
{
for(int i = 0; i < 5; i = i + 2){
if(aBounds[i] < aNewBndBox[i])
return true;
}
- if(aNewBndBox[0] > -VTK_LARGE_FLOAT && aNewBndBox[1] < VTK_LARGE_FLOAT &&
- aNewBndBox[2] > -VTK_LARGE_FLOAT && aNewBndBox[3] < VTK_LARGE_FLOAT &&
- aNewBndBox[4] > -VTK_LARGE_FLOAT && aNewBndBox[5] < VTK_LARGE_FLOAT)
+ if(aNewBndBox[0] > -VTK_FLOAT_MAX && aNewBndBox[1] < VTK_FLOAT_MAX &&
+ aNewBndBox[2] > -VTK_FLOAT_MAX && aNewBndBox[3] < VTK_FLOAT_MAX &&
+ aNewBndBox[4] > -VTK_FLOAT_MAX && aNewBndBox[5] < VTK_FLOAT_MAX)
{
- static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX;
double aLength = aNewBndBox[1]-aNewBndBox[0];
aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength);
printf("aCount = %d\n",aCount);
if(aCount){
- static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX;
double aLength = aBounds[1]-aBounds[0];
aLength = max((aBounds[3]-aBounds[2]),aLength);