* happen if mesh data is not yet fully loaded from the file of study.
*/
virtual bool IsMeshInfoCorrect();
+ /*!
+ * Returns mesh unstructed grid information.
+ */
+ virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; }
// Internal C++ interface
int GetLocalID() const { return myLocalID; }
#include <iostream>
#include <sstream>
+#include <vtkUnstructuredGridWriter.h>
+
// to pass CORBA exception through SMESH_TRY
#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; }
while (theItr->more())
theInfo[ theItr->next()->GetEntityType() ]++;
}
+//=============================================================================
+/*
+ * Returns mesh unstructed grid information.
+ */
+//=============================================================================
+
+SALOMEDS::TMPFile* SMESH_Mesh_i::GetVtkUgStream()
+{
+ if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() )
+ {
+ vtkUnstructuredGrid* aCopy;
+ SMDS_UnstructuredGrid* aGrid = aMeshDS->getGrid();
+ if(aGrid)
+ {
+ aCopy = aGrid->NewInstance();
+ aCopy->ShallowCopy(aGrid);
+ vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
+ aWriter->WriteToOutputStringOn();
+ aWriter->SetInputData(aCopy);
+ aWriter->SetFileTypeToBinary();
+ aWriter->Write();
+ char* str = aWriter->GetOutputString();
+ int size = aWriter->GetOutputStringLength();
+
+ //Allocate octect buffer of required size
+ CORBA::Octet* OctetBuf = SALOMEDS::TMPFile::allocbuf(size);
+ //Copy ostrstream content to the octect buffer
+ memcpy(OctetBuf, str, size);
+ //Create and return TMPFile
+ SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size, size, OctetBuf, 1);
+
+ aWriter->Delete();
+ return SeqFile._retn();
+ }
+ }
+ return NULL;
+}
//=============================================================================
namespace /* Iterators used in SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_var obj,
* happen if mesh data is not yet fully loaded from the file of study.
*/
bool IsMeshInfoCorrect();
+ /*!
+ * Returns mesh unstructed grid information.
+ */
+ virtual SALOMEDS::TMPFile* GetVtkUgStream();
std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI