STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
HEXABLOCK_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define HEXABLOCK_VERSION_STR "@VERSION@"
-#define HEXABLOCK_VERSION @XVERSION@
-#define HEXABLOCK_DEVELOPMENT @VERSION_DEV@
+
+/*!
+ Specify version of SALOME HEXABLOCK module, as follows
+
+HEXABLOCK_VERSION_MAJOR : (integer) number identifying major version
+HEXABLOCK_VERSION_MINOR : (integer) number identifying minor version
+HEXABLOCK_VERSION_MAINTENANCE : (integer) number identifying maintenance version
+HEXABLOCK_VERSION_STR : (string) complete version number "major.minor.maintenance"
+HEXABLOCK_VERSION : (hex) complete version number (major << 16) + (minor << 8) + maintenance
+HEXABLOCK_DEVELOPMENT : (integer) indicates development version when set to 1
+ */
+
+#define HEXABLOCK_VERSION_MAJOR @SALOMEHEXABLOCK_MAJOR_VERSION@
+#define HEXABLOCK_VERSION_MINOR @SALOMEHEXABLOCK_MINOR_VERSION@
+#define HEXABLOCK_VERSION_MAINTENANCE @SALOMEHEXABLOCK_PATCH_VERSION@
+#define HEXABLOCK_VERSION_STR "@SALOMEHEXABLOCK_VERSION@"
+#define HEXABLOCK_VERSION @SALOMEHEXABLOCK_XVERSION@
+#define HEXABLOCK_DEVELOPMENT @SALOMEHEXABLOCK_VERSION_DEV@
#endif // __HEXABLOCK_VERSION_H__
if [ -z "${KERNEL_ROOT_DIR}" ] ; then
export KERNEL_ROOT_DIR=@KERNEL_ROOT_DIR@
fi
-if [ -z "${HEXA_ROOT_DIR}" ] ; then
-export HEXA_ROOT_DIR=@prefix@
+if [ -z "${HEXABLOCK_ROOT_DIR}" ] ; then
+export HEXABLOCK_ROOT_DIR=@CMAKE_INSTALL_PREFIX@
fi
searchFreePort() {
# for source files.
exclude_trees = []
+# A list of glob-style patterns that should be excluded when looking for source
+# files. They are matched against the source file names relative to the
+# source directory, using slashes as directory separators on all platforms.
+exclude_patterns = ['**/CVS']
+
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
--- /dev/null
+:tocdepth: 3
+
+.. _guiaddgeometry:
+
+============================
+Add a geometry to a document
+============================
+
+Only geometries added to a document can be used by that document.
+Vertices, Edges and Quadrangles of the model of blocks of a document can only be associated to those of a geometry that
+has already been added to that document.
+
+To add a geometry to a document:
+
+- *1-* Import the geometry (.brep, .step, ...) in the GEOM Module
+- *2-* Activate HexaBlock
+- *3-* Open your document or create a new one
+- *4-* In the **Main Menu** select **Association -> Add geometry**
+- *5-* Select the imported geometry and click the **Apply** button of the **Add geometry** Dialog Box
+
+
+ .. image:: _static/gui_addshape.png
+ :align: center
+
+.. centered::
+ Adding geometry to a document
+
+
+TUI command: :ref:`tuiaddgeometry`
\ No newline at end of file
gui_modify_elmts.rst
gui_modify_symmetry.rst
gui_association.rst
+ gui_add_geometry.rst
gui_asso_quad_to_geom.rst
gui_asso_vertex_to_geom.rst
gui_groups.rst
tui_modify_elmts.rst
tui_quad_revolution.rst
tui_association.rst
+ tui_add_geometry.rst
tui_asso_quad_to_geom.rst
tui_asso_vertex_to_geom.rst
tui_groups.rst
--- /dev/null
+:tocdepth: 3
+
+
+.. _tuiaddgeometry:
+
+============================
+Add a geometry to a document
+============================
+
+To add a geometry to a document in python mode, you need the following arguments:
+
+- *doc* : the document
+- *geom* : the geometry
+- *shape_name* : the name of the geometry
+
+Use the function **addShape**::
+
+ doc = hexablock.addDocument (doc_name)
+ geom = geompy.ImportBREP (shape_name + ".brep")
+ shape = hexablock.addShape (doc, geom , shape_name)
+
+GUI command: :ref:`guiaddgeometry`
HexHexa.hxx
HexMatrix.hxx
HexQuad.hxx
+ HexQpattern.hxx
HexVertex.hxx
HexLaw.hxx
HexCloner.hxx
HexVertex.cxx
HexEdge.cxx
HexQuad.cxx
+ HexQpattern.cxx
HexHexa.cxx
HexHexa_disco.cxx
HexVector.cxx
_dwInputPanel = new QDockWidget(aParent);
_dwInputPanel->setVisible(false);
_dwInputPanel->setWindowTitle("Input Panel");
+ _dwInputPanel->setObjectName("InputPanelDockWidget");
// _dwInputPanel->setMinimumWidth(DWINPUT_MINIMUM_WIDTH); // --- force a minimum until display
// _treeViewDelegate = new DocumentDelegate(_dwInputPanel);
_dwPattern->setVisible(false);
_dwPattern->setWindowTitle("Model");
_dwPattern->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+ _dwPattern->setObjectName("ModelDockWidget");
QFrame* patternFrame = new QFrame(_dwPattern);
patternFrame->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
_dwGroups->setVisible(false);
_dwGroups->setWindowTitle("Groups");
_dwGroups->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+ _dwGroups->setObjectName("GroupsDockWidget");
_groupsTreeView = new QTreeView(_dwGroups);
_groupsTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
// _groupsTreeView->setItemDelegate(_treeViewDelegate);
_dwMesh->setVisible(false);
_dwMesh->setWindowTitle("Mesh");
_dwMesh->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+ _dwMesh->setObjectName("MeshDockWidget");
_meshTreeView = new QTreeView(_dwMesh);
_meshTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
_meshTreeView->setSelectionMode(QAbstractItemView::SingleSelection);
# uic files / to be processed by pyuic
SET(_pyuic_files
- DlgRef_1List1Spin1Btn_QTD.ui
- DlgRef_1Sel1Check1List_QTD.ui
- DlgRef_1Sel1Check1Sel_QTD.ui
- DlgRef_1Sel1Check_QTD.ui
- DlgRef_1Sel1List1Check3Btn_QTD.ui
- DlgRef_1Sel1Spin1Check_QTD.ui
- DlgRef_1Sel1Spin_QTD.ui
- DlgRef_1Sel2Spin1View1Check_QTD.ui
DlgRef_1Sel2Spin_QTD.ui
- DlgRef_1Sel3Check_QTD.ui
DlgRef_1Sel3Spin_QTD.ui
- DlgRef_1Sel3Spin1Check_QTD.ui
- DlgRef_1Sel4Spin2Check_QTD.ui
- DlgRef_1Sel4Spin_QTD.ui
- DlgRef_1Sel5Spin1Check_QTD.ui
- DlgRef_1Sel5Spin_QTD.ui
- DlgRef_1Sel_QTD.ui
- DlgRef_1SelExt_QTD.ui
- DlgRef_1Spin_QTD.ui
- DlgRef_2Sel1List1Check_QTD.ui
- DlgRef_2Sel1List2Check_QTD.ui
- DlgRef_2Sel1List_QTD.ui
- DlgRef_2Sel1Spin2Check_QTD.ui
DlgRef_2Sel1Spin_QTD.ui
- DlgRef_2Sel1SpinInt_QTD.ui
- DlgRef_2Sel2List_QTD.ui
- DlgRef_2Sel2Spin1Check_QTD.ui
- DlgRef_2Sel2Spin3Check_QTD.ui
- DlgRef_2Sel2Spin_QTD.ui
- DlgRef_2Sel3Spin2Rb_QTD.ui
- DlgRef_2Sel3Spin_QTD.ui
- DlgRef_2Sel4Spin1Check_QTD.ui
DlgRef_2Sel_QTD.ui
- DlgRef_2SelExt_QTD.ui
- DlgRef_2Spin_QTD.ui
- DlgRef_3Check_QTD.ui
- DlgRef_3Radio_QTD.ui
- DlgRef_3Radio1Sel1Spin_QTD.ui
- DlgRef_3Sel1Check_QTD.ui
- DlgRef_3Sel1Spin_QTD.ui
- DlgRef_3Sel2Spin_QTD.ui
- DlgRef_3Sel3Spin1Check_QTD.ui
- DlgRef_3Sel3Spin2Check_QTD.ui
- DlgRef_3Sel4Spin2Check_QTD.ui
- DlgRef_3Sel_QTD.ui
- DlgRef_3Spin1Check_QTD.ui
DlgRef_3Spin_QTD.ui
- DlgRef_4Sel1List1Check_QTD.ui
- DlgRef_4Sel1List_QTD.ui
- DlgRef_4Sel1Spin2Check_QTD.ui
- DlgRef_4Sel1Spin3Check_QTD.ui
- DlgRef_6Sel_QTD.ui
DlgRef_Skeleton_QTD.ui
)
#define MYGEOM_MYDLGREF_HXX
#if defined WIN32
-# if defined MYDLGREF_EXPORTS || defined MYDlgRef_EXPORTS
+# if defined MYDLGREF_EXPORTS || defined MyDlgRef_EXPORTS
# define MYDLGREF_EXPORT __declspec( dllexport )
# else
# define MYDLGREF_EXPORT __declspec( dllimport )
<!-- Major module parameters -->
<parameter name="name" value="HexaBlock"/>
<parameter name="icon" value="ModuleHexablock.png"/>
- <parameter name="version" value="@VERSION@"/>
+ <parameter name="version" value="@SALOMEHEXABLOCK_VERSION@"/>
<parameter name="documentation" value="hexablock_help"/>
</section>
<section name="hexablock_help" >
<parameter name="sub_menu" value="%1 module"/>
- <parameter name="User's Guide" value="${HEXABLOCK_ROOT_DIR}/share/doc/salome/gui/HEXABLOCK/index.html"/>
+ <parameter name="User's Guide" value="%HEXABLOCK_ROOT_DIR%/share/doc/salome/gui/HEXABLOCK/index.html"/>
</section>
<section name="resources">
<!-- Module resources -->
- <parameter name="HEXABLOCK" value="${HEXABLOCK_ROOT_DIR}/share/salome/resources/hexablock"/>
+ <parameter name="HEXABLOCK" value="%HEXABLOCK_ROOT_DIR%/share/salome/resources/hexablock"/>
</section>
</document>
--- /dev/null
+# !/bin/python
+# -*- coding: latin-1 -*-
+# Hexa : Creation d'hexaedres
+
+import hexablock
+import os
+
+#---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
+
+doc = hexablock.addDocument ("default")
+vx = doc.addVector (1,0,0)
+vy = doc.addVector (0,1,0)
+vz = doc.addVector (0,0,1)
+
+vxy = doc.addVector (1,1,0)
+
+nbr_files = 0
+
+
+# ======================================================= save_vtk
+def save_vtk () :
+
+ global nbr_files
+ nom = "lecas%d.vtk" % nbr_files
+ nbr_files += 1
+ doc.saveVtk (nom)
+
+# ======================================================= carre
+def carre (x) :
+ return x*x
+
+# ======================================================= get_center
+def get_center (quad) :
+ px = 0
+ py = 0
+ pz = 0
+ for nv in range (4) :
+ vertex = quad.getVertex (nv)
+ px += vertex.getX() / 4
+ py += vertex.getY() / 4
+ pz += vertex.getZ() / 4
+ return [ px, py, pz ]
+# ======================================================= nearest
+def nearest (grid, vertex) :
+ nbre = grid.countVertex()
+ dmin = 1e+6
+ result = None
+ px = vertex.getX()
+ py = vertex.getY()
+ pz = vertex.getZ()
+ for nro in range (nbre) :
+ v1 = grid.getVertex (nro)
+ d2 = carre(px-v1.getX()) + carre(py-v1.getY()) + carre(pz-v1.getZ())
+ if (d2 < dmin) :
+ result = v1
+ dmin = d2
+
+ print vertex.getName () , px, py, pz, " -> ", result.getName()
+ return result
+
+# ======================================================= nearest_quad
+def nearest_quad (grid, quad) :
+ dmin = 1e+16
+ result = None
+ [ox, oy, oz] = get_center (quad)
+ nbre = grid.countQuad ()
+ for nro in range (nbre) :
+ q1 = grid.getQuad (nro)
+ if q1 != None :
+ [px, py, pz] = get_center (q1)
+ d2 = carre(px-ox) + carre(py-oy) + carre(pz-oz)
+ if (d2 < dmin) :
+ result = q1
+ dmin = d2
+
+ print quad.getName () , px, py, pz, " -> ", result.getName()
+ return result
+
+# ======================================================= insert_cylinder
+def insert_cylinder (plaque, nx, ny) :
+
+ hexa = plaque.getHexaIJK (nx, ny, 0)
+ xmin = 666 ; ymin = xmin ; zmin = xmin
+ xmax = -666 ; ymax = xmax ; zmax = xmax
+
+ tabv1 = []
+ for nv in range (8) :
+ node = hexa.getVertex (nv)
+ xmin = min (xmin, node.getX()) ; xmax = max (xmax, node.getX())
+ ymin = min (ymin, node.getY()) ; ymax = max (ymax, node.getY())
+ zmin = min (zmin, node.getZ()) ; zmax = max (zmax, node.getZ())
+ tabv1.append (node)
+
+ doc.removeHexa (hexa)
+ save_vtk ()
+
+ dx = (xmax - xmin)/2
+ dz = (zmax - zmin)/2
+ xorig = (xmin + xmax)/2
+ yorig = (ymin + ymax)/2
+ zorig = (zmin + zmax)/2 - dz
+
+ orig = doc.addVertex (xorig, yorig, zorig)
+ nr = 1
+ na = 4
+ nh = 1
+ rext = dx
+ rint = rext/2
+ haut = 1
+ angle = 360
+ pipe = doc.makePipeUni (orig, vxy,vz, rint,rext,angle,haut, nr,na,nh)
+
+ hexablock.what ()
+
+ tabquad = []
+ tabv0 = []
+ for nq in range (4) :
+ quad = pipe.getQuadJK (1, nq, 0)
+ tabquad.append (quad)
+
+ print " .. tabquad[0] = ", tabquad[0].getName ()
+ cible = nearest_quad (plaque, tabquad[0])
+ tabquad[0]. setColor (5)
+ cible . setColor (5)
+ save_vtk ()
+
+ va1 = tabquad[0].getVertex (0)
+ va2 = tabquad[0].getVertex (1)
+ vb1 = cible.nearestVertex (va1)
+ vb2 = cible.nearestVertex (va2)
+ doc.setLevel (1)
+ doc.joinQuadsUni (tabquad, cible, va1, vb1, va2, vb2, 1)
+ hexablock.what ()
+ save_vtk ()
+
+ return
+ doc.setLevel (1)
+ for nv in range (8) :
+ ier = doc.mergeVertices (tabv0[nv], tabv1[nv])
+ print "ier = ", ier
+ save_vtk ()
+
+
+# ======================================================= test_2013
+def test_2013 () :
+
+ orig = doc.addVertex (0,0,0)
+
+ lx = 3
+ ly = lx
+ lz = 1
+ nx = 3
+ ny = nx
+ nz = 1
+
+ plaque = doc.makeCartesianUni (orig, vx,vy,vz, lx, ly, lz, nx,ny,nz)
+ save_vtk ()
+
+ insert_cylinder (plaque, 1, 1)
+ return doc
+
+# ================================================================= Begin
+
+doc = test_2013 ()
+doc.addLaws (0.1, True)
+
+mesh_hexas = hexablock.mesh (doc)