mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-14 02:30:35 +05:00
IPAL54049: Operations on multiple study objects are very long
Most of time was spent in GEOM_Displayer::UpdateColorScale() { myApp->selectionMgr()->selectedObjects( aSelectedObjects ); }
This commit is contained in:
parent
7c7eefda24
commit
fb044eba69
@ -322,8 +322,8 @@ void BuildGUI_FaceDlg::updateConstraintsTree()
|
||||
return;
|
||||
|
||||
for ( int i = 0, n = aList->length(); i < n; i++ ) {
|
||||
TreeWidgetItem* item = new TreeWidgetItem( myTreeConstraints,
|
||||
GEOM::GeomObjPtr( aList[i] ) );
|
||||
/*TreeWidgetItem* item =*/
|
||||
new TreeWidgetItem( myTreeConstraints, GEOM::GeomObjPtr( aList[i] ) );
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setEnabled(false);
|
||||
|
@ -475,10 +475,10 @@ void DependencyTree_View::parseTree()
|
||||
std::string objectEntry = i->first;
|
||||
addNode( objectEntry );
|
||||
parseTreeWard( i->second.first );
|
||||
if( i->second.first.size() > myMaxUpwardLevelsNumber )
|
||||
if((int) i->second.first.size() > myMaxUpwardLevelsNumber )
|
||||
myMaxUpwardLevelsNumber = i->second.first.size();
|
||||
parseTreeWard( i->second.second );
|
||||
if( i->second.second.size() > myMaxDownwardLevelsNumber )
|
||||
if((int) i->second.second.size() > myMaxDownwardLevelsNumber )
|
||||
myMaxDownwardLevelsNumber = i->second.second.size();
|
||||
}
|
||||
|
||||
@ -518,13 +518,13 @@ void DependencyTree_View::parseTreeWard( const GEOMUtils::LevelsList& theWard )
|
||||
//=================================================================================
|
||||
void DependencyTree_View::parseTreeWardArrow( const GEOMUtils::LevelsList& theWard)
|
||||
{
|
||||
for( int j = 0; j < theWard.size(); j++ ) {
|
||||
for( size_t j = 0; j < theWard.size(); j++ ) {
|
||||
GEOMUtils::LevelInfo Level = theWard.at(j);
|
||||
GEOMUtils::LevelInfo::const_iterator node;
|
||||
for( node = Level.begin(); node != Level.end(); node++ ) {
|
||||
DependencyTree_Object* object = myTreeMap[ node->first ];
|
||||
std::vector<std::string> Links = node->second;
|
||||
for( int link = 0; link < Links.size(); link++ ) {
|
||||
for( size_t link = 0; link < Links.size(); link++ ) {
|
||||
DependencyTree_Object* LinkObject = myTreeMap[ Links[ link ] ];
|
||||
if( object && LinkObject )
|
||||
addArrow( LinkObject, object );
|
||||
@ -607,7 +607,7 @@ void DependencyTree_View::drawTree()
|
||||
std::map< int, std::vector< std::string > >::const_iterator level;
|
||||
for( level = levelObjects.begin(); level != levelObjects.end(); level++ ) {
|
||||
int step = -horDistance * ( int(level->second.size()) - 1 ) / 2;
|
||||
for( int objIter = 0; objIter < level->second.size(); objIter++ ) {
|
||||
for( size_t objIter = 0; objIter < level->second.size(); objIter++ ) {
|
||||
DependencyTree_Object* anObject = myTreeMap[ level->second.at( objIter ) ];
|
||||
anObject->setPos( step, verDistance * level->first );
|
||||
step += horDistance;
|
||||
@ -647,7 +647,7 @@ void DependencyTree_View::drawWard( const GEOMUtils::LevelsList& theWard,
|
||||
std::map< int, std::vector< std::string > >& theLevelObjects,
|
||||
int theCurrentLevel, const int theLevelStep )
|
||||
{
|
||||
for( int level = 0; level < theWard.size(); level++ ) {
|
||||
for( int level = 0, size = theWard.size(); level < size; level++ ) {
|
||||
if( level >= myLevelsNumber )
|
||||
return;
|
||||
theCurrentLevel += theLevelStep;
|
||||
@ -671,7 +671,7 @@ void DependencyTree_View::drawWard( const GEOMUtils::LevelsList& theWard,
|
||||
//=================================================================================
|
||||
void DependencyTree_View::drawWardArrows( const GEOMUtils::LevelsList& theWard )
|
||||
{
|
||||
for( int j = 0; j < theWard.size(); j++ ) {
|
||||
for( int j = 0, size = theWard.size(); j < size; j++ ) {
|
||||
if( j >= myLevelsNumber )
|
||||
break;
|
||||
GEOMUtils::LevelInfo Level = theWard.at(j);
|
||||
@ -679,7 +679,7 @@ void DependencyTree_View::drawWardArrows( const GEOMUtils::LevelsList& theWard )
|
||||
for( node = Level.begin(); node != Level.end(); node++ ) {
|
||||
DependencyTree_Object* object = myTreeMap[ node->first ];
|
||||
GEOMUtils::NodeLinks Links = node->second;
|
||||
for( int link = 0; link < Links.size(); link++ ) {
|
||||
for( size_t link = 0; link < Links.size(); link++ ) {
|
||||
DependencyTree_Object* LinkObject = myTreeMap[ Links[ link ] ];
|
||||
if( isItemAdded( object ) && isItemAdded( LinkObject ) ) {
|
||||
DependencyTree_Arrow* arrow = myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( LinkObject, object ) ];
|
||||
@ -824,4 +824,5 @@ int DependencyTree_View::checkMaxLevelsNumber()
|
||||
return myMaxUpwardLevelsNumber;
|
||||
else if( myDisplayDescendants->isChecked() )
|
||||
return myMaxDownwardLevelsNumber;
|
||||
return 0;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ GEOM::GEOM_Gen_ptr GEOMBase_Helper::getGeomEngine()
|
||||
// Purpose :
|
||||
//================================================================
|
||||
GEOMBase_Helper::GEOMBase_Helper( SUIT_Desktop* desktop )
|
||||
: myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false ),
|
||||
: myDisplayer( 0 ), myCommand( 0 ), myViewWindow( 0 ), isPreview( false ), myDesktop( desktop ),
|
||||
myIsApplyAndClose( false ), myIsOptimizedBrowsing( false ), myIsWaitCursorEnabled( true ),
|
||||
myIsDisableBrowsing(false), myIsDisplayResult(true)
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ SALOME_Prs* GEOMGUI_AnnotationMgr::CreatePresentation( const GEOMGUI_AnnotationA
|
||||
setDisplayProperties( aPresentation, aView, getEntry( theObject ).c_str() );
|
||||
|
||||
// add Prs to preview
|
||||
SUIT_ViewWindow* vw = getApplication()->desktop()->activeWindow();
|
||||
//SUIT_ViewWindow* vw = getApplication()->desktop()->activeWindow();
|
||||
SOCC_Prs* aPrs =
|
||||
dynamic_cast<SOCC_Prs*>( ( aView )->CreatePrs( 0 ) );
|
||||
|
||||
@ -424,7 +424,6 @@ void GEOMGUI_AnnotationMgr::UpdateVisibleAnnotations( const QString& theEntry, S
|
||||
|
||||
if ( !aShape.IsNull() ) {
|
||||
|
||||
gp_Ax3 aShapeLCS = gp_Ax3().Transformed( aShape.Location().Transformation() );
|
||||
GEOMGUI_AnnotationAttrs::SetupPresentation( aPresentation, aProperty, aShapeLCS );
|
||||
if ( aProperty.ShapeType == TopAbs_SHAPE ) {
|
||||
aPresentation->SetHilightShape( aShape );
|
||||
|
@ -538,10 +538,8 @@ bool GEOMGUI_Selection::isNameMode( const int index ) const
|
||||
|
||||
bool GEOMGUI_Selection::hasChildren( const _PTR(SObject)& obj )
|
||||
{
|
||||
if ( obj ) {
|
||||
// as soon as Use Case browser data tree was added
|
||||
return obj->GetStudy()->GetUseCaseBuilder()->HasChildren( obj );
|
||||
}
|
||||
return obj ? obj->GetStudy()->GetUseCaseBuilder()->HasChildren( obj ) : false;
|
||||
}
|
||||
|
||||
bool GEOMGUI_Selection::expandable( const _PTR(SObject)& obj )
|
||||
|
@ -464,7 +464,7 @@ static std::string getName( GEOM::GEOM_BaseObject_ptr object )
|
||||
*/
|
||||
//=================================================================
|
||||
GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
|
||||
: myIsRedisplayed( false )
|
||||
: myUpdateColorScale(true), myIsRedisplayed( false )
|
||||
{
|
||||
if( st )
|
||||
myApp = dynamic_cast<SalomeApp_Application*>( st->application() );
|
||||
@ -3046,11 +3046,10 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons
|
||||
Standard_Real aColorScaleMin = 0, aColorScaleMax = 0;
|
||||
Standard_Boolean anIsBoolean = Standard_False;
|
||||
|
||||
SALOME_ListIO aSelectedObjects;
|
||||
myApp->selectionMgr()->selectedObjects( aSelectedObjects );
|
||||
if( aSelectedObjects.Extent() == 1 )
|
||||
{
|
||||
Handle(SALOME_InteractiveObject) anIO = aSelectedObjects.First();
|
||||
Handle(SALOME_InteractiveObject) anIO;
|
||||
if ( myUpdateColorScale )
|
||||
anIO = myApp->selectionMgr()->soleSelectedObject();
|
||||
|
||||
if( !anIO.IsNull() )
|
||||
{
|
||||
SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( aViewModel->CreatePrs( anIO->getEntry() ) );
|
||||
@ -3087,7 +3086,6 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( anIsDisplayColorScale )
|
||||
{
|
||||
|
@ -230,6 +230,7 @@ public:
|
||||
|
||||
/* Update visibility and parameters of the currently selected field step's color scale */
|
||||
void UpdateColorScale( const bool theIsRedisplayFieldSteps = false, const bool updateViewer = true );
|
||||
void SetUpdateColorScale(bool toUpdate) { myUpdateColorScale = toUpdate; } // IPAL54049
|
||||
|
||||
protected:
|
||||
/* internal methods */
|
||||
@ -304,6 +305,7 @@ protected:
|
||||
#if OCC_VERSION_MAJOR >= 7
|
||||
Handle(AIS_ColorScale) myColorScale;
|
||||
#endif
|
||||
int myUpdateColorScale; // IPAL54049
|
||||
|
||||
// Attributes
|
||||
Quantity_Color myShadingColor;
|
||||
|
@ -1189,7 +1189,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
||||
|
||||
// ---- create menus --------------------------
|
||||
|
||||
int fileId = createMenu( tr( "MEN_FILE" ), -1, -1 );
|
||||
/*int fileId =*/ createMenu( tr( "MEN_FILE" ), -1, -1 );
|
||||
|
||||
int editId = createMenu( tr( "MEN_EDIT" ), -1, -1 );
|
||||
createMenu( GEOMOp::OpDelete, editId, -1 );
|
||||
@ -2246,7 +2246,7 @@ Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture
|
||||
|
||||
aTexture = new TColStd_HArray1OfByte (1, aStream->length());
|
||||
|
||||
for (int i = 0; i < aStream->length(); i++)
|
||||
for ( CORBA::ULong i = 0; i < aStream->length(); i++)
|
||||
aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
|
||||
aTextureMap[ theId ] = aTexture;
|
||||
}
|
||||
@ -2452,7 +2452,7 @@ void GeometryGUI::createPreferences()
|
||||
resMgr->value("resources", "GEOM", aFontFile);
|
||||
aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf";
|
||||
// add enginier font into combobox
|
||||
int fontID = QFontDatabase::addApplicationFont( aFontFile );
|
||||
/*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile );
|
||||
Handle(Font_SystemFont) sf = new Font_SystemFont(
|
||||
new TCollection_HAsciiString("Y14.5M-2009"),
|
||||
Font_FA_Regular,
|
||||
|
@ -90,25 +90,26 @@ static bool inUse( _PTR(Study) study, const QString& component, const QMap<QStri
|
||||
QMap<QString, GEOM::GEOM_BaseObject_var> gobjects;
|
||||
QMap<QString, QString>::ConstIterator oit;
|
||||
std::list<_PTR(SObject)> aSelectedSO;
|
||||
for ( oit = objects.begin(); oit != objects.end(); ++oit ) {
|
||||
for ( oit = objects.begin(); oit != objects.end(); ++oit )
|
||||
{
|
||||
_PTR(SObject) so = study->FindObjectID( oit.key().toLatin1().data() );
|
||||
if ( !so )
|
||||
continue;
|
||||
aSelectedSO.push_back(so);
|
||||
CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject( so );
|
||||
GEOM::GEOM_BaseObject_var geomObj_rem = GEOM::GEOM_BaseObject::_narrow( corbaObj_rem );
|
||||
if( CORBA::is_nil( geomObj_rem ) )
|
||||
continue;
|
||||
if ( ! CORBA::is_nil( geomObj_rem ))
|
||||
gobjects.insert( oit.key(), geomObj_rem );
|
||||
}
|
||||
|
||||
// Search References with other Modules
|
||||
std::list< _PTR(SObject) >::iterator itSO = aSelectedSO.begin();
|
||||
for ( ; itSO != aSelectedSO.end(); ++itSO ) {
|
||||
for ( ; itSO != aSelectedSO.end(); ++itSO )
|
||||
{
|
||||
std::vector<_PTR(SObject)> aReferences = study->FindDependances( *itSO );
|
||||
int aRefLength = aReferences.size();
|
||||
if (aRefLength) {
|
||||
for (int i = 0; i < aRefLength; i++) {
|
||||
for ( int i = 0; i < aRefLength; i++ )
|
||||
{
|
||||
_PTR(SObject) firstSO( aReferences[i] );
|
||||
_PTR(SComponent) aComponent = firstSO->GetFatherComponent();
|
||||
QString type = aComponent->ComponentDataType().c_str();
|
||||
@ -116,28 +117,34 @@ static bool inUse( _PTR(Study) study, const QString& component, const QMap<QStri
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// browse through all GEOM data tree
|
||||
// browse through all GEOM data tree to find an object with is not deleted and depends
|
||||
// on a deleted object
|
||||
_PTR(ChildIterator) it ( study->NewChildIterator( comp ) );
|
||||
for ( it->InitEx( true ); it->More(); it->Next() ) {
|
||||
_PTR(SObject) child( it->Value() );
|
||||
for ( it->InitEx( true ); it->More(); it->Next() )
|
||||
{
|
||||
_PTR(SObject) child = it->Value();
|
||||
QString childID = child->GetID().c_str();
|
||||
bool deleted = objects.contains( childID );
|
||||
if ( deleted )
|
||||
continue; // deleted object
|
||||
|
||||
CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( child );
|
||||
GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
|
||||
if ( CORBA::is_nil( geomObj ) )
|
||||
continue;
|
||||
|
||||
GEOM::ListOfGBO_var list = geomObj->GetDependency();
|
||||
if( list->length() == 0 )
|
||||
continue;
|
||||
GEOM::ListOfGBO_var dep = geomObj->GetDependency(); // child depends on dep
|
||||
for( CORBA::ULong i = 0; i < dep->length(); i++ )
|
||||
{
|
||||
CORBA::String_var id = dep[i]->GetStudyEntry();
|
||||
bool depends = objects.contains( id.in() ); // depends on deleted
|
||||
|
||||
for( int i = 0; i < list->length(); i++ ) {
|
||||
bool depends = false;
|
||||
bool deleted = false;
|
||||
QMap<QString, GEOM::GEOM_BaseObject_var>::Iterator git;
|
||||
for ( git = gobjects.begin(); git != gobjects.end() && ( !depends || !deleted ); ++git ) {
|
||||
depends = depends || list[i]->_is_equivalent( *git );
|
||||
deleted = deleted || git.key() == child->GetID().c_str() ;//geomObj->_is_equivalent( *git );
|
||||
for ( git = gobjects.begin(); git != gobjects.end() && ( !depends || !deleted ); ++git )
|
||||
{
|
||||
depends = depends || dep[i]->_is_equivalent( *git );
|
||||
deleted = deleted || git.key() == childID ;//geomObj->_is_equivalent( *git )
|
||||
}
|
||||
if ( depends && !deleted )
|
||||
return true;
|
||||
@ -444,6 +451,8 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
if ( !dlg.exec() )
|
||||
return; // operation is cancelled by user
|
||||
|
||||
SUIT_OverrideCursor wc;
|
||||
|
||||
// get currently opened views
|
||||
QList<SALOME_View*> views;
|
||||
SALOME_View* view;
|
||||
@ -457,7 +466,8 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
}
|
||||
|
||||
_PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
|
||||
GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
|
||||
GEOM_Displayer disp( appStudy );
|
||||
disp.SetUpdateColorScale( false ); // IPAL54049
|
||||
|
||||
if ( isComponentSelected ) {
|
||||
// GEOM component is selected: delete all objects recursively
|
||||
@ -469,7 +479,7 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
for ( it->InitEx( false ); it->More(); it->Next() ) {
|
||||
_PTR(SObject) child( it->Value() );
|
||||
// remove object from GEOM engine
|
||||
removeObjectWithChildren( child, aStudy, views, disp );
|
||||
removeObjectWithChildren( child, aStudy, views, &disp );
|
||||
// remove object from study
|
||||
aStudyBuilder->RemoveObjectWithChildren( child );
|
||||
// remove object from use case tree
|
||||
@ -491,7 +501,7 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
for ( it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) {
|
||||
_PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
|
||||
// remove object from GEOM engine
|
||||
removeObjectWithChildren( obj, aStudy, views, disp );
|
||||
removeObjectWithChildren( obj, aStudy, views, &disp );
|
||||
// remove objects from study
|
||||
aStudyBuilder->RemoveObjectWithChildren( obj );
|
||||
// remove object from use case tree
|
||||
@ -501,7 +511,7 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
for ( it = toBeDelFolders.begin(); it != toBeDelFolders.end(); ++it ) {
|
||||
_PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
|
||||
// remove object from GEOM engine
|
||||
removeObjectWithChildren( obj, aStudy, views, disp );
|
||||
removeObjectWithChildren( obj, aStudy, views, &disp );
|
||||
// remove objects from study
|
||||
aStudyBuilder->RemoveObjectWithChildren( obj );
|
||||
// remove object from use case tree
|
||||
|
@ -530,6 +530,8 @@ void GEOMToolsGUI::OnDiscloseConcealChildren( bool show )
|
||||
return;
|
||||
}
|
||||
|
||||
SUIT_OverrideCursor wc;
|
||||
disp->SetUpdateColorScale( false ); // IPAL54049
|
||||
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
|
||||
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
||||
|
||||
@ -538,10 +540,12 @@ void GEOMToolsGUI::OnDiscloseConcealChildren( bool show )
|
||||
if ( obj ) {
|
||||
_PTR(AttributeExpandable) aExp = B->FindOrCreateAttribute( obj, "AttributeExpandable" );
|
||||
aExp->SetExpandable( show );
|
||||
if(!show)
|
||||
if ( !show ) {
|
||||
disp->EraseWithChildren(IObject,true);
|
||||
}
|
||||
} // if ( obj )
|
||||
} // iterator
|
||||
disp->SetUpdateColorScale( true );
|
||||
}
|
||||
}
|
||||
app->updateObjectBrowser( false );
|
||||
@ -593,7 +597,8 @@ void GEOMToolsGUI::OnUnpublishObject() {
|
||||
QObject::tr( "WRN_STUDY_LOCKED" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
SUIT_OverrideCursor wc;
|
||||
disp->SetUpdateColorScale( false ); // IPAL54049
|
||||
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
|
||||
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
||||
|
||||
@ -612,6 +617,7 @@ void GEOMToolsGUI::OnUnpublishObject() {
|
||||
}
|
||||
} // if ( obj )
|
||||
} // iterator
|
||||
disp->SetUpdateColorScale( true ); // IPAL54049
|
||||
aSelMgr->clearSelected();
|
||||
}
|
||||
}
|
||||
@ -891,7 +897,7 @@ void GEOMToolsGUI::OnSortChildren()
|
||||
#ifndef DISABLE_GRAPHICSVIEW
|
||||
void GEOMToolsGUI::OnShowDependencyTree()
|
||||
{
|
||||
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
|
||||
//SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
|
||||
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
if ( !app ) return;
|
||||
|
@ -30,40 +30,54 @@
|
||||
#include <QGridLayout>
|
||||
#include <SUIT_MessageBox.h>
|
||||
|
||||
static bool isEntryLess( const QString& e1, const QString& e2 )
|
||||
#include <iostream>
|
||||
|
||||
namespace
|
||||
{
|
||||
QStringList el1 = e1.split(":");
|
||||
QStringList el2 = e2.split(":");
|
||||
int e1c = el1.count(), e2c = el2.count();
|
||||
for ( int i = 0; i < e1c && i < e2c; i++ ) {
|
||||
int id1 = el1[i].toInt();
|
||||
int id2 = el2[i].toInt();
|
||||
if ( id1 < id2 ) return true;
|
||||
else if ( id2 < id1 ) return false;
|
||||
struct NaturalCompare
|
||||
{
|
||||
bool operator () (const std::string& s1, const std::string& s2) const
|
||||
{
|
||||
// hope the entries are never empty and never equal
|
||||
int diff21 = 0;
|
||||
const char* p1 = s1.c_str();
|
||||
const char* p2 = s2.c_str();
|
||||
for ( ; ; ++p1, ++p2 )
|
||||
{
|
||||
if ( *p1 == *p2 )
|
||||
{
|
||||
if ( diff21 && !*p1 ) // both numbers ends
|
||||
return diff21 > 0;
|
||||
continue;
|
||||
}
|
||||
return el1.count() < el2.count();
|
||||
// different chars
|
||||
bool d1 = isdigit( *p1 );
|
||||
bool d2 = isdigit( *p2 );
|
||||
if ( d1 != d2 ) // one number is shorter then another
|
||||
return d2; // is s1 shorter?
|
||||
if ( !d1 && diff21 ) // both numbers ends
|
||||
return diff21 > 0;
|
||||
if ( !diff21 ) // remember the first difference
|
||||
diff21 = *p2 - *p1;
|
||||
}
|
||||
return diff21 > 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static QStringList objectsToNames( const QMap<QString, QString>& objects )
|
||||
{
|
||||
QStringList entries;
|
||||
for ( QMap<QString, QString>::ConstIterator it = objects.begin(); it != objects.end(); ++it ) {
|
||||
QString entry = it.key();
|
||||
QStringList::Iterator iter;
|
||||
bool added = false;
|
||||
for ( iter = entries.begin(); iter != entries.end() && !added; ++iter ) {
|
||||
if ( isEntryLess( entry, *iter ) ) {
|
||||
entries.insert( iter, entry );
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
if ( !added )
|
||||
entries.append( entry );
|
||||
}
|
||||
typedef std::map< std::string, QString, NaturalCompare > TSortMap;
|
||||
TSortMap sortedByEntry;
|
||||
for ( QMap<QString, QString>::ConstIterator it = objects.begin(); it != objects.end(); ++it )
|
||||
sortedByEntry.insert( sortedByEntry.end(), std::make_pair( it.key().toStdString(), it.value() ));
|
||||
|
||||
QStringList names;
|
||||
for ( int i = 0; i < entries.count(); i++ ) {
|
||||
int level = entries[i].count(":")-3;
|
||||
names.append( QString( level*2, ' ' ) + objects[ entries[i] ] );
|
||||
for ( TSortMap::iterator it = sortedByEntry.begin(); it != sortedByEntry.end(); ++it )
|
||||
{
|
||||
const std::string& entry = it->first;
|
||||
int level = std::count( entry.begin(), entry.end(), ':' ) - 3;
|
||||
names.append( QString( level * 2, ' ' ) + it->second );
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
@ -778,7 +778,7 @@ void GEOMToolsGUI_MaterialPropertiesDlg::SelectionIntoArgument()
|
||||
if ( study ) {
|
||||
SALOME_ListIO aSelList;
|
||||
aSelMgr->selectedObjects(aSelList);
|
||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||
/*int nbSel = */GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||
}
|
||||
myLineEditCurArg->setText( aString );
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ void GEOMToolsGUI_PublishDlg::clickOnApply() {
|
||||
}
|
||||
// show references if any
|
||||
std::vector< _PTR(SObject) > vso = aStudy->FindDependances(SO);
|
||||
for ( int i = 0; i < vso.size(); i++ ) {
|
||||
for ( size_t i = 0; i < vso.size(); i++ ) {
|
||||
_PTR(SObject) refObj = vso[i];
|
||||
aDrw = aBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" );
|
||||
aDrw->SetDrawable( true );
|
||||
|
@ -349,7 +349,7 @@ void GEOMToolsGUI_ReduceStudyDlg::checkVisibleIcon( QTreeWidget* theWidget )
|
||||
QTreeWidgetItemIterator it( theWidget );
|
||||
while(*it) {
|
||||
GEOMToolsGUI_TreeWidgetItem* item = dynamic_cast<GEOMToolsGUI_TreeWidgetItem*>(*it);
|
||||
const char* entry = item->getStudyEntry();
|
||||
//const char* entry = item->getStudyEntry();
|
||||
if( item->flags() & Qt::ItemIsSelectable )
|
||||
if( !item->isVisible() )
|
||||
isInvisible = true;
|
||||
|
@ -236,7 +236,7 @@ void MeasureGUI_AnnotationDlg::Init()
|
||||
myIsScreenFixed->setChecked( myAnnotationProperties.IsScreenFixed );
|
||||
|
||||
int aSubShapeTypeIndex = -1;
|
||||
int aTypesCount = aTypesCount = mySubShapeTypeCombo->count();
|
||||
int aTypesCount = mySubShapeTypeCombo->count();
|
||||
for ( int i = 0; i < aTypesCount && aSubShapeTypeIndex < 0; i++ ) {
|
||||
int aType = mySubShapeTypeCombo->itemData( i ).toInt();
|
||||
if ( aType == myAnnotationProperties.ShapeType )
|
||||
@ -290,7 +290,7 @@ void MeasureGUI_AnnotationDlg::Init()
|
||||
myIsScreenFixed->setChecked( myAnnotationProperties.IsScreenFixed );
|
||||
|
||||
int aSubShapeTypeIndex = -1;
|
||||
int aTypesCount = aTypesCount = mySubShapeTypeCombo->count();
|
||||
int aTypesCount = mySubShapeTypeCombo->count();
|
||||
for ( int i = 0; i < aTypesCount && aSubShapeTypeIndex < 0; i++ ) {
|
||||
int aType = mySubShapeTypeCombo->itemData( i ).toInt();
|
||||
if ( aType == myAnnotationProperties.ShapeType )
|
||||
|
@ -418,7 +418,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
|
||||
|
||||
myListBox2->clear();
|
||||
|
||||
if (aCurItem < aErrs.length()) {
|
||||
if (aCurItem < (int)aErrs.length()) {
|
||||
GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem];
|
||||
GEOM::ListOfLong aObjLst = aErr.incriminated;
|
||||
QStringList aSubShapeList;
|
||||
|
@ -281,17 +281,17 @@ bool XAOPlugin_ImportDlg::execute()
|
||||
QStringList anEntryList;
|
||||
anEntryList << addInStudy(m_mainShape, m_mainShape->GetName());
|
||||
m_mainShape->UnRegister();
|
||||
for (int i = 0; i < subShapes->length(); i++)
|
||||
for (CORBA::ULong i = 0; i < subShapes->length(); i++)
|
||||
{
|
||||
addInStudy(subShapes[i].in(), subShapes[i]->GetName());
|
||||
subShapes[i]->UnRegister();
|
||||
}
|
||||
for (int i = 0; i < groups->length(); i++)
|
||||
for (CORBA::ULong i = 0; i < groups->length(); i++)
|
||||
{
|
||||
addInStudy(groups[i].in(), groups[i]->GetName());
|
||||
groups[i]->UnRegister();
|
||||
}
|
||||
for (int i = 0; i < fields->length(); i++)
|
||||
for (CORBA::ULong i = 0; i < fields->length(); i++)
|
||||
{
|
||||
addFieldInStudy(fields[i].in(), m_mainShape);
|
||||
}
|
||||
@ -329,7 +329,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO
|
||||
|
||||
// add steps
|
||||
GEOM::ListOfLong_var steps = theField->GetSteps();
|
||||
for (int i = 0; i < steps->length(); ++i)
|
||||
for (CORBA::ULong i = 0; i < steps->length(); ++i)
|
||||
{
|
||||
GEOM::GEOM_FieldStep_ptr step = theField->GetStep(steps[i]);
|
||||
QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
|
||||
|
Loading…
Reference in New Issue
Block a user