_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
/*!
* \brief Increment mesh modif time and optionally record that the performed
* modification may influence futher mesh re-compute.
- * \param [in] isReComputeSafe - true if the modification does not infulence
+ * \param [in] isReComputeSafe - true if the modification does not influence
* futher mesh re-compute
*/
//================================================================================
<< 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();
(theScaleFact.length() == 1) ? theScaleFact[0] : theScaleFact[1],
(theScaleFact.length() == 1) ? theScaleFact[0] : theScaleFact[2],
};
- double tol = std::numeric_limits<double>::max();
gp_Trsf aTrsf;
#if OCC_VERSION_LARGE > 0x06070100
- // fight against ortagonalization
+ // fight against orthogonalization
// aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]),
// 0, S[1], 0, thePoint.y * (1-S[1]),
// 0, 0, S[2], thePoint.z * (1-S[2]) );
- aTrsf.SetTranslation( gp_Vec( thePoint.x * (1-S[0]),
- thePoint.y * (1-S[1]),
- thePoint.z * (1-S[2])));
- gp_Mat & M = ( gp_Mat& ) aTrsf.HVectorialPart();
+ aTrsf.SetScale( gp::Origin(), 1.0 ); // set form which is used to make group names
+ gp_XYZ & loc = ( gp_XYZ& ) aTrsf.TranslationPart();
+ gp_Mat & M = ( gp_Mat& ) aTrsf.HVectorialPart();
+ loc.SetCoord( thePoint.x * (1-S[0]),
+ thePoint.y * (1-S[1]),
+ thePoint.z * (1-S[2]));
M.SetDiagonal( S[0], S[1], S[2] );
#else
+ double tol = std::numeric_limits<double>::max();
aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]),
0, S[1], 0, thePoint.y * (1-S[1]),
0, 0, S[2], thePoint.z * (1-S[2]), tol, tol);
throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
+ initData();
+
TIDSortedElemSet elems;
bool elemsOK;
if ( !( elemsOK = CORBA::is_nil( theObject )))
CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
throw (SALOME::SALOME_Exception)
{
+ SMESH_TRY;
+ initData();
+
CORBA::Boolean isDone = getEditor().ConvertFromQuadratic();
TPythonDump() << this << ".ConvertFromQuadratic()";
declareMeshModified( /*isReComputeSafe=*/!isDone );
return isDone;
+
+ SMESH_CATCH( SMESH::throwCorbaException );
+ return false;
}
//=======================================================================
throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
+ initData();
TPythonDump pyDump;