2011-06-06 14:15:39 +06:00
|
|
|
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2011-06-06 14:15:39 +06:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2011-06-06 14:15:39 +06:00
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2.1 of the License.
|
2005-01-20 11:25:54 +05:00
|
|
|
//
|
2011-06-06 14:15:39 +06:00
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
2005-01-20 11:25:54 +05:00
|
|
|
//
|
2011-06-06 14:15:39 +06:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2005-01-20 11:25:54 +05:00
|
|
|
//
|
2011-06-06 14:15:39 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2005-01-20 11:25:54 +05:00
|
|
|
//
|
2010-05-14 21:32:37 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH OBJECT : interactive object for SMESH visualization
|
2005-01-20 11:25:54 +05:00
|
|
|
// File : SMESH_Object.h
|
|
|
|
// Author : Nicolas REJNERI
|
|
|
|
// Module : SMESH
|
|
|
|
// $Header$
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2005-01-20 11:25:54 +05:00
|
|
|
#ifndef SMESH_OBJECTDEF_H
|
|
|
|
#define SMESH_OBJECTDEF_H
|
|
|
|
|
2006-03-13 20:29:49 +05:00
|
|
|
#include "SMESH_Controls.hxx"
|
|
|
|
#include "SMESH_Object.h"
|
|
|
|
#include "SMESH_Client.hxx"
|
2011-12-15 19:32:32 +06:00
|
|
|
#include "SMESH_Actor.h"
|
2006-03-13 20:29:49 +05:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
// IDL Headers
|
2005-06-07 19:22:20 +06:00
|
|
|
#include <SALOMEconfig.h>
|
2005-01-20 11:25:54 +05:00
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Group)
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
class vtkPoints;
|
|
|
|
class SALOME_ExtractUnstructuredGrid;
|
|
|
|
|
|
|
|
class SMDS_MeshNode;
|
|
|
|
class SMDS_MeshElement;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class : SMESH_VisualObj
|
|
|
|
Description : Base class for all mesh objects to be visuilised
|
|
|
|
*/
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHOBJECT_EXPORT SMESH_VisualObjDef: public SMESH_VisualObj
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::list<const SMDS_MeshElement*> TEntityList;
|
|
|
|
typedef std::map<vtkIdType,vtkIdType> TMapOfIds;
|
|
|
|
|
|
|
|
SMESH_VisualObjDef();
|
|
|
|
virtual ~SMESH_VisualObjDef();
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
virtual bool Update( int theIsClear = true ) = 0;
|
2010-11-29 18:20:53 +05:00
|
|
|
virtual bool NulData() {return 0; };
|
2005-01-20 11:25:54 +05:00
|
|
|
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
|
|
|
|
virtual int GetElemDimension( const int theObjId ) = 0;
|
|
|
|
|
|
|
|
virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
|
|
|
|
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
|
|
|
|
virtual bool IsNodePrs() const = 0;
|
|
|
|
virtual SMDS_Mesh* GetMesh() const = 0;
|
|
|
|
|
2009-12-08 18:11:42 +05:00
|
|
|
virtual bool IsValid() const;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
virtual bool GetEdgeNodes( const int theElemId,
|
|
|
|
const int theEdgeNum,
|
|
|
|
int& theNodeId1,
|
|
|
|
int& theNodeId2 ) const;
|
|
|
|
|
2010-11-29 18:20:53 +05:00
|
|
|
virtual vtkUnstructuredGrid* GetUnstructuredGrid();
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
virtual vtkIdType GetNodeObjId( int theVTKID );
|
|
|
|
virtual vtkIdType GetNodeVTKId( int theObjID );
|
|
|
|
virtual vtkIdType GetElemObjId( int theVTKID );
|
|
|
|
virtual vtkIdType GetElemVTKId( int theObjID );
|
|
|
|
|
2011-12-15 19:32:32 +06:00
|
|
|
virtual void ClearEntitiesFlags();
|
|
|
|
virtual bool GetEntitiesFlag();
|
|
|
|
virtual unsigned int GetEntitiesState();
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
protected:
|
|
|
|
|
|
|
|
void createPoints( vtkPoints* );
|
2010-11-29 18:20:53 +05:00
|
|
|
void buildPrs(bool buildGrid = false);
|
2005-01-20 11:25:54 +05:00
|
|
|
void buildNodePrs();
|
|
|
|
void buildElemPrs();
|
2011-12-15 19:32:32 +06:00
|
|
|
void updateEntitiesFlags();
|
2010-11-29 18:20:53 +05:00
|
|
|
//private:
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
TMapOfIds mySMDS2VTKNodes;
|
|
|
|
TMapOfIds myVTK2SMDSNodes;
|
|
|
|
TMapOfIds mySMDS2VTKElems;
|
|
|
|
TMapOfIds myVTK2SMDSElems;
|
2010-11-29 18:20:53 +05:00
|
|
|
bool myLocalGrid;
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2011-12-15 19:32:32 +06:00
|
|
|
bool myEntitiesFlag;
|
|
|
|
unsigned int myEntitiesState;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
vtkUnstructuredGrid* myGrid;
|
2011-12-15 19:32:32 +06:00
|
|
|
std::map<SMDSAbs_ElementType,int> myEntitiesCache;
|
2005-01-20 11:25:54 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class : SMESH_MeshObj
|
|
|
|
Description : Class for visualisation of mesh
|
|
|
|
*/
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHOBJECT_EXPORT SMESH_MeshObj: public SMESH_VisualObjDef
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
SMESH_MeshObj( SMESH::SMESH_Mesh_ptr );
|
|
|
|
virtual ~SMESH_MeshObj();
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
virtual bool Update( int theIsClear = true );
|
2010-11-29 18:20:53 +05:00
|
|
|
virtual bool NulData();
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
virtual int GetNbEntities( const SMDSAbs_ElementType) const;
|
|
|
|
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
|
|
|
|
virtual bool IsNodePrs() const;
|
|
|
|
|
|
|
|
virtual int GetElemDimension( const int theObjId );
|
|
|
|
|
|
|
|
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
|
|
|
|
|
2006-03-13 20:29:49 +05:00
|
|
|
SMESH::SMESH_Mesh_ptr GetMeshServer() { return myClient.GetMeshServer(); }
|
|
|
|
SMDS_Mesh* GetMesh() const { return myClient.GetMesh(); }
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
protected:
|
2006-03-13 20:29:49 +05:00
|
|
|
SMESH_Client myClient;
|
2010-11-29 18:20:53 +05:00
|
|
|
vtkUnstructuredGrid* myEmptyGrid;
|
2005-01-20 11:25:54 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class : SMESH_SubMeshObj
|
|
|
|
Description : Base class for visualisation of submeshes and groups
|
|
|
|
*/
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHOBJECT_EXPORT SMESH_SubMeshObj: public SMESH_VisualObjDef
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
SMESH_SubMeshObj(SMESH_MeshObj* theMeshObj);
|
|
|
|
virtual ~SMESH_SubMeshObj();
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
virtual bool Update( int theIsClear = true );
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
|
|
|
|
virtual int GetElemDimension( const int theObjId );
|
|
|
|
virtual SMDS_Mesh* GetMesh() const { return myMeshObj->GetMesh(); }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
SMESH_MeshObj* myMeshObj;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class : SMESH_GroupObj
|
|
|
|
Description : Class for visualisation of groups
|
|
|
|
*/
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHOBJECT_EXPORT SMESH_GroupObj: public SMESH_SubMeshObj
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* );
|
|
|
|
virtual ~SMESH_GroupObj();
|
|
|
|
|
|
|
|
virtual int GetNbEntities( const SMDSAbs_ElementType) const;
|
|
|
|
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
|
|
|
|
virtual bool IsNodePrs() const;
|
|
|
|
|
2009-05-27 18:05:48 +06:00
|
|
|
virtual SMDSAbs_ElementType GetElementType() const;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
private:
|
|
|
|
|
|
|
|
SMESH::SMESH_GroupBase_var myGroupServer;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class : SMESH_subMeshObj
|
|
|
|
Description : Class for visualisation of submeshes
|
|
|
|
*/
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHOBJECT_EXPORT SMESH_subMeshObj : public SMESH_SubMeshObj
|
2005-01-20 11:25:54 +05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
SMESH_subMeshObj( SMESH::SMESH_subMesh_ptr,
|
|
|
|
SMESH_MeshObj* );
|
|
|
|
virtual ~SMESH_subMeshObj();
|
|
|
|
|
|
|
|
virtual int GetNbEntities( const SMDSAbs_ElementType) const;
|
|
|
|
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
|
|
|
|
virtual bool IsNodePrs() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
SMESH::SMESH_subMesh_var mySubMeshServer;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|