+
+//=======================================================================
+//function : RotationSweep
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElements,
+ const SMESH::AxisStruct & theAxis,
+ CORBA::Double theAngleInRadians,
+ CORBA::Long theNbOfSteps,
+ CORBA::Double theTolerance)
+{
+ initData();
+
+ TIDSortedElemSet inElements, copyElements;
+ ToMap(theIDsOfElements, GetMeshDS(), inElements);
+
+ TIDSortedElemSet* workElements = & inElements;
+ TPreviewMesh tmpMesh( SMDSAbs_Face );
+ SMESH_Mesh* mesh = 0;
+ bool makeWalls=true;
+ if ( myPreviewMode )
+ {
+ SMDSAbs_ElementType select = SMDSAbs_All, avoid = SMDSAbs_Volume;
+ tmpMesh.Copy( inElements, copyElements, select, avoid );
+ mesh = &tmpMesh;
+ workElements = & copyElements;
+ //makeWalls = false;
+ }
+ else
+ {
+ mesh = myMesh;
+ }
+
+ gp_Ax1 Ax1 (gp_Pnt( theAxis.x, theAxis.y, theAxis.z ),
+ gp_Vec( theAxis.vx, theAxis.vy, theAxis.vz ));
+
+ ::SMESH_MeshEditor anEditor( mesh );
+ anEditor.RotationSweep (*workElements, Ax1, theAngleInRadians,
+ theNbOfSteps, theTolerance, makeWalls);
+
+ StoreResult(anEditor);
+
+ if ( !myPreviewMode ) {
+ // Update Python script
+ TPythonDump() << "axis = " << theAxis;
+ TPythonDump() << this << ".RotationSweep( "
+ << theIDsOfElements
+ << ", axis, "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
+ }
+}
+
+//=======================================================================
+//function : RotationSweepObject
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::AxisStruct & theAxis,
+ CORBA::Double theAngleInRadians,
+ CORBA::Long theNbOfSteps,
+ CORBA::Double theTolerance)
+{
+ initData();
+
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ RotationSweep(anElementsId, theAxis, theAngleInRadians, theNbOfSteps, theTolerance);
+
+ // Clear python line, created by RotationSweep()
+ SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+ aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
+
+ // Update Python script
+ TPythonDump() << this << ".RotationSweepObject( "
+ << theObject
+ << ", axis, "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
+}
+
+//=======================================================================
+//function : ExtrusionSweep
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElements,
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps)
+{
+ initData();
+
+#ifdef NO_CAS_CATCH
+ try {
+ OCC_CATCH_SIGNALS;
+#else
+ CASCatch_TRY {
+#endif
+ SMESHDS_Mesh* aMesh = GetMeshDS();
+
+ TIDSortedElemSet elements;
+ ToMap(theIDsOfElements, aMesh, elements);
+
+ const SMESH::PointStruct * P = &theStepVector.PS;
+ gp_Vec stepVec( P->x, P->y, P->z );
+
+ TElemOfElemListMap aHystory;
+ ::SMESH_MeshEditor anEditor( myMesh );
+ anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
+
+ StoreResult(anEditor);
+
+ // Update Python script
+ TPythonDump() << "stepVector = " << theStepVector;
+ TPythonDump() << this << ".ExtrusionSweep( "
+ << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
+
+#ifdef NO_CAS_CATCH
+ } catch(Standard_Failure) {
+#else
+ } CASCatch_CATCH(Standard_Failure) {
+#endif
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
+ }
+}
+
+
+//=======================================================================
+//function : ExtrusionSweepObject
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps)
+{
+ initData();
+
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ ExtrusionSweep(anElementsId, theStepVector, theNbOfSteps);
+
+ // Clear python line, created by ExtrusionSweep()
+ SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+ aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
+
+ // Update Python script
+ TPythonDump() << this << ".ExtrusionSweepObject( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
+}
+