-// Copyright (C) 2004-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
//
// 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.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : HYBRIDPlugin_Hypothesis_i.cxx
-// Created : Wed Apr 2 13:53:01 2008
-// Author : Edward AGAPOV (eap)
+// ---
+// File : HYBRIDPlugin_Hypothesis_i.cxx
+// Author : Christian VAN WAMBEKE (CEA)
+// ---
//
#include "HYBRIDPlugin_Hypothesis_i.hxx"
//=======================================================================
//function : HYBRIDPlugin_Hypothesis_i
//=======================================================================
-
HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i" );
myBaseImpl = new ::HYBRIDPlugin_Hypothesis (theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
//=======================================================================
//function : ~HYBRIDPlugin_Hypothesis_i
//=======================================================================
-
HYBRIDPlugin_Hypothesis_i::~HYBRIDPlugin_Hypothesis_i()
{
- MESSAGE( "HYBRIDPlugin_Hypothesis_i::~HYBRIDPlugin_Hypothesis_i" );
+}
+
+//=======================================================================
+//function : SetLayersOnAllWrap
+//=======================================================================
+
+void HYBRIDPlugin_Hypothesis_i::SetLayersOnAllWrap(CORBA::Boolean toMesh)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetLayersOnAllWrap(toMesh);
+ SMESH::TPythonDump() << _this() << ".SetLayersOnAllWrap( " << toMesh << " )";
+}
+
+//=======================================================================
+//function : GetLayersOnAllWrap
+//=======================================================================
+
+CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetLayersOnAllWrap()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetLayersOnAllWrap();
+}
+
+//=======================================================================
+//function : SetFacesWithLayers
+//=======================================================================
+
+void HYBRIDPlugin_Hypothesis_i::SetFacesWithLayers(const ::SMESH::long_array& theVal)
+{
+ std::vector<int> ids( theVal.length() );
+ for ( size_t i = 0; i < ids.size(); ++i )
+ ids[i] = theVal[i];
+
+ bool valueChanged = this->GetImpl()->SetFacesWithLayers(ids);
+ if (valueChanged)
+ SMESH::TPythonDump() << _this() << ".SetFacesWithLayers( "<< theVal << " )";
+}
+
+//=======================================================================
+//function : GetFacesWithLayers
+//=======================================================================
+
+SMESH::long_array* HYBRIDPlugin_Hypothesis_i::GetFacesWithLayers()
+{
+ const std::vector<int>& idsVec = this->GetImpl()->GetFacesWithLayers();
+ SMESH::long_array_var ids = new SMESH::long_array;
+ ids->length( idsVec.size() );
+ for ( size_t i = 0; i < idsVec.size(); ++i )
+ ids[i] = idsVec[i];
+ return ids._retn();
+}
+
+//=======================================================================
+//function : SetFacesWithImprinting
+//=======================================================================
+
+void HYBRIDPlugin_Hypothesis_i::SetFacesWithImprinting(const ::SMESH::long_array& theVal)
+{
+ std::vector<int> ids( theVal.length() );
+ for ( size_t i = 0; i < ids.size(); ++i )
+ ids[i] = theVal[i];
+
+ bool valueChanged = this->GetImpl()->SetFacesWithImprinting(ids);
+ if (valueChanged)
+ SMESH::TPythonDump() << _this() << ".SetFacesWithImprinting( "<< theVal << " )";
+}
+
+//=======================================================================
+//function : GetFacesWithImprinting
+//=======================================================================
+
+SMESH::long_array* HYBRIDPlugin_Hypothesis_i::GetFacesWithImprinting()
+{
+ const std::vector<int>& idsVec = this->GetImpl()->GetFacesWithImprinting();
+ SMESH::long_array_var ids = new SMESH::long_array;
+ ids->length( idsVec.size() );
+ for ( size_t i = 0; i < idsVec.size(); ++i )
+ ids[i] = idsVec[i];
+ return ids._retn();
}
//=======================================================================
return this->GetImpl()->GetOptimizationLevel();
}
+
//=======================================================================
-//function : SetWorkingDirectory
+//function : SetCollisionMode
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetCollisionMode(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
+{
+ ::HYBRIDPlugin_Hypothesis::CollisionMode l =
+ (::HYBRIDPlugin_Hypothesis::CollisionMode) level;
+ if ( l < ::HYBRIDPlugin_Hypothesis::Decrease ||
+ l > ::HYBRIDPlugin_Hypothesis::Stop )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid collision mode",SALOME::BAD_PARAM );
+
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetCollisionMode(l);
+ SMESH::TPythonDump() << _this() << ".SetCollisionMode( " << level << " )";
+}
+
+//=======================================================================
+//function : GetCollisionMode
//=======================================================================
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetCollisionMode()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetCollisionMode();
+}
+//=======================================================================
+//function : SetWorkingDirectory
+//=======================================================================
void HYBRIDPlugin_Hypothesis_i::SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception )
{
if (!path )
THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM );
- string file(path);
+ std::string file(path);
const char lastChar = *file.rbegin();
#ifdef WIN32
if ( lastChar != '\\' ) file += '\\';
//=======================================================================
//function : GetWorkingDirectory
//=======================================================================
-
char* HYBRIDPlugin_Hypothesis_i::GetWorkingDirectory()
{
ASSERT(myBaseImpl);
//=======================================================================
//function : SetKeepFiles
//=======================================================================
-
void HYBRIDPlugin_Hypothesis_i::SetKeepFiles(CORBA::Boolean toKeep)
{
ASSERT(myBaseImpl);
//=======================================================================
//function : GetKeepFiles
//=======================================================================
-
CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetKeepFiles()
{
ASSERT(myBaseImpl);
//=======================================================================
//function : SetVerboseLevel
//=======================================================================
-
void HYBRIDPlugin_Hypothesis_i::SetVerboseLevel(CORBA::Short level)
throw ( SALOME::SALOME_Exception )
{
//=======================================================================
//function : GetVerboseLevel
//=======================================================================
-
CORBA::Short HYBRIDPlugin_Hypothesis_i::GetVerboseLevel()
{
ASSERT(myBaseImpl);
//=======================================================================
//function : SetTextOption
//=======================================================================
-
void HYBRIDPlugin_Hypothesis_i::SetTextOption(const char* option)
{
ASSERT(myBaseImpl);
- this->GetImpl()->SetTextOption(option);
- SMESH::TPythonDump() << _this() << ".SetTextOption( '" << option << "' )";
+ this->GetImpl()->SetAdvancedOption(option);
+ SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << option << "' )";
}
//=======================================================================
//function : GetTextOption
//=======================================================================
-
char* HYBRIDPlugin_Hypothesis_i::GetTextOption()
{
ASSERT(myBaseImpl);
- return CORBA::string_dup( this->GetImpl()->GetTextOption().c_str() );
+ return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
+}
+
+//=======================================================================
+//function : SetAdvancedOption
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetAdvancedOption(const char* theOptAndVals )
+{
+ if ( theOptAndVals && GetImpl()->GetAdvancedOption() != theOptAndVals )
+ {
+ GetImpl()->SetAdvancedOption( theOptAndVals );
+ SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptAndVals << "' )";
+ }
+}
+
+//=======================================================================
+//function : GetAdvancedOption
+//=======================================================================
+char* HYBRIDPlugin_Hypothesis_i::GetAdvancedOption()
+{
+ return CORBA::string_dup( GetImpl()->GetAdvancedOption().c_str() );
}
//=======================================================================
//=======================================================================
//function : SetStandardOutputLog
//=======================================================================
-
void HYBRIDPlugin_Hypothesis_i::SetStandardOutputLog(CORBA::Boolean logInStandardOutput)
{
ASSERT(myBaseImpl);
//=======================================================================
//function : GetStandardOutputLog
//=======================================================================
-
CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetStandardOutputLog()
{
ASSERT(myBaseImpl);
//=======================================================================
//function : SetRemoveLogOnSuccess
//=======================================================================
-
void HYBRIDPlugin_Hypothesis_i::SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess)
{
ASSERT(myBaseImpl);
//=======================================================================
//function : GetRemoveLogOnSuccess
//=======================================================================
-
CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetRemoveLogOnSuccess()
{
ASSERT(myBaseImpl);
return this->GetImpl()->GetRemoveLogOnSuccess();
}
+//=======================================================================
+//function : SetBoundaryLayersGrowth
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetBoundaryLayersGrowth(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
+{
+ ::HYBRIDPlugin_Hypothesis::BoundaryLayersGrowth l =
+ (::HYBRIDPlugin_Hypothesis::BoundaryLayersGrowth) level;
+ if ( l < ::HYBRIDPlugin_Hypothesis::Layer_Growth_Inward ||
+ l > ::HYBRIDPlugin_Hypothesis::Layer_Growth_Outward )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid BoundaryLayersGrowth mode",SALOME::BAD_PARAM );
+
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetBoundaryLayersGrowth(l);
+ SMESH::TPythonDump() << _this() << ".SetBoundaryLayersGrowth( " << level << " )";
+}
+
+//=======================================================================
+//function : GetBoundaryLayersGrowth
+//=======================================================================
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetBoundaryLayersGrowth()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetBoundaryLayersGrowth();
+}
+
+//=======================================================================
+//function : SetElementGeneration
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetElementGeneration(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
+{
+ ::HYBRIDPlugin_Hypothesis::ElementGeneration l =
+ (::HYBRIDPlugin_Hypothesis::ElementGeneration) level;
+ if ( l < ::HYBRIDPlugin_Hypothesis::Generation_Tetra_Dominant ||
+ l > ::HYBRIDPlugin_Hypothesis::Generation_Cartesian_Core )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid ElementGeneration mode",SALOME::BAD_PARAM );
+
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetElementGeneration(l);
+ SMESH::TPythonDump() << _this() << ".SetElementGeneration( " << level << " )";
+}
+
+//=======================================================================
+//function : GetElementGeneration
+//=======================================================================
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetElementGeneration()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetElementGeneration();
+}
+
+//=======================================================================
+//function : SetAddMultinormals
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetAddMultinormals(CORBA::Boolean toAddMultinormals)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetAddMultinormals(toAddMultinormals);
+ SMESH::TPythonDump() << _this() << ".SetAddMultinormals( " << toAddMultinormals << " )";
+}
+
+//=======================================================================
+//function : GetAddMultinormals
+//=======================================================================
+CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetAddMultinormals()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetAddMultinormals();
+}
+
+//=======================================================================
+//function : SetSmoothNormals
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetSmoothNormals(CORBA::Boolean toSmoothNormals)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetSmoothNormals(toSmoothNormals);
+ SMESH::TPythonDump() << _this() << ".SetSmoothNormals( " << toSmoothNormals << " )";
+}
+
+//=======================================================================
+//function : GetSmoothNormals
+//=======================================================================
+CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetSmoothNormals()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetSmoothNormals();
+}
+
+//=======================================================================
+//function : SetHeightFirstLayer
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetHeightFirstLayer(CORBA::Double toHeightFirstLayer)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetHeightFirstLayer(toHeightFirstLayer);
+ SMESH::TPythonDump() << _this() << ".SetHeightFirstLayer( " << toHeightFirstLayer << " )";
+}
+
+//=======================================================================
+//function : GetHeightFirstLayer
+//=======================================================================
+CORBA::Double HYBRIDPlugin_Hypothesis_i::GetHeightFirstLayer()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetHeightFirstLayer();
+}
+
+//=======================================================================
+//function : SetBoundaryLayersProgression
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetBoundaryLayersProgression(toBoundaryLayersProgression);
+ SMESH::TPythonDump() << _this() << ".SetBoundaryLayersProgression( " << toBoundaryLayersProgression << " )";
+}
+
+//=======================================================================
+//function : GetBoundaryLayersProgression
+//=======================================================================
+CORBA::Double HYBRIDPlugin_Hypothesis_i::GetBoundaryLayersProgression()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetBoundaryLayersProgression();
+}
+
+//=======================================================================
+//function : SetCoreSize
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetCoreSize(CORBA::Double toCoreSize)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetCoreSize(toCoreSize);
+ SMESH::TPythonDump() << _this() << ".SetCoreSize( " << toCoreSize << " )";
+}
+
+//=======================================================================
+//function : GetCoreSize
+//=======================================================================
+CORBA::Double HYBRIDPlugin_Hypothesis_i::GetCoreSize()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetCoreSize();
+}
+
+//=======================================================================
+//function : SetMultinormalsAngle
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetMultinormalsAngle(CORBA::Double toMultinormalsAngle)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetMultinormalsAngle(toMultinormalsAngle);
+ SMESH::TPythonDump() << _this() << ".SetMultinormalsAngle( " << toMultinormalsAngle << " )";
+}
+
+//=======================================================================
+//function : GetMultinormalsAngle
+//=======================================================================
+CORBA::Double HYBRIDPlugin_Hypothesis_i::GetMultinormalsAngle()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetMultinormalsAngle();
+}
+
+//=======================================================================
+//function : SetNbOfBoundaryLayers
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetNbOfBoundaryLayers(toNbOfBoundaryLayers);
+ SMESH::TPythonDump() << _this() << ".SetNbOfBoundaryLayers( " << toNbOfBoundaryLayers << " )";
+}
+
+//=======================================================================
+//function : GetNbOfBoundaryLayers
+//=======================================================================
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetNbOfBoundaryLayers()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetNbOfBoundaryLayers();
+}
+
//=======================================================================
//function : SetEnforcedVertex
//=======================================================================
bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size)
throw (SALOME::SALOME_Exception) {
ASSERT(myBaseImpl);
- MESSAGE("IDL : SetEnforcedVertex( "<< x << ", " << y << ", " << z << ", " << size << ")");
return p_SetEnforcedVertex(size, x, y, z);
}
bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName)
throw (SALOME::SALOME_Exception) {
ASSERT(myBaseImpl);
- MESSAGE("IDL : SetEnforcedVertexNamed( "<< x << ", " << y << ", " << z << ", " << size << ", " << theVertexName << ")");
return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", "");
}
bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName)
throw (SALOME::SALOME_Exception) {
ASSERT(myBaseImpl);
- MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< x << ", " << y << ", " << z << ", " << size << ", " << theGroupName << ")");
return p_SetEnforcedVertex(size, x, y, z, "", "", theGroupName);
}
bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName)
throw (SALOME::SALOME_Exception) {
ASSERT(myBaseImpl);
- MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< x << ", " << y << ", " << z << ", " << size << ", " << theVertexName << ", " << theGroupName << ")");
return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", theGroupName);
}
ASSERT(myBaseImpl);
if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
- MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
}
- string theVertexEntry = theVertex->GetStudyEntry();
+ std::string theVertexEntry = theVertex->GetStudyEntry();
CORBA::Double x = 0, y = 0, z = 0;
CORBA::Boolean isCompound = false;
GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
if (theVertexEntry.empty()) {
- string aName;
+ std::string aName;
if (theVertex->GetShapeType() == GEOM::VERTEX) {
aName = "Vertex_";
}
return false;
measureOp->PointCoordinates (theVertex, x, y, z);
- MESSAGE("Point coordinates from measureOp: " << x << ", " << y << ", " << z);
}
- string theVertexName = theVertex->GetName();
- MESSAGE("IDL : SetEnforcedVertexGeom( "<< theVertexEntry << ", " << size<< ")");
+ std::string theVertexName = theVertex->GetName();
return p_SetEnforcedVertex(size, x, y, z, theVertexName.c_str(), theVertexEntry.c_str(), "", isCompound);
}
THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
}
- string theVertexEntry = theVertex->GetStudyEntry();
+ std::string theVertexEntry = theVertex->GetStudyEntry();
CORBA::Double x = 0, y = 0, z = 0;
CORBA::Boolean isCompound = false;
GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
if (theVertexEntry.empty()) {
- string aName;
+ std::string aName;
if (theVertex->GetShapeType() == GEOM::VERTEX) {
aName = "Vertex_";
}
return false;
measureOp->PointCoordinates (theVertex, x, y, z);
- MESSAGE("Point coordinates from measureOp: " << x << ", " << y << ", " << z);
}
- string theVertexName = theVertex->GetName();
- MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theVertexEntry << ", " << size<< ", " << theGroupName << ")");
+ std::string theVertexName = theVertex->GetName();
return p_SetEnforcedVertex(size, x, y, z, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName, isCompound);
}
CORBA::Boolean isCompound)
throw (SALOME::SALOME_Exception) {
ASSERT(myBaseImpl);
- MESSAGE("IDL : p_SetEnforcedVertex(" << size << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\", " << isCompound<< ")");
bool newValue = false;
::HYBRIDPlugin_Hypothesis::TCoordsHYBRIDEnforcedVertexMap coordsList;
::HYBRIDPlugin_Hypothesis::TGeomEntryHYBRIDEnforcedVertexMap enfVertexEntryList;
- if (string(theVertexEntry).empty()) {
+ if (std::string(theVertexEntry).empty()) {
coordsList = this->GetImpl()->_GetEnforcedVerticesByCoords();
std::vector<double> coords;
coords.push_back(x);
coords.push_back(y);
coords.push_back(z);
if (coordsList.find(coords) == coordsList.end()) {
- MESSAGE("Coords not found: add it in coordsList");
newValue = true;
}
else {
- MESSAGE("Coords already found, compare names");
::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex *enfVertex = this->GetImpl()->GetEnforcedVertex(x, y, z);
if ((enfVertex->name != theVertexName) || (enfVertex->groupName != theGroupName) || (enfVertex->size != size)) {
- MESSAGE("The names or size are different: update");
// this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
newValue = true;
}
else {
- MESSAGE("The names and size are identical");
}
}
if (newValue) {
- if (string(theVertexName).empty()) {
- if (string(theGroupName).empty())
+ if (std::string(theVertexName).empty()) {
+ if (std::string(theGroupName).empty())
SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertex(" << x << ", " << y << ", " << z << ", " << size << ")";
else
SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexWithGroup(" << x << ", " << y << ", " << z << ", " << size << ", \"" << theGroupName << "\")";
}
else {
- if (string(theGroupName).empty())
+ if (std::string(theGroupName).empty())
SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexNamed(" << x << ", " << y << ", " << z << ", " << size << ", \"" << theVertexName << "\")";
else
SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexNamedWithGroup(" << x << ", " << y << ", " << z << ", " << size << ", \"" << theVertexName << "\", \"" << theGroupName << "\")";
}
}
else {
-// if (isCompound || (!isCompound && !string(theVertexEntry).empty())) {
+// if (isCompound || (!isCompound && !std::string(theVertexEntry).empty())) {
enfVertexEntryList = this->GetImpl()->_GetEnforcedVerticesByEntry();
// ::BLSURFPlugin_Hypothesis::TGeomEntryHYBRIDEnforcedVertexMap::const_iterator it = enfVertexEntryList.find(theVertexEntry);
if ( enfVertexEntryList.find(theVertexEntry) == enfVertexEntryList.end()) {
- MESSAGE("Geom entry not found: add it in enfVertexEntryList");
newValue = true;
}
else {
- MESSAGE("Geom entry already found, compare names");
::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex *enfVertex = this->GetImpl()->GetEnforcedVertex(theVertexEntry);
if ((enfVertex->name != theVertexName) || (enfVertex->groupName != theGroupName) || (enfVertex->size != size)) {
- MESSAGE("The names or size are different: update");
// this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
newValue = true;
}
else {
- MESSAGE("The names and size are identical");
}
}
if (newValue) {
- if (string(theGroupName).empty())
+ if (std::string(theGroupName).empty())
SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexGeom(" << theVertexEntry << ", " << size << ")";
else
SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexGeomWithGroup(" << theVertexEntry << ", " << size << ", \"" << theGroupName << "\")";
if (newValue)
this->GetImpl()->SetEnforcedVertex(theVertexName, theVertexEntry, theGroupName, size, x, y, z, isCompound);
- MESSAGE("IDL : SetEnforcedVertexEntry END");
return newValue;
}
THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
}
- string theVertexEntry = theVertex->GetStudyEntry();
+ std::string theVertexEntry = theVertex->GetStudyEntry();
if (theVertexEntry.empty()) {
GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
- string aName;
+ std::string aName;
if (theVertex->GetShapeType() == GEOM::VERTEX)
aName = "Vertex_";
if (theVertex->GetShapeType() == GEOM::COMPOUND)
if (theVertexEntry.empty())
THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
- string theVertexName = theVertex->GetName();
+ std::string theVertexName = theVertex->GetName();
try {
bool isDone = this->GetImpl()->GetEnforcedVertex(theVertexName)->size;
// Coords
HYBRIDPlugin::TCoords_var coords = new HYBRIDPlugin::TCoords();
coords->length(currentVertex->coords.size());
- for (int ind = 0; ind < currentVertex->coords.size(); ind++)
+ for (size_t ind = 0; ind < currentVertex->coords.size(); ind++)
coords[ind] = currentVertex->coords[ind];
enfVertex->coords = coords;
// Group Name
THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
}
- string theVertexEntry = theVertex->GetStudyEntry();
+ std::string theVertexEntry = theVertex->GetStudyEntry();
if (theVertexEntry.empty()) {
GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
- string aName;
+ std::string aName;
if (theVertex->GetShapeType() == GEOM::VERTEX)
aName = "Vertex_";
if (theVertex->GetShapeType() == GEOM::COMPOUND)
bool HYBRIDPlugin_Hypothesis_i::SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType)
throw (SALOME::SALOME_Exception)
{
-// MESSAGE("HYBRIDPlugin_Hypothesis_i::SetEnforcedMesh");
// #if HYBRID_VERSION >= 42
return p_SetEnforcedMesh(theSource, theType);
// #else
bool HYBRIDPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, const char* theName, const char* theGroupName)
throw (SALOME::SALOME_Exception)
{
- MESSAGE("HYBRIDPlugin_Hypothesis_i::p_SetEnforcedMesh");
ASSERT(myBaseImpl);
if (CORBA::is_nil( theSource ))
switch (theType) {
case SMESH::NODE:
- MESSAGE("Required type is NODE");
break;
case SMESH::EDGE:
- MESSAGE("Required type is EDGE");
break;
case SMESH::FACE:
- MESSAGE("Required type is FACE");
break;
default:
- MESSAGE("Incompatible required type: " << theType);
- return false;
+ return false;
}
-// MESSAGE("Required type is "<<theType);
SMESH::array_of_ElementType_var types = theSource->GetTypes();
- MESSAGE("Available types:");
- for (int i=0;i<types->length();i++){MESSAGE(types[i]);}
if ( types->length() >= 1 && types[types->length()-1] < theType)
{
- MESSAGE("Required type not available");
return false;
// SALOME::ExceptionStruct ExDescription;
// ExDescription.text = "The source mesh has bad type";
// ExDescription.lineNumber = 840;
// throw SALOME::SALOME_Exception(ExDescription);
}
-
+
SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::SObject_ptr SObj = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(),theSource);
SMESH_Group_i* theGroup_i = SMESH::DownCast<SMESH_Group_i*>( theSource);
SMESH_GroupOnGeom_i* theGroupOnGeom_i = SMESH::DownCast<SMESH_GroupOnGeom_i*>( theSource);
- string enfMeshName = theName;
+ std::string enfMeshName = theName;
if (enfMeshName.empty())
- enfMeshName = SObj->GetName();
+ enfMeshName = SObj->GetName();
if (theMesh_i)
{
try {
- bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName);
- if (theGroupName != "") {
- SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
- << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )";
- }
- else {
- SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
- << theSource << ".GetMesh(), " << theType << " )";
- }
+ bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName);
+ if (theGroupName && theGroupName[0]) {
+ SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
+ << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )";
+ }
+ else {
+ SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
+ << theSource << ".GetMesh(), " << theType << " )";
+ }
return res;
}
}
else if (theGroup_i)// && types->length() == 1 && types[0] == theType)
{
- MESSAGE("The source is a group")
try {
bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
- if (theGroupName != "") {
+ if (theGroupName && theGroupName[0]) {
SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
<< theSource << ", " << theType << ", \"" << theGroupName << "\" )";
}
}
else if (theGroupOnGeom_i)// && types->length() == 1 && types[0] == theType)
{
- MESSAGE("The source is a group on geom")
- try {
+ try {
bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
- if (theGroupName != "") {
- SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
+ if (theGroupName && theGroupName[0]) {
+ SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
<< theSource << ", " << theType << ", \"" << theGroupName << "\" )";
}
else {
- SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
+ SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
<< theSource << ", " << theType << " )";
}
- return res;
- }
- catch (const std::invalid_argument& ex) {
- SALOME::ExceptionStruct ExDescription;
+ return res;
+ }
+ catch (const std::invalid_argument& ex) {
+ SALOME::ExceptionStruct ExDescription;
ExDescription.text = ex.what();
ExDescription.type = SALOME::BAD_PARAM;
ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";