if(aMethod.IsEqual("SetLength")) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ // here and below IncrementState() is commented for hypothesis commands
+ // because at the current moment all hypotheses have only one state
+ //aStates->IncrementState();
}
else if(aMethod.IsEqual("SetPrecision")) {
if(!aStates->GetCurrectState().at(1).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(1));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
if(aMethod == "SetLength") {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
else if(!aStates->GetCurrectState().at(1).IsEmpty())
aCmd->SetArg(1,aStates->GetCurrectState().at(1));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
if(aMethod == "SetDeflection" && aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
if(aMethod == "SetMaxElementArea" && aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
if(aMethod == "SetMaxElementVolume" && aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
if(aMethod == "SetMaxSize" && aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
else if(aMethod == "SetGrowthRate" && aStates->GetCurrectState().size() >= 2) {
if(!aStates->GetCurrectState().at(1).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(1));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
else if(aMethod == "SetNbSegPerEdge" && aStates->GetCurrectState().size() >= 3) {
if(!aStates->GetCurrectState().at(2).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(2));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
else if(aMethod == "SetNbSegPerRadius" && aStates->GetCurrectState().size() >= 4) {
if(!aStates->GetCurrectState().at(3).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(3));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
else if(aMethod == "SetMaxElementArea" && aStates->GetCurrectState().size() >= 2) {
if(!aStates->GetCurrectState().at(1).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(1));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
else if(aMethod == "SetMaxElementVolume" && aStates->GetCurrectState().size() >= 3) {
if(!aStates->GetCurrectState().at(2).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(2));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
else if(aMethod == "LengthFromEdges" || aMethod == "LengthFromFaces"){
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
- // Case for NumberOfLayers hypothesis
- else if(aStates->GetObjectType().IsEqual("NumberOfLayers")){
+ // Case for NumberOfLayers or NumberOfLayers2D hypothesis
+ else if(aStates->GetObjectType().IsEqual("NumberOfLayers") ||
+ aStates->GetObjectType().IsEqual("NumberOfLayers2D")){
if(aMethod == "SetNumberOfLayers" && aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
if(aMethod == "SetNumberOfSegments" && aStates->GetCurrectState().size() >= 1) {
if(!aStates->GetCurrectState().at(0).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
- if(aStates->GetCurrectState().size()==1)
- aStates->IncrementState();
+ //if(aStates->GetCurrectState().size()==1)
+ // aStates->IncrementState();
}
else if (aMethod == "SetScaleFactor" && aStates->GetCurrectState().size() >= 2) {
if(!aStates->GetCurrectState().at(1).IsEmpty() )
aCmd->SetArg(1,aStates->GetCurrectState().at(1));
- aStates->IncrementState();
+ //aStates->IncrementState();
}
}
}
aStates->IncrementState();
}
- else if(aMethod.IsEqual("ExtrusionAlongPath") ||
+ else if(aMethod.IsEqual("ExtrusionAlongPathX") || // new version of extrusion along path (issue 20003)
+ aMethod.IsEqual("ExtrusionAlongPathObjX") || // no comments 0_o
+ aMethod.IsEqual("ExtrusionAlongPath") ||
aMethod.IsEqual("ExtrusionAlongPathObject") ||
aMethod.IsEqual("ExtrusionAlongPathObject1D") ||
aMethod.IsEqual("ExtrusionAlongPathObject2D") ||
int anArgIndex = 0;
for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
- anArgIndex = i-1-aNbAngles;
+ anArgIndex = i-3;
break;
}
}
- if(anArgIndex > 0) {
- int j = 0;
- for(; j < aNbAngles; j++) {
- if(!aCurrentState.at(j).IsEmpty()) {
- aCmd->SetArg(anArgIndex+j-1, aCurrentState.at(j));
+ if(anArgIndex > 0) { // the argument should be parsed like that: [ 1, 2, 3 ] -> [ "a", 2, "b" ]
+ TCollection_AsciiString anAngleArg = aCmd->GetArg(anArgIndex);
+ for(int anIndex = 1; anIndex <= aNbAngles; anIndex++) {
+ int aPos1 = anIndex == 1 ? 1 : anAngleArg.Location(anIndex-1, ',', 1, anAngleArg.Length());
+ int aPos2 = anIndex == aNbAngles ? anAngleArg.Length() : anAngleArg.Location(anIndex, ',', 1, anAngleArg.Length());
+ TCollection_AsciiString aParameter = anAngleArg.SubString(aPos1+1, aPos2-1);
+ if(!aCurrentState.at(anIndex-1).IsEmpty()) {
+ TCollection_AsciiString aSubst = aCurrentState.at(anIndex-1);
+ aSubst.Prepend(TCollection_AsciiString(" "));
+ anAngleArg.Remove(aPos1+1, aPos2-aPos1-1);
+ anAngleArg.Insert(aPos1+1, aSubst);
}
}
- for(; j < aNbAngles+3; j++) {
- if(!aCurrentState.at(j).IsEmpty()) {
+ aCmd->SetArg(anArgIndex, anAngleArg);
+ for(int j = 0; j < 3; j++) {
+ if(!aCurrentState.at(j+aNbAngles).IsEmpty()) {
isSubstitute = true;
- aCmd->SetArg(anArgIndex+j+2, aCurrentState.at(j));
+ aCmd->SetArg(anArgIndex+4+j, aCurrentState.at(j+aNbAngles));
}
}
}
if(isSubstitute)
- aCmd->SetArg(anArgIndex + aNbAngles + 1,
+ aCmd->SetArg(anArgIndex + 3,
TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
aStates->IncrementState();
}
ProcessLayerDistribution();
}
+
+//============================================================================
+// function : splitString
+// purpose : The functions returns a list of substring of initial string
+// divided by given separator include empty strings
+//============================================================================
+std::vector<std::string> splitString(const std::string& theValue, char sep)
+{
+ std::vector<std::string> aResult;
+ if(theValue[0] == sep ) aResult.push_back(std::string());
+ int pos = theValue.find(sep);
+ if(pos < 0 ) {
+ aResult.push_back(theValue);
+ return aResult;
+ }
+
+ std::string s = theValue;
+ if(s[0] == sep) s = s.substr(1, s.size());
+ while((pos = s.find(sep)) >= 0) {
+ aResult.push_back(s.substr(0, pos));
+ s = s.substr(pos+1, s.size());
+ }
+
+ if(!s.empty() && s[0] != sep) aResult.push_back(s);
+ if(theValue[theValue.size()-1] == sep) aResult.push_back(std::string());
+
+ return aResult;
+}
+
+//============================================================================
+// function : splitString
+// purpose : The functions returns a list of lists of substrings of initial string
+// divided by two given separators include empty strings
+//============================================================================
+std::vector< std::vector<std::string> > splitString(const std::string& theValue, char sep1, char sep2)
+{
+ std::vector< std::vector<std::string> > aResult;
+ if(theValue.size() > 0) {
+ std::vector<std::string> aSections = splitString( theValue, sep1 );
+ for( int i = 0, n = aSections.size(); i < n; i++ )
+ aResult.push_back( splitString( aSections[i], sep2 ) );
+ }
+ return aResult;
+}
+
//================================================================================
/*!
* \brief Private method
//================================================================================
void SMESH_NoteBook::InitObjectMap()
{
- /* ouv: temporarily disabled
SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
if(!aGen)
return;
return;
SALOMEDS::ChildIterator_var Itr = aStudy->NewChildIterator(aSO);
- char* aParameters;
+ std::string aParameters;
for(Itr->InitEx(true); Itr->More(); Itr->Next()) {
SALOMEDS::SObject_var aSObject = Itr->Value();
SALOMEDS::GenericAttribute_var anAttr;
if ( aSObject->FindAttribute(anAttr, "AttributeString")) {
aParameters = SALOMEDS::AttributeString::_narrow(anAttr)->Value();
- SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
+ std::vector< std::vector<string> > aSections = splitString(aParameters, '|', ':');
if(MYDEBUG) {
cout<<"Entry : "<< aSObject->GetID()<<endl;
cout<<"aParameters : "<<aParameters<<endl;
else
aState = new ObjectStates(anObjType);
- for(int i = 0; i < aSections->length(); i++) {
+ for(int i = 0; i < aSections.size(); i++) {
TState aVars;
- SALOMEDS::ListOfStrings aListOfVars = aSections[i];
- for(int j = 0;j<aListOfVars.length();j++) {
- TCollection_AsciiString aVar(aListOfVars[j].in());
- if(!aVar.IsEmpty() && aStudy->IsVariable(aVar.ToCString())) {
+ std::vector<string> aListOfVars = aSections[i];
+ for(int j = 0;j<aListOfVars.size();j++) {
+ TCollection_AsciiString aVar(aListOfVars[j].c_str());
+ if(!aVar.IsEmpty()) {
aVar.InsertBefore(1,"\"");
aVar.InsertAfter(aVar.Length(),"\"");
}
_objectMap.insert(pair<TCollection_AsciiString,ObjectStates*>(TCollection_AsciiString(aSObject->GetID()),aState));
}
}
- */
+
+ if(MYDEBUG) {
+ printf( "_objectMap:\n" );
+ std::map<TCollection_AsciiString,ObjectStates*>::const_iterator it1 = _objectMap.begin();
+ for( ; it1 != _objectMap.end(); ++it1 ) {
+ TCollection_AsciiString aName = (*it1).first;
+ ObjectStates* aStates = (*it1).second;
+ printf( " Name = %s\n", aName.ToCString() );
+ TAllStates anAllStates = aStates->GetAllStates();
+ for( int i = 0; i < anAllStates.size(); i++ ) {
+ TState aState = anAllStates[i];
+ printf( " %d - ( ", i );
+ for( int j = 0; j < aState.size(); j++ )
+ printf( "%s ", aState[j].ToCString() );
+ printf( ")\n" );
+ }
+ }
+ }
}
//================================================================================
from math import pi
return AngleInDegrees * pi / 180.0
-# Salome notebook variable separator
-var_separator = ":"
-
# Parametrized substitute for PointStruct
class PointStructStr:
def __init__(self, pointStruct):
self.pointStruct = pointStruct
+# Returns value of the parameter
+def ParseValue(Parameter, ConvertToRadians = False):
+ Result = Parameter
+ if isinstance(Parameter, str):
+ p = notebook.get(Parameter)
+ if p == None:
+ notebook.getNotebook().AddExpression(Parameter)
+ p = notebook.get(Parameter)
+ if ConvertToRadians:
+ p = DegreesToRadians(p)
+ Result = p
+ return Result
+
+# Returns the input parameter unchanged if it is a string or empty string otherwise
+def ParseString(Parameter):
+ Result = ""
+ if isinstance(Parameter, str):
+ Result = Parameter
+ return Result
+
# Returns list of variable values from salome notebook
def ParsePointStruct(Point):
- Parameters = 2*var_separator
+ Parameters = []
if isinstance(Point, PointStructStr):
- Parameters = str(Point.xStr) + var_separator + str(Point.yStr) + var_separator + str(Point.zStr)
- Point = PointStruct(Point.x, Point.y, Point.z)
+ Parameters.append(ParseString(Point.xStr))
+ Parameters.append(ParseString(Point.yStr))
+ Parameters.append(ParseString(Point.zStr))
+ Point = PointStruct(ParseValue(Point.x),
+ ParseValue(Point.y),
+ ParseValue(Point.z))
return Point, Parameters
# Returns list of variable values from salome notebook
def ParseDirStruct(Dir):
- Parameters = 2*var_separator
+ Parameters = []
if isinstance(Dir, DirStructStr):
pntStr = Dir.pointStruct
if isinstance(pntStr, PointStructStr6):
- Parameters = str(pntStr.x1Str) + var_separator + str(pntStr.x2Str) + var_separator
- Parameters += str(pntStr.y1Str) + var_separator + str(pntStr.y2Str) + var_separator
- Parameters += str(pntStr.z1Str) + var_separator + str(pntStr.z2Str)
- Point = PointStruct(pntStr.x2 - pntStr.x1, pntStr.y2 - pntStr.y1, pntStr.z2 - pntStr.z1)
+ Parameters.append(ParseString(pntStr.x1Str))
+ Parameters.append(ParseString(pntStr.x2Str))
+ Parameters.append(ParseString(pntStr.y1Str))
+ Parameters.append(ParseString(pntStr.y2Str))
+ Parameters.append(ParseString(pntStr.z1Str))
+ Parameters.append(ParseString(pntStr.z2Str))
+ Point = PointStruct(ParseValue(pntStr.x2) - ParseValue(pntStr.x1),
+ ParseValue(pntStr.y2) - ParseValue(pntStr.y1),
+ ParseValue(pntStr.z2) - ParseValue(pntStr.z1))
else:
- Parameters = str(pntStr.xStr) + var_separator + str(pntStr.yStr) + var_separator + str(pntStr.zStr)
- Point = PointStruct(pntStr.x, pntStr.y, pntStr.z)
+ Parameters.append(ParseString(pntStr.xStr))
+ Parameters.append(ParseString(pntStr.yStr))
+ Parameters.append(ParseString(pntStr.zStr))
+ Point = PointStruct(ParseValue(pntStr.x),
+ ParseValue(pntStr.y),
+ ParseValue(pntStr.z))
Dir = DirStruct(Point)
return Dir, Parameters
# Returns list of variable values from salome notebook
def ParseAxisStruct(Axis):
- Parameters = 5*var_separator
+ Parameters = []
if isinstance(Axis, AxisStructStr):
- Parameters = str(Axis.xStr) + var_separator + str(Axis.yStr) + var_separator + str(Axis.zStr) + var_separator
- Parameters += str(Axis.dxStr) + var_separator + str(Axis.dyStr) + var_separator + str(Axis.dzStr)
- Axis = AxisStruct(Axis.x, Axis.y, Axis.z, Axis.dx, Axis.dy, Axis.dz)
+ Parameters.append(ParseString(Axis.xStr))
+ Parameters.append(ParseString(Axis.yStr))
+ Parameters.append(ParseString(Axis.zStr))
+ Parameters.append(ParseString(Axis.dxStr))
+ Parameters.append(ParseString(Axis.dyStr))
+ Parameters.append(ParseString(Axis.dzStr))
+ Axis = AxisStruct(ParseValue(Axis.x),
+ ParseValue(Axis.y),
+ ParseValue(Axis.z),
+ ParseValue(Axis.dx),
+ ParseValue(Axis.dy),
+ ParseValue(Axis.dz))
return Axis, Parameters
## Return list of variable values from salome notebook
def ParseAngles(list):
Result = []
- Parameters = ""
+ Parameters = []
for parameter in list:
- if isinstance(parameter,str) and notebook.isVariable(parameter):
- Result.append(DegreesToRadians(notebook.get(parameter)))
- pass
- else:
- Result.append(parameter)
- pass
-
- Parameters = Parameters + str(parameter)
- Parameters = Parameters + var_separator
+ Result.append(ParseValue(parameter, True))
+ Parameters.append(ParseString(parameter))
pass
- Parameters = Parameters[:len(Parameters)-1]
return Result, Parameters
-## Wrapper for SetParameters method
-def SetParameters( obj, params ):
- #obj.SetParameters( notebook.getNotebook(), params )
- pass
-
def IsEqual(val1, val2, tol=PrecisionConfusion):
if abs(val1 - val2) < tol:
return True
else:
aSmeshMesh = SMESH._objref_SMESH_Gen.Concatenate(
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,mergeTolerance)
- SetParameters(aSmeshMesh, Parameters)
+ geompyDC.SetParameters(aSmeshMesh, Parameters)
aMesh = Mesh(self, self.geompyD, aSmeshMesh)
return aMesh
# @ingroup l2_modif_add
def AddNode(self, x, y, z):
x,y,z,Parameters = geompyDC.ParseParameters(x,y,z)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
return self.editor.AddNode( x, y, z)
## Creates a 0D element on a node with given number.
# @ingroup l2_modif_movenode
def MoveNode(self, NodeID, x, y, z):
x,y,z,Parameters = geompyDC.ParseParameters(x,y,z)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
return self.editor.MoveNode(NodeID, x, y, z)
## Finds the node closest to a point and moves it to a point location
# @ingroup l2_modif_throughp
def MoveClosestNodeToPoint(self, x, y, z, NodeID):
x,y,z,Parameters = geompyDC.ParseParameters(x,y,z)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
return self.editor.MoveClosestNodeToPoint(x, y, z, NodeID)
## Finds the node closest to a point
MaxAngle = DegreesToRadians(MaxAngle)
if IDsOfElements == []:
IDsOfElements = self.GetElementsId()
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
Functor = 0
if ( isinstance( theCriterion, SMESH._objref_NumericalFunctor ) ):
Functor = theCriterion
if IDsOfElements == []:
IDsOfElements = self.GetElementsId()
MaxNbOfIterations,MaxAspectRatio,Parameters = geompyDC.ParseParameters(MaxNbOfIterations,MaxAspectRatio)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
return self.editor.Smooth(IDsOfElements, IDsOfFixedNodes,
MaxNbOfIterations, MaxAspectRatio, Method)
if IDsOfElements == []:
IDsOfElements = self.GetElementsId()
MaxNbOfIterations,MaxAspectRatio,Parameters = geompyDC.ParseParameters(MaxNbOfIterations,MaxAspectRatio)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
return self.editor.SmoothParametric(IDsOfElements, IDsOfFixedNodes,
MaxNbOfIterations, MaxAspectRatio, Method)
if TotalAngle and NbOfSteps:
AngleInRadians /= NbOfSteps
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
- Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AxisParameters + AngleParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.RotationSweepMakeGroups(IDsOfElements, Axis,
AngleInRadians, NbOfSteps, Tolerance)
if TotalAngle and NbOfSteps:
AngleInRadians /= NbOfSteps
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
- Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AxisParameters + AngleParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.RotationSweepObjectMakeGroups(theObject, Axis, AngleInRadians,
NbOfSteps, Tolerance)
if TotalAngle and NbOfSteps:
AngleInRadians /= NbOfSteps
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
- Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AxisParameters + AngleParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.RotationSweepObject1DMakeGroups(theObject, Axis, AngleInRadians,
NbOfSteps, Tolerance)
if TotalAngle and NbOfSteps:
AngleInRadians /= NbOfSteps
NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
- Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AxisParameters + AngleParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.RotationSweepObject2DMakeGroups(theObject, Axis, AngleInRadians,
NbOfSteps, Tolerance)
StepVector = self.smeshpyD.GetDirStruct(StepVector)
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
- Parameters = StepVectorParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = StepVectorParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
StepVector = self.smeshpyD.GetDirStruct(StepVector)
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
- Parameters = StepVectorParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = StepVectorParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
StepVector = self.smeshpyD.GetDirStruct(StepVector)
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
- Parameters = StepVectorParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = StepVectorParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionSweepObject1DMakeGroups(theObject, StepVector, NbOfSteps)
self.editor.ExtrusionSweepObject1D(theObject, StepVector, NbOfSteps)
StepVector = self.smeshpyD.GetDirStruct(StepVector)
StepVector,StepVectorParameters = ParseDirStruct(StepVector)
NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
- Parameters = StepVectorParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = StepVectorParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionSweepObject2DMakeGroups(theObject, StepVector, NbOfSteps)
self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps)
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
pass
- Parameters = AnglesParameters + var_separator + RefPointParameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AnglesParameters + RefPointParameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if isinstance(Base,list):
IDsOfElements = []
if HasAngles and Angles and LinearVariation:
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
pass
- Parameters = AnglesParameters + var_separator + RefPointParameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AnglesParameters + RefPointParameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionAlongPathMakeGroups(IDsOfElements, PathMesh,
PathShape, NodeStart, HasAngles,
if HasAngles and Angles and LinearVariation:
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
pass
- Parameters = AnglesParameters + var_separator + RefPointParameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AnglesParameters + RefPointParameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh,
PathShape, NodeStart, HasAngles,
if HasAngles and Angles and LinearVariation:
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
pass
- Parameters = AnglesParameters + var_separator + RefPointParameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AnglesParameters + RefPointParameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionAlongPathObject1DMakeGroups(theObject, PathMesh,
PathShape, NodeStart, HasAngles,
if HasAngles and Angles and LinearVariation:
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
pass
- Parameters = AnglesParameters + var_separator + RefPointParameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AnglesParameters + RefPointParameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if MakeGroups:
return self.editor.ExtrusionAlongPathObject2DMakeGroups(theObject, PathMesh,
PathShape, NodeStart, HasAngles,
if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
Mirror = self.smeshpyD.GetAxisStruct(Mirror)
Mirror,Parameters = ParseAxisStruct(Mirror)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
if Copy and MakeGroups:
return self.editor.MirrorMakeGroups(IDsOfElements, Mirror, theMirrorType)
self.editor.Mirror(IDsOfElements, Mirror, theMirrorType, Copy)
Mirror,Parameters = ParseAxisStruct(Mirror)
mesh = self.editor.MirrorMakeMesh(IDsOfElements, Mirror, theMirrorType,
MakeGroups, NewMeshName)
- SetParameters(mesh, Parameters)
+ geompyDC.SetParameters(mesh, Parameters)
return Mesh(self.smeshpyD,self.geompyD,mesh)
## Creates a symmetrical copy of the object
if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
Mirror = self.smeshpyD.GetAxisStruct(Mirror)
Mirror,Parameters = ParseAxisStruct(Mirror)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
if Copy and MakeGroups:
return self.editor.MirrorObjectMakeGroups(theObject, Mirror, theMirrorType)
self.editor.MirrorObject(theObject, Mirror, theMirrorType, Copy)
Mirror,Parameters = ParseAxisStruct(Mirror)
mesh = self.editor.MirrorObjectMakeMesh(theObject, Mirror, theMirrorType,
MakeGroups, NewMeshName)
- SetParameters(mesh, Parameters)
+ geompyDC.SetParameters(mesh, Parameters)
return Mesh( self.smeshpyD,self.geompyD,mesh )
## Translates the elements
if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
Vector = self.smeshpyD.GetDirStruct(Vector)
Vector,Parameters = ParseDirStruct(Vector)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
if Copy and MakeGroups:
return self.editor.TranslateMakeGroups(IDsOfElements, Vector)
self.editor.Translate(IDsOfElements, Vector, Copy)
Vector = self.smeshpyD.GetDirStruct(Vector)
Vector,Parameters = ParseDirStruct(Vector)
mesh = self.editor.TranslateMakeMesh(IDsOfElements, Vector, MakeGroups, NewMeshName)
- SetParameters(mesh, Parameters)
+ geompyDC.SetParameters(mesh, Parameters)
return Mesh ( self.smeshpyD, self.geompyD, mesh )
## Translates the object
if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
Vector = self.smeshpyD.GetDirStruct(Vector)
Vector,Parameters = ParseDirStruct(Vector)
- SetParameters(self.mesh, Parameters)
+ geompyDC.SetParameters(self.mesh, Parameters)
if Copy and MakeGroups:
return self.editor.TranslateObjectMakeGroups(theObject, Vector)
self.editor.TranslateObject(theObject, Vector, Copy)
Vector = self.smeshpyD.GetDirStruct(Vector)
Vector,Parameters = ParseDirStruct(Vector)
mesh = self.editor.TranslateObjectMakeMesh(theObject, Vector, MakeGroups, NewMeshName)
- SetParameters(mesh, Parameters)
+ geompyDC.SetParameters(mesh, Parameters)
return Mesh( self.smeshpyD, self.geompyD, mesh )
## Rotates the elements
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
Axis = self.smeshpyD.GetAxisStruct(Axis)
Axis,AxisParameters = ParseAxisStruct(Axis)
- Parameters = AxisParameters + var_separator + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AxisParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if Copy and MakeGroups:
return self.editor.RotateMakeGroups(IDsOfElements, Axis, AngleInRadians)
self.editor.Rotate(IDsOfElements, Axis, AngleInRadians, Copy)
if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
Axis = self.smeshpyD.GetAxisStruct(Axis)
Axis,AxisParameters = ParseAxisStruct(Axis)
- Parameters = AxisParameters + var_separator + Parameters
+ Parameters = AxisParameters + Parameters
mesh = self.editor.RotateMakeMesh(IDsOfElements, Axis, AngleInRadians,
MakeGroups, NewMeshName)
- SetParameters(mesh, Parameters)
+ geompyDC.SetParameters(mesh, Parameters)
return Mesh( self.smeshpyD, self.geompyD, mesh )
## Rotates the object
if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
Axis = self.smeshpyD.GetAxisStruct(Axis)
Axis,AxisParameters = ParseAxisStruct(Axis)
- Parameters = AxisParameters + ":" + Parameters
- SetParameters(self.mesh, Parameters)
+ Parameters = AxisParameters + Parameters
+ geompyDC.SetParameters(self.mesh, Parameters)
if Copy and MakeGroups:
return self.editor.RotateObjectMakeGroups(theObject, Axis, AngleInRadians)
self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy)
if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
Axis = self.smeshpyD.GetAxisStruct(Axis)
Axis,AxisParameters = ParseAxisStruct(Axis)
- Parameters = AxisParameters + ":" + Parameters
+ Parameters = AxisParameters + Parameters
mesh = self.editor.RotateObjectMakeMesh(theObject, Axis, AngleInRadians,
MakeGroups, NewMeshName)
- SetParameters(mesh, Parameters)
+ geompyDC.SetParameters(mesh, Parameters)
return Mesh( self.smeshpyD, self.geompyD, mesh )
## Finds groups of ajacent nodes within Tolerance.
notebook = salome_notebook.notebook
##Return values of the notebook variables
-def ParseParameters(last, nbParams,nbParam, value):
+def ParseParameters(last, nbParams, nbParam, value):
+ #print "ParseParameters", last, nbParams, nbParam, value
result = None
- strResult = ""
+ strResult = []
counter = 0
listSize = len(last)
for n in range(0,nbParams):
if n+1 != nbParam:
if counter < listSize:
- strResult = strResult + last[counter]
+ strResult.append( last[counter] )
else:
- strResult = strResult + ""
+ strResult = strResult
else:
- if isinstance(value, str):
- if notebook.isVariable(value):
- result = notebook.get(value)
- strResult=strResult+value
- else:
- raise RuntimeError, "Variable with name '" + value + "' doesn't exist!!!"
- else:
- strResult=strResult+str(value)
- result = value
- if nbParams - 1 != counter:
- strResult=strResult+var_separator #":"
+ strResult.append(ParseString(value))
+ result = ParseValue(value)
counter = counter+1
return result, strResult
# @param length numerical value or name of variable from notebook
def SetLength(self, length):
length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetParameters(self),2,1,length)
- #StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_LocalLength.SetLength(self,length)
## Set Precision parameter value
# @param precision numerical value or name of variable from notebook
def SetPrecision(self, precision):
precision,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetParameters(self),2,2,precision)
- #StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_LocalLength.SetPrecision(self, precision)
#Registering the new proxy for LocalLength
# @param length numerical value or name of variable from notebook
def SetLength(self, length):
length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.GetParameters(self),1,1,length)
- #StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetLength(self,length)
#Registering the new proxy for SegmentLengthAroundVertex
if isStart:
nb = 1
length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Arithmetic1D.GetParameters(self),2,nb,length)
- #StdMeshers._objref_StdMeshers_Arithmetic1D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_Arithmetic1D.SetLength(self,length,isStart)
#Registering the new proxy for Arithmetic1D
# @param deflection numerical value or name of variable from notebook
def SetDeflection(self, deflection):
deflection,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Deflection1D.GetParameters(self),1,1,deflection)
- #StdMeshers._objref_StdMeshers_Deflection1D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_Deflection1D.SetDeflection(self,deflection)
#Registering the new proxy for Deflection1D
if isStart:
nb = 1
length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_StartEndLength.GetParameters(self),2,nb,length)
- #StdMeshers._objref_StdMeshers_StartEndLength.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_StartEndLength.SetLength(self,length,isStart)
#Registering the new proxy for StartEndLength
# @param area numerical value or name of variable from notebook
def SetMaxElementArea(self, area):
area ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementArea.GetParameters(self),1,1,area)
- #StdMeshers._objref_StdMeshers_MaxElementArea.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_MaxElementArea.SetMaxElementArea(self,area)
#Registering the new proxy for MaxElementArea
# @param volume numerical value or name of variable from notebook
def SetMaxElementVolume(self, volume):
volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetParameters(self),1,1,volume)
- #StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_MaxElementVolume.SetMaxElementVolume(self,volume)
#Registering the new proxy for MaxElementVolume
# @param nbLayers numerical value or name of variable from notebook
def SetNumberOfLayers(self, nbLayers):
nbLayers ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfLayers.GetParameters(self),1,1,nbLayers)
- #StdMeshers._objref_StdMeshers_NumberOfLayers.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_NumberOfLayers.SetNumberOfLayers(self,nbLayers)
#Registering the new proxy for NumberOfLayers
omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfLayers._NP_RepositoryId, NumberOfLayers)
+#Wrapper class for StdMeshers_NumberOfLayers2D hypothesis
+class NumberOfLayers2D(StdMeshers._objref_StdMeshers_NumberOfLayers2D):
+
+ ## Set Number Of Layers parameter value
+ # @param nbLayers numerical value or name of variable from notebook
+ def SetNumberOfLayers(self, nbLayers):
+ nbLayers ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfLayers2D.GetParameters(self),1,1,nbLayers)
+ geompyDC.SetParameters(self, parameters)
+ StdMeshers._objref_StdMeshers_NumberOfLayers2D.SetNumberOfLayers(self,nbLayers)
+
+#Registering the new proxy for NumberOfLayers2D
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfLayers2D._NP_RepositoryId, NumberOfLayers2D)
+
#Wrapper class for StdMeshers_NumberOfSegments hypothesis
class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments):
def SetNumberOfSegments(self, nbSeg):
lastParameters = StdMeshers._objref_StdMeshers_NumberOfSegments.GetParameters(self)
nbSeg , parameters = ParseParameters(lastParameters,1,1,nbSeg)
- #StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_NumberOfSegments.SetNumberOfSegments(self,nbSeg)
## Set Scale Factor parameter value
# @param factor numerical value or name of variable from notebook
def SetScaleFactor(self, factor):
factor, parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfSegments.GetParameters(self),2,2,factor)
- #StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
StdMeshers._objref_StdMeshers_NumberOfSegments.SetScaleFactor(self,factor)
#Registering the new proxy for NumberOfSegments
def SetMaxSize(self, maxsize):
lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetParameters(self)
maxsize, parameters = ParseParameters(lastParameters,4,1,maxsize)
- #NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetMaxSize(self,maxsize)
## Set Growth Rate parameter value
def SetGrowthRate(self, value):
lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetParameters(self)
value, parameters = ParseParameters(lastParameters,4,2,value)
- #NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetGrowthRate(self,value)
## Set Number of Segments per Edge parameter value
def SetNbSegPerEdge(self, value):
lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetParameters(self)
value, parameters = ParseParameters(lastParameters,4,3,value)
- #NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerEdge(self,value)
## Set Number of Segments per Radius parameter value
def SetNbSegPerRadius(self, value):
lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetParameters(self)
value, parameters = ParseParameters(lastParameters,4,4,value)
- #NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerRadius(self,value)
#Registering the new proxy for NETGENPlugin_Hypothesis
def SetNumberOfSegments(self, nbSeg):
lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetParameters(self)
nbSeg, parameters = ParseParameters(lastParameters,2,1,nbSeg)
- #NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetNumberOfSegments(self, nbSeg)
## Set Local Length parameter value
def SetLocalLength(self, length):
lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetParameters(self)
length, parameters = ParseParameters(lastParameters,2,1,length)
- #NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length)
## Set Max Element Area parameter value
def SetMaxElementArea(self, area):
lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetParameters(self)
area, parameters = ParseParameters(lastParameters,2,2,area)
- #NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetMaxElementArea(self, area)
def LengthFromEdges(self):
lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetParameters(self)
value = 0;
value, parameters = ParseParameters(lastParameters,2,2,value)
- #NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.LengthFromEdges(self)
#Registering the new proxy for NETGEN_SimpleParameters_2D
def SetMaxElementVolume(self, volume):
lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetParameters(self)
volume, parameters = ParseParameters(lastParameters,3,3,volume)
- #NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetMaxElementVolume(self, volume)
def LengthFromFaces(self):
lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetParameters(self)
value = 0;
value, parameters = ParseParameters(lastParameters,3,3,value)
- #NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+ geompyDC.SetParameters(self, parameters)
NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.LengthFromFaces(self)
#Registering the new proxy for NETGEN_SimpleParameters_3D
theNodeIndexOnKeyPoint1,Parameters = geompyDC.ParseParameters(theNodeIndexOnKeyPoint1)
if flag:
theNodeIndexOnKeyPoint1 -= 1
- SetParameters(theMesh, Parameters)
+ geompyDC.SetParameters(theMesh, Parameters)
return SMESH._objref_SMESH_Pattern.ApplyToMeshFaces( self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse )
def ApplyToHexahedrons(self, theMesh, theVolumesIDs, theNode000Index, theNode001Index):
theNode000Index -= 1
if flag1:
theNode001Index -= 1
- SetParameters(theMesh, Parameters)
+ geompyDC.SetParameters(theMesh, Parameters)
return SMESH._objref_SMESH_Pattern.ApplyToHexahedrons( self, theMesh, theVolumesIDs, theNode000Index, theNode001Index )
#Registering the new proxy for Pattern