From 84d928da09dbefe23460d354d15c927c93794e23 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 20 Feb 2007 07:34:00 +0000 Subject: [PATCH] PAL13903 (SMESH Extrusion along a path , linear variation of the angles) add LinearAnglesVariation() --- src/SMESH_I/SMESH_MeshEditor_i.cxx | 56 ++++++++++++++++++++++-------- src/SMESH_I/SMESH_MeshEditor_i.hxx | 8 +++-- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 8447ab89e..36413918a 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -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(); } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index cd7538c62..73d3e7ee8 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -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 -- 2.39.2