NPAL16198: EDF462: Submeshes creation duplicate algorithms and hypotheses. Refix.

This commit is contained in:
jfa 2007-12-27 09:37:46 +00:00
parent 32032d4d58
commit 415771a7d5
15 changed files with 564 additions and 544 deletions

View File

@ -15,7 +15,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -43,6 +43,35 @@ module SMESH
interface FilterManager;
interface SMESH_Pattern;
/*!
* Tags definition
*/
// Top level
const long Tag_HypothesisRoot = 1; // hypotheses root
const long Tag_AlgorithmsRoot = 2; // algorithms root
const long Tag_FirstMeshRoot = 3; // first mesh root
// Mesh/Submesh
const long Tag_RefOnShape = 1; // references to shape
const long Tag_RefOnAppliedHypothesis = 2; // applied hypotheses root
const long Tag_RefOnAppliedAlgorithms = 3; // applied algorithms root
// Mesh only: sub-meshes roots by type
const long Tag_FirstSubMesh = 4;
const long Tag_SubMeshOnVertex = 4;
const long Tag_SubMeshOnEdge = 5;
const long Tag_SubMeshOnWire = 6;
const long Tag_SubMeshOnFace = 7;
const long Tag_SubMeshOnShell = 8;
const long Tag_SubMeshOnSolid = 9;
const long Tag_SubMeshOnCompound = 10;
const long Tag_LastSubMesh = 10;
// Mesh only: group roots by type
const long Tag_FirstGroup = 11;
const long Tag_NodeGroups = 11;
const long Tag_EdgeGroups = 12;
const long Tag_FaceGroups = 13;
const long Tag_VolumeGroups = 14;
const long Tag_LastGroup = 14;
/*!
* Hypothesis definintion error
*/
@ -246,6 +275,12 @@ module SMESH
in double theMergeTolerance)
raises ( SALOME::SALOME_Exception );
/*!
* \brief Return id of object, registered in current study context
*
* Can be used to check if the object was created in the same container, as this engine.
*/
long GetObjectId(in Object theObject);
};
};

View File

@ -71,8 +71,8 @@ using namespace std;
*/
//=============================================================================
SMESH_Algo::SMESH_Algo(int hypId, int studyId,
SMESH_Gen * gen):SMESH_Hypothesis(hypId, studyId, gen)
SMESH_Algo::SMESH_Algo (int hypId, int studyId, SMESH_Gen * gen)
: SMESH_Hypothesis(hypId, studyId, gen)
{
gen->_mapAlgo[hypId] = this;
@ -108,7 +108,7 @@ istream & SMESH_Algo::LoadFrom(istream & load) { return load; }
const vector < string > &SMESH_Algo::GetCompatibleHypothesis()
{
return _compatibleHypothesis;
return _compatibleHypothesis;
}
//=============================================================================
@ -132,7 +132,7 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh,
{
aMesh.GetHypotheses( aShape, filter, _usedHypList, true );
if ( ignoreAuxiliary && _usedHypList.size() > 1 )
_usedHypList.clear(); //only one compatible hypothesis allowed
_usedHypList.clear(); //only one compatible hypothesis allowed
}
return _usedHypList;
}

View File

@ -149,6 +149,7 @@ bool SMESHDS_GroupBase::Contains (const SMDS_MeshElement* elem)
{
if ( elem )
return Contains( elem->GetID() );
return false;
}
//=======================================================================

View File

@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
#
@ -48,14 +48,15 @@ dist_libSMESHFiltersSelection_la_SOURCES = \
# additionnal information to compil and link file
libSMESHFiltersSelection_la_CPPFLAGS = \
$(KERNEL_CXXFLAGS) \
$(GUI_CXXFLAGS) \
$(GEOM_CXXFLAGS) \
$(CAS_CPPFLAGS) \
$(QT_INCLUDES) \
$(PYTHON_INCLUDES) \
$(VTK_INCLUDES) \
${BOOST_CPPFLAGS} \
$(KERNEL_CXXFLAGS) \
$(GUI_CXXFLAGS) \
$(GEOM_CXXFLAGS) \
$(MED_CXXFLAGS) \
$(BOOST_CPPFLAGS) \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
-I$(top_builddir)/idl \

View File

@ -11,12 +11,13 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "SMESH_TypeFilter.hxx"
#include <SUIT_Session.h>
@ -24,12 +25,15 @@
#include <SalomeApp_Study.h>
#include <LightApp_DataOwner.h>
SMESH_TypeFilter::SMESH_TypeFilter (MeshObjectType theType)
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SMESH_Gen)
SMESH_TypeFilter::SMESH_TypeFilter (MeshObjectType theType)
{
myType = theType;
}
SMESH_TypeFilter::~SMESH_TypeFilter()
SMESH_TypeFilter::~SMESH_TypeFilter()
{
}
@ -80,90 +84,98 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const
return false;
switch (myType)
{
{
case HYPOTHESIS:
{
if ( aLevel == 2 && ( objFather->Tag() == 1 )) // hypo definition
if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_HypothesisRoot))
// hypo definition
Ok = true;
else if ( aLevel == 3 && ( objFather->Tag() == 2 )) // applied global hypo
else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
// applied global hypo
Ok = true;
else if ( aLevel == 5 && ( objFather->Tag() == 2 )) // applied local hypo
else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
// applied local hypo
Ok = true;
break;
}
case ALGORITHM:
{
if ( aLevel == 2 && ( objFather->Tag() == 2 )) // algo definition
if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_AlgorithmsRoot))
// algo definition
Ok = true;
else if ( aLevel == 3 && ( objFather->Tag() == 3 )) // applied global algo
else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
// applied global algo
Ok = true;
else if ( aLevel == 5 && ( objFather->Tag() == 3 )) // applied local algo
else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
// applied local algo
Ok = true;
break;
}
case MESH:
{
if ( aLevel == 1 && ( obj->Tag() >= 3 ))
if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
Ok = true;
break;
}
case SUBMESH:
{
// see SMESH_Gen_i.cxx for tag numbers
if ( aLevel == 3 && ( objFather->Tag() >= 4 && objFather->Tag() <= 10 ))
if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
objFather->Tag() <= SMESH::Tag_LastSubMesh))
Ok = true;
break;
}
case MESHorSUBMESH:
{
if ( aLevel == 1 && ( obj->Tag() >= 3 ))
if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
Ok = true; // mesh
else if ( aLevel == 3 && ( objFather->Tag() >= 4 && objFather->Tag() <= 10 ))
else if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
objFather->Tag() <= SMESH::Tag_LastSubMesh))
Ok = true;
break;
}
case SUBMESH_VERTEX: // Label "SubMeshes on vertexes"
case SUBMESH_VERTEX: // Label "SubMeshes on vertexes"
{
if ( aLevel == 3 && ( objFather->Tag() == 4 ))
if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnVertex))
Ok = true;
break;
}
case SUBMESH_EDGE:
{
if ( aLevel == 3 && ( objFather->Tag() == 5 ))
if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnEdge))
Ok = true;
break;
}
case SUBMESH_FACE:
{
if ( aLevel == 3 && ( objFather->Tag() == 7 ))
if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnFace))
Ok = true;
break;
}
case SUBMESH_SOLID:
{
if ( aLevel == 3 && ( objFather->Tag() == 9 ))
if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnSolid))
Ok = true;
break;
}
case SUBMESH_COMPOUND:
{
if ( aLevel == 3 && ( objFather->Tag() == 10 ))
if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnCompound))
Ok = true;
break;
}
case GROUP:
{
if ( aLevel == 3 && ( objFather->Tag() > 10 ))
if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstGroup))
Ok = true;
break;
}
}
}
}
return Ok;
}
MeshObjectType SMESH_TypeFilter::type() const
MeshObjectType SMESH_TypeFilter::type() const
{
return myType;
}

View File

@ -44,6 +44,8 @@
#include "SMESH_TypeFilter.hxx"
#include "SMESH_NumberFilter.hxx"
#include CORBA_CLIENT_HEADER(SMESH_Gen)
#include "GEOM_SelectionFilter.h"
#include "GEOMBase.h"
#include "GeometryGUI.h"
@ -72,18 +74,6 @@
#include <TopoDS_Shape.hxx>
#include <TopExp_Explorer.hxx>
enum { GLOBAL_ALGO_TAG =3,
GLOBAL_HYPO_TAG =2,
LOCAL_ALGO_TAG =2,
LOCAL_HYPO_TAG =1,
SUBMESH_ON_VERTEX_TAG =4,
SUBMESH_ON_EDGE_TAG =5,
SUBMESH_ON_WIRE_TAG =6,
SUBMESH_ON_FACE_TAG =7,
SUBMESH_ON_SHELL_TAG =8,
SUBMESH_ON_SOLID_TAG =9,
SUBMESH_ON_COMPOUND_TAG=10 };
//================================================================================
/*!
* \brief Constructor
@ -368,13 +358,13 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
if ( !geom->_is_nil() ) {
int tag = -1;
switch ( geom->GetShapeType() ) {
case GEOM::VERTEX: tag = SUBMESH_ON_VERTEX_TAG ; break;
case GEOM::EDGE: tag = SUBMESH_ON_EDGE_TAG ; break;
case GEOM::WIRE: tag = SUBMESH_ON_WIRE_TAG ; break;
case GEOM::FACE: tag = SUBMESH_ON_FACE_TAG ; break;
case GEOM::SHELL: tag = SUBMESH_ON_SHELL_TAG ; break;
case GEOM::SOLID: tag = SUBMESH_ON_SOLID_TAG ; break;
case GEOM::COMPOUND: tag = SUBMESH_ON_COMPOUND_TAG; break;
case GEOM::VERTEX: tag = SMESH::Tag_SubMeshOnVertex ; break;
case GEOM::EDGE: tag = SMESH::Tag_SubMeshOnEdge ; break;
case GEOM::WIRE: tag = SMESH::Tag_SubMeshOnWire ; break;
case GEOM::FACE: tag = SMESH::Tag_SubMeshOnFace ; break;
case GEOM::SHELL: tag = SMESH::Tag_SubMeshOnShell ; break;
case GEOM::SOLID: tag = SMESH::Tag_SubMeshOnSolid ; break;
case GEOM::COMPOUND: tag = SMESH::Tag_SubMeshOnCompound; break;
default:;
}
_PTR(GenericAttribute) anAttr;
@ -760,9 +750,9 @@ void SMESHGUI_MeshOp::existingHyps( const int theDim,
bool isMesh = !_CAST( SComponent, theFather );
int aPart = -1;
if ( isMesh )
aPart = theHypType == Algo ? GLOBAL_ALGO_TAG : GLOBAL_HYPO_TAG;
aPart = theHypType == Algo ? SMESH::Tag_RefOnAppliedAlgorithms : SMESH::Tag_RefOnAppliedHypothesis;
else
aPart = theHypType == Algo ? LOCAL_ALGO_TAG : LOCAL_HYPO_TAG;
aPart = theHypType == Algo ? SMESH::Tag_AlgorithmsRoot : SMESH::Tag_HypothesisRoot;
if ( theFather->FindSubObject( aPart, aHypRoot ) )
{

View File

@ -37,8 +37,8 @@
#include "SMESHGUI_SelectionOp.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_CLIENT_HEADER(GEOM_Gen)
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
#include <qstringlist.h>

View File

@ -36,8 +36,9 @@
#include "SVTK_RenderWindowInteractor.h"
#include "SVTK_ViewWindow.h"
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_CLIENT_HEADER(SMESH_Gen)
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
#include CORBA_CLIENT_HEADER(SMESH_Group)
//=======================================================================
//function : SMESHGUI_Selection
@ -82,7 +83,7 @@ void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
//=======================================================================
void SMESHGUI_Selection::processOwner( const LightApp_DataOwner* ow )
{
const LightApp_SVTKDataOwner* owner =
const LightApp_SVTKDataOwner* owner =
dynamic_cast<const LightApp_SVTKDataOwner*> ( ow );
if( owner )
myActors.append( dynamic_cast<SMESH_Actor*>( owner->GetActor() ) );
@ -313,7 +314,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
/* Handle(SALOME_InteractiveObject) io =
static_cast<LightApp_DataOwner*>( myDataOwners[ ind ].get() )->IO();
if ( !io.IsNull() ) {
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io) ; // m,sm,gr->m
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
if ( !mesh->_is_nil() ) {*/
_PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).latin1() );
//FindSObject( mesh );
@ -402,47 +403,47 @@ int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
anOTag = obj->Tag(),
res = -1;
switch( aLevel )
switch (aLevel)
{
case 1:
if( anOTag>=3 )
if (anOTag >= SMESH::Tag_FirstMeshRoot)
res = MESH;
break;
case 2:
switch( aFTag )
switch (aFTag)
{
case 1:
case SMESH::Tag_HypothesisRoot:
res = HYPOTHESIS;
break;
case 2:
case SMESH::Tag_AlgorithmsRoot:
res = ALGORITHM;
break;
}
break;
case 3:
switch( aFTag )
switch (aFTag)
{
case 4:
case SMESH::Tag_SubMeshOnVertex:
res = SUBMESH_VERTEX;
break;
case 5:
case SMESH::Tag_SubMeshOnEdge:
res = SUBMESH_EDGE;
break;
case 7:
case SMESH::Tag_SubMeshOnFace:
res = SUBMESH_FACE;
break;
case 9:
case SMESH::Tag_SubMeshOnSolid:
res = SUBMESH_SOLID;
break;
case 10:
case SMESH::Tag_SubMeshOnCompound:
res = SUBMESH_COMPOUND;
break;
default:
if (aFTag >= SMESH::Tag_FirstGroup)
res = GROUP;
else
res = SUBMESH;
}
if( aFTag>10 )
res = GROUP;
else
res = SUBMESH;
break;
}

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -32,7 +32,6 @@
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESH.hxx"
#include "SMESH_TypeFilter.hxx"
#include "SALOMEDSClient_Study.hxx"
@ -251,7 +250,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
bool hasGroup = false;
// info about groups on nodes
aMeshSO->FindSubObject(Tag_NodeGroups, anObj);
aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (it->More()) {
@ -284,7 +283,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
// info about groups on edges
anObj.reset();
aMeshSO->FindSubObject(Tag_EdgeGroups, anObj);
aMeshSO->FindSubObject(SMESH::Tag_EdgeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More()) {
@ -317,7 +316,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
// info about groups on faces
anObj.reset();
aMeshSO->FindSubObject(Tag_FaceGroups , anObj);
aMeshSO->FindSubObject(SMESH::Tag_FaceGroups , anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More()) {
@ -350,7 +349,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
// info about groups on volumes
anObj.reset();
aMeshSO->FindSubObject(Tag_VolumeGroups, anObj);
aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More())
@ -458,14 +457,14 @@ void SMESHGUI_StandardMeshInfosDlg::onStartSelection()
void SMESHGUI_StandardMeshInfosDlg::onHelp()
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
QString platform;
#ifdef WIN32
platform = "winapplication";
platform = "winapplication";
#else
platform = "application";
platform = "application";
#endif
SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -65,20 +65,6 @@ using namespace std;
static CORBA::ORB_var anORB;
// Tags definition
static long Tag_HypothesisRoot = 1;
static long Tag_AlgorithmsRoot = 2;
static long Tag_RefOnShape = 1;
static long Tag_RefOnAppliedHypothesis = 2;
static long Tag_RefOnAppliedAlgorithms = 3;
static long Tag_SubMeshOnVertex = 4;
static long Tag_SubMeshOnEdge = 5;
static long Tag_SubMeshOnFace = 6;
static long Tag_SubMeshOnSolid = 7;
static long Tag_SubMeshOnCompound = 8;
namespace
{
//---------------------------------------------------------------
@ -125,11 +111,11 @@ namespace
{
return GetDomainRoot(theSComponentMesh,
theStudyBuilder,
Tag_HypothesisRoot,
SMESH::Tag_HypothesisRoot,
QObject::tr("SMESH_MEN_HYPOTHESIS"),
"ICON_SMESH_TREE_HYPO");
}
//---------------------------------------------------------------
inline
@ -139,7 +125,7 @@ namespace
{
return GetDomainRoot(theSComponentMesh,
theStudyBuilder,
Tag_AlgorithmsRoot,
SMESH::Tag_AlgorithmsRoot,
QObject::tr("SMESH_MEN_ALGORITHMS"),
"ICON_SMESH_TREE_ALGO");
}
@ -157,7 +143,7 @@ namespace
{
SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh,
theStudyBuilder,
Tag_AlgorithmsRoot,
SMESH::Tag_AlgorithmsRoot,
theDomainName,
theDomainPixmap);
// Add New Hypothesis
@ -172,7 +158,7 @@ namespace
anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
anIOR->SetValue(theIOR.c_str());
return aSObject;
}
@ -186,7 +172,7 @@ namespace
return AddToDomain(theIOR,
theSComponentMesh,
theStudyBuilder,
Tag_HypothesisRoot,
SMESH::Tag_HypothesisRoot,
QObject::tr("SMESH_MEN_HYPOTHESIS"),
"ICON_SMESH_TREE_HYPO");
}
@ -201,7 +187,7 @@ namespace
return AddToDomain(theIOR,
theSComponentMesh,
theStudyBuilder,
Tag_AlgorithmsRoot,
SMESH::Tag_AlgorithmsRoot,
QObject::tr("SMESH_MEN_ALGORITHMS"),
"ICON_SMESH_TREE_ALGO");
}
@ -209,7 +195,7 @@ namespace
//---------------------------------------------------------------
void
SetDomain(const char* theMeshOrSubMeshEntry,
SetDomain(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder,
@ -225,7 +211,7 @@ namespace
SALOMEDS::SObject_var anAppliedDomainSO;
if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){
anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
SALOMEDS::GenericAttribute_var anAttr =
SALOMEDS::GenericAttribute_var anAttr =
theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aName->SetValue(theAppliedDomainMEN.latin1());
@ -244,7 +230,7 @@ namespace
//---------------------------------------------------------------
void
SetHypothesis(const char* theMeshOrSubMeshEntry,
SetHypothesis(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder)
@ -253,7 +239,7 @@ namespace
theDomainEntry,
theStudy,
theStudyBuilder,
Tag_RefOnAppliedHypothesis,
SMESH::Tag_RefOnAppliedHypothesis,
QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
"ICON_SMESH_TREE_HYPO");
}
@ -261,7 +247,7 @@ namespace
//---------------------------------------------------------------
void
SetAlgorithms(const char* theMeshOrSubMeshEntry,
SetAlgorithms(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder)
@ -270,7 +256,7 @@ namespace
theDomainEntry,
theStudy,
theStudyBuilder,
Tag_RefOnAppliedAlgorithms,
SMESH::Tag_RefOnAppliedAlgorithms,
QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
"ICON_SMESH_TREE_ALGO");
}
@ -347,7 +333,7 @@ SMESH_Swig::Init(int theStudyID)
myStudy = aStudyMgr->GetStudyByID(myStudyID);
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
aSMESHGen->SetCurrentStudy( myStudy.in() );
aSMESHGen->SetCurrentStudy( myStudy.in() );
myStudyBuilder = myStudy->NewBuilder();
@ -358,7 +344,7 @@ SMESH_Swig::Init(int theStudyID)
SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
if(aSComponent->_is_nil()){
bool aLocked = myStudy->GetProperties()->IsLocked();
if (aLocked)
if (aLocked)
myStudy->GetProperties()->SetLocked(false);
aSComponent = myStudyBuilder->NewComponent("SMESH");
@ -366,18 +352,18 @@ SMESH_Swig::Init(int theStudyID)
aName = SALOMEDS::AttributeName::_narrow(anAttr);
SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
if(!aSMESHGUI){
if (!aSMESHGUI){
CAM_Module* aModule = anApp->module("Mesh");
if(!aModule)
if(!aModule)
aModule = anApp->loadModule("Mesh");
aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
} //SRN: BugID IPAL9186: end of a fix
aName->SetValue(aSMESHGUI->moduleName());
anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
if(aLocked)
if (aLocked)
myStudy->GetProperties()->SetLocked(true);
}
@ -404,18 +390,17 @@ SMESH_Swig::~SMESH_Swig()
//===============================================================
const char*
SMESH_Swig::AddNewMesh(const char* theIOR)
const char* SMESH_Swig::AddNewMesh(const char* theIOR)
{
MESSAGE("AddNewMesh");
// VSR: added temporarily - to be removed - objects are published automatically by engine
SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
if(aSObject->_is_nil()){
if (aSObject->_is_nil()){
//Find or Create Hypothesis root
GetHypothesisRoot(mySComponentMesh,myStudyBuilder);
GetAlgorithmsRoot(mySComponentMesh,myStudyBuilder);
// Add New Mesh
aSObject = myStudyBuilder->NewObject(mySComponentMesh);
SALOMEDS::GenericAttribute_var anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
@ -433,12 +418,10 @@ SMESH_Swig::AddNewMesh(const char* theIOR)
//===============================================================
const char*
SMESH_Swig::AddNewHypothesis(const char* theIOR)
const char* SMESH_Swig::AddNewHypothesis(const char* theIOR)
{
MESSAGE("AddNewHypothesis");
SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
mySComponentMesh,
myStudyBuilder);
@ -448,11 +431,10 @@ SMESH_Swig::AddNewHypothesis(const char* theIOR)
//===============================================================
const char*
SMESH_Swig::AddNewAlgorithms(const char* theIOR)
const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
{
MESSAGE("AddNewAlgorithms");
SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
mySComponentMesh,
myStudyBuilder);
@ -462,24 +444,22 @@ SMESH_Swig::AddNewAlgorithms(const char* theIOR)
//===============================================================
void
SMESH_Swig::SetShape(const char* theShapeEntry,
const char* theMeshEntry)
void SMESH_Swig::SetShape(const char* theShapeEntry,
const char* theMeshEntry)
{
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID( theMeshEntry );
SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO,Tag_RefOnShape);
SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
myStudyBuilder->Addreference(aSObject,aGeomShapeSO);
}
}
//===============================================================
void
SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry)
void SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry)
{
::SetHypothesis(theMeshOrSubMeshEntry,
theDomainEntry,
@ -489,9 +469,8 @@ SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
//===============================================================
void
SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry)
void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry)
{
::SetAlgorithms(theMeshOrSubMeshEntry,
theDomainEntry,
@ -509,10 +488,9 @@ SMESH_Swig::UnSetHypothesis(const char* theDomainEntry)
myStudyBuilder->RemoveObject(aDomainSO);
}
const char*
SMESH_Swig::AddSubMesh(const char* theMeshEntry,
const char* theSubMeshIOR,
int theShapeType)
const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
const char* theSubMeshIOR,
int theShapeType)
{
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
if(!aMeshSO->_is_nil()){
@ -520,26 +498,26 @@ SMESH_Swig::AddSubMesh(const char* theMeshEntry,
QString aSubMeshName;
switch(theShapeType){
case TopAbs_SOLID:
aShapeTag = Tag_SubMeshOnSolid;
aShapeTag = SMESH::Tag_SubMeshOnSolid;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnSolid");
break;
case TopAbs_FACE:
aShapeTag = Tag_SubMeshOnFace;
aShapeTag = SMESH::Tag_SubMeshOnFace;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnFace");
break;
case TopAbs_EDGE:
aShapeTag = Tag_SubMeshOnEdge;
aShapeTag = SMESH::Tag_SubMeshOnEdge;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnEdge");
break;
case TopAbs_VERTEX:
aShapeTag = Tag_SubMeshOnVertex;
aShapeTag = SMESH::Tag_SubMeshOnVertex;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnVertex");
break;
default:
aShapeTag = Tag_SubMeshOnCompound;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound");
aShapeTag = SMESH::Tag_SubMeshOnCompound;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound");
}
SALOMEDS::SObject_var aSubMeshesRoot;
SALOMEDS::GenericAttribute_var anAttr;
if(!aMeshSO->FindSubObject(aShapeTag,aSubMeshesRoot)){
@ -564,11 +542,10 @@ SMESH_Swig::AddSubMesh(const char* theMeshEntry,
return "";
}
const char*
SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
const char* theGeomShapeEntry,
const char* theSubMeshIOR,
int ShapeType)
const char* SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
const char* theGeomShapeEntry,
const char* theSubMeshIOR,
int ShapeType)
{
SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
if(!aGeomShapeSO->_is_nil()){
@ -605,14 +582,12 @@ void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry )
aDisp->Display(_entry,1);
}
};
ProcessVoidEvent(new TEvent(Mesh_Entry));
}
void
SMESH_Swig::SetName(const char* theEntry,
const char* theName)
void SMESH_Swig::SetName(const char* theEntry,
const char* theName)
{
SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
SALOMEDS::GenericAttribute_var anAttr;
@ -632,7 +607,7 @@ SMESH_Swig::SetName(const char* theEntry,
*/
//================================================================================
void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
const bool theIsComputed,
const bool isEmpty)
{

View File

@ -17,14 +17,14 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : SMESH.hxx
// Author : Michael ZORIN
// Module : SMESH
// $Header:
// $Header$
#ifndef _SMESH_I_SMESH_HXX_
#define _SMESH_I_SMESH_HXX_
@ -39,28 +39,4 @@
#define SMESH_I_EXPORT
#endif
// Tags definition
enum {
// Top level
Tag_HypothesisRoot = 1, // hypotheses root
Tag_AlgorithmsRoot = 2, // algorithms root
// Mesh/Submesh
Tag_RefOnShape = 1, // references to shape
Tag_RefOnAppliedHypothesis = 2, // applied hypotheses root
Tag_RefOnAppliedAlgorithms = 3, // applied algorithms root
// Mesh only
Tag_SubMeshOnVertex = 4, // sub-meshes roots by type
Tag_SubMeshOnEdge = 5, // ...
Tag_SubMeshOnWire = 6, // ...
Tag_SubMeshOnFace = 7, // ...
Tag_SubMeshOnShell = 8, // ...
Tag_SubMeshOnSolid = 9, // ...
Tag_SubMeshOnCompound = 10, // ...
Tag_NodeGroups = 11, // Group roots by type
Tag_EdgeGroups = 12, // ...
Tag_FaceGroups = 13, // ...
Tag_VolumeGroups = 14 // ...
};
#endif

View File

@ -327,43 +327,41 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
{
int libNameLen = strlen(theLibName);
//check for old format "libXXXXXXX.so"
if( libNameLen > 7 &&
if (libNameLen > 7 &&
!strncmp( theLibName, "lib", 3 ) &&
!strcmp( theLibName+libNameLen-3, ".so" ) )
{
//the old format
!strcmp( theLibName+libNameLen-3, ".so" ))
{
//the old format
#ifdef WNT
aPlatformLibName = new char[libNameLen - 1];
aPlatformLibName[0] = '\0';
aPlatformLibName = strncat( aPlatformLibName, theLibName+3, libNameLen-6 );
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
aPlatformLibName[libNameLen - 2] = '\0';
aPlatformLibName = new char[libNameLen - 1];
aPlatformLibName[0] = '\0';
aPlatformLibName = strncat( aPlatformLibName, theLibName+3, libNameLen-6 );
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
aPlatformLibName[libNameLen - 2] = '\0';
#else
aPlatformLibName = new char[ libNameLen + 1];
aPlatformLibName[0] = '\0';
aPlatformLibName = strcat( aPlatformLibName, theLibName );
aPlatformLibName[libNameLen] = '\0';
aPlatformLibName = new char[ libNameLen + 1];
aPlatformLibName[0] = '\0';
aPlatformLibName = strcat( aPlatformLibName, theLibName );
aPlatformLibName[libNameLen] = '\0';
#endif
}
}
else
{
//try to use new format
{
//try to use new format
#ifdef WNT
aPlatformLibName = new char[ libNameLen + 5 ];
aPlatformLibName[0] = '\0';
aPlatformLibName = strcat( aPlatformLibName, theLibName );
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
aPlatformLibName = new char[ libNameLen + 5 ];
aPlatformLibName[0] = '\0';
aPlatformLibName = strcat( aPlatformLibName, theLibName );
aPlatformLibName = strcat( aPlatformLibName, ".dll" );
#else
aPlatformLibName = new char[ libNameLen + 7 ];
aPlatformLibName[0] = '\0';
aPlatformLibName = strcat( aPlatformLibName, "lib" );
aPlatformLibName = strcat( aPlatformLibName, theLibName );
aPlatformLibName = strcat( aPlatformLibName, ".so" );
aPlatformLibName = new char[ libNameLen + 7 ];
aPlatformLibName[0] = '\0';
aPlatformLibName = strcat( aPlatformLibName, "lib" );
aPlatformLibName = strcat( aPlatformLibName, theLibName );
aPlatformLibName = strcat( aPlatformLibName, ".so" );
#endif
}
}
}
Unexpect aCatch(SALOME_SalomeException);
@ -418,7 +416,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
// create a new hypothesis object, store its ref. in studyContext
if(MYDEBUG) MESSAGE("Create Hypothesis " << theHypName);
myHypothesis_i =
myHypCreatorMap[string(theHypName)]->Create (myPoa, GetCurrentStudyID(), &myGen);
myHypCreatorMap[string(theHypName)]->Create(myPoa, GetCurrentStudyID(), &myGen);
myHypothesis_i->SetLibName(aPlatformLibName/*theLibName*/); // for persistency assurance
}
catch (SALOME_Exception& S_ex)
@ -439,7 +437,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
return hypothesis_i._retn();
}
//=============================================================================
/*!
* SMESH_Gen_i::createMesh
@ -3708,7 +3706,7 @@ int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
*/
//================================================================================
int SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
{
StudyContext* myStudyContext = GetCurrentStudyContext();
if ( myStudyContext && !CORBA::is_nil( theObject )) {

View File

@ -17,7 +17,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
@ -427,7 +427,7 @@ public:
int RegisterObject(CORBA::Object_ptr theObject);
// Return id of registered object
int GetObjectId(CORBA::Object_ptr theObject);
CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
// Return an object that previously had an oldID
template<class TInterface>

View File

@ -34,8 +34,6 @@
#include "SMESH_Group_i.hxx"
#include "SMESH_subMesh_i.hxx"
#include "SMESH.hxx"
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
#include "utilities.h"
@ -59,82 +57,82 @@ static int MYDEBUG = 0;
long SMESH_Gen_i::GetHypothesisRootTag()
{
return Tag_HypothesisRoot;
return SMESH::Tag_HypothesisRoot;
}
long SMESH_Gen_i::GetAlgorithmsRootTag()
{
return Tag_AlgorithmsRoot;
return SMESH::Tag_AlgorithmsRoot;
}
long SMESH_Gen_i::GetRefOnShapeTag()
{
return Tag_RefOnShape;
return SMESH::Tag_RefOnShape;
}
long SMESH_Gen_i::GetRefOnAppliedHypothesisTag()
{
return Tag_RefOnAppliedHypothesis;
return SMESH::Tag_RefOnAppliedHypothesis;
}
long SMESH_Gen_i::GetRefOnAppliedAlgorithmsTag()
{
return Tag_RefOnAppliedAlgorithms;
return SMESH::Tag_RefOnAppliedAlgorithms;
}
long SMESH_Gen_i::GetSubMeshOnVertexTag()
{
return Tag_SubMeshOnVertex;
return SMESH::Tag_SubMeshOnVertex;
}
long SMESH_Gen_i::GetSubMeshOnEdgeTag()
{
return Tag_SubMeshOnEdge;
return SMESH::Tag_SubMeshOnEdge;
}
long SMESH_Gen_i::GetSubMeshOnFaceTag()
{
return Tag_SubMeshOnFace;
return SMESH::Tag_SubMeshOnFace;
}
long SMESH_Gen_i::GetSubMeshOnSolidTag()
{
return Tag_SubMeshOnSolid;
return SMESH::Tag_SubMeshOnSolid;
}
long SMESH_Gen_i::GetSubMeshOnCompoundTag()
{
return Tag_SubMeshOnCompound;
return SMESH::Tag_SubMeshOnCompound;
}
long SMESH_Gen_i::GetSubMeshOnWireTag()
{
return Tag_SubMeshOnWire;
return SMESH::Tag_SubMeshOnWire;
}
long SMESH_Gen_i::GetSubMeshOnShellTag()
{
return Tag_SubMeshOnShell;
return SMESH::Tag_SubMeshOnShell;
}
long SMESH_Gen_i::GetNodeGroupsTag()
{
return Tag_NodeGroups;
return SMESH::Tag_NodeGroups;
}
long SMESH_Gen_i::GetEdgeGroupsTag()
{
return Tag_EdgeGroups;
return SMESH::Tag_EdgeGroups;
}
long SMESH_Gen_i::GetFaceGroupsTag()
{
return Tag_FaceGroups;
return SMESH::Tag_FaceGroups;
}
long SMESH_Gen_i::GetVolumeGroupsTag()
{
return Tag_VolumeGroups;
return SMESH::Tag_VolumeGroups;
}
//=============================================================================

File diff suppressed because it is too large Load Diff