mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-28 14:20:34 +05:00
Implementation of 2.6.3/2.6.4 improvements
This commit is contained in:
parent
8166d3be38
commit
ff2e6c820b
@ -313,6 +313,10 @@ module SMESH
|
|||||||
* happen if mesh data is not yet fully loaded from the file of study.
|
* happen if mesh data is not yet fully loaded from the file of study.
|
||||||
*/
|
*/
|
||||||
boolean IsMeshInfoCorrect();
|
boolean IsMeshInfoCorrect();
|
||||||
|
/*!
|
||||||
|
* Returns mesh unstructed grid information.
|
||||||
|
*/
|
||||||
|
SALOMEDS::TMPFile GetVtkUgStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
interface SMESH_Group;
|
interface SMESH_Group;
|
||||||
|
@ -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; }
|
||||||
/*!
|
/*!
|
||||||
* \brief Object notified on change of predicate
|
* \brief Object notified on change of predicate
|
||||||
*/
|
*/
|
||||||
|
@ -95,6 +95,10 @@ class SMESH_I_EXPORT SMESH_GroupBase_i:
|
|||||||
* happen if mesh data is not yet fully loaded from the file of study.
|
* happen if mesh data is not yet fully loaded from the file of study.
|
||||||
*/
|
*/
|
||||||
virtual bool IsMeshInfoCorrect();
|
virtual bool IsMeshInfoCorrect();
|
||||||
|
/*!
|
||||||
|
* Returns mesh unstructed grid information.
|
||||||
|
*/
|
||||||
|
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; }
|
||||||
|
|
||||||
// Internal C++ interface
|
// Internal C++ interface
|
||||||
int GetLocalID() const { return myLocalID; }
|
int GetLocalID() const { return myLocalID; }
|
||||||
|
@ -779,6 +779,7 @@ struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource,
|
|||||||
}
|
}
|
||||||
return types._retn();
|
return types._retn();
|
||||||
}
|
}
|
||||||
|
SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; }
|
||||||
};
|
};
|
||||||
|
|
||||||
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,
|
||||||
|
@ -79,6 +79,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <vtkUnstructuredGridWriter.h>
|
||||||
|
|
||||||
// to pass CORBA exception through SMESH_TRY
|
// to pass CORBA exception through SMESH_TRY
|
||||||
#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; }
|
#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; }
|
||||||
|
|
||||||
@ -5048,6 +5050,43 @@ void SMESH_Mesh_i::CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
|
|||||||
while (theItr->more())
|
while (theItr->more())
|
||||||
theInfo[ theItr->next()->GetEntityType() ]++;
|
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,
|
namespace /* Iterators used in SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_var obj,
|
||||||
|
@ -650,6 +650,10 @@ public:
|
|||||||
* happen if mesh data is not yet fully loaded from the file of study.
|
* happen if mesh data is not yet fully loaded from the file of study.
|
||||||
*/
|
*/
|
||||||
bool IsMeshInfoCorrect();
|
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_i*> _mapSubMesh_i; //NRI
|
||||||
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
|
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
|
||||||
|
@ -110,6 +110,10 @@ public:
|
|||||||
* happen if mesh data is not yet fully loaded from the file of study.
|
* happen if mesh data is not yet fully loaded from the file of study.
|
||||||
*/
|
*/
|
||||||
virtual bool IsMeshInfoCorrect();
|
virtual bool IsMeshInfoCorrect();
|
||||||
|
/*!
|
||||||
|
* Returns mesh unstructed grid information.
|
||||||
|
*/
|
||||||
|
virtual SALOMEDS::TMPFile* GetVtkUgStream(){ return NULL; }
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user