_myMeshDS = new SMESHDS_Mesh( _id, true );
myPreviewType = previewElements;
}
- //!< Destructor
- virtual ~TPreviewMesh() { delete _myMeshDS; _myMeshDS = 0; }
//!< Copy a set of elements
void Copy(const TIDSortedElemSet & theElements,
TIDSortedElemSet& theCopyElements,
{
GetMeshDS()->ClearMesh();
}
+ void Remove( SMDSAbs_ElementType type )
+ {
+ SMDS_ElemIteratorPtr eIt = GetMeshDS()->elementsIterator( type );
+ while ( eIt->more() )
+ GetMeshDS()->RemoveFreeElement( eIt->next(), /*sm=*/0, /*fromGroups=*/false );
+ }
};// struct TPreviewMesh
static SMESH_NodeSearcher * theNodeSearcher = 0;
delete myPreviewEditor; myPreviewEditor = 0;
}
+//================================================================================
+/*!
+ * \brief Returns the mesh
+ */
+//================================================================================
+
+SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::GetMesh()
+{
+ return myMesh_i->_this();
+}
+
//================================================================================
/*!
* \brief Clear members
<< TVar( theTolerance ) << ", "
<< theMakeGroups << " )";
}
+ else
+ {
+ getPreviewMesh()->Remove( SMDSAbs_Volume );
+ }
return aGroups ? aGroups : new SMESH::ListOfGroups;
ExtrusionParams(CORBA::Double theStepSize,
CORBA::Long theNbOfSteps,
CORBA::Short theDim,
- CORBA::Boolean theUseInputElemsOnly,
CORBA::Boolean theByAverageNormal,
+ CORBA::Boolean theUseInputElemsOnly,
CORBA::Boolean theMakeGroups ):
::SMESH_MeshEditor::ExtrusParam ( theStepSize,
theNbOfSteps,
idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
TIDSortedElemSet* workElements = & elemsNodes[0], copyElements[2];
+ SMDSAbs_ElementType previewType = SMDSAbs_All; //SMDSAbs_Face;
if ( myIsPreviewMode )
{
- SMDSAbs_ElementType previewType = SMDSAbs_All; //SMDSAbs_Face;
// if ( (*elemsNodes.begin())->GetType() == SMDSAbs_Node )
// previewType = SMDSAbs_Edge;
SMDSAbs_ElementType select = SMDSAbs_All, avoid = SMDSAbs_Volume;
- TPreviewMesh * tmpMesh = getPreviewMesh();
+ TPreviewMesh * tmpMesh = getPreviewMesh( previewType );
tmpMesh->Copy( elemsNodes[0], copyElements[0], select, avoid );
tmpMesh->Copy( elemsNodes[1], copyElements[1], select, avoid );
workElements = & copyElements[0];
<< TVar( theNbOfSteps ) << ", "
<< theToMakeGroups << " )";
}
+ else
+ {
+ getPreviewMesh( previewType )->Remove( SMDSAbs_Volume );
+ }
return aGroups ? aGroups : new SMESH::ListOfGroups;
idSourceToSet( objects[i], getMeshDS(), elemsNodes[0], elemType );
TIDSortedElemSet* workElements = & elemsNodes[0], copyElements[2];
+ SMDSAbs_ElementType previewType = SMDSAbs_Face;
if ( myIsPreviewMode )
{
- SMDSAbs_ElementType previewType = SMDSAbs_Face;
SMDSAbs_ElementType select = SMDSAbs_All, avoid = SMDSAbs_Volume;
TPreviewMesh * tmpMesh = getPreviewMesh( previewType );
tmpMesh->Copy( elemsNodes[0], copyElements[0], select, avoid );
<< ", " << dim
<< " )";
}
+ else
+ {
+ getPreviewMesh( previewType )->Remove( SMDSAbs_Volume );
+ }
declareMeshModified( /*isReComputeSafe=*/true ); // does not influence Compute()
<< theSewTolerance << ", "
<< theMakeGroups << " )";
}
+ else
+ {
+ getPreviewMesh()->Remove( SMDSAbs_Volume );
+ }
return aGroups ? aGroups : new SMESH::ListOfGroups;
<< ( theHasRefPoint ? theRefPoint.z : 0 ) << " ), "
<< theMakeGroups << " )";
}
+ else
+ {
+ getPreviewMesh()->Remove( SMDSAbs_Volume );
+ }
return aGroups._retn();