]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL13903 (SMESH Extrusion along a path , linear variation of the angles)
authoreap <eap@opencascade.com>
Tue, 20 Feb 2007 07:34:00 +0000 (07:34 +0000)
committereap <eap@opencascade.com>
Tue, 20 Feb 2007 07:34:00 +0000 (07:34 +0000)
    add LinearAnglesVariation()

src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.hxx

index 8447ab89e5d09efd1ea54ea09487465c5d09dc3b..36413918a3df09c6b3df7af486dbf83e617718c5 100644 (file)
@@ -1298,18 +1298,24 @@ SMESH::SMESH_MeshEditor::Extrusion_Error
   gp_Pnt refPnt( theRefPoint.x, theRefPoint.y, theRefPoint.z );
 
   // Update Python script
-  TPythonDump() << "refPoint = SMESH.PointStruct( "
-                << refPnt.X() << ", "
-                << refPnt.Y() << ", "
-                << refPnt.Z() << " )";
+  TPythonDump() << "rotAngles = " << theAngles;
+
+  if ( theHasRefPoint )
+    TPythonDump() << "refPoint = SMESH.PointStruct( "
+                  << refPnt.X() << ", "
+                  << refPnt.Y() << ", "
+                  << refPnt.Z() << " )";
+  else
+    TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
+
   TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
                 << theIDsOfElements << ", "
-                << thePathMesh  <<  ", "
-                << thePathShape <<  ", "
-                << theNodeStart << ", "
-                << theHasAngles << ", "
-                << theAngles << ", "
-                << theHasRefPoint << ", refPoint )";
+                << thePathMesh      << ", "
+                << thePathShape     << ", "
+                << theNodeStart     << ", "
+                << theHasAngles     << ", "
+                << "rotAngles"      << ", "
+                << theHasRefPoint   << ", refPoint )";
 
   ::SMESH_MeshEditor anEditor( _myMesh );
   SMESH::SMESH_MeshEditor::Extrusion_Error error = 
@@ -1350,18 +1356,40 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObje
   aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
 
   // Update Python script
+  TPythonDump() << "rotAngles = " << theAngles;
   TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject( "
                 << theObject    << ", "
                 << thePathMesh  << ", "
                 << thePathShape << ", "
                 << theNodeStart << ", "
                 << theHasAngles << ", "
-                << theAngles << ", "
-                << theHasRefPoint << ", refPoint )";
+                << "rotAngles"     << ", "
+                << theHasRefPoint<<", refPoint )";
 
   return error;
 }
 
+//================================================================================
+/*!
+ * \brief Compute rotation angles for ExtrusionAlongPath as linear variation
+ * of given angles along path steps
+  * \param PathMesh mesh containing a 1D sub-mesh on the edge, along 
+  *                which proceeds the extrusion
+  * \param PathShape is shape(edge); as the mesh can be complex, the edge 
+  *                 is used to define the sub-mesh for the path
+ */
+//================================================================================
+
+SMESH::double_array*
+SMESH_MeshEditor_i::LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       thePathMesh,
+                                          GEOM::GEOM_Object_ptr       thePathShape,
+                                          const SMESH::double_array & theAngles)
+{
+  SMESH::double_array_var aResult = new SMESH::double_array();
+  // TO BE IMPLEMENTED
+  return aResult._retn();
+}
+
 //=======================================================================
 //function : Mirror
 //purpose  :
@@ -2015,7 +2043,7 @@ void SMESH_MeshEditor_i::UpdateLastResult(::SMESH_MeshEditor& anEditor)
 
 SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
 {
-  return myLastCreatedNodes;
+  return myLastCreatedNodes.out();
 }
 
 //================================================================================
@@ -2027,7 +2055,7 @@ SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
 
 SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedElems()
 {
-  return myLastCreatedElems;
+  return myLastCreatedElems.out();
 }
 
 
index cd7538c62cedda59f8e53e4bdd704e8d7eefb5f4..73d3e7ee881219b27495e169b72a2605f67b5f66 100644 (file)
@@ -177,6 +177,10 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                              CORBA::Boolean              HasRefPoint,
                              const SMESH::PointStruct &  RefPoint);
 
+  SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
+                                             GEOM::GEOM_Object_ptr       PathShape,
+                                             const SMESH::double_array & Angles);
+
   void Mirror(const SMESH::long_array &           IDsOfElements,
               const SMESH::AxisStruct &           Axis,
               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
@@ -277,8 +281,8 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
  private:
   SMESHDS_Mesh * GetMeshDS() { return _myMesh->GetMeshDS(); }
   SMESH_Mesh   *_myMesh;
-  SMESH::long_array* myLastCreatedElems;
-  SMESH::long_array* myLastCreatedNodes;
+  SMESH::long_array_var myLastCreatedElems;
+  SMESH::long_array_var myLastCreatedNodes;
 };
 
 #endif