This commit is contained in:
ouv 2009-12-17 09:32:28 +00:00
parent 37240e9d8e
commit f3f5a55bf7
8 changed files with 64 additions and 32 deletions

View File

@ -1379,6 +1379,10 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
hyp = new _pyLayerDistributionHypo( theCreationCmd );
hyp->SetConvMethodAndType( "LayerDistribution", "RadialPrism_3D");
}
else if ( hypType == "LayerDistribution2D" ) {
hyp = new _pyLayerDistributionHypo( theCreationCmd );
hyp->SetConvMethodAndType( "LayerDistribution2D", "RadialQuadrangle_1D2D");
}
if ( algo->IsValid() ) {
return algo;

View File

@ -234,7 +234,7 @@ void SMESH_Hypothesis_i::UpdateStringAttribute()
// previous implementation can be found in revision 1.12.14.8
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetStudy( myBaseImpl->GetStudyId() );
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject( aStudy, SMESH::SMESH_Hypothesis::_narrow( _this() ) );
if( CORBA::is_nil( aSObject ) )

View File

@ -2556,7 +2556,7 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
else
aPythonDump <<"error";
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
aPythonDump << " = " << this << ".ExtrusionAlongPathX( "
<< Object << ", "
<< Path << ", "
<< NodeStart << ", "

View File

@ -3470,7 +3470,7 @@ void SMESH_Mesh_i::UpdateStringAttribute( const SALOME::StringArray& theParamete
// previous implementation can be found in revision 1.23.2.7.2.2.2.6
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetStudy( GetStudyId() );
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject( aStudy, SMESH::SMESH_Mesh::_narrow( _this() ) );
if( CORBA::is_nil( aSObject ) )

View File

@ -124,8 +124,8 @@ TCollection_AsciiString ObjectStates::GetObjectType() const{
* \brief Constructor
*/
//================================================================================
LayerDistributionStates::LayerDistributionStates():
ObjectStates("LayerDistribution")
LayerDistributionStates::LayerDistributionStates(TCollection_AsciiString theType):
ObjectStates(theType)
{
}
//================================================================================
@ -302,7 +302,8 @@ void SMESH_NoteBook::ReplaceVariables()
}
// Case for LayerDistribution hypothesis (not finished yet)
else if(aStates->GetObjectType() == "LayerDistribution") {
else if(aStates->GetObjectType() == "LayerDistribution" ||
aStates->GetObjectType() == "LayerDistribution2D") {
if(aMethod == "SetLayerDistribution"){
LayerDistributionStates* aLDStates = (LayerDistributionStates*)(aStates);
aLDStates->AddDistribution(aCmd->GetArg(1));
@ -732,8 +733,9 @@ void SMESH_NoteBook::InitObjectMap()
if(MYDEBUG)
cout<<"The object Type : "<<anObjType<<endl;
ObjectStates *aState = NULL;
if(anObjType == "LayerDistribution") {
aState = new LayerDistributionStates();
if(anObjType == "LayerDistribution" ||
anObjType == "LayerDistribution2D") {
aState = new LayerDistributionStates(anObjType);
}
else
aState = new ObjectStates(anObjType);
@ -839,11 +841,11 @@ void SMESH_NoteBook::ProcessLayerDistribution()
if(aType == "LocalLength") {
if(aMethod == "SetLength") {
SetVariable(_commands[i], aLDS[j],0,1);
aLDS[j]->IncrementState();
//aLDS[j]->IncrementState();
}
else if(aMethod == "SetPrecision") {
SetVariable(_commands[i], aLDS[j],1,1);
aLDS[j]->IncrementState();
//aLDS[j]->IncrementState();
}
}
@ -851,19 +853,19 @@ void SMESH_NoteBook::ProcessLayerDistribution()
else if(aType == "NumberOfSegments"){
if(aMethod == "SetNumberOfSegments") {
SetVariable(_commands[i], aLDS[j],0,1);
if(aLDS[j]->GetCurrectState().size()==1)
aLDS[j]->IncrementState();
//if(aLDS[j]->GetCurrectState().size()==1)
// aLDS[j]->IncrementState();
}
else if (aMethod == "SetScaleFactor") {
SetVariable(_commands[i], aLDS[j],1,1);
aLDS[j]->IncrementState();
//aLDS[j]->IncrementState();
}
}
else if( aType == "Deflection1D" ){
if(aMethod == "SetDeflection"){
SetVariable(_commands[i], aLDS[j],0,1);
aLDS[j]->IncrementState();
//aLDS[j]->IncrementState();
}
}
// Case for Arithmetic1D and StartEndLength hypothesis
@ -871,8 +873,18 @@ void SMESH_NoteBook::ProcessLayerDistribution()
if(aMethod == "SetLength") {
int anArgNb = (_commands[i]->GetArg(2) == "1") ? 0 : 1;
SetVariable(_commands[i], aLDS[j],anArgNb,1);
aLDS[j]->IncrementState();
//aLDS[j]->IncrementState();
}
/* ouv: temporarily disabled (see limitation on LayerDistribution in SMESH help)
else if(aMethod == "SetStartLength"){
SetVariable(_commands[i], aLDS[j],0,1);
//aLDS[j]->IncrementState();
}
else if(aMethod == "SetEndLength"){
SetVariable(_commands[i], aLDS[j],1,1);
//aLDS[j]->IncrementState();
}
*/
}
}
}

View File

@ -62,7 +62,7 @@ class LayerDistributionStates : public ObjectStates
{
public:
typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TDistributionMap;
LayerDistributionStates();
LayerDistributionStates(TCollection_AsciiString theType);
virtual ~LayerDistributionStates();
void AddDistribution(const TCollection_AsciiString& theDistribution);

View File

@ -2917,6 +2917,8 @@ class Mesh:
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
pass
if ( isinstance( Path, Mesh )):
Path = Path.GetMesh()
Parameters = AnglesParameters + RefPointParameters
geompyDC.SetParameters(self.mesh, Parameters)
@ -2929,6 +2931,7 @@ class Mesh:
HasRefPoint, RefPoint, MakeGroups, ElemType)
else:
if isinstance(Base,Mesh):
Base = Base.GetMesh()
return self.editor.ExtrusionAlongPathObjX(Base, Path, NodeStart,
HasAngles, Angles, LinearVariation,
HasRefPoint, RefPoint, MakeGroups, ElemType)
@ -5172,13 +5175,24 @@ omniORB.registerObjref(StdMeshers._objref_StdMeshers_LocalLength._NP_RepositoryI
class LayerDistribution(StdMeshers._objref_StdMeshers_LayerDistribution):
def SetLayerDistribution(self, hypo):
#StdMeshers._objref_StdMeshers_LayerDistribution.SetParameters(self,hypo.GetParameters())
#hypo.ClearParameters();
geompyDC.SetParameters(self, hypo.GetParameters())
geompyDC.SetParameters(hypo, [])
StdMeshers._objref_StdMeshers_LayerDistribution.SetLayerDistribution(self,hypo)
#Registering the new proxy for LayerDistribution
omniORB.registerObjref(StdMeshers._objref_StdMeshers_LayerDistribution._NP_RepositoryId, LayerDistribution)
#Wrapper class for StdMeshers_LayerDistribution2D hypothesis
class LayerDistribution2D(StdMeshers._objref_StdMeshers_LayerDistribution2D):
def SetLayerDistribution(self, hypo):
geompyDC.SetParameters(self, hypo.GetParameters())
geompyDC.SetParameters(hypo, [])
StdMeshers._objref_StdMeshers_LayerDistribution2D.SetLayerDistribution(self,hypo)
#Registering the new proxy for LayerDistribution
omniORB.registerObjref(StdMeshers._objref_StdMeshers_LayerDistribution2D._NP_RepositoryId, LayerDistribution2D)
#Wrapper class for StdMeshers_SegmentLengthAroundVertex hypothesis
class SegmentLengthAroundVertex(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex):

View File

@ -545,10 +545,13 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
h->SetLayerDistribution( w->GetHypothesis() );
/* ouv: temporarily disabled
h->SetParameters(w->GetHypothesis()->GetParameters());
w->GetHypothesis()->ClearParameters();
*/
SALOME::StringArray* aParameters = w->GetHypothesis()->GetParameters();
QStringList aList;
for( int i = 0; i < aParameters->length(); i++ )
aList.append( QString( aParameters->operator[](i) ) );
getNotebook()->setParameters( h, aList );
getNotebook()->setParameters( w->GetHypothesis(), QStringList() );
}
else if( hypType()=="NumberOfLayers2D" )
{
@ -566,10 +569,13 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
h->SetLayerDistribution( w->GetHypothesis() );
/* ouv: temporarily disabled
h->SetParameters(w->GetHypothesis()->GetParameters());
w->GetHypothesis()->ClearParameters();
*/
SALOME::StringArray* aParameters = w->GetHypothesis()->GetParameters();
QStringList aList;
for( int i = 0; i < aParameters->length(); i++ )
aList.append( QString( aParameters->operator[](i) ) );
getNotebook()->setParameters( h, aList );
getNotebook()->setParameters( w->GetHypothesis(), QStringList() );
}
else if( hypType()=="ProjectionSource1D" )
{
@ -885,10 +891,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
for(int i = 0;i<aParameters->length();i++)
aLastVarsList.append(QString(aParameters->operator[](i)));
/* ouv: temporarily disabled
if(!aLastVarsList.isEmpty())
h->GetLayerDistribution()->SetLastParameters(aLastVarsList.join(":").toLatin1().constData());
*/
getNotebook()->setParameters( h->GetLayerDistribution(), aLastVarsList );
customWidgets()->append
( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));
@ -913,10 +917,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
for(int i = 0;i<aParameters->length();i++)
aLastVarsList.append(QString(aParameters->operator[](i)));
/* ouv: temporarily disabled
if(!aLastVarsList.isEmpty())
h->GetLayerDistribution()->SetLastParameters(aLastVarsList.join(":").toLatin1().constData());
*/
getNotebook()->setParameters( h->GetLayerDistribution(), aLastVarsList );
customWidgets()->append
( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));