mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
Geomerty & Mesh plug-ins in the ParaVis module: small corrections.
This commit is contained in:
parent
ff2e6c820b
commit
66a355ac8f
@ -952,7 +952,7 @@ namespace SMESH
|
||||
virtual SMESH::array_of_ElementType* GetTypes();
|
||||
virtual SMESH::SMESH_Mesh_ptr GetMesh();
|
||||
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
|
||||
*/
|
||||
|
@ -98,7 +98,7 @@ class SMESH_I_EXPORT SMESH_GroupBase_i:
|
||||
/*!
|
||||
* 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
|
||||
int GetLocalID() const { return myLocalID; }
|
||||
|
@ -779,7 +779,7 @@ struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource,
|
||||
}
|
||||
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,
|
||||
|
@ -5058,34 +5058,28 @@ void SMESH_Mesh_i::CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
|
||||
|
||||
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;
|
||||
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();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -113,7 +113,7 @@ public:
|
||||
/*!
|
||||
* Returns mesh unstructed grid information.
|
||||
*/
|
||||
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; }
|
||||
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); }
|
||||
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user