X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers_I%2FStdMeshers_ProjectionSource2D_i.cxx;h=3fafb98e5ef8a515b2ec9c24edcdc6290bdd9172;hp=5f1275088f243fbe09249887da5987e0a5b89fb8;hb=499f29d24922cec66e41b41a0039a954993bc6df;hpb=6bac08c1a81f34d3f21c550bd92f83654b2546a5 diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx index 5f1275088..3fafb98e5 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -48,13 +48,10 @@ using namespace std; StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i ( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { - MESSAGE( "StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i" ); myBaseImpl = new ::StdMeshers_ProjectionSource2D( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } @@ -68,7 +65,6 @@ StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i() { - MESSAGE( "StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i" ); } //============================================================================= @@ -78,7 +74,6 @@ StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i() //============================================================================= void StdMeshers_ProjectionSource2D_i::SetSourceFace(GEOM::GEOM_Object_ptr face) - throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); try { @@ -100,7 +95,6 @@ void StdMeshers_ProjectionSource2D_i::SetSourceFace(GEOM::GEOM_Object_ptr face) //============================================================================= void StdMeshers_ProjectionSource2D_i::SetSourceMesh(SMESH::SMESH_Mesh_ptr theMesh) - throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); @@ -151,7 +145,6 @@ void StdMeshers_ProjectionSource2D_i::SetVertexAssociation(GEOM::GEOM_Object_ptr GEOM::GEOM_Object_ptr sourceVertex2, GEOM::GEOM_Object_ptr targetVertex1, GEOM::GEOM_Object_ptr targetVertex2) - throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); try { @@ -298,12 +291,16 @@ void StdMeshers_ProjectionSource2D_i::LoadFrom( const char* theStream ) myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh ); - GetImpl()->SetSourceMesh ( meshImpl ); - GetImpl()->SetSourceFace ( shapes[ SRC_FACE ] ); - GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], - shapes[ SRC_VERTEX2 ], - shapes[ TGT_VERTEX1 ], - shapes[ TGT_VERTEX2 ]); + try { + GetImpl()->SetSourceMesh ( meshImpl ); + GetImpl()->SetSourceFace ( shapes[ SRC_FACE ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], + shapes[ SRC_VERTEX2 ], + shapes[ TGT_VERTEX1 ], + shapes[ TGT_VERTEX2 ]); + } + catch( ... ) { + } myBaseImpl->LoadFrom( is ); std::istringstream str( theStream ); @@ -311,3 +308,48 @@ void StdMeshers_ProjectionSource2D_i::LoadFrom( const char* theStream ) str >> myShapeEntries[ i ]; } +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource2D_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & /*subIDArray*/ ) const +{ + for ( int i = 0; i < NB_SHAPES; ++i ) + entryArray.push_back( myShapeEntries[ i ]); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +StdMeshers_ProjectionSource2D_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & /*subIDArray*/ ) +{ + TopoDS_Shape shapes[ NB_SHAPES ]; + for ( int i = 0; i < NB_SHAPES; ++i ) + { + myShapeEntries[ i ] = entryArray[ i ]; + shapes[ i ] = StdMeshers_ObjRefUlils::EntryToShape( entryArray[ i ]); + } + + try { + GetImpl()->SetSourceFace ( shapes[ SRC_FACE ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], + shapes[ SRC_VERTEX2 ], + shapes[ TGT_VERTEX1 ], + shapes[ TGT_VERTEX2 ]); + } + catch (...) { + return false; + } + return true; +}