mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 03:40:33 +05:00
0020431: EDF 1020 SMESH : Radial Mesh of a cylinder
* Fix conversion of LayerDistribution hypothesis
This commit is contained in:
parent
c6fb8166df
commit
890d47aa59
@ -1316,7 +1316,7 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
|
|||||||
hyp->AddArgMethod( "SetNumberOfLayers" );
|
hyp->AddArgMethod( "SetNumberOfLayers" );
|
||||||
}
|
}
|
||||||
else if ( hypType == "LayerDistribution2D" ) {
|
else if ( hypType == "LayerDistribution2D" ) {
|
||||||
hyp = new _pyLayerDistributionHypo( theCreationCmd );
|
hyp = new _pyLayerDistributionHypo( theCreationCmd, "Get2DHypothesis" );
|
||||||
hyp->SetConvMethodAndType( "LayerDistribution", "RadialQuadrangle_1D2D");
|
hyp->SetConvMethodAndType( "LayerDistribution", "RadialQuadrangle_1D2D");
|
||||||
}
|
}
|
||||||
// BLSURF ----------
|
// BLSURF ----------
|
||||||
@ -1418,14 +1418,11 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
|
|||||||
hyp->AddArgMethod( "SetNumberOfLayers" );
|
hyp->AddArgMethod( "SetNumberOfLayers" );
|
||||||
}
|
}
|
||||||
else if ( hypType == "LayerDistribution" ) {
|
else if ( hypType == "LayerDistribution" ) {
|
||||||
hyp = new _pyLayerDistributionHypo( theCreationCmd );
|
hyp = new _pyLayerDistributionHypo( theCreationCmd, "Get3DHypothesis" );
|
||||||
hyp->SetConvMethodAndType( "LayerDistribution", "RadialPrism_3D");
|
hyp->SetConvMethodAndType( "LayerDistribution", "RadialPrism_3D");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( algo->IsValid() ) {
|
return algo->IsValid() ? algo : hyp;
|
||||||
return algo;
|
|
||||||
}
|
|
||||||
return hyp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -1686,20 +1683,23 @@ bool _pyLayerDistributionHypo::Addition2Creation( const Handle(_pyCommand)& theA
|
|||||||
|
|
||||||
_pyID geom = theAdditionCmd->GetArg( 1 );
|
_pyID geom = theAdditionCmd->GetArg( 1 );
|
||||||
|
|
||||||
my1dHyp->SetMesh( theMesh );
|
|
||||||
if ( !my1dHyp->Addition2Creation( theAdditionCmd, theMesh ))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// clear "SetLayerDistribution()" cmd
|
|
||||||
myArgCommands.front()->Clear();
|
|
||||||
|
|
||||||
// Convert my creation => me = RadialPrismAlgo.Get3DHypothesis()
|
|
||||||
|
|
||||||
// find RadialPrism algo created on <geom> for theMesh
|
|
||||||
Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMesh, this );
|
Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMesh, this );
|
||||||
if ( !algo.IsNull() ) {
|
if ( !algo.IsNull() )
|
||||||
|
{
|
||||||
|
my1dHyp->SetMesh( theMesh );
|
||||||
|
my1dHyp->SetConvMethodAndType(my1dHyp->GetAlgoCreationMethod().ToCString(),
|
||||||
|
algo->GetAlgoType().ToCString());
|
||||||
|
if ( !my1dHyp->Addition2Creation( theAdditionCmd, theMesh ))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// clear "SetLayerDistribution()" cmd
|
||||||
|
myArgCommands.back()->Clear();
|
||||||
|
|
||||||
|
// Convert my creation => me = RadialPrismAlgo.Get3DHypothesis()
|
||||||
|
|
||||||
|
// find RadialPrism algo created on <geom> for theMesh
|
||||||
GetCreationCmd()->SetObject( algo->GetID() );
|
GetCreationCmd()->SetObject( algo->GetID() );
|
||||||
GetCreationCmd()->SetMethod( "Get3DHypothesis" );
|
GetCreationCmd()->SetMethod( myAlgoMethod );
|
||||||
GetCreationCmd()->RemoveArgs();
|
GetCreationCmd()->RemoveArgs();
|
||||||
theAdditionCmd->AddDependantCmd( GetCreationCmd() );
|
theAdditionCmd->AddDependantCmd( GetCreationCmd() );
|
||||||
myIsWrapped = true;
|
myIsWrapped = true;
|
||||||
@ -1723,17 +1723,16 @@ void _pyLayerDistributionHypo::Flush()
|
|||||||
|
|
||||||
// make a new name for 1D hyp = "HypType" + "_Distribution"
|
// make a new name for 1D hyp = "HypType" + "_Distribution"
|
||||||
_pyID newName;
|
_pyID newName;
|
||||||
if ( my1dHyp->GetCreationCmd()->GetMethod() == "CreateHypothesis" ) {
|
if ( my1dHyp->IsWrapped() ) {
|
||||||
// not yet converted creation cmd
|
newName = my1dHyp->GetCreationCmd()->GetMethod();
|
||||||
TCollection_AsciiString hypTypeQuoted = my1dHyp->GetCreationCmd()->GetArg(1);
|
|
||||||
TCollection_AsciiString hypType = hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 );
|
|
||||||
newName = hypType + "_Distribution";
|
|
||||||
my1dHyp->GetCreationCmd()->SetResultValue( newName );
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// already converted creation cmd
|
TCollection_AsciiString hypTypeQuoted = my1dHyp->GetCreationCmd()->GetArg(1);
|
||||||
newName = my1dHyp->GetCreationCmd()->GetResultValue();
|
newName = hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 );
|
||||||
}
|
}
|
||||||
|
newName += "_Distribution";
|
||||||
|
my1dHyp->GetCreationCmd()->SetResultValue( newName );
|
||||||
|
|
||||||
list< Handle(_pyCommand) >& cmds = theGen->GetCommands();
|
list< Handle(_pyCommand) >& cmds = theGen->GetCommands();
|
||||||
list< Handle(_pyCommand) >::iterator cmdIt = cmds.begin();
|
list< Handle(_pyCommand) >::iterator cmdIt = cmds.begin();
|
||||||
for ( ; cmdIt != cmds.end(); ++cmdIt ) {
|
for ( ; cmdIt != cmds.end(); ++cmdIt ) {
|
||||||
@ -1744,20 +1743,10 @@ void _pyLayerDistributionHypo::Flush()
|
|||||||
( *cmdIt )->SetObject( newName );
|
( *cmdIt )->SetObject( newName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !myArgCommands.empty() )
|
// Set new hyp name to SetLayerDistribution() cmd
|
||||||
|
if ( !myArgCommands.empty() && !myArgCommands.back()->IsEmpty() )
|
||||||
myArgCommands.back()->SetArg( 1, newName );
|
myArgCommands.back()->SetArg( 1, newName );
|
||||||
}
|
}
|
||||||
// copy hyp1d's creation method and args
|
|
||||||
// myCreationMethod = hyp1d->GetCreationMethod();
|
|
||||||
// myArgs = hyp1d->GetArgs();
|
|
||||||
// // make them cleared at conversion
|
|
||||||
// myArgCommands = hyp1d->GetArgCommands();
|
|
||||||
|
|
||||||
// // to be cleared at convertion only
|
|
||||||
// myArgCommands.push_back( theCommand );
|
|
||||||
|
|
||||||
//my1dHyp.Nullify();
|
|
||||||
//_pyHypothesis::Flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
int GetOrderNb() const { return myOrderNb; }
|
int GetOrderNb() const { return myOrderNb; }
|
||||||
void SetOrderNb( int theNb ) { myOrderNb = theNb; }
|
void SetOrderNb( int theNb ) { myOrderNb = theNb; }
|
||||||
int Length() { return myString.Length(); }
|
int Length() { return myString.Length(); }
|
||||||
void Clear() { myString.Clear(); myBegPos.Clear(); }
|
void Clear() { myString.Clear(); myBegPos.Clear(); myArgs.Clear(); }
|
||||||
bool IsEmpty() const { return myString.IsEmpty(); }
|
bool IsEmpty() const { return myString.IsEmpty(); }
|
||||||
TCollection_AsciiString GetIndentation();
|
TCollection_AsciiString GetIndentation();
|
||||||
const TCollection_AsciiString & GetResultValue();
|
const TCollection_AsciiString & GetResultValue();
|
||||||
@ -373,9 +373,10 @@ DEFINE_STANDARD_HANDLE (_pyComplexParamHypo, _pyHypothesis);
|
|||||||
class _pyLayerDistributionHypo: public _pyHypothesis
|
class _pyLayerDistributionHypo: public _pyHypothesis
|
||||||
{
|
{
|
||||||
Handle(_pyHypothesis) my1dHyp;
|
Handle(_pyHypothesis) my1dHyp;
|
||||||
|
TCollection_AsciiString myAlgoMethod;
|
||||||
public:
|
public:
|
||||||
_pyLayerDistributionHypo(const Handle(_pyCommand)& theCreationCmd):
|
_pyLayerDistributionHypo(const Handle(_pyCommand)& theCreationCmd, const char* algoMethod):
|
||||||
_pyHypothesis(theCreationCmd) {}
|
_pyHypothesis(theCreationCmd), myAlgoMethod((char*)algoMethod) {}
|
||||||
void Process( const Handle(_pyCommand)& theCommand);
|
void Process( const Handle(_pyCommand)& theCommand);
|
||||||
void Flush();
|
void Flush();
|
||||||
bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd,
|
bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd,
|
||||||
|
@ -208,6 +208,19 @@ namespace SMESH
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TPythonDump&
|
||||||
|
TPythonDump::
|
||||||
|
operator<<(SMESH::SMESH_Hypothesis_ptr theArg)
|
||||||
|
{
|
||||||
|
SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
|
||||||
|
SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
|
||||||
|
if(aSObject->_is_nil() && !CORBA::is_nil(theArg))
|
||||||
|
myStream << "hyp_" << theArg->GetId();
|
||||||
|
else
|
||||||
|
*this << CORBA::Object_ptr( theArg );
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
TPythonDump&
|
TPythonDump&
|
||||||
TPythonDump::
|
TPythonDump::
|
||||||
operator<<(SMESH::FilterLibrary_i* theArg)
|
operator<<(SMESH::FilterLibrary_i* theArg)
|
||||||
|
@ -117,6 +117,9 @@ namespace SMESH
|
|||||||
TPythonDump&
|
TPythonDump&
|
||||||
operator<<(const SMESH::double_array& theArg);
|
operator<<(const SMESH::double_array& theArg);
|
||||||
|
|
||||||
|
TPythonDump&
|
||||||
|
operator<<(SMESH::SMESH_Hypothesis_ptr theArg);
|
||||||
|
|
||||||
TPythonDump&
|
TPythonDump&
|
||||||
operator<<(SALOMEDS::SObject_ptr theArg);
|
operator<<(SALOMEDS::SObject_ptr theArg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user