This commit is contained in:
eap 2009-09-10 16:11:08 +00:00
parent 0244669837
commit 53254ff3ed
4 changed files with 1004 additions and 1004 deletions

View File

@ -99,7 +99,7 @@ namespace SMESH
_PTR(Study) aStudy = GetActiveStudyDocument(); _PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId(); CORBA::Long anId = aStudy->StudyId();
if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) { if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
aVisualObj->Update( true ); aVisualObj->Update( true );
} }
} }
catch ( SALOME::SALOME_Exception& exc ) { catch ( SALOME::SALOME_Exception& exc ) {
@ -235,7 +235,7 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ):
mySimulation = new SMESH::TNodeSimulation( SMESH::GetViewWindow( mySMESHGUI ) ); mySimulation = new SMESH::TNodeSimulation( SMESH::GetViewWindow( mySMESHGUI ) );
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",
tr( "ICON_DLG_NODE" ) ) ); tr( "ICON_DLG_NODE" ) ) );
QVBoxLayout* SMESHGUI_NodesDlgLayout = new QVBoxLayout( this ); QVBoxLayout* SMESHGUI_NodesDlgLayout = new QVBoxLayout( this );
SMESHGUI_NodesDlgLayout->setSpacing( SPACING ); SMESHGUI_NodesDlgLayout->setSpacing( SPACING );
@ -398,7 +398,7 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
if ( myMesh->_is_nil() ) { if ( myMesh->_is_nil() ) {
SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ), SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ),
tr( "MESH_IS_NOT_SELECTED" ) ); tr( "MESH_IS_NOT_SELECTED" ) );
return false; return false;
} }
@ -472,7 +472,7 @@ void SMESHGUI_NodesDlg::ClickOnHelp()
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() ); LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
if ( app ) if ( app )
app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
QString( "" ), myHelpFileName ); QString( "" ), myHelpFileName );
else { else {
QString platform; QString platform;
#ifdef WIN32 #ifdef WIN32
@ -481,10 +481,10 @@ void SMESHGUI_NodesDlg::ClickOnHelp()
platform = "application"; platform = "application";
#endif #endif
SUIT_MessageBox::warning( this, tr("WRN_WARNING"), SUIT_MessageBox::warning( this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg( app->resourceMgr()->stringValue( "ExternalBrowser", arg( app->resourceMgr()->stringValue( "ExternalBrowser",
platform ) ). platform ) ).
arg( myHelpFileName ) ); arg( myHelpFileName ) );
} }
} }
@ -508,19 +508,19 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument()
if ( myMesh->_is_nil() ) return; if ( myMesh->_is_nil() ) return;
QString aText; QString aText;
if ( SMESH::GetNameOfSelectedNodes( mySelector, anIO, aText ) == 1 ) { if ( SMESH::GetNameOfSelectedNodes( mySelector, anIO, aText ) == 1 ) {
if ( SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh.in() ) ) { if ( SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh.in() ) ) {
if ( SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh() ) { if ( SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh() ) {
if ( const SMDS_MeshNode* aNode = aMesh->FindNode( aText.toInt() ) ) { if ( const SMDS_MeshNode* aNode = aMesh->FindNode( aText.toInt() ) ) {
SpinBox_X->SetValue( aNode->X() ); SpinBox_X->SetValue( aNode->X() );
SpinBox_Y->SetValue( aNode->Y() ); SpinBox_Y->SetValue( aNode->Y() );
SpinBox_Z->SetValue( aNode->Z() ); SpinBox_Z->SetValue( aNode->Z() );
} }
} }
} }
} }
mySimulation->SetPosition( SpinBox_X->GetValue(), mySimulation->SetPosition( SpinBox_X->GetValue(),
SpinBox_Y->GetValue(), SpinBox_Y->GetValue(),
SpinBox_Z->GetValue() ); SpinBox_Z->GetValue() );
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -371,9 +371,9 @@ static void addReference (SALOMEDS::Study_ptr theStudy,
//============================================================================= //=============================================================================
SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
SALOMEDS::SObject_ptr theSObject, SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theIOR, CORBA::Object_ptr theIOR,
const char* theName) const char* theName)
throw (SALOME::SALOME_Exception) throw (SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
@ -468,9 +468,9 @@ static long findMaxChildTag( SALOMEDS::SObject_ptr theSObject )
if ( !aStudy->_is_nil() ) { if ( !aStudy->_is_nil() ) {
SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator( theSObject ); SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator( theSObject );
for ( ; anIter->More(); anIter->Next() ) { for ( ; anIter->More(); anIter->Next() ) {
long nTag = anIter->Value()->Tag(); long nTag = anIter->Value()->Tag();
if ( nTag > aTag ) if ( nTag > aTag )
aTag = nTag; aTag = nTag;
} }
} }
} }

View File

@ -95,8 +95,8 @@ int SMESH_Mesh_i::myIdGenerator = 0;
//============================================================================= //=============================================================================
SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
SMESH_Gen_i* gen_i, SMESH_Gen_i* gen_i,
CORBA::Long studyId ) CORBA::Long studyId )
: SALOME::GenericObj_i( thePOA ) : SALOME::GenericObj_i( thePOA )
{ {
MESSAGE("SMESH_Mesh_i"); MESSAGE("SMESH_Mesh_i");
@ -525,21 +525,21 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Object_ptr aS
SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
SMESH::SMESH_Hypothesis_ptr anHyp) SMESH::SMESH_Hypothesis_ptr anHyp)
{ {
if(MYDEBUG) MESSAGE("removeHypothesis()"); if(MYDEBUG) MESSAGE("removeHypothesis()");
// **** proposer liste de subShape (selection multiple) // **** proposer liste de subShape (selection multiple)
if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh()) if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh())
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM); SALOME::BAD_PARAM);
SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp); SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
if (CORBA::is_nil(myHyp)) if (CORBA::is_nil(myHyp))
THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
SALOME::BAD_PARAM); SALOME::BAD_PARAM);
SMESH_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK; SMESH_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK;
try try
{ {
TopoDS_Shape myLocSubShape; TopoDS_Shape myLocSubShape;
//use PseudoShape in case if mesh has no shape //use PseudoShape in case if mesh has no shape
if(HasShapeToMesh()) if(HasShapeToMesh())
@ -548,15 +548,15 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Ob
myLocSubShape = _impl->GetShapeToMesh(); myLocSubShape = _impl->GetShapeToMesh();
int hypId = myHyp->GetId(); int hypId = myHyp->GetId();
status = _impl->RemoveHypothesis(myLocSubShape, hypId); status = _impl->RemoveHypothesis(myLocSubShape, hypId);
if ( !SMESH_Hypothesis::IsStatusFatal(status) ) if ( !SMESH_Hypothesis::IsStatusFatal(status) )
_mapHypo.erase( hypId ); _mapHypo.erase( hypId );
} }
catch(SALOME_Exception & S_ex) catch(SALOME_Exception & S_ex)
{ {
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
} }
return status; return status;
} }
//============================================================================= //=============================================================================
@ -566,14 +566,14 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Ob
//============================================================================= //=============================================================================
SMESH::ListOfHypothesis * SMESH::ListOfHypothesis *
SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject) SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject)
throw(SALOME::SALOME_Exception) throw(SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
if (MYDEBUG) MESSAGE("GetHypothesisList"); if (MYDEBUG) MESSAGE("GetHypothesisList");
if (_impl->HasShapeToMesh() && CORBA::is_nil(aSubShapeObject)) if (_impl->HasShapeToMesh() && CORBA::is_nil(aSubShapeObject))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM); SALOME::BAD_PARAM);
SMESH::ListOfHypothesis_var aList = new SMESH::ListOfHypothesis(); SMESH::ListOfHypothesis_var aList = new SMESH::ListOfHypothesis();
@ -588,7 +588,7 @@ throw(SALOME::SALOME_Exception)
for ( list<const SMESHDS_Hypothesis*>::const_iterator anIt = aLocalList.begin(); i < n && anIt != aLocalList.end(); anIt++ ) { for ( list<const SMESHDS_Hypothesis*>::const_iterator anIt = aLocalList.begin(); i < n && anIt != aLocalList.end(); anIt++ ) {
SMESHDS_Hypothesis* aHyp = (SMESHDS_Hypothesis*)(*anIt); SMESHDS_Hypothesis* aHyp = (SMESHDS_Hypothesis*)(*anIt);
if ( _mapHypo.find( aHyp->GetID() ) != _mapHypo.end() ) if ( _mapHypo.find( aHyp->GetID() ) != _mapHypo.end() )
aList[i++] = SMESH::SMESH_Hypothesis::_narrow( _mapHypo[aHyp->GetID()] ); aList[i++] = SMESH::SMESH_Hypothesis::_narrow( _mapHypo[aHyp->GetID()] );
} }
aList->length( i ); aList->length( i );
@ -606,14 +606,14 @@ throw(SALOME::SALOME_Exception)
*/ */
//============================================================================= //=============================================================================
SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject,
const char* theName ) const char* theName )
throw(SALOME::SALOME_Exception) throw(SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
MESSAGE("SMESH_Mesh_i::GetSubMesh"); MESSAGE("SMESH_Mesh_i::GetSubMesh");
if (CORBA::is_nil(aSubShapeObject)) if (CORBA::is_nil(aSubShapeObject))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM); SALOME::BAD_PARAM);
SMESH::SMESH_subMesh_var subMesh; SMESH::SMESH_subMesh_var subMesh;
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(_this()); SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(_this());
@ -667,7 +667,7 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
long aTag = SMESH_Gen_i::GetRefOnShapeTag(); long aTag = SMESH_Gen_i::GetRefOnShapeTag();
SALOMEDS::SObject_var anObj, aRef; SALOMEDS::SObject_var anObj, aRef;
if ( anSO->FindSubObject( aTag, anObj ) && anObj->ReferencedObject( aRef ) ) if ( anSO->FindSubObject( aTag, anObj ) && anObj->ReferencedObject( aRef ) )
aSubShapeObject = GEOM::GEOM_Object::_narrow( aRef->GetObject() ); aSubShapeObject = GEOM::GEOM_Object::_narrow( aRef->GetObject() );
aStudy->NewBuilder()->RemoveObjectWithChildren( anSO ); aStudy->NewBuilder()->RemoveObjectWithChildren( anSO );
@ -2096,14 +2096,14 @@ throw(SALOME::SALOME_Exception)
aLog[indexLog].coords.length(rnum); aLog[indexLog].coords.length(rnum);
aLog[indexLog].indexes.length(inum); aLog[indexLog].indexes.length(inum);
for(int i = 0; i < rnum; i++){ for(int i = 0; i < rnum; i++){
aLog[indexLog].coords[i] = *ir; aLog[indexLog].coords[i] = *ir;
//MESSAGE(" "<<i<<" "<<ir.Value()); //MESSAGE(" "<<i<<" "<<ir.Value());
ir++; ir++;
} }
for(int i = 0; i < inum; i++){ for(int i = 0; i < inum; i++){
aLog[indexLog].indexes[i] = *ii; aLog[indexLog].indexes[i] = *ii;
//MESSAGE(" "<<i<<" "<<ii.Value()); //MESSAGE(" "<<i<<" "<<ii.Value());
ii++; ii++;
} }
indexLog++; indexLog++;
its++; its++;
@ -2284,8 +2284,8 @@ void SMESH_Mesh_i::PrepareForWriting (const char* file)
} }
void SMESH_Mesh_i::ExportToMED (const char* file, void SMESH_Mesh_i::ExportToMED (const char* file,
CORBA::Boolean auto_groups, CORBA::Boolean auto_groups,
SMESH::MED_VERSION theVersion) SMESH::MED_VERSION theVersion)
throw(SALOME::SALOME_Exception) throw(SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
@ -2300,20 +2300,20 @@ void SMESH_Mesh_i::ExportToMED (const char* file,
aMeshName = aMeshSO->GetName(); aMeshName = aMeshSO->GetName();
// asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes // asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes
if ( !aStudy->GetProperties()->IsLocked() ) if ( !aStudy->GetProperties()->IsLocked() )
{ {
SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::AttributeExternalFileDef_var aFileName; SALOMEDS::AttributeExternalFileDef_var aFileName;
anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeExternalFileDef"); anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeExternalFileDef");
aFileName = SALOMEDS::AttributeExternalFileDef::_narrow(anAttr); aFileName = SALOMEDS::AttributeExternalFileDef::_narrow(anAttr);
ASSERT(!aFileName->_is_nil()); ASSERT(!aFileName->_is_nil());
aFileName->SetValue(file); aFileName->SetValue(file);
SALOMEDS::AttributeFileType_var aFileType; SALOMEDS::AttributeFileType_var aFileType;
anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeFileType"); anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeFileType");
aFileType = SALOMEDS::AttributeFileType::_narrow(anAttr); aFileType = SALOMEDS::AttributeFileType::_narrow(anAttr);
ASSERT(!aFileType->_is_nil()); ASSERT(!aFileType->_is_nil());
aFileType->SetValue("FICHIERMED"); aFileType->SetValue("FICHIERMED");
} }
} }
} }
// Update Python script // Update Python script
@ -2330,7 +2330,7 @@ void SMESH_Mesh_i::ExportToMED (const char* file,
} }
void SMESH_Mesh_i::ExportMED (const char* file, void SMESH_Mesh_i::ExportMED (const char* file,
CORBA::Boolean auto_groups) CORBA::Boolean auto_groups)
throw(SALOME::SALOME_Exception) throw(SALOME::SALOME_Exception)
{ {
ExportToMED(file,auto_groups,SMESH::MED_V2_1); ExportToMED(file,auto_groups,SMESH::MED_V2_1);