+
+ // meshes made by *MakeMesh() methods are not wrapped by _pyMesh,
+ // so let _pyMesh care of it (TMP?)
+ // if ( theCommand->GetMethod().Search("MakeMesh") != -1 )
+ // _pyMesh( new _pyCommand( theCommand->GetString(), 0 )); // for theGen->SetAccessorMethod()
+ if ( isPyMeshMethod )
+ {
+ theCommand->SetObject( myMesh );
+ }
+ else
+ {
+ // editor creation command is needed only if any editor function is called
+ theGen->AddMeshAccessorMethod( theCommand ); // for *Object()
+ if ( !myCreationCmdStr.IsEmpty() ) {
+ GetCreationCmd()->GetString() = myCreationCmdStr;
+ myCreationCmdStr.Clear();
+ }
+ }
+}
+
+//================================================================================
+/*!
+ * \brief _pyHypothesis constructor
+ * \param theCreationCmd -
+ */
+//================================================================================
+
+_pyHypothesis::_pyHypothesis(const Handle(_pyCommand)& theCreationCmd):
+ _pyObject( theCreationCmd )
+{
+ myIsAlgo = myIsWrapped = /*myIsConverted = myIsLocal = myDim = */false;
+}
+
+//================================================================================
+/*!
+ * \brief Creates algorithm or hypothesis
+ * \param theCreationCmd - The engine command creating a hypothesis
+ * \retval Handle(_pyHypothesis) - Result _pyHypothesis
+ */
+//================================================================================
+
+Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& theCreationCmd)
+{
+ // theCreationCmd: CreateHypothesis( "theHypType", "theLibName" )
+ ASSERT (( theCreationCmd->GetMethod() == "CreateHypothesis"));
+
+ Handle(_pyHypothesis) hyp, algo;
+
+ // "theHypType"
+ const TCollection_AsciiString & hypTypeQuoted = theCreationCmd->GetArg( 1 );
+ if ( hypTypeQuoted.IsEmpty() )
+ return hyp;
+ // theHypType
+ TCollection_AsciiString hypType =
+ hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 );
+
+ algo = new _pyAlgorithm( theCreationCmd );
+ hyp = new _pyHypothesis( theCreationCmd );
+
+ // 1D Regular_1D ----------
+ if ( hypType == "Regular_1D" ) {
+ // set mesh's method creating algo,
+ // i.e. convertion result will be "regular1d = Mesh.Segment()",
+ // and set hypType by which algo creating a hypothesis is searched for
+ algo->SetConvMethodAndType("Segment", hypType.ToCString());
+ }
+ else if ( hypType == "CompositeSegment_1D" ) {
+ algo->SetConvMethodAndType("Segment", "Regular_1D");
+ algo->myArgs.Append( "algo=smesh.COMPOSITE");
+ }
+ else if ( hypType == "LocalLength" ) {
+ // set algo's method creating hyp, and algo type
+ hyp->SetConvMethodAndType( "LocalLength", "Regular_1D");
+ // set method whose 1 arg will become the 1-st arg of hyp creation command
+ // i.e. convertion result will be "locallength = regular1d.LocalLength(<arg of SetLength()>)"
+ hyp->AddArgMethod( "SetLength" );
+ }
+ else if ( hypType == "MaxLength" ) {
+ // set algo's method creating hyp, and algo type
+ hyp->SetConvMethodAndType( "MaxSize", "Regular_1D");
+ // set method whose 1 arg will become the 1-st arg of hyp creation command
+ // i.e. convertion result will be "maxsize = regular1d.MaxSize(<arg of SetLength()>)"
+ hyp->AddArgMethod( "SetLength" );
+ }
+ else if ( hypType == "NumberOfSegments" ) {
+ hyp = new _pyNumberOfSegmentsHyp( theCreationCmd );
+ hyp->SetConvMethodAndType( "NumberOfSegments", "Regular_1D");
+ // arg of SetNumberOfSegments() will become the 1-st arg of hyp creation command
+ hyp->AddArgMethod( "SetNumberOfSegments" );
+ // arg of SetScaleFactor() will become the 2-nd arg of hyp creation command
+ hyp->AddArgMethod( "SetScaleFactor" );
+ hyp->AddArgMethod( "SetReversedEdges" );
+ }
+ else if ( hypType == "Arithmetic1D" ) {
+ hyp = new _pyComplexParamHypo( theCreationCmd );
+ hyp->SetConvMethodAndType( "Arithmetic1D", "Regular_1D");
+ hyp->AddArgMethod( "SetStartLength" );
+ hyp->AddArgMethod( "SetEndLength" );
+ hyp->AddArgMethod( "SetReversedEdges" );
+ }
+ else if ( hypType == "StartEndLength" ) {
+ hyp = new _pyComplexParamHypo( theCreationCmd );
+ hyp->SetConvMethodAndType( "StartEndLength", "Regular_1D");
+ hyp->AddArgMethod( "SetStartLength" );
+ hyp->AddArgMethod( "SetEndLength" );
+ hyp->AddArgMethod( "SetReversedEdges" );
+ }
+ else if ( hypType == "Deflection1D" ) {
+ hyp->SetConvMethodAndType( "Deflection1D", "Regular_1D");
+ hyp->AddArgMethod( "SetDeflection" );
+ }
+ else if ( hypType == "Propagation" ) {
+ hyp->SetConvMethodAndType( "Propagation", "Regular_1D");
+ }
+ else if ( hypType == "QuadraticMesh" ) {
+ hyp->SetConvMethodAndType( "QuadraticMesh", "Regular_1D");