-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015 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
* HexoticPlugin_Hypothesis_i::SetHexoticSdMode
* HexoticPlugin_Hypothesis_i::SetVerbosity
* HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory
+ * HexoticPlugin_Hypothesis_i::SetTextOptions
+ * HexoticPlugin_Hypothesis_i::SetNbLayers
+ * HexoticPlugin_Hypothesis_i::SetFirstLayerSize
+ * HexoticPlugin_Hypothesis_i::SetDirection
+ * HexoticPlugin_Hypothesis_i::SetGrowth
+ * HexoticPlugin_Hypothesis_i::SetFacesWithLayers
+ * HexoticPlugin_Hypothesis_i::SetImprintedFaces
*/
//=============================================================================
THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM );
ASSERT(myBaseImpl);
- string file(path);
- string oldValue(GetHexoticWorkingDirectory());
+ std::string file(path);
+ std::string oldValue(GetHexoticWorkingDirectory());
bool doDump = false;
if (oldValue != file)
doDump = true;
SMESH::TPythonDump() << _this() << ".SetHexoticMaxMemory( " << theValue << " )";
}
+void HexoticPlugin_Hypothesis_i::SetTextOptions(const char* theOptions)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetTextOptions");
+ ASSERT(myBaseImpl);
+ std::string oldValue(GetTextOptions());
+ this->GetImpl()->SetTextOptions(theOptions);
+ if (theOptions != oldValue)
+ SMESH::TPythonDump() << _this() << ".SetTextOptions( '" << theOptions << "' )";
+}
+
+HexoticPlugin::HexoticPluginSizeMapsList* HexoticPlugin_Hypothesis_i::GetSizeMaps ()
+{
+ // Get the std::map < std::string entry, double size >
+ HexoticPlugin::HexoticPluginSizeMapsList_var result = new HexoticPlugin::HexoticPluginSizeMapsList();
+ const ::HexoticPlugin_Hypothesis::THexoticSizeMaps sizeMaps = this->GetImpl()->GetSizeMaps();
+ result->length( sizeMaps.size() );
+
+ // Write the content into a CORBA sequence of struct{ entry=anEntry; size=aSize; }
+ ::HexoticPlugin_Hypothesis::THexoticSizeMaps::const_iterator it = sizeMaps.begin();
+ for ( int i = 0; it != sizeMaps.end(); i++, it++ )
+ {
+ HexoticPlugin::HexoticPluginSizeMap_var aSizeMap = new HexoticPlugin::HexoticPluginSizeMap();
+ aSizeMap->entry = CORBA::string_dup( it->first.c_str() );
+ aSizeMap->size = it->second;
+ result[i] = aSizeMap;
+ }
+ return result._retn();
+}
+
+void HexoticPlugin_Hypothesis_i::SetSizeMapEntry ( const char* theEntry, CORBA::Double theSize )
+{
+// MESSAGE("HexoticPlugin_Hypothesis_i::SetSizeMapEntry");
+ bool valueChanged = this->GetImpl()->AddSizeMap(theEntry, theSize);
+ if (valueChanged)
+ SMESH::TPythonDump() << _this() << ".SetSizeMap( "<< theEntry << ", " << theSize << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::UnsetSizeMapEntry ( const char* theEntry )
+{
+// MESSAGE("HexoticPlugin_Hypothesis_i::UnsetSizeMapEntry");
+ bool entryRemoved = this->GetImpl()->UnsetSizeMap(theEntry);
+ if (entryRemoved)
+ SMESH::TPythonDump() << _this() << ".UnsetSizeMap( "<< theEntry << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetSizeMap (const GEOM::GEOM_Object_ptr theGeomObj, const double theSize)
+{
+// MESSAGE("HexoticPlugin_Hypothesis_i::SetSizeMap");
+ ASSERT(myBaseImpl);
+ std::string entry = theGeomObj->GetStudyEntry();
+ SetSizeMapEntry( entry.c_str(), theSize);
+}
+
+void HexoticPlugin_Hypothesis_i::UnsetSizeMap (const GEOM::GEOM_Object_ptr theGeomObj)
+{
+// MESSAGE("HexoticPlugin_Hypothesis_i::UnsetSizeMap");
+ ASSERT(myBaseImpl);
+ std::string entry = theGeomObj->GetStudyEntry();
+ UnsetSizeMapEntry( entry.c_str());
+}
+
+void HexoticPlugin_Hypothesis_i::SetNbLayers(CORBA::Long theVal)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetNbLayers");
+ ASSERT(myBaseImpl);
+ CORBA::Long oldValue = GetNbLayers();
+ this->GetImpl()->SetNbLayers(theVal);
+ if (theVal != oldValue)
+ SMESH::TPythonDump() << _this() << ".SetNbLayers( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetFirstLayerSize(CORBA::Double theVal)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetFirstLayerSize");
+ ASSERT(myBaseImpl);
+ CORBA::Double oldValue = GetFirstLayerSize();
+ this->GetImpl()->SetFirstLayerSize(theVal);
+ if (theVal != oldValue)
+ SMESH::TPythonDump() << _this() << ".SetFirstLayerSize( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetDirection(CORBA::Boolean theVal)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetDirection");
+ ASSERT(myBaseImpl);
+ CORBA::Boolean oldValue = GetDirection();
+ this->GetImpl()->SetDirection(theVal);
+ if (theVal != oldValue)
+ SMESH::TPythonDump() << _this() << ".SetDirection( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetGrowth(CORBA::Double theVal)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetGrowth");
+ ASSERT(myBaseImpl);
+ CORBA::Double oldValue = GetGrowth();
+ this->GetImpl()->SetGrowth(theVal);
+ if (theVal != oldValue)
+ SMESH::TPythonDump() << _this() << ".SetGrowth( " << theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetFacesWithLayers(const ::SMESH::long_array& theVal)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetFacesWithLayers");
+ std::vector<int> ids( theVal.length() );
+ for ( unsigned i = 0; i < ids.size(); ++i )
+ ids[i] = theVal[i];
+
+ bool valueChanged = this->GetImpl()->SetFacesWithLayers(ids);
+ if (valueChanged)
+ SMESH::TPythonDump() << _this() << ".SetFacesWithLayers( "<< theVal << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetImprintedFaces(const ::SMESH::long_array& theVal)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetImprintedFaces");
+ std::vector<int> ids( theVal.length() );
+ for ( unsigned i = 0; i < ids.size(); ++i )
+ ids[i] = theVal[i];
+
+ bool valueChanged = this->GetImpl()->SetImprintedFaces(ids);
+ if (valueChanged)
+ SMESH::TPythonDump() << _this() << ".SetImprintedFaces( "<< theVal << " )";
+}
+
//=============================================================================
/*!
* HexoticPlugin_Hypothesis_i::GetHexesMinLevel
* HexoticPlugin_Hypothesis_i::GetHexoticSdMode
* HexoticPlugin_Hypothesis_i::GetVerbosity
* HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory
+ * HexoticPlugin_Hypothesis_i::GetTextOptions
+ * HexoticPlugin_Hypothesis_i::GetNbLayers
+ * HexoticPlugin_Hypothesis_i::GetFirstLayerSize
+ * HexoticPlugin_Hypothesis_i::GetDirection
+ * HexoticPlugin_Hypothesis_i::GetGrowth
+ * HexoticPlugin_Hypothesis_i::GetFacesWithLayers
+ * HexoticPlugin_Hypothesis_i::GetImprintedFaces
*/
//=============================================================================
return this->GetImpl()->GetHexoticMaxMemory();
}
+char* HexoticPlugin_Hypothesis_i::GetTextOptions()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetTextOptions");
+ ASSERT(myBaseImpl);
+ return CORBA::string_dup( this->GetImpl()->GetTextOptions().c_str() );
+}
+
+CORBA::Long HexoticPlugin_Hypothesis_i::GetNbLayers()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetNbLayers");
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetNbLayers();
+}
+
+CORBA::Double HexoticPlugin_Hypothesis_i::GetFirstLayerSize()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetFirstLayerSize");
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetFirstLayerSize();
+}
+
+CORBA::Boolean HexoticPlugin_Hypothesis_i::GetDirection()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetDirection");
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetDirection();
+}
+
+CORBA::Double HexoticPlugin_Hypothesis_i::GetGrowth()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetGrowth");
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetGrowth();
+}
+
+SMESH::long_array* HexoticPlugin_Hypothesis_i::GetFacesWithLayers()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetFacesWithLayers");
+ ASSERT(myBaseImpl);
+ std::vector<int> idsVec = this->GetImpl()->GetFacesWithLayers();
+ SMESH::long_array_var ids = new SMESH::long_array;
+ ids->length( idsVec.size() );
+ for ( unsigned i = 0; i < idsVec.size(); ++i )
+ ids[i] = idsVec[i];
+ return ids._retn();
+}
+
+SMESH::long_array* HexoticPlugin_Hypothesis_i::GetImprintedFaces()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetImprintedFaces");
+ ASSERT(myBaseImpl);
+ std::vector<int> idsVec = this->GetImpl()->GetImprintedFaces();
+ SMESH::long_array_var ids = new SMESH::long_array;
+ ids->length( idsVec.size() );
+ for ( unsigned i = 0; i < idsVec.size(); ++i )
+ ids[i] = idsVec[i];
+ return ids._retn();
+}
//=============================================================================
/*!
* HexoticPlugin_Hypothesis_i::GetImpl