Geomerty & Mesh plug-ins in the ParaVis module: small corrections.

This commit is contained in:
rnv 2014-11-27 15:40:27 +03:00
parent ff2e6c820b
commit 66a355ac8f
5 changed files with 26 additions and 32 deletions

View File

@ -952,7 +952,7 @@ namespace SMESH
virtual SMESH::array_of_ElementType* GetTypes(); virtual SMESH::array_of_ElementType* GetTypes();
virtual SMESH::SMESH_Mesh_ptr GetMesh(); virtual SMESH::SMESH_Mesh_ptr GetMesh();
virtual bool IsMeshInfoCorrect() { return true; } virtual bool IsMeshInfoCorrect() { return true; }
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; } virtual SALOMEDS::TMPFile* GetVtkUgStream(){ SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); }
/*! /*!
* \brief Object notified on change of predicate * \brief Object notified on change of predicate
*/ */

View File

@ -98,7 +98,7 @@ class SMESH_I_EXPORT SMESH_GroupBase_i:
/*! /*!
* Returns mesh unstructed grid information. * Returns mesh unstructed grid information.
*/ */
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; } virtual SALOMEDS::TMPFile* GetVtkUgStream(){ SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); }
// Internal C++ interface // Internal C++ interface
int GetLocalID() const { return myLocalID; } int GetLocalID() const { return myLocalID; }

View File

@ -779,7 +779,7 @@ struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource,
} }
return types._retn(); return types._retn();
} }
SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; } SALOMEDS::TMPFile* GetVtkUgStream(){ SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); }
}; };
SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids, SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids,

View File

@ -5058,17 +5058,13 @@ void SMESH_Mesh_i::CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
SALOMEDS::TMPFile* SMESH_Mesh_i::GetVtkUgStream() SALOMEDS::TMPFile* SMESH_Mesh_i::GetVtkUgStream()
{ {
if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) SALOMEDS::TMPFile_var SeqFile;
{ if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) {
vtkUnstructuredGrid* aCopy;
SMDS_UnstructuredGrid* aGrid = aMeshDS->getGrid(); SMDS_UnstructuredGrid* aGrid = aMeshDS->getGrid();
if(aGrid) if(aGrid) {
{
aCopy = aGrid->NewInstance();
aCopy->ShallowCopy(aGrid);
vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
aWriter->WriteToOutputStringOn(); aWriter->WriteToOutputStringOn();
aWriter->SetInputData(aCopy); aWriter->SetInputData(aGrid);
aWriter->SetFileTypeToBinary(); aWriter->SetFileTypeToBinary();
aWriter->Write(); aWriter->Write();
char* str = aWriter->GetOutputString(); char* str = aWriter->GetOutputString();
@ -5079,14 +5075,12 @@ SALOMEDS::TMPFile* SMESH_Mesh_i::GetVtkUgStream()
//Copy ostrstream content to the octect buffer //Copy ostrstream content to the octect buffer
memcpy(OctetBuf, str, size); memcpy(OctetBuf, str, size);
//Create and return TMPFile //Create and return TMPFile
SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size, size, OctetBuf, 1); SeqFile = new SALOMEDS::TMPFile(size, size, OctetBuf, 1);
aWriter->Delete(); aWriter->Delete();
}
}
return SeqFile._retn(); return SeqFile._retn();
} }
}
return NULL;
}
//============================================================================= //=============================================================================
namespace /* Iterators used in SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_var obj, namespace /* Iterators used in SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_var obj,

View File

@ -113,7 +113,7 @@ public:
/*! /*!
* Returns mesh unstructed grid information. * Returns mesh unstructed grid information.
*/ */
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; } virtual SALOMEDS::TMPFile* GetVtkUgStream(){ SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); }
protected: protected: