//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_MeshEditor_i.cxx
// Author : Nicolas REJNERI
// Module : SMESH
-//
+
#ifdef WNT
#define NOMINMAX
#endif
#include "SMESH_MeshEditor_i.hxx"
#include "SMDS_Mesh0DElement.hxx"
-#include "SMDS_MeshEdge.hxx"
+#include "SMDS_LinearEdge.hxx"
#include "SMDS_MeshFace.hxx"
#include "SMDS_MeshVolume.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
SMDS_MeshElement* anElemCopy = 0;
if ( anElem->IsPoly() && anElem->GetType() == SMDSAbs_Volume )
{
- const SMDS_PolyhedralVolumeOfNodes* ph =
- dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem);
+ const SMDS_VtkVolume* ph =
+ dynamic_cast<const SMDS_VtkVolume*> (anElem);
if ( ph )
anElemCopy = _myMeshDS->AddPolyhedralVolumeWithID
- (anElemNodesID, ph->GetQuanities(),anElem->GetID());
+ (anElemNodesID, ph->GetQuantities(),anElem->GetID());
}
else {
anElemCopy = ::SMESH_MeshEditor(this).AddElement( anElemNodesID,
//!< Copy a node
SMDS_MeshNode* Copy( const SMDS_MeshNode* anElemNode )
{
- return _myMeshDS->AddNodeWithID(anElemNode->X(), anElemNode->Y(), anElemNode->Z(),
+ return _myMeshDS->AddNodeWithID(anElemNode->X(), anElemNode->Y(), anElemNode->Z(),
anElemNode->GetID());
}
};// struct TPreviewMesh
// Update Python script
TPythonDump() << "isDone = " << this << ".RemoveElements( " << IDsOfElements << " )";
+ // Remove Elements
+ bool ret = anEditor.Remove( IdList, false );
+ myMesh->GetMeshDS()->Modified();
if ( IDsOfElements.length() )
myMesh->SetIsModified( true ); // issue 0020693
-
- // Remove Elements
- return anEditor.Remove( IdList, false );
+ return ret;
}
//=============================================================================
// Update Python script
TPythonDump() << "isDone = " << this << ".RemoveNodes( " << IDsOfNodes << " )";
+ bool ret = anEditor.Remove( IdList, true );
+ myMesh->GetMeshDS()->Modified();
if ( IDsOfNodes.length() )
myMesh->SetIsModified( true ); // issue 0020693
-
- return anEditor.Remove( IdList, true );
+ return ret;
}
//=============================================================================
for ( int i = 0; i < seq.size(); i++ )
IdList.push_back( seq[i] );
+ bool ret = anEditor.Remove( IdList, true );
+ myMesh->GetMeshDS()->Modified();
if ( IdList.size() )
myMesh->SetIsModified( true );
- return anEditor.Remove( IdList, true );
+ return ret;
}
//=============================================================================
TPythonDump() << "nodeID = " << this << ".AddNode( "
<< x << ", " << y << ", " << z << " )";
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true ); // issue 0020693
-
return N->GetID();
}
// Update Python script
TPythonDump() << "elem0d = " << this << ".Add0DElement( " << IDOfNode <<" )";
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true ); // issue 0020693
if (elem)
<<n1<<", "<<n2<<", "<<n12<<" ])";
}
+ myMesh->GetMeshDS()->Modified();
if(elem)
return myMesh->SetIsModified( true ), elem->GetID();
// Update Python script
TPythonDump() << "faceID = " << this << ".AddFace( " << IDsOfNodes << " )";
+ myMesh->GetMeshDS()->Modified();
if(elem)
return myMesh->SetIsModified( true ), elem->GetID();
// Update Python script
TPythonDump() <<"faceID = "<<this<<".AddPolygonalFace( "<<IDsOfNodes<<" )";
+ myMesh->GetMeshDS()->Modified();
return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
}
// Update Python script
TPythonDump() << "volID = " << this << ".AddVolume( " << IDsOfNodes << " )";
+ myMesh->GetMeshDS()->Modified();
if(elem)
return myMesh->SetIsModified( true ), elem->GetID();
int NbNodes = IDsOfNodes.length();
std::vector<const SMDS_MeshNode*> n (NbNodes);
for (int i = 0; i < NbNodes; i++)
- n[i] = GetMeshDS()->FindNode(IDsOfNodes[i]);
+ {
+ const SMDS_MeshNode* aNode = GetMeshDS()->FindNode(IDsOfNodes[i]);
+ if (!aNode) return 0;
+ n[i] = aNode;
+ }
int NbFaces = Quantities.length();
std::vector<int> q (NbFaces);
// Update Python script
TPythonDump() << "volID = " << this << ".AddPolyhedralVolume( "
<< IDsOfNodes << ", " << Quantities << " )";
+ myMesh->GetMeshDS()->Modified();
return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
}
// Update Python script
TPythonDump() << "volID = " << this << ".AddPolyhedralVolumeByFaces( "
<< IdsOfFaces << " )";
+ myMesh->GetMeshDS()->Modified();
return elem ? ( myMesh->SetIsModified( true ), elem->GetID()) : 0;
}
if ( isOut ) {
#ifdef _DEBUG_
MESSAGE ( "FACE " << FaceID << " (" << u << "," << v << ") out of "
- << " u( " << surf.FirstUParameter()
- << "," << surf.LastUParameter()
- << ") v( " << surf.FirstVParameter()
+ << " u( " << surf.FirstUParameter()
+ << "," << surf.LastUParameter()
+ << ") v( " << surf.FirstVParameter()
<< "," << surf.LastVParameter() << ")" );
-#endif
+#endif
THROW_SALOME_CORBA_EXCEPTION("Invalid UV", SALOME::BAD_PARAM);
}
mesh->SetNodeOnFace( node, FaceID, u, v );
-
myMesh->SetIsModified( true );
}
TPythonDump() << "isDone = " << this << ".InverseDiag( "
<< NodeID1 << ", " << NodeID2 << " )";
- myMesh->SetIsModified( true );
::SMESH_MeshEditor aMeshEditor( myMesh );
- return aMeshEditor.InverseDiag ( n1, n2 );
+ int ret = aMeshEditor.InverseDiag ( n1, n2 );
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+ return ret;
}
//=============================================================================
bool stat = aMeshEditor.DeleteDiag ( n1, n2 );
+ myMesh->GetMeshDS()->Modified();
if ( stat )
myMesh->SetIsModified( true ); // issue 0020693
-
+
storeResult(aMeshEditor);
return stat;
// Update Python script
TPythonDump() << "isDone = " << this << ".Reorient( " << IDsOfElements << " )";
+ myMesh->GetMeshDS()->Modified();
if ( IDsOfElements.length() )
myMesh->SetIsModified( true ); // issue 0020693
::SMESH_MeshEditor anEditor( myMesh );
bool stat = anEditor.TriToQuad( faces, aCrit, MaxAngle );
+ myMesh->GetMeshDS()->Modified();
if ( stat )
myMesh->SetIsModified( true ); // issue 0020693
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean stat = anEditor.QuadToTri( faces, aCrit );
+ myMesh->GetMeshDS()->Modified();
if ( stat )
myMesh->SetIsModified( true ); // issue 0020693
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean stat = anEditor.QuadToTri( faces, Diag13 );
+ myMesh->GetMeshDS()->Modified();
if ( stat )
myMesh->SetIsModified( true ); // issue 0020693
SMESH::long_array_var anElementsId = elems->GetIDs();
TIDSortedElemSet elemSet;
arrayToSet( anElementsId, GetMeshDS(), elemSet, SMDSAbs_Volume );
-
+
::SMESH_MeshEditor anEditor (myMesh);
anEditor.SplitVolumesIntoTetra( elemSet, int( methodFlags ));
+ myMesh->GetMeshDS()->Modified();
storeResult(anEditor);
anEditor.Smooth(elements, fixedNodes, method,
MaxNbOfIterations, MaxAspectRatio, IsParametric );
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true ); // issue 0020693
storeResult(anEditor);
//=======================================================================
//function : rotationSweep
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
anEditor.RotationSweep (*workElements, Ax1, theAngleInRadians,
theNbOfSteps, theTolerance, theMakeGroups, makeWalls);
storeResult(anEditor);
+ myMesh->GetMeshDS()->Modified();
// myMesh->SetIsModified( true ); -- it does not influence Compute()
//=======================================================================
//function : RotationSweepMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
CORBA::Long theNbOfSteps,
CORBA::Double theTolerance)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups *aGroups = rotationSweep(theIDsOfElements,
theAxis,
theAngleInRadians,
theNbOfSteps,
theTolerance,
true);
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump<< this << ".RotationSweepMakeGroups( "
- << theIDsOfElements << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".RotationSweepMakeGroups( "
+ << theIDsOfElements << ", "
+ << theAxis << ", "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
return aGroups;
}
//=======================================================================
//function : RotationSweepObjectMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
CORBA::Long theNbOfSteps,
CORBA::Double theTolerance)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
theAxis,
theNbOfSteps,
theTolerance,
true);
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".RotationSweepObjectMakeGroups( "
+ << theObject << ", "
+ << theAxis << ", "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
return aGroups;
}
//=======================================================================
//function : RotationSweepObject1DMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
CORBA::Long theNbOfSteps,
CORBA::Double theTolerance)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
theAxis,
theTolerance,
true,
SMDSAbs_Edge);
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump<< this << ".RotationSweepObject1DMakeGroups( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".RotationSweepObject1DMakeGroups( "
+ << theObject << ", "
+ << theAxis << ", "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
return aGroups;
}
//=======================================================================
//function : RotationSweepObject2DMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
CORBA::Long theNbOfSteps,
CORBA::Double theTolerance)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
theAxis,
theTolerance,
true,
SMDSAbs_Face);
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump<< this << ".RotationSweepObject2DMakeGroups( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".RotationSweepObject2DMakeGroups( "
+ << theObject << ", "
+ << theAxis << ", "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
return aGroups;
}
//=======================================================================
//function : extrusionSweep
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
{
initData();
- try {
+ try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS;
#endif
::SMESH_MeshEditor::PGroupIDs groupIds =
anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory, theMakeGroups);
+ myMesh->GetMeshDS()->Modified();
storeResult(anEditor);
return theMakeGroups ? getGroups(groupIds.get()) : 0;
} catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
}
return 0;
CORBA::Long theNbOfSteps)
{
extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false );
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
TPythonDump() << this << ".ExtrusionSweep( "
<< theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
}
{
SMESH::long_array_var anElementsId = theObject->GetIDs();
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false );
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
TPythonDump() << this << ".ExtrusionSweepObject( "
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
}
//=======================================================================
//function : ExtrusionSweepMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
- SMESH::ListOfGroups* aGroups = extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, true );
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump << this << ".ExtrusionSweepMakeGroups( "
- << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ SMESH::ListOfGroups* aGroups = extrusionSweep(theIDsOfElements, theStepVector, theNbOfSteps, true);
+
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".ExtrusionSweepMakeGroups( " << theIDsOfElements
+ << ", " << theStepVector <<", " << theNbOfSteps << " )";
}
return aGroups;
}
+
//=======================================================================
//function : ExtrusionSweepObjectMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
- SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
+ SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector, theNbOfSteps, true);
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump<< this << ".ExtrusionSweepObjectMakeGroups( "
- << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".ExtrusionSweepObjectMakeGroups( " << theObject
+ << ", " << theStepVector << ", " << theNbOfSteps << " )";
}
return aGroups;
}
//=======================================================================
//function : ExtrusionSweepObject1DMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
- SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
- << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector,
+ theNbOfSteps, true, SMDSAbs_Edge);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( " << theObject
+ << ", " << theStepVector << ", " << theNbOfSteps << " )";
}
return aGroups;
}
//=======================================================================
//function : ExtrusionSweepObject2DMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
- SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
- aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
- << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector,
+ theNbOfSteps, true, SMDSAbs_Face);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( " << theObject
+ << ", " << theStepVector << ", " << theNbOfSteps << " )";
}
return aGroups;
}
//=======================================================================
//function : advancedExtrusion
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
//=======================================================================
//function : AdvancedExtrusionMakeGroups
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups*
SMESH_MeshEditor_i::AdvancedExtrusionMakeGroups(const SMESH::long_array& theIDsOfElements,
const SMESH::DirStruct& theStepVector,
CORBA::Long theExtrFlags,
CORBA::Double theSewTolerance)
{
+ if (!myPreviewMode) {
+ TPythonDump() << "stepVector = " << theStepVector;
+ }
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = advancedExtrusion( theIDsOfElements,
theStepVector,
theNbOfSteps,
theSewTolerance,
true);
- if ( !myPreviewMode ) {
- TPythonDump() << "stepVector = " << theStepVector;
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".AdvancedExtrusionMakeGroups("
<< theIDsOfElements
<< ", stepVector, "
//=======================================================================
//function : extrusionAlongPath
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups*
SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array & theIDsOfElements,
SMESH::SMESH_Mesh_ptr thePathMesh,
SMESH::SMESH_MeshEditor::Extrusion_Error & theError,
const SMDSAbs_ElementType theElementType)
{
+ MESSAGE("extrusionAlongPath");
initData();
if ( thePathMesh->_is_nil() || thePathShape->_is_nil() ) {
anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart,
theHasAngles, angles, false,
theHasRefPoint, refPnt, theMakeGroups );
+ myMesh->GetMeshDS()->Modified();
storeResult(anEditor);
theError = convExtrError( error );
//=======================================================================
//function : extrusionAlongPathX
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups*
SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
SMESH::SMESH_IDSource_ptr Path,
SMESH_Mesh_i* aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( Path );
if(aMeshImp) {
// path as mesh
- SMDS_MeshNode* aNodeStart =
+ SMDS_MeshNode* aNodeStart =
(SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
if ( !aNodeStart ) {
Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
error = anEditor.ExtrusionAlongTrack( elements, &(aMeshImp->GetImpl()), aNodeStart,
HasAngles, angles, LinearVariation,
HasRefPoint, refPnt, MakeGroups );
+ myMesh->GetMeshDS()->Modified();
}
else {
SMESH_subMesh_i* aSubMeshImp = SMESH::DownCast<SMESH_subMesh_i*>( Path );
// path as submesh
SMESH::SMESH_Mesh_ptr aPathMesh = aSubMeshImp->GetFather();
aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( aPathMesh );
- SMDS_MeshNode* aNodeStart =
+ SMDS_MeshNode* aNodeStart =
(SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
if ( !aNodeStart ) {
Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
return EmptyGr;
}
- SMESH_subMesh* aSubMesh =
+ SMESH_subMesh* aSubMesh =
aMeshImp->GetImpl().GetSubMeshContaining(aSubMeshImp->GetId());
error = anEditor.ExtrusionAlongTrack( elements, aSubMesh, aNodeStart,
HasAngles, angles, LinearVariation,
HasRefPoint, refPnt, MakeGroups );
+ myMesh->GetMeshDS()->Modified();
}
else {
SMESH_Group_i* aGroupImp = SMESH::DownCast<SMESH_Group_i*>( Path );
//function : ExtrusionAlongPath
//purpose :
//=======================================================================
-
SMESH::SMESH_MeshEditor::Extrusion_Error
SMESH_MeshEditor_i::ExtrusionAlongPath(const SMESH::long_array & theIDsOfElements,
SMESH::SMESH_Mesh_ptr thePathMesh,
CORBA::Boolean theHasRefPoint,
const SMESH::PointStruct & theRefPoint)
{
+ MESSAGE("ExtrusionAlongPath");
if ( !myPreviewMode ) {
TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
<< theIDsOfElements << ", "
//function : ExtrusionAlongPathObject
//purpose :
//=======================================================================
-
SMESH::SMESH_MeshEditor::Extrusion_Error
SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr thePathMesh,
//function : ExtrusionAlongPathObject1D
//purpose :
//=======================================================================
-
SMESH::SMESH_MeshEditor::Extrusion_Error
SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr thePathMesh,
//function : ExtrusionAlongPathObject2D
//purpose :
//=======================================================================
-
SMESH::SMESH_MeshEditor::Extrusion_Error
SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr thePathMesh,
//=======================================================================
//function : ExtrusionAlongPathMakeGroups
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups*
SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array& theIDsOfElements,
SMESH::SMESH_Mesh_ptr thePathMesh,
const SMESH::PointStruct& theRefPoint,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = extrusionAlongPath( theIDsOfElements,
thePathMesh,
thePathShape,
theRefPoint,
true,
Error);
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
bool isDumpGroups = aGroups && aGroups->length() > 0;
- TPythonDump aPythonDump;
- if(isDumpGroups) {
- aPythonDump << "("<<aGroups;
- }
- if(isDumpGroups)
- aPythonDump << ", error)";
+ if (isDumpGroups)
+ aPythonDump << "(" << aGroups << ", error)";
else
aPythonDump <<"error";
//=======================================================================
//function : ExtrusionAlongPathObjectMakeGroups
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups* SMESH_MeshEditor_i::
ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr thePathMesh,
const SMESH::PointStruct& theRefPoint,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
thePathMesh,
true,
Error);
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
bool isDumpGroups = aGroups && aGroups->length() > 0;
- TPythonDump aPythonDump;
- if(isDumpGroups) {
- aPythonDump << "("<<aGroups;
- }
- if(isDumpGroups)
- aPythonDump << ", error)";
+ if (isDumpGroups)
+ aPythonDump << "(" << aGroups << ", error)";
else
aPythonDump <<"error";
//=======================================================================
//function : ExtrusionAlongPathObject1DMakeGroups
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups* SMESH_MeshEditor_i::
ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr thePathMesh,
const SMESH::PointStruct& theRefPoint,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
thePathMesh,
Error,
SMDSAbs_Edge);
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
bool isDumpGroups = aGroups && aGroups->length() > 0;
- TPythonDump aPythonDump;
- if(isDumpGroups) {
- aPythonDump << "("<<aGroups;
- }
- if(isDumpGroups)
- aPythonDump << ", error)";
+ if (isDumpGroups)
+ aPythonDump << "(" << aGroups << ", error)";
else
- aPythonDump <<"error";
+ aPythonDump << "error";
aPythonDump << " = " << this << ".ExtrusionAlongPathObject1DMakeGroups( "
<< theObject << ", "
//=======================================================================
//function : ExtrusionAlongPathObject2DMakeGroups
-//purpose :
+//purpose :
//=======================================================================
-
SMESH::ListOfGroups* SMESH_MeshEditor_i::
ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr thePathMesh,
const SMESH::PointStruct& theRefPoint,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
thePathMesh,
Error,
SMDSAbs_Face);
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
bool isDumpGroups = aGroups && aGroups->length() > 0;
- TPythonDump aPythonDump;
- if(isDumpGroups) {
- aPythonDump << "("<<aGroups;
- }
- if(isDumpGroups)
- aPythonDump << ", error)";
+ if (isDumpGroups)
+ aPythonDump << "(" << aGroups << ", error)";
else
- aPythonDump <<"error";
+ aPythonDump << "error";
aPythonDump << " = " << this << ".ExtrusionAlongPathObject2DMakeGroups( "
<< theObject << ", "
//=======================================================================
//function : ExtrusionAlongPathObjX
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups* SMESH_MeshEditor_i::
ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
SMESH::ElementType ElemType,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::long_array_var anElementsId = Object->GetIDs();
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
Path,
(SMDSAbs_ElementType)ElemType,
Error);
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
bool isDumpGroups = aGroups && aGroups->length() > 0;
- TPythonDump aPythonDump;
- if(isDumpGroups) {
- aPythonDump << "("<<aGroups;
- }
- if(isDumpGroups)
- aPythonDump << ", error)";
+ if (isDumpGroups)
+ aPythonDump << "(" << *aGroups << ", error)";
else
- aPythonDump <<"error";
+ aPythonDump << "error";
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
<< Object << ", "
//=======================================================================
//function : ExtrusionAlongPathX
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups* SMESH_MeshEditor_i::
ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
SMESH::ElementType ElemType,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
Path,
NodeStart,
(SMDSAbs_ElementType)ElemType,
Error);
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
bool isDumpGroups = aGroups && aGroups->length() > 0;
- TPythonDump aPythonDump;
- if(isDumpGroups) {
- aPythonDump << "("<<aGroups;
- }
- if(isDumpGroups)
- aPythonDump << ", error)";
+ if (isDumpGroups)
+ aPythonDump << "(" << *aGroups << ", error)";
else
aPythonDump <<"error";
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", "
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", "
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
+ << MakeGroups << ", "
<< ElemType << " )";
}
return aGroups;
/*!
* \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
+ * \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
+ * \param PathShape is shape(edge); as the mesh can be complex, the edge
* is used to define the sub-mesh for the path
*/
//================================================================================
//=======================================================================
//function : mirror
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
if(theCopy)
storeResult(anEditor);
else
- myMesh->SetIsModified( true );
+ {
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+ }
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
//=======================================================================
//function : MirrorMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = 0;
if ( theIDsOfElements.length() > 0 )
{
arrayToSet(theIDsOfElements, GetMeshDS(), elements);
aGroups = mirror(elements, theMirror, theMirrorType, true, true);
}
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".MirrorMakeGroups( "
<< theIDsOfElements << ", "
<< theMirror << ", "
//=======================================================================
//function : MirrorObjectMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = 0;
TIDSortedElemSet elements;
if ( idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
aGroups = mirror(elements, theMirror, theMirrorType, true, true);
- if ( !myPreviewMode )
+ if (!myPreviewMode)
{
- TPythonDump aPythonDump;
DumpGroupsList(aPythonDump,aGroups);
aPythonDump << this << ".MirrorObjectMakeGroups( "
<< theObject << ", "
//=======================================================================
//function : MirrorMakeMesh
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_Mesh_ptr
mesh_i->CreateGroupServants();
}
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
pydump << mesh << " = " << this << ".MirrorMakeMesh( "
<< theIDsOfElements << ", "
<< theMirror << ", "
}
//dump "GetGroups"
- if(!myPreviewMode && mesh_i)
+ if (!myPreviewMode && mesh_i)
mesh_i->GetGroups();
return mesh._retn();
//=======================================================================
//function : MirrorObjectMakeMesh
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_Mesh_ptr
false, theCopyGroups, & mesh_i->GetImpl());
mesh_i->CreateGroupServants();
}
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( "
<< theObject << ", "
<< theMirror << ", "
}
//dump "GetGroups"
- if(!myPreviewMode && mesh_i)
+ if (!myPreviewMode && mesh_i)
mesh_i->GetGroups();
return mesh._retn();
//=======================================================================
//function : translate
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
if(theCopy)
storeResult(anEditor);
else
- myMesh->SetIsModified( true );
+ {
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+ }
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
const SMESH::DirStruct & theVector,
CORBA::Boolean theCopy)
{
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
TPythonDump() << this << ".Translate( "
<< theIDsOfElements << ", "
<< theVector << ", "
<< theCopy << " )";
}
- if ( theIDsOfElements.length() )
- {
+ if (theIDsOfElements.length()) {
TIDSortedElemSet elements;
arrayToSet(theIDsOfElements, GetMeshDS(), elements);
- translate(elements,theVector,theCopy,false);
+ translate(elements, theVector, theCopy, false);
}
}
const SMESH::DirStruct & theVector,
CORBA::Boolean theCopy)
{
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
TPythonDump() << this << ".TranslateObject( "
<< theObject << ", "
<< theVector << ", "
<< theCopy << " )";
}
TIDSortedElemSet elements;
- if ( idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
- translate( elements, theVector, theCopy, false);
+ if (idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
+ translate(elements, theVector, theCopy, false);
}
//=======================================================================
//function : TranslateMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElements,
const SMESH::DirStruct& theVector)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = 0;
- if ( theIDsOfElements.length() )
- {
+ if (theIDsOfElements.length()) {
TIDSortedElemSet elements;
arrayToSet(theIDsOfElements, GetMeshDS(), elements);
aGroups = translate(elements,theVector,true,true);
}
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".TranslateMakeGroups( "
<< theIDsOfElements << ", "
<< theVector << " )";
//=======================================================================
//function : TranslateObjectMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct& theVector)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = 0;
TIDSortedElemSet elements;
if (idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
aGroups = translate(elements, theVector, true, true);
- if ( !myPreviewMode ) {
-
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".TranslateObjectMakeGroups( "
<< theObject << ", "
<< theVector << " )";
//=======================================================================
//function : TranslateMakeMesh
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_Mesh_ptr
}
//dump "GetGroups"
- if(!myPreviewMode && mesh_i)
+ if (!myPreviewMode && mesh_i)
mesh_i->GetGroups();
return mesh._retn();
//=======================================================================
//function : TranslateObjectMakeMesh
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_Mesh_ptr
}
}
- //dump "GetGroups"
- if(!myPreviewMode && mesh_i)
+ // dump "GetGroups"
+ if (!myPreviewMode && mesh_i)
mesh_i->GetGroups();
return mesh._retn();
//=======================================================================
//function : rotate
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
::SMESH_MeshEditor::PGroupIDs groupIds =
anEditor.Transform (theElements, aTrsf, theCopy, theMakeGroups, theTargetMesh);
- if(theCopy)
+ if(theCopy)
storeResult(anEditor);
else
- myMesh->SetIsModified( true );
+ {
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+ }
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
CORBA::Double theAngle,
CORBA::Boolean theCopy)
{
- if ( !myPreviewMode ) {
+ if (!myPreviewMode) {
TPythonDump() << this << ".Rotate( "
<< theIDsOfElements << ", "
<< theAxis << ", "
<< theAngle << ", "
<< theCopy << " )";
}
- if ( theIDsOfElements.length() > 0 )
+ if (theIDsOfElements.length() > 0)
{
TIDSortedElemSet elements;
arrayToSet(theIDsOfElements, GetMeshDS(), elements);
//=======================================================================
//function : RotateMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngle)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = 0;
- if ( theIDsOfElements.length() > 0 )
+ if (theIDsOfElements.length() > 0)
{
TIDSortedElemSet elements;
arrayToSet(theIDsOfElements, GetMeshDS(), elements);
aGroups = rotate(elements,theAxis,theAngle,true,true);
}
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotateMakeGroups( "
<< theIDsOfElements << ", "
<< theAxis << ", "
//=======================================================================
//function : RotateObjectMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngle)
{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
SMESH::ListOfGroups * aGroups = 0;
TIDSortedElemSet elements;
- if ( idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
- aGroups = rotate(elements,theAxis,theAngle,true,true);
+ if (idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
+ aGroups = rotate(elements, theAxis, theAngle, true, true);
- if ( !myPreviewMode ) {
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotateObjectMakeGroups( "
<< theObject << ", "
<< theAxis << ", "
//=======================================================================
//function : RotateMakeMesh
-//purpose :
+//purpose :
//=======================================================================
-SMESH::SMESH_Mesh_ptr
+SMESH::SMESH_Mesh_ptr
SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngleInRadians,
}
}
- //dump "GetGroups"
- if(!myPreviewMode && mesh_i && theIDsOfElements.length() > 0 )
+ // dump "GetGroups"
+ if (!myPreviewMode && mesh_i && theIDsOfElements.length() > 0 )
mesh_i->GetGroups();
return mesh._retn();
//=======================================================================
//function : RotateObjectMakeMesh
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_Mesh_ptr
}
}
- //dump "GetGroups"
- if(!myPreviewMode && mesh_i)
+ // dump "GetGroups"
+ if (!myPreviewMode && mesh_i)
mesh_i->GetGroups();
return mesh._retn();
//=======================================================================
//function : scale
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
if(theCopy)
storeResult(anEditor);
else
- myMesh->SetIsModified( true );
-
+ {
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+ }
return theMakeGroups ? getGroups(groupIds.get()) : 0;
}
//=======================================================================
//function : ScaleMakeGroups
-//purpose :
+//purpose :
//=======================================================================
SMESH::ListOfGroups*
const SMESH::PointStruct& thePoint,
const SMESH::double_array& theScaleFact)
{
- SMESH::ListOfGroups * aGroups = scale(theObject, thePoint, theScaleFact, true, true);
- if ( !myPreviewMode ) {
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
- TPythonDump aPythonDump;
- DumpGroupsList(aPythonDump,aGroups);
+ SMESH::ListOfGroups * aGroups = scale(theObject, thePoint, theScaleFact, true, true);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".Scale("
<< theObject << ","
<< "SMESH.PointStruct(" <<thePoint.x << ","
//=======================================================================
//function : ScaleMakeMesh
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_Mesh_ptr
<< theMeshName << "' )";
}
- //dump "GetGroups"
- if(!myPreviewMode && mesh_i)
+ // dump "GetGroups"
+ if (!myPreviewMode && mesh_i)
mesh_i->GetGroups();
return mesh._retn();
anEditor.MergeNodes( aListOfListOfNodes );
aTPythonDump << "])";
-
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
}
::SMESH_MeshEditor anEditor( myMesh );
anEditor.MergeElements(aListOfListOfElementsID);
-
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
aTPythonDump << "] )";
TIDSortedElemSet linkedNodes;
::SMESH_MeshEditor::GetLinkedNodes( node, linkedNodes );
TIDSortedElemSet::iterator nIt = linkedNodes.begin();
+ SMDS_MeshNode *nodeCpy1 = tmpMesh.Copy(node);
for ( ; nIt != linkedNodes.end(); ++nIt )
{
- SMDS_MeshEdge edge( node, cast2Node( *nIt ));
- tmpMesh.Copy( &edge );
+ SMDS_MeshNode *nodeCpy2 = tmpMesh.Copy ( cast2Node( *nIt ));
+ tmpMesh.GetMeshDS()->AddEdge(nodeCpy1, nodeCpy2);
}
// move copied node
- node = tmpMesh.GetMeshDS()->FindNode( NodeID );
- if ( node )
- tmpMesh.GetMeshDS()->MoveNode(node, x, y, z);
+ if ( nodeCpy1 )
+ tmpMesh.GetMeshDS()->MoveNode(nodeCpy1, x, y, z);
// fill preview data
::SMESH_MeshEditor anEditor( & tmpMesh );
storeResult( anEditor );
// Update Python script
TPythonDump() << "isDone = " << this << ".MoveNode( "
<< NodeID << ", " << x << ", " << y << ", " << z << " )";
-
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
}
TIDSortedElemSet::iterator nIt = linkedNodes.begin();
for ( ; nIt != linkedNodes.end(); ++nIt )
{
- SMDS_MeshEdge edge( node, cast2Node( *nIt ));
+ SMDS_LinearEdge edge( node, cast2Node( *nIt ));
tmpMesh.Copy( &edge );
}
// move copied node
<< ".MoveClosestNodeToPoint( "<< x << ", " << y << ", " << z
<< ", " << nodeID << " )";
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
}
storeResult(anEditor);
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
return error;
storeResult(anEditor);
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
return error;
storeResult(anEditor);
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
return error;
storeResult(anEditor);
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
return error;
TPythonDump() << "isDone = " << this << ".ChangeElemNodes( "
<< ide << ", " << newIDs << " )";
+ MESSAGE("ChangeElementNodes");
bool res = GetMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
+ myMesh->GetMeshDS()->Modified();
if ( res )
myMesh->SetIsModified( true );
void SMESH_MeshEditor_i::storeResult(::SMESH_MeshEditor& anEditor)
{
- if ( myPreviewMode ) { // --- MeshPreviewStruct filling ---
+ if ( myPreviewMode ) { // --- MeshPreviewStruct filling ---
list<int> aNodesConnectivity;
typedef map<int, int> TNodesMap;
SMDS_ElemIteratorPtr itElemNodes = aMeshElem->nodesIterator();
while ( itElemNodes->more() ) {
- const SMDS_MeshNode* aMeshNode =
+ const SMDS_MeshNode* aMeshNode =
static_cast<const SMDS_MeshNode*>( itElemNodes->next() );
int aNodeID = aMeshNode->GetID();
TNodesMap::iterator anIter = nodesMap.find(aNodeID);
::SMESH_MeshEditor anEditor( myMesh );
anEditor.ConvertToQuadratic(theForce3d);
TPythonDump() << this << ".ConvertToQuadratic( " << theForce3d << " )";
+ myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
}
//=======================================================================
//function : ConvertFromQuadratic
-//purpose :
+//purpose :
//=======================================================================
CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
::SMESH_MeshEditor anEditor( myMesh );
CORBA::Boolean isDone = anEditor.ConvertFromQuadratic();
TPythonDump() << this << ".ConvertFromQuadratic()";
+ myMesh->GetMeshDS()->Modified();
if ( isDone )
myMesh->SetIsModified( true );
return isDone;
//=======================================================================
//function : makeMesh
-//purpose : create a named imported mesh
+//purpose : create a named imported mesh
//=======================================================================
SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::makeMesh(const char* theMeshName)
//function : DumpGroupsList
//purpose :
//=======================================================================
-void SMESH_MeshEditor_i::DumpGroupsList(TPythonDump & theDumpPython,
+void SMESH_MeshEditor_i::DumpGroupsList(TPythonDump & theDumpPython,
const SMESH::ListOfGroups * theGroupList)
{
bool isDumpGroupList = theGroupList && theGroupList->length() > 0;
{
SMESH::ListOfGroups_var groups = myMesh_i->GetGroups();
set<string> groupNames;
-
+
// Get existing group names
for (int i = 0, nbGroups = groups->length(); i < nbGroups; i++ ) {
SMESH::SMESH_GroupBase_var aGroup = groups[i];
}
++index;
}
-
+
return name;
}
/*!
\brief Creates a hole in a mesh by doubling the nodes of some particular elements
\param theNodes - identifiers of nodes to be doubled
- \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
- nodes. If list of element identifiers is empty then nodes are doubled but
+ \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
+ nodes. If list of element identifiers is empty then nodes are doubled but
they not assigned to elements
\return TRUE if operation has been completed successfully, FALSE otherwise
\sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes,
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes,
const SMESH::long_array& theModifiedElems )
{
initData();
bool aResult = aMeshEditor.DoubleNodes( aListOfNodes, aListOfElems );
+ myMesh->GetMeshDS()->Modified();
storeResult( aMeshEditor) ;
if ( aResult )
myMesh->SetIsModified( true );
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long theNodeId,
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long theNodeId,
const SMESH::long_array& theModifiedElems )
{
SMESH::long_array_var aNodes = new SMESH::long_array;
SMESH::long_array_var aModifiedElems;
if ( !CORBA::is_nil( theModifiedElems ) )
aModifiedElems = theModifiedElems->GetListOfID();
- else
+ else
{
aModifiedElems = new SMESH::long_array;
aModifiedElems->length( 0 );
{
if ( CORBA::is_nil( theNodes ) && theNodes->GetType() != SMESH::NODE )
return false;
-
+
SMESH::SMESH_Group_var aNewGroup;
// Duplicate nodes
aModifiedElems = new SMESH::long_array;
aModifiedElems->length( 0 );
}
-
+
TPythonDump pyDump; // suppress dump by the next line
bool aResult = DoubleNodes( aNodes, aModifiedElems );
aNewGroup->Add(anIds);
}
}
-
+
pyDump << "createdNodes = " << this << ".DoubleNodeGroupNew( " << theNodes << ", "
<< theModifiedElems << " )";
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
\param theElems - the list of elements (edges or faces) to be replicated
The nodes for duplication could be found from these elements
\param theNodesNot - list of nodes to NOT replicate
- \param theAffectedElems - the list of elements (cells and edges) to which the
+ \param theAffectedElems - the list of elements (cells and edges) to which the
replicated nodes should be associated to.
\return TRUE if operation has been completed successfully, FALSE otherwise
\sa DoubleNodeGroup(), DoubleNodeGroups()
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems,
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems,
const SMESH::long_array& theNodesNot,
const SMESH::long_array& theAffectedElems )
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems,
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems,
const SMESH::long_array& theNodesNot,
GEOM::GEOM_Object_ptr theShape )
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
SMESHDS_Mesh* aMeshDS = GetMeshDS();
TIDSortedElemSet anElems, aNodes, anAffected;
- idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
- idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
+ idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
+ idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
idSourceToSet( theAffectedElems, aMeshDS, anAffected, SMDSAbs_All );
bool aResult = aMeshEditor.DoubleNodes( anElems, aNodes, anAffected );
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
SMESHDS_Mesh* aMeshDS = GetMeshDS();
TIDSortedElemSet anElems, aNodes, anAffected;
- idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
- idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
+ idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
+ idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
idSourceToSet( theAffectedElems, aMeshDS, anAffected, SMDSAbs_All );
-
+
bool aResult = aMeshEditor.DoubleNodes( anElems, aNodes, anAffected );
-
+
storeResult( aMeshEditor) ;
if ( aResult ) {
SMESHDS_Mesh* aMeshDS = GetMeshDS();
TIDSortedElemSet anElems, aNodes, anAffected;
- idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
- idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
+ idSourceToSet( theElems, aMeshDS, anElems, SMDSAbs_All );
+ idSourceToSet( theNodesNot, aMeshDS, aNodes, SMDSAbs_Node );
TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theShape );
bool aResult = aMeshEditor.DoubleNodesInRegion( anElems, aNodes, aShape );
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
\param theAffectedElems - group of elements to which the replicated nodes
should be associated to.
\return TRUE if operation has been completed successfully, FALSE otherwise
- \sa DoubleNodeGroup(), DoubleNodes()
+ \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
*/
//================================================================================
for ( int i = 0, n = theGrpList.length(); i < n; i++ )
{
SMESH::SMESH_GroupBase_var aGrp = theGrpList[ i ];
- if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE
+ if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE
: aGrp->GetType() != SMESH::NODE ) )
{
SMESH::long_array_var anIDs = aGrp->GetIDs();
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
return aResult;
}
+//================================================================================
+/*!
+ * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+ * Works as DoubleNodeElemGroups(), but returns a new group with newly created elements.
+ \param theElems - list of groups of elements (edges or faces) to be replicated
+ \param theNodesNot - list of groups of nodes not to replicated
+ \param theAffectedElems - group of elements to which the replicated nodes
+ should be associated to.
+ * \return a new group with newly created elements
+ * \sa DoubleNodeElemGroups()
+ */
+//================================================================================
+
+SMESH::SMESH_Group_ptr SMESH_MeshEditor_i::DoubleNodeElemGroupsNew(const SMESH::ListOfGroups& theElems,
+ const SMESH::ListOfGroups& theNodesNot,
+ const SMESH::ListOfGroups& theAffectedElems)
+{
+ SMESH::SMESH_Group_var aNewGroup;
+
+ initData();
+
+ ::SMESH_MeshEditor aMeshEditor( myMesh );
+
+ SMESHDS_Mesh* aMeshDS = GetMeshDS();
+ TIDSortedElemSet anElems, aNodes, anAffected;
+ listOfGroupToSet(theElems, aMeshDS, anElems, false );
+ listOfGroupToSet(theNodesNot, aMeshDS, aNodes, true );
+ listOfGroupToSet(theAffectedElems, aMeshDS, anAffected, false );
+
+ bool aResult = aMeshEditor.DoubleNodes( anElems, aNodes, anAffected );
+
+ storeResult( aMeshEditor) ;
+
+ myMesh->GetMeshDS()->Modified();
+ if ( aResult ) {
+ myMesh->SetIsModified( true );
+
+ // Create group with newly created elements
+ SMESH::long_array_var anIds = GetLastCreatedElems();
+ if (anIds->length() > 0) {
+ SMESH::ElementType aGroupType = myMesh_i->GetElementType(anIds[0], true);
+ string anUnindexedName (theElems[0]->GetName());
+ string aNewName = generateGroupName(anUnindexedName + "_double");
+ aNewGroup = myMesh_i->CreateGroup(aGroupType, aNewName.c_str());
+ aNewGroup->Add(anIds);
+ }
+ }
+
+ // Update Python script
+ TPythonDump() << "createdElems = " << this << ".DoubleNodeElemGroupsNew( " << &theElems << ", "
+ << &theNodesNot << ", " << &theAffectedElems << " )";
+ return aNewGroup._retn();
+}
+
//================================================================================
/*!
\brief Creates a hole in a mesh by doubling the nodes of some particular elements
storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
if ( aResult )
myMesh->SetIsModified( true );
::SMESH_MeshEditor aMeshEditor( myMesh );
bool aResult = aMeshEditor.Make2DMeshFrom3D();
storeResult( aMeshEditor) ;
-
+ myMesh->GetMeshDS()->Modified();
TPythonDump() << "isDone = " << this << ".Make2DMeshFrom3D()";
return aResult;
}
+//================================================================================
+/*!
+ * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
+ * The list of groups must describe a partition of the mesh volumes.
+ * The nodes of the internal faces at the boundaries of the groups are doubled.
+ * In option, the internal faces are replaced by flat elements.
+ * Triangles are transformed in prisms, and quadrangles in hexahedrons.
+ * @param theDomains - list of groups of volumes
+ * @param createJointElems - if TRUE, create the elements
+ * @return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+//================================================================================
+
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
+ CORBA::Boolean createJointElems )
+{
+ initData();
+
+ ::SMESH_MeshEditor aMeshEditor( myMesh );
+
+ SMESHDS_Mesh* aMeshDS = GetMeshDS();
+
+ vector<TIDSortedElemSet> domains;
+ domains.clear();
+
+ for ( int i = 0, n = theDomains.length(); i < n; i++ )
+ {
+ SMESH::SMESH_GroupBase_var aGrp = theDomains[ i ];
+ if ( !CORBA::is_nil( aGrp ) && ( aGrp->GetType() != SMESH::NODE ) )
+ {
+ TIDSortedElemSet domain;
+ domain.clear();
+ domains.push_back(domain);
+ SMESH::long_array_var anIDs = aGrp->GetIDs();
+ arrayToSet( anIDs, aMeshDS, domains[ i ], SMDSAbs_All );
+ }
+ }
+
+ bool aResult = aMeshEditor.DoubleNodesOnGroupBoundaries( domains, createJointElems );
+
+ storeResult( aMeshEditor) ;
+ myMesh->GetMeshDS()->Modified();
+
+ // Update Python script
+ TPythonDump() << "isDone = " << this << ".DoubleNodesOnGroupBoundaries( " << &theDomains
+ << ", " << createJointElems << " )";
+ return aResult;
+}
+
// issue 20749 ===================================================================
/*!
* \brief Creates missing boundary elements
* \param meshName - a name of new mesh to store created boundary elements in,
* "" means not to create the new mesh
* \param toCopyElements - if true, the checked elements will be copied into the new mesh
- * \param toCopyExistingBondary - if true, not only new but also pre-existing
+ * \param toCopyExistingBondary - if true, not only new but also pre-existing
* boundary elements will be copied into the new mesh
* \param group - returns the create group, if any
* \retval SMESH::SMESH_Mesh - the mesh where elements were added to
if ( dim > SMESH::BND_1DFROM2D )
THROW_SALOME_CORBA_EXCEPTION("Invalid boundary dimension", SALOME::BAD_PARAM);
-
+
SMESHDS_Mesh* aMeshDS = GetMeshDS();
SMESH::SMESH_Mesh_var mesh_var;
SMESH_Group* smesh_group = 0;
if ( strlen(groupName) )
{
- group_var = mesh_i->CreateGroup( SMESH::ElementType(elemType),groupName);
+ group_var = mesh_i->CreateGroup( SMESH::ElementType(int(elemType)-1),groupName);
if ( SMESH_GroupBase_i* group_i = SMESH::DownCast<SMESH_GroupBase_i*>( group_var ))
smesh_group = group_i->GetSmeshGroup();
}
storeResult( aMeshEditor );
}
+ const char* dimName[] = { "BND_2DFROM3D", "BND_1DFROM3D", "BND_1DFROM2D" };
+
// result of MakeBoundaryMesh() is a tuple (mesh, group)
if ( mesh_var->_is_nil() )
pyDump << myMesh_i->_this() << ", ";
pyDump << group_var << " = ";
pyDump << this << ".MakeBoundaryMesh( "
<< idSource << ", "
- << dim << ", "
- << groupName << ", "
- << meshName<< ", "
+ << "SMESH." << dimName[int(dim)] << ", "
+ << "'" << groupName << "', "
+ << "'" << meshName<< "', "
<< toCopyElements << ", "
<< toCopyExistingBondary << ")";