* happen if mesh data is not yet fully loaded from the file of study.
*/
boolean IsMeshInfoCorrect();
+
+ /*!
+ * Returns mesh unstructed grid information.
+ */
+ SALOMEDS::TMPFile GetVtkUgStream();
};
interface SMESH_Group;
return SMESH_Mesh::_duplicate( myMesh );
}
+//=======================================================================
+//function : GetVtkUgStream
+//purpose : Return data vtk unstructured grid (not implemented)
+//=======================================================================
+
+SALOMEDS::TMPFile* Filter_i::GetVtkUgStream()
+{
+ SALOMEDS::TMPFile_var SeqFile;
+ return SeqFile._retn();
+}
+
//================================================================================
/*!
* \brief Stores an object to be notified on change of predicate
virtual SMESH::array_of_ElementType* GetTypes();
virtual SMESH::SMESH_Mesh_ptr GetMesh();
virtual bool IsMeshInfoCorrect() { return true; }
-
+ virtual SALOMEDS::TMPFile* GetVtkUgStream();
/*!
* \brief Object notified on change of predicate
*/
return myPreMeshInfo ? myPreMeshInfo->IsMeshInfoCorrect() : true;
}
+//=======================================================================
+//function : GetVtkUgStream
+//purpose : Return data vtk unstructured grid (not implemented)
+//=======================================================================
+
+SALOMEDS::TMPFile* SMESH_GroupBase_i::GetVtkUgStream()
+{
+ SALOMEDS::TMPFile_var SeqFile;
+ return SeqFile._retn();
+}
+
//================================================================================
/*!
* \brief Retrieves the predicate from the filter
* 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();
// Internal C++ interface
int GetLocalID() const { return myLocalID; }
}
return types._retn();
}
+ SALOMEDS::TMPFile* GetVtkUgStream()
+ {
+ SALOMEDS::TMPFile_var SeqFile;
+ return SeqFile._retn();
+ }
};
SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids,
#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()
+{
+ SALOMEDS::TMPFile_var SeqFile;
+ if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) {
+ SMDS_UnstructuredGrid* aGrid = aMeshDS->getGrid();
+ if(aGrid) {
+ vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
+ aWriter->WriteToOutputStringOn();
+ aWriter->SetInputData(aGrid);
+ 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
+ SeqFile = new SALOMEDS::TMPFile(size, size, OctetBuf, 1);
+ aWriter->Delete();
+ }
+ }
+ return SeqFile._retn();
+}
//=============================================================================
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
{
return _preMeshInfo ? _preMeshInfo->IsMeshInfoCorrect() : true;
}
+
+//=======================================================================
+//function : GetVtkUgStream
+//purpose : Return data vtk unstructured grid (not implemented)
+//=======================================================================
+
+SALOMEDS::TMPFile* SMESH_subMesh_i::GetVtkUgStream()
+{
+ SALOMEDS::TMPFile_var SeqFile;
+ return SeqFile._retn();
+}
* 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();
protected: