mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
Fix problems with displaying Dependency tree on Windows platform.
This commit is contained in:
parent
b5261a9818
commit
80531775fd
@ -63,7 +63,8 @@ myIsMainObject( false )
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
if ( !app ) return;
|
||||
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
|
||||
int studyId = GeometryGUI::ClientStudyToStudy( study->studyDS())->StudyId();
|
||||
SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy( study->studyDS() );
|
||||
int studyId = aStudyDS->StudyId();
|
||||
myGeomObject = GeometryGUI::GetGeomGen()->GetObject( studyId, myEntry.c_str() );
|
||||
|
||||
updateName();
|
||||
@ -167,9 +168,9 @@ void DependencyTree_Object::updateName()
|
||||
{
|
||||
|
||||
QString name = myGeomObject->GetName();
|
||||
QString studyEntry = myGeomObject->GetStudyEntry();
|
||||
CORBA::String_var studyEntryVar = myGeomObject->GetStudyEntry();
|
||||
|
||||
if( studyEntry.isEmpty() ) {
|
||||
if( QString( studyEntryVar.in() ).isEmpty() ) {
|
||||
if( name.isEmpty() )
|
||||
name = "unpublished";
|
||||
myColor = myUnpublishObjectColor;
|
||||
@ -203,8 +204,8 @@ void DependencyTree_Object::updateName()
|
||||
//=================================================================================
|
||||
void DependencyTree_Object::setColor( const QColor& theColor )
|
||||
{
|
||||
QString studyEntry = myGeomObject->GetStudyEntry();
|
||||
if( studyEntry.isEmpty() )
|
||||
CORBA::String_var studyEntryVar = myGeomObject->GetStudyEntry();
|
||||
if( QString( studyEntryVar.in() ).isEmpty() )
|
||||
myColor = myUnpublishObjectColor;
|
||||
else
|
||||
myColor = theColor;
|
||||
@ -236,8 +237,8 @@ void DependencyTree_Object::setMainObjectColor( const QColor& theColor )
|
||||
void DependencyTree_Object::setUnpublishObjectColor( const QColor& theColor )
|
||||
{
|
||||
myUnpublishObjectColor = theColor;
|
||||
QString studyEntry = myGeomObject->GetStudyEntry();
|
||||
if( studyEntry.isEmpty() )
|
||||
CORBA::String_var studyEntryVar = myGeomObject->GetStudyEntry();
|
||||
if( QString( studyEntryVar.in() ).isEmpty() )
|
||||
myColor = myUnpublishObjectColor;
|
||||
}
|
||||
|
||||
|
@ -48,23 +48,25 @@ void DependencyTree_Selector::getSelection( SUIT_DataOwnerPtrList& theList ) con
|
||||
{
|
||||
for( myView->initSelected(); myView->moreSelected(); myView->nextSelected() )
|
||||
if( DependencyTree_Object* treeObject = dynamic_cast<DependencyTree_Object*>( myView->selectedObject() ) ) {
|
||||
const char* entry;
|
||||
const char* name;
|
||||
QString studyEntry;
|
||||
QString name;
|
||||
GEOM::GEOM_BaseObject_var anObj = GeometryGUI::GetGeomGen()->GetObject( myView->getStudyId(),
|
||||
treeObject->getEntry().c_str() );
|
||||
if( anObj->_is_nil() )
|
||||
continue;
|
||||
QString studyEntry = anObj->GetStudyEntry();
|
||||
CORBA::String_var studyEntryVar = anObj->GetStudyEntry();
|
||||
studyEntry = studyEntryVar.in();
|
||||
if( studyEntry.isEmpty() ) {
|
||||
entry = treeObject->getEntry().c_str();
|
||||
studyEntry = treeObject->getEntry().c_str();
|
||||
name = "TEMP_IO_UNPUBLISHED";
|
||||
}
|
||||
else {
|
||||
entry = studyEntry.toStdString().c_str();
|
||||
name = "TEMP_IO";
|
||||
}
|
||||
Handle(SALOME_InteractiveObject) tmpIO =
|
||||
new SALOME_InteractiveObject( entry, "GEOM", name);
|
||||
new SALOME_InteractiveObject( studyEntry.toStdString().c_str(),
|
||||
"GEOM",
|
||||
name.toStdString().c_str());
|
||||
|
||||
theList.append( new LightApp_DataOwner( tmpIO ) );
|
||||
}
|
||||
|
@ -594,7 +594,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 * ( level->second.size() - 1 ) / 2;
|
||||
int step = -horDistance * ( int(level->second.size()) - 1 ) / 2;
|
||||
for( int objIter = 0; objIter < level->second.size(); objIter++ ) {
|
||||
DependencyTree_Object* anObject = myTreeMap[ level->second.at( objIter ) ];
|
||||
anObject->setPos( step, verDistance * level->first );
|
||||
|
Loading…
Reference in New Issue
Block a user