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 #include "StdMeshers_Arithmetic1D_i.hxx"
00030 #include "SMESH_Gen_i.hxx"
00031 #include "SMESH_Gen.hxx"
00032 #include "SMESH_PythonDump.hxx"
00033
00034 #include "Utils_CorbaException.hxx"
00035 #include "utilities.h"
00036
00037 #include <TCollection_AsciiString.hxx>
00038
00039 using namespace std;
00040
00041
00047
00048
00049 StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
00050 int theStudyId,
00051 ::SMESH_Gen* theGenImpl )
00052 : SALOME::GenericObj_i( thePOA ),
00053 SMESH_Hypothesis_i( thePOA )
00054 {
00055 MESSAGE( "StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i" );
00056 myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
00057 theStudyId,
00058 theGenImpl );
00059 }
00060
00061
00067
00068
00069 StdMeshers_Arithmetic1D_i::~StdMeshers_Arithmetic1D_i()
00070 {
00071 MESSAGE( "StdMeshers_Arithmetic1D_i::~StdMeshers_Arithmetic1D_i" );
00072 }
00073
00074
00080
00081
00082 void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength,
00083 CORBA::Boolean theIsStart )
00084 throw ( SALOME::SALOME_Exception )
00085 {
00086 MESSAGE( "StdMeshers_StartEndLength_i::SetLength" );
00087 ASSERT( myBaseImpl );
00088 try {
00089 this->GetImpl()->SetLength( theLength, theIsStart );
00090 }
00091 catch ( SALOME_Exception& S_ex ) {
00092 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00093 SALOME::BAD_PARAM );
00094 }
00095
00096
00097 SMESH::TPythonDump()
00098 << _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) << theLength << " )";
00099 }
00100
00101
00105
00106
00107 void StdMeshers_Arithmetic1D_i::SetStartLength( CORBA::Double length)
00108 throw (SALOME::SALOME_Exception)
00109 {
00110 SetLength( length, true );
00111 }
00112
00113
00117
00118
00119 void StdMeshers_Arithmetic1D_i::SetEndLength( CORBA::Double length)
00120 throw (SALOME::SALOME_Exception)
00121 {
00122 SetLength( length, false );
00123 }
00124
00125
00131
00132
00133 CORBA::Double StdMeshers_Arithmetic1D_i::GetLength( CORBA::Boolean theIsStart)
00134 {
00135 MESSAGE( "StdMeshers_Arithmetic1D_i::GetLength" );
00136 ASSERT( myBaseImpl );
00137 return this->GetImpl()->GetLength( theIsStart );
00138 }
00139
00140
00146
00147
00148 void StdMeshers_Arithmetic1D_i::SetReversedEdges( const SMESH::long_array& theIds )
00149 {
00150 ASSERT( myBaseImpl );
00151 try {
00152 std::vector<int> ids( theIds.length() );
00153 CORBA::Long iEnd = theIds.length();
00154 for ( CORBA::Long i = 0; i < iEnd; i++ )
00155 ids[ i ] = theIds[ i ];
00156
00157 this->GetImpl()->SetReversedEdges( ids );
00158 }
00159 catch ( SALOME_Exception& S_ex ) {
00160 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
00161 SALOME::BAD_PARAM );
00162 }
00163
00164
00165 SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )";
00166 }
00167
00168
00174
00175
00176 void StdMeshers_Arithmetic1D_i::SetObjectEntry( const char* theEntry )
00177 {
00178 ASSERT( myBaseImpl );
00179 string entry(theEntry);
00180 try {
00181 this->GetImpl()->SetObjectEntry( entry.c_str() );
00182
00183 SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )";
00184 }
00185 catch ( SALOME_Exception& S_ex ) {
00186 THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM );
00187 }
00188 }
00189
00190
00196
00197
00198 char* StdMeshers_Arithmetic1D_i::GetObjectEntry()
00199 {
00200 MESSAGE( "StdMeshers_Arithmetic1D_i::SetObjectEntry" );
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(),
00208 SALOME::BAD_PARAM );
00209 }
00210 return CORBA::string_dup( entry );
00211 }
00212
00213
00219
00220
00221 SMESH::long_array* StdMeshers_Arithmetic1D_i::GetReversedEdges()
00222 {
00223 MESSAGE( "StdMeshers_StartEndLength_i::GetReversedEdges" );
00224 ASSERT( myBaseImpl );
00225 SMESH::long_array_var anArray = new SMESH::long_array;
00226 std::vector<int> ids = this->GetImpl()->GetReversedEdges();
00227 anArray->length( ids.size() );
00228 for ( CORBA::Long i = 0; i < ids.size(); i++)
00229 anArray [ i ] = ids [ i ];
00230
00231 return anArray._retn();
00232 }
00233
00234
00240
00241
00242 ::StdMeshers_Arithmetic1D* StdMeshers_Arithmetic1D_i::GetImpl()
00243 {
00244 MESSAGE( "StdMeshers_Arithmetic1D_i::GetImpl" );
00245 return ( ::StdMeshers_Arithmetic1D* )myBaseImpl;
00246 }
00247
00248
00256
00257 CORBA::Boolean StdMeshers_Arithmetic1D_i::IsDimSupported( SMESH::Dimension type )
00258 {
00259 return type == SMESH::DIM_1D;
00260 }
00261