X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers_I%2FStdMeshers_ProjectionSource1D_i.cxx;h=c07e41a15c4e1edd0f7af463a9202d120c8a73d8;hp=279e556f3ff22536730db97e7694bb73f6771938;hb=6d32f944a0a115b6419184c50b57bf7c4eef5786;hpb=7eda9ca931ed2a11cb5e4637e4ffe19f5c061115 diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx index 279e556f3..c07e41a15 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 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_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i ( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { - MESSAGE( "StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i" ); myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } @@ -68,7 +65,6 @@ StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i() { - MESSAGE( "StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i" ); } //============================================================================= @@ -287,11 +283,14 @@ void StdMeshers_ProjectionSource1D_i::LoadFrom( const char* theStream ) } myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh ); - GetImpl()->SetSourceMesh ( meshImpl ); - GetImpl()->SetSourceEdge ( shapes[ SRC_EDGE ] ); - GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ], - shapes[ TGT_VERTEX ]); - + try { + GetImpl()->SetSourceMesh ( meshImpl ); + GetImpl()->SetSourceEdge ( shapes[ SRC_EDGE ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ], + shapes[ TGT_VERTEX ]); + } + catch (...) { + } myBaseImpl->LoadFrom( is ); std::istringstream str( theStream ); @@ -299,3 +298,46 @@ void StdMeshers_ProjectionSource1D_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_ProjectionSource1D_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_ProjectionSource1D_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()->SetSourceEdge ( shapes[ SRC_EDGE ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ], + shapes[ TGT_VERTEX ]); + } + catch (...) { + return false; + } + return true; +}