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;
// 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 ) )
else
aPythonDump <<"error";
- aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
+ aPythonDump << " = " << this << ".ExtrusionAlongPathX( "
<< Object << ", "
<< Path << ", "
<< NodeStart << ", "
// 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 ) )
* \brief Constructor
*/
//================================================================================
-LayerDistributionStates::LayerDistributionStates():
- ObjectStates("LayerDistribution")
+LayerDistributionStates::LayerDistributionStates(TCollection_AsciiString theType):
+ ObjectStates(theType)
{
}
//================================================================================
}
// 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));
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);
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();
}
}
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
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();
+ }
+ */
}
}
}
{
public:
typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TDistributionMap;
- LayerDistributionStates();
+ LayerDistributionStates(TCollection_AsciiString theType);
virtual ~LayerDistributionStates();
void AddDistribution(const TCollection_AsciiString& theDistribution);
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)
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)
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):
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" )
{
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" )
{
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()));
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()));