mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-06 23:00:34 +05:00
PAL16202,16203 (Propagation 1D on edges group)
remove useless includes and + /*! + * \brief Return submeshes of groups containing the given subshape + */ + std::list<SMESH_subMesh*> GetGroupSubMeshesContaining(const TopoDS_Shape & shape) const + throw(SALOME_Exception);
This commit is contained in:
parent
9d182ff3a7
commit
90bfa44674
@ -35,6 +35,7 @@
|
|||||||
#include "SMESHDS_Group.hxx"
|
#include "SMESHDS_Group.hxx"
|
||||||
#include "SMESHDS_Script.hxx"
|
#include "SMESHDS_Script.hxx"
|
||||||
#include "SMESHDS_GroupOnGeom.hxx"
|
#include "SMESHDS_GroupOnGeom.hxx"
|
||||||
|
#include "SMESHDS_Document.hxx"
|
||||||
#include "SMDS_MeshVolume.hxx"
|
#include "SMDS_MeshVolume.hxx"
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
@ -48,19 +49,13 @@
|
|||||||
#include "DriverUNV_R_SMDS_Mesh.h"
|
#include "DriverUNV_R_SMDS_Mesh.h"
|
||||||
#include "DriverSTL_R_SMDS_Mesh.h"
|
#include "DriverSTL_R_SMDS_Mesh.h"
|
||||||
|
|
||||||
#include <BRepTools_WireExplorer.hxx>
|
|
||||||
#include <BRepPrimAPI_MakeBox.hxx>
|
#include <BRepPrimAPI_MakeBox.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
|
||||||
#include <gp_Pnt.hxx>
|
|
||||||
|
|
||||||
#include <TCollection_AsciiString.hxx>
|
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopTools_Array1OfShape.hxx>
|
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "Utils_ExceptHandlers.hxx"
|
#include "Utils_ExceptHandlers.hxx"
|
||||||
|
|
||||||
@ -724,7 +719,7 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const TopoDS_Shape & aSubShape)
|
SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const TopoDS_Shape & aSubShape) const
|
||||||
throw(SALOME_Exception)
|
throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
Unexpect aCatch(SalomeException);
|
Unexpect aCatch(SalomeException);
|
||||||
@ -732,13 +727,12 @@ SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const TopoDS_Shape & aSubShape)
|
|||||||
|
|
||||||
int index = _myMeshDS->ShapeToIndex(aSubShape);
|
int index = _myMeshDS->ShapeToIndex(aSubShape);
|
||||||
|
|
||||||
map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.find(index);
|
map <int, SMESH_subMesh *>::const_iterator i_sm = _mapSubMesh.find(index);
|
||||||
if ( i_sm != _mapSubMesh.end())
|
if ( i_sm != _mapSubMesh.end())
|
||||||
aSubMesh = i_sm->second;
|
aSubMesh = i_sm->second;
|
||||||
|
|
||||||
return aSubMesh;
|
return aSubMesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* Get the SMESH_subMesh object implementation. Dont create it, return null
|
* Get the SMESH_subMesh object implementation. Dont create it, return null
|
||||||
@ -746,17 +740,51 @@ SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const TopoDS_Shape & aSubShape)
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const int aShapeID)
|
SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const int aShapeID) const
|
||||||
throw(SALOME_Exception)
|
throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
Unexpect aCatch(SalomeException);
|
Unexpect aCatch(SalomeException);
|
||||||
|
|
||||||
map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.find(aShapeID);
|
map <int, SMESH_subMesh *>::const_iterator i_sm = _mapSubMesh.find(aShapeID);
|
||||||
if (i_sm == _mapSubMesh.end())
|
if (i_sm == _mapSubMesh.end())
|
||||||
return NULL;
|
return NULL;
|
||||||
return i_sm->second;
|
return i_sm->second;
|
||||||
}
|
}
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return submeshes of groups containing the given subshape
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
list<SMESH_subMesh*>
|
||||||
|
SMESH_Mesh::GetGroupSubMeshesContaining(const TopoDS_Shape & aSubShape) const
|
||||||
|
throw(SALOME_Exception)
|
||||||
|
{
|
||||||
|
Unexpect aCatch(SalomeException);
|
||||||
|
list<SMESH_subMesh*> found;
|
||||||
|
|
||||||
|
SMESH_subMesh * subMesh = GetSubMeshContaining(aSubShape);
|
||||||
|
if ( !subMesh )
|
||||||
|
return found;
|
||||||
|
|
||||||
|
// submeshes of groups have max IDs, so search from the map end
|
||||||
|
map<int, SMESH_subMesh *>::const_reverse_iterator i_sm;
|
||||||
|
for ( i_sm = _mapSubMesh.rbegin(); i_sm != _mapSubMesh.rend(); ++i_sm) {
|
||||||
|
SMESHDS_SubMesh * ds = i_sm->second->GetSubMeshDS();
|
||||||
|
if ( ds && ds->IsComplexSubmesh() ) {
|
||||||
|
TopExp_Explorer exp( i_sm->second->GetSubShape(), aSubShape.ShapeType() );
|
||||||
|
for ( ; exp.More(); exp.Next() ) {
|
||||||
|
if ( aSubShape.IsSame( exp.Current() )) {
|
||||||
|
found.push_back( i_sm->second );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsUsedHypothesis
|
//function : IsUsedHypothesis
|
||||||
//purpose : Return True if anHyp is used to mesh aSubShape
|
//purpose : Return True if anHyp is used to mesh aSubShape
|
||||||
|
@ -32,50 +32,27 @@
|
|||||||
#include "SMESH_SMESH.hxx"
|
#include "SMESH_SMESH.hxx"
|
||||||
|
|
||||||
#include "SMESH_Hypothesis.hxx"
|
#include "SMESH_Hypothesis.hxx"
|
||||||
//#include "SMESH_subMesh.hxx"
|
|
||||||
|
|
||||||
#include "SMESHDS_Document.hxx"
|
|
||||||
#include "SMESHDS_Mesh.hxx"
|
#include "SMESHDS_Mesh.hxx"
|
||||||
#include "SMESHDS_Command.hxx"
|
#include "SMESHDS_Command.hxx"
|
||||||
#include "SMDSAbs_ElementType.hxx"
|
#include "SMDSAbs_ElementType.hxx"
|
||||||
|
|
||||||
//#include "NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx"
|
|
||||||
#include "SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx"
|
|
||||||
|
|
||||||
#include "Utils_SALOME_Exception.hxx"
|
#include "Utils_SALOME_Exception.hxx"
|
||||||
|
|
||||||
#include <TopExp.hxx>
|
|
||||||
#include <TopExp_Explorer.hxx>
|
|
||||||
#include <TopoDS.hxx>
|
|
||||||
#include <TopoDS_Iterator.hxx>
|
|
||||||
#include <TopoDS_Compound.hxx>
|
|
||||||
#include <TopoDS_CompSolid.hxx>
|
|
||||||
#include <TopoDS_Solid.hxx>
|
|
||||||
#include <TopoDS_Shell.hxx>
|
|
||||||
#include <TopoDS_Face.hxx>
|
|
||||||
#include <TopoDS_Wire.hxx>
|
|
||||||
#include <TopoDS_Edge.hxx>
|
|
||||||
#include <TopoDS_Vertex.hxx>
|
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
|
||||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
class SMESH_Gen;
|
class SMESH_Gen;
|
||||||
|
class SMESHDS_Document;
|
||||||
class SMESH_Group;
|
class SMESH_Group;
|
||||||
class TopTools_ListOfShape;
|
class TopTools_ListOfShape;
|
||||||
class SMESH_subMesh;
|
class SMESH_subMesh;
|
||||||
class SMESH_HypoFilter;
|
class SMESH_HypoFilter;
|
||||||
class TopoDS_Solid;
|
class TopoDS_Solid;
|
||||||
|
|
||||||
typedef SMESH_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain;
|
|
||||||
|
|
||||||
class SMESH_EXPORT SMESH_Mesh
|
class SMESH_EXPORT SMESH_Mesh
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -122,7 +99,7 @@ public:
|
|||||||
RemoveHypothesis(const TopoDS_Shape & aSubShape, int anHypId)
|
RemoveHypothesis(const TopoDS_Shape & aSubShape, int anHypId)
|
||||||
throw(SALOME_Exception);
|
throw(SALOME_Exception);
|
||||||
|
|
||||||
const list <const SMESHDS_Hypothesis * >&
|
const std::list <const SMESHDS_Hypothesis * >&
|
||||||
GetHypothesisList(const TopoDS_Shape & aSubShape) const
|
GetHypothesisList(const TopoDS_Shape & aSubShape) const
|
||||||
throw(SALOME_Exception);
|
throw(SALOME_Exception);
|
||||||
|
|
||||||
@ -132,10 +109,10 @@ public:
|
|||||||
|
|
||||||
int GetHypotheses(const TopoDS_Shape & aSubShape,
|
int GetHypotheses(const TopoDS_Shape & aSubShape,
|
||||||
const SMESH_HypoFilter& aFilter,
|
const SMESH_HypoFilter& aFilter,
|
||||||
list <const SMESHDS_Hypothesis * >& aHypList,
|
std::list <const SMESHDS_Hypothesis * >& aHypList,
|
||||||
const bool andAncestors) const;
|
const bool andAncestors) const;
|
||||||
|
|
||||||
const list<SMESHDS_Command*> & GetLog() throw(SALOME_Exception);
|
const std::list<SMESHDS_Command*> & GetLog() throw(SALOME_Exception);
|
||||||
|
|
||||||
void ClearLog() throw(SALOME_Exception);
|
void ClearLog() throw(SALOME_Exception);
|
||||||
|
|
||||||
@ -148,38 +125,52 @@ public:
|
|||||||
SMESH_subMesh *GetSubMesh(const TopoDS_Shape & aSubShape)
|
SMESH_subMesh *GetSubMesh(const TopoDS_Shape & aSubShape)
|
||||||
throw(SALOME_Exception);
|
throw(SALOME_Exception);
|
||||||
|
|
||||||
SMESH_subMesh *GetSubMeshContaining(const TopoDS_Shape & aSubShape)
|
SMESH_subMesh *GetSubMeshContaining(const TopoDS_Shape & aSubShape) const
|
||||||
throw(SALOME_Exception);
|
throw(SALOME_Exception);
|
||||||
|
|
||||||
SMESH_subMesh *GetSubMeshContaining(const int aShapeID)
|
SMESH_subMesh *GetSubMeshContaining(const int aShapeID) const
|
||||||
throw(SALOME_Exception);
|
throw(SALOME_Exception);
|
||||||
|
/*!
|
||||||
|
* \brief Return submeshes of groups containing the given subshape
|
||||||
|
*/
|
||||||
|
std::list<SMESH_subMesh*> GetGroupSubMeshesContaining(const TopoDS_Shape & shape) const
|
||||||
|
throw(SALOME_Exception);
|
||||||
|
/*!
|
||||||
|
* \brief Say all submeshes that theChangedHyp has been modified
|
||||||
|
*/
|
||||||
void NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* theChangedHyp);
|
void NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* theChangedHyp);
|
||||||
// Say all submeshes that theChangedHyp has been modified
|
|
||||||
|
|
||||||
const list < SMESH_subMesh * >&
|
|
||||||
GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp)
|
|
||||||
throw(SALOME_Exception);
|
|
||||||
|
|
||||||
|
const std::list < SMESH_subMesh * >&
|
||||||
|
GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp) throw(SALOME_Exception);
|
||||||
|
/*!
|
||||||
|
* \brief Return True if anHyp is used to mesh aSubShape
|
||||||
|
*/
|
||||||
bool IsUsedHypothesis(SMESHDS_Hypothesis * anHyp,
|
bool IsUsedHypothesis(SMESHDS_Hypothesis * anHyp,
|
||||||
const SMESH_subMesh * aSubMesh);
|
const SMESH_subMesh * aSubMesh);
|
||||||
// Return True if anHyp is used to mesh aSubShape
|
/*!
|
||||||
|
* \brief check if a hypothesis alowing notconform mesh is present
|
||||||
|
*/
|
||||||
bool IsNotConformAllowed() const;
|
bool IsNotConformAllowed() const;
|
||||||
// check if a hypothesis alowing notconform mesh is present
|
|
||||||
|
|
||||||
bool IsMainShape(const TopoDS_Shape& theShape) const;
|
bool IsMainShape(const TopoDS_Shape& theShape) const;
|
||||||
|
/*!
|
||||||
|
* \brief Return list of ancestors of theSubShape in the order
|
||||||
|
* that lower dimention shapes come first
|
||||||
|
*/
|
||||||
const TopTools_ListOfShape& GetAncestors(const TopoDS_Shape& theSubShape) const;
|
const TopTools_ListOfShape& GetAncestors(const TopoDS_Shape& theSubShape) const;
|
||||||
// return list of ancestors of theSubShape in the order
|
|
||||||
// that lower dimention shapes come first.
|
|
||||||
|
|
||||||
void SetAutoColor(bool theAutoColor) throw(SALOME_Exception);
|
void SetAutoColor(bool theAutoColor) throw(SALOME_Exception);
|
||||||
|
|
||||||
bool GetAutoColor() throw(SALOME_Exception);
|
bool GetAutoColor() throw(SALOME_Exception);
|
||||||
|
|
||||||
/*! Check group names for duplications.
|
/*!
|
||||||
* Consider maximum group name length stored in MED file.
|
* \brief Return data map of descendant to ancestor shapes
|
||||||
|
*/
|
||||||
|
typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap;
|
||||||
|
const TAncestorMap& GetAncestorMap() const { return _mapAncestors; }
|
||||||
|
/*!
|
||||||
|
* \brief Check group names for duplications.
|
||||||
|
* Consider maximum group name length stored in MED file
|
||||||
*/
|
*/
|
||||||
bool HasDuplicatedGroupNamesMED();
|
bool HasDuplicatedGroupNamesMED();
|
||||||
|
|
||||||
@ -228,7 +219,7 @@ public:
|
|||||||
|
|
||||||
SMESH_Group* GetGroup (const int theGroupID);
|
SMESH_Group* GetGroup (const int theGroupID);
|
||||||
|
|
||||||
list<int> GetGroupIds();
|
std::list<int> GetGroupIds();
|
||||||
|
|
||||||
void RemoveGroup (const int theGroupID);
|
void RemoveGroup (const int theGroupID);
|
||||||
|
|
||||||
@ -247,7 +238,7 @@ protected:
|
|||||||
int _idDoc; // id given by SMESHDS_Document
|
int _idDoc; // id given by SMESHDS_Document
|
||||||
int _groupId; // id generator for group objects
|
int _groupId; // id generator for group objects
|
||||||
bool _isShapeToMesh;// set to true when a shape is given (only once)
|
bool _isShapeToMesh;// set to true when a shape is given (only once)
|
||||||
list <SMESH_subMesh *> _subMeshesUsingHypothesisList;
|
std::list <SMESH_subMesh*> _subMeshesUsingHypothesisList;
|
||||||
SMESHDS_Document * _myDocument;
|
SMESHDS_Document * _myDocument;
|
||||||
SMESHDS_Mesh * _myMeshDS;
|
SMESHDS_Mesh * _myMeshDS;
|
||||||
map <int, SMESH_subMesh *> _mapSubMesh;
|
map <int, SMESH_subMesh *> _mapSubMesh;
|
||||||
|
Loading…
Reference in New Issue
Block a user