-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2023 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
class LightApp_SelectionMgr;
class BLSURFPluginGUI_StdWidget;
class BLSURFPluginGUI_AdvWidget;
+class StdMeshersGUI_SubShapeSelectorWdg;
// class DlgBlSurfHyp_Enforced;
// Name
TEnfVertexCoords coords;
TEnfName grpName;
};
-
+// Attractor
+struct TAttractor{
+ std::string attEntry;
+ double startSize;
+ double infDist;
+ double constDist;
+ TAttractor( const char* theAttEntry, double theStartSize, double theInfDist, double theConstDist)
+ : attEntry( theAttEntry ),
+ startSize( theStartSize ),
+ infDist( theInfDist ),
+ constDist( theConstDist )
+ {}
+ void SetToDelete() { startSize = -1; }
+ bool IsToDelete() const { return startSize < 0; }
+};
+typedef std::vector< TAttractor > TAttractorVec;
struct CompareEnfVertices
{
int myPhysicalMesh, myGeometricMesh;
double myPhySize, myMinSize, myMaxSize;
bool myPhySizeRel, myMinSizeRel, myMaxSizeRel;
- bool myUseMinSize, myUseMaxSize;
- double myGradation, myAngleMesh, myChordalError;
- bool myAnisotropic, myRemoveTinyEdges, myForceBadElementRemoval;
- double myAnisotropicRatio, myTinyEdgeLength, myBadElementAspectRatio;
+ bool myUseMinSize, myUseMaxSize, myUseGradation, myUseVolumeGradation;
+ double myGradation, myVolumeGradation, myAngleMesh, myChordalError;
+ bool myAnisotropic, myOptimiseTinyEdges, myRemoveTinyEdges, myForceBadElementRemoval, myCorrectSurfaceIntersection;
+ double myAnisotropicRatio, myTinyEdgeLength, myTinyEdgeOptimisLength, myBadElementAspectRatio, myCorrectSurfaceIntersectionMaxCost;
bool myOptimizeMesh, myQuadraticMesh;
- bool myAllowQuadrangles, mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces;
- bool myPreCADMergeEdges, myPreCADProcess3DTopology, myPreCADDiscardInput;
+ bool mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces;
+ int myElementType;
+ bool myUseSurfaceProximity;
+ int myNbSurfaceProximityLayers;
+ double mySurfaceProximityRatio;
+ bool myUseVolumeProximity;
+ int myNbVolumeProximityLayers;
+ double myVolumeProximityRatio;
+ // bool myPreCADMergeEdges, myPreCADProcess3DTopology, myPreCADDiscardInput;
// bool myGMFFileMode;
std::string myGMFFileName, myInternalEnforcedVerticesAllFacesGroup;
TEnfVertexList enfVertexList;
TGroupNameEnfVertexListMap groupNameEnfVertexListMap;
*/
TPreCadPeriodicityVector preCadPeriodicityVector;
+ QStringList hyperpatches, hyperEntries;
QString myName;
} BlsurfHypothesisData;
/*!
- * \brief Class for creation of BLSURF hypotheses
+ * \brief Class for creation of MG-CADSurf hypotheses
*/
class BLSURFPLUGIN_GUI_EXPORT BLSURFPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
{
void onStateChange();
// Advanced tab
void onAddOption();
- void onDeleteOption();
- void onOptionChosenInPopup( QAction* );
+ void onChangeOptionName( int, int );
// Sizemap tab
void onMapGeomContentModified();
void onSmpItemClicked( QTreeWidgetItem *, int );
- void onSmpTabChanged(int);
+ void onTabChanged(int);
void onAttractorClicked(int);
void onConstSizeClicked(int);
void onAddMap();
void onSetSizeMap(QTreeWidgetItem *, int);
// Enforced vertices tab
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 addEnforcedVertex(double x=0, double y=0, double z=0,
+ std::string vertexName = "",
+ std::string geomEntry = "",
+ std::string groupName = "");
void onAddEnforcedVertices();
void onRemoveEnforcedVertex();
void synchronizeCoords();
void updateEnforcedVertexValues(QTreeWidgetItem* , int );
void onSelectEnforcedVertex();
-// void deactivateSelection(QWidget*, QWidget*);
void clearEnforcedVertexWidgets();
void onInternalVerticesClicked(int);
+ // Enforced mesh tab
+ void onAddEnforcedMesh();
+ void onRemoveEnforcedMesh();
+ void onEnforcedMeshSelected();
+ void onEnfMeshTableSelected();
// Periodicity tab
void onPeriodicityByVerticesChecked(bool);
-// void onPeriodicityRadioButtonChanged();
void onAddPeriodicity();
void onRemovePeriodicity();
void onPeriodicityTreeClicked(QTreeWidgetItem*, int);
void onPeriodicityContentModified();
+ // HyperPatch tab
+ void onHyPatchFaceSelection(bool);
+ void onHyPatchGroupSelection(bool);
+ void onHyPatchSelectionChanged();
+ void onHyPatchAdd();
+ void onHyPatchRemove();
private:
bool readParamsFromHypo( BlsurfHypothesisData& ) const;
bool sizeMapsValidation();
bool sizeMapValidationFromRow(int,bool displayError = true);
bool sizeMapValidationFromEntry(QString,bool displayError = true);
- GeomSelectionTools* getGeomSelectionTool();
+ GeomSelectionTools* getGeomSelectionTool() const;
GEOM::GEOM_Gen_var getGeomEngine();
- //void insertElementType( TopAbs_ShapeEnum );
bool insertElement( GEOM::GEOM_Object_var, bool modify = false );
bool insertAttractor(GEOM::GEOM_Object_var, GEOM::GEOM_Object_var, bool modify = false);
int findRowFromEntry(QString entry);
static LightApp_SelectionMgr* selectionMgr();
void avoidSimultaneousSelection(ListOfWidgets &myCustomWidgets) const;
void AddPreCadSequenceToVector(BlsurfHypothesisData& h_data, BLSURFPlugin::TPeriodicityList_var preCadFacePeriodicityVector, bool onFace) const;
+ void addHyPatchToTable(const QString& tags, const QString& entries);
+ bool hasGeom() const;
+
+ void addEnforcedMesh( SMESH::SMESH_IDSource_ptr mesh, const QString& groupName );
private:
QWidget* myEnfGroup;
-// TODO FACE AND VERTEX SELECTION
StdMeshersGUI_ObjectReferenceParamWdg *myEnfFaceWdg;
GEOM::GEOM_Object_var myEnfFace;
StdMeshersGUI_ObjectReferenceParamWdg *myEnfVertexWdg;
GEOM::GEOM_Object_var myEnfVertex;
-// DlgBlSurfHyp_Enforced* myEnforcedVertexWidget;
QTreeWidget* myEnforcedTreeWidget;
SMESHGUI_SpinBox* myXCoord;
SMESHGUI_SpinBox* myYCoord;
SMESHGUI_SpinBox* myZCoord;
QLineEdit* myGroupName;
-// QGroupBox* makeGroupsCheck;
-// QCheckBox* myGlobalGroupName;
QPushButton* addVertexButton;
QPushButton* removeVertexButton;
QCheckBox *myInternalEnforcedVerticesAllFaces;
QLineEdit *myInternalEnforcedVerticesAllFacesGroup;
+
+ // Enforced meshes
+ QWidget* myEnfMeshGroup;
+ StdMeshersGUI_ObjectReferenceParamWdg *myEnfMeshWdg;
+ QTableWidget* myEnfMeshTableWdg;
+ QLineEdit* myEnforcedGroupName;
+ QPushButton* myAddEnfMeshButton;
+ QPushButton* myRemoveEnfMeshButton;
+
+
+
// map = entry , size map
QMap<QString, QString> mySMPMap; // Map <face entry, size>
- QMap<QString, QString> myATTMap; // Map <face entry, att. entry>
- QMap<QString, double> myDistMap; // Map <entry,distance with constant size>
- QMap<QString, double> myAttDistMap; // Map <entry, influence distance>
+ QMap<QString, TAttractorVec > myATTMap; // Map <face entry, att. entry, etc>
QMap<QString, TopAbs_ShapeEnum> mySMPShapeTypeMap;
GeomSelectionTools* GeomToolSelected;
LightApp_SelectionMgr* aSel;
// Periodicity
- QWidget* myPeriodicityGroup;
- QSplitter* myPeriodicitySplitter;
- QTreeWidget* myPeriodicityTreeWidget;
- QWidget* myPeriodicityRightWidget;
- QGridLayout* myPeriodicityRightGridLayout;
- QGroupBox* myPeriodicityGroupBox1;
- QGroupBox* myPeriodicityGroupBox2;
+ QWidget* myPeriodicityGroup;
+ QSplitter* myPeriodicitySplitter;
+ QTreeWidget* myPeriodicityTreeWidget;
+ QWidget* myPeriodicityRightWidget;
+ QGridLayout* myPeriodicityRightGridLayout;
+ QGroupBox* myPeriodicityGroupBox1;
+ QGroupBox* myPeriodicityGroupBox2;
QGridLayout* aPeriodicityLayout1;
- QGridLayout* myPeriodicityGroupBox1Layout;
- QGridLayout* myPeriodicityGroupBox2Layout;
+ QGridLayout* myPeriodicityGroupBox1Layout;
+ QGridLayout* myPeriodicityGroupBox2Layout;
QRadioButton* myPeriodicityOnFaceRadioButton;
QRadioButton* myPeriodicityOnEdgeRadioButton;
- QLabel* myPeriodicityMainSourceLabel;
- QLabel* myPeriodicityMainTargetLabel;
- QLabel* myPeriodicitySourceLabel;
- QLabel* myPeriodicityTargetLabel;
+ QLabel* myPeriodicityMainSourceLabel;
+ QLabel* myPeriodicityMainTargetLabel;
+ QLabel* myPeriodicitySourceLabel;
+ QLabel* myPeriodicityTargetLabel;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicitySourceFaceWdg;
-// StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicitySourceEdgeWdg;
GEOM::GEOM_Object_var myPeriodicityFace;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityTargetFaceWdg;
-// StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityTargetEdgeWdg;
GEOM::GEOM_Object_var myPeriodicityEdge;
- QLabel* myPeriodicityP1SourceLabel;
- QLabel* myPeriodicityP2SourceLabel;
- QLabel* myPeriodicityP3SourceLabel;
- QLabel* myPeriodicityP1TargetLabel;
- QLabel* myPeriodicityP2TargetLabel;
- QLabel* myPeriodicityP3TargetLabel;
+ QLabel* myPeriodicityP1SourceLabel;
+ QLabel* myPeriodicityP2SourceLabel;
+ QLabel* myPeriodicityP3SourceLabel;
+ QLabel* myPeriodicityP1TargetLabel;
+ QLabel* myPeriodicityP2TargetLabel;
+ QLabel* myPeriodicityP3TargetLabel;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP1SourceWdg;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP2SourceWdg;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP3SourceWdg;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP2TargetWdg;
StdMeshersGUI_ObjectReferenceParamWdg* myPeriodicityP3TargetWdg;
ListOfWidgets myPeriodicitySelectionWidgets;
- QPushButton* myPeriodicityAddButton;
- QPushButton* myPeriodicityRemoveButton;
- QSpacerItem* myPeriodicityVerticalSpacer;
+ QPushButton* myPeriodicityAddButton;
+ QPushButton* myPeriodicityRemoveButton;
+ QSpacerItem* myPeriodicityVerticalSpacer;
+
+ QTableWidget* myHyPatchTable;
+ StdMeshersGUI_SubShapeSelectorWdg* myHyPatchFaceSelector;
+ QLineEdit* myHyPatchTagsLE;
+ QPushButton* myHyPatchFaceSelBtn;
+ QPushButton* myHyPatchGroupSelBtn;
- BLSURFPlugin::string_array_var myOptions, myPreCADOptions;
+ BLSURFPlugin::string_array_var myOptions, myPreCADOptions, myCustomOptions;
PyObject * main_mod;
PyObject * main_dict;
class EnforcedTreeWidgetDelegate : public QItemDelegate
{
- Q_OBJECT
+ Q_OBJECT
public:
EnforcedTreeWidgetDelegate(QObject *parent = 0);
- QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem & option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
- const QModelIndex &index) const;
+ const QModelIndex &index) const;
bool vertexExists(QAbstractItemModel *model, const QModelIndex &index, QString value) const;
};