X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers_I%2FStdMeshers_LocalLength_i.cxx;h=f360400ca6893e5349c2107b500cd9c077914f7b;hb=07ec002dfd20ec187228e11533e8e2135eca08fd;hp=a37b8e14a72ed18f69c6049dbefaba239e3281b7;hpb=ea3e3193e3d50a44a4b3a069fc4fc1239c22f27b;p=modules%2Fsmesh.git diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx index a37b8e14a..f360400ca 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,16 +27,18 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_LocalLength_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" #include +using namespace std; + //============================================================================= /*! * StdMeshers_LocalLength_i::StdMeshers_LocalLength_i @@ -46,15 +48,15 @@ using namespace std; //============================================================================= StdMeshers_LocalLength_i::StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl ) - : SALOME::GenericObj_i( thePOA ), + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { MESSAGE( "StdMeshers_LocalLength_i::StdMeshers_LocalLength_i" ); myBaseImpl = new ::StdMeshers_LocalLength( theGenImpl->GetANewId(), - theStudyId, - theGenImpl ); + theStudyId, + theGenImpl ); } //============================================================================= @@ -77,7 +79,6 @@ StdMeshers_LocalLength_i::~StdMeshers_LocalLength_i() * Set length */ //============================================================================= - void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength ) throw ( SALOME::SALOME_Exception ) { @@ -92,11 +93,31 @@ void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength ) } // Update Python script - TCollection_AsciiString aStr, aStrLen ((double)theLength); - SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength("; - aStr += aStrLen + ")"; + SMESH::TPythonDump() << _this() << ".SetLength( " << theLength << " )"; +} + +//============================================================================= +/*! + * StdMeshers_LocalLength_i::SetPrecision + * + * Set length + */ +//============================================================================= +void StdMeshers_LocalLength_i::SetPrecision( CORBA::Double thePrecision ) + throw ( SALOME::SALOME_Exception ) +{ + MESSAGE( "StdMeshers_LocalLength_i::SetPrecision" ); + ASSERT( myBaseImpl ); + try { + this->GetImpl()->SetPrecision( thePrecision ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), + SALOME::BAD_PARAM ); + } - SMESH_Gen_i::AddToCurrentPyScript(aStr); + // Update Python script + SMESH::TPythonDump() << _this() << ".SetPrecision( " << thePrecision << " )"; } //============================================================================= @@ -106,7 +127,6 @@ void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength ) * Get length */ //============================================================================= - CORBA::Double StdMeshers_LocalLength_i::GetLength() { MESSAGE( "StdMeshers_LocalLength_i::GetLength" ); @@ -114,6 +134,20 @@ CORBA::Double StdMeshers_LocalLength_i::GetLength() return this->GetImpl()->GetLength(); } +//============================================================================= +/*! + * StdMeshers_LocalLength_i::GetPrecision + * + * Get precision + */ +//============================================================================= +CORBA::Double StdMeshers_LocalLength_i::GetPrecision() +{ + MESSAGE( "StdMeshers_LocalLength_i::GetPrecision" ); + ASSERT( myBaseImpl ); + return this->GetImpl()->GetPrecision(); +} + //============================================================================= /*! * StdMeshers_LocalLength_i::GetImpl @@ -121,7 +155,6 @@ CORBA::Double StdMeshers_LocalLength_i::GetLength() * Get implementation */ //============================================================================= - ::StdMeshers_LocalLength* StdMeshers_LocalLength_i::GetImpl() { MESSAGE( "StdMeshers_LocalLength_i::GetImpl" ); @@ -141,4 +174,3 @@ CORBA::Boolean StdMeshers_LocalLength_i::IsDimSupported( SMESH::Dimension type ) { return type == SMESH::DIM_1D; } -