Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "StdMeshers_StartEndLength_i.hxx"
00031 #include "SMESH_Gen_i.hxx"
00032 #include "SMESH_Gen.hxx"
00033 #include "SMESH_PythonDump.hxx"
00034
00035 #include "Utils_CorbaException.hxx"
00036 #include "utilities.h"
00037
00038 #include <TCollection_AsciiString.hxx>
00039
00040 using namespace std;
00041
00042
00048
00049
00050 StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i( PortableServer::POA_ptr thePOA,
00051 int theStudyId,
00052 ::SMESH_Gen* theGenImpl )
00053 : SALOME::GenericObj_i( thePOA ),
00054 SMESH_Hypothesis_i( thePOA )
00055 {
00056 MESSAGE( "StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i" );
00057 myBaseImpl = new ::StdMeshers_StartEndLength( theGenImpl->GetANewId(),
00058 theStudyId,
00059 theGenImpl );
00060 }
00061
00062
00068
00069
00070 StdMeshers_StartEndLength_i::~StdMeshers_StartEndLength_i()
00071 {
00072 MESSAGE( "StdMeshers_StartEndLength_i::~StdMeshers_StartEndLength_i" );
00073 }
00074
00075
00081
00082
00083 void StdMeshers_StartEndLength_i::SetLength(CORBA::Double theLength,
00084 CORBA::Boolean theIsStart )
00085 throw ( SALOME::SALOME_Exception )
00086 {
00087 MESSAGE( "StdMeshers_StartEndLength_i::SetLength" );
00088 ASSERT( myBaseImpl );
00089 try {
00090 this->GetImpl()->SetLength( theLength, theIsStart );
00091 }
00092 catch ( SALOME_Exception& S_ex ) {
00093 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00094 SALOME::BAD_PARAM );
00095 }
00096
00097
00098 SMESH::TPythonDump() <<
00099 _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) << theLength << " )";
00100 }
00101
00102
00106
00107
00108 void StdMeshers_StartEndLength_i::SetStartLength( CORBA::Double length)
00109 throw (SALOME::SALOME_Exception)
00110 {
00111 SetLength( length, true );
00112 }
00113
00114
00118
00119
00120 void StdMeshers_StartEndLength_i::SetEndLength( CORBA::Double length)
00121 throw (SALOME::SALOME_Exception)
00122 {
00123 SetLength( length, false );
00124 }
00125
00126
00132
00133
00134 CORBA::Double StdMeshers_StartEndLength_i::GetLength( CORBA::Boolean theIsStart)
00135 {
00136 MESSAGE( "StdMeshers_StartEndLength_i::GetLength" );
00137 ASSERT( myBaseImpl );
00138 return this->GetImpl()->GetLength( theIsStart );
00139 }
00140
00141
00147
00148
00149 void StdMeshers_StartEndLength_i::SetReversedEdges( const SMESH::long_array& theIds )
00150 {
00151 ASSERT( myBaseImpl );
00152 try {
00153 std::vector<int> ids( theIds.length() );
00154 CORBA::Long iEnd = theIds.length();
00155 for ( CORBA::Long i = 0; i < iEnd; i++ )
00156 ids[ i ] = theIds[ i ];
00157
00158 this->GetImpl()->SetReversedEdges( ids );
00159 }
00160 catch ( SALOME_Exception& S_ex ) {
00161 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00162 SALOME::BAD_PARAM );
00163 }
00164
00165
00166 SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )";
00167 }
00168
00169
00175
00176
00177 void StdMeshers_StartEndLength_i::SetObjectEntry( const char* theEntry )
00178 {
00179 ASSERT( myBaseImpl );
00180 string entry(theEntry);
00181 try {
00182 this->GetImpl()->SetObjectEntry( entry.c_str() );
00183
00184 SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry.c_str() << "' )";
00185 }
00186 catch ( SALOME_Exception& S_ex ) {
00187 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM );
00188 }
00189 }
00190
00191
00197
00198
00199 char* StdMeshers_StartEndLength_i::GetObjectEntry()
00200 {
00201 ASSERT( myBaseImpl );
00202 const char* entry;
00203 try {
00204 entry = this->GetImpl()->GetObjectEntry();
00205 }
00206 catch ( SALOME_Exception& S_ex ) {
00207 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
00208 }
00209 return CORBA::string_dup( entry );
00210 }
00211
00212
00218
00219
00220 SMESH::long_array* StdMeshers_StartEndLength_i::GetReversedEdges()
00221 {
00222 ASSERT( myBaseImpl );
00223 SMESH::long_array_var anArray = new SMESH::long_array;
00224 std::vector<int> ids = this->GetImpl()->GetReversedEdges();
00225 anArray->length( ids.size() );
00226 for ( CORBA::Long i = 0; i < ids.size(); i++)
00227 anArray [ i ] = ids [ i ];
00228
00229 return anArray._retn();
00230 }
00231
00232
00238
00239
00240 ::StdMeshers_StartEndLength* StdMeshers_StartEndLength_i::GetImpl()
00241 {
00242 MESSAGE( "StdMeshers_StartEndLength_i::GetImpl" );
00243 return ( ::StdMeshers_StartEndLength* )myBaseImpl;
00244 }
00245
00246
00254
00255 CORBA::Boolean StdMeshers_StartEndLength_i::IsDimSupported( SMESH::Dimension type )
00256 {
00257 return type == SMESH::DIM_1D;
00258 }
00259