X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers_I%2FStdMeshers_ProjectionSource3D_i.cxx;h=dc62345b50562c314e3764e56216edfa68b93a03;hp=8dd2b5f9f75dae7dbc326424776cf7b3d570f7f7;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx index 8dd2b5f9f..dc62345b5 100644 --- a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -48,13 +48,10 @@ using namespace std; StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i ( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { - MESSAGE( "StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i" ); myBaseImpl = new ::StdMeshers_ProjectionSource3D( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } @@ -68,7 +65,6 @@ StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i() { - MESSAGE( "StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i" ); } //============================================================================= @@ -78,7 +74,6 @@ StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i() //============================================================================= void StdMeshers_ProjectionSource3D_i::SetSource3DShape(GEOM::GEOM_Object_ptr shape) - throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); try { @@ -101,7 +96,6 @@ void StdMeshers_ProjectionSource3D_i::SetSource3DShape(GEOM::GEOM_Object_ptr sha //============================================================================= void StdMeshers_ProjectionSource3D_i::SetSourceMesh(SMESH::SMESH_Mesh_ptr theMesh) - throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); @@ -152,7 +146,6 @@ void StdMeshers_ProjectionSource3D_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 { @@ -252,7 +245,7 @@ CORBA::Boolean StdMeshers_ProjectionSource3D_i::IsDimSupported( SMESH::Dimension //================================================================================ /*! * \brief Write parameters in a string - * \retval char* - resulting string + * \retval char* - resulting string */ //================================================================================ @@ -273,7 +266,7 @@ char* StdMeshers_ProjectionSource3D_i::SaveTo() //================================================================================ /*! * \brief Retrieve parameters from the string - * \param theStream - the input string + * \param theStream - the input string */ //================================================================================ @@ -299,13 +292,16 @@ void StdMeshers_ProjectionSource3D_i::LoadFrom( const char* theStream ) myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh ); - GetImpl()->SetSourceMesh ( meshImpl ); - GetImpl()->SetSource3DShape ( shapes[ SRC_SHAPE3D ] ); - GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], - shapes[ SRC_VERTEX2 ], - shapes[ TGT_VERTEX1 ], - shapes[ TGT_VERTEX2 ]); - + try { + GetImpl()->SetSourceMesh ( meshImpl ); + GetImpl()->SetSource3DShape ( shapes[ SRC_SHAPE3D ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], + shapes[ SRC_VERTEX2 ], + shapes[ TGT_VERTEX1 ], + shapes[ TGT_VERTEX2 ]); + } + catch (...) { + } myBaseImpl->LoadFrom( is ); std::istringstream str( theStream ); @@ -313,3 +309,48 @@ void StdMeshers_ProjectionSource3D_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_ProjectionSource3D_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_ProjectionSource3D_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()->SetSource3DShape ( shapes[ SRC_SHAPE3D ] ); + GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ], + shapes[ SRC_VERTEX2 ], + shapes[ TGT_VERTEX1 ], + shapes[ TGT_VERTEX2 ]); + } + catch (...) { + return false; + } + return true; +}