-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
try {
OSD_File( fileName ).Remove();
}
- catch ( Standard_ProgramError ) {
+ catch ( Standard_ProgramError& ) {
MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied");
}
}
int ver, dim;
int meshID = theHexaOutput->GmfOpenMesh( theFile, GmfRead, &ver, &dim );
+ int nbVerticesInShape = countShape( theMesh, TopAbs_VERTEX );
int nbVertices = getNbShape(theHexaOutput, meshID, GmfVertices );
- int nbCorners = getNbShape(theHexaOutput, meshID, GmfCorners, countShape( theMesh, TopAbs_VERTEX ));
+ int nbCorners = getNbShape(theHexaOutput, meshID, GmfCorners, nbVerticesInShape);
if ( nbVertices == 0 )
return false;
tabCorner.resize( nbCorners );
HexoticNode.resize( nbVertices + 1 );
- if ( nbCorners > 0 )
+ // get the shape vertices if the mesh lies on a shape (and this shape has corners)
+ if ( nbCorners > 0 && nbVerticesInShape > 0 )
getShape( theMeshDS, TopAbs_VERTEX, tabCorner.data() );
int nbNodes = theHexaOutput->GmfStatKwd( meshID, GmfVertices );
{
GEOM::GEOM_Object_var aGeomObj;
TopoDS_Shape S = TopoDS_Shape();
- SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
+ SALOMEDS::SObject_var aSObj = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindObjectID( entry.c_str() );
if (!aSObj->_is_nil()) {
CORBA::Object_var obj = aSObj->GetObject();
aGeomObj = GEOM::GEOM_Object::_narrow(obj);
//=============================================================================
bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
+ const TopoDS_Shape& /*aShape*/)
{
_computeCanceled = false;
bool Ok = true;