STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
# Common CMake macros
# ===================
SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
# Specific to GUI:
-SET(SALOME_GUI_INSTALL_PARAVIEW_LIBS lib/paraview CACHE PATH
- "Install path: SALOME GUI ParaView libraries")
SET(SALOME_GUI_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/gui" CACHE PATH
"Install path: SALOME GUI specific data")
SET(SALOME_GUI_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/gui" CACHE PATH
MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
-MARK_AS_ADVANCED(SALOME_GUI_INSTALL_PARAVIEW_LIBS SALOME_GUI_INSTALL_RES_DATA SALOME_GUI_INSTALL_RES_SCRIPTS SALOME_GUI_INSTALL_PLUGINS)
+MARK_AS_ADVANCED(SALOME_GUI_INSTALL_RES_DATA SALOME_GUI_INSTALL_RES_SCRIPTS SALOME_GUI_INSTALL_PLUGINS)
MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
# Accumulate environment variables for GUI module
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
-SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}
- ${CMAKE_INSTALL_PREFIX}/${SALOME_GUI_INSTALL_PARAVIEW_LIBS})
+SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
# Sources
# ========
# VTK specific targets:
IF(SALOME_USE_VTKVIEWER)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
- VTKViewer vtkTools vtkEDFOverloads)
+ VTKViewer )
IF(SALOME_USE_SALOMEOBJECT)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
SVTK)
SET(GUI_VTKViewer VTKViewer)
SET(GUI_PVViewer PVViewer)
SET(GUI_PVServerService PVServerService)
-SET(GUI_vtkEDFOverloads vtkEDFOverloads)
SET(GUI_vtkTools vtkTools)
SET(GUI_SalomeGuiHelpers SalomeGuiHelpers)
SET(GUI_SalomeTreeData SalomeTreeData)
def set_env( args ):
"""Add environment required for GUI module"""
- vtk_overloads_dir = os.path.join( os.getenv( "GUI_ROOT_DIR" ), "lib", "paraview" )
- dirs = re.split( ":|;", os.getenv( 'VTK_AUTOLOAD_PATH', vtk_overloads_dir ) )
- if vtk_overloads_dir not in dirs: dirs[0:0] = [vtk_overloads_dir]
- os.environ['VTK_AUTOLOAD_PATH'] = os.pathsep.join(dirs)
- os.environ['QT_PLUGIN_PATH'] = ''
+ qt_plugin_dir = os.path.join( os.getenv( "QTDIR" ), "plugins" )
+ dirs = re.split( ":|;", os.getenv( 'QT_PLUGIN_PATH', qt_plugin_dir ) )
+ if qt_plugin_dir not in dirs: dirs[0:0] = [qt_plugin_dir]
+ dirs2 = list(set(dirs))
+ os.environ['QT_PLUGIN_PATH'] = os.pathsep.join(dirs2)
return
-
-
*/
void CAM_Application::start()
{
+ // check modules
+ for ( ModuleInfoList::iterator it = myInfoList.begin();
+ it != myInfoList.end(); ++it )
+ {
+ if ( (*it).status == stUnknown )
+ (*it).status = checkModule( (*it).title ) ? stReady : stInaccessible;
+ }
+
+ // auto-load modules
if ( myAutoLoad )
loadModules();
if ( !modName.isEmpty() )
{
CAM_Module* mod = module( modName );
- if ( !mod && !moduleLibrary( modName ).isEmpty() )
- {
+ if ( !mod )
mod = loadModule( modName );
- addModule( mod );
- }
+ addModule( mod );
if ( mod )
res = activateModule( mod );
STD_Application::setActiveStudy( study );
}
+/*!
+ \brief Check module availability.
+
+ The method can be redefined in successors. Default implementation returns \c true.
+
+ \param title module title
+ \return \c true if module is accessible; \c false otherwise
+*/
+bool CAM_Application::checkModule( const QString& )
+{
+ return true;
+}
+
/*!
\brief Callback function, called when the module is added to the application.
{
bool found = false;
bool blocked = false;
+ bool statusOK = false;
QStringList somewhereLoaded;
QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
{
found = (*it).title == title;
blocked = (*it).isSingleton && somewhereLoaded.contains((*it).title);
+ statusOK = (*it).status == stReady;
}
- return found && !blocked;
+ return found && statusOK && !blocked;
}
/*!
for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && res.isEmpty(); ++it )
{
if ( (*it).title == title )
- res = (*it).internal;
+ res = (*it).library;
}
if ( !res.isEmpty() && full )
res = SUIT_Tools::library( res );
if ( !moduleTitle( modName ).isEmpty() )
continue; // already added
+ if ( modName == "KERNEL" || modName == "GUI" )
+ continue; // omit KERNEL and GUI modules
+
QString modTitle = resMgr->stringValue( *it, "name", QString() );
if ( modTitle.isEmpty() )
{
printf( "****************************************************************\n" );
- printf( "* Warning: %s GUI resources are not found.\n", qPrintable(*it) );
- printf( "* %s GUI will not be available.\n", qPrintable(*it) );
+ printf( " Warning: module %s is improperly configured!\n", qPrintable(*it) );
+ printf( " Module %s will not be available in GUI mode!\n", qPrintable(*it) );
printf( "****************************************************************\n" );
continue;
}
else
modLibrary = modName;
- bool aIsSingleton = resMgr->booleanValue(*it, "singleton", false);
-
- QString ver = resMgr->stringValue(*it, "version", QString());
+ bool aIsSingleton = resMgr->booleanValue( *it, "singleton", false );
+ bool hasGui = resMgr->booleanValue( *it, "gui", true );
+ QString version = resMgr->stringValue( *it, "version", QString() );
ModuleInfo inf;
inf.name = modName;
inf.title = modTitle;
- inf.internal = modLibrary;
+ inf.status = hasGui ? stUnknown : stNoGui;
+ if ( hasGui ) inf.library = modLibrary;
inf.icon = modIcon;
inf.isSingleton = aIsSingleton;
- inf.version = ver;
+ inf.version = version;
myInfoList.append( inf );
}
static QString moduleName( const QString& );
static QString moduleTitle( const QString& );
static QString moduleIcon( const QString& );
+ static QString moduleLibrary( const QString&, const bool = true );
static bool isModuleAccessible( const QString& );
virtual void createEmptyStudy();
virtual SUIT_Study* createNewStudy();
virtual void updateCommandsStatus();
+ virtual bool checkModule( const QString& );
virtual void moduleAdded( CAM_Module* );
virtual void beforeCloseDoc( SUIT_Study* );
virtual void afterCloseDoc();
virtual void setActiveStudy( SUIT_Study* );
- static QString moduleLibrary( const QString&, const bool = true );
-
virtual bool abortAllOperations();
private:
void readModuleList();
private:
- typedef struct { QString name, title, internal, icon; bool isSingleton; QString version; } ModuleInfo;
+ enum { stUnknown = 0, stNoGui, stInaccessible, stReady };
+ typedef struct {
+ QString name, title, icon, library, version;
+ bool isSingleton;
+ int status;
+ } ModuleInfo;
typedef QList<ModuleInfo> ModuleInfoList;
private:
#include <Standard_Type.hxx>
#include <string.h>
-OCCT_IMPLEMENT_STANDARD_RTTIEXT( CASCatch_Failure, Standard_Transient )
+IMPLEMENT_STANDARD_RTTIEXT(CASCatch_Failure, Standard_Transient)
#ifndef NO_CXX_EXCEPTION
static Handle(CASCatch_Failure) RaisedError;
#ifndef CASCATCH_FAILURE_HXX
#define CASCATCH_FAILURE_HXX
-#include <Basics_OCCTVersion.hxx>
-
#include <Standard_Transient.hxx>
#include <Standard_DefineHandle.hxx>
-DEFINE_STANDARD_HANDLE( CASCatch_Failure, Standard_Transient )
-
#include <Standard.hxx>
/*!
Standard_EXPORT virtual void Throw() const;public:
public:
-
- OCCT_DEFINE_STANDARD_RTTIEXT(CASCatch_Failure,Standard_Transient)
+ DEFINE_STANDARD_RTTIEXT(CASCatch_Failure, Standard_Transient)
private:
/*!\var myMessage
};
+DEFINE_STANDARD_HANDLE(CASCatch_Failure, Standard_Transient)
#endif // CASCATCH_FAILURE_HXX
#ifndef DDS_H
#define DDS_H
-#include <Basics_OCCTVersion.hxx>
-
#include <TCollection_AsciiString.hxx>
-
#include <NCollection_DefineDataMap.hxx>
#define UNIT_SYSTEM_SI "SI"
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, Standard_Transient)
/*!
\class DDS_DicGroup
\param name group name
*/
DDS_DicGroup::DDS_DicGroup( const TCollection_AsciiString& name )
-: MMgt_TShared(),
+: Standard_Transient(),
myName( name ),
myActiveSystem( UNIT_SYSTEM_SI )
{
#include "DDS_DicItem.h"
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <NCollection_List.hxx>
class LDOM_Element;
-DEFINE_STANDARD_HANDLE(DDS_DicGroup, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_DicGroup, Standard_Transient)
-class DDS_DicGroup : public MMgt_TShared
+class DDS_DicGroup : public Standard_Transient
{
public:
Standard_EXPORT DDS_DicGroup( const TCollection_AsciiString& );
friend class DDS_Dictionary;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(DDS_DicGroup,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(DDS_DicGroup, Standard_Transient)
};
typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(DDS_DicGroup)> DDS_IndexedDataMapOfDicGroups;
#include <UnitsAPI.hxx>
#include <Units_Dimensions.hxx>
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_DicItem, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_DicItem, Standard_Transient)
/*!
\class DDS_DicItem
#include "DDS.h"
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>
// optional : format, units,
// min value, max value, default value.
-class DDS_DicItem : public MMgt_TShared
+class DDS_DicItem : public Standard_Transient
{
public:
/*! Enum describes type of datum value */
friend class DDS_DicGroup;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(DDS_DicItem,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(DDS_DicItem, Standard_Transient)
};
-DEFINE_STANDARD_HANDLE(DDS_DicItem, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_DicItem, Standard_Transient)
typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(DDS_DicItem)> DDS_IndexedDataMapOfDicItems;
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, Standard_Transient)
Handle(DDS_Dictionary) DDS_Dictionary::myDictionary = Handle(DDS_Dictionary)();
Use Get() method instead.
*/
DDS_Dictionary::DDS_Dictionary()
-: MMgt_TShared()
+: Standard_Transient()
{
}
#include <LDOMString.hxx>
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
class LDOM_Element;
class TCollection_AsciiString;
-DEFINE_STANDARD_HANDLE(DDS_Dictionary, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_Dictionary, Standard_Transient)
-class DDS_Dictionary : public MMgt_TShared
+class DDS_Dictionary : public Standard_Transient
{
public:
Standard_EXPORT static Handle(DDS_Dictionary) Get();
static Handle(DDS_Dictionary) myDictionary;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(DDS_Dictionary,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(DDS_Dictionary, Standard_Transient)
};
#endif
#include "DDS_KeyWords.h"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, Standard_Transient)
/*!
\class DDS_KeyWords
Use Get() method instead.
*/
DDS_KeyWords::DDS_KeyWords()
-: MMgt_TShared()
+: Standard_Transient()
{
SetKeyWord( "D_URI", "dictionary" );
#include "DDS.h"
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
#include <NCollection_DataMap.hxx>
-DEFINE_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(DDS_KeyWords, Standard_Transient)
class TCollection_AsciiString;
-class DDS_KeyWords : public MMgt_TShared
+class DDS_KeyWords : public Standard_Transient
{
public:
Standard_EXPORT static Handle(DDS_KeyWords) Get();
KeyWordMap myKeyWord;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(DDS_KeyWords,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(DDS_KeyWords, Standard_Transient)
};
#endif
# --- resources ---
# uic files / to be processed by pyuic
-SET(_pyuic_files
+SET(_pyuic_FILES
SelectVarsDialog.ui
genericdialog.ui
mytestdialog.ui
# --- scripts ---
# scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
# scripts / static
SET(_other_SCRIPTS
selectvars.py
dockwidgets.py
)
+
SET(_bin_SCRIPTS
test_dockwidgets.py
)
${CMAKE_CURRENT_BINARY_DIR}/qtsalome.py
)
-# scripts / to install
-
-SET(_all_SCRIPTS ${_other_SCRIPTS} ${_pyuic_SCRIPTS})
-
# --- rules ---
SALOME_INSTALL_SCRIPTS("${_gen_SCRIPTS}" ${SALOME_INSTALL_PYTHON})
-SALOME_INSTALL_SCRIPTS("${_all_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui)
+SALOME_INSTALL_SCRIPTS("${_other_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui)
SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA})
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
//since the 'toolbar marker' is not unique, find index of first occurrence of the
//'toolbar marker' in the array and check that next string is name of the toolbar
+void LightAppCleanUpAppResources()
+{
+ if ( LightApp_Application::_prefs_ ) {
+ delete LightApp_Application::_prefs_;
+ LightApp_Application::_prefs_ = 0;
+ }
+}
+
namespace
{
int getToolbarMarkerIndex( QByteArray input, const QStringList& aFlags ) {
savePreferences();
delete mySelMgr;
delete myScreenHelper;
+ myPrefs = 0;
}
/*!Start application.*/
QStringList::Iterator it;
for ( it = modList.begin(); it != modList.end(); ++it )
{
- if ( !isLibExists( *it ) )
+ if ( !isModuleAccessible( *it ) )
continue;
QString modName = moduleName( *it );
- if ( !isModuleAccessible( *it ) )
- continue;
-
QString iconName;
if ( iconMap.contains( *it ) )
iconName = iconMap[*it];
if ( icon.isNull() )
{
icon = modIcon;
- INFOS ( "\n****************************************************************" << std::endl
- << "* Icon for " << (*it).toLatin1().constData()
- << " not found. Using the default one." << std::endl
- << "****************************************************************" << std::endl );
+ INFOS( std::endl <<
+ "****************************************************************" << std::endl <<
+ " Warning: icon for " << qPrintable(*it) << " is not found!" << std::endl <<
+ " Using the default icon." << std::endl <<
+ "****************************************************************" << std::endl);
}
-
icon = Qtx::scaleIcon( icon, iconSize );
moduleAction->insertModule( *it, icon );
resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ));
vm->setInteractionStyle( resMgr->integerValue( "3DViewer", "navigation_mode", vm->interactionStyle() ) );
vm->setProjectionType( resMgr->integerValue( "OCCViewer", "projection_mode", vm->projectionType() ) );
- #if OCC_VERSION_LARGE > 0x06090000
vm->setStereoType( resMgr->integerValue( "OCCViewer", "stereo_type", vm->stereoType() ) );
vm->setAnaglyphFilter( resMgr->integerValue( "OCCViewer", "anaglyph_filter", vm->anaglyphFilter() ) );
vm->setStereographicFocus( resMgr->integerValue( "OCCViewer", "focus_type", vm->stereographicFocusType() ),
vm->setReverseStereo( resMgr->booleanValue( "OCCViewer", "reverse_stereo", vm->isReverseStereo() ) );
vm->setVSync( resMgr->booleanValue( "OCCViewer", "enable_vsync", vm->isVSync() ) );
vm->setQuadBufferSupport( resMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", vm->isQuadBufferSupport() ) );
- #endif
vm->setZoomingStyle( resMgr->integerValue( "3DViewer", "zooming_mode", vm->zoomingStyle() ) );
vm->enablePreselection( resMgr->booleanValue( "OCCViewer", "enable_preselection", vm->isPreselectionEnabled() ) );
vm->enableSelection( resMgr->booleanValue( "OCCViewer", "enable_selection", vm->isSelectionEnabled() ) );
{
_prefs_ = new LightApp_Preferences( resourceMgr() );
that->createPreferences( _prefs_ );
+ qAddPostRoutine( LightAppCleanUpAppResources );
}
that->myPrefs = _prefs_;
for ( QStringList::const_iterator it = modNameList.begin(); it != modNameList.end(); ++it )
{
- if ( !app->isLibExists( *it ) || _prefs_->hasModule( *it ) )
+ if ( !app->isModuleAccessible( *it ) || _prefs_->hasModule( *it ) )
continue;
int modId = _prefs_->addPreference( *it );
anIndicesList << 0 << 1;
pref->setItemProperty( "strings", aValuesList, occProjMode );
pref->setItemProperty( "indexes", anIndicesList, occProjMode );
-#if OCC_VERSION_LARGE > 0x06090000
+
// .... -> Stereo group
int stereoGroup = pref->addPreference( tr( "PREF_GROUP_STEREO" ), occGroup);
pref->setItemProperty( "columns", 2, stereoGroup );
// .... -> Enable quad-buffer support
pref->addPreference( tr( "PREF_ENABLE_QUAD_BUFFER_SUPPORT" ), stereoGroup,
LightApp_Preferences::Bool, "OCCViewer", "enable_quad_buffer_support" );
-#endif
+
// ... "Background" group <<start>>
int bgGroup = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup );
// pref->setItemProperty( "columns", 2, bgGroup );
}
}
#endif
-#if OCC_VERSION_LARGE > 0x06090000
+
#ifndef DISABLE_OCCVIEWER
if ( sec == QString( "OCCViewer" ) && param == QString( "stereo_type" ) )
{
}
}
#endif
-#endif
+
if ( sec == QString( "3DViewer" ) && param == QString( "zooming_mode" ) )
{
int mode = resMgr->integerValue( "3DViewer", "zooming_mode", 0 );
moduleAction->removeModule( modName );
}
+bool LightApp_Application::checkModule( const QString& title )
+{
+ if ( title.isEmpty() )
+ return false;
+
+ QString library = moduleLibrary( title, true );
+ if ( library.isEmpty() )
+ return false;
+
+ QString name = moduleName( title );
+
+ bool isPyModule = library.contains( "SalomePyQtGUI" ) || library.contains( "SalomePyQtGUILight" );
+
+ QStringList paths;
+#if defined(WIN32)
+ paths = QString( ::getenv( "PATH" ) ).split( ";", QString::SkipEmptyParts );
+#elif defined(__APPLE__)
+ paths = QString( ::getenv( "DYLD_LIBRARY_PATH" ) ).split( ":", QString::SkipEmptyParts );
+#else
+ paths = QString( ::getenv( "LD_LIBRARY_PATH" ) ).split( ":", QString::SkipEmptyParts );
+#endif
+
+ bool isFound = false;
+ QStringList::const_iterator it;
+ for ( it = paths.begin(); it != paths.end() && !isFound; ++it )
+ {
+ isFound = QFileInfo( Qtx::addSlash( *it ) + library ).exists();
+ }
+
+ if ( !isFound )
+ {
+ INFOS( std::endl <<
+ "****************************************************************" << std::endl <<
+ " Warning: library " << qPrintable( library ) << " is not found!" << std::endl <<
+ " Module " << qPrintable( title ) << " will not be available in GUI mode!" << std::endl <<
+ "****************************************************************" << std::endl);
+ return false;
+ }
+
+ if ( isPyModule )
+ {
+ QString pyModule = QString( "%1GUI.py" ).arg( name );
+ paths = QString( ::getenv( "PYTHONPATH" ) ).split( ":", QString::SkipEmptyParts );
+
+ isFound = false;
+ for ( it = paths.begin(); it != paths.end() && !isFound; ++it )
+ {
+ isFound = QFileInfo( Qtx::addSlash( *it ) + pyModule ).exists();
+ }
+
+ if ( !isFound )
+ {
+ INFOS( std::endl <<
+ "****************************************************************" << std::endl <<
+ " Warning: Python module " << qPrintable( pyModule ) << " is not found!" << std::endl <<
+ " Module " << qPrintable( title ) << " will not be available in GUI mode!" << std::endl <<
+ "****************************************************************" << std::endl);
+ return false;
+ }
+ }
+
+ return true;
+}
+
/*!
Gets current windows.
\param winMap - output current windows map.
wgStack->stack();
}
-/*!
- \return if the library of module exists
- \param moduleTitle - title of module
-*/
-bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
-{
- if( moduleTitle.isEmpty() )
- return false;
-
- QString lib = moduleLibrary( moduleTitle );
-
- //abd: changed libSalomePyQtGUI to SalomePyQtGUI for WIN32
- bool isPythonModule = lib.contains("SalomePyQtGUI");
- bool isPythonLightModule = lib.contains("SalomePyQtGUILight");
-
- QStringList paths;
-#if defined(WIN32)
- paths = QString(::getenv( "PATH" )).split( ";", QString::SkipEmptyParts );
-#elif defined(__APPLE__)
- paths = QString(::getenv( "DYLD_LIBRARY_PATH" )).split( ":", QString::SkipEmptyParts );
-#else
- paths = QString(::getenv( "LD_LIBRARY_PATH" )).split( ":", QString::SkipEmptyParts );
-#endif
-
- bool isLibFound = false;
- QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
- for( ; anIt!=aLast; anIt++ )
- {
- QFileInfo inf( Qtx::addSlash( *anIt ) + lib );
-
- if( inf.exists() )
- {
- isLibFound = true;
- break;
- }
- }
-
- if ( !isLibFound )
- {
- INFOS( "\n****************************************************************" << std::endl
- << "* Warning: library " << lib.toLatin1().constData() << " cannot be found" << std::endl
- << "* Module " << moduleTitle.toLatin1().constData() << " will not be available in GUI mode" << std::endl
- << "****************************************************************" << std::endl );
- }
- else if ( !isPythonModule && !isPythonLightModule)
- return true;
-
- if ( isPythonModule || isPythonLightModule)
- {
- QString pylib = moduleName( moduleTitle ) + QString(".py");
- QString pylibgui = moduleName( moduleTitle ) + QString("GUI.py");
-
- // Check the python library
-// #ifdef WIN32
-// paths = QString(::getenv( "PATH" )).split( ";", QString::SkipEmptyParts );
-// #else
- paths = QString(::getenv( "PYTHONPATH" )).split( ":", QString::SkipEmptyParts );
-// #endif
- bool isPyLib = false, isPyGuiLib = false;
- QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
- for( ; anIt!=aLast; anIt++ )
- {
- QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
- QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
-
- if(!isPythonLightModule)
- if( !isPyLib && inf.exists() )
- isPyLib = true;
-
- if( !isPyGuiLib && infgui.exists() )
- isPyGuiLib = true;
-
- if ((isPyLib || isPythonLightModule ) && isPyGuiLib && isLibFound)
- return true;
- }
-
- printf( "\n****************************************************************\n" );
- printf( "* Warning: python library for %s cannot be found:\n", moduleTitle.toLatin1().constData() );
- if (!isPyLib)
- printf( "* No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
- if (!isPyGuiLib)
- printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
- printf( "****************************************************************\n" );
- return true;
- }
- return false;
-}
-
/*!
\return default name for an active study
*/
void updateModuleActions();
void removeModuleAction( const QString& );
+ bool checkModule( const QString& );
+
void loadDockWindowsState();
void saveDockWindowsState();
void currentViewManagers( QStringList& ) const;
void moduleIconNames( QMap<QString, QString>& ) const;
- bool isLibExists( const QString& ) const;
-
QDockWidget* windowDock( QWidget* ) const;
QByteArray dockWindowsState( const QMap<QString, bool>&, const QMap<QString, bool>& ) const;
void dockWindowsState( const QByteArray&, QMap<QString, bool>&, QMap<QString, bool>& ) const;
static int lastStudyId;
QStringList myUserWmTypes;
+
+ friend void LightAppCleanUpAppResources();
};
#ifdef WIN32
</message>
<message>
<source>PREF_GROUP_PY_EDITOR</source>
- <translation type="unfinished">Editor settings</translation>
+ <translation>Paramètres de l'éditeur</translation>
</message>
<message>
<source>PREF_PY_COMPLETION_MODE</source>
- <translation type="unfinished">Completion mode</translation>
+ <translation>Mode de complétion</translation>
</message>
<message>
<source>PREF_PY_NONE</source>
- <translation type="unfinished">None</translation>
+ <translation>Aucun</translation>
</message>
<message>
<source>PREF_PY_AUTO</source>
- <translation type="unfinished">Auto</translation>
+ <translation>Auto</translation>
</message>
<message>
<source>PREF_PY_MANUAL</source>
- <translation type="unfinished">Manual</translation>
+ <translation>Manuel</translation>
</message>
<message>
<source>PREF_PY_ALWAYS</source>
- <translation type="unfinished">Always</translation>
+ <translation>Toujours</translation>
</message>
<message>
<source>PREF_GROUP_PY_TAB</source>
<translation>ライン数エリアの表示</translation>
</message>
<message>
- <source>PREF_GROUP_PY_EDITOR</source>
- <translation type="unfinished">Editor settings</translation>
+ <source>PREF_GROUP_PY_EDITOR</source>
+ <translation>エディタ設定</translation>
</message>
<message>
- <source>PREF_PY_COMPLETION_MODE</source>
- <translation type="unfinished">Completion mode</translation>
+ <source>PREF_PY_COMPLETION_MODE</source>
+ <translation>完了モード</translation>
</message>
<message>
- <source>PREF_PY_NONE</source>
- <translation type="unfinished">None</translation>
+ <source>PREF_PY_NONE</source>
+ <translation>なし</translation>
</message>
<message>
- <source>PREF_PY_AUTO</source>
- <translation type="unfinished">Auto</translation>
+ <source>PREF_PY_AUTO</source>
+ <translation>自動</translation>
</message>
<message>
- <source>PREF_PY_MANUAL</source>
- <translation type="unfinished">Manual</translation>
+ <source>PREF_PY_MANUAL</source>
+ <translation>手動</translation>
</message>
<message>
- <source>PREF_PY_ALWAYS</source>
- <translation type="unfinished">Always</translation>
+ <source>PREF_PY_ALWAYS</source>
+ <translation>常に</translation>
</message>
<message>
<source>PREF_GROUP_PY_TAB</source>
#include "SALOME_AISObject.hxx"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISObject, AIS_InteractiveObject)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISObject, AIS_InteractiveObject)
SALOME_AISObject::SALOME_AISObject()
{
Standard_EXPORT virtual void setName(const Standard_CString aName) = 0;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_AISObject,AIS_InteractiveObject)
+ DEFINE_STANDARD_RTTIEXT(SALOME_AISObject, AIS_InteractiveObject)
};
DEFINE_STANDARD_HANDLE(SALOME_AISObject, AIS_InteractiveObject)
#include "SALOME_AISShape.hxx"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISShape, ViewerData_AISShape)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_AISShape, ViewerData_AISShape)
/*!
Constructor
Standard_EXPORT virtual void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight ) = 0;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_AISShape,ViewerData_AISShape)
+ DEFINE_STANDARD_RTTIEXT(SALOME_AISShape, ViewerData_AISShape)
};
DEFINE_STANDARD_HANDLE(SALOME_AISShape, ViewerData_AISShape)
#include "SALOME_Filter.hxx"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_Filter, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_Filter, Standard_Transient)
SALOME_Filter::SALOME_Filter()
{
#ifndef SALOME_FILTER_HXX
#define SALOME_FILTER_HXX
-#include <MMgt_TShared.hxx>
#include <Standard.hxx>
+#include <Standard_Transient.hxx>
#include <Standard_DefineHandle.hxx>
#include "SALOME_InteractiveObject.hxx"
-class SALOME_Filter : public MMgt_TShared
+class SALOME_Filter : public Standard_Transient
{
public:
Standard_EXPORT SALOME_Filter();
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SALOME_InteractiveObject)& anObj) const = 0;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_Filter,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(SALOME_Filter, Standard_Transient)
};
-DEFINE_STANDARD_HANDLE(SALOME_Filter, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(SALOME_Filter, Standard_Transient)
#endif // SALOME_FILTER_HXX
#include "SALOME_InteractiveObject.hxx"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_InteractiveObject, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_InteractiveObject, Standard_Transient)
/*!
Default constructor
#ifndef SALOME_INTERACTIVEOBJECT_HXX
#define SALOME_INTERACTIVEOBJECT_HXX
-#include <MMgt_TShared.hxx>
#include <Standard.hxx>
+#include <Standard_Transient.hxx>
#include <Standard_DefineHandle.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include <string>
class SALOME_InteractiveObject;
-DEFINE_STANDARD_HANDLE(SALOME_InteractiveObject, MMgt_TShared)
+DEFINE_STANDARD_HANDLE(SALOME_InteractiveObject, Standard_Transient)
-class SALOME_InteractiveObject : public MMgt_TShared
+class SALOME_InteractiveObject : public Standard_Transient
{
public:
Standard_EXPORT SALOME_InteractiveObject();
std::string myReference;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_InteractiveObject,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(SALOME_InteractiveObject, Standard_Transient)
};
#endif // SALOME_INTERACTIVEOBJECT_HXX
#include "SALOME_TypeFilter.hxx"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(SALOME_TypeFilter, SALOME_Filter)
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_TypeFilter, SALOME_Filter)
/*!
Constructor
Standard_CString myKind;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(SALOME_TypeFilter,SALOME_Filter)
+ DEFINE_STANDARD_RTTIEXT(SALOME_TypeFilter, SALOME_Filter)
};
DEFINE_STANDARD_HANDLE(SALOME_TypeFilter, SALOME_Filter)
#include "OCCViewer_AISSelector.h"
-#include <Basics_OCCTVersion.hxx>
-
/*!
Constructor
*/
{
myHilightColor = color;
if ( !myAISContext.IsNull() ) {
-#if OCC_VERSION_LARGE > 0x07000000
const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle();
hStyle->SetColor( myHilightColor );
-#else
- myAISContext->SetHilightColor( myHilightColor );
-#endif
}
}
{
mySelectColor = color;
if ( !myAISContext.IsNull() ) {
-#if OCC_VERSION_LARGE > 0x07000000
const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
sStyle->SetColor( mySelectColor );
-#else
- myAISContext->SelectionColor( mySelectColor );
-#endif
}
}
{
myAISContext = aisContext;
if ( ! myAISContext.IsNull() ) {
-#if OCC_VERSION_LARGE > 0x07000000
const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle();
const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
hStyle->SetColor( myHilightColor );
sStyle->SetColor( mySelectColor );
-#else
- myAISContext->SetHilightColor( myHilightColor );
- myAISContext->SelectionColor( mySelectColor );
-#endif
myAISContext->SetSubIntensityColor( Quantity_NOC_CYAN1 );
}
}
gp_Pnt aPickPoint = aFindPick.Point( 1 );
- const gp_Dir& aPlaneN = aPlanePln.Axis().Direction();
- const gp_Dir& aPlaneX = aPlanePln.XAxis().Direction();
- const gp_Dir& aPlaneY = aPlanePln.YAxis().Direction();
- const gp_Pnt& aPlaneCenter = aPlanePln.Location();
+ gp_Dir aPlaneN = aPlanePln.Axis().Direction();
+ gp_Dir aPlaneX = aPlanePln.XAxis().Direction();
+ gp_Dir aPlaneY = aPlanePln.YAxis().Direction();
+ gp_Pnt aPlaneCenter = aPlanePln.Location();
switch ( theDragOp )
{
myInteractedPlane = NULL;
myIsDraggable = false;
myIsClickable = false;
+ myViewer->getAISContext()->ClearSelected( Standard_True );
return true;
}
#include "OCCViewer_ViewManager.h"
#include "OCCViewer_ClipPlaneInteractor.h"
-#include <Basics_OCCTVersion.hxx>
-
#include <V3d_View.hxx>
#include <Geom_Plane.hxx>
#include <Prs3d_Presentation.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
-#if OCC_VERSION_LARGE > 0x06080000
- #include <Prs3d_Drawer.hxx>
-#else
- #include <AIS_Drawer.hxx>
-#endif
+#include <Prs3d_Drawer.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
if ( !aPrs->IsEmpty() && !aPrs->IsInfinite() ) {
isFound = true;
double xmin, ymin, zmin, xmax, ymax, zmax;
-#if OCC_VERSION_LARGE > 0x06070100
Bnd_Box aBox = aPrs->MinMaxValues();
xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
xmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X();
ymax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y();
zmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z();
-#else
- aPrs->MinMaxValues( xmin, ymin, zmin, xmax, ymax, zmax );
-#endif
aXMin = qMin( aXMin, xmin ); aXMax = qMax( aXMax, xmax );
aYMin = qMin( aYMin, ymin ); aYMax = qMax( aYMax, ymax );
aZMin = qMin( aZMin, zmin ); aZMax = qMax( aZMax, zmax );
OCCViewer_ViewManager* aViewMgr = (OCCViewer_ViewManager*) myModel->getViewManager();
myInteractor = new OCCViewer_ClipPlaneInteractor( aViewMgr, this );
- connect( myInteractor, SIGNAL( planeClicked( const Handle(AIS_Plane)& ) ), SLOT( onPlaneClicked( const Handle(AIS_Plane)& ) ) );
- connect( myInteractor, SIGNAL( planeDragged( const Handle(AIS_Plane)& ) ), SLOT( onPlaneDragged( const Handle(AIS_Plane)& ) ) );
+ connect( myInteractor, SIGNAL( planeClicked( const Handle_AIS_Plane& ) ),
+ SLOT( onPlaneClicked( const Handle_AIS_Plane& ) ) );
+ connect( myInteractor, SIGNAL( planeDragged( const Handle_AIS_Plane& ) ),
+ SLOT( onPlaneDragged( const Handle_AIS_Plane& ) ) );
myLocalPlanes = myModel->getClipPlanes();
synchronize();
Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
aView3d->SetScale( myCurrentItem.scale );
-#if OCC_VERSION_LARGE <= 0x06070100
- aView3d->SetCenter( myCurrentItem.centerX, myCurrentItem.centerY );
-#endif
aView3d->SetProj( myCurrentItem.projX, myCurrentItem.projY, myCurrentItem.projZ );
aView3d->SetTwist( myCurrentItem.twist );
aView3d->SetAt( myCurrentItem.atX, myCurrentItem.atY, myCurrentItem.atZ );
#include "QtxAction.h"
#include "QtxIntSpinBox.h"
-#include <Basics_OCCTVersion.hxx>
-
-#if OCC_VERSION_LARGE > 0x06080000
#include <Graphic3d_GraduatedTrihedron.hxx>
-#endif
#include <QCheckBox>
#include <QGroupBox>
// font support will be introduced in OCC-6.4)
int aGap = 20;
-#if OCC_VERSION_LARGE > 0x06080000
Graphic3d_GraduatedTrihedron gt;
// main params
gt.SetDrawGrid(Standard_True); // to draw grid
}
// draw trihedron
theView->GraduatedTrihedronDisplay(gt);
-#else
- theView->GraduatedTrihedronDisplay(
- anAxisData[0].Name.toLatin1().constData(),
- anAxisData[1].Name.toLatin1().constData(),
- anAxisData[2].Name.toLatin1().constData(),
- anAxisData[0].DrawName,
- anAxisData[1].DrawName,
- anAxisData[2].DrawName,
- anAxisData[0].DrawValues,
- anAxisData[1].DrawValues,
- anAxisData[2].DrawValues,
- Standard_True, // draw grid
- Standard_False, // draw axes
- anAxisData[0].NbValues - 1,
- anAxisData[1].NbValues - 1,
- anAxisData[2].NbValues - 1,
- anAxisData[0].Offset,
- anAxisData[1].Offset,
- anAxisData[2].Offset,
- anAxisData[0].Offset + aGap, // see above
- anAxisData[1].Offset + aGap, // see above
- anAxisData[2].Offset + aGap, // see above
- anAxisData[0].DrawTickmarks,
- anAxisData[1].DrawTickmarks,
- anAxisData[2].DrawTickmarks,
- anAxisData[0].TickmarkLength,
- anAxisData[1].TickmarkLength,
- anAxisData[2].TickmarkLength,
- Quantity_NOC_WHITE, // grid color
- Quantity_Color( anAxisData[0].NameColor.redF(),
- anAxisData[0].NameColor.greenF(),
- anAxisData[0].NameColor.blueF(),
- Quantity_TOC_RGB ),
- Quantity_Color( anAxisData[1].NameColor.redF(),
- anAxisData[1].NameColor.greenF(),
- anAxisData[1].NameColor.blueF(),
- Quantity_TOC_RGB ),
- Quantity_Color( anAxisData[2].NameColor.redF(),
- anAxisData[2].NameColor.greenF(),
- anAxisData[2].NameColor.blueF(),
- Quantity_TOC_RGB ),
- Quantity_Color( anAxisData[0].Color.redF(),
- anAxisData[0].Color.greenF(),
- anAxisData[0].Color.blueF(),
- Quantity_TOC_RGB ),
- Quantity_Color( anAxisData[1].Color.redF(),
- anAxisData[1].Color.greenF(),
- anAxisData[1].Color.blueF(),
- Quantity_TOC_RGB ),
- Quantity_Color( anAxisData[2].Color.redF(),
- anAxisData[2].Color.greenF(),
- anAxisData[2].Color.blueF(),
- Quantity_TOC_RGB ) );
-#endif // OCC_VERSION_LARGE > 0x06080000
}
else
theView->GraduatedTrihedronErase();
onTextureChanged();
else {
Handle(Graphic3d_TextureEnv) aTexture;
-#if OCC_VERSION_LARGE > 0x07000000
setEnvTexture( aTexture );
-#else
- setEnvTexture( aTexture, V3d_TEX_ALL );
-#endif
}
}
<< Graphic3d_NOT_ENV_LINES << Graphic3d_NOT_ENV_ROAD;
aTexture = new Graphic3d_TextureEnv( aTextures.at( myEnvTextureId->currentIndex() ) );
}
-#if OCC_VERSION_LARGE > 0x07000000
setEnvTexture( aTexture );
-#else
- setEnvTexture( aTexture, V3d_TEX_ENVIRONMENT );
-#endif
}
/*!
/*!
Sets current texture environment for all view in the viewer
*/
-#if OCC_VERSION_LARGE > 0x07000000
void OCCViewer_EnvTextureDlg::setEnvTexture( Handle(Graphic3d_TextureEnv) theTexture)
-#else
-void OCCViewer_EnvTextureDlg::setEnvTexture( Handle(Graphic3d_TextureEnv) theTexture, V3d_TypeOfSurfaceDetail theMode )
-#endif
{
for ( int i = OCCViewer_ViewFrame::BOTTOM_RIGHT; i <= OCCViewer_ViewFrame::TOP_RIGHT; i++ ) {
if ( OCCViewer_ViewWindow* aViewWindow = myViewFrame->getView(i) ) {
Handle(V3d_View) aView = aViewWindow->getViewPort()->getView();
aView->SetTextureEnv( theTexture );
-#if OCC_VERSION_LARGE <= 0x07000000
- aView->SetSurfaceDetail( theMode );
-#endif
aView->Redraw();
}
}
#include "OCCViewer.h"
#include <QDialog>
#include <V3d_View.hxx>
-#include <Basics_OCCTVersion.hxx>
class OCCViewer_ViewWindow;
class OCCViewer_ViewFrame;
private:
void initParam();
-#if OCC_VERSION_LARGE > 0x07000000
void setEnvTexture( Handle(Graphic3d_TextureEnv) );
-#else
- void setEnvTexture( Handle(Graphic3d_TextureEnv), V3d_TypeOfSurfaceDetail );
-#endif
OCCViewer_ViewFrame* myViewFrame;
Handle(V3d_View) myView3d;
#define PI 3.14159265359
-OCCT_IMPLEMENT_STANDARD_RTTIEXT( OCCViewer_Trihedron, AIS_InteractiveObject )
+IMPLEMENT_STANDARD_RTTIEXT( OCCViewer_Trihedron, AIS_InteractiveObject )
/*!
* Constructor
/*!
* Sets the bounding box (MinMax values).
*/
-#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
void OCCViewer_Trihedron::bounds( Graphic3d_BndBox4f& theMinMax ) const
{
Graphic3d_Vec4 aMinPt (-1.f, -1.f, -1.f, 1.f);
theMinMax.Add (aMinPt);
theMinMax.Add (aMaxPt);
}
-#else
-void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
-{
- Standard_Real aXMin = -1, aYMin = -1, aZMin = -1;
- Standard_Real aXMax = 1, aYMax = 1, aZMax = 1;
-
- if( aMinMax.XMin > aXMin ) aMinMax.XMin = aXMin;
- if( aMinMax.YMin > aYMin ) aMinMax.YMin = aYMin;
- if( aMinMax.ZMin > aZMin ) aMinMax.ZMin = aZMin;
- if( aMinMax.XMax < aXMax ) aMinMax.XMax = aXMax;
- if( aMinMax.YMax < aYMax ) aMinMax.YMax = aYMax;
- if( aMinMax.ZMax < aZMax ) aMinMax.ZMax = aZMax;
-}
-#endif
/*!
* Redefined method. Calculates the object presentation.
#include "OCCViewer.h"
#include <AIS_InteractiveObject.hxx>
-#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
- #include <Graphic3d_BndBox4f.hxx>
-#else
- #include <Graphic3d_CBounds.hxx>
-#endif
+#include <Graphic3d_BndBox4f.hxx>
#include <Standard_DefineHandle.hxx>
/*!
virtual void ComputeSelection( const Handle( SelectMgr_Selection )&,
const Standard_Integer );
-#if OCC_VERSION_LARGE > 0x06070100
virtual void bounds( Graphic3d_BndBox4f& ) const;
-#else
- virtual void bounds( Graphic3d_CBounds& ) const;
-#endif
virtual void display();
- OCCT_DEFINE_STANDARD_RTTIEXT(OCCViewer_Trihedron,AIS_InteractiveObject)
+ DEFINE_STANDARD_RTTIEXT(OCCViewer_Trihedron, AIS_InteractiveObject)
private:
unsigned int myTextList;
};
-DEFINE_STANDARD_HANDLE( OCCViewer_Trihedron, AIS_InteractiveObject )
+DEFINE_STANDARD_HANDLE(OCCViewer_Trihedron, AIS_InteractiveObject)
-#endif
+#endif // OCCVIEWER_TRIHEDRON_H
#include "QtxActionToolMgr.h"
#include "QtxMultiAction.h"
-// KERNEL includes
-#include <Basics_OCCTVersion.hxx>
-
// OCC includes
#include <V3d_View.hxx>
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
-#if OCC_VERSION_LARGE < 0x07000000
-#include <Visual3d_View.hxx>
-#endif
// QT includes
#include <QImage>
const uchar* aImageBytes = anImage.bits();
for ( int aLine = anImage.height() - 1; aLine >= 0; --aLine ) {
-#if OCC_VERSION_LARGE > 0x06070100
// convert pixels from ARGB to renderer-compatible RGBA
for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
Image_ColorBGRA& aPixmapBytes = aPixmap->ChangeValue<Image_ColorBGRA>(aLine, aByte);
aPixmapBytes.r() = (Standard_Byte) *aImageBytes++;
aPixmapBytes.a() = (Standard_Byte) *aImageBytes++;
}
-#else
- Image_ColorBGRA* aPixmapBytes = aPixmap->EditData<Image_ColorBGRA>().ChangeRow(aLine);
-
- // convert pixels from ARGB to renderer-compatible RGBA
- for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
- aPixmapBytes->b() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes->g() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes->r() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes->a() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes++;
- }
-#endif
}
}
return aPixmap;
aStructure->IsInfinite() || aStructure->CStructure()->IsForHighlight )
continue;
double aBounds[6];
-#if OCC_VERSION_LARGE > 0x06070100
Bnd_Box aBox = aStructure->MinMaxValues();
aBounds[0] = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
aBounds[2] = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
aBounds[1] = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X();
aBounds[3] = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y();
aBounds[5] = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z();
-#else
- aStructure->MinMaxValues( aBounds[0], aBounds[2], aBounds[4],
- aBounds[1], aBounds[3], aBounds[5] );
-#endif
if ( aBounds[0] > -DBL_MAX && aBounds[1] < DBL_MAX &&
aBounds[2] > -DBL_MAX && aBounds[3] < DBL_MAX &&
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
-#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
#include <OpenGl_GraphicDriver.hxx>
-#else
-#include <Graphic3d.hxx>
-#include <Graphic3d_GraphicDriver.hxx>
-#endif
#include <Aspect_DisplayConnection.hxx>
#if defined(WIN32)
const Standard_Boolean computedMode,
const Standard_Boolean defaultComputedMode )
{
-#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
static Handle(OpenGl_GraphicDriver) aGraphicDriver;
-#else
- static Handle(Graphic3d_GraphicDriver) aGraphicDriver;
-#endif
if (aGraphicDriver.IsNull())
{
Handle(Aspect_DisplayConnection) aDisplayConnection;
#else
aDisplayConnection = new Aspect_DisplayConnection();
#endif
-#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
-#else
- aGraphicDriver = Graphic3d::InitGraphicDriver( aDisplayConnection );
-#endif
}
-#if OCC_VERSION_LARGE > 0x07010001
return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD,
computedMode, defaultComputedMode );
-
-#elif OCC_VERSION_LARGE > 0x07000000
- return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
- Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
- computedMode, defaultComputedMode );
-#else
- return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
- Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
- computedMode, defaultComputedMode, V3d_TEX_NONE );
-#endif
}
// set environment texture parameters
aView->SetTextureEnv( aMainView->TextureEnv() );
-#if OCC_VERSION_LARGE <= 0x07000000
- aView->SetSurfaceDetail( aMainView->SurfaceDetail() );
-#endif
}
void OCCViewer_ViewFrame::splitSubViews()
#include "ViewerData_AISShape.hxx"
-#include <Basics_OCCTVersion.hxx>
-
#include "QtxActionToolMgr.h"
#include "QtxBackgroundTool.h"
#include <QDesktopWidget>
#include <AIS_Axis.hxx>
-#if OCC_VERSION_LARGE > 0x06080000
- #include <Prs3d_Drawer.hxx>
-#else
- #include <AIS_Drawer.hxx>
-#endif
+#include <Prs3d_Drawer.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <V3d_DirectionalLight.hxx>
#include <V3d_AmbientLight.hxx>
-#if OCC_VERSION_MAJOR < 7
- #include <Visual3d_View.hxx>
-#endif
-
/*!
Get data for supported background modes: gradient types, identifiers and supported image formats
*/
// init selector
myAISContext = new AIS_InteractiveContext( myV3dViewer );
-#if OCC_VERSION_LARGE > 0x07010100
myAISContext->HighlightStyle(Prs3d_TypeOfHighlight_LocalSelected)->SetColor( Quantity_NOC_WHITE );
myAISContext->HighlightStyle(Prs3d_TypeOfHighlight_Selected)->SetColor( Quantity_NOC_WHITE );
-#elif OCC_VERSION_LARGE > 0x07000000
- const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
- sStyle->SetColor( Quantity_NOC_WHITE );
-#else
- myAISContext->SelectionColor( Quantity_NOC_WHITE );
-#endif
// display isoline on planar faces (box for ex.)
myAISContext->IsoOnPlane( true );
+
+ // create color scale
+ myColorScale = new AIS_ColorScale();
+ myColorScale->SetZLayer( Graphic3d_ZLayerId_TopOSD );
+ myColorScale->SetTransformPersistence( Graphic3d_TransformPers::FromDeprecatedParams( Graphic3d_TMF_2d, gp_Pnt(-1, -1, 0) ) );
/* create trihedron */
if ( DisplayTrihedron )
//myTrihedron->SetColor( Col );
myTrihedron->SetArrowColor( Col.Name() );
myTrihedron->SetSize(100);
-#if OCC_VERSION_LARGE > 0x06080000
- Handle(Prs3d_Drawer) drawer = myTrihedron->Attributes();
- if (drawer->HasOwnDatumAspect()) {
-#else
- Handle(AIS_Drawer) drawer = myTrihedron->Attributes();
- if (drawer->HasDatumAspect()) {
-#endif
+ Handle(Prs3d_Drawer) drawer = myTrihedron->Attributes();
+ if (drawer->HasOwnDatumAspect()) {
Handle(Prs3d_DatumAspect) daspect = drawer->DatumAspect();
daspect->FirstAxisAspect()->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB));
daspect->SecondAxisAspect()->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB));
OCCViewer_ViewPort3d* vp3d = view->getViewPort();
if ( vp3d )
{
-#if OCC_VERSION_LARGE <= 0x07000000
- vp3d->getView()->SetSurfaceDetail(V3d_TEX_ALL);
-#endif
// connect signal from viewport
connect(vp3d, SIGNAL(vpClosed(OCCViewer_ViewPort3d*)), this, SLOT(onViewClosed(OCCViewer_ViewPort3d*)));
connect(vp3d, SIGNAL(vpMapped(OCCViewer_ViewPort3d*)), this, SLOT(onViewMapped(OCCViewer_ViewPort3d*)));
myV3dViewer->Update();
}
+bool OCCViewer_Viewer::isColorScaleVisible() const
+{
+ return !myColorScale.IsNull() && !myAISContext.IsNull() && myAISContext->IsDisplayed( myColorScale );
+}
+
+void OCCViewer_Viewer::setColorScaleShown( const bool on )
+{
+ if ( myColorScale.IsNull() )
+ return;
+ if ( on )
+ {
+ if ( !myAISContext->IsDisplayed( myColorScale ) )
+ myAISContext->Display( myColorScale, Standard_True );
+ myAISContext->Redisplay( myColorScale, Standard_True, Standard_True );
+ }
+ else
+ {
+ if ( myAISContext->IsDisplayed( myColorScale ) )
+ myAISContext->Erase( myColorScale, Standard_True );
+ }
+}
+
/*!
Changes visibility of trihedron to opposite
*/
double aMaxSide = 0;
double Xmin = 0, Ymin = 0, Zmin = 0, Xmax = 0, Ymax = 0, Zmax = 0;
-#if OCC_VERSION_LARGE > 0x06070100
Bnd_Box aBox = view3d->View()->MinMaxValues();
Xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
Ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
Xmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X();
Ymax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y();
Zmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z();
-#else
- view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
-#endif
if ( Xmin != RealFirst() && Ymin != RealFirst() && Zmin != RealFirst() &&
Xmax != RealLast() && Ymax != RealLast() && Zmax != RealLast() )
#include "SUIT_ViewModel.h"
#include <V3d_View.hxx>
+#include <AIS_ColorScale.hxx>
#include <AIS_Trihedron.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_ListOfInteractive.hxx>
Qtx::BackgroundData background(int theViewId) const;
void setBackground( int theViewId, const Qtx::BackgroundData& );
+ bool isColorScaleVisible() const;
+ virtual void setColorScaleShown( const bool );
+
//! returns true if 3d Trihedron in viewer was created
bool trihedronActivated() const { return !myTrihedron.IsNull(); }
public:
Handle(V3d_Viewer) getViewer3d() const { return myV3dViewer;}
Handle(AIS_InteractiveContext) getAISContext() const { return myAISContext; }
+ Handle(AIS_ColorScale) getColorScale() const { return myColorScale; }
Handle(AIS_Trihedron) getTrihedron() const { return myTrihedron; }
int getTopLayerId();
protected:
Handle(V3d_Viewer) myV3dViewer;
-
+ Handle(AIS_ColorScale) myColorScale;
Handle(AIS_Trihedron) myTrihedron;
Handle(AIS_InteractiveContext) myAISContext;
setBackgroundRole( QPalette::NoRole );//NoBackground );
// set focus policy to threat QContextMenuEvent from keyboard
setFocusPolicy( Qt::StrongFocus );
-#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0) && OCC_VERSION_LARGE < 0x07000000) || QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
setAttribute( Qt::WA_PaintOnScreen );
-#endif
setAttribute( Qt::WA_NoSystemBackground );
}
#include <QApplication>
#include <QTimer>
-#if OCC_VERSION_MAJOR < 7
- #include <Visual3d_View.hxx>
-#endif
-
-#if OCC_VERSION_LARGE > 0x06070100
#include <V3d_View.hxx>
-#else
-#include <V3d_PerspectiveView.hxx>
-#include <V3d_OrthographicView.hxx>
-#endif
+#include <Quantity_Ratio.hxx>
#include "utilities.h"
// VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
//selectVisualId();
-#if OCC_VERSION_LARGE > 0x06070100
myActiveView = new V3d_View( viewer, type );
-#else
- if ( type == V3d_ORTHOGRAPHIC ) {
- myOrthoView = new V3d_OrthographicView( viewer );
- myActiveView = myOrthoView;
- myPerspView = 0;
- } else {
- myPerspView = new V3d_PerspectiveView( viewer );
- myActiveView = myPerspView;
- }
-#endif
setDefaultParams();
refView->Up( x, y, z ); tgtView->SetUp( x, y, z );
refView->Eye( x, y, z ); tgtView->SetEye( x, y, z );
refView->Proj( x, y, z ); tgtView->SetProj( x, y, z );
-#if OCC_VERSION_LARGE <= 0x06070100
- refView->Center( x, y ); tgtView->SetCenter( x, y );
-#endif
tgtView->SetScale( refView->Scale() );
tgtView->SetTwist( refView->Twist() );
/* update */
tgtView->Update();
tgtView->SetImmediateUpdate( Standard_True );
-#if OCC_VERSION_LARGE <= 0x07000000
- tgtView->ZFitAll();
-#endif
- return true;
-}
-#if OCC_VERSION_LARGE <= 0x07000000
-/*!
- Returns Z-size of this view. [ public ]
-*/
-double OCCViewer_ViewPort3d::getZSize() const
-{
- if ( !activeView().IsNull() )
- return activeView()->ZSize();
- return 0;
+ return true;
}
-/*!
- Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
-*/
-void OCCViewer_ViewPort3d::setZSize( double zsize )
-{
- myActiveView->SetZSize( zsize );
- /* if ( !myOrthoView.IsNull() )
- myOrthoView->SetZSize( zsize );
- if ( !myPerspView.IsNull() )
- myPerspView->SetZSize( zsize );*/
-}
-#endif
/*!
Get axial scale to the view
void OCCViewer_ViewPort3d::endRotation()
{
if ( !activeView().IsNull() ) {
-#if OCC_VERSION_LARGE <= 0x07000000
- activeView()->ZFitAll( 1.0 );
- activeView()->SetZSize( 0.0 );
-#endif
activeView()->Update();
emit vpTransformed( this );
}
QApplication::syncX();
#endif
if ( !myPaintersRedrawing ) {
-#if OCC_VERSION_MAJOR < 7
- QRect rc = e->rect();
- activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
-#else
activeView()->Redraw();
-#endif
}
}
OCCViewer_ViewPort::paintEvent( e );
Standard_Real margin = 0.01;
-#if OCC_VERSION_LARGE > 0x06070100
activeView()->FitAll( margin, upd );
-#if OCC_VERSION_LARGE <= 0x07000000
- if(withZ)
- activeView()->ZFitAll();
-#endif
-#else
- activeView()->FitAll( margin, withZ, upd );
- activeView()->SetZSize(0.);
-#endif
+
emit vpTransformed( this );
}
Handle(V3d_View) aView3d = getView();
Handle(V3d_View) aRefView3d = vp3d->getView();
aView3d->SetImmediateUpdate( Standard_False );
-#if OCC_VERSION_LARGE > 0x06070100
aView3d->Camera()->Copy( aRefView3d->Camera() );
-#else
- aView3d->SetViewMapping( aRefView3d->ViewMapping() );
- aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
-#endif
-#if OCC_VERSION_LARGE <= 0x07000000
- aView3d->ZFitAll();
-#endif
aView3d->SetImmediateUpdate( Standard_True );
aView3d->Update();
blockSignals( blocked );
#ifndef OCCVIEWER_VIEWPORT3D_H
#define OCCVIEWER_VIEWPORT3D_H
-#include <Basics_OCCTVersion.hxx>
-
#include "OCCViewer_ViewPort.h"
#include "Qtx.h"
// void setActive( V3d_TypeOfView );
virtual bool syncronize( const OCCViewer_ViewPort3d* );
-#if OCC_VERSION_LARGE <= 0x07000000
- double getZSize() const;
- void setZSize( double );
-#endif
-
void getAxialScale( double&, double&, double& );
virtual void onUpdate();
private:
Handle(V3d_View) myActiveView;
-#if OCC_VERSION_LARGE <= 0x06070100
- Handle(V3d_View) myOrthoView;
- Handle(V3d_View) myPerspView;
-#endif
bool myBusy;
double myScale;
bool myIsAdvancedZoomingEnabled;
#include <QtxMultiAction.h>
#include <QtxRubberBand.h>
-#include <Basics_OCCTVersion.hxx>
-
#include <QPainter>
#include <QTime>
#include <QImage>
#include <Graphic3d_MapOfStructure.hxx>
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_ExportFormat.hxx>
-#if OCC_VERSION_LARGE > 0x06090000
#include <Graphic3d_StereoMode.hxx>
#include <Graphic3d_RenderingParams.hxx>
-#endif
-
-#if OCC_VERSION_MAJOR < 7
- #include <Visual3d_View.hxx>
-#endif
#include <V3d_Plane.hxx>
#include <V3d_Light.hxx>
int x1 = (int)( aEvent->x() + width()*delta/100 );
int y1 = (int)( aEvent->y() + height()*delta/100 );
myViewPort->zoom( x, y, x1, y1 );
-#if OCC_VERSION_LARGE <= 0x07000000
- myViewPort->getView()->ZFitAll();
-#endif
emit vpTransformationFinished ( ZOOMVIEW );
}
}
// the ones which lie within the screen limits
Standard_Real aScreenLimits[4] = { 0.0, 0.0, 0.0, 0.0 };
-#if OCC_VERSION_LARGE > 0x06070100
// NDC space screen limits
aScreenLimits[0] = -1.0;
aScreenLimits[1] = 1.0;
aScreenLimits[2] = -1.0;
aScreenLimits[3] = 1.0;
-#else
- aView3d->View()->ViewMapping().WindowLimit( aScreenLimits[0],
- aScreenLimits[1],
- aScreenLimits[2],
- aScreenLimits[3] );
-#endif
Standard_Integer aPointsNb = 0;
if ( aStructure->IsEmpty() || !aStructure->IsVisible() || aStructure->CStructure()->IsForHighlight )
continue;
-#if OCC_VERSION_LARGE > 0x06070100
Bnd_Box aBox = aStructure->MinMaxValues();
aXmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
aYmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
aXmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X();
aYmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y();
aZmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z();
-#else
- aStructure->MinMaxValues( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
-#endif
// Infinite structures are skipped
Standard_Real aLIM = ShortRealLast() - 1.0;
for ( Standard_Integer aPointIt = 0; aPointIt < 8; ++aPointIt ) {
const gp_Pnt& aBBPoint = aPoints[aPointIt];
-#if OCC_VERSION_LARGE > 0x06070100
gp_Pnt aProjected = aView3d->Camera()->Project( aBBPoint );
const Standard_Real& U = aProjected.X();
const Standard_Real& V = aProjected.Y();
-#else
- Standard_Real U = 0.0;
- Standard_Real V = 0.0;
- Standard_Real W = 0.0;
- aView3d->View()->Projects( aBBPoint.X(), aBBPoint.Y(), aBBPoint.Z(), U, V, W );
-#endif
if (U >= aScreenLimits[0]
&& U <= aScreenLimits[1]
case PANVIEW:
case ZOOMVIEW:
-#if OCC_VERSION_LARGE <= 0x07000000
- myViewPort->getView()->ZFitAll();
-#endif
resetState();
break;
aAction->setStatusTip(tr("DSC_PERSPECTIVE_MODE"));
aAction->setCheckable(true);
toolMgr()->registerAction( aAction, PerspectiveId );
-#if OCC_VERSION_LARGE > 0x06090000
+
// - stereo projection
aAction = new QtxAction(tr("MNU_STEREO_MODE"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_STEREO" ) ),
tr( "MNU_STEREO_MODE" ), 0, this);
aAction->setCheckable(true);
toolMgr()->registerAction( aAction, StereoId );
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onStereoType(bool)));
-#endif
+
// - add exclusive action group
QActionGroup* aProjectionGroup = new QActionGroup( this );
aProjectionGroup->addAction( toolMgr()->action( OrthographicId ) );
QtxMultiAction* aScaleAction = new QtxMultiAction( this );
aScaleAction->insertAction( toolMgr()->action( FitAllId ) );
aScaleAction->insertAction( toolMgr()->action( FitRectId ) );
-#if OCC_VERSION_LARGE > 0x06090000
aScaleAction->insertAction( toolMgr()->action( FitSelectionId ) );
-#endif
aScaleAction->insertAction( toolMgr()->action( ZoomId ) );
toolMgr()->append( aScaleAction, tid );
toolMgr()->append( OrthographicId, tid );
toolMgr()->append( PerspectiveId, tid );
-#if OCC_VERSION_LARGE > 0x06090000
toolMgr()->append( StereoId, tid );
-#endif
toolMgr()->append( ResetId, tid );
}
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();
}
*/
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 ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
toolMgr()->action( StereoId )->isChecked() )
SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ), tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
-#endif
}
/*!
setProjectionType( Orthographic );
if (toolMgr()->action( PerspectiveId )->isChecked())
setProjectionType( Perspective );
-#if OCC_VERSION_LARGE > 0x06090000
if (toolMgr()->action( StereoId )->isChecked())
setProjectionType( Stereo );
-#endif
emit vpTransformationFinished( PROJECTION );
}
{
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 );
// 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() ) {
if ( !aPerspectiveAction->isEnabled() )
aPerspectiveAction->setEnabled( true );
}
-#endif
}
/*!
void OCCViewer_ViewWindow::onFitSelection()
{
emit vpTransformationStarted( FITSELECTION );
-#if OCC_VERSION_LARGE > 0x06090000
myModel->getAISContext()->FitSelected( getViewPort()->getView() );
-#endif
emit vpTransformationFinished( FITSELECTION );
}
aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ );
-#if OCC_VERSION_LARGE > 0x06070100
if ( anItem.centerX != 0.0 || anItem.centerY != 0.0 )
{
double anUpX = 0.0, anUpY = 0.0, anUpZ = 0.0;
aView3d->SetAt( anAt.X(), anAt.Y(), anAt.Z() );
aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
}
-#else
- aView3d->SetCenter( anItem.centerX, anItem.centerY );
-#endif
if ( !baseParamsOnly ) {
\brief Dump view window contents to the pixmap.
\return pixmap containing all scene rendered in the window
*/
+//#define USE_OLD_IMPLEMENTATION
QImage OCCViewer_ViewWindow::dumpView()
{
Handle(V3d_View) view = myViewPort->getView();
int aWidth = myViewPort->width();
int aHeight = myViewPort->height();
- // rnv: An old approach to dump the OCCViewer content
- // Now used OCCT built-in procedure.
- /*
- QApplication::syncX();
- view->Redraw(); // In order to reactivate GL context
- //view->Update();
+#ifdef USE_OLD_IMPLEMENTATION
+ // rnv: Old approach to dump the OCCViewer content via Frame Buffer Object
+
+ view->Redraw();
#ifndef DISABLE_GLVIEWER
OpenGLUtils_FrameBuffer aFrameBuffer;
- if( aFrameBuffer.init( aWidth, aHeight ) )
+ if ( aFrameBuffer.init( aWidth, aHeight ) )
{
- QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
-
glPushAttrib( GL_VIEWPORT_BIT );
glViewport( 0, 0, aWidth, aHeight );
aFrameBuffer.bind();
aFrameBuffer.unbind();
glPopAttrib();
+ QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
+
aFrameBuffer.bind();
glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
aFrameBuffer.unbind();
anImage = anImage.mirrored();
return anImage;
}
- // if frame buffers are unsupported, use old functionality
- //view->Redraw();
- unsigned char* data = new unsigned char[ aWidth*aHeight*4 ];
-
- QPoint p = myViewPort->mapFromParent(myViewPort->geometry().topLeft());
+ // if frame buffers are unsupported, use old approach
+ unsigned char* data = new unsigned char[ aWidth*aHeight*4 ];
+ QPoint p = myViewPort->mapFromParent( myViewPort->geometry().topLeft() );
glReadPixels( p.x(), p.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE,
data);
-#endif
- */
+ QImage anImage( data, aWidth, aHeight, QImage::Format_ARGB32 );
+ anImage = anImage.mirrored();
+ anImage = anImage.rgbSwapped();
+ return anImage;
- Image_PixMap aPix;
- view->ToPixMap(aPix,aWidth, aHeight,Graphic3d_BT_RGBA);
+#else // DISABLE_GLVIEWER
- QImage anImage( aPix.Data(), aWidth, aHeight, QImage::Format_ARGB32 );
- anImage = anImage.mirrored();
+ return QImage();
+
+#endif // DISABLE_GLVIEWER
+
+#else // USE_OLD_IMPLEMENTATION
+ // rnv: New approach is to use OCCT built-in procedure
+
+ Image_PixMap aPix;
+ view->ToPixMap(aPix, aWidth, aHeight, Graphic3d_BT_RGB);
+
+ QImage anImage( aWidth, aHeight, QImage::Format_ARGB32 );
+ for ( int i = 0; i < aWidth; i++ ) {
+ for ( int j = 0; j < aHeight; j++ ) {
+ Quantity_Color pixel = aPix.PixelColor( i, j ).GetRGB();
+ QColor color = QColor::fromRgbF( pixel.Red(), pixel.Green(), pixel.Blue() );
+ anImage.setPixelColor( i, j, color );
+ }
+ }
+
+ if ( aPix.IsTopDown() )
+ anImage = anImage.mirrored();
return anImage;
+
+#endif // USE_OLD_IMPLEMENTATION
}
bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
{
bool res = false;
QApplication::setOverrideCursor( Qt::WaitCursor );
- if ( format != "PS" && format != "EPS")
- res = myViewPort->getView()->Dump( fileName.toStdString().c_str() );
-#if OCC_VERSION_MAJOR < 7
- Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
-#else
Handle(Graphic3d_CView) a3dView = myViewPort->getView()->View();
-#endif
- if (format == "PS")
+ if (format == "PS") {
+ Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver());
+ OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
+ int prev = aCaps->ffpEnable;
+ aCaps->ffpEnable = 1;
res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
- else if (format == "EPS")
+ aCaps->ffpEnable = prev;
+ }
+ else if (format == "EPS") {
+ Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver());
+ OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
+ int prev = aCaps->ffpEnable;
+ aCaps->ffpEnable = 1;
res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
+ aCaps->ffpEnable = prev;
+ }
+ else {
+ res = myViewPort->getView()->Dump( fileName.toStdString().c_str() );
+ }
QApplication::restoreOverrideCursor();
return res;
gp_Pln pln (gp_Pnt(x, y, z), gp_Dir(dx, dy, dz));
double a, b, c, d;
pln.Coefficients(a, b, c, d);
-#if OCC_VERSION_LARGE > 0x07000000
Handle(Graphic3d_SequenceOfHClipPlane) aPlanes = view->ClipPlanes();
Graphic3d_SequenceOfHClipPlane::Iterator anIter (*aPlanes);
if(aPlanes->Size() > 0 ) {
-#else
- Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
- Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
- if(aPlanes.Size() > 0 ) {
-#endif
Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
aClipPlane->SetEquation(pln);
aClipPlane->SetOn(Standard_True);
}
}
else {
-#if OCC_VERSION_LARGE > 0x07000000
Handle(Graphic3d_SequenceOfHClipPlane) aPlanes = view->ClipPlanes();
Graphic3d_SequenceOfHClipPlane::Iterator anIter (*aPlanes);
-#else
- Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
- Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
-#endif
for( ;anIter.More();anIter.Next() ){
Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
aClipPlane->SetOn(Standard_False);
{
Handle(V3d_View) view = myViewPort->getView();
bool res = false;
-#if OCC_VERSION_LARGE > 0x07000000
Handle(Graphic3d_SequenceOfHClipPlane) aPlanes = view->ClipPlanes();
Graphic3d_SequenceOfHClipPlane::Iterator anIter (*aPlanes);
-#else
- Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
- Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
-#endif
for( ;anIter.More();anIter.Next() ) {
Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
if(aClipPlane->IsOn()) {
params.isVisible= isShown;
params.size = size;
-#if OCC_VERSION_LARGE <= 0x06070100 // the property is deprecated after OCCT 6.7.1
- aView3d->Center( params.centerX, params.centerY );
-#endif
-
// graduated trihedron
bool anIsVisible = false;
OCCViewer_AxisWidget::AxisData anAxisData[3];
QStringList data;
data << QString( "scale=%1" ) .arg( params.scale, 0, 'e', 12 );
-#if OCC_VERSION_LARGE <= 0x06070100 // the property is deprecated after OCCT 6.7.1
- data << QString( "centerX=%1" ) .arg( params.centerX, 0, 'e', 12 );
- data << QString( "centerY=%1" ) .arg( params.centerY, 0, 'e', 12 );
-#endif
data << QString( "projX=%1" ) .arg( params.projX, 0, 'e', 12 );
data << QString( "projY=%1" ) .arg( params.projY, 0, 'e', 12 );
data << QString( "projZ=%1" ) .arg( params.projZ, 0, 'e', 12 );
aTexture = new Graphic3d_TextureEnv( TCollection_AsciiString( et_paramValue.toStdString().c_str() ) );
Handle(V3d_View) aView = this->getViewPort()->getView();
aView->SetTextureEnv( aTexture );
-#if OCC_VERSION_LARGE <= 0x07000000
- aView->SetSurfaceDetail( V3d_TEX_ENVIRONMENT );
-#endif
}
}
else if ( paramName == "lightSource" )
mode = Perspective;
if (aCamera->ProjectionType() == Graphic3d_Camera::Projection_Orthographic)
mode = Orthographic;
- #if OCC_VERSION_LARGE > 0x06090000
if (aCamera->ProjectionType() == Graphic3d_Camera::Projection_Stereo)
mode = Stereo;
- #endif
}
return mode;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
aParams->StereoMode = (Graphic3d_StereoMode)type;
- #endif
}
}
int type = QuadBuffer;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
type = (OCCViewer_ViewWindow::StereoType)aParams->StereoMode;
- #endif
}
return type;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
if (type == RedCyan)
aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_RedCyan_Optimized;
aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_YellowBlue_Optimized;
if (type == GreenMagenta)
aParams->AnaglyphFilter = Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple;
- #endif
}
}
int type = RedCyan;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_RedCyan_Optimized)
type = RedCyan;
type = YellowBlue;
if (aParams->AnaglyphFilter == Graphic3d_RenderingParams::Anaglyph_GreenMagenta_Simple)
type = GreenMagenta;
- #endif
}
return type;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
aCamera->SetZFocus( (Graphic3d_Camera::FocusType) type, value );
- #endif
}
}
int type = Relative;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
type = (OCCViewer_ViewWindow::FocusIODType)aCamera->ZFocusType();
- #endif
}
return type;
}
double value = 1.0;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
value = aCamera->ZFocus();
- #endif
}
return value;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
aCamera->SetIOD( (Graphic3d_Camera::IODType) type, value );
- #endif
}
}
int type = Relative;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
type = (OCCViewer_ViewWindow::FocusIODType)aCamera->GetIODType();
- #endif
}
return type;
}
double value = 0.05;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
value = aCamera->IOD();
- #endif
}
return value;
}
{
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
aParams->ToReverseStereo = reverse;
- #endif
}
}
int reverse = false;
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams();
reverse = aParams->ToReverseStereo;
- #endif
}
return reverse;
}
{
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
aCaps->swapInterval = enable;
- #endif
}
}
int enable = true;
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
enable = aCaps->swapInterval;
- #endif
}
return enable;
}
{
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
aCaps->contextStereo = enable;
- #endif
}
}
int enable = true;
Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext();
if ( !anIntCont.IsNull() ) {
- #if OCC_VERSION_LARGE > 0x06090000
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver());
OpenGl_Caps* aCaps = &aDriver->ChangeOptions();
enable = aCaps->contextStereo;
- #endif
}
return enable;
}
aProps.setAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
aProps.setViewUp( anUp[0], anUp[1], anUp[2] );
-#if OCC_VERSION_LARGE > 0x06070100
aSourceView->Eye( anEye[0], anEye[1], anEye[2] );
// store camera properties "as is": it is up to synchronized
aProps.setViewAngle( aSourceView->Camera()->FOVy() );
}
aProps.setMappingScale( aSourceView->Camera()->Scale() );
-#else
- Standard_Real aCameraDepth = aSourceView->Depth() + aSourceView->ZSize() * 0.5;
-
- // generate view orientation matrix for transforming OCC projection reference point
- // into a camera (eye) position.
- gp_Dir aLeftDir = gp_Dir( anUp[0], anUp[1], anUp[2] ) ^ gp_Dir( aProj[0], aProj[1], aProj[2] );
-
- gp_GTrsf aTrsf;
- aTrsf.SetValue( 1, 1, aLeftDir.X() );
- aTrsf.SetValue( 2, 1, aLeftDir.Y() );
- aTrsf.SetValue( 3, 1, aLeftDir.Z() );
-
- aTrsf.SetValue( 1, 2, anUp[0] );
- aTrsf.SetValue( 2, 2, anUp[1] );
- aTrsf.SetValue( 3, 2, anUp[2] );
-
- aTrsf.SetValue( 1, 3, aProj[0] );
- aTrsf.SetValue( 2, 3, aProj[1] );
- aTrsf.SetValue( 3, 3, aProj[2] );
-
- aTrsf.SetValue( 1, 4, anAt[0] );
- aTrsf.SetValue( 2, 4, anAt[1] );
- aTrsf.SetValue( 3, 4, anAt[2] );
-
- Graphic3d_Vertex aProjRef = aSourceView->ViewMapping().ProjectionReferencePoint();
-
- // transform to world-space coordinate system
- gp_XYZ aPosition( aProjRef.X(), aProjRef.Y(), aCameraDepth );
- aTrsf.Transforms( aPosition );
-
- // compute focal point
- double aFocalPoint[3];
-
- aFocalPoint[0] = aPosition.X() - aProj[0] * aCameraDepth;
- aFocalPoint[1] = aPosition.Y() - aProj[1] * aCameraDepth;
- aFocalPoint[2] = aPosition.Z() - aProj[2] * aCameraDepth;
-
- aProps.setFocalPoint( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] );
- aProps.setPosition( aPosition.X(), aPosition.Y(), aPosition.Z() );
-
- Standard_Real aViewScale[2];
- aSourceView->Size( aViewScale[0], aViewScale[1] );
- aProps.setMappingScale( aViewScale[1] );
-#endif
return aProps;
}
aProps.getViewUp( anUpDir[0], anUpDir[1], anUpDir[2] );
aProps.getAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
-#if OCC_VERSION_LARGE > 0x06070100
aDestView->SetAt( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] );
aDestView->SetEye( aPosition[0], aPosition[1], aPosition[2] );
aDestView->SetUp( anUpDir[0], anUpDir[1], anUpDir[2] );
aDestView->Camera()->SetScale( aProps.getMappingScale() );
-#else
- gp_Dir aProjDir( aPosition[0] - aFocalPoint[0],
- aPosition[1] - aFocalPoint[1],
- aPosition[2] - aFocalPoint[2] );
-
- // get custom view translation
- Standard_Real aTranslation[3];
- aDestView->At( aTranslation[0], aTranslation[1], aTranslation[2] );
-
- gp_Dir aLeftDir = gp_Dir( anUpDir[0], anUpDir[1], anUpDir[2] )
- ^ gp_Dir( aProjDir.X(), aProjDir.Y(), aProjDir.Z() );
-
- gp_GTrsf aTrsf;
- aTrsf.SetValue( 1, 1, aLeftDir.X() );
- aTrsf.SetValue( 2, 1, aLeftDir.Y() );
- aTrsf.SetValue( 3, 1, aLeftDir.Z() );
-
- aTrsf.SetValue( 1, 2, anUpDir[0] );
- aTrsf.SetValue( 2, 2, anUpDir[1] );
- aTrsf.SetValue( 3, 2, anUpDir[2] );
-
- aTrsf.SetValue( 1, 3, aProjDir.X() );
- aTrsf.SetValue( 2, 3, aProjDir.Y() );
- aTrsf.SetValue( 3, 3, aProjDir.Z() );
-
- aTrsf.SetValue( 1, 4, aTranslation[0] );
- aTrsf.SetValue( 2, 4, aTranslation[1] );
- aTrsf.SetValue( 3, 4, aTranslation[2] );
- aTrsf.Invert();
-
- // transform to view-space coordinate system
- gp_XYZ aProjRef( aPosition[0], aPosition[1], aPosition[2] );
- aTrsf.Transforms( aProjRef );
-
- // set view camera properties using low-level approach. this is done
- // in order to avoid interference with static variables in v3d view used
- // when rotation is in process in another view.
- Visual3d_ViewMapping aMapping = aDestView->View()->ViewMapping();
- Visual3d_ViewOrientation anOrientation = aDestView->View()->ViewOrientation();
-
- Graphic3d_Vector aMappingProj( aProjDir.X(), aProjDir.Y(), aProjDir.Z() );
- Graphic3d_Vector aMappingUp( anUpDir[0], anUpDir[1], anUpDir[2] );
-
- aMappingProj.Normalize();
- aMappingUp.Normalize();
-
- anOrientation.SetViewReferencePlane( aMappingProj );
- anOrientation.SetViewReferenceUp( aMappingUp );
-
- aDestView->SetViewMapping( aMapping );
- aDestView->SetViewOrientation( anOrientation );
-
- // set panning
- aDestView->SetCenter( aProjRef.X(), aProjRef.Y() );
-
- // set mapping scale
- double aMapScaling = aProps.getMappingScale();
- Standard_Real aWidth, aHeight;
- aDestView->Size( aWidth, aHeight );
- aDestView->SetSize ( aWidth > aHeight ? aMapScaling * (aWidth / aHeight) : aMapScaling );
-#endif
getViewPort()->setAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
-#if OCC_VERSION_LARGE <= 0x07000000
- aDestView->ZFitAll();
-#endif
aDestView->SetImmediateUpdate( Standard_True );
aDestView->Redraw();
</message>
<message>
<source>MNU_RAY_TRACING</source>
- <translation type="unfinished">Ray tracing</translation>
+ <translation>Ray tracing</translation>
</message>
<message>
<source>DSC_RAY_TRACING</source>
- <translation type="unfinished">Ray tracing</translation>
+ <translation>Ray tracing</translation>
</message>
<message>
<source>MNU_ENV_TEXTURE</source>
- <translation type="unfinished">Environment texture</translation>
+ <translation>Texture de l'environnement</translation>
</message>
<message>
<source>DSC_ENV_TEXTURE</source>
- <translation type="unfinished">Environment texture</translation>
+ <translation>Texture de l'environnement</translation>
</message>
<message>
<source>MNU_LIGHT_SOURCE</source>
- <translation type="unfinished">Light source</translation>
+ <translation>Source de lumière</translation>
</message>
<message>
<source>DSC_LIGHT_SOURCE</source>
- <translation type="unfinished">Light source</translation>
+ <translation>Source de lumière</translation>
</message>
<message>
<source>OCC_IMAGE_FILES</source>
<name>OCCViewer_RayTracingDlg</name>
<message>
<source>RAY_TRACING</source>
- <translation type="unfinished">Ray tracing</translation>
+ <translation>Ray tracing</translation>
</message>
<message>
<source>DEPTH</source>
- <translation type="unfinished">Depth</translation>
+ <translation>Profondeur</translation>
</message>
<message>
<source>SHADOW</source>
- <translation type="unfinished">Shadows rendering</translation>
+ <translation>Rendu des ombres</translation>
</message>
<message>
<source>REFLECTION</source>
- <translation type="unfinished">Specular reflections</translation>
+ <translation>Réflexions spéculaires</translation>
</message>
<message>
<source>ANTIALIASING</source>
- <translation type="unfinished">Adaptive anti-aliasing</translation>
+ <translation>Anti-crénelage adaptatif</translation>
</message>
<message>
<source>TRANSPARENT_SHADOW</source>
- <translation type="unfinished">Transparent shadow</translation>
+ <translation>Ombres transparentes</translation>
</message>
</context>
<context>
<name>OCCViewer_EnvTextureDlg</name>
<message>
<source>ENV_TEXTURE</source>
- <translation type="unfinished">Environment texture</translation>
+ <translation>Texture de l'environnement</translation>
</message>
<message>
<source>ENV_CLOUDS</source>
- <translation type="unfinished">Clouds</translation>
+ <translation>Nuages</translation>
</message>
<message>
<source>ENV_CV</source>
- <translation type="unfinished">Cv</translation>
+ <translation>Cv</translation>
</message>
<message>
<source>ENV_MEDIT</source>
- <translation type="unfinished">Medit</translation>
+ <translation>Medit</translation>
</message>
<message>
<source>ENV_PEARL</source>
- <translation type="unfinished">Pearl</translation>
+ <translation>Perle</translation>
</message>
<message>
<source>ENV_SKY1</source>
- <translation type="unfinished">Sky1</translation>
+ <translation>Ciel1</translation>
</message>
<message>
<source>ENV_SKY2</source>
- <translation type="unfinished">Sky2</translation>
+ <translation>Ciel2</translation>
</message>
<message>
<source>ENV_LINES</source>
- <translation type="unfinished">Lines</translation>
+ <translation>Lignes</translation>
</message>
<message>
<source>ENV_ROAD</source>
- <translation type="unfinished">Road</translation>
+ <translation>Route</translation>
</message>
<message>
<source>ENV_CUSTOM</source>
- <translation type="unfinished">Custom...</translation>
+ <translation>Personnalisé...</translation>
</message>
</context>
<context>
<name>OCCViewer_LightSourceDlg</name>
<message>
<source>LIGHT_SOURCE</source>
- <translation type="unfinished">Light source</translation>
+ <translation>Source de lumière</translation>
</message>
<message>
<source>TYPE</source>
- <translation type="unfinished">Type</translation>
+ <translation>Type</translation>
</message>
<message>
<source>DIRECTIONAL</source>
- <translation type="unfinished">Directional</translation>
+ <translation>Directionnel</translation>
</message>
<message>
<source>DIRECTION</source>
- <translation type="unfinished">Direction</translation>
+ <translation>Direction</translation>
</message>
<message>
<source>POSITIONAL</source>
- <translation type="unfinished">Positional</translation>
+ <translation>Positionnel</translation>
</message>
<message>
<source>POSITION</source>
- <translation type="unfinished">Position</translation>
+ <translation>Position</translation>
</message>
<message>
<source>COLOR</source>
- <translation type="unfinished">Color</translation>
+ <translation>Couleur</translation>
</message>
<message>
<source>HEADLIGHT</source>
- <translation type="unfinished">Headlight</translation>
+ <translation>Lumière frontale</translation>
</message>
<message>
<source>BUT_DEFAULT</source>
- <translation type="unfinished">Default</translation>
+ <translation>Défaut</translation>
</message>
</context>
</TS>
PVViewer_ViewWindow.h
PVViewer_Behaviors.h
PVViewer_GUIElements.h
+ PVViewer_InitSingleton.h
)
# header files / no moc processing
PVViewer_Behaviors.cxx
PVViewer_GUIElements.cxx
PVViewer_Core.cxx
+ PVViewer_InitSingleton.cxx
)
# sources / to compile
#include <pqDataTimeStepBehavior.h>
#include <pqDefaultViewBehavior.h>
#include <pqObjectPickingBehavior.h>
-#include <pqPersistentMainWindowStateBehavior.h>
#include <pqPipelineContextMenuBehavior.h>
#include <pqPluginActionGroupBehavior.h>
#include <pqPluginDockWidgetsBehavior.h>
#include <pqCollaborationBehavior.h>
#include <pqVerifyRequiredPluginBehavior.h>
#include <pqPluginSettingsBehavior.h>
-#include <pqFixPathsInStateFilesBehavior.h>
#include <pqApplyBehavior.h>
#include <pqPropertiesPanel.h>
// Load plugins distributed with application.
pqApplicationCore::instance()->loadDistributedPlugins();
+ new pqPipelineContextMenuBehavior(this);
new pqDefaultViewBehavior(this); // shows a 3D view as soon as a server connection is made
new pqAlwaysConnectedBehavior(this); // client always connected to a server
new pqVerifyRequiredPluginBehavior(this);
new pqPluginSettingsBehavior(this);
- new pqFixPathsInStateFilesBehavior(this);
new pqCrashRecoveryBehavior(this);
new pqCommandLineOptionsBehavior(this);
//new pqQtMessageHandlerBehavior(this); // THIS ONE TO EXCLUDE !! see comment above
new pqDataTimeStepBehavior(this);
new pqSpreadSheetVisibilityBehavior(this);
- new pqPipelineContextMenuBehavior(this);
+ //new pqPipelineContextMenuBehavior(this);
new pqUndoRedoBehavior(this);
new pqAutoLoadPluginXMLBehavior(this); // auto load plugins GUI stuff
new pqPluginDockWidgetsBehavior(desk);
new pqPluginActionGroupBehavior(desk);
- new pqPersistentMainWindowStateBehavior(desk);
+ // rnv: Disable ParaView main window persistance mechanism,
+ // because SALOME has own functionality for store/restore windows state.
+ // new pqPersistentMainWindowStateBehavior(desk);
new pqObjectPickingBehavior(desk);
new pqCollaborationBehavior(this);
new pqViewStreamingBehavior(this);
#include <QStringList>
#include <QDir>
#include <QMainWindow>
+#include <QStandardPaths>
#include <string>
char** argv = 0;
QString aOptions = getenv("PARAVIEW_OPTIONS");
QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts);
- argv = new char*[aOptList.size() + 1];
+ argv = new char*[aOptList.size() + 3];
QStringList args = QApplication::arguments();
argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis");
argc++;
argv[argc] = strdup( aStr.toLatin1().constData() );
argc++;
}
+ argv[argc++] = strdup("--multi-servers");
+ // Make salome sharing the same server configuration than external one with "salome shell paraview"
+ QStringList li(QStandardPaths::standardLocations(QStandardPaths::ConfigLocation));
+ foreach(QString pathConfig,li)
+ {
+ QFileInfo fi(QDir(pathConfig),QString("ParaView"));
+ if(fi.exists() && fi.isDir())
+ {
+ QFileInfo fi2(fi.canonicalFilePath(),"servers.pvsc");
+ if(fi2.exists() && fi2.isFile())
+ {
+ QString addEntry(QString("--servers-file=%1").arg(fi2.canonicalFilePath()));
+ std::string addEntry2(addEntry.toStdString());
+ argv[argc++] = strdup(addEntry2.c_str());
+ break;
+ }
+ }
+ }
+ //
MyCoreApp = new pqPVApplicationCore (argc, argv);
if (MyCoreApp->getOptions()->GetHelpSelected() ||
MyCoreApp->getOptions()->GetUnknownArgument() ||
--- /dev/null
+// Copyright (C) 2017 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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#include "PVViewer_InitSingleton.h"
+#include "PVViewer_Core.h"
+#include "PVViewer_ViewManager.h"
+
+bool PVViewer_InitSingleton::IS_INIT=false;
+
+void PVViewer_InitSingleton::Init(QMainWindow *aDesktop, LogWindow *logWindow)
+{
+ if(IS_INIT)
+ return ;
+ PVViewer_Core::ParaviewInitApp(aDesktop,logWindow);
+ // Finish ParaView set up: behaviors, connection and configurations.
+ const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
+ PVViewer_Core::ParaviewInitBehaviors(true,aDesktop);
+ PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop);
+ PVViewer_Core::ParaviewLoadConfigurations(configPath);
+ IS_INIT=true;
+}
--- /dev/null
+// Copyright (C) 2017 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
+//
+// Author : Anthony GEAY (EDF R&D)
+
+#ifndef __PVVIEWER_INITSINGLETON_H__
+#define __PVVIEWER_INITSINGLETON_H__
+
+#include "PVViewer.h"
+
+class QMainWindow;
+class LogWindow;
+
+/**
+ * This class deals with initialization of SALOME_Session to make it a PV based application.
+ * The initialization must be done only once.
+ * It allows multi initializator ParaView visu modules other than PARAVIS.
+ */
+class PVVIEWER_EXPORT PVViewer_InitSingleton
+{
+public:
+ static void Init(QMainWindow *aDesktop, LogWindow *logWindow);
+private:
+ static bool IS_INIT;
+};
+
+#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */
#include "PVViewer_ViewModel.h"
#include "PVViewer_GUIElements.h"
#include "PVViewer_Core.h"
+#include "PVViewer_InitSingleton.h"
#include "PVServer_ServiceWrapper.h"
#include <utilities.h>
setTitle( tr( "PARAVIEW_VIEW_TITLE" ) );
// Initialize minimal paraview stuff (if not already done)
- PVViewer_Core::ParaviewInitApp(desk, logWindow);
+ PVViewer_InitSingleton::Init(desk, logWindow);
connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
// This is mandatory, see setParent() method in Qt 4 documentation
myPVMgr->show();
setCentralWidget( myPVMgr );
-
- // Finish ParaView set up: behaviors, connection and configurations.
- const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
- PVViewer_Core::ParaviewInitBehaviors(true, theDesktop);
- PVViewer_ViewManager::ConnectToExternalPVServer(theDesktop);
- PVViewer_Core::ParaviewLoadConfigurations(configPath);
-
// Hide toolbars
PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(myDesktop);
pvge->setToolBarVisible(false);
</Category>
<Category name="CosmoTools" menu_label="&CosmoTools" show_in_toolbar="0">
+ <Proxy group="filters" name="ANLHaloFinder" />
+ <Proxy group="filters" name="ANLSubhaloFinder" />
<Proxy group="filters" name="LANLHaloFinder" />
<Proxy group="filters" name="MinkowskiFilter" />
<Proxy group="filters" name="PMergeConnected" />
icon=":/pqWidgets/Icons/pqBoxChart16.png" omit_from_toolbar="1"/>
<Proxy group="filters" name="ExtractBagPlots"
icon=":/pqWidgets/Icons/pqFunctionalBagChart16.png" omit_from_toolbar="1"/>
+ <Proxy group="filters" name="ExtractLocation" omit_from_toolbar="1" />
</Category>
<Category name="Statistics" menu_label="&Statistics">
</Category>
<Category name="Temporal" menu_label="&Temporal">
- <Proxy group="filters" name="ParticleTracer" />
+ <Proxy group="filters" name="ExtractTimeSteps" />
+ <Proxy group="filters" name="GroupTimeSteps" />
<Proxy group="filters" name="ParticlePath" />
+ <Proxy group="filters" name="ParticleTracer" />
<Proxy group="filters" name="StreakLine" />
+ <Proxy group="filters" name="SynchronizeTime" />
<Proxy group="filters" name="TemporalCache" />
<Proxy group="filters" name="TemporalInterpolator" />
- <Proxy group="filters" name="TemporalSnapToTimeStep" />
<Proxy group="filters" name="TemporalShiftScale" />
+ <Proxy group="filters" name="TemporalSnapToTimeStep" />
<Proxy group="filters" name="TemporalStatistics" />
+ <Proxy group="filters" name="TimeStepProgressFilter" />
<Proxy group="filters" name="TimeToTextConvertor" />
</Category>
<Proxy group="filters" name="QuadratureSchemeDictionaryGenerator" />
</Category>
+ <Category name="Annotation" menu_label="Annotation">
+ <Proxy group="filters" name="AnnotateGlobalData" />
+ <Proxy group="filters" name="AnnotateAttributeData" />
+ <Proxy group="filters" name="PythonAnnotation" />
+ <Proxy group="filters" name="TimeToTextConvertor" />
+ <Proxy group="filters" name="TimeStepProgressFilter" />
+ <Proxy group="filters" name="DataSetRegionSurfaceFilter" />
+ <Proxy group="filters" name="EnvironmentAnnotation" />
+ </Category>
+
+ <Category name="Point Interpolation" menu_label="Point Interpolation">
+ <Proxy group="filters" name="PointLineInterpolator" />
+ <Proxy group="filters" name="PointPlaneInterpolator" />
+ <Proxy group="filters" name="PointVolumeInterpolator" />
+ <Proxy group="filters" name="PointDatasetInterpolator" />
+ <Proxy group="filters" name="SPHLineInterpolator" />
+ <Proxy group="filters" name="SPHPlaneInterpolator" />
+ <Proxy group="filters" name="SPHVolumeInterpolator" />
+ <Proxy group="filters" name="SPHDatasetInterpolator" />
+ </Category>
+ <Proxy group="filters" name="AggregateDataSet" />
+ <Proxy group="filters" name="AppendArcLength" />
+ <Proxy group="filters" name="AddFieldArrays" />
<Proxy group="filters" name="ImageDataToAMR" />
<Proxy group="filters" name="UniformGridPartitioner" />
- <Proxy group="filters" name="AnnotateGlobalData" />
<Proxy group="filters" name="Append" />
<Proxy group="filters" name="AppendAttributes" />
<Proxy group="filters" name="AppendPolyData" />
+ <Proxy group="filters" name="AppendReductionFilter" />
+ <Proxy group="filters" name="AngularPeriodicFilter" />
<Proxy group="filters" name="ArbitrarySourceStreamTracer" />
<Proxy group="filters" name="BlockIdScalars" />
<Proxy group="filters" name="RandomAttributeGenerator" />
<Proxy group="filters" name="CellCenters" />
<Proxy group="filters" name="CellDataToPointData" />
<Proxy group="filters" name="CellDerivatives"/>
+ <Proxy group="filters" name="CellSize" />
<Proxy group="filters" name="CleanPolyData" />
<Proxy group="filters" name="CleanUnstructuredGrid" />
<Proxy group="filters" name="CleanUnstructuredGridCells" />
<Proxy group="filters" name="Clip" />
<Proxy group="filters" name="ClipClosedSurface" />
<Proxy group="filters" name="Contour" />
+ <Proxy group="filters" name="CountCellFaces" />
+ <Proxy group="filters" name="CountCellVertices" />
<Proxy group="filters" name="Curvatures" />
<Proxy group="filters" name="Cut" />
<Proxy group="filters" name="CutEverything" />
<Proxy group="filters" name="D3" />
<Proxy group="filters" name="DataSetSurfaceFilter" />
+ <Proxy group="filters" name="DataSetRegionSurfaceFilter" />
<Proxy group="filters" name="DataSetTriangleFilter" />
<Proxy group="filters" name="DecimatePro" />
<Proxy group="filters" name="Delaunay2D" />
<Proxy group="filters" name="Delaunay3D" />
<Proxy group="filters" name="ElevationFilter" />
+ <Proxy group="filters" name="EvenlySpacedStreamlines2D" />
<Proxy group="filters" name="ExtractBlock" />
<Proxy group="filters" name="ExtractComponent" />
<Proxy group="filters" name="ExtractEdges" />
<Proxy group="filters" name="FFTSelectionOverTime" />
<Proxy group="filters" name="GaussianSplatter"/>
<Proxy group="filters" name="GenerateIdScalars"/>
+ <Proxy group="filters" name="GhostCellsGenerator" />
<Proxy group="filters" name="Glyph" />
<Proxy group="filters" name="GlyphWithCustomSource" />
<Proxy group="filters" name="Gradient" />
<Proxy group="filters" name="ImageDataToPointSet" />
<Proxy group="filters" name="IntegrateAttributes" />
<Proxy group="filters" name="IntegrateFlowThroughSurface" />
- <Proxy group="filters" name="LegacyGlyph" />
<!-- <Proxy group="filters" name="LevelIdScalars" /> -->
<Proxy group="filters" name="LinearExtrusionFilter" />
<Proxy group="filters" name="LoopSubdivisionFilter" />
<Proxy group="filters" name="MeshQuality" />
<Proxy group="filters" name="OctreeDepthLimit" />
<Proxy group="filters" name="OctreeDepthScalars" />
+ <Proxy group="filters" name="OTKernelSmoothing" />
+ <Proxy group="filters" name="OTDensityMap" />
<Proxy group="filters" name="OutlineCornerFilter" />
<Proxy group="filters" name="OutlineFilter" />
<Proxy group="filters" name="ParticlePathLines" />
<Proxy group="filters" name="PlotOnSortedLines" />
<Proxy group="filters" name="PointDataToCellData" />
<Proxy group="filters" name="PolyDataNormals" />
- <Proxy group="filters" name="Probe" />
- <Proxy group="filters" name="ImageResampling" />
<Proxy group="filters" name="ProbeLine" />
<Proxy group="filters" name="ProbePoint" />
<Proxy group="filters" name="ProcessIdScalars" />
<Proxy group="filters" name="ProgrammableFilter" />
<Proxy group="filters" name="PVConnectivityFilter" />
<Proxy group="filters" name="PythonCalculator" />
- <Proxy group="filters" name="PythonAnnotation" />
<Proxy group="filters" name="PythonExtractSelection" />
<Proxy group="filters" name="QuadricClustering" />
<Proxy group="filters" name="RectilinearGridConnectivity" />
<Proxy group="filters" name="RectilinearGridToPointSet" />
<Proxy group="filters" name="ReflectionFilter" />
+ <Proxy group="filters" name="RemoveGhostInformation" />
+ <Proxy group="filters" name="ResampleToImage" />
+ <Proxy group="filters" name="ResampleWithDataset" />
<Proxy group="filters" name="RibbonFilter" />
<Proxy group="filters" name="RotationalExtrusionFilter" />
<Proxy group="filters" name="ScatterPlot"/>
<Proxy group="filters" name="TextureMapToPlane" />
<Proxy group="filters" name="TextureMapToSphere" />
<Proxy group="filters" name="Threshold" />
- <Proxy group="filters" name="TimeToTextConvertor" />
<Proxy group="filters" name="TransformFilter" />
<Proxy group="filters" name="TriangleFilter" />
<Proxy group="filters" name="TubeFilter" />
<Proxy group="filters" name="GenericStreamTracer" />
<Proxy group="filters" name="GenericGeometryFilter" />
<Proxy group="filters" name="SliceAlongPolyLine" />
+ <Proxy group="filters" name="SliceWithPlane" />
+ <Proxy group="filters" name="RulerFilter" />
</ParaViewFilters>
<Proxy group="sources" name="OutlineSource" />
<Proxy group="sources" name="PlaneSource" />
<Proxy group="sources" name="PointSource" />
+ <Proxy group="sources" name="PolyLineSource" />
<Proxy group="sources" name="ProgrammableSource" />
+ <Proxy group="sources" name="Ruler" />
<Proxy group="sources" name="SphereSource" />
<Proxy group="sources" name="SplineSource" />
<Proxy group="sources" name="SuperquadricSource" />
<Proxy group="sources" name="TextSource" />
<Proxy group="sources" name="TimeSource" />
- <Proxy group="sources" name="Ruler" />
+ <Proxy group="sources" name="UnstructuredCellTypes" />
<Proxy group="sources" name="RTAnalyticSource" />
<Proxy group="sources" name="AMRGaussianPulseSource" />
</ParaViewSources>
#include <string>
#include <list>
-#include <Basics_OCCTVersion.hxx>
+#include <Standard_DefineHandle.hxx>
class SALOME_View;
class SALOME_Displayer;
class SALOME_ListIO;
-#if OCC_VERSION_MAJOR >= 7
- class SALOME_InteractiveObject;
-#else
- class Handle_SALOME_InteractiveObject;
-#endif
+class SALOME_InteractiveObject;
/*!
\class SALOME_Prs
</message>
<message>
<source>ACT_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>Cherche</translation>
</message>
<message>
<source>TTP_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>Cherche</translation>
</message>
<message>
<source>DSC_FIND</source>
- <translation type="unfinished">Find text</translation>
+ <translation>Cherche le text</translation>
</message>
<message>
<source>ACT_REPLACE</source>
- <translation type="unfinished">Replace</translation>
+ <translation>Remplace</translation>
</message>
<message>
<source>TTP_REPLACE</source>
- <translation type="unfinished">Find & Replace</translation>
+ <translation>Cherche & Remplace</translation>
</message>
<message>
<source>DSC_REPLACE</source>
- <translation type="unfinished">Find and replace text</translation>
+ <translation>Cherche et remplace le texte</translation>
</message>
<message>
<source>ACT_PREFERENCES</source>
</message>
<message>
<source>ACT_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>検索</translation>
</message>
<message>
<source>TTP_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>検索</translation>
</message>
<message>
<source>DSC_FIND</source>
- <translation type="unfinished">Find text</translation>
+ <translation>テキストの検索</translation>
</message>
<message>
<source>ACT_REPLACE</source>
- <translation type="unfinished">Replace</translation>
+ <translation>置換</translation>
</message>
<message>
<source>TTP_REPLACE</source>
- <translation type="unfinished">Find & Replace</translation>
+ <translation>検索と置換</translation>
</message>
<message>
<source>DSC_REPLACE</source>
- <translation type="unfinished">Find and replace text</translation>
+ <translation>テキストの検索と置換</translation>
</message>
<message>
<source>ACT_PREFERENCES</source>
#include <QApplication>
#include <QDesktopWidget>
#include <QtDebug>
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
+#include <QSurfaceFormat>
+#endif
#include <stdio.h>
#include <stdlib.h>
#endif // WIN32
+
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
+/*!
+ \brief Set default QSurfaceFormat for an application.
+
+ This application property should be set before a creation of the QApplication.
+*/
+void Qtx::initDefaultSurfaceFormat()
+{
+ // Settings from Paraview:
+ // This piece of code was taken from QVTKOpenGLWidget::defaultFormat() method in
+ // order to avoid dependency of the SALOME_Session_Server on vtk libraries
+ QSurfaceFormat fmt;
+ fmt.setRenderableType(QSurfaceFormat::OpenGL);
+ fmt.setVersion(3, 2);
+ fmt.setProfile(QSurfaceFormat::CoreProfile);
+ fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+ fmt.setRedBufferSize(1);
+ fmt.setGreenBufferSize(1);
+ fmt.setBlueBufferSize(1);
+ fmt.setDepthBufferSize(1);
+ fmt.setStencilBufferSize(0);
+ fmt.setAlphaBufferSize(1);
+ fmt.setStereo(false);
+ fmt.setSamples(0);
+
+ // Settings for OCCT viewer window:
+ fmt.setDepthBufferSize(16);
+ fmt.setStencilBufferSize(1);
+ // fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
+
+ QSurfaceFormat::setDefaultFormat(fmt);
+}
+#endif
+
/*!
\class Qtx::CmdLineArgs
\brief Get access to the command line arguments in the C-like manner.
static void* getDisplay();
static Qt::HANDLE getVisual();
#endif
+
+#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
+ static void initDefaultSurfaceFormat();
+#endif
};
#endif
if ( d )
aWorkspace = d->workstack();
}
-#if SIP_VERSION < 0x040800
- PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget) );
-#else
- PyObjWrapper pyws( sipBuildResult( 0, "D", aWorkspace, sipType_QWidget , NULL) );
+#if SIP_VERSION >= 0x041300
+ static const sipTypeDef *sipType_QWidget = 0;
+ if (!sipType_QWidget)
+ sipType_QWidget = sipFindType("QWidget");
#endif
+ PyObjWrapper pyws( sipBuildResult( 0, "D", aWorkspace, sipType_QWidget , NULL) );
// ... and finally call Python module's setWorkSpace() method (obsolete)
if ( PyObject_HasAttrString( myPyModule, (char*)"setWorkSpace" ) ) {
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"setWorkSpace", (char*)"O", pyws.get() ) );
QStringList* theList = new QStringList(entries);
-#if SIP_VERSION < 0x040800
- PyObjWrapper sipList(sipBuildResult(0, "M", theList, sipClass_QStringList));
-#else
- PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) );
+#if SIP_VERSION >= 0x041300
+ static const sipTypeDef *sipType_QStringList = 0;
+ if (!sipType_QStringList)
+ sipType_QStringList = sipFindType("QStringList");
#endif
+ PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) );
if (PyObject_HasAttrString(myPyModule, (char*) "onSelectionUpdated"))
{
MESSAGE("call onSelectionUpdated");
if ( myXmlHandler )
myXmlHandler->createPopup( menu, aContext, aParent, aObject );
-#if SIP_VERSION < 0x040800
- PyObjWrapper sipPopup( sipBuildResult( 0, "M", menu, sipClass_QMenu ) );
-#else
- PyObjWrapper sipPopup( sipBuildResult( 0, "D", menu, sipType_QMenu, NULL ) );
+#if SIP_VERSION >= 0x041300
+ static const sipTypeDef *sipType_QMenu = 0;
+ if (!sipType_QMenu)
+ sipType_QMenu = sipFindType("QMenu");
#endif
+ PyObjWrapper sipPopup( sipBuildResult( 0, "D", menu, sipType_QMenu, NULL ) );
// then call Python module's createPopupMenu() method (for new modules)
if ( PyObject_HasAttrString( myPyModule, (char*)"createPopupMenu" ) ) {
QStringList* theList = new QStringList( files );
-#if SIP_VERSION < 0x040800
- PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList ) );
-#else
- PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) );
+#if SIP_VERSION >= 0x041300
+ static const sipTypeDef *sipType_QStringList = 0;
+ if (!sipType_QStringList)
+ sipType_QStringList = sipFindType("QStringList");
#endif
+ PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL ) );
if ( PyObject_HasAttrString(myPyModule , (char*)"openFiles") ) {
// try with two parameters (new syntax)
if ( dataObject ) theList->append( dataObject->entry() );
}
-#if SIP_VERSION < 0x040800
- PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList) );
-#else
- PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL) );
+#if SIP_VERSION >= 0x041300
+ static const sipTypeDef *sipType_QStringList = 0;
+ if (!sipType_QStringList)
+ sipType_QStringList = sipFindType("QStringList");
#endif
+ PyObjWrapper sipList( sipBuildResult( 0, "D", theList, sipType_QStringList, NULL) );
if ( PyObject_HasAttrString(myPyModule, (char*)"dropObjects") ) {
PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"dropObjects", (char*)"Osii",
sipList.get(),
*/
void SUIT_Desktop::childEvent( QChildEvent* e )
{
- if ( e->type() == QEvent::ChildAdded && e->child()->isWidgetType() )
+ if ( e->type() == QEvent::ChildAdded && e->child()->isWidgetType() ) {
+ // The following line is a workaround to avoid showing view window as a top-level window
+ // before re-parenting it to workstack (issue #23467).
+ // See SUIT_ViewWindow::setVisible() and SUIT_Desktop::customEvent().
+ e->child()->setProperty("blockShow", true );
QApplication::postEvent( this, new ReparentEvent( QEvent::Type( Reparent ), e->child() ) );
- else
+ }
+ else {
QtxMainWindow::childEvent( e );
+ }
}
void SUIT_Desktop::customEvent( QEvent* e )
bool invis = wid->testAttribute( Qt::WA_WState_ExplicitShowHide ) &&
wid->testAttribute( Qt::WA_WState_Hidden );
+ // The following line is a workaround to avoid showing view window as a top-level window
+ // before re-parenting it to workstack (issue #23467).
+ // See SUIT_ViewWindow::setVisible() and SUIT_Desktop::childEvent().
+ wid->setProperty("blockShow", false);
addWindow( wid );
wid->setVisible( !invis );
}
}
}
}
+
+void SUIT_ViewWindow::setVisible( bool on )
+{
+ // This is a workaround to avoid showing view window as a top-level window
+ // before re-parenting it to workstack (issue #23467).
+ // See SUIT_Desktop::childEvent().
+ QApplication::sendPostedEvents( 0, QEvent::ChildRemoved );
+ QApplication::sendPostedEvents( 0, QEvent::ChildAdded );
+ QApplication::sendPostedEvents( 0, QEvent::ChildPolished );
+ if ( !property( "blockShow" ).toBool() )
+ QMainWindow::setVisible( on );
+}
public slots:
virtual void onDumpView();
+ void setVisible( bool );
signals:
void tryClosing( SUIT_ViewWindow* );
#include <QRegExp>
#include <QString>
#include <QStringList>
-#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-#include <QSurfaceFormat>
-#endif
#include <stdlib.h>
}
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
- // initialization of the X11 visual on Linux
- QSurfaceFormat format;
- format.setDepthBufferSize(16);
- format.setStencilBufferSize(1);
- format.setProfile(QSurfaceFormat::CompatibilityProfile);
- QSurfaceFormat::setDefaultFormat(format);
+ // RNV: setup the default format:
+ // QSurfaceFormat should be set before creation of QApplication,
+ // so to avoid conflicts beetween SALOME and ParaView QSurfaceFormats we should merge theirs formats
+ // (see void Qtx::initDefaultSurfaceFormat()) and set the resultant format here.
+ Qtx::initDefaultSurfaceFormat();
#endif
// add <qtdir>/plugins directory to the pluins search path for image plugins
myRepresentation = VTKViewer::Representation::Surface;
myIsResolveCoincidentTopology = true;
- vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+ myPolygonOffsetUnits);
myMapper = VTKViewer_DataSetMapper::New();
aStyle->SetInteractor(NULL);
myInteractorStyles.pop();
}
-
- SetRenderer(NULL);
-
- GetDevice()->SetRenderWindow(NULL);
}
/*!
#include "SalomeApp_ExceptionHandler.h"
#include "Utils_CorbaException.hxx"
-#include "CASCatch.hxx"
-
#include <OSD.hxx>
#include <stdexcept>
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
{
- try {
+ bool result = true;
+
+ try
+ {
OCC_CATCH_SIGNALS;
- SUIT_ExceptionHandler::internalHandle( o, e );
+ result = SUIT_ExceptionHandler::internalHandle( o, e );
}
- catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- throw Standard_Failure( aFail->GetMessageString() );
+ catch( Standard_Failure& e )
+ {
+ throw Standard_Failure( e.GetMessageString() );
}
- return true;
+ return result;
}
/*!Try to call handleSignals( o, e ), catch and show error message.*/
# --- resources ---
# uic files / to be processed by pyuic
-SET(_pyuic_files
+SET(_pyuic_FILES
minmax.ui
)
# scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
# --- scripts ---
# scripts / static
# TODO: process UIC files via PyQt pyuic tool, see UsePyQt.cmake
SET(_plugins_SCRIPTS
- ${_pyuic_SCRIPTS}
minmax_plugin.py
trihedron.py
tubedialog_ui.py
salome_plugins.py
smesh_plugins.py
)
+
SET(_helper_SCRIPTS
xalome.py
)
# --- rules ---
-SALOME_INSTALL_SCRIPTS("${_plugins_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${_helper_SCRIPTS}" ${SALOME_INSTALL_PYTHON})
+SALOME_INSTALL_SCRIPTS("${_plugins_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_GUI_INSTALL_PLUGINS}/demo DEF_PERMS TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
#include <QWaitCondition>
#include <QRegExp>
#include <QTextStream>
-#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
-#include <QSurfaceFormat>
-#endif
/*! - read arguments, define list of server to launch with their arguments.
* - wait for naming service
}
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
- // initialization of the X11 visual on Linux
- QSurfaceFormat format;
- format.setDepthBufferSize(16);
- format.setStencilBufferSize(1);
- format.setProfile(QSurfaceFormat::CompatibilityProfile);
- QSurfaceFormat::setDefaultFormat(format);
+
+ // RNV: setup the default format:
+ // QSurfaceFormat should be set before creation of QApplication,
+ // so to avoid conflicts beetween SALOME and ParaView QSurfaceFormats we should merge theirs formats
+ // (see void Qtx::initDefaultSurfaceFormat()) and set the resultant format here.
+ Qtx::initDefaultSurfaceFormat();
+
#endif
// Create Qt application instance;
myIsPreselected(false),
myIsHighlighted(false)
{
- vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+ myPolygonOffsetUnits);
for(int i = 0; i < 6; i++)
myPassFilter.push_back(vtkPassThroughFilter::New());
units = myPolygonOffsetUnits;
}
+/*!
+ Get polygon offset parameters
+ \param factor, units - Opengl polygon offset parameters
+*/
+void
+VTKViewer_Actor
+::GetDefaultPolygonOffsetParameters(double& factor,
+ double& units)
+{
+ factor = 2.0;
+ units = 2.0;
+}
+
/*!
\return shrink factor
*/
void
GetPolygonOffsetParameters(double& factor,
double& units);
+
+ //! Get default ResolveCoincidentTopology parameters
+ static
+ void
+ GetDefaultPolygonOffsetParameters(double& factor,
+ double& units);
virtual
void
#include "VTKViewer_Filter.h"
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, Standard_Transient)
/*!
* \class VTKViewer_Filter
#include "VTKViewer.h"
-#include <MMgt_TShared.hxx>
+#include <Standard_Transient.hxx>
#include <Standard_DefineHandle.hxx>
-#include <Basics_OCCTVersion.hxx>
-
class VTKViewer_Actor;
-DEFINE_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared);
+DEFINE_STANDARD_HANDLE(VTKViewer_Filter, Standard_Transient);
/*
Class : VTKViewer_Filter
should be redefined in derived classes
*/
-class VTKViewer_Filter : public MMgt_TShared
+class VTKViewer_Filter : public Standard_Transient
{
public:
VTKViewer_Actor* myActor;
public:
- OCCT_DEFINE_STANDARD_RTTIEXT(VTKViewer_Filter,MMgt_TShared)
+ DEFINE_STANDARD_RTTIEXT(VTKViewer_Filter, Standard_Transient)
};
#endif
case VTK_QUADRATIC_HEXAHEDRON:
case VTK_TRIQUADRATIC_HEXAHEDRON:
case VTK_QUADRATIC_WEDGE:
+ case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
case VTK_QUADRATIC_PYRAMID:
if(!myIsWireframeMode)
{
int npts1 = 0;
switch (aCellType ){
- case VTK_QUADRATIC_TETRA: npts1 = 4; break;
- case VTK_QUADRATIC_HEXAHEDRON: npts1 = 8; break;
- case VTK_TRIQUADRATIC_HEXAHEDRON: npts1 = 8; break;
- case VTK_QUADRATIC_WEDGE: npts1 = 6; break;
- case VTK_QUADRATIC_PYRAMID: npts1 = 5; break;
+ case VTK_QUADRATIC_TETRA: npts1 = 4; break;
+ case VTK_QUADRATIC_HEXAHEDRON: npts1 = 8; break;
+ case VTK_TRIQUADRATIC_HEXAHEDRON: npts1 = 8; break;
+ case VTK_QUADRATIC_WEDGE: npts1 = 6; break;
+ case VTK_BIQUADRATIC_QUADRATIC_WEDGE: npts1 = 6; break;
+ case VTK_QUADRATIC_PYRAMID: npts1 = 5; break;
}
faceIdsTmp->SetNumberOfIds( npts1 );
if ( npts1 > 0 ) {
}
case VTK_QUADRATIC_TETRA:
case VTK_QUADRATIC_WEDGE:
+ case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
case VTK_TRIQUADRATIC_HEXAHEDRON:
case VTK_QUADRATIC_HEXAHEDRON:
case VTK_QUADRATIC_PYRAMID:
void VTKViewer_OpenGLRenderer::Clear(void)
{
+ vtkOpenGLRenderer::Clear();
#ifdef VTK_OPENGL2
if (this->OpenGLHelper.IsInitialized())
{
#include "ViewerData_AISShape.hxx"
-#ifdef USE_TEXTURED_SHAPE
- OCCT_IMPLEMENT_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_TexturedShape)
-#else
- OCCT_IMPLEMENT_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_Shape)
-#endif
+IMPLEMENT_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_ColoredShape)
/*!
- Constructor
- \param shape - TopoDS shape
+ Constructor.
+ \param shape Shape to manage.
*/
-ViewerData_AISShape::ViewerData_AISShape (const TopoDS_Shape& theShape)
-#ifdef USE_TEXTURED_SHAPE
-: AIS_TexturedShape (theShape),
-#else
-: AIS_Shape (theShape),
-#endif
- myIsClippable (true)
+ViewerData_AISShape::ViewerData_AISShape(const TopoDS_Shape& theShape)
+: AIS_ColoredShape(theShape),
+ myIsClippable(true)
{
}
/*!
- Destructor
+ Destructor.
*/
ViewerData_AISShape::~ViewerData_AISShape()
{
}
-
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#ifndef _ViewerData_AISShape_HeaderFile
-#define _ViewerData_AISShape_HeaderFile
-
-// When below macro is defined, AIS_TexturedShape is used as base class
-#define USE_TEXTURED_SHAPE
-
-#ifdef USE_TEXTURED_SHAPE
- #include <AIS_TexturedShape.hxx>
-#else
- #include <AIS_Shape.hxx>
-#endif
+#ifndef VIEWERDATA_AISSHAPE
+#define VIEWERDATA_AISSHAPE
#include <Standard.hxx>
#include <Standard_DefineHandle.hxx>
+#include <AIS_ColoredShape.hxx>
-#include <Basics_OCCTVersion.hxx>
-
-class ViewerData_AISShape
-#ifdef USE_TEXTURED_SHAPE
- : public AIS_TexturedShape
-#else
- : public AIS_Shape
-#endif
+class ViewerData_AISShape : public AIS_ColoredShape
{
public:
- Standard_EXPORT ViewerData_AISShape (const TopoDS_Shape& theShape);
+ Standard_EXPORT ViewerData_AISShape(const TopoDS_Shape&);
Standard_EXPORT ~ViewerData_AISShape();
- // checks if shape is clippable
+ //! Checks if shape is clippable.
Standard_EXPORT inline bool IsClippable() const
{
return myIsClippable;
}
- // makes shape clippable/not clippable
- Standard_EXPORT inline void SetClippable (bool isClippable)
+ //! Makes shape clippable/not clippable.
+ Standard_EXPORT inline void SetClippable(bool isClippable)
{
myIsClippable = isClippable;
}
bool myIsClippable;
public:
-
-#ifdef USE_TEXTURED_SHAPE
- OCCT_DEFINE_STANDARD_RTTIEXT(ViewerData_AISShape,AIS_TexturedShape)
-#else
- OCCT_DEFINE_STANDARD_RTTIEXT(ViewerData_AISShape,AIS_Shape)
-#endif
+ DEFINE_STANDARD_RTTIEXT(ViewerData_AISShape, AIS_ColoredShape)
};
-#ifdef USE_TEXTURED_SHAPE
- DEFINE_STANDARD_HANDLE(ViewerData_AISShape, AIS_TexturedShape)
-#else
- DEFINE_STANDARD_HANDLE(ViewerData_AISShape, AIS_Shape)
-#endif
+DEFINE_STANDARD_HANDLE(ViewerData_AISShape, AIS_ColoredShape)
-#endif // _ViewerData_AISShape_HeaderFile
+#endif // VIEWERDATA_AISSHAPE
ADD_SUBDIRECTORY(dlgfactory)
-IF(SALOME_USE_VTKVIEWER)
- ADD_SUBDIRECTORY(vtkEDFOverloads)
-ENDIF()
-
##
# Python-based packages, part 1 (generic)
##
// ========================================================
// avoid warning messages
-#ifdef WIN32
+#ifdef _MSC_VER
#pragma warning (disable : 4786)
#pragma warning (disable : 4251)
#endif
</message>
<message>
<source>TOO_MANY_MATCHES</source>
- <translation type="unfinished">Too many matches! Displaying first ones only...</translation>
+ <translation>Trop d'occurences! Affichage des premières...</translation>
</message>
<message>
<source>NO_DOC_AVAILABLE</source>
- <translation type="unfinished">no documentation available</translation>
+ <translation>pas de documentation disponible</translation>
</message>
</context>
</TS>
QStringListModel& model = replace ? myReplaceCompletion : myFindCompletion;
QStringList completions = model.stringList();
- if ( !text.isEmpty() and !completions.contains( text ) )
+ if ( !text.isEmpty() && !completions.contains( text ) )
{
completions.prepend( text );
model.setStringList( completions );
</message>
<message>
<source>GR_EDIT_SET</source>
- <translation type="unfinished">Editor settings</translation>
+ <translation>Paramètres de l'éditeur</translation>
</message>
<message>
<source>LBL_COMPLETION_MODE</source>
- <translation type="unfinished">Completion mode</translation>
+ <translation>Mode de complétion</translation>
</message>
<message>
<source>LBL_NONE</source>
- <translation type="unfinished">None</translation>
+ <translation>Auncun</translation>
</message>
<message>
<source>LBL_AUTO</source>
- <translation type="unfinished">Auto</translation>
+ <translation>Auto</translation>
</message>
<message>
<source>LBL_MANUAL</source>
- <translation type="unfinished">Manual</translation>
+ <translation>Manuel</translation>
</message>
<message>
<source>LBL_ALWAYS</source>
- <translation type="unfinished">Always</translation>
+ <translation>Toujours</translation>
</message>
<message>
<source>GR_TAB_SET</source>
</message>
<message>
<source>ACT_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>Cherche</translation>
</message>
<message>
<source>TTP_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>Cherche</translation>
</message>
<message>
<source>DSC_FIND</source>
- <translation type="unfinished">Find text</translation>
+ <translation>Cherche le texte</translation>
</message>
<message>
<source>ACT_REPLACE</source>
- <translation type="unfinished">Replace</translation>
+ <translation>Remplace</translation>
</message>
<message>
<source>TTP_REPLACE</source>
- <translation type="unfinished">Find & Replace</translation>
+ <translation>Cherche & Remplace</translation>
</message>
<message>
<source>DSC_REPLACE</source>
- <translation type="unfinished">Find and replace text</translation>
+ <translation>Cherche et remplace le texte</translation>
</message>
<message>
<source>ACT_PREFERENCES</source>
</message>
<message>
<source>FILE_PARAM_NAME</source>
- <translation type="unfinished">file</translation>
+ <translation>fichier</translation>
</message>
<message>
<source>FILE_PARAM_DESCRIPTION</source>
- <translation type="unfinished">File to edit.</translation>
+ <translation>Fichier à éditer.</translation>
</message>
</context>
<context>
<name>PyEditor_FindTool</name>
<message>
<source>FIND_LABEL</source>
- <translation type="unfinished">Find:</translation>
+ <translation>Cherche:</translation>
</message>
<message>
<source>REPLACE_LABEL</source>
- <translation type="unfinished">Replace with:</translation>
+ <translation>Remplace avec:</translation>
</message>
<message>
<source>REPLACE_BTN</source>
- <translation type="unfinished">Replace</translation>
+ <translation>Remplace</translation>
</message>
<message>
<source>REPLACE_ALL_BTN</source>
- <translation type="unfinished">Replace All</translation>
+ <translation>Remplace tout</translation>
</message>
<message>
<source>CASE_SENSITIVE_CHECK</source>
- <translation type="unfinished">Case Sensitive</translation>
+ <translation>Sensible à la casse</translation>
</message>
<message>
<source>WHOLE_WORDS_CHECK</source>
- <translation type="unfinished">Whole Words Only</translation>
+ <translation>Mots entiers uniquement</translation>
</message>
<message>
<source>REGEX_CHECK</source>
- <translation type="unfinished">Use Regular Expressions</translation>
+ <translation>Utilise des expressions régulières</translation>
</message>
<message>
<source>NB_MATCHED_LABEL</source>
- <translation type="unfinished">%1 of %2 matches</translation>
+ <translation>%1 sur %2 correspond</translation>
</message>
</context>
</TS>
</message>
<message>
<source>GR_EDIT_SET</source>
- <translation type="unfinished">Editor settings</translation>
+ <translation>エディタの設定</translation>
</message>
<message>
<source>LBL_COMPLETION_MODE</source>
- <translation type="unfinished">Completion mode</translation>
+ <translation>完全モード</translation>
</message>
<message>
<source>LBL_NONE</source>
- <translation type="unfinished">None</translation>
+ <translation>なし</translation>
</message>
<message>
<source>LBL_AUTO</source>
- <translation type="unfinished">Auto</translation>
+ <translation>自動</translation>
</message>
<message>
<source>LBL_MANUAL</source>
- <translation type="unfinished">Manual</translation>
+ <translation>手動</translation>
</message>
<message>
<source>LBL_ALWAYS</source>
- <translation type="unfinished">Always</translation>
+ <translation>常時</translation>
</message>
<message>
<source>GR_TAB_SET</source>
</message>
<message>
<source>ACT_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>検索</translation>
</message>
<message>
<source>TTP_FIND</source>
- <translation type="unfinished">Find</translation>
+ <translation>検索</translation>
</message>
<message>
<source>DSC_FIND</source>
- <translation type="unfinished">Find text</translation>
+ <translation>テキストの検索</translation>
</message>
<message>
<source>ACT_REPLACE</source>
- <translation type="unfinished">Replace</translation>
+ <translation>置換</translation>
</message>
<message>
<source>TTP_REPLACE</source>
- <translation type="unfinished">Find & Replace</translation>
+ <translation>検索と置換</translation>
</message>
<message>
<source>DSC_REPLACE</source>
- <translation type="unfinished">Find and replace text</translation>
+ <translation>テキストの検索と置換</translation>
</message>
<message>
<source>ACT_PREFERENCES</source>
</message>
<message>
<source>WRN_READ_FILE</source>
- <translation>ファイルが読めません %1:
-%2.</translation>
+ <translation>ファイルが読めません %1:\n%2.</translation>
</message>
<message>
<source>WRN_WRITE_FILE</source>
- <translation>ファイルが書き込めません %1:
-%2.</translation>
+ <translation>ファイルが書き込めません %1:\n%2.</translation>
</message>
<message>
<source>STS_READY</source>
<name>PyEditor</name>
<message>
<source>PROGRAM_DESCRIPTION</source>
- <translation>Pythonのエディタ</translation>
+ <translation>簡易 Python エディタ</translation>
</message>
<message>
<source>FILE_PARAM_NAME</source>
- <translation type="unfinished">file</translation>
+ <translation>ファイル</translation>
</message>
<message>
<source>FILE_PARAM_DESCRIPTION</source>
- <translation type="unfinished">File to edit.</translation>
+ <translation>ファイルの編集</translation>
</message>
</context>
<context>
<name>PyEditor_FindTool</name>
<message>
<source>FIND_LABEL</source>
- <translation type="unfinished">Find:</translation>
+ <translation>Find:</translation>
</message>
<message>
<source>REPLACE_LABEL</source>
- <translation type="unfinished">Replace with:</translation>
+ <translation>Replace with:</translation>
</message>
<message>
<source>REPLACE_BTN</source>
- <translation type="unfinished">Replace</translation>
+ <translation>置換</translation>
</message>
<message>
<source>REPLACE_ALL_BTN</source>
- <translation type="unfinished">Replace All</translation>
+ <translation>全て置換</translation>
</message>
<message>
<source>CASE_SENSITIVE_CHECK</source>
- <translation type="unfinished">Case Sensitive</translation>
+ <translation>大文字と小文字を区別</translation>
</message>
<message>
<source>WHOLE_WORDS_CHECK</source>
- <translation type="unfinished">Whole Words Only</translation>
+ <translation>完全に同一な単語のみ</translation>
</message>
<message>
<source>REGEX_CHECK</source>
- <translation type="unfinished">Use Regular Expressions</translation>
+ <translation>正規表現を使用</translation>
</message>
<message>
<source>NB_MATCHED_LABEL</source>
- <translation type="unfinished">%1 of %2 matches</translation>
+ <translation>%1 of %2 matches</translation>
</message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# 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
-#
-
-INCLUDE(${VTK_USE_FILE})
-
-ADD_LIBRARY(vtkTools vtkEDFCutter.cxx)
-TARGET_LINK_LIBRARIES(vtkTools ${VTK_LIBRARIES})
-INSTALL(TARGETS vtkTools EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-ADD_LIBRARY(vtkEDFOverloads vtkEDFFactory.cxx)
-TARGET_LINK_LIBRARIES(vtkEDFOverloads ${VTK_LIBRARIES} vtkTools)
-INSTALL(TARGETS vtkEDFOverloads EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_GUI_INSTALL_PARAVIEW_LIBS})
-
-FILE(GLOB COMMON_HEADERS_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
-INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${SALOME_INSTALL_HEADERS})
+++ /dev/null
-// Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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
-//
-
-#include "vtkEDFCutter.h"
-
-#include "vtkInformationVector.h"
-#include "vtkInformation.h"
-#include "vtkSmartPointer.h"
-#include "vtkGenericCell.h"
-#include "vtkPolyData.h"
-#include "vtkObjectFactory.h"
-#include "vtkIdTypeArray.h"
-#include "vtkCellData.h"
-#include "vtkCellArray.h"
-#include "vtkIdList.h"
-
-#include <list>
-#include <set>
-#include <map>
-#include <deque>
-
-class vtkEDFEdge
-{
-public :
- vtkIdType v0;
- vtkIdType v1;
-
- vtkEDFEdge(vtkIdType a, vtkIdType b) : v0(a), v1(b){}
- vtkEDFEdge(){}
-};
-
-bool operator == (const vtkEDFEdge& e0, const vtkEDFEdge& e1)
-{
- return (e0.v0 == e1.v0 && e0.v1 == e1.v1) ||
- (e0.v1 == e1.v0 && e0.v0 == e1.v1);
-}
-
-bool operator != (const vtkEDFEdge& e0, const vtkEDFEdge& e1)
-{
- return !(e0==e1);
-}
-
-bool operator < (const vtkEDFEdge& e0, const vtkEDFEdge& e1)
-{
- vtkEDFEdge the_e0;
- vtkEDFEdge the_e1;
- if(e0.v0 < e0.v1)
- {
- the_e0.v0 = e0.v0;
- the_e0.v1 = e0.v1;
- }
- else
- {
- the_e0.v0 = e0.v1;
- the_e0.v1 = e0.v0;
- }
- if(e1.v0 < e1.v1)
- {
- the_e1.v0 = e1.v0;
- the_e1.v1 = e1.v1;
- }
- else
- {
- the_e1.v0 = e1.v1;
- the_e1.v1 = e1.v0;
- }
-
- if(the_e0.v0 == the_e1.v0)
- return (the_e0.v1 < the_e1.v1);
-
- return the_e0.v0 < the_e1.v0;
-}
-
-vtkStandardNewMacro(vtkEDFCutter);
-
-vtkEDFCutter::vtkEDFCutter()
-{
- this->OriginalCellIdsName = NULL;
-}
-
-vtkEDFCutter::~vtkEDFCutter()
-{
- this->SetOriginalCellIdsName(NULL);
-}
-
-int vtkEDFCutter::RequestData(vtkInformation * request,
- vtkInformationVector ** inVector,
- vtkInformationVector * outVector)
-{
- // get the info objects
- vtkInformation *inInfo = inVector[0]->GetInformationObject(0);
- vtkInformation *outInfo = outVector->GetInformationObject(0);
-
- // get the input and output
- vtkDataSet *input = vtkDataSet::SafeDownCast(
- inInfo->Get(vtkDataObject::DATA_OBJECT()));
-
- vtkSmartPointer<vtkIdTypeArray> cellIdArray =
- vtkSmartPointer<vtkIdTypeArray>::New();
- cellIdArray->SetName(this->GetOriginalCellIdsName());
- cellIdArray->SetNumberOfComponents(1);
- cellIdArray->SetNumberOfTuples(input->GetNumberOfCells());
- for(vtkIdType id=0; id < cellIdArray->GetNumberOfTuples(); id++)
- {
- cellIdArray->SetTuple1(id, id);
- }
- input->GetCellData()->AddArray(cellIdArray);
-
- int ret = this->Superclass::RequestData(request, inVector, outVector);
-
- if(ret == 0)
- return 0;
-
- vtkPolyData *output = vtkPolyData::SafeDownCast(
- outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
- vtkSmartPointer<vtkPolyData> tmpOutput;
- tmpOutput.TakeReference(output->NewInstance());
-
- this->AssembleOutputTriangles(output, tmpOutput);
-
- output->ShallowCopy(tmpOutput);
-
- return ret;
-}
-
-
-void vtkEDFCutter::AssembleOutputTriangles(vtkPolyData* inpd,
- vtkPolyData* outpd)
-{
- outpd->ShallowCopy(inpd);
-
- vtkIdTypeArray* originalCellIds = vtkIdTypeArray::SafeDownCast(
- inpd->GetCellData()->GetArray(this->GetOriginalCellIdsName()));
-
- if(originalCellIds == NULL)
- {
- return;
- }
-
- outpd->GetCellData()->Initialize();
- outpd->GetCellData()->CopyAllocate(inpd->GetCellData());
-
- vtkSmartPointer<vtkCellArray> verts = vtkSmartPointer<vtkCellArray>::New();
- vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
- vtkSmartPointer<vtkCellArray> polys = vtkSmartPointer<vtkCellArray>::New();
- vtkSmartPointer<vtkCellArray> strips = vtkSmartPointer<vtkCellArray>::New();
- outpd->SetVerts(verts);
- outpd->SetLines(lines);
- outpd->SetPolys(polys);
- outpd->SetStrips(strips);
-
- for(vtkIdType cellId=0; cellId<inpd->GetNumberOfCells(); cellId++)
- {
- unsigned char type = inpd->GetCellType(cellId);
- if(type != VTK_TRIANGLE)
- {
- vtkIdType npts;
- vtkIdType* pts = NULL;
- inpd->GetCellPoints(cellId, npts, pts);
- vtkIdType newCellId =
- outpd->InsertNextCell(type, npts, pts);
- outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
- }
- else
- {
- vtkIdType cellIdEnd = cellId+1;
- vtkIdType originalCellId = originalCellIds->GetValue(cellId);
- while(cellIdEnd < inpd->GetNumberOfCells() &&
- inpd->GetCellType(cellIdEnd) == VTK_TRIANGLE &&
- originalCellIds->GetValue(cellIdEnd) == originalCellId)
- {
- cellIdEnd++;
- }
-
- // all triangles from cellId to cellIdEnd come from the same
- // original cell.
-
- // A batch is composed of triangles which are connected by the edges.
- std::map<vtkIdType, std::set<vtkIdType> > connectedTriangles;
- for(vtkIdType firstCell = cellId; firstCell < cellIdEnd-1; firstCell++)
- {
- vtkIdType npts;
- vtkIdType* pts = NULL;
- inpd->GetCellPoints(firstCell, npts, pts);
- vtkEDFEdge fe0 = vtkEDFEdge(pts[0], pts[1]);
- vtkEDFEdge fe1 = vtkEDFEdge(pts[1], pts[2]);
- vtkEDFEdge fe2 = vtkEDFEdge(pts[2], pts[0]);
- for(vtkIdType secondCell = firstCell+1; secondCell < cellIdEnd; secondCell++)
- {
- vtkIdType snpts;
- vtkIdType* spts = NULL;
- inpd->GetCellPoints(secondCell, snpts, spts);
- vtkEDFEdge se0 = vtkEDFEdge(spts[0], spts[1]);
- vtkEDFEdge se1 = vtkEDFEdge(spts[1], spts[2]);
- vtkEDFEdge se2 = vtkEDFEdge(spts[2], spts[0]);
-
- if(fe0 == se0 || fe0 == se1 || fe0 == se2 ||
- fe1 == se0 || fe1 == se1 || fe1 == se2 ||
- fe2 == se0 || fe2 == se1 || fe2 == se2)
- {
- connectedTriangles[firstCell].insert(secondCell);
- connectedTriangles[secondCell].insert(firstCell);
- }
- }
- }
-
- std::set<vtkIdType> visitedCell;
- for(vtkIdType id=cellId; id<cellIdEnd; id++)
- {
- if(visitedCell.find(id) != visitedCell.end())
- continue;
-
- // if this cell has not yet been visited, I create a batch of all
- // cells connected to this one
-
- visitedCell.insert(id);
- std::set<vtkIdType> batch;
- std::list<vtkIdType> cellList;
- cellList.push_back(id);
- while(cellList.size() > 0)
- {
- vtkIdType currentId = *(cellList.begin());
- batch.insert(currentId);
- cellList.pop_front();
- if(connectedTriangles.find(currentId) != connectedTriangles.end())
- {
- const std::set<vtkIdType>& adj = connectedTriangles[currentId];
- std::set<vtkIdType>::const_iterator it = adj.begin();
- while(it != adj.end())
- {
- vtkIdType other = *it;
- if(visitedCell.find(other) == visitedCell.end())
- {
- cellList.push_back(other);
- visitedCell.insert(other);
- }
- it++;
- }
- }
- }
-
-
-
- // then I add this batch to the output,
- // creating a unique cell for the whole batch.
-
- if(batch.size() == 1)
- {
- vtkIdType tid = *(batch.begin());
- vtkIdType npts;
- vtkIdType* pts = NULL;
- inpd->GetCellPoints(tid, npts, pts);
- vtkIdType newCellId =
- outpd->InsertNextCell(VTK_TRIANGLE, npts, pts);
- outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
- }
- else if(batch.size() == 2)
- { // two triangles connected together --> create a VTK_QUAD
- vtkIdType fid = *(batch.begin());
- vtkIdType sid = *(batch.rbegin());
- vtkIdType fnpts;
- vtkIdType* fpts = NULL;
- inpd->GetCellPoints(fid, fnpts, fpts);
- vtkIdType snpts;
- vtkIdType* spts = NULL;
- inpd->GetCellPoints(sid, snpts, spts);
-
- int findex = 0;
- vtkIdType fv = fpts[findex];
- while(((fv == spts[0]) ||
- (fv == spts[1]) ||
- (fv == spts[2])) && findex < 3)
- {
- findex++;
- fv = fpts[findex];
- }
- if(findex == 3)
- {// this is a degenerate case : one of the triangles use
- // only 2 vertices
- findex = 0;
- }
- int sindex = 0;
- vtkIdType sv = spts[sindex];
- while(((sv == fpts[0]) ||
- (sv == fpts[1]) ||
- (sv == fpts[2])) && sindex < 3)
- {
- sindex++;
- sv = spts[sindex];
- }
- if(sindex == 3)
- {// this is a degenerate case : one of the triangles use
- // only 2 vertices
- sindex = 0;
- }
-
- vtkIdType pts[4];
- pts[0] = fpts[findex];
- pts[1] = fpts[(findex+1)%3];
- pts[2] = spts[sindex];
- pts[3] = fpts[(findex+2)%3];
-
- vtkIdType newCellId = outpd->InsertNextCell(VTK_QUAD, 4, pts);
- outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
- }
- else
- {
- std::deque<vtkEDFEdge> contour;
-
- std::list<vtkIdType> toVisit;
- std::set<vtkIdType> visited;
-
- toVisit.push_back(*(batch.begin()));
-
- std::set<vtkIdType> triedAgain;
-
- while(toVisit.size() > 0)
- {
- vtkIdType currentId = *(toVisit.begin());
- toVisit.pop_front();
- if(visited.find(currentId) != visited.end())
- continue;
-
- visited.insert(currentId);
- const std::set<vtkIdType>& adj = connectedTriangles[currentId];
- std::set<vtkIdType>::const_iterator it = adj.begin();
- while(it != adj.end())
- {
- vtkIdType adjid = *it;
- it++;
- if(visited.find(adjid) != visited.end())
- continue;
-
- toVisit.push_back(adjid);
- }
-
- vtkIdType npts;
- vtkIdType* pts = NULL;
- inpd->GetCellPoints(currentId, npts, pts);
- vtkEDFEdge edge[3] = {vtkEDFEdge(pts[0], pts[1]),
- vtkEDFEdge(pts[1], pts[2]),
- vtkEDFEdge(pts[2], pts[0])};
-
- // special case : initialization of the contour
- if(contour.size() == 0)
- {
- contour.push_back(edge[0]);
- contour.push_back(edge[1]);
- contour.push_back(edge[2]);
- continue;
- }
-
- // Find which edge of the contour
- // is connected to the current triangle
- int orient = 0;
- std::deque<vtkEDFEdge>::iterator contourit = contour.begin();
- bool found = false;
- while(contourit != contour.end())
- {
- vtkEDFEdge& e = *contourit;
- for(orient = 0; orient<3; orient++)
- {
- if(e == edge[orient])
- {
- found = true;
- break;
- }
- }
- if(found)
- break;
-
- contourit++;
- }
- if(contourit == contour.end())
- {// this triangle is not connected to the current contour.
- // put it back in the queue for later processing
- if(triedAgain.find(currentId) == triedAgain.end())
- {
- triedAgain.insert(currentId);
- toVisit.push_back(currentId);
- visited.erase(currentId);
- continue;
- }
- else
- {
- vtkDebugMacro( << "triangle " << currentId
- << "could not be added to the contour of the current batch");
- continue;
- }
- }
- // if I reach this point, I will add the triangle to the contour
- // --> the contour will be modified and I can try again
- // to add the previously rejected triangles
- triedAgain.clear();
-
- // Now, merge the edges of the current triangle with
- // the contour
- vtkEDFEdge& tbeforeedge = edge[(orient+1)%3];
- vtkEDFEdge& tafteredge = edge[(orient+2)%3];
-
- std::deque<vtkEDFEdge>::iterator beforeit;
- if(contourit == contour.begin())
- beforeit = contour.end()-1;
- else
- beforeit = contourit - 1;
- vtkEDFEdge& beforeedge = *beforeit;
-
- std::deque<vtkEDFEdge>::iterator afterit;
- if(contourit == contour.end()-1)
- afterit = contour.begin();
- else
- afterit = contourit + 1;
- vtkEDFEdge& afteredge = *afterit;
-
- if(beforeedge == tbeforeedge)
- {
- if(afteredge == tafteredge)
- {// in this case, I am adding a triangle that is fully inside
- // the contour. I need to remove the three edges from the
- // contour.
- if(contour.size() == 3)
- {
- contour.clear();
- }
- else
- {
- std::deque<vtkEDFEdge>::iterator lastit;
- if(afterit == contour.end()-1)
- lastit = contour.begin();
- else
- lastit = afterit + 1;
-
- if(lastit < beforeit)
- {
- contour.erase(beforeit, contour.end());
- contour.erase(contour.begin(), lastit);
- }
- else
- {
- contour.erase(beforeit, lastit);
- }
- }
- }
- else
- {// the edge before is the glued, remove the two adjacent edges
- // and add the edge after
- if(beforeit == contour.end()-1)
- {
- contour.erase(beforeit, contour.end());
- contour.erase(contour.begin(), contour.begin()+1);
- contour.push_back(tafteredge);
- }
- else
- {
- int index = beforeit - contour.begin();
- contour.erase(beforeit, contourit+1);
- contour.insert(contour.begin()+index, tafteredge);
- }
- }
- }
- else if(afteredge == tafteredge)
- {// the edge after is glued, removed the two glued edges and add
- // the edge new edge
- if(contourit == contour.end() -1)
- {
- contour.erase(contour.end() - 1);
- contour.erase(contour.begin());
- contour.push_back(tbeforeedge);
- }
- else
- {
- int index = contourit - contour.begin();
- contour.erase(contourit, afterit+1);
- contour.insert(contour.begin()+index, tbeforeedge);
- }
- }
- else
- {
- int index = contourit - contour.begin();
- contour.erase(contourit);
- contour.insert(contour.begin()+index, tbeforeedge);
- contour.insert(contour.begin()+index+1, tafteredge);
- }
- }
- vtkSmartPointer<vtkIdList> ids = vtkSmartPointer<vtkIdList>::New();
- std::deque<vtkEDFEdge>::iterator cit = contour.begin();
- while(cit != contour.end())
- {
- vtkEDFEdge& e = *cit;
- cit++;
- ids->InsertNextId(e.v0);
- }
-
- vtkIdType newCellId = outpd->InsertNextCell(VTK_POLYGON, ids);
- outpd->GetCellData()->CopyData(inpd->GetCellData(), cellId, newCellId);
- }
- }
- cellId = cellIdEnd - 1;
- }
- }
-}
-
-void vtkEDFCutter::PrintSelf(ostream& os, vtkIndent indent)
-{
- this->Superclass::PrintSelf(os, indent);
-}
-
-
+++ /dev/null
-// Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 __vtkEDFCutter_h__
-#define __vtkEDFCutter_h__
-
-#include "vtkEDFOverloadsDefines.h"
-#include "vtkCutter.h"
-
-class VTKTOOLS_EXPORT vtkEDFCutter : public vtkCutter
-{
-public :
- static vtkEDFCutter* New();
- vtkTypeMacro(vtkEDFCutter, vtkCutter);
- void PrintSelf(ostream& os, vtkIndent indent);
-
- // Description:
- // these ivars
- // control the name given to the field in which the ids are written into. If
- // set to NULL, then vtkOriginalCellIds or vtkOriginalPointIds (the default)
- // is used, respectively.
- vtkSetStringMacro(OriginalCellIdsName);
- virtual const char *GetOriginalCellIdsName() {
- return ( this->OriginalCellIdsName
- ? this->OriginalCellIdsName : "vtkOriginalCellIds");
- }
-
-protected :
- virtual int RequestData(vtkInformation *,
- vtkInformationVector **,
- vtkInformationVector *);
-
- virtual void AssembleOutputTriangles(vtkPolyData* inpd,
- vtkPolyData* outpd);
-
- char* OriginalCellIdsName;
-
- vtkEDFCutter();
- ~vtkEDFCutter();
-
-private:
- vtkEDFCutter(const vtkEDFCutter&); // Not implemented.
- void operator=(const vtkEDFCutter&); // Not implemented.
-};
-
-#endif //__vtkEDFCutter_h__
+++ /dev/null
-// Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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
-//
-
-#include "vtkEDFFactory.h"
-#include "vtkVersion.h"
-#include "vtkEDFCutter.h"
-
-vtkStandardNewMacro(vtkEDFFactory);
-
-VTK_CREATE_CREATE_FUNCTION(vtkEDFCutter);
-
-vtkEDFFactory::vtkEDFFactory()
-{
- this->RegisterOverride("vtkCutter",
- "vtkEDFCutter",
- "MergeTriangles",
- 1,
- vtkObjectFactoryCreatevtkEDFCutter);
-}
-
-const char* vtkEDFFactory::GetVTKSourceVersion()
-{
- return VTK_SOURCE_VERSION;
-}
-
-const char* vtkEDFFactory::GetDescription()
-{
- return "VTK EDF Factory";
-}
-
-#ifdef WIN32
- //RNV: workaround to avoid definition __declspec( dllimport )
- //for the vtkGetFactoryCompilerUsed(), vtkGetFactoryVersion()
- //and vtkLoad(). This happens because of a bug in the
- //vtkObjectFactory.h file.
- //This workaround will be removed in the future as soon as
- //mentioned bug is fixed.
- #ifdef VTK_FACTORY_INTERFACE_IMPLEMENT
- #undef VTK_FACTORY_INTERFACE_IMPLEMENT
-
- #define VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName) \
- extern "C" \
- VTKEDF_OVERLOADS_EXPORT \
- const char* vtkGetFactoryCompilerUsed() \
- { \
- return VTK_CXX_COMPILER; \
- } \
- extern "C" \
- VTKEDF_OVERLOADS_EXPORT \
- const char* vtkGetFactoryVersion() \
- { \
- return VTK_SOURCE_VERSION; \
- } \
- extern "C" \
- VTKEDF_OVERLOADS_EXPORT \
- vtkObjectFactory* vtkLoad() \
- { \
- return factoryName ::New(); \
- }
- #endif
-#endif
-
-
-VTK_FACTORY_INTERFACE_IMPLEMENT(vtkEDFFactory);
+++ /dev/null
-// Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 __vtkEDFFactory_h
-#define __vtkEDFFactory_h
-
-#include "vtkEDFOverloadsDefines.h"
-#include "vtkObjectFactory.h"
-
-class VTKEDF_OVERLOADS_EXPORT vtkEDFFactory : public vtkObjectFactory
-{
-public:
-// Methods from vtkObject
- vtkTypeMacro(vtkEDFFactory,vtkObjectFactory);
- static vtkEDFFactory *New();
-
- virtual const char* GetVTKSourceVersion();
- virtual const char* GetDescription();
-protected:
- vtkEDFFactory();
-private:
- vtkEDFFactory(const vtkEDFFactory&); // Not implemented.
- void operator=(const vtkEDFFactory&); // Not implemented.
-};
-
-extern "C" VTK_EXPORT vtkObjectFactory* vtkLoad();
-#endif
+++ /dev/null
-// Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// 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 VTKEDF_OVERLOADS_DEFINES_H
-#define VTKEDF_OVERLOADS_DEFINES_H
-
-#if defined WIN32
-# if defined VTKEDF_OVERLOADS_EXPORTS || defined vtkEDFOverloads_EXPORTS
-# define VTKEDF_OVERLOADS_EXPORT __declspec( dllexport )
-# else
-# define VTKEDF_OVERLOADS_EXPORT __declspec( dllimport )
-# endif
-
-# if defined VTKTOOLS_EXPORTS || defined vtkTools_EXPORTS
-# define VTKTOOLS_EXPORT __declspec( dllexport )
-# else
-# define VTKTOOLS_EXPORT __declspec( dllimport )
-# endif
-
-#else
-# define VTKEDF_OVERLOADS_EXPORT
-# define VTKTOOLS_EXPORT
-#endif //WIN32
-
-#endif //VTKEDF_OVERLOADS_DEFINES_H