-// Copyright (C) 2007-2015 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
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i" );
myBaseImpl = new ::HYBRIDPlugin_Hypothesis (theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
//=======================================================================
HYBRIDPlugin_Hypothesis_i::~HYBRIDPlugin_Hypothesis_i()
{
- MESSAGE( "HYBRIDPlugin_Hypothesis_i::~HYBRIDPlugin_Hypothesis_i" );
}
//=======================================================================
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();
+}
+
//=======================================================================
//function : SetToMeshHoles
//=======================================================================
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 << "' )";
}
//=======================================================================
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() );
}
//=======================================================================
::HYBRIDPlugin_Hypothesis::ElementGeneration l =
(::HYBRIDPlugin_Hypothesis::ElementGeneration) level;
if ( l < ::HYBRIDPlugin_Hypothesis::Generation_Tetra_Dominant ||
- l > ::HYBRIDPlugin_Hypothesis::Generation_Hexa_Dominant )
+ l > ::HYBRIDPlugin_Hypothesis::Generation_Cartesian_Core )
THROW_SALOME_CORBA_EXCEPTION( "Invalid ElementGeneration mode",SALOME::BAD_PARAM );
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
//=======================================================================
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);
}
return false;
measureOp->PointCoordinates (theVertex, x, y, z);
- MESSAGE("Point coordinates from measureOp: " << x << ", " << y << ", " << z);
}
std::string theVertexName = theVertex->GetName();
- MESSAGE("IDL : SetEnforcedVertexGeom( "<< theVertexEntry << ", " << size<< ")");
return p_SetEnforcedVertex(size, x, y, z, theVertexName.c_str(), theVertexEntry.c_str(), "", isCompound);
}
return false;
measureOp->PointCoordinates (theVertex, x, y, z);
- MESSAGE("Point coordinates from measureOp: " << x << ", " << y << ", " << z);
}
std::string theVertexName = theVertex->GetName();
- MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theVertexEntry << ", " << size<< ", " << theGroupName << ")");
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;
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");
}
}
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)
this->GetImpl()->SetEnforcedVertex(theVertexName, theVertexEntry, theGroupName, size, x, y, z, isCompound);
- MESSAGE("IDL : SetEnforcedVertexEntry END");
return newValue;
}
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 (CORBA::ULong 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";
}
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 && theGroupName[0]) {
}
else if (theGroupOnGeom_i)// && types->length() == 1 && types[0] == theType)
{
- MESSAGE("The source is a group on geom")
try {
bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
if (theGroupName && theGroupName[0]) {