0020082: EDF 869 GEOM : Edges Orientation indicator/reverse

implement python dump
This commit is contained in:
eap 2009-07-15 13:44:24 +00:00
parent 951e90bf47
commit 74c0034727
5 changed files with 88 additions and 41 deletions

View File

@ -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 <start segment length> parameter value
*/
//=============================================================================
void StdMeshers_Arithmetic1D_i::SetStartLength( CORBA::Double length)
throw (SALOME::SALOME_Exception)
{
SetLength( length, true );
}
//=============================================================================
/*!
* Sets <end segment length> 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<int> 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 );
}
}

View File

@ -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 <start segment length> parameter value
void SetStartLength( CORBA::Double length) throw (SALOME::SALOME_Exception);
// Sets <end segment length> parameter value
void SetEndLength( CORBA::Double length) throw (SALOME::SALOME_Exception);
// Get length
CORBA::Double GetLength(CORBA::Boolean theIsStart);

View File

@ -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<int> 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;

View File

@ -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 <start segment length> parameter value
*/
//=============================================================================
void StdMeshers_StartEndLength_i::SetStartLength( CORBA::Double length)
throw (SALOME::SALOME_Exception)
{
SetLength( length, true );
}
//=============================================================================
/*!
* Sets <end segment length> 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<int> 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<int> ids = this->GetImpl()->GetReversedEdges();

View File

@ -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 <start segment length> parameter value
void SetStartLength( CORBA::Double length) throw (SALOME::SALOME_Exception);
// Sets <end segment length> parameter value
void SetEndLength( CORBA::Double length) throw (SALOME::SALOME_Exception);
// Get length
CORBA::Double GetLength(CORBA::Boolean theIsStart);