X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_Hypothesis_i.cxx;h=c64dca3e76fc16ac82418e11e69c04ff2571e05e;hb=ce10bee1cd6708ba2e75e678f43d9bbdb2d3956b;hp=2f220f066c3a14b77d27547ac30eadc8a93b26e6;hpb=c93498bd46b52a5f9902ac734a42736eb9d49dc9;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx index 2f220f0..c64dca3 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx @@ -59,15 +59,12 @@ bool NETGENPlugin_Hypothesis_i::isToSetParameter(double curValue, //============================================================================= NETGENPlugin_Hypothesis_i:: NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), mySetMethodFlags(0) { - MESSAGE( "NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i" ); myBaseImpl = new ::NETGENPlugin_Hypothesis (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } @@ -80,7 +77,6 @@ NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, //============================================================================= NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i() { - MESSAGE( "NETGENPlugin_Hypothesis_i::~NETGENPlugin_Hypothesis_i" ); } //============================================================================= @@ -309,6 +305,36 @@ CORBA::Double NETGENPlugin_Hypothesis_i::GetNbSegPerRadius() //============================================================================= +void NETGENPlugin_Hypothesis_i::SetChordalErrorEnabled(CORBA::Boolean theValue) +{ + if ( isToSetParameter( GetChordalErrorEnabled(), theValue, METH_SetChordalErrorEnabled )) + { + this->GetImpl()->SetChordalErrorEnabled(theValue); + SMESH::TPythonDump() << _this() << ".SetChordalErrorEnabled( " << theValue << " )"; + } +} + +CORBA::Boolean NETGENPlugin_Hypothesis_i::GetChordalErrorEnabled() +{ + return GetImpl()->GetChordalErrorEnabled(); +} + +void NETGENPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) +{ + if ( isToSetParameter( GetChordalError(), theValue, METH_SetChordalError )) + { + this->GetImpl()->SetChordalError(theValue); + SMESH::TPythonDump() << _this() << ".SetChordalError( " << SMESH::TVar(theValue) << " )"; + } +} + +CORBA::Double NETGENPlugin_Hypothesis_i::GetChordalError() +{ + return GetImpl()->GetChordalError(); +} + +//============================================================================= + void NETGENPlugin_Hypothesis_i::SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize) throw (SALOME::SALOME_Exception) @@ -368,6 +394,24 @@ void NETGENPlugin_Hypothesis_i::UnsetLocalSizeOnEntry(const char* entry) //============================================================================= +void NETGENPlugin_Hypothesis_i::SetMeshSizeFile(const char* fileName) +{ + if ( GetImpl()->GetMeshSizeFile() != fileName ) + { + GetImpl()->SetMeshSizeFile( fileName ); + SMESH::TPythonDump() << _this() << ".SetMeshSizeFile( '" << fileName << "' )"; + } +} + +//============================================================================= + +char* NETGENPlugin_Hypothesis_i::GetMeshSizeFile() +{ + return CORBA::string_dup( GetImpl()->GetMeshSizeFile().c_str() ); +} + +//============================================================================= + void NETGENPlugin_Hypothesis_i::SetQuadAllowed (CORBA::Boolean theValue) { if ( NETGENPlugin_Hypothesis_i::isToSetParameter( GetQuadAllowed(), @@ -426,6 +470,175 @@ CORBA::Boolean NETGENPlugin_Hypothesis_i::GetFuseEdges() return this->GetImpl()->GetFuseEdges(); } +//======================================================================= +//function : SetNbSurfOptSteps +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetNbSurfOptSteps(CORBA::Short nb ) +{ + if ( GetNbSurfOptSteps() != nb ) + { + this->GetImpl()->SetNbSurfOptSteps( nb ); + SMESH::TPythonDump() << _this() << ".SetNbSurfOptSteps( " << SMESH::TVar(nb) << " )"; + } +} + +//======================================================================= +//function : GetNbSurfOptSteps +//purpose : +//======================================================================= + +CORBA::Short NETGENPlugin_Hypothesis_i::GetNbSurfOptSteps() +{ + return GetImpl()->GetNbSurfOptSteps(); +} + +//======================================================================= +//function : SetNbVolOptSteps +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetNbVolOptSteps(CORBA::Short nb ) +{ + if ( GetNbVolOptSteps() != nb ) + { + this->GetImpl()->SetNbVolOptSteps( nb ); + SMESH::TPythonDump() << _this() << ".SetNbVolOptSteps( " << SMESH::TVar(nb) << " )"; + } + +} + +//======================================================================= +//function : GetNbVolOptSteps +//purpose : +//======================================================================= + +CORBA::Short NETGENPlugin_Hypothesis_i::GetNbVolOptSteps() +{ + return GetImpl()->GetNbVolOptSteps(); +} + +//======================================================================= +//function : SetElemSizeWeight +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetElemSizeWeight(CORBA::Double size ) +{ + if ( GetElemSizeWeight() != size ) + { + this->GetImpl()->SetElemSizeWeight( size ); + SMESH::TPythonDump() << _this() << ".SetElemSizeWeight( " << SMESH::TVar(size) << " )"; + } +} + +//======================================================================= +//function : GetElemSizeWeight +//purpose : +//======================================================================= + +CORBA::Double NETGENPlugin_Hypothesis_i::GetElemSizeWeight() +{ + return GetImpl()->GetElemSizeWeight(); +} + +//======================================================================= +//function : SetWorstElemMeasure +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetWorstElemMeasure(CORBA::Short val ) +{ + if ( GetWorstElemMeasure() != val ) + { + this->GetImpl()->SetWorstElemMeasure( val ); + SMESH::TPythonDump() << _this() << ".SetWorstElemMeasure( " << SMESH::TVar(val) << " )"; + } +} + +//======================================================================= +//function : GetWorstElemMeasure +//purpose : +//======================================================================= + +CORBA::Short NETGENPlugin_Hypothesis_i::GetWorstElemMeasure() +{ + return GetImpl()->GetWorstElemMeasure(); +} + +//======================================================================= +//function : SetUseDelauney +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetUseDelauney(CORBA::Boolean toUse) +{ + if ( GetUseDelauney() != toUse ) + { + this->GetImpl()->SetUseDelauney( toUse ); + SMESH::TPythonDump() << _this() << ".SetUseDelauney( " << toUse << " )"; + } +} + +//======================================================================= +//function : GetUseDelauney +//purpose : +//======================================================================= + +CORBA::Boolean NETGENPlugin_Hypothesis_i::GetUseDelauney() +{ + return GetImpl()->GetUseDelauney(); +} + +//======================================================================= +//function : SetCheckOverlapping +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetCheckOverlapping(CORBA::Boolean toCheck ) +{ + if ( GetCheckOverlapping() != toCheck ) + { + this->GetImpl()->SetCheckOverlapping( toCheck ); + SMESH::TPythonDump() << _this() << ".SetCheckOverlapping( " << toCheck << " )"; + } +} + +//======================================================================= +//function : GetCheckOverlapping +//purpose : +//======================================================================= + +CORBA::Boolean NETGENPlugin_Hypothesis_i::GetCheckOverlapping() +{ + return GetImpl()->GetCheckOverlapping(); +} + +//======================================================================= +//function : SetCheckChartBoundary +//purpose : +//======================================================================= + +void NETGENPlugin_Hypothesis_i::SetCheckChartBoundary(CORBA::Boolean toCheck ) +{ + if ( GetCheckChartBoundary() != toCheck ) + { + this->GetImpl()->SetCheckChartBoundary( toCheck ); + SMESH::TPythonDump() << _this() << ".SetCheckChartBoundary( " << toCheck << " )"; + } +} + +//======================================================================= +//function : GetCheckChartBoundary +//purpose : Get implementation +//======================================================================= + +CORBA::Boolean NETGENPlugin_Hypothesis_i::GetCheckChartBoundary() +{ + return GetImpl()->GetCheckChartBoundary(); +} + //============================================================================= /*! * NETGENPlugin_Hypothesis_i::GetImpl @@ -490,3 +703,51 @@ std::string NETGENPlugin_Hypothesis_i::getMethodOfParameter(const int paramIndex } return ""; } + +//================================================================================ +/*! + * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter + */ +//================================================================================ + +bool +NETGENPlugin_Hypothesis_i::getObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) const +{ + typedef ::NETGENPlugin_Hypothesis THyp; + + const THyp* h = static_cast< ::NETGENPlugin_Hypothesis* >( myBaseImpl ); + const THyp::TLocalSize& ls = h->GetLocalSizesAndEntries(); + + THyp::TLocalSize::const_iterator entry2size = ls.cbegin(); + for ( ; entry2size != ls.cend(); ++entry2size ) + entryArray.push_back( entry2size->first ); + + return true; +} + +//================================================================================ +/*! + * \brief Set new geometry instead of that returned by getObjectsDependOn() + */ +//================================================================================ + +bool +NETGENPlugin_Hypothesis_i::setObjectsDependOn( std::vector< std::string > & entryArray, + std::vector< int > & subIDArray ) +{ + typedef ::NETGENPlugin_Hypothesis THyp; + + const THyp* h = static_cast< ::NETGENPlugin_Hypothesis* >( myBaseImpl ); + + THyp::TLocalSize& lsNew = const_cast< THyp::TLocalSize& >( h->GetLocalSizesAndEntries() ); + THyp::TLocalSize ls; + lsNew.swap( ls ); + + THyp::TLocalSize::const_iterator entry2size = ls.cbegin(); + for ( int i = 0; entry2size != ls.cend(); ++entry2size, ++i ) + if ( !entryArray[ i ].empty() ) + lsNew[ entryArray[ i ]] = entry2size->second; + + return true; +}