From: eap Date: Wed, 15 Jul 2009 13:44:24 +0000 (+0000) Subject: 0020082: EDF 869 GEOM : Edges Orientation indicator/reverse X-Git-Tag: V5_1_3rc1~141 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=74c00347274ba846dad96d1e2dd31f1b1b76c9f8;p=modules%2Fsmesh.git 0020082: EDF 869 GEOM : Edges Orientation indicator/reverse implement python dump --- diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx index 3bf9e825b..9afb8748a 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx @@ -93,8 +93,32 @@ void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength, } // Update Python script - SMESH::TPythonDump() << _this() << ".SetLength( " - << theLength << ", " << theIsStart << " )"; + SMESH::TPythonDump() + << _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) << theLength << " )"; +} + +//============================================================================= +/*! + * Sets parameter value + */ +//============================================================================= + +void StdMeshers_Arithmetic1D_i::SetStartLength( CORBA::Double length) + throw (SALOME::SALOME_Exception) +{ + SetLength( length, true ); +} + +//============================================================================= +/*! + * Sets parameter value + */ +//============================================================================= + +void StdMeshers_Arithmetic1D_i::SetEndLength( CORBA::Double length) + throw (SALOME::SALOME_Exception) +{ + SetLength( length, false ); } //============================================================================= @@ -122,7 +146,6 @@ CORBA::Double StdMeshers_Arithmetic1D_i::GetLength( CORBA::Boolean theIsStart) void StdMeshers_Arithmetic1D_i::SetReversedEdges( const SMESH::long_array& theIds ) { - MESSAGE( "StdMeshers_Arithmetic1D_i::SetReversedEdges" ); ASSERT( myBaseImpl ); try { std::vector ids( theIds.length() ); @@ -138,8 +161,7 @@ void StdMeshers_Arithmetic1D_i::SetReversedEdges( const SMESH::long_array& theId } // Update Python script - /* SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( " - << theList << " )";*/ + SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; } //============================================================================= @@ -150,19 +172,17 @@ void StdMeshers_Arithmetic1D_i::SetReversedEdges( const SMESH::long_array& theId */ //============================================================================= -void StdMeshers_Arithmetic1D_i::SetObjectEntry( const char* entry ) +void StdMeshers_Arithmetic1D_i::SetObjectEntry( const char* theEntry ) { - MESSAGE( "StdMeshers_Arithmetic1D_i::SetObjectEntry" ); ASSERT( myBaseImpl ); - + string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping try { - this->GetImpl()->SetObjectEntry( entry ); + this->GetImpl()->SetObjectEntry( entry.c_str() ); // Update Python script - // SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )"; + SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )"; } 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 ); } } diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx index 7abea29e1..641e56779 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx @@ -23,7 +23,6 @@ // File : StdMeshers_Arithmetic1D_i.hxx // Author : Damien COQUERET, OCC // Module : SMESH -// $Header$ // #ifndef _SMESH_ARITHMETIC1D_I_HXX_ #define _SMESH_ARITHMETIC1D_I_HXX_ @@ -47,14 +46,21 @@ public: // Constructor StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA, int theStudyId, - ::SMESH_Gen* theGenImpl ); + ::SMESH_Gen* theGenImpl ); // Destructor virtual ~StdMeshers_Arithmetic1D_i(); // Set length + // * OBSOLETE *. Avoid such a way of interface design void SetLength( CORBA::Double theLength, CORBA::Boolean theIsStart ) throw ( SALOME::SALOME_Exception ); + // Sets parameter value + void SetStartLength( CORBA::Double length) throw (SALOME::SALOME_Exception); + + // Sets parameter value + void SetEndLength( CORBA::Double length) throw (SALOME::SALOME_Exception); + // Get length CORBA::Double GetLength(CORBA::Boolean theIsStart); @@ -72,7 +78,7 @@ public: // Get implementation ::StdMeshers_Arithmetic1D* GetImpl(); - + // Verify whether hypothesis supports given entity type CORBA::Boolean IsDimSupported( SMESH::Dimension type ); }; diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index 8efa554d3..55a269f9b 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -172,7 +172,6 @@ CORBA::Long StdMeshers_NumberOfSegments_i::GetNumberOfSegments() void StdMeshers_NumberOfSegments_i::SetReversedEdges( const SMESH::long_array& theIds ) { - MESSAGE( "StdMeshers_NumberOfSegments_i::SetReversedEdges" ); ASSERT( myBaseImpl ); try { std::vector ids( theIds.length() ); @@ -188,8 +187,7 @@ void StdMeshers_NumberOfSegments_i::SetReversedEdges( const SMESH::long_array& t } // Update Python script - /* SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( " - << theList << " )";*/ + SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; } //============================================================================= @@ -200,20 +198,19 @@ void StdMeshers_NumberOfSegments_i::SetReversedEdges( const SMESH::long_array& t */ //============================================================================= -void StdMeshers_NumberOfSegments_i::SetObjectEntry( const char* entry ) +void StdMeshers_NumberOfSegments_i::SetObjectEntry( const char* theEntry ) { - MESSAGE( "StdMeshers_NumberOfSegments_i::SetObjectEntry" ); ASSERT( myBaseImpl ); - + string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping try { - this->GetImpl()->SetObjectEntry( entry ); - // Update Python script - // SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )"; + this->GetImpl()->SetObjectEntry( entry.c_str() ); } catch ( SALOME_Exception& S_ex ) { THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )"; } //============================================================================= @@ -226,7 +223,6 @@ void StdMeshers_NumberOfSegments_i::SetObjectEntry( const char* entry ) char* StdMeshers_NumberOfSegments_i::GetObjectEntry() { - MESSAGE( "StdMeshers_NumberOfSegments_i::SetObjectEntry" ); ASSERT( myBaseImpl ); const char* entry; diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx index c9a75a3d5..628f4acff 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx @@ -94,8 +94,32 @@ void StdMeshers_StartEndLength_i::SetLength(CORBA::Double theLength, } // Update Python script - SMESH::TPythonDump() << _this() << ".SetLength( " - << theLength << ", " << theIsStart << " )"; + SMESH::TPythonDump() << + _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) << theLength << " )"; +} + +//============================================================================= +/*! + * Sets parameter value + */ +//============================================================================= + +void StdMeshers_StartEndLength_i::SetStartLength( CORBA::Double length) + throw (SALOME::SALOME_Exception) +{ + SetLength( length, true ); +} + +//============================================================================= +/*! + * Sets parameter value + */ +//============================================================================= + +void StdMeshers_StartEndLength_i::SetEndLength( CORBA::Double length) + throw (SALOME::SALOME_Exception) +{ + SetLength( length, false ); } //============================================================================= @@ -123,7 +147,6 @@ CORBA::Double StdMeshers_StartEndLength_i::GetLength( CORBA::Boolean theIsStart) void StdMeshers_StartEndLength_i::SetReversedEdges( const SMESH::long_array& theIds ) { - MESSAGE( "StdMeshers_StartEndLength_i::SetReversedEdges" ); ASSERT( myBaseImpl ); try { std::vector ids( theIds.length() ); @@ -139,8 +162,7 @@ void StdMeshers_StartEndLength_i::SetReversedEdges( const SMESH::long_array& the } // Update Python script - /* SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( " - << theList << " )";*/ + SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )"; } //============================================================================= @@ -151,18 +173,17 @@ void StdMeshers_StartEndLength_i::SetReversedEdges( const SMESH::long_array& the */ //============================================================================= -void StdMeshers_StartEndLength_i::SetObjectEntry( const char* entry ) +void StdMeshers_StartEndLength_i::SetObjectEntry( const char* theEntry ) { - MESSAGE( "StdMeshers_StartEndLength_i::SetObjectEntry" ); ASSERT( myBaseImpl ); + string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping try { - this->GetImpl()->SetObjectEntry( entry ); + this->GetImpl()->SetObjectEntry( entry.c_str() ); // Update Python script - // SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )"; + SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry.c_str() << "' )"; } 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 ); } } @@ -176,15 +197,13 @@ void StdMeshers_StartEndLength_i::SetObjectEntry( const char* entry ) char* StdMeshers_StartEndLength_i::GetObjectEntry() { - MESSAGE( "StdMeshers_StartEndLength_i::SetObjectEntry" ); ASSERT( myBaseImpl ); const char* entry; try { entry = this->GetImpl()->GetObjectEntry(); } 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 CORBA::string_dup( entry ); } @@ -199,7 +218,6 @@ char* StdMeshers_StartEndLength_i::GetObjectEntry() SMESH::long_array* StdMeshers_StartEndLength_i::GetReversedEdges() { - MESSAGE( "StdMeshers_StartEndLength_i::GetReversedEdges" ); ASSERT( myBaseImpl ); SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx index 3ce0e9db3..89ec61696 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx @@ -24,7 +24,6 @@ // Moved here from SMESH_LocalLength_i.hxx // Author : Paul RASCLE, EDF // Module : SMESH -// $Header$ // #ifndef _SMESH_StartEndLength_I_HXX_ #define _SMESH_StartEndLength_I_HXX_ @@ -55,8 +54,16 @@ public: virtual ~StdMeshers_StartEndLength_i(); // Set length + // * OBSOLETE *. Avoid such a way of interface design void SetLength( CORBA::Double theLength, CORBA::Boolean theIsStart ) throw ( SALOME::SALOME_Exception ); + + // Sets parameter value + void SetStartLength( CORBA::Double length) throw (SALOME::SALOME_Exception); + + // Sets parameter value + void SetEndLength( CORBA::Double length) throw (SALOME::SALOME_Exception); + // Get length CORBA::Double GetLength(CORBA::Boolean theIsStart);