-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <GEOM_SelectionFilter.h>
#include <GEOMBase.h>
#include <GeometryGUI.h>
+#include <GEOM_wrap.hxx>
// SALOME GUI includes
#include <SalomeApp_Tools.h>
// SALOME KERNEL includes
#include <SALOMEDS_SComponent.hxx>
#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_Study.hxx>
+#include <SALOMEDS_wrap.hxx>
// Qt includes
#include <QStringList>
return new GEOM_SelectionFilter( (SalomeApp_Study*)study(), true );
}
else if ( theId == SMESHGUI_MeshDlg::Obj && !myToCreate )
- return new SMESH_TypeFilter( MESHorSUBMESH );
+ return new SMESH_TypeFilter( SMESH::MESHorSUBMESH );
else if ( theId == SMESHGUI_MeshDlg::Mesh )
- return new SMESH_TypeFilter( MESH );
+ return new SMESH_TypeFilter( SMESH::MESH );
else
return 0;
}
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if (geomGen->_is_nil() || !aStudy) return false;
- GEOM::GEOM_IGroupOperations_var op =
- geomGen->GetIGroupOperations(aStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
if (op->_is_nil()) return false;
// check all selected shapes
if (aSubGeomVar->_is_nil()) return false;
// skl for NPAL14695 - implementation of searching of mainObj
- GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar);
- //if (mainObj->_is_nil() ||
- // string(mainObj->GetEntry()) != string(mainGeom->GetEntry())) return false;
+ GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); /* _var not _wrap as
+ mainObj already exists! */
while(1) {
if (mainObj->_is_nil())
return false;
- if (std::string(mainObj->GetEntry()) == std::string(mainGeom->GetEntry()))
+ CORBA::String_var entry1 = mainObj->GetEntry();
+ CORBA::String_var entry2 = mainGeom->GetEntry();
+ if (std::string( entry1.in() ) == entry2.in() )
return true;
mainObj = op->GetMainShape(mainObj);
}
}
- //return true;
}
return false;
SMESH::SMESH_Hypothesis_var aHypVar = SMESH::SMESH_Hypothesis::_narrow( aVar );
if ( !aHypVar->_is_nil() )
{
- HypothesisData* aData = SMESH::GetHypothesisData( aHypVar->GetName() );
+ CORBA::String_var hypType = aHypVar->GetName();
+ HypothesisData* aData = SMESH::GetHypothesisData( hypType.in() );
if ( !aData) continue;
if ( ( theDim == -1 || aData->Dim.contains( theDim ) ) &&
( isCompatible ( theAlgoData, aData, theHypType )) &&
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if (!geomGen->_is_nil() && aStudy) {
- GEOM::GEOM_IGroupOperations_var op =
+ GEOM::GEOM_IGroupOperations_wrap op =
geomGen->GetIGroupOperations(aStudy->StudyId());
if (!op->_is_nil()) {
// check and add all selected GEOM objects: they must be
aSeq[iSubSh] = aSubGeomVar;
}
// create a group
- GEOM::GEOM_Object_var aGroupVar = op->CreateGroup(mainGeom, aGroupType);
+ GEOM::GEOM_Object_wrap aGroupVar = op->CreateGroup(mainGeom, aGroupType);
op->UnionList(aGroupVar, aSeq);
if (op->IsDone()) {
- aGeomVar = aGroupVar;
+ aGeomVar = aGroupVar.in();
// publish the GEOM group in study
QString aNewGeomGroupName ("Auto_group_for_");
aNewGeomGroupName += aName;
- SALOMEDS::SObject_var aNewGroupSO =
- geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar,
- aNewGeomGroupName.toLatin1().data(), mainGeom);
+ SALOMEDS::Study_var aStudyVar = _CAST(Study, aStudy)->GetStudy();
+ SALOMEDS::SObject_wrap aNewGroupSO =
+ geomGen->AddInStudy( aStudyVar, aGeomVar,
+ aNewGeomGroupName.toLatin1().data(), mainGeom);
}
}
}
//================================================================================
/*!
- * \brief Reads parameters of edited mesh and assigns them to the dialog
+ * \brief Reads parameters of an edited mesh and assigns them to the dialog
*
- * Reads parameters of edited mesh and assigns them to the dialog (called when
- * mesh is edited only)
+ * Called when mesh is edited only.
*/
//================================================================================
void SMESHGUI_MeshOp::readMesh()
// Get hypotheses and algorithms assigned to the mesh/sub-mesh
QStringList anExisting;
- const int aDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_3D;
- for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ )
+ const int lastDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_3D;
+ for ( int dim = SMESH::DIM_3D; dim >= lastDim; --dim )
{
// get algorithm
existingHyps( dim, Algo, pObj, anExisting, myObjHyps[ dim ][ Algo ] );
// get hypotheses
bool hypWithoutAlgo = false;
- for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ )
+ for ( int dim = SMESH::DIM_3D; dim >= lastDim; --dim )
{
for ( int hypType = MainHyp; hypType <= AddHyp; hypType++ )
{