From: gdd Date: Tue, 28 Feb 2012 15:51:05 +0000 (+0000) Subject: Add support of internal vertices for BLSURF X-Git-Tag: V6_5_0a1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7568db35e19d3bd962dc5806cc2e4c13500ce8e3;p=plugins%2Fblsurfplugin.git Add support of internal vertices for BLSURF --- diff --git a/idl/BLSURFPlugin_Algorithm.idl b/idl/BLSURFPlugin_Algorithm.idl index 43a2757..6082e52 100644 --- a/idl/BLSURFPlugin_Algorithm.idl +++ b/idl/BLSURFPlugin_Algorithm.idl @@ -96,6 +96,9 @@ module BLSURFPlugin }; typedef sequence TEnfVertexEntryEnfVertexMap; + // List of Face Entry with internal enforced vertices activated + typedef sequence TFaceEntryInternalVerticesList; + // Attractors struct TAttractorParams { string faceEntry; @@ -313,8 +316,6 @@ module BLSURFPlugin void SetClassAttractorEntry(in string entry, in string att_entry, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius ); BLSURFPlugin::TAttParamsMap GetAttractorParams(); - - /* void SetCustomSizeMapEntry(in string entry, in string sizeMap); string GetCustomSizeMapEntry(in string entry); @@ -358,29 +359,28 @@ module BLSURFPlugin * Set/get/unset an enforced vertex on geom face given by entry */ boolean SetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, - in TEnfName theVertexName, in TEntry theVertexEntry, in string groupName) raises (SALOME::SALOME_Exception); -// boolean SetEnforcedVertexEntryNamed(in TEntry theFaceEntry, in double x, in double y, in double z, in TEnfName theVertexName) raises (SALOME::SALOME_Exception); -// boolean SetEnforcedVertexEntryGeom(in TEntry theFaceEntry, in TEntry theVertexEntry, in TEnfName theVertexName) raises (SALOME::SALOME_Exception); - /* TODO GROUPS - void SetEnforcedVertexEntryWithGroup(in string theFaceEntry, in double x, in double y, in double z, in TEnfGroupName groupName) - raises (SALOME::SALOME_Exception); - */ -// + in TEnfName theVertexName, in TEntry theVertexEntry, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception); + TEnfVertexList GetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception); -// boolean UnsetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception); // boolean UnsetEnforcedVertexEntryGeom(in TEntry theFaceEntry, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception); boolean UnsetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception); - /*! - * Set/get an enforced vertex on geom object and add it to a group - */ - /* TODO GROUPS - void SetEnforcedVertexGroupName(in double x, in double y, in double z, in TEnfGroupName groupName) - raises (SALOME::SALOME_Exception); - string GetEnforcedVertexGroupName(in double x, in double y, in double z) - raises (SALOME::SALOME_Exception); - */ + /*! + * To get/set internal vertices as enforced vertices + */ + void SetInternalEnforcedVertexAllFaces(in boolean toEnforceInternalVertices); + boolean GetInternalEnforcedVertexAllFaces(); + void SetInternalEnforcedVertexAllFacesGroup(in TEnfGroupName groupName); + TEnfGroupName GetInternalEnforcedVertexAllFacesGroup(); + +// Enable internal enforced vertices on specific face if requested by user +// void SetInternalEnforcedVertex(in GEOM::GEOM_Object theFace,in boolean toEnforceInternalVertices) raises (SALOME::SALOME_Exception); +// void SetInternalEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception); +// void SetInternalEnforcedVertexEntry(in TEntry theFaceEntry, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception); +// boolean GetInternalEnforcedVertex(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception); +// boolean GetInternalEnforcedVertexEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception); +// TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesFaces(); /////////////////////// /*! diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index dc08519..0e5c1aa 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -473,7 +473,13 @@ void _createEnforcedVertexOnFace(TopoDS_Face faceShape, gp_Pnt aPnt, BLSURFPlugi MESSAGE("("<< myPoint.xyz.X() << ", " << myPoint.xyz.Y() << ", " << myPoint.xyz.Z() <<") / (" << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z()<<")"); EnfVertexCoords2ProjVertex[s_coords] = enf_coords; MESSAGE("Group name is: \"" << enfVertex->grpName << "\""); - EnfVertexCoords2EnfVertexList[s_coords].insert(enfVertex); + pair ret; + BLSURFPlugin_Hypothesis::TEnfVertexList::iterator it; + ret = EnfVertexCoords2EnfVertexList[s_coords].insert(enfVertex); + if (ret.second == false) { + it = ret.first; + (*it)->grpName = enfVertex->grpName; + } int key = 0; if (! FacesWithEnforcedVertices.Contains(faceShape)) { @@ -1008,6 +1014,38 @@ void BLSURFPlugin_BLSURF::SetParameters( } } + // Internal vertices + bool useInternalVertexAllFaces = BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFaces(hyp); + if (useInternalVertexAllFaces) { + std::string grpName = BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFacesGroup(hyp); + MESSAGE("Setting Internal Enforced Vertices"); + GeomShape = mesh.GetShapeToMesh(); + gp_Pnt aPnt; + TopExp_Explorer exp (GeomShape, TopAbs_FACE); + for (; exp.More(); exp.Next()){ + MESSAGE("Iterating shapes. Shape type is " << exp.Current().ShapeType()); + TopExp_Explorer exp_face (exp.Current(), TopAbs_VERTEX); + for (; exp_face.More(); exp_face.Next()) + { + // Get coords of vertex + // Check if current coords is already in enfVertexList + // If coords not in enfVertexList, add new enfVertex + aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exp_face.Current())); + MESSAGE("Found vertex on face at " << aPnt.X() <<", "<coords.push_back(aPnt.X()); + enfVertex->coords.push_back(aPnt.Y()); + enfVertex->coords.push_back(aPnt.Z()); + enfVertex->name = ""; + enfVertex->faceEntries.clear(); + enfVertex->geomEntry = ""; + enfVertex->grpName = grpName; + _createEnforcedVertexOnFace( TopoDS::Face(exp.Current()), aPnt, enfVertex); + HasSizeMapOnFace = true; + } + } + } + MESSAGE("Setting Size Map on FACES "); // #if BLSURF_VERSION_LONG < "3.1.1" blsurf_data_set_sizemap_iso_cad_face(bls, size_on_surface, &_smp_phy_size); @@ -1697,7 +1735,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) groupDone = true; } if (!groupDone) - throw SALOME_Exception(LOCALIZED("A enforced vertex node was not added to a group")); + throw SALOME_Exception(LOCALIZED("An enforced vertex node was not added to a group")); } else MESSAGE("Group name is empty: '"<grpName<<"' => group is not created"); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index ccadedc..ca260ab 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -69,11 +69,8 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G _faceEntryEnfVertexEntryListMap(GetDefaultFaceEntryEnfVertexEntryListMap()), _enfVertexEntryEnfVertexMap(GetDefaultEnfVertexEntryEnfVertexMap()), _groupNameNodeIDMap(GetDefaultGroupNameNodeIDMap()), - _GMFFileName(GetDefaultGMFFile()) -/* TODO GROUPS - _groupNameEnfVertexListMap(GetDefaultGroupNameEnfVertexListMap()), - _enfVertexGroupNameMap(GetDefaultEnfVertexGroupNameMap()) - */ + _GMFFileName(GetDefaultGMFFile()), + _enforcedInternalVerticesAllFaces(GetDefaultInternalEnforcedVertex()) { _name = "BLSURF_Parameters"; _param_algo_dim = 2; @@ -636,6 +633,35 @@ void BLSURFPlugin_Hypothesis::ClearSizeMaps() { _classAttractors.clear(); } +// Enable internal enforced vertices on specific face if requested by user + +////======================================================================= +////function : SetInternalEnforcedVertex +////======================================================================= +//void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertex(TEntry theFaceEntry, +// bool toEnforceInternalVertices, +// TEnfGroupName theGroupName) { + +// MESSAGE("BLSURFPlugin_Hypothesis::SetInternalEnforcedVertex("<< theFaceEntry << ", " +// << toEnforceInternalVertices << ", " << theGroupName << ")"); + +// TFaceEntryInternalVerticesList::iterator it = _faceEntryInternalVerticesList.find(theFaceEntry); +// if (it != _faceEntryInternalVerticesList.end()) { +// if (!toEnforceInternalVertices) { +// _faceEntryInternalVerticesList.erase(it); +// } +// } +// else { +// if (toEnforceInternalVertices) { +// _faceEntryInternalVerticesList.insert(theFaceEntry); +// } +// } + +// // TODO +// // Take care of groups +//} + + //======================================================================= //function : SetEnforcedVertex //======================================================================= @@ -805,6 +831,18 @@ BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(const throw std::invalid_argument(msg.str()); } +//Enable internal enforced vertices on specific face if requested by user +////======================================================================= +////function : GetInternalEnforcedVertex +////======================================================================= + +//bool BLSURFPlugin_Hypothesis::GetInternalEnforcedVertex(const TEntry& theFaceEntry) +//{ +// if (_faceEntryInternalVerticesList.count(theFaceEntry) > 0) +// return true; +// return false; +//} + //======================================================================= //function : ClearEnforcedVertex //======================================================================= @@ -975,6 +1013,8 @@ void BLSURFPlugin_Hypothesis::ClearAllEnforcedVertices() { _coordsEnfVertexMap.clear(); _faceEntryEnfVertexEntryListMap.clear(); _enfVertexEntryEnfVertexMap.clear(); +// Enable internal enforced vertices on specific face if requested by user +// _faceEntryInternalVerticesList.clear(); NotifySubMeshesHypothesisModification(); } @@ -990,6 +1030,22 @@ BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap BLSURFPlugin_Hypothesis::Get return hyp ? hyp->_GetAllEnforcedVerticesByFace() : GetDefaultFaceEntryEnfVertexListMap(); } +//Enable internal enforced vertices on specific face if requested by user +//BLSURFPlugin_Hypothesis::TFaceEntryInternalVerticesList BLSURFPlugin_Hypothesis::GetAllInternalEnforcedVerticesByFace( +// const BLSURFPlugin_Hypothesis* hyp) { +// return hyp ? hyp->_GetAllInternalEnforcedVerticesByFace() : GetDefaultFaceEntryInternalVerticesMap(); +//} + +bool BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFaces(const BLSURFPlugin_Hypothesis* hyp) +{ + return hyp ? hyp->_GetInternalEnforcedVertexAllFaces() : GetDefaultInternalEnforcedVertex(); +} + +BLSURFPlugin_Hypothesis::TEnfGroupName BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFacesGroup(const BLSURFPlugin_Hypothesis* hyp) +{ + return hyp ? hyp->_GetInternalEnforcedVertexAllFacesGroup() : BLSURFPlugin_Hypothesis::TEnfGroupName(); +} + BLSURFPlugin_Hypothesis::TEnfVertexList BLSURFPlugin_Hypothesis::GetAllEnforcedVertices( const BLSURFPlugin_Hypothesis* hyp) { return hyp ? hyp->_GetAllEnforcedVertices() : GetDefaultEnfVertexList(); @@ -1047,6 +1103,26 @@ void BLSURFPlugin_Hypothesis::RemoveEnfVertexNodeID(TEnfGroupName theGroupName,i throw std::invalid_argument(msg.str()); } + +//============================================================================= +void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices) { + if (toEnforceInternalVertices != _enforcedInternalVerticesAllFaces) { + _enforcedInternalVerticesAllFaces = toEnforceInternalVertices; + if (toEnforceInternalVertices) + SetPhysicalMesh(SizeMap); + NotifySubMeshesHypothesisModification(); + } +} + + +//============================================================================= +void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertexAllFacesGroup(BLSURFPlugin_Hypothesis::TEnfGroupName theGroupName) { + if (string(theGroupName) != string(_enforcedInternalVerticesAllFacesGroup)) { + _enforcedInternalVerticesAllFacesGroup = theGroupName; + NotifySubMeshesHypothesisModification(); + } +} + //============================================================================= std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) { save << " " << (int) _topology << " " << (int) _physicalMesh << " " << (int) _geometricMesh << " " << _phySize << " " @@ -1713,3 +1789,9 @@ double BLSURFPlugin_Hypothesis::GetDefaultPreCADEpsNano() { std::string BLSURFPlugin_Hypothesis::GetDefaultGMFFile() { return ""; } + +//============================================================================= +bool BLSURFPlugin_Hypothesis::GetDefaultInternalEnforcedVertex() { + return false; +} + diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index 79f7a23..7d6c190 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -205,6 +205,9 @@ public: // Map Face Entry / List of enforced vertices typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap; + // List of Face Entry with internal enforced vertices activated + typedef std::set< TEntry > TFaceEntryInternalVerticesList; + // Map Face Entry / List of coords typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap; @@ -265,15 +268,22 @@ public: static TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp); static TEnfVertexEntryEnfVertexMap GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp); - /*! - * \brief Set/get node group to an enforced vertex - */ - /* TODO GROUPS - void SetEnforcedVertexGroupName(double x, double y, double z, const TEnfGroupName& groupName) throw (std::invalid_argument); - TEnfGroupName GetEnforcedVertexGroupName(double x, double y, double z) throw (std::invalid_argument); - TEnfVertexList GetEnforcedVertexByGroupName(TEnfGroupName& groupName) throw (std::invalid_argument); - */ + * \brief Internal enforced vertices + */ + void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices); + const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; } + static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp ); + void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName); + const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; } + static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp ); + +// Enable internal enforced vertices on specific face if requested by user +// static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); } +// const TFaceEntryInternalVerticesList _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; } +// static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp); +// void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName); +// bool GetInternalEnforcedVertex(const TEntry& theFaceEntry); static Topology GetDefaultTopology(); static PhysicalMesh GetDefaultPhysicalMesh(); @@ -304,6 +314,8 @@ public: static TEnfVertexEntryEnfVertexMap GetDefaultEnfVertexEntryEnfVertexMap() { return TEnfVertexEntryEnfVertexMap(); } static TGroupNameNodeIDMap GetDefaultGroupNameNodeIDMap() { return TGroupNameNodeIDMap(); } + static bool GetDefaultInternalEnforcedVertex(); + /* TODO GROUPS static TGroupNameEnfVertexListMap GetDefaultGroupNameEnfVertexListMap() { return TGroupNameEnfVertexListMap(); } static TEnfVertexGroupNameMap GetDefaultEnfVertexGroupNameMap() { return TEnfVertexGroupNameMap(); } @@ -389,12 +401,14 @@ private: TEnfVertexEntryEnfVertexMap _enfVertexEntryEnfVertexMap; TGroupNameNodeIDMap _groupNameNodeIDMap; +// Enable internal enforced vertices on specific face if requested by user +// TFaceEntryInternalVerticesList _faceEntryInternalVerticesList; + bool _enforcedInternalVerticesAllFaces; + TEnfGroupName _enforcedInternalVerticesAllFacesGroup; + std::string _GMFFileName; // bool _GMFFileMode; - - /* TODO GROUPS - TGroupNameEnfVertexListMap _groupNameEnfVertexListMap; - */ + // TSizeMap _customSizeMap; }; diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 7079c10..5e4612f 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -311,7 +311,8 @@ void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) { // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed"); ASSERT(myBaseImpl); this->GetImpl()->SetQuadAllowed(theValue); - SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValue << " )"; + std::string theValueStr = theValue ? "True" : "False"; + SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )"; } //============================================================================= @@ -338,7 +339,8 @@ void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) { // MESSAGE("BLSURFPlugin_Hypothesis_i::SetDecimesh"); ASSERT(myBaseImpl); this->GetImpl()->SetDecimesh(theValue); - SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValue << " )"; + std::string theValueStr = theValue ? "True" : "False"; + SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValueStr.c_str() << " )"; } //============================================================================= @@ -381,7 +383,8 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) { // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges"); ASSERT(myBaseImpl); this->GetImpl()->SetPreCADMergeEdges(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValue << " )"; + std::string theValueStr = theValue ? "True" : "False"; + SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValueStr.c_str() << " )"; } //============================================================================= @@ -408,7 +411,8 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges"); ASSERT(myBaseImpl); this->GetImpl()->SetPreCADRemoveNanoEdges(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADRemoveNanoEdges( " << theValue << " )"; + std::string theValueStr = theValue ? "True" : "False"; + SMESH::TPythonDump() << _this() << ".SetPreCADRemoveNanoEdges( " << theValueStr.c_str() << " )"; } //============================================================================= @@ -435,7 +439,8 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) { // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput"); ASSERT(myBaseImpl); this->GetImpl()->SetPreCADDiscardInput(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValue << " )"; + std::string theValueStr = theValue ? "True" : "False"; + SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValueStr.c_str() << " )"; } //============================================================================= @@ -1706,6 +1711,46 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object } } +//Enable internal enforced vertices on specific face if requested by user +///*! +// * Are internal enforced vertices used for a face ? +// */ +//CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) +// throw (SALOME::SALOME_Exception) { +// ASSERT(myBaseImpl); + +// if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { +// MESSAGE("theFace shape type is not FACE or COMPOUND"); +// THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM); +// } + +// string theFaceEntry = theFace->GetStudyEntry(); + +// if (theFaceEntry.empty()) { +// GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); +// SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); +// string aName; +// if (theFace->GetShapeType() == GEOM::FACE) +// aName = "Face_"; +// if (theFace->GetShapeType() == GEOM::COMPOUND) +// aName = "Compound_"; +// aName += theFace->GetEntry(); +// SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); +// if (!theSFace->_is_nil()) +// theFaceEntry = theSFace->GetID(); +// } +// if (theFaceEntry.empty()) +// THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM ); + +// MESSAGE("IDL : GetName : " << theFace->GetName()); +// MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")"); +// try { +// return GetInternalEnforcedVertexEntry(theFaceEntry.c_str()); +// } catch (SALOME_Exception& ex) { +// THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); +// } +//} + /*! * Get the list of all enforced vertices */ @@ -1737,7 +1782,7 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM ); MESSAGE("IDL : GetName : " << theFace->GetName()); - MESSAGE("IDL : GetEnforcedVertexList ( "<< theFaceEntry << ")"); + MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")"); try { return GetEnforcedVerticesEntry(theFaceEntry.c_str()); } catch (SALOME_Exception& ex) { @@ -1969,6 +2014,18 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, return newValue; } +//Enable internal enforced vertices on specific face if requested by user +//CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry) +// throw (SALOME::SALOME_Exception) { +// ASSERT(myBaseImpl); +// try { +// return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry); +// } catch (const std::exception& ex) { +// std::cout << "Exception: " << ex.what() << std::endl; +// THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); +// } +//} + BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry) throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); @@ -2085,6 +2142,132 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEn return true; } +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces + * + * Set true or false + */ +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) { + MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces"); + ASSERT(myBaseImpl); + this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue); + std::string theValueStr = theValue ? "True" : "False"; + SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFaces( " << theValueStr.c_str() << " )"; +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces + * + * Get true or false + */ +//============================================================================= +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() { + MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces"); + ASSERT(myBaseImpl); + return this->GetImpl()->_GetInternalEnforcedVertexAllFaces(); +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup + * + * Set group name + */ +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char* groupName) { + MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup"); + ASSERT(myBaseImpl); + this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName); + SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )"; +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup + * + * Get group name + */ +//============================================================================= +char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() { + MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup"); + ASSERT(myBaseImpl); + return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str()); +} + +/* + * Enable internal enforced vertices on specific face if requested by user + * +void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) + throw (SALOME::SALOME_Exception) +{ + MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace"); + try { + SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices); + } catch (SALOME_Exception& ex) { + THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); + } +} + +void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName) + throw (SALOME::SALOME_Exception) +{ + MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup"); + + if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { + MESSAGE("theFace shape type is not FACE or COMPOUND"); + THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM); + } + + string theFaceEntry = theFace->GetStudyEntry(); + + if (theFaceEntry.empty()) { + GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); + SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); + string aName; + if (theFace->GetShapeType() == GEOM::FACE) + aName = "Face_"; + if (theFace->GetShapeType() == GEOM::COMPOUND) + aName = "Compound_"; + aName += theFace->GetEntry(); + SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + if (!theSFace->_is_nil()) + theFaceEntry = theSFace->GetID(); + } + if (theFaceEntry.empty()) + THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM ); + + MESSAGE("IDL : GetName : " << theFace->GetName()); + MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")"); + try { + SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName); + } catch (SALOME_Exception& ex) { + THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); + } +} + +void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName) + throw (SALOME::SALOME_Exception) +{ + MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry"); + ASSERT(myBaseImpl); + try { + this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName); + std::string theValueStr = toEnforceInternalVertices ? "True" : "False"; + if (string(theGroupName).empty()) + SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )"; + else + SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )"; + } catch (const std::exception& ex) { + std::cout << "Exception: " << ex.what() << std::endl; + THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); + } +} + +*/ + /* TODO GROUPS char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index bd5c2e7..ce1fde6 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -218,12 +218,20 @@ public: bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception); /*! - * Set/get node group to an enforced vertex - */ - /* TODO GROUPS - void SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName) throw (SALOME::SALOME_Exception); - char* GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception); + * To add internal vertices as enforced vertices */ + void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices); + CORBA::Boolean GetInternalEnforcedVertexAllFaces(); + void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = ""); + char* GetInternalEnforcedVertexAllFacesGroup(); + +// Enable internal enforced vertices on specific face if requested by user +// void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception); +// void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception); +// void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception); +// CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception); +// CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception); + /////////////////////// /*! diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index b9c5b41..20ec640 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -163,6 +163,9 @@ enum { // ENF_VER_GROUP_CHECK, // ENF_VER_SPACE, ENF_VER_BTN, + ENF_VER_SEPARATOR, + ENF_VER_INTERNAL_ALL_FACES, + ENF_VER_INTERNAL_ALL_FACES_GROUP, // ENF_VER_VERTEX_BTN, // ENF_VER_REMOVE_BTN, // ENF_VER_SEPARATOR, @@ -1018,6 +1021,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() addVertexButton = new QPushButton(tr("BLSURF_ENF_VER_VERTEX"),myEnfGroup); removeVertexButton = new QPushButton(tr("BLSURF_ENF_VER_REMOVE"),myEnfGroup); + myInternalEnforcedVerticesAllFaces = new QCheckBox(tr("Use internal vertices of all faces"),myEnfGroup); + + QLabel* myInternalEnforcedVerticesAllFacesGroupLabel = new QLabel( tr( "BLSURF_ENF_VER_GROUP_LABEL" ), myEnfGroup ); + myInternalEnforcedVerticesAllFacesGroup = new QLineEdit(myEnfGroup); + // myGlobalGroupName = new QCheckBox(tr("BLSURF_ENF_VER_GROUPS"), myEnfGroup); // myGlobalGroupName->setChecked(false); @@ -1038,6 +1046,9 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() // anEnfLayout2->setRowStretch( ENF_VER_SPACE, 1); anEnfLayout2->addWidget(addVertexButton, ENF_VER_BTN, 0, 1, 1); anEnfLayout2->addWidget(removeVertexButton, ENF_VER_BTN, 1, 1, 1); + anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFaces, ENF_VER_INTERNAL_ALL_FACES, 0, 1, 2); + anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFacesGroupLabel, ENF_VER_INTERNAL_ALL_FACES_GROUP, 0, 1, 1); + anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFacesGroup, ENF_VER_INTERNAL_ALL_FACES_GROUP, 1, 1, 1); anEnfLayout2->setRowStretch(ENF_VER_NB_LINES+1, 1); // anEnfLayout2->addWidget(makeGroupsCheck, ENF_VER_GROUP_CHECK, 0, 1, 2); anEnfLayout->addLayout(anEnfLayout2, 0,1,ENF_VER_NB_LINES+1,2); @@ -1082,6 +1093,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() connect( addVertexButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedVertices() ) ); connect( removeVertexButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedVertex() ) ); connect( myEnfVertexWdg, SIGNAL( contentModified()), this, SLOT( onSelectEnforcedVertex() ) ); + connect( myInternalEnforcedVerticesAllFaces, SIGNAL( stateChanged ( int )), this, SLOT( onInternalVerticesClicked( int ) ) ); // connect( myEnfVertexWdg, SIGNAL( selectionActivated()), this, SLOT( onVertexSelectionActivated() ) ); // connect( myEnfFaceWdg, SIGNAL( selectionActivated()), this, SLOT( onFaceSelectionActivated() ) ); @@ -1103,7 +1115,7 @@ This method stop the selection of the widgets StdMeshersGUI_ObjectReferenceParam // } /** - * This method resets the content of the X, Y, Z and GroupName widgets; + * This method resets the content of the X, Y, Z widgets; **/ void BLSURFPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets() { @@ -1213,11 +1225,10 @@ void BLSURFPluginGUI_HypothesisCreator::synchronizeCoords() { } } -/** BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(entry, shapeName, x, y, z) -This method adds an enforced vertex (x,y,z) to shapeName in the tree widget. +/** BLSURFPluginGUI_HypothesisCreator::addEnforcedFace(entry, shapeName, useInternalVertices) +This method adds a face containing enforced vertices in the tree widget. */ -void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(std::string theFaceEntry, std::string theFaceName, - double x, double y, double z, std::string vertexName, std::string geomEntry, std::string groupName) { +QTreeWidgetItem* BLSURFPluginGUI_HypothesisCreator::addEnforcedFace(std::string theFaceEntry, std::string theFaceName) { // Find theFaceEntry item QList theItemList = myEnforcedTreeWidget->findItems(QString(theFaceEntry.c_str()),Qt::MatchExactly,ENF_VER_FACE_ENTRY_COLUMN); QTreeWidgetItem* theItem; @@ -1231,7 +1242,16 @@ void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(std::string theFaceEnt else { theItem = theItemList[0]; } + return theItem; +} +/** BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(entry, shapeName, x, y, z) +This method adds an enforced vertex (x,y,z) to shapeName in the tree widget. +*/ +void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(QTreeWidgetItem* theItem, double x, double y, double z, + std::string vertexName, std::string geomEntry, std::string groupName) { + + std::string theFaceName = theItem->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString().toStdString(); // MESSAGE("theItemName is " << theItem->text(ENF_VER_NAME_COLUMN).toStdString()); bool okToCreate = true; @@ -1358,15 +1378,15 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { myEnfFace = myEnfFaceWdg->GetObject< GEOM::GEOM_Object >(i); entry = myEnfFace->GetStudyEntry(); shapeName = myEnfFace->GetName(); - + + QTreeWidgetItem * faceItem = addEnforcedFace(entry, shapeName); + std::string groupName = myGroupName->text().toStdString(); -// if (myGlobalGroupName->isChecked()) -// groupName = myGlobalGroupName->text().toStdString(); if (boost::trim_copy(groupName).empty()) groupName = ""; - if (selEnfVertex <= 1) + if (selEnfVertex == 1) { double x,y,z; x = myXCoord->GetValue(); @@ -1374,10 +1394,10 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { z = myZCoord->GetValue(); if (selEnfVertex == 1) { myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(); - addEnforcedVertex(entry, shapeName, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName); + addEnforcedVertex(faceItem, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName); } else - addEnforcedVertex(entry, shapeName, x, y, z, "", "", groupName); + addEnforcedVertex(faceItem, x, y, z, "", "", groupName); } else { @@ -1396,9 +1416,9 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { if (myEnfVertex->GetShapeType() == GEOM::VERTEX) { measureOp->PointCoordinates (myEnfVertex, x, y, z); if ( measureOp->IsDone() ) - addEnforcedVertex(entry, shapeName, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName); + addEnforcedVertex(faceItem, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName); } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) { - addEnforcedVertex(entry, shapeName, 0, 0, 0, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName); + addEnforcedVertex(faceItem, 0, 0, 0, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName); } } } @@ -1459,6 +1479,17 @@ void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() { myEnforcedTreeWidget->selectionModel()->clearSelection(); } + +void BLSURFPluginGUI_HypothesisCreator::onInternalVerticesClicked(int state) +{ + if (state == Qt::Checked) { + myInternalEnforcedVerticesAllFacesGroup->setEnabled(true); + } + if (state == Qt::Unchecked) { + myInternalEnforcedVerticesAllFacesGroup->setEnabled(false); + } +} + /** BLSURFPluginGUI_HypothesisCreator::retrieveParams() This method updates the GUI widgets with the hypothesis data */ @@ -1609,20 +1640,16 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const // Enforced vertices MESSAGE("retrieveParams(): data.entryCoordsListMap.size() = " << data.faceEntryEnfVertexListMap.size()); TFaceEntryEnfVertexListMap::const_iterator evmIt = data.faceEntryEnfVertexListMap.begin(); + for ( ; evmIt != data.faceEntryEnfVertexListMap.end() ; ++evmIt) { TEntry entry = (*evmIt).first; std::string shapeName = myGeomToolSelected->getNameFromEntry(entry); MESSAGE("Face entry: " << entry); MESSAGE("Face name: " << shapeName); + + QTreeWidgetItem* faceItem = that->addEnforcedFace(entry, shapeName); TEnfVertexList evs = (*evmIt).second; -// try { -// evs = (*evmIt).second; -// } -// catch(...) { -// MESSAGE("evs = (*evmIt).second: FAIL"); -// break; -// } TEnfVertexList::const_iterator evsIt = evs.begin(); TEnfVertex *enfVertex; @@ -1635,13 +1662,17 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const y = enfVertex->coords[1]; z = enfVertex->coords[2]; } - that->addEnforcedVertex(entry, shapeName, x, y, z, enfVertex->name, enfVertex->geomEntry, enfVertex->grpName); + that->addEnforcedVertex(faceItem, x, y, z, enfVertex->name, enfVertex->geomEntry, enfVertex->grpName); } } for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column) myEnforcedTreeWidget->resizeColumnToContents(column); + myInternalEnforcedVerticesAllFaces->setChecked(data.myInternalEnforcedVerticesAllFaces); + myInternalEnforcedVerticesAllFacesGroup->setText(QString(data.myInternalEnforcedVerticesAllFacesGroup.c_str())); + myInternalEnforcedVerticesAllFacesGroup->setEnabled(data.myInternalEnforcedVerticesAllFaces); + // update widgets that->onPhysicalMeshChanged(); that->onGeometricMeshChanged(); @@ -1837,6 +1868,8 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData h_data.faceEntryEnfVertexListMap.erase(entry); } } + h_data.myInternalEnforcedVerticesAllFaces = h->GetInternalEnforcedVertexAllFaces(); + h_data.myInternalEnforcedVerticesAllFacesGroup = h->GetInternalEnforcedVertexAllFacesGroup(); return true; } @@ -1986,6 +2019,12 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi ret = h->SetEnforcedVertexEntry( faceEntry.c_str(), x, y, z, (*evsIt)->name.c_str(), (*evsIt)->geomEntry.c_str(), (*evsIt)->grpName.c_str()); } // for } // for + + if ( h->GetInternalEnforcedVertexAllFaces() != h_data.myInternalEnforcedVerticesAllFaces ) + h->SetInternalEnforcedVertexAllFaces( h_data.myInternalEnforcedVerticesAllFaces ); + if ( h->GetInternalEnforcedVertexAllFacesGroup() != h_data.myInternalEnforcedVerticesAllFacesGroup ) + h->SetInternalEnforcedVertexAllFacesGroup( h_data.myInternalEnforcedVerticesAllFacesGroup.c_str() ); + } // try catch(const std::exception& ex) { std::cout << "Exception: " << ex.what() << std::endl; @@ -2140,6 +2179,9 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes } } + h_data.myInternalEnforcedVerticesAllFaces = myInternalEnforcedVerticesAllFaces->isChecked(); + h_data.myInternalEnforcedVerticesAllFacesGroup = myInternalEnforcedVerticesAllFacesGroup->text().toStdString(); + MESSAGE("guiHyp : " << guiHyp.toLatin1().data()); return guiHyp; } diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h index 68e4338..64e214a 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h @@ -118,17 +118,20 @@ typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList; // Map Face Entry / List of enforced vertices typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap; +// Map Face Entry / InternalEnforcedVertices +typedef std::map< TEntry, bool > TFaceEntryInternalVerticesMap; + typedef struct { int myTopology, myVerbosity; int myPhysicalMesh, myGeometricMesh; double myAngleMeshS, myAngleMeshC, myGradation; double myPhySize, myGeoMin, myGeoMax, myPhyMin,myPhyMax; - bool myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex; + bool myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces; bool myPreCADMergeEdges, myPreCADRemoveNanoEdges, myPreCADDiscardInput; double myPreCADEpsNano; // bool myGMFFileMode; - std::string myGMFFileName; + std::string myGMFFileName, myInternalEnforcedVerticesAllFacesGroup; TEnfVertexList enfVertexList; TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap; /* TODO GROUPS @@ -201,8 +204,11 @@ protected slots: void onModifyMap(); void onSetSizeMap(QTreeWidgetItem *, int); - void addEnforcedVertex(std::string theFaceEntry, std::string theFaceName, double x=0, double y=0, double z=0, + QTreeWidgetItem* addEnforcedFace(std::string theFaceEntry, std::string theFaceName); + + void addEnforcedVertex(QTreeWidgetItem * theFaceItem, double x=0, double y=0, double z=0, std::string vertexName = "", std::string geomEntry = "", std::string groupName = ""); + void onAddEnforcedVertices(); void onRemoveEnforcedVertex(); void synchronizeCoords(); @@ -210,6 +216,7 @@ protected slots: void onSelectEnforcedVertex(); // void deactivateSelection(QWidget*, QWidget*); void clearEnforcedVertexWidgets(); + void onInternalVerticesClicked(int); private: bool readParamsFromHypo( BlsurfHypothesisData& ) const; @@ -308,6 +315,9 @@ private: QPushButton* addVertexButton; QPushButton* removeVertexButton; + QCheckBox *myInternalEnforcedVerticesAllFaces; + QLineEdit *myInternalEnforcedVerticesAllFacesGroup; + // map = entry , size map QMap mySMPMap; // Map QMap myATTMap; // Map diff --git a/src/GUI/BLSURFPlugin_msg_fr.ts b/src/GUI/BLSURFPlugin_msg_fr.ts index 2b58c98..35aef5c 100755 --- a/src/GUI/BLSURFPlugin_msg_fr.ts +++ b/src/GUI/BLSURFPlugin_msg_fr.ts @@ -348,8 +348,12 @@ Supprimer - BLSURF_ENF_VER_GROUPS - Groupe unique + Use internal vertices + Utiliser les points internes + + + Use internal vertices of all faces + Utiliser les points internes de toutes les faces