STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-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})
2003-12-09 14:13 Nadir Bouhamou <nadir.bouhamou@cea.fr>
* src/SMESH/Makefile.in: Correcting a problem araising when
- building the SMESH module whithout Netgen.
+ building the SMESH module without Netgen.
2003-12-09 10:00 Nadir Bouhamou <nadir.bouhamou@cea.fr>
QWTHOME=$d
AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
libqwt_name=${extension}
- dnl break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+ dnl break, libqwt-qt4.so is chosen before libqwt.so since it is surely the Qt4 version.
break
fi
done
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# examples that cant be used for testing because they use external mesher plug-ins
+# examples that can't be used for testing because they use external mesher plug-ins
SET(BAD_TESTS
3dmesh.py
a3DmeshOnModified2Dmesh.py
## create compounds
# create a compound of two meshes with renaming namesake groups and
-# merging of elements with the given tolerance
+# merging elements with the given tolerance
Compound1 = smesh.Concatenate([Mesh_inf, Mesh_sup], 0, 1, 1e-05,
- name='Compound_with_RenamedGrps_and_MergeElems')
+ name='Compound with RenamedGrps and MergeElems')
# create a compound of two meshes with uniting namesake groups and
# creating groups of all elements
Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True,
- name='Compound_with_UniteGrps_and_GrpsOfAllElems')
+ name='Compound with UniteGrps and GrpsOfAllElems')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(True)
# compute the mesh
ret = tetra.Compute()
if ret == 0:
- print "probleme when computing the mesh"
+ print "problem when computing the mesh"
else:
- print "Computation succeded"
+ print "Computation succeeded"
src_mesh.Compute()
-# Mesh the box using projection algoritms
+# Mesh the box using projection algorithms
# Define the same global 1D and 2D hypotheses
tgt_mesh = smesh.Mesh(box, "Target mesh")
src_mesh.Triangle()
src_mesh.Compute()
-# Mesh the target mesh using the algoritm Projection1D2D
+# Mesh the target mesh using the algorithm Projection1D2D
tgt_mesh = smesh.Mesh(Face_2, "Target mesh")
tgt_mesh.Projection1D2D().SourceFace(Face_1,src_mesh)
tgt_mesh.Compute()
# create mesh
from SMESH_mechanic import *
# get faces with warping angle = 2.0e-13 with tolerance 5.0e-14
-criterion = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Warping, SMESH.FT_EqualTo, 2.0e-13)
-criterion.Tolerance = 5.0e-14
-filter = smesh.CreateFilterManager().CreateFilter()
-filter.SetCriteria([criterion])
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Warping, "=", 2.0e-13, Tolerance=5.0e-14)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with warping angle = 2.0e-13 (tolerance 5.0e-14):", len(ids)
# create mesh
from SMESH_mechanic import *
# get faces with area > 60 and < 90
-criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 60,\
- SMESH.FT_Undefined, SMESH.FT_LogicalAND)
+criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 60)
criterion2 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 90)
-filter = smesh.CreateFilterManager().CreateFilter()
-filter.SetCriteria([criterion1,criterion2])
+filter = smesh.GetFilterFromCriteria([criterion1,criterion2], SMESH.FT_LogicalAND)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with area in range (60,90):", len(ids)
smesh = smeshBuilder.New(salome.myStudy)
# create mesh
-face = geompy.MakeFaceHW(100, 100, 1)
-geompy.addToStudy( face, "quadrangle" )
+face = geompy.MakeFaceHW(100, 100, 1, theName="quadrangle")
mesh = smesh.Mesh(face)
mesh.Segment().NumberOfSegments(10)
mesh.Triangle().MaxElementArea(25)
# create a group of elements with area [35; 40] by removing elements with area > 40 from group aGroup
aGroup.Remove(anIds)
+aGroup.SetName("35 < Area < 40")
# print the result
aGroupElemIDs = aGroup.GetListOfID()
# Union of groups
import SMESH_mechanic
-import SMESH
+import SMESH, SALOMEDS
smesh = SMESH_mechanic.smesh
mesh = SMESH_mechanic.mesh
# create union group : area >= 20
aGroup3 = mesh.UnionListOfGroups([aGroup1, aGroup2], "Area >= 20")
+aGroup3.SetColor( SALOMEDS.Color(1.,1.,0.));
print "Criterion: Area >= 20, Nb = ", len(aGroup3.GetListOfID())
# Please note that also there is UnionGroups() method which works with two groups only
# create a group by adding elements with area < 20
aGroup4 = mesh.CreateEmptyGroup(SMESH.FACE, "Area < 20")
aGroup4.Add(anIds)
+aGroup4.SetColor( SALOMEDS.Color(1.,0.,0.));
# create union group : area >= 20 and area < 20
aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")
# Creating groups of entities basing on nodes of other groups
import SMESH_mechanic
-import SMESH
+import SMESH, SALOMEDS
smesh = SMESH_mechanic.smesh
mesh = SMESH_mechanic.mesh
# create a group by adding elements with area > 100
aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
+aSrcGroup1.SetColor( SALOMEDS.Color(1.,1.,0.))
print "Criterion: Area > 100, Nb = ", aSrcGroup1.Size()
# Criterion : AREA < 30
# create a group by adding elements with area < 30
aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
+aSrcGroup2.SetColor( SALOMEDS.Color(1.,0.,0.))
print "Criterion: Area < 30, Nb = ", aSrcGroup2.Size()
\page about_meshes_page About meshes
\n \b MESH represents a discrete approximation of a subset of the
-three-dimensional space by \ref mesh_entities "elementary geometrical
-elements".
+three-dimensional space by \ref mesh_entities "elementary geometrical elements".
A SALOME study can contain multiple meshes, but they do not
implicitly compose one super-mesh, and finally each of them
<b>Add to group</b> box, that allows choosing an existing group for
the created node or element or giving the name to a new group. By
default, the <b>Add to group</b> check box is switched off. If the user
-swiches this check box on, the combo box listing all currently
+switches this check box on, the combo box listing all currently
existing groups of the corresponding type becomes available. By
default, no group is selected. In this case, when the user presses
<b>Apply</b> or <b>Apply & Close</b> button, the warning message box
cells</b> check-box prevents merging medium nodes of quadratic
elements with corner nodes. This check-box is enabled provided
that the selected mesh includes quadratic elements.</li>
+<li>Activation of <b>Avoid making holes</b> check-box prevents merging
+ nodes that make elements invalid (but not degenerated) and hence
+ removed. Thus, no holes in place of removed elements appear. </li>
<li><b>Exclude groups from detection</b> group allows to ignore the
nodes which belong to the specified mesh groups. This control is
active provided that the mesh includes groups.</li>
analyze directly in the dialog box or select the node(s) or element(s) in
the 3D viewer.
+If <b>Show IDs</b> is activated, IDs of selected nodes or elements are
+displayed in the 3D viewer.
+
\note The information about the groups, to which the node or element belongs,
can be shown in a short or in a detailed form. By default, for performance
reasons, this information is shown in a short form (group names
\page over_constrained_faces_page Over-constrained faces
\n This mesh quality control highlights faces sharing only one border
-with other faces. In other words, the faces having all thier nodes on
+with other faces. In other words, the faces having all their nodes on
the free border of the 2D mesh are highlighted.
\note The highlighted faces are actually over-constrained only if, at
\page skew_page Skew
\n \b Skew mesh quality criterion reflects the angle between the lines
-that join opposite sides of a quadrangle element or the greatesr angle
-between three medians in triangle elements. This mesh quality
+that join opposite sides of a quadrangle element or the greatest angle
+between a median and a midline in a triangle element. This mesh quality
criterion can be applied to elements composed of 4 and 3 nodes
(quadrangles and triangles).
\code
MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
\endcode
-\n StdMeshers algoritms concerned are <em>REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD</em>.
+\n StdMeshers algorithms concerned are <em>REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD</em>.
\n SMESH Plugins provide such algorithms as: <em> NETGEN, NETGEN_FULL, FULL_NETGEN, NETGEN_1D2D3D, NETGEN_1D2D, NETGEN_2D, NETGEN_3D</em>.
\n If you use DISTENE plugins, you also have <em>BLSURF, GHS3D, GHS3DPRL, Hexotic</em>.
\tui_script{a3DmeshOnModified2Dmesh.py}
<br>
-\section tui_editing_mesh Editing a mesh
+\section tui_editing_mesh Editing a mesh (i.e. changing hypotheses)
\tui_script{creating_meshes_ex04.py}
<br>
\image html editing_groups1.png
-\image html editing_groups2.png
-
<br>
\section tui_union_of_groups Union of groups
\tui_script{grouping_elements_ex05.py}
\image html union_groups1.png
-\image html union_groups2.png
-
-\image html union_groups3.png
-
<br>
\section tui_intersection_of_groups Intersection of groups
\tui_script{grouping_elements_ex06.py}
\image html intersect_groups1.png
-\image html intersect_groups2.png
-
-\image html intersect_groups3.png
-
<br>
\section tui_cut_of_groups Cut of groups
\tui_script{grouping_elements_ex07.py}
\image html cut_groups1.png
-\image html cut_groups2.png
-
-\image html cut_groups3.png
-
<br>
-\section tui_create_dim_group Creating groups of entities from existing groups of superior dimensions
+\section tui_create_dim_group Creating groups of entities basing on nodes of other groups
\tui_script{grouping_elements_ex08.py}
\image html dimgroup_tui1.png
-<center>Source groups of faces</center>
-
-\image html dimgroup_tui2.png
-<center>Result groups of edges and nodes</center>
<ul>
$navpath
<li class="footer">
- Copyright © 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</li>
</ul>
<ul>
$navpath
<li class="footer">
- Copyright © 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE<br>
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
</li>
</ul>
* \param internalPoints - points dividing a grid into parts along an axis
* \param axis - index of an axis counterd from zero, i.e. 0==X, 1==Y, 2==Z
*
- * Parameter t of spaceFunction f(t) is a position [0,1] withing bounding box of
- * the shape to mesh or withing an interval defined by internal points
+ * Parameter t of spaceFunction f(t) is a position [0,1] within bounding box of
+ * the shape to mesh or within an interval defined by internal points
*/
void SetGridSpacing(in SMESH::string_array spaceFunctions,
in SMESH::double_array internalPoints,
Filter CreateFilter();
/*!
- * Load filter library. If libary does not exist it is created
+ * Load filter library. If library does not exist it is created
*/
FilterLibrary LoadLibrary( in string aFileName );
/*!
* Return true if a hypothesis has parameters.
*
- * This method is intended for GUI to know if "Edit" menu item sould be available
+ * This method is intended for GUI to know if "Edit" menu item should be available
*/
boolean HasParameters();
};
};
/*!
- * Auxilary flags for advanced extrusion.
+ * Auxiliary flags for advanced extrusion.
* BOUNDARY: create or not boundary for result of extrusion
* SEW: try to use existing nodes or create new nodes in any case
*/
raises (SALOME::SALOME_Exception);
/*!
- * Get geom shape to mesh. A result sould not be nil. Use HasShapeToMesh()
+ * Get geom shape to mesh. A result should not be nil. Use HasShapeToMesh()
* to know if a returned shape
*/
GEOM::GEOM_Object GetShapeToMesh()
* Get the subMesh object associated to a Sub-shape. The subMesh object
* gives access to nodes and elements IDs.
* SubMesh will be used instead of Sub-shape in a next idl version to
- * adress a specific subMesh...
+ * address a specific subMesh...
*/
SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
raises (SALOME::SALOME_Exception);
ERR_LOADF_CANT_PROJECT, // impossible to project nodes
// Load(volume)
ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
- ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
+ ERR_LOADV_COMPUTE_PARAMS, // can't compute point parameters
// Apply(shape)
ERR_APPL_NOT_LOADED, // pattern was not loaded
- ERR_APPL_BAD_DIMENTION, // wrong shape dimention
+ ERR_APPL_BAD_DIMENTION, // wrong shape dimension
ERR_APPL_BAD_NB_VERTICES, // keypoints - vertices mismatch
// Apply(face)
ERR_APPLF_BAD_TOPOLOGY, // bad pattern topology
mesh_tree_hypo.png
mesh_tree_hypo_segment.png
mesh_tree_hypo_volume.png
+ mesh_tree_hypo_cartesian.png
mesh_tree_mesh.png
mesh_tree_importedmesh.png
mesh_tree_mesh_warn.png
mesh_tree_hypo_source_3d_shape.png
mesh_tree_hypo_projection_3d.png
mesh_tree_hypo_projection_2d.png
+ mesh_tree_hypo_quadratic.png
mesh_build_compound.png
copy_mesh.png
mesh_node_to_point.png
mesh_extmeth_node_offset.png
mesh_extmeth_surf_offset_smooth.png
mesh_extmeth_face_offset.png
+ mesh_quality.png
+ mesh_show.png
+ mesh_hide.png
)
INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA})
label-id ="Quadratic Mesh"
icon-id ="mesh_algo_quad.png"
dim ="1"
- context ="GLOBAL"
auxiliary="true"/>
<hypothesis type ="MaxElementArea"
// +-----+------+ +-----+------+
// | | | |
// | | | |
- // result sould be 2 in both cases
+ // result should be 2 in both cases
//
int aResult0 = 0, aResult1 = 0;
// last node, it is a medium one in a quadratic edge
for ( ; volItr != volEnd; ++volItr )
if ( (*volItr).second >= nbNode )
nbVol++;
- // face is not free if number of volumes constructed on thier nodes more than one
+ // face is not free if number of volumes constructed on their nodes more than one
return (nbVol < 2);
}
//================================================================================
/*
Class : GroupColor
- Description : Functor for check color of group to whic mesh element belongs to
+ Description : Functor for check color of group to which mesh element belongs to
*/
//================================================================================
/*
Class : GroupColor
- Description : Functor for check color of group to whic mesh element belongs to
+ Description : Functor for check color of group to which mesh element belongs to
*/
class SMESHCONTROLS_EXPORT GroupColor: public virtual Predicate{
public:
}
// Read connectivity between zones. Nodes of the zone interface will be
- // replaced withing the zones read later
+ // replaced within the zones read later
string err = zone.ReadZonesConnection( _fn, cgnsBase, zonesByName, myMesh );
if ( !err.empty() )
addMessage( err );
int NoeudsMaille[20];
int NoeudMaille;
- MESSAGE("in DriverDAT_R_SMDS_Mesh::Read()");
/****************************************************************************
* OUVERTURE DU FICHIER EN LECTURE *
****************************************************************************/
char *file2Read = (char *)myFile.c_str();
FILE* aFileId = fopen(file2Read, "w+");
- if ( !aFileId ) {
+ if ( !aFileId )
+ {
fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read);
return DRS_FAIL;
}
****************************************************************************/
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
- while(itNodes->more()){
+ while(itNodes->more())
+ {
const SMDS_MeshNode * node = itNodes->next();
fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z());
}
-
+
/****************************************************************************
* ECRITURE DES ELEMENTS *
****************************************************************************/
/* Ecriture des connectivites, noms, numeros des mailles */
-
+
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
- while(itEdges->more()){
+ while(itEdges->more())
+ {
const SMDS_MeshElement * elem = itEdges->next();
- switch (elem->NbNodes()) {
+ switch (elem->NbNodes())
+ {
case 2:
fprintf(aFileId, "%d %d ", elem->GetID(), 102);
break;
break;
}
SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more())
+ while(it->more())
fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
}
-
+
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
- while(itFaces->more()){
+ while(itFaces->more())
+ {
const SMDS_MeshElement * elem = itFaces->next();
if ( elem->IsPoly() )
fprintf(aFileId, "%d %d ", elem->GetID(), 400+elem->NbNodes());
else
fprintf(aFileId, "%d %d ", elem->GetID(), 200+elem->NbNodes());
SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more())
+ while(it->more())
fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
}
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
- while(itVolumes->more()){
+ const SMDS_VtkVolume* v;
+ while(itVolumes->more())
+ {
const SMDS_MeshElement * elem = itVolumes->next();
if ( elem->IsPoly() )
+ {
fprintf(aFileId, "%d %d ", elem->GetID(), 500+elem->NbNodes());
+
+ if (( v = dynamic_cast< const SMDS_VtkVolume*>( elem )))
+ {
+ std::vector<int> quant = v->GetQuantities();
+ if ( !quant.empty() )
+ {
+ fprintf(aFileId, "%d %d ", (int)quant.size(), quant[0]);
+ for ( size_t i = 1; i < quant.size(); ++i )
+ fprintf(aFileId, "%d ", quant[i]);
+ }
+ }
+ }
else
+ {
fprintf(aFileId, "%d %d ", elem->GetID(), 300+elem->NbNodes());
+ }
SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more())
+ while(it->more())
fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
const bool doGroupOfFaces,
const bool doGroupOfVolumes,
const bool doGroupOf0DElems,
- const bool doGroupOfBalls)
+ const bool doGroupOfBalls,
+ const bool doAllInGroups)
{
DriverMED_FamilyPtrList aFamilies;
}
DriverMED_FamilyPtr aNullFam (new DriverMED_Family);
- aNullFam->SetId(0);
+ aNullFam->SetId( 0 );
aNullFam->myType = SMDSAbs_All;
aFamilies.push_back(aNullFam);
+ if ( doAllInGroups )
+ {
+ if ( !doGroupOfEdges )
+ {
+ DriverMED_FamilyPtr aNigEdgeFam (new DriverMED_Family);
+ aNigEdgeFam->SetId( NIG_EDGES_FAMILY );
+ aNigEdgeFam->myType = SMDSAbs_Edge;
+ aNigEdgeFam->myGroupNames.insert( NIG_GROUP_PREFIX "_EDGES" );
+ aFamilies.push_back(aNigEdgeFam);
+ }
+ if ( !doGroupOfFaces )
+ {
+ DriverMED_FamilyPtr aNigFaceFam (new DriverMED_Family);
+ aNigFaceFam->SetId( NIG_FACES_FAMILY );
+ aNigFaceFam->myType = SMDSAbs_Face;
+ aNigFaceFam->myGroupNames.insert( NIG_GROUP_PREFIX "_FACES" );
+ aFamilies.push_back(aNigFaceFam);
+ }
+ if ( !doGroupOfVolumes )
+ {
+ DriverMED_FamilyPtr aNigVolFam (new DriverMED_Family);
+ aNigVolFam->SetId( NIG_VOLS_FAMILY );
+ aNigVolFam->myType = SMDSAbs_Volume;
+ aNigVolFam->myGroupNames.insert( NIG_GROUP_PREFIX "_VOLS" );
+ aFamilies.push_back(aNigVolFam);
+ }
+ }
+
return aFamilies;
}
* Create TFamilyInfo for this family
*/
//=============================================================================
-MED::PFamilyInfo
+MED::PFamilyInfo
DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper,
const MED::PMeshInfo& theMeshInfo) const
{
*/
//=============================================================================
DriverMED_FamilyPtrList
-DriverMED_Family
-::SplitByType (SMESHDS_SubMesh* theSubMesh,
- const int theId)
+DriverMED_Family::SplitByType (SMESHDS_SubMesh* theSubMesh,
+ const int theId)
{
DriverMED_FamilyPtrList aFamilies;
DriverMED_FamilyPtr aNodesFamily (new DriverMED_Family);
#include <boost/shared_ptr.hpp>
#include <set>
+#include <limits>
#define REST_NODES_FAMILY 1
#define FIRST_NODE_FAMILY 2
#define REST_BALL_FAMILY -5
#define FIRST_ELEM_FAMILY -6
+// Not In Group families
+#define NIG_EDGES_FAMILY INT_MAX-1
+#define NIG_FACES_FAMILY INT_MAX-2
+#define NIG_VOLS_FAMILY INT_MAX-3
+#define NIG_0DELEM_FAMILY INT_MAX-4
+#define NIG_BALL_FAMILY INT_MAX-5
+#define NIG_GROUP_PREFIX "NOT_IN_GRP"
+
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;
const bool doGroupOfFaces,
const bool doGroupOfVolumes,
const bool doGroupOf0DElems,
- const bool doGroupOfBalls);
+ const bool doGroupOfBalls,
+ const bool doAllInGroups);
//! Create TFamilyInfo for this family
MED::PFamilyInfo
aFamily->SetGroupAttributVal(anAttrVal);
}
if(MYDEBUG) MESSAGE(aGroupName);
- aFamily->AddGroupName(aGroupName);
+ if ( strncmp( aGroupName.c_str(), NIG_GROUP_PREFIX, strlen(NIG_GROUP_PREFIX) ) != 0 )
+ aFamily->AddGroupName(aGroupName);
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
myDoGroupOf0DElems(false),
myDoGroupOfBalls(false),
myAutoDimension(false),
- myAddODOnVertices(false)
+ myAddODOnVertices(false),
+ myDoAllInGroups(false)
{}
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName,
myDoGroupOfVolumes = true;
}
+void DriverMED_W_SMESHDS_Mesh::AddGroupOf0DElems()
+{
+ myDoGroupOf0DElems = true;
+}
+
+void DriverMED_W_SMESHDS_Mesh::AddGroupOfBalls()
+{
+ myDoGroupOfBalls = true;
+}
+
+//================================================================================
+/*!
+ * \brief Set up a flag to add all elements not belonging to any group to
+ * some auxiliary group. This is needed for SMESH -> SAUVE -> SMESH conversion,
+ * which since PAL0023285 reads only SAUVE elements belonging to any group,
+ * and hence can lose some elements. That auxiliary group is ignored while
+ * reading a MED file.
+ */
+//================================================================================
+
+void DriverMED_W_SMESHDS_Mesh::AddAllToGroup()
+{
+ myDoAllInGroups = true;
+}
+
+
namespace
{
typedef double (SMDS_MeshNode::* TGetCoord)() const;
break;
}
}
-
+
MED::PWrapper myMed = CrWrapper(myFile,myMedVersion);
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
//MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
int nbEdges = myMesh->NbEdges();
int nbFaces = myMesh->NbFaces();
int nbVolumes = myMesh->NbVolumes();
- if (myDoGroupOfNodes && nbNodes) myNodesDefaultFamilyId = REST_NODES_FAMILY;
- if (myDoGroupOfEdges && nbEdges) myEdgesDefaultFamilyId = REST_EDGES_FAMILY;
- if (myDoGroupOfFaces && nbFaces) myFacesDefaultFamilyId = REST_FACES_FAMILY;
- if (myDoGroupOfVolumes && nbVolumes) myVolumesDefaultFamilyId = REST_VOLUMES_FAMILY;
- if (myDoGroupOf0DElems && nb0DElements) my0DElementsDefaultFamilyId = REST_0DELEM_FAMILY;
- if (myDoGroupOfBalls && nbBalls) myBallsDefaultFamilyId = REST_BALL_FAMILY;
+ if (myDoGroupOfNodes) myNodesDefaultFamilyId = REST_NODES_FAMILY;
+ if (myDoGroupOfEdges) myEdgesDefaultFamilyId = REST_EDGES_FAMILY;
+ if (myDoGroupOfFaces) myFacesDefaultFamilyId = REST_FACES_FAMILY;
+ if (myDoGroupOfVolumes) myVolumesDefaultFamilyId = REST_VOLUMES_FAMILY;
+ if (myDoGroupOf0DElems) my0DElementsDefaultFamilyId = REST_0DELEM_FAMILY;
+ if (myDoGroupOfBalls) myBallsDefaultFamilyId = REST_BALL_FAMILY;
+ if (myDoAllInGroups )
+ {
+ if (!myDoGroupOfEdges) myEdgesDefaultFamilyId = NIG_EDGES_FAMILY ;
+ if (!myDoGroupOfFaces) myFacesDefaultFamilyId = NIG_FACES_FAMILY ;
+ if (!myDoGroupOfVolumes) myVolumesDefaultFamilyId = NIG_VOLS_FAMILY ;
+ if (!myDoGroupOf0DElems) my0DElementsDefaultFamilyId = NIG_0DELEM_FAMILY ;
+ if (!myDoGroupOfBalls) myBallsDefaultFamilyId = NIG_BALL_FAMILY ;
+ }
//MESSAGE("Perform - aFamilyInfo");
list<DriverMED_FamilyPtr> aFamilies;
myDoGroupOfFaces && nbFaces,
myDoGroupOfVolumes && nbVolumes,
myDoGroupOf0DElems && nb0DElements,
- myDoGroupOfBalls && nbBalls);
+ myDoGroupOfBalls && nbBalls,
+ myDoAllInGroups);
}
else {
aFamilies = DriverMED_Family::MakeFamilies
myDoGroupOfFaces && nbFaces,
myDoGroupOfVolumes && nbVolumes,
myDoGroupOf0DElems && nb0DElements,
- myDoGroupOfBalls && nbBalls);
+ myDoGroupOfBalls && nbBalls,
+ myDoAllInGroups);
}
list<DriverMED_FamilyPtr>::iterator aFamsIter;
for (aFamsIter = aFamilies.begin(); aFamsIter != aFamilies.end(); aFamsIter++)
void AddGroupOfVolumes();
void AddGroupOf0DElems();
void AddGroupOfBalls();
+ void AddAllToGroup();
/*! functions to prepare adding one mesh
*/
bool myDoGroupOfBalls;
bool myAutoDimension;
bool myAddODOnVertices;
+ bool myDoAllInGroups;
};
#endif
};
typedef NCollection_DataMap<gp_Pnt,SMDS_MeshNode*,Hasher> TDataMapOfPntNodePtr;
- const int HEADER_SIZE = 84;
+ const int HEADER_SIZE = 84; // 80 chars + int
const int SIZEOF_STL_FACET = 50;
const int ASCII_LINES_PER_FACET = 7;
const int SIZE_OF_FLOAT = 4;
static Standard_Real readFloat(SMESH_File& theFile)
{
union {
- Standard_Boolean i;
- Standard_ShortReal f;
+ int i;
+ float f;
} u;
const char* c = theFile;
+ u.i = 0;
u.i = c[0] & 0xFF;
u.i |= (c[1] & 0xFF) << 0x08;
u.i |= (c[2] & 0xFF) << 0x10;
//=======================================================================
//function : readAscii
-//purpose :
+//purpose :
//=======================================================================
Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readAscii(SMESH_File& theFile) const
{
Status aResult = DRS_OK;
+ // get a solid name
+ if ( strncmp( "solid ", theFile, strlen("solid ")) == 0 ) // not empty
+ {
+ const char * header = theFile;
+ std::string& name = const_cast<std::string&>( myName );
+ for ( header += strlen("solid "); !iscntrl( *header ); ++header )
+ name.push_back( *header );
+
+ std::string::iterator i = name.begin();
+ while ( i != name.end() && isspace( *i )) ++i;
+ name.erase( name.begin(), i );
+
+ size_t n = name.size();
+ while ( n > 0 && isspace( name[ n - 1 ] )) --n;
+ name.resize( n );
+ }
+
// get the file size
long filesize = theFile.size();
theFile.close();
- // Open the file
+ // Open the file
FILE* file = fopen( myFile.c_str(),"r");
// count the number of lines
Standard_Integer nbLines = 0;
- for (long ipos = 0; ipos < filesize; ++ipos) {
+ for (long ipos = 0; ipos < filesize; ++ipos)
+ {
if (getc(file) == '\n')
nbLines++;
}
// go back to the beginning of the file
rewind(file);
-
+
Standard_Integer nbTri = (nbLines / ASCII_LINES_PER_FACET);
TDataMapOfPntNodePtr uniqnodes;
while (getc(file) != '\n');
// main reading
- for (Standard_Integer iTri = 0; iTri < nbTri; ++iTri) {
-
+ for (Standard_Integer iTri = 0; iTri < nbTri; ++iTri)
+ {
// skipping the facet normal
Standard_ShortReal normal[3];
fscanf(file,"%*s %*s %f %f %f\n",&normal[0],&normal[1],&normal[2]);
long filesize = file.size();
- if ( (filesize - HEADER_SIZE) % SIZEOF_STL_FACET !=0
+ if ( (filesize - HEADER_SIZE) % SIZEOF_STL_FACET != 0
// Commented to allow reading small files (ex: 1 face)
/*|| (filesize < STL_MIN_FILE_SIZE)*/) {
Standard_NoMoreObject::Raise("DriverSTL_R_SMDS_MESH::readBinary (wrong file size)");
// sometimes it is wrong, and with this technique we don't need to swap endians for integer
Standard_Integer nbTri = ((filesize - HEADER_SIZE) / SIZEOF_STL_FACET);
+ // get a solid name
+ if ( strncmp( "name: ", file, strlen("name: ")) == 0 ) // name present
+ {
+ const char * header = file;
+ std::string& name = const_cast<std::string&>( myName );
+ header += strlen("name: ");
+ name.assign( header, HEADER_SIZE - strlen("name: ") - 4);
+
+ size_t n = name.size();
+ while ( n > 0 && isspace( name[ n - 1 ] )) --n;
+ name.resize( n );
+ }
+
// skip the header
file += HEADER_SIZE;
DriverSTL_R_SMDS_Mesh();
virtual Status Perform();
void SetIsCreateFaces( const bool theIsCreate = true );
+ std::string GetName() const { return myName; }
private:
// PRIVATE METHODS
- Status readAscii (SMESH_File& file) const;
- Status readBinary(SMESH_File& file) const;
-
+ Status readAscii (SMESH_File& file) const;
+ Status readBinary(SMESH_File& file) const;
+
private:
// PRIVATE FIELDS
- bool myIsCreateFaces;
- bool myIsAscii;
+ bool myIsCreateFaces;
+ bool myIsAscii;
+ std::string myName;
};
#endif
{
union {
Standard_ShortReal f;
- char c[4];
+ char c[4];
} u;
u.f = theVal;
SMESH_File aFile( myFile, /*openForReading=*/false );
aFile.openForWriting();
- std::string buf("solid\n");
+ std::string buf("solid ");
+ buf += myName + "\n";
aFile.writeRaw( buf.c_str(), buf.size() );
char sval[128];
" endfacet\n", 21 );
}
}
- aFile.writeRaw ("endsolid\n" , 9 );
+ buf = "endsolid " + myName + "\n";
+ aFile.writeRaw( buf.c_str(), buf.size() );
return aResult;
}
}
}
std::string sval( LABEL_SIZE, ' ' );
+ if ( !myName.empty() )
+ {
+ sval = "name: " + myName;
+ sval.resize( LABEL_SIZE, ' ' );
+ }
aFile.write( sval.c_str(), LABEL_SIZE );
// write number of triangles
~DriverSTL_W_SMDS_Mesh();
virtual Status Perform();
void SetIsAscii( const bool theIsAscii = false );
+ void SetName( const std::string name ) { myName = name; }
private:
// PRIVATE METHODS
private:
// PRIVATE FIELDS
- bool myIsAscii;
+ bool myIsAscii;
+ std::string myName;
int myNbVolumeTrias;
std::vector<const SMDS_MeshElement*> myVolumeFacets; // tmp faces
};
aRec.node_labels[6],
aRec.node_labels[4],
aRec.node_labels[2],
+
+ aRec.node_labels[12],
+
aRec.node_labels[7],
aRec.node_labels[5],
aRec.node_labels[3],
aRec.node_labels[11],
aRec.node_labels[10],
aRec.node_labels[9],
- aRec.node_labels[12],
aRec.label);
break;
TDataSet aDataSet2411;
// Storing SMDS nodes to the UNV file
//-----------------------------------
- MESSAGE("Perform - myMesh->NbNodes() = "<<myMesh->NbNodes());
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
TRecord aRec;
while ( aNodesIter->more() )
aRec.coord[2] = aNode->Z();
aDataSet2411.push_back( aRec );
}
- MESSAGE("Perform - aDataSet2411.size() = "<<aDataSet2411.size());
UNV2411::Write(out_stream,aDataSet2411);
}
{
TDataSet aDataSet2412;
// Storing SMDS Edges
- MESSAGE("Perform - myMesh->NbEdges() = "<<myMesh->NbEdges());
if(myMesh->NbEdges()){
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
while( anIter->more() )
}
aDataSet2412.push_back(aRec);
}
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
- MESSAGE("Perform - myMesh->NbFaces() = "<<myMesh->NbFaces());
if ( myMesh->NbFaces() )
{
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
}
aDataSet2412.push_back(aRec);
}
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
- MESSAGE("Perform - myMesh->NbVolumes() = "<<myMesh->NbVolumes());
if ( myMesh->NbVolumes() )
{
SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
aDataSet2412.push_back(aRec);
}
}
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
UNV2412::Write(out_stream,aDataSet2412);
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#ifndef MED_Utilities_HeaderFile
-#define MED_Utilities_HeaderFile
+#ifndef UNV_Utilities_HeaderFile
+#define UNV_Utilities_HeaderFile
#include "SMESH_DriverUNV.hxx"
};
/**
- * @returns \p false when error occured, \p true otherwise.
+ * @returns \p false when error occurred, \p true otherwise.
* Adjusts the \p in_stream to the beginning of the
* dataset \p ds_name.
*/
{
/* find "D" in string, start looking at
* 6th element, to improve speed.
- * We dont expect a "D" earlier
+ * We don't expect a "D" earlier
*/
const size_t position = number.find("D",6);
if ( position != std::string::npos )
#ifndef MED_SliceArray_HeaderFile
#define MED_SliceArray_HeaderFile
-#ifdef WIN32 // for correctly compiling "valarray" in modules, which are includes this file
+#ifdef WIN32 // for correctly compiling "valarray" in modules, which includes this file
#undef max
#undef min
#endif
namespace MED
{
//---------------------------------------------------------------
- //! This class intends to provide an uniform way to handle multy-dimention data (const version)
+ //! This class intends to provide a uniform way to handle multidimensional data (const version)
/*!
- It just contains pointer to real sequence and implement proper calcultion of its indexes.
- This class deal with constant pointer to the sources data and provide const method to
- read the them (data).
+ It just contains a pointer to real sequence and implement proper calculation of its indexes.
+ This class deals with constant pointer to the sources data and provides const method to
+ read them (data).
*/
template<class TValueType>
class TCSlice
{
- const TValueType* myCValuePtr; //!< Reference to source multy-dimension data
- size_t mySourceSize; //!< Size of the source multy-dimension data
+ const TValueType* myCValuePtr; //!< Reference to source multidimensional data
+ size_t mySourceSize; //!< Size of the source multidimensional data
std::slice mySlice; //!< Defines algorithm of index calculation
protected:
throw std::out_of_range("TCSlice::check_id");
}
- //! Calculate internal index to get proper element from the source multy-dimension data
+ //! Calculate internal index to get proper element from the source multidimensional data
size_t
calculate_id(size_t theId) const
{
//---------------------------------------------------------------
- //! This class extend TCSlice functionality for non-constant case
+ //! This class extends TCSlice functionality for non-constant case
template<class TValueType>
class TSlice: public TCSlice<TValueType>
{
virtual TModeSwitchInfo
{
EEntiteMaillage myEntity; //!< Defines the MED Entity where the mesh cells belongs to
- //! Let known what MED ENTITY the cells belong to
+ //! Find out what MED ENTITY the cells belong to
EEntiteMaillage GetEntity() const { return myEntity;}
EGeometrieElement myGeom; //!< Defines the MED Geometric type of the instance
- //! Let known what MED geometrical type the cells belong to
+ //! Find out what MED geometrical type the cells belong to
EGeometrieElement GetGeom() const { return myGeom;}
EConnectivite myConnMode; //!< Defines connectivity mode
- //! Let known in what connectivity the cells are writen
+ //! Find out in what connectivity the cells are written
EConnectivite GetConnMode() const { return myConnMode;}
virtual TInt GetConnDim() const = 0; //!< Gives step in the connectivity sequence
{
//! Defines the MED Entity where the polygons belongs to
EEntiteMaillage myEntity; // MED_FACE|MED_MAILLE
- //! Let known what MED ENTITY the MED Polygons belong to
+ //! Find out what MED ENTITY the MED Polygons belong to
EEntiteMaillage GetEntity() const { return myEntity;}
//! Defines the MED Geometric type of the instance
EGeometrieElement myGeom; // ePOLYGONE
- //! Let known what MED geometrical type the MED Polygons belong to
+ //! Find out what MED geometrical type the MED Polygons belong to
EGeometrieElement GetGeom() const { return ePOLYGONE;}
//! Defines connectivity mode
EConnectivite myConnMode; // eNOD|eDESC(eDESC not used)
- //! Let known in what connectivity the cells are writen
+ //! Find out in what connectivity the cells are written
EConnectivite GetConnMode() const { return myConnMode;}
PElemNum myConn; //!< Table de connectivities
{
//! Defines the MED Entity where the polyedres belongs to
EEntiteMaillage myEntity; // MED_FACE|MED_MAILLE
- //! Let known what MED ENTITY the MED Polyedres belong to
+ //! Find out what MED ENTITY the MED Polyedres belong to
EEntiteMaillage GetEntity() const { return myEntity;}
//! Defines the MED Geometric type of the instance
EGeometrieElement myGeom; // ePOLYEDRE
- //! Let known what MED geometrical type the MED Polyedres belong to
+ //! Find out what MED geometrical type the MED Polyedres belong to
EGeometrieElement GetGeom() const { return ePOLYEDRE;}
//! Defines connectivity mode
EConnectivite myConnMode; // eNOD|eDESC(eDESC not used)
- //! Let known in what connectivity the cells are writen
+ //! Find out in what connectivity the cells are written
EConnectivite GetConnMode() const { return myConnMode;}
PElemNum myConn; //!< Table de connectivities
struct MEDWRAPPER_EXPORT TFieldInfo:
virtual TNameInfo
{
- PMeshInfo myMeshInfo; //!< A reference to correspondig MED Mesh
+ PMeshInfo myMeshInfo; //!< A reference to corresponding MED Mesh
//! Get a reference to corresponding MED Mesh
const PMeshInfo& GetMeshInfo() const { return myMeshInfo;}
- ETypeChamp myType; //!< Defines type of the MED Field
- //! Let known what type of the MED FIELD is used
+ ETypeChamp myType; //!< Defines type of MED Field
+ //! Find out what type of MED FIELD is used
ETypeChamp GetType() const { return myType;}
TInt myNbComp; //!< Defines number of components stored in the field
- //! Get number of components for the MED FIELD
+ //! Get number of components for MED FIELD
TInt GetNbComp() const { return myNbComp;}
EBooleen myIsLocal; //!< Defines if the MED Field is local
- //! Let known is the MED FIELD is local or not
+ //! Find out if MED FIELD is local or not
EBooleen GetIsLocal() const { return myIsLocal;}
- TInt myNbRef; //!< Defines number of refereces of the field
- //! Let known number of references for the MED FIELD
+ TInt myNbRef; //!< Defines number of references of the field
+ //! Find out number of references for the MED FIELD
TInt GetNbRef() const { return myNbRef;}
TString myCompNames; //!< Contains names for each of MED Field components
//! Defines, which geometrical type the MED Gauss entity belongs to
EGeometrieElement myGeom;
- //! Let known what MED geometrical type the MED GAUSS entity belong to
+ //! Find out what MED geometrical type the MED GAUSS entity belong to
EGeometrieElement GetGeom() const { return myGeom;}
//! Contains coordinates for the refereced nodes
//! Defines the MED Entity where the MED TimeStamp belongs to
EEntiteMaillage myEntity;
- //! Let known to what MED Entity the MED TimeStamp belong to
+ //! Find out to what MED Entity the MED TimeStamp belong to
EEntiteMaillage GetEntity() const { return myEntity;}
//! Keeps map of number of cells per geometric type where the MED TimeStamp belongs to
typedef boost::tuple<TKey,TInt> TInfo;
EModeProfil myMode; //!< Keeps mode for the MED Profile
- //! Let known what mode of MED Profile is used
+ //! Find out what mode of MED Profile is used
EModeProfil GetMode() const { return myMode;}
//! Set mode for the MED Profile
void SetMode(EModeProfil theMode) { myMode = theMode;}
//! Set number of mesh elelemts by its order number
void SetElemNum(TInt theId, TInt theVal);
- //! Let known is the MED Profile defined
+ //! Find out if the MED Profile defined
bool IsPresent() const { return GetName() != "";}
- //! Let known size of the MED Profile
+ //! Find out size of the MED Profile
TInt GetSize() const { return (TInt)myElemNum->size();}
};
struct MEDWRAPPER_EXPORT TWrapper
{
typedef boost::mutex TMutex;
- //! This is a syncronization primitive which allow to support thread safety for the MED access
+ //! This is a synchronization primitive which allow to support thread safety for the MED access
TMutex myMutex;
virtual
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}
myIsPointsVisible = false;
myIsEntityModeCache = false;
+ myRepresentationCache = 0;
myHighlightActor = SMESH_SVTKActor::New();
myHighlightActor->Delete(); // vtkSmartPointer!
myScalarBarActor->VisibilityOff();
- if(GetVisibility()){
- if(theIsUpdateRepersentation)
+ if ( GetVisibility() ) {
+ if ( theIsUpdateRepersentation )
SetRepresentation(GetRepresentation());
if(myControlMode != eNone) {
void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
{
- myEntityState = eAllEntity;
+ unsigned int anObjectEntities = eAllEntity; // entities present in my object
if(!myVisualObj->GetNbEntities(SMDSAbs_0DElement)) {
- myEntityState &= ~e0DElements;
+ anObjectEntities &= ~e0DElements;
theMode &= ~e0DElements;
}
if(!myVisualObj->GetNbEntities(SMDSAbs_Ball)) {
- myEntityState &= ~eBallElem;
+ anObjectEntities &= ~eBallElem;
theMode &= ~eBallElem;
}
if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)) {
- myEntityState &= ~eEdges;
+ anObjectEntities &= ~eEdges;
theMode &= ~eEdges;
}
if(!myVisualObj->GetNbEntities(SMDSAbs_Face)) {
- myEntityState &= ~eFaces;
+ anObjectEntities &= ~eFaces;
theMode &= ~eFaces;
}
if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)) {
- myEntityState &= ~eVolumes;
+ anObjectEntities &= ~eVolumes;
theMode &= ~eVolumes;
}
theMode |= eVolumes;
}
- myBaseActor->myGeomFilter->SetInside(myEntityMode != myEntityState);
+ myBaseActor->myGeomFilter->SetInside(myEntityMode != anObjectEntities);
- myEntityMode = theMode;
-
- VTKViewer_ExtractUnstructuredGrid* aFilter = myBaseActor->GetExtractUnstructuredGrid();
- aFilter->ClearRegisteredCellsWithType();
- VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
- aHightFilter->ClearRegisteredCellsWithType();
-
- bool isPassAll =
- (( myEntityMode & e0DElements || myVisualObj->GetNbEntities(SMDSAbs_0DElement) == 0 ) &&
- ( myEntityMode & eBallElem || myVisualObj->GetNbEntities(SMDSAbs_Ball) == 0 ) &&
- ( myEntityMode & eEdges || myVisualObj->GetNbEntities(SMDSAbs_Edge) == 0 ) &&
- ( myEntityMode & eFaces || myVisualObj->GetNbEntities(SMDSAbs_Face) == 0 ) &&
- ( myEntityMode & eVolumes || myVisualObj->GetNbEntities(SMDSAbs_Volume) == 0 ));
- if ( isPassAll && myEntityMode )
+ if ( anObjectEntities == 0 && myRepresentation != ePoint ) // no elements, show nodes
{
- aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
- aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
+ myRepresentationCache = GetRepresentation();
+ SetRepresentation( ePoint );
}
- else
+
+ if ( myEntityMode != theMode )
{
- aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ myEntityMode = theMode; // entities to show
- if (myEntityMode & e0DElements) {
- aFilter->RegisterCellsWithType(VTK_VERTEX);
- aHightFilter->RegisterCellsWithType(VTK_VERTEX);
- }
+ // Set cell types to extract
+
+ VTKViewer_ExtractUnstructuredGrid* aFilter = myBaseActor->GetExtractUnstructuredGrid();
+ VTKViewer_ExtractUnstructuredGrid* aHltFilter = myHighlitableActor->GetExtractUnstructuredGrid();
+ aFilter->ClearRegisteredCellsWithType();
+ aHltFilter->ClearRegisteredCellsWithType();
- if (myEntityMode & eBallElem) {
- aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
+ bool isPassAll = ( myEntityMode == anObjectEntities && myEntityMode );
+ if ( isPassAll )
+ {
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
+ aHltFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll);
}
+ else
+ {
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aHltFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- if (myEntityMode & eEdges) {
- aFilter->RegisterCellsWithType(VTK_LINE);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+ if (myEntityMode & e0DElements) {
+ aFilter->RegisterCellsWithType(VTK_VERTEX);
+ aHltFilter->RegisterCellsWithType(VTK_VERTEX);
+ }
- aHightFilter->RegisterCellsWithType(VTK_LINE);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
- }
+ if (myEntityMode & eBallElem) {
+ aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
+ }
- if (myEntityMode & eFaces) {
- aFilter->RegisterCellsWithType(VTK_TRIANGLE);
- aFilter->RegisterCellsWithType(VTK_QUAD);
- aFilter->RegisterCellsWithType(VTK_POLYGON);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
- aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
- aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
-
- aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
- aHightFilter->RegisterCellsWithType(VTK_QUAD);
- aHightFilter->RegisterCellsWithType(VTK_POLYGON);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
- aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
- aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
- }
+ if (myEntityMode & eEdges) {
+ aFilter->RegisterCellsWithType(VTK_LINE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
- if (myEntityMode & eVolumes) {
- aFilter->RegisterCellsWithType(VTK_TETRA);
- aFilter->RegisterCellsWithType(VTK_VOXEL);
- aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
- aFilter->RegisterCellsWithType(VTK_WEDGE);
- aFilter->RegisterCellsWithType(VTK_PYRAMID);
- aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
- aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
- aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
- aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
- aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
-
- aHightFilter->RegisterCellsWithType(VTK_TETRA);
- aHightFilter->RegisterCellsWithType(VTK_VOXEL);
- aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
- aHightFilter->RegisterCellsWithType(VTK_WEDGE);
- aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
- aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
- aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
- aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
- aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
- aHightFilter->RegisterCellsWithType(VTK_POLYHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_LINE);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+ }
+
+ if (myEntityMode & eFaces) {
+ aFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_QUAD);
+ aFilter->RegisterCellsWithType(VTK_POLYGON);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
+ aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
+ aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
+
+ aHltFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aHltFilter->RegisterCellsWithType(VTK_QUAD);
+ aHltFilter->RegisterCellsWithType(VTK_POLYGON);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON);
+ aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
+ aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
+ }
+
+ if (myEntityMode & eVolumes) {
+ aFilter->RegisterCellsWithType(VTK_TETRA);
+ aFilter->RegisterCellsWithType(VTK_VOXEL);
+ aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+ aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
+
+ aHltFilter->RegisterCellsWithType(VTK_TETRA);
+ aHltFilter->RegisterCellsWithType(VTK_VOXEL);
+ aHltFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_WEDGE);
+ aHltFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aHltFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
+ aHltFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+ aHltFilter->RegisterCellsWithType(VTK_POLYHEDRON);
+ }
}
+ if ( GetVisibility() )
+ aFilter->Update();
+ if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());
}
- if ( GetVisibility() )
- aFilter->Update();
- if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());
- SetVisibility(GetVisibility(),false);
+
+ SetVisibility( GetVisibility(), myRepresentationCache != 0 );
}
void SMESH_ActorDef::SetRepresentation (int theMode)
int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
+ if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls )
+ {
+ theMode = myRepresentationCache;
+ if ( theMode == eSurface && aNbFaces + aNbVolumes == 0 )
+ theMode = eEdge;
+ else
+ myRepresentationCache = 0;
+ }
+
if (theMode < 0) {
myRepresentation = eSurface;
if (!aNbFaces && !aNbVolumes && !aNbBalls && aNbEdges) {
case eLength:
case eMultiConnection:
aProp = aBackProp = my1DProp;
- if(myRepresentation != ePoint)
+ if ( myRepresentation != ePoint )
aReperesent = SMESH_DeviceActor::eInsideframe;
break;
default:;
SetFacesOriented(myIsFacesOriented);
}
- if(myVisualObj->GetEntitiesFlag()) {
- myEntityMode |= myVisualObj->GetEntitiesState();
- }
+ // if(myVisualObj->GetEntitiesFlag()) { IPAL53915
+ // myEntityMode |= myVisualObj->GetEntitiesState();
+ // }
SetEntityMode(GetEntityMode());
SetVisibility(GetVisibility());
SMESH_DeviceActor* my0DExtActor;
unsigned int myEntityMode;
- unsigned int myEntityState;
unsigned int myEntityModeCache;
+ int myRepresentationCache;
bool myIsEntityModeCache;
bool myIsPointsVisible;
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshCell.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
+#include "SMESHDS_Mesh.hxx"
+#include "SMESHDS_Script.hxx"
#include "SMESH_Actor.h"
#include "SMESH_ControlsDef.hxx"
#include <stdexcept>
#include <set>
-#include "utilities.h"
+#include <utilities.h>
using namespace std;
NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh()
if ( MYDEBUG ) MESSAGE("*** buildPrs ==> compactMesh!");
GetMesh()->compactMesh();
+ if ( SMESHDS_Mesh* m = dynamic_cast<SMESHDS_Mesh*>( GetMesh() )) // IPAL53915
+ m->GetScript()->SetModified(false); // drop IsModified set in compactMesh()
}
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
updateEntitiesFlags();
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
{
- // Convertions connectivities from SMDS to VTK
+ // Convert connectivities from SMDS to VTK
if (aType == SMDSAbs_Volume && anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
anIdList->Reset();
{
NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh()
GetMesh()->compactMesh();
+ if ( SMESHDS_Mesh* m = dynamic_cast<SMESHDS_Mesh*>( GetMesh() )) // IPAL53915
+ m->GetScript()->SetModified(false); // drop IsModified set in compactMesh()
updateEntitiesFlags();
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
myGrid->ShallowCopy(theGrid);
// rnv begin
// Customization of the vtkScalarBarActor to show distribution histogram.
- if(myDistributionColoringType == SMESH_MULTICOLOR_TYPE && GetDistributionVisibility() && distrVisibility)
- {
- rgb = distColors->GetPointer(3*dcCount); //write into array directly
- rgb[0] = rgba[0];
- rgb[1] = rgba[1];
- rgb[2] = rgba[2];
- dcCount++;
- }
+ if ( myDistributionColoringType == SMESH_MULTICOLOR_TYPE &&
+ GetDistributionVisibility() &&
+ distrVisibility &&
+ myNbValues[i] > 0 )
+ {
+ rgb = distColors->GetPointer(3*dcCount); //write into array directly
+ rgb[0] = rgba[0];
+ rgb[1] = rgba[1];
+ rgb[2] = rgba[2];
+ dcCount++;
}
+ }
// Now position everything properly
//
// This is not done inside a function of SALOME because allocated memory is not always
// returned to the system. (PAL16631)
//
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
#include <sys/sysinfo.h>
#endif
int main (int argc, char ** argv)
{
// To better understand what is going on here, consult bug [SALOME platform 0019911]
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
struct sysinfo si;
int err = sysinfo( &si );
if ( err )
#include <iterator>
using namespace std;
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
#include <sys/sysinfo.h>
#endif
int SMDS_Mesh::CheckMemory(const bool doNotRaise) throw (std::bad_alloc)
{
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
struct sysinfo si;
int err = sysinfo( &si );
if ( err )
if ( !n1 || !n2 ) return 0;
SMDS_MeshEdge * edge = 0;
- // --- retreive nodes ID
+ // --- retrieve nodes ID
vector<vtkIdType> nodeIds;
nodeIds.clear();
nodeIds.push_back(n1->getVtkId());
return myInfo.NbNodes();
}
+///////////////////////////////////////////////////////////////////////////////
+/// Return the number of elements
+///////////////////////////////////////////////////////////////////////////////
+int SMDS_Mesh::NbElements() const
+{
+ return myInfo.NbElements();
+}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements
///////////////////////////////////////////////////////////////////////////////
IdSortedIterator(const SMDS_MeshElementIDFactory& fact,
const SMDSAbs_ElementType type, // SMDSAbs_All NOT allowed!!!
const int totalNb)
- :myIDFact( fact ),
+ :myIDFact( const_cast<SMDS_MeshElementIDFactory&>(fact) ),
myID(1), myMaxID( myIDFact.GetMaxID() ),myNbFound(0), myTotalNb( totalNb ),
myType( type ),
myElem(0)
if (const SMDS_VtkEdge* vtkElem = dynamic_cast<const SMDS_VtkEdge*>(*it))
myEdgePool->destroy((SMDS_VtkEdge*) vtkElem);
else {
- ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
+ ((SMDS_MeshElement*) *it)->init( 0, -1, -1 ); // avoid reuse
delete (*it);
}
break;
if (const SMDS_VtkFace* vtkElem = dynamic_cast<const SMDS_VtkFace*>(*it))
myFacePool->destroy((SMDS_VtkFace*) vtkElem);
else {
- ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
+ ((SMDS_MeshElement*) *it)->init( 0, -1, -1 ); // avoid reuse
delete (*it);
}
break;
if (const SMDS_VtkVolume* vtkElem = dynamic_cast<const SMDS_VtkVolume*>(*it))
myVolumePool->destroy((SMDS_VtkVolume*) vtkElem);
else {
- ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
+ ((SMDS_MeshElement*) *it)->init( 0, -1, -1 ); // avoid reuse
delete (*it);
}
break;
if (const SMDS_BallElement* vtkElem = dynamic_cast<const SMDS_BallElement*>(*it))
myBallPool->destroy(const_cast<SMDS_BallElement*>( vtkElem ));
else {
- ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
+ ((SMDS_MeshElement*) *it)->init( 0, -1, -1 ); // avoid reuse
delete (*it);
}
break;
void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
{
int elemId = elem->GetID();
- int vtkId = elem->getVtkId();
+ int vtkId = elem->getVtkId();
SMDSAbs_ElementType aType = elem->GetType();
- SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
- if (aType == SMDSAbs_Node) {
+ SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
+ if ( aType == SMDSAbs_Node )
+ {
// only free node can be removed by this method
const SMDS_MeshNode* n = static_cast<SMDS_MeshNode*>(todest);
- SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
- if (!itFe->more()) { // free node
+ if ( n->NbInverseElements() == 0 ) { // free node
myNodes[elemId] = 0;
myInfo.myNbNodes--;
((SMDS_MeshNode*) n)->SetPosition(SMDS_SpacePosition::originSpacePosition());
- ((SMDS_MeshNode*) n)->SMDS_MeshElement::init( -1, -1, -1 ); // avoid reuse
+ ((SMDS_MeshNode*) n)->SMDS_MeshElement::init( 0, -1, -1 ); // avoid reuse
myNodePool->destroy(static_cast<SMDS_MeshNode*>(todest));
myNodeIDFactory->ReleaseID(elemId, vtkId);
}
- } else {
+ }
+ else
+ {
if (hasConstructionEdges() || hasConstructionFaces())
// this methods is only for meshes without descendants
return;
// --- to do: keep vtkid in a list of reusable cells
if ( elem )
- ((SMDS_MeshElement*) elem)->init( -1, -1, -1 ); // avoid reuse
+ ((SMDS_MeshElement*) elem)->init( 0, -1, -1 ); // avoid reuse
}
}
SMDS_Mesh();
- //! to retreive this SMDS_Mesh instance from its elements (index stored in SMDS_Elements)
+ //! to retrieve this SMDS_Mesh instance from its elements (index stored in SMDS_Elements)
static std::vector<SMDS_Mesh*> _meshList;
//! actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
virtual int NbNodes() const;
+ virtual int NbElements() const;
virtual int Nb0DElements() const;
virtual int NbBalls() const;
virtual int NbEdges() const;
// ============================================================
-class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject
+class SMDS_EXPORT SMDS_MeshElement : public SMDS_MeshObject
{
public:
bool SMDS_MeshElementIDFactory::BindID(int ID, SMDS_MeshElement * elem)
{
- MESSAGE("SMDS_MeshElementIDFactory::BindID " << ID);
SetInVtkGrid(elem);
return myMesh->registerElement(ID, elem);
}
SMDS_UnstructuredGrid * grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
vtkPoints *points = grid->GetPoints();
points->InsertPoint(myVtkID, x, y, z);
- grid->GetLinks()->ResizeForPoint( myVtkID );
+ if ( grid->HasLinks() )
+ grid->GetLinks()->ResizeForPoint( myVtkID );
}
SMDS_MeshNode::~SMDS_MeshNode()
SMDS_MeshNode_MyInvIterator(SMDS_Mesh *mesh, vtkIdType* cells, int ncells, SMDSAbs_ElementType type) :
myMesh(mesh), myCells(cells), myNcells(ncells), myType(type), iter(0)
{
- cellList.reserve( ncells );
- if (type == SMDSAbs_All)
- cellList.assign( cells, cells + ncells );
- else
- for (int i = 0; i < ncells; i++)
+ if ( ncells )
+ {
+ cellList.reserve( ncells );
+ if (type == SMDSAbs_All)
+ {
+ cellList.assign( cells, cells + ncells );
+ }
+ else
{
- int vtkId = cells[i];
- int smdsId = myMesh->fromVtkToSmds(vtkId);
- const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
- if (elem->GetType() == type)
+ for (int i = 0; i < ncells; i++)
{
- cellList.push_back(vtkId);
+ int vtkId = cells[i];
+ int smdsId = myMesh->fromVtkToSmds(vtkId);
+ const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
+ if (elem->GetType() == type)
+ {
+ cellList.push_back(vtkId);
+ }
}
}
- myCells = cellList.empty() ? 0 : &cellList[0];
- myNcells = cellList.size();
+ myCells = cellList.empty() ? 0 : &cellList[0];
+ myNcells = cellList.size();
+ }
}
bool more()
SMDS_ElemIteratorPtr SMDS_MeshNode::GetInverseElementIterator(SMDSAbs_ElementType type) const
{
- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID);
- return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
-}
-
-// Same as GetInverseElementIterator but the created iterator only returns
-// wanted type elements.
-class SMDS_MeshNode_MyIterator:public SMDS_ElemIterator
-{
-private:
- SMDS_Mesh* myMesh;
- vtkIdType* myCells;
- int myNcells;
- SMDSAbs_ElementType myType;
- int iter;
- vector<SMDS_MeshElement*> myFiltCells;
-
-public:
- SMDS_MeshNode_MyIterator(SMDS_Mesh *mesh,
- vtkIdType* cells,
- int ncells,
- SMDSAbs_ElementType type):
- myMesh(mesh), myCells(cells), myNcells(ncells), myType(type), iter(0)
+ if ( SMDS_Mesh::_meshList[myMeshId]->NbElements() > 0 ) // avoid building links
{
- for (; iter<ncells; iter++)
- {
- int vtkId = myCells[iter];
- int smdsId = myMesh->fromVtkToSmds(vtkId);
- const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
- if (elem->GetType() == type)
- myFiltCells.push_back((SMDS_MeshElement*)elem);
- }
- myNcells = myFiltCells.size();
- iter = 0;
- }
-
- bool more()
- {
- return (iter< myNcells);
+ vtkCellLinks::Link& l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID);
+ return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
}
-
- const SMDS_MeshElement* next()
+ else
{
- const SMDS_MeshElement* elem = myFiltCells[iter];
- iter++;
- return elem;
+ return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], 0, 0, type));
}
-};
+}
-SMDS_ElemIteratorPtr SMDS_MeshNode::
-elementsIterator(SMDSAbs_ElementType type) const
+SMDS_ElemIteratorPtr SMDS_MeshNode::elementsIterator(SMDSAbs_ElementType type) const
{
- if(type==SMDSAbs_Node)
- return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
+ if ( type == SMDSAbs_Node )
+ return SMDS_MeshElement::elementsIterator( SMDSAbs_Node );
else
- {
- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID);
- return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
- }
+ return GetInverseElementIterator( type );
}
int SMDS_MeshNode::NbNodes() const
/*!
* \brief thread safe getting coords
*/
+//================================================================================
+
void SMDS_MeshNode::GetXYZ(double xyz[3]) const
{
return SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetPoint(myVtkID,xyz);
}
-//* resize the vtkPoints structure every SMDS_Mesh::chunkSize points
+//================================================================================
void SMDS_MeshNode::setXYZ(double x, double y, double z)
{
SMDS_Mesh *mesh = SMDS_Mesh::_meshList[myMeshId];
void SMDS_MeshNode::AddInverseElement(const SMDS_MeshElement* ME)
{
SMDS_UnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
- vtkCellLinks *Links = grid->GetLinks();
- Links->ResizeCellList(myVtkID, 1);
- Links->AddCellReference(ME->getVtkId(), myVtkID);
+ if ( grid->HasLinks() )
+ {
+ vtkCellLinks *Links = grid->GetLinks();
+ Links->ResizeCellList(myVtkID, 1);
+ Links->AddCellReference(ME->getVtkId(), myVtkID);
+ }
}
//=======================================================================
SMDS_Mesh::_meshList[myMeshId]->getGrid()->ResizeCellList(myVtkID, 0);
}
-bool SMDS_MeshNode::emptyInverseElements()
-{
- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID);
- return (l.ncells == 0);
-}
-
//================================================================================
/*!
* \brief Count inverse elements of given type
int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const
{
- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID);
-
- if ( type == SMDSAbs_All )
- return l.ncells;
-
int nb = 0;
- SMDS_Mesh *mesh = SMDS_Mesh::_meshList[myMeshId];
- for (int i=0; i<l.ncells; i++)
+ if ( SMDS_Mesh::_meshList[myMeshId]->NbElements() > 0 ) // avoid building links
{
- const SMDS_MeshElement* elem = mesh->FindElement(mesh->fromVtkToSmds(l.cells[i]));
- if (elem->GetType() == type)
- nb++;
- }
- return nb;
-}
+ vtkCellLinks::Link& l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID);
-///////////////////////////////////////////////////////////////////////////////
-/// To be used with STL set
-///////////////////////////////////////////////////////////////////////////////
-bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2)
-{
- return e1.getVtkId()<e2.getVtkId();
- /*if(e1.myX<e2.myX) return true;
- else if(e1.myX==e2.myX)
+ if ( type == SMDSAbs_All )
+ return l.ncells;
+
+ SMDS_Mesh *mesh = SMDS_Mesh::_meshList[myMeshId];
+ for ( int i = 0; i < l.ncells; i++ )
{
- if(e1.myY<e2.myY) return true;
- else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
- else return false;
+ const SMDS_MeshElement* elem = mesh->FindElement( mesh->fromVtkToSmds( l.cells[i] ));
+ nb += ( elem->GetType() == type );
}
- else return false;*/
+ }
+ return nb;
}
-
void AddInverseElement(const SMDS_MeshElement * ME);
void RemoveInverseElement(const SMDS_MeshElement * parent);
void ClearInverseElements();
- bool emptyInverseElements();
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
#ifndef _SMDS_TypeOfPosition_HeaderFile
#define _SMDS_TypeOfPosition_HeaderFile
-enum SMDS_TypeOfPosition // Value is equal to shape dimention
+enum SMDS_TypeOfPosition // Value is equal to shape dimension
{
SMDS_TOP_UNSPEC = -1,
SMDS_TOP_VERTEX = 0,
SaveFacet( SMDS_VolumeTool::Facet& facet ): myToRestore( facet )
{
mySaved = facet;
+ mySaved.myNodes.swap( facet.myNodes );
}
~SaveFacet()
{
if ( myToRestore.myIndex != mySaved.myIndex )
myToRestore = mySaved;
+ myToRestore.myNodes.swap( mySaved.myNodes );
}
};
//purpose : Set volume to iterate on
//=======================================================================
-bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume,
- const bool ignoreCentralNodes)
+bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume,
+ const bool ignoreCentralNodes,
+ const std::vector<const SMDS_MeshNode*>* otherNodes)
{
// reset fields
myVolume = 0;
}
// set nodes
- int iNode = 0;
myVolumeNodes.resize( myVolume->NbNodes() );
- SMDS_ElemIteratorPtr nodeIt = myVolume->nodesIterator();
- while ( nodeIt->more() )
- myVolumeNodes[ iNode++ ] = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
+ if ( otherNodes )
+ {
+ if ( otherNodes->size() != myVolumeNodes.size() )
+ return ( myVolume = 0 );
+ for ( size_t i = 0; i < otherNodes->size(); ++i )
+ if ( ! ( myVolumeNodes[i] = (*otherNodes)[0] ))
+ return ( myVolume = 0 );
+ }
+ else
+ {
+ int iNode = 0;
+ SMDS_ElemIteratorPtr nodeIt = myVolume->nodesIterator();
+ while ( nodeIt->more() )
+ myVolumeNodes[ iNode++ ] = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
+ }
// check validity
if ( !setFace(0) )
SMDS_VolumeTool ();
~SMDS_VolumeTool ();
- SMDS_VolumeTool (const SMDS_MeshElement* theVolume,
- const bool ignoreCentralNodes=true);
+ SMDS_VolumeTool( const SMDS_MeshElement* theVolume,
+ const bool ignoreCentralNodes = true);
- bool Set (const SMDS_MeshElement* theVolume,
- const bool ignoreCentralNodes=true);
+ bool Set( const SMDS_MeshElement* theVolume,
+ const bool ignoreCentralNodes = true,
+ const std::vector<const SMDS_MeshNode*>* nodes = 0);
// Set volume.
// Return false if theVolume is not of type SMDSAbs_Volume.
// ignoreCentralNodes makes skip nodes at face centers when returning
- // nodes of faces of SMDSEntity_TriQuad_Hexa
+ // nodes of faces of SMDSEntity_TriQuad_Hexa.
+ // alternative nodes can be provided
const SMDS_MeshVolume* Element() const;
// return element
// top and bottom faces are reversed.
// Result of IsForward() and methods returning nodes change
- const SMDS_MeshNode** GetNodes() { return &myVolumeNodes[0]; }
+ const SMDS_MeshNode** GetNodes() const { return (const SMDS_MeshNode**) &myVolumeNodes[0]; }
// Return array of volume nodes
- int NbNodes() { return myVolumeNodes.size(); }
+ int NbNodes() const { return myVolumeNodes.size(); }
// Return array of volume nodes
double GetSize() const;
}
}
-chrono::chrono(int i) :
+salome_chrono::salome_chrono(int i) :
_run(true), _ctr(i)
{
//MESSAGE("chrono::chrono " << _ctr << " " << _run);
_start = clock();
}
-chrono::~chrono()
+salome_chrono::~salome_chrono()
{
if (_run)
stop();
}
-void chrono::stop()
+void salome_chrono::stop()
{
//MESSAGE("chrono::stop " << _ctr << " " << _run);
if (_run)
static int _nbChrono;
};
-class SMDS_EXPORT chrono
+class SMDS_EXPORT salome_chrono
{
public:
- chrono(int i);
- ~chrono();
+ salome_chrono(int i);
+ ~salome_chrono();
void stop();
protected:
bool _run;
#ifdef CHRONODEF
#define CHRONO(i) counters::_ctrs[i]._ctrNames = (char *)__FILE__; \
counters::_ctrs[i]._ctrLines = __LINE__; \
- chrono aChrono##i(i);
+ salome_chrono aChrono##i(i);
#define CHRONOSTOP(i) aChrono##i.stop();
//=============================================================================
/*!
- * Usually an algoritm has nothing to save
+ * Usually an algorithm has nothing to save
*/
//=============================================================================
TopExp::Vertices(theEdge, v1, v2);
const SMDS_MeshNode* n1 = VertexNode( v1, eSubMesh, 0 );
const SMDS_MeshNode* n2 = VertexNode( v2, eSubMesh, 0 );
+ const SMDS_MeshNode* nEnd[2] = { nbNodes ? theNodes.begin()->second : 0,
+ nbNodes ? theNodes.rbegin()->second : 0 };
Standard_Real f, l;
BRep_Tool::Range(theEdge, f, l);
if ( v1.Orientation() != TopAbs_FORWARD )
std::swap( f, l );
- if ( n1 && ++nbNodes )
+ if ( n1 && n1 != nEnd[0] && n1 != nEnd[1] && ++nbNodes )
theNodes.insert( make_pair( f, n1 ));
- if ( n2 && ++nbNodes )
+ if ( n2 && n2 != nEnd[0] && n2 != nEnd[1] && ++nbNodes )
theNodes.insert( make_pair( l, n2 ));
return (int)theNodes.size() == nbNodes;
if ( !fIt->more() )
return MEr_EMPTY;
- // We check that olny links on EDGEs encouter once, the rest links, twice
+ // We check that only links on EDGEs encouter once, the rest links, twice
set< SMESH_TLink > links;
while ( fIt->more() )
{
// ==================================================================
// SMESH_Hypothesis::GetDim();
- // 1 - dimention of target mesh
+ // 1 - dimension of target mesh
bool OnlyUnaryInput() const { return _onlyUnaryInput; }
// 2 - is collection of tesselatable shapes inacceptable as input;
// 3 - is a Dim-1 mesh prerequisite
bool NeedShape() const { return _requireShape; }
- // 4 - is shape existance required
+ // 4 - is shape existence required
bool SupportSubmeshes() const { return _supportSubmeshes; }
// 5 - whether supports submeshes if !NeedDiscreteBoundary()
//vtkDebugLeaks::SetExitError(0);
}
+namespace
+{
+ // a structure used to nullify SMESH_Gen field of SMESH_Hypothesis,
+ // which is needed for SMESH_Hypothesis not deleted before ~SMESH_Gen()
+ struct _Hyp : public SMESH_Hypothesis
+ {
+ void NullifyGen()
+ {
+ _gen = 0;
+ }
+ };
+}
+
//=============================================================================
/*!
* Destructor
std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
{
- delete i_sc->second->myDocument;
- delete i_sc->second;
- }
+ StudyContextStruct* context = i_sc->second;
+ std::map < int, SMESH_Hypothesis * >::iterator i_hyp = context->mapHypothesis.begin();
+ for ( ; i_hyp != context->mapHypothesis.end(); ++i_hyp )
+ {
+ if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second ))
+ h->NullifyGen();
+ }
+ delete context->myDocument;
+ delete context;
+ }
}
//=============================================================================
// one face only.
SMESH_subMesh::compute_event computeEvent =
aShapeOnly ? SMESH_subMesh::COMPUTE_SUBMESH : SMESH_subMesh::COMPUTE;
+ if ( !aMesh.HasShapeToMesh() )
+ computeEvent = SMESH_subMesh::COMPUTE_NOGEOM; // if several algos and no geometry
if ( anUpward ) // is called from the below code in this method
{
ret = Evaluate( aMesh, aShape, aResMap, /*anUpward=*/true, aShapesId );
}
- MESSAGE( "VSR - SMESH_Gen::Evaluate() finished, OK = " << ret);
return ret;
}
SMESH_Mesh& aMesh = *aSubMesh->GetFather();
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
- filter.And( filter.IsApplicableTo( aShape ));
+ if ( aMesh.HasShapeToMesh() )
+ filter.And( filter.IsApplicableTo( aShape ));
typedef SMESH_Algo::Features AlgoData;
//=============================================================================
/*!
- * Genarate a new id unique withing this Gen
+ * Genarate a new id unique within this Gen
*/
//=============================================================================
// Author : Paul RASCLE, EDF
// Module : SMESH
//
-#include "SMESH_Hypothesis.hxx"
-#include "SMESHDS_Mesh.hxx"
#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-#include "SMESH_subMesh.hxx"
-#include "utilities.h"
+#include "SMESHDS_Mesh.hxx"
+#include "SMESH_Hypothesis.hxx"
+#include "SMESH_Mesh.hxx"
using namespace std;
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
SMESH_Hypothesis::~SMESH_Hypothesis()
{
- StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
- myStudyContext->mapHypothesis[_hypId] = 0;
+ if ( _gen )
+ {
+ StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+ myStudyContext->mapHypothesis[_hypId] = 0;
+ }
}
//=============================================================================
{
int dim = 0;
switch (_type)
- {
- case ALGO_1D: dim = 1; break;
- case ALGO_2D: dim = 2; break;
- case ALGO_3D: dim = 3; break;
- case ALGO_0D: dim = 0; break;
- case PARAM_ALGO:
- dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
- }
+ {
+ case ALGO_1D: dim = 1; break;
+ case ALGO_2D: dim = 2; break;
+ case ALGO_3D: dim = 3; break;
+ case ALGO_0D: dim = 0; break;
+ case PARAM_ALGO:
+ dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
+ }
return dim;
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
*
* An auxiliary hypothesis is optional, i.e. an algorithm
* can work without it and another hypothesis of the same
- * dimention can be assigned to the shape
+ * dimension can be assigned to the shape
*/
virtual bool IsAuxiliary() const
{ return GetType() == PARAM_ALGO && _param_algo_dim < 0; }
//purpose :
//=======================================================================
-int SMESH_Mesh::STLToMesh(const char* theFileName)
+std::string SMESH_Mesh::STLToMesh(const char* theFileName)
{
if(_isShapeToMesh)
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
myReader.SetMeshId(-1);
myReader.Perform();
- return 1;
+ return myReader.GetName();
}
//================================================================================
}
}
HasModificationsToDiscard(); // to reset _isModified flag if a mesh becomes empty
+ GetMeshDS()->Modified();
if(MYDEBUG) subMesh->DumpAlgoState(true);
if(MYDEBUG) SCRUTE(ret);
}
HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty
+ GetMeshDS()->Modified();
if(MYDEBUG) subMesh->DumpAlgoState(true);
if(MYDEBUG) SCRUTE(ret);
//=============================================================================
/*!
- * Get the SMESH_subMesh object implementation. Dont create it, return null
+ * Get the SMESH_subMesh object implementation. Don't create it, return null
* if it does not exist.
*/
//=============================================================================
//=============================================================================
/*!
- * Get the SMESH_subMesh object implementation. Dont create it, return null
+ * Get the SMESH_subMesh object implementation. Don't create it, return null
* if it does not exist.
*/
//=============================================================================
* - 2D if all mesh nodes lie on XOY coordinate plane, or
* - 3D in the rest cases.
* If \a theAutoDimension is \c false, the space dimension is always 3.
+ * \param [in] theAddODOnVertices - to create 0D elements on all vertices
+ * \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413)
* \return int - mesh index in the file
*/
//================================================================================
int theVersion,
const SMESHDS_Mesh* meshPart,
bool theAutoDimension,
- bool theAddODOnVertices)
+ bool theAddODOnVertices,
+ bool theAllElemsToGroup)
throw(SALOME_Exception)
{
SMESH_TRY;
myWriter.AddGroupOfEdges();
myWriter.AddGroupOfFaces();
myWriter.AddGroupOfVolumes();
+ myWriter.AddGroupOf0DElems();
+ myWriter.AddGroupOfBalls();
}
+ if ( theAllElemsToGroup )
+ myWriter.AddAllToGroup();
// Pass groups to writer. Provide unique group names.
//set<string> aGroupNames; // Corrected for Mantis issue 0020028
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
cmd += "\"";
system(cmd.c_str());
- ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, 1);
+ ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*theVersion=*/1,
+ /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
+ /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
#ifdef WIN32
cmd = "%PYTHONBIN% ";
#else
void SMESH_Mesh::ExportSTL(const char * file,
const bool isascii,
+ const char * name,
const SMESHDS_Mesh* meshPart) throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
myWriter.SetIsAscii( isascii );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS);
myWriter.SetMeshId(_id);
+ if ( name ) myWriter.SetName( name );
myWriter.Perform();
}
//=======================================================================
//function : IsNotConformAllowed
-//purpose : check if a hypothesis alowing notconform mesh is present
+//purpose : check if a hypothesis allowing notconform mesh is present
//=======================================================================
bool SMESH_Mesh::IsNotConformAllowed() const
//=======================================================================
//function : GetAncestors
//purpose : return list of ancestors of theSubShape in the order
-// that lower dimention shapes come first.
+// that lower dimension shapes come first.
//=======================================================================
const TopTools_ListOfShape& SMESH_Mesh::GetAncestors(const TopoDS_Shape& theS) const
int MEDToMesh(const char* theFileName, const char* theMeshName);
- int STLToMesh(const char* theFileName);
+ std::string STLToMesh(const char* theFileName);
int CGNSToMesh(const char* theFileName, const int theMeshIndex, std::string& theMeshName);
bool IsUsedHypothesis(SMESHDS_Hypothesis * anHyp,
const SMESH_subMesh * aSubMesh);
/*!
- * \brief check if a hypothesis alowing notconform mesh is present
+ * \brief check if a hypothesis allowing notconform mesh is present
*/
bool IsNotConformAllowed() const;
bool IsMainShape(const TopoDS_Shape& theShape) const;
/*!
* \brief Return list of ancestors of theSubShape in the order
- * that lower dimention shapes come first
+ * that lower dimension shapes come first
*/
const TopTools_ListOfShape& GetAncestors(const TopoDS_Shape& theSubShape) const;
int theVersion = 0,
const SMESHDS_Mesh* theMeshPart = 0,
bool theAutoDimension = false,
- bool theAddODOnVertices = false)
+ bool theAddODOnVertices = false,
+ bool theAllElemsToGroup = false)
throw(SALOME_Exception);
void ExportDAT(const char * file,
const SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
void ExportSTL(const char * file,
const bool isascii,
+ const char * name = 0,
const SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
void ExportCGNS(const char * file,
const SMESHDS_Mesh* mesh,
//=======================================================================
//function : IsQuadraticSubMesh
-//purpose : Check submesh for given shape: if all elements on this shape
+//purpose : Check sub-meshes of a given shape: if all elements on sub-shapes
// are quadratic, quadratic elements will be created.
-// Also fill myTLinkNodeMap
+// Fill myTLinkNodeMap
//=======================================================================
bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
SMESHDS_Mesh* meshDS = GetMeshDS();
// we can create quadratic elements only if all elements
// created on sub-shapes of given shape are quadratic
- // also we have to fill myTLinkNodeMap
myCreateQuadratic = true;
mySeamShapeIds.clear();
myDegenShapeIds.clear();
}
SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge );
-
- //int nbOldLinks = myTLinkNodeMap.size();
-
if ( !myMesh->HasShapeToMesh() )
{
if (( myCreateQuadratic = myMesh->NbFaces( ORDER_QUADRATIC )))
}
}
+//=======================================================================
+/*!
+ * \brief Copy shape information from another helper. Used to improve performance
+ * since SetSubShape() can be time consuming if there are many edges
+ */
+//=======================================================================
+
+void SMESH_MesherHelper::CopySubShapeInfo(const SMESH_MesherHelper& other)
+{
+ this->myShape = other.myShape;
+ this->myShapeID = other.myShapeID;
+ this->myDegenShapeIds = other.myDegenShapeIds;
+ this->mySeamShapeIds = other.mySeamShapeIds;
+ this->myPar1[0] = other.myPar1[0];
+ this->myPar1[1] = other.myPar1[1];
+ this->myPar2[0] = other.myPar2[0];
+ this->myPar2[1] = other.myPar2[1];
+ this->myParIndex = other.myParIndex;
+ this->myFace2Surface = other.myFace2Surface;
+}
+
//=======================================================================
//function : ShapeToIndex
//purpose : Convert a shape to its index in the SMESHDS_Mesh
if ( !bestEdge.IsNull() )
{
- // move n12 to position of a successfull projection
+ // move n12 to position of a successful projection
//double tol = BRep_Tool::Tolerance(edges[ iOkEdge ]);
if ( !force3d /*&& distMiddleProj > 2*tol*/ )
{
}
// get nodes on theBaseEdge sorted by param on edge and initialize theParam2ColumnMap with them
+ const SMDS_MeshNode* prevEndNodes[2] = { 0, 0 };
edge = theBaseSide.begin();
for ( int iE = 0; edge != theBaseSide.end(); ++edge, ++iE )
{
const double prevPar = theParam2ColumnMap.empty() ? 0 : theParam2ColumnMap.rbegin()->first;
for ( u_n = sortedBaseNN.begin(); u_n != sortedBaseNN.end(); u_n++ )
{
+ if ( u_n->second == prevEndNodes[0] ||
+ u_n->second == prevEndNodes[1] )
+ continue;
double par = prevPar + coeff * ( u_n->first - f );
TParam2ColumnMap::iterator u2nn =
theParam2ColumnMap.insert( theParam2ColumnMap.end(), make_pair( par, TNodeColumn()));
u2nn->second.push_back( u_n->second );
}
+ prevEndNodes[0] = sortedBaseNN.begin()->second;
+ prevEndNodes[1] = sortedBaseNN.rbegin()->second;
}
if ( theParam2ColumnMap.size() < 2 )
return false;
//purpose : Return true if 2D mesh on FACE is ditorted
//=======================================================================
-bool SMESH_MesherHelper::IsDistorted2D( SMESH_subMesh* faceSM,
- bool checkUV)
+bool SMESH_MesherHelper::IsDistorted2D( SMESH_subMesh* faceSM,
+ bool checkUV,
+ SMESH_MesherHelper* faceHelper)
{
if ( !faceSM || faceSM->GetSubShape().ShapeType() != TopAbs_FACE )
return false;
bool haveBadFaces = false;
SMESH_MesherHelper helper( *faceSM->GetFather() );
+ if ( faceHelper )
+ helper.CopySubShapeInfo( *faceHelper );
helper.SetSubShape( faceSM->GetSubShape() );
const TopoDS_Face& F = TopoDS::Face( faceSM->GetSubShape() );
SMESHDS_SubMesh* smDS = helper.GetMeshDS()->MeshElements( F );
if ( !smDS || smDS->NbElements() == 0 ) return false;
+ bool subIdsValid = true; // shape ID of nodes is OK
+ if ( helper.HasSeam() )
+ {
+ // check if nodes are bound to seam edges
+ SMESH_subMeshIteratorPtr smIt = faceSM->getDependsOnIterator(/*includeSelf=*/false);
+ while ( smIt->more() && subIdsValid )
+ {
+ SMESH_subMesh* sm = smIt->next();
+ if ( helper.IsSeamShape( sm->GetId() ) && sm->IsEmpty() )
+ subIdsValid = false;
+ }
+ }
SMDS_ElemIteratorPtr faceIt = smDS->GetElements();
double prevArea = 0;
vector< const SMDS_MeshNode* > nodes;
if ( isOnDegen )
continue;
}
- // prepare to getting UVs
+ // prepare for getting UVs
const SMDS_MeshNode* inFaceNode = 0;
if ( helper.HasSeam() ) {
for ( size_t i = 0; ( i < nodes.size() && !inFaceNode ); ++i )
if ( !helper.IsSeamShape( nodes[ i ]->getshapeId() ))
+ {
inFaceNode = nodes[ i ];
+ if ( !subIdsValid )
+ {
+ gp_XY uv = helper.GetNodeUV( F, inFaceNode );
+ if ( helper.IsOnSeam( uv ))
+ inFaceNode = NULL;
+ }
+ }
if ( !inFaceNode )
continue;
}
for ( size_t i = 0; i < nodes.size(); ++i )
uv[ i ] = helper.GetNodeUV( F, nodes[ i ], inFaceNode, toCheckUV );
+ if ( !subIdsValid ) // fix uv on seam
+ {
+ gp_XY uvInFace = helper.GetNodeUV( F, inFaceNode );
+ for ( size_t i = 0; i < uv.size(); ++i )
+ if ( helper.IsOnSeam( uv[i] ))
+ uv[i] = helper.getUVOnSeam( uv[i], uvInFace ).XY();
+ }
+
// compare orientation of triangles
double faceArea = 0;
for ( int iT = 0, nbT = nodes.size()-2; iT < nbT; ++iT )
//=======================================================================
//function : IsSubShape
-//purpose :
+//purpose :
//=======================================================================
bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape,
* of the FACE normal
* \return double - the angle (between -Pi and Pi), negative if the angle is concave,
* 1e100 in case of failure
- * \waring Care about order of the EDGEs and their orientation to be as they are
+ * \warning Care about order of the EDGEs and their orientation to be as they are
* within the FACE! Don't pass degenerated EDGEs neither!
*/
//================================================================================
return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
}
+//=======================================================================
+//function : IsOnSeam
+//purpose : Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
+//=======================================================================
+
+int SMESH_MesherHelper::IsOnSeam(const gp_XY& uv) const
+{
+ for ( int i = U_periodic; i <= V_periodic ; ++i )
+ if ( myParIndex & i )
+ {
+ double p = uv.Coord( i );
+ double tol = ( myPar2[i-1] - myPar1[i-1] ) / 100.;
+ if ( Abs( p - myPar1[i-1] ) < tol ||
+ Abs( p - myPar2[i-1] ) < tol )
+ return i;
+ }
+ return 0;
+}
+
namespace {
//=======================================================================
TopTools_ListIteratorOfListOfShape _ancIter;
TopAbs_ShapeEnum _type;
TopTools_MapOfShape _encountered;
- TAncestorsIterator( const TopTools_ListOfShape& ancestors, TopAbs_ShapeEnum type)
+ TopTools_IndexedMapOfShape _allowed;
+ TAncestorsIterator( const TopTools_ListOfShape& ancestors,
+ TopAbs_ShapeEnum type,
+ const TopoDS_Shape* container/* = 0*/)
: _ancIter( ancestors ), _type( type )
{
+ if ( container && !container->IsNull() )
+ TopExp::MapShapes( *container, type, _allowed);
if ( _ancIter.More() ) {
- if ( _ancIter.Value().ShapeType() != _type ) next();
+ if ( !isCurrentAllowed() ) next();
else _encountered.Add( _ancIter.Value() );
}
}
const TopoDS_Shape* s = _ancIter.More() ? & _ancIter.Value() : 0;
if ( _ancIter.More() )
for ( _ancIter.Next(); _ancIter.More(); _ancIter.Next())
- if ( _ancIter.Value().ShapeType() == _type && _encountered.Add( _ancIter.Value() ))
+ if ( isCurrentAllowed() && _encountered.Add( _ancIter.Value() ))
break;
return s;
}
+ bool isCurrentAllowed()
+ {
+ return (( _ancIter.Value().ShapeType() == _type ) &&
+ ( _allowed.IsEmpty() || _allowed.Contains( _ancIter.Value() )));
+ }
};
} // namespace
//=======================================================================
/*!
- * \brief Return iterator on ancestors of the given type
+ * \brief Return iterator on ancestors of the given type, included into a container shape
*/
//=======================================================================
PShapeIteratorPtr SMESH_MesherHelper::GetAncestors(const TopoDS_Shape& shape,
const SMESH_Mesh& mesh,
- TopAbs_ShapeEnum ancestorType)
+ TopAbs_ShapeEnum ancestorType,
+ const TopoDS_Shape* container)
{
- return PShapeIteratorPtr( new TAncestorsIterator( mesh.GetAncestors(shape), ancestorType));
+ return PShapeIteratorPtr
+ ( new TAncestorsIterator( mesh.GetAncestors(shape), ancestorType, container));
}
//=======================================================================
* \brief Make up a chain of links
* \param iSide - link to add first
* \param chain - chain to fill in
- * \param pos - postion of medium nodes the links should have
+ * \param pos - position of medium nodes the links should have
* \param error - out, specifies what is wrong
* \retval bool - false if valid chain can't be built; "valid" means that links
* of the chain belongs to rectangles bounding hexahedrons
if ( _sideIsAdded[ iSide ]) // already in chain
return true;
- if ( _sides.size() != 4 ) { // triangle - visit all my continous faces
+ if ( _sides.size() != 4 ) { // triangle - visit all my continuous faces
MSGBEG( *this );
TLinkSet links;
list< const QFace* > faces( 1, this );
if ( link->MediumPos() >= pos ) {
int nbLinkFaces = link->_faces.size();
if ( nbLinkFaces == 4 || (/*nbLinkFaces < 4 && */link->OnBoundary())) {
- // hexahedral mesh or boundary quadrangles - goto a continous face
+ // hexahedral mesh or boundary quadrangles - goto a continuous face
if ( const QFace* f = link->GetContinuesFace( this ))
if ( f->_sides.size() == 4 )
return f->GetLinkChain( *chLink, chain, pos, error );
* \brief Move medium node of theLink according to its distance from boundary
* \param theLink - link to fix
* \param theRefVec - movement of boundary
- * \param theLinks - all adjacent links of continous triangles
+ * \param theLinks - all adjacent links of continuous triangles
* \param theFaceHelper - helper is not used so far
* \param thePrevLen - distance from the boundary
* \param theStep - number of steps till movement propagation limit
< const SMDS_MeshElement*, vector< SMDS_ElemIteratorPtr > > TIterOnIter;
SMDS_ElemIteratorPtr faceIter( new TIterOnIter( faceIterVec ));
- // a seacher to check if a volume is close to a concave face
- std::auto_ptr< SMESH_ElementSearcher > faceSearcher
+ // search to check if a volume is close to a concave face
+ SMESHUtils::Deleter< SMESH_ElementSearcher > faceSearcher
( SMESH_MeshAlgos::GetElementSearcher( *theHelper.GetMeshDS(), faceIter ));
// classifier
gp_Pnt pMedium = SMESH_TNodeXYZ( linkIt->second );
double hMedium = faceNorm * gp_Vec( pOnFace0, pMedium ).XYZ();
double hVol = faceNorm * gp_Vec( pOnFace0, pInSolid ).XYZ();
- isDistorted = ( Abs( hMedium ) > Abs( hVol * 0.5 ));
+ isDistorted = ( Abs( hMedium ) > Abs( hVol * 0.75 ));
}
}
}
/*!
* \brief Return true if 2D mesh on FACE is distored
*/
- static bool IsDistorted2D( SMESH_subMesh* faceSM, bool checkUV=false );
+ static bool IsDistorted2D( SMESH_subMesh* faceSM,
+ bool checkUV = false,
+ SMESH_MesherHelper* faceHelper = NULL);
/*!
* \brief Returns true if given node is medium
* \brief Count nb of sub-shapes
* \param shape - the shape
* \param type - the type of sub-shapes to count
- * \param ignoreSame - if true, use map not to count same shapes, esle use explorer
+ * \param ignoreSame - if true, use map not to count same shapes, else use explorer
* \retval int - the calculated number
*/
static int Count(const TopoDS_Shape& shape,
const SMESH_Mesh& mesh,
TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE);
/*!
- * \brief Return iterator on ancestors of the given type
+ * \brief Return iterator on ancestors of the given type, included into a container shape
*/
static PShapeIteratorPtr GetAncestors(const TopoDS_Shape& shape,
const SMESH_Mesh& mesh,
- TopAbs_ShapeEnum ancestorType);
+ TopAbs_ShapeEnum ancestorType,
+ const TopoDS_Shape* container = 0);
/*!
* \brief Find a common ancestor, of the given type, of two shapes
*/
* \brief Return the shape set by IsQuadraticSubMesh() or SetSubShape()
*/
const TopoDS_Shape& GetSubShape() const { return myShape; }
+ /*!
+ * \brief Copy shape information from another helper to improve performance
+ * since SetSubShape() can be time consuming if there are many edges
+ */
+ void CopySubShapeInfo(const SMESH_MesherHelper& other);
+
/*!
* \brief Convert a shape to its index in the SMESHDS_Mesh
* \brief Return an alternative parameter for a node on seam
*/
double GetOtherParam(const double param) const;
+ /*!
+ * \brief Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
+ */
+ int IsOnSeam(const gp_XY& uv) const;
/*!
* \brief Return existing or create new medium nodes between given ones
static void WriteShape(const TopoDS_Shape& s);
+
protected:
/*!
double getFaceMaxTol( const TopoDS_Shape& face ) const;
+
private:
- // Forbiden copy constructor
+ // forbidden copy constructor
SMESH_MesherHelper (const SMESH_MesherHelper& theOther);
// key of a map of bi-quadratic face to it's central node
bool SMESH_Pattern::Load (const char* theFileContents)
{
- MESSAGE("Load( file ) ");
-
Kernel_Utils::Localizer loc;
// file structure:
// ! This is a comment
// NB_POINTS ! 1 integer - the number of points in the pattern.
// X1 Y1 [Z1] ! 2 or 3 reals - nodes coordinates within 2D or 3D domain:
- // X2 Y2 [Z2] ! the pattern dimention is defined by the number of coordinates
+ // X2 Y2 [Z2] ! the pattern dimension is defined by the number of coordinates
// ...
// [ ID1 ID2 ... IDn ] ! Indices of key-points for a 2D pattern (only).
// ! elements description goes after all
// X1 Y1 [Z1] ! 2 or 3 reals - nodes coordinates within 2D or 3D domain:
- // read the first point coordinates to define pattern dimention
+ // read the first point coordinates to define pattern dimension
int dim = readLine( fields, lineBeg, clearFields );
if ( dim == 2 )
myIs2D = true;
bool SMESH_Pattern::Save (ostream& theFile)
{
- MESSAGE(" ::Save(file) " );
-
Kernel_Utils::Localizer loc;
if ( !IsLoaded() ) {
TopoDS_Vertex the1stVertex,
bool theKeepNodes)
{
- MESSAGE(" ::Load(face) " );
Clear();
myIs2D = true;
myToKeepNodes = theKeepNodes;
if ( needProject )
{
- MESSAGE("Project the submesh");
// ---------------------------------------------------------------
// The case where the submesh is projected to theFace
// ---------------------------------------------------------------
double u = epos->GetUParameter();
paramNodeMap.insert( make_pair( u, node ));
}
- if ((int) paramNodeMap.size() != eSubMesh->NbNodes() ) {
+ if ((int) paramNodeMap.size() != eSubMesh->NbNodes() - nbMeduimNodes ) {
// wrong U on edge, project
Extrema_ExtPC proj;
BRepAdaptor_Curve aCurve( edge );
// resUV /= 2.;
// }
- if ( isDeformed ) {
- MESSAGE("intersectIsolines(), d1 = " << d1 << ", d2 = " << d2 << ", delta = " << delta <<
- ", " << (loc1 - loc2).SquareModulus() << " > " << delta * delta);
- }
+ // if ( isDeformed ) {
+ // MESSAGE("intersectIsolines(), d1 = " << d1 << ", d2 = " << d2 << ", delta = " << delta <<
+ // ", " << (loc1 - loc2).SquareModulus() << " > " << delta * delta);
+ // }
return true;
}
}
if ( !intersectIsolines( uv1[0], uv2[0], ratio[0],
uv1[1], uv2[1], ratio[1], theUV, theIsDeformed )) {
- MESSAGE(" Cant intersect isolines for a point "<<theInitUV.X()<<", "<<theInitUV.Y());
+ MESSAGE(" Can't intersect isolines for a point "<<theInitUV.X()<<", "<<theInitUV.Y());
return setErrorCode( ERR_APPLF_BAD_TOPOLOGY );
}
return false;
}
else {
- //MESSAGE(" Cant improve UV, uv: "<<uv.X()<<" "<<uv.Y());
+ //MESSAGE(" Can't improve UV, uv: "<<uv.X()<<" "<<uv.Y());
}
}
if ( !oldIsIn && nbOldFix ) {
return false;
}
else {
- //MESSAGE(" Cant fix UV, uv: "<<uv.X()<<" "<<uv.Y());
+ //MESSAGE(" Can't fix UV, uv: "<<uv.X()<<" "<<uv.Y());
}
}
if ( newIsIn && oldIsIn )
list < TIsoNode* > internNodes;
bool needIteration = true;
if ( startNodes.empty() ) {
- MESSAGE( " Starting UV by compUVByIsoIntersection()");
+ //MESSAGE( " Starting UV by compUVByIsoIntersection()");
needIteration = false;
map < double, TIsoLine >& isos = isoMap[ 0 ];
map < double, TIsoLine >::iterator isoIt = isos.begin();
#endif
} while ( maxMove > 1e-8 && nbIter++ < maxNbIter );
- MESSAGE( "compUVByElasticIsolines(): Nb iterations " << nbIter << " dist: " << sqrt( maxMove ));
+ //MESSAGE( "compUVByElasticIsolines(): Nb iterations " << nbIter << " dist: " << sqrt( maxMove ));
if ( nbIter >= maxNbIter && sqrt(maxMove) > minUvSize * 0.05 ) {
MESSAGE( "compUVByElasticIsolines() failed: "<<sqrt(maxMove)<<">"<<minUvSize * 0.05);
list< TPoint* > & ePoints = getShapePoints( eID++ );
TPoint* p = ePoints.front();
if ( !compUVByIsoIntersection( theEdgesPointsList, p->myInitUV, p->myUV, aBool )) {
- MESSAGE("cant sortSameSizeWires()");
+ MESSAGE("can't sortSameSizeWires()");
return false;
}
gcVec[iW] += p->myUV;
const TopoDS_Vertex& theVertexOnKeyPoint1,
const bool theReverse)
{
- MESSAGE(" ::Apply(face) " );
TopoDS_Face face = theReverse ? TopoDS::Face( theFace.Reversed() ) : theFace;
if ( !setShapeToMesh( face ))
return false;
if ( nbWires > 1 )
{
// compute UV of inner edge-points using the method for in-face points
- // and devide eList into a list of separate wires
+ // and divide eList into a list of separate wires
bool aBool;
list< list< TopoDS_Edge > > wireList;
list<TopoDS_Edge>::iterator eIt = elIt;
for ( pIt++; pIt != ePoints.end(); pIt++ ) {
TPoint* p = (*pIt);
if ( !compUVByIsoIntersection( edgesPointsList, p->myInitUV, p->myUV, aBool )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
// keep the computed UV to compare against by setFirstEdge()
for ( pIt = fPoints.begin(); !isDeformed && pIt != fPoints.end(); pIt++ )
if ( !compUVByIsoIntersection( edgesPointsList, (*pIt)->myInitUV,
(*pIt)->myUV, isDeformed )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
// try to use a complex algo if it is a difficult case
for ( ; pIt != fPoints.end(); pIt++ ) // continue with the simple algo
if ( !compUVByIsoIntersection( edgesPointsList, (*pIt)->myInitUV,
(*pIt)->myUV, isDeformed )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
}
for ( pIt = fPoints.begin(); !isDeformed && pIt != fPoints.end(); pIt++ )
if ( !compUVByIsoIntersection( edgesPointsList, (*pIt)->myInitUV,
(*pIt)->myUV, isDeformed )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
// try to use a complex algo if it is a difficult case
for ( ; pIt != fPoints.end(); pIt++ ) // continue with the simple algo
if ( !compUVByIsoIntersection( edgesPointsList, (*pIt)->myInitUV,
(*pIt)->myUV, isDeformed )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
}
for ( pIt = fPoints.begin(); !isDeformed && pIt != fPoints.end(); pIt++ )
if ( !compUVByIsoIntersection( edgesPointsList, (*pIt)->myInitUV,
(*pIt)->myUV, isDeformed )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
// try to use a complex algo if it is a difficult case
for ( ; pIt != fPoints.end(); pIt++ ) // continue with the simple algo
if ( !compUVByIsoIntersection( edgesPointsList, (*pIt)->myInitUV,
(*pIt)->myUV, isDeformed )) {
- MESSAGE("cant Apply(face)");
+ MESSAGE("can't Apply(face)");
return false;
}
}
const int theNode000Index,
const int theNode001Index)
{
- MESSAGE(" ::Apply(set<MeshVolumes>) " );
-
if ( !IsLoaded() ) {
MESSAGE( "Pattern not loaded" );
return setErrorCode( ERR_APPL_NOT_LOADED );
const TopoDS_Shell& theBlock,
bool theKeepNodes)
{
- MESSAGE(" ::Load(volume) " );
Clear();
myIs2D = false;
myToKeepNodes = theKeepNodes;
const TopoDS_Vertex& theVertex000,
const TopoDS_Vertex& theVertex001)
{
- MESSAGE(" ::Apply(volume) " );
-
if (!findBoundaryPoints() || // bind ID to points
!setShapeToMesh( theBlock )) // check theBlock is a suitable shape
return false;
const int theNode000Index,
const int theNode001Index)
{
- //MESSAGE(" ::Apply(MeshVolume) " );
-
if (!findBoundaryPoints()) // bind ID to points
return false;
const bool toCreatePolygons,
const bool toCreatePolyedrs)
{
- MESSAGE(" ::MakeMesh() " );
if ( !myIsComputed )
return setErrorCode( ERR_MAKEM_NOT_COMPUTED );
{
if ( myIsBoundaryPointsFound ) return true;
- MESSAGE(" findBoundaryPoints() ");
-
myNbKeyPntInBoundary.clear();
if ( myIs2D )
TopAbs_ShapeEnum aType = theShape.ShapeType();
bool dimOk = ( myIs2D ? aType == TopAbs_FACE : aType == TopAbs_SHELL );
if ( !dimOk ) {
- MESSAGE( "Pattern dimention mismatch" );
+ MESSAGE( "Pattern dimension mismatch" );
return setErrorCode( ERR_APPL_BAD_DIMENTION );
}
ERR_LOADF_CANT_PROJECT, // impossible to project nodes
// Load(volume)
ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
- ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
+ ERR_LOADV_COMPUTE_PARAMS, // can't compute point parameters
// Apply(shape)
ERR_APPL_NOT_COMPUTED, // mapping failed
ERR_APPL_NOT_LOADED, // pattern was not loaded
- ERR_APPL_BAD_DIMENTION, // wrong shape dimention
+ ERR_APPL_BAD_DIMENTION, // wrong shape dimension
ERR_APPL_BAD_NB_VERTICES, // keypoints - vertices mismatch
// Apply(face)
ERR_APPLF_BAD_TOPOLOGY, // bad pattern topology
// private methods
struct TPoint {
- gp_XYZ myInitXYZ; // loaded postion
+ gp_XYZ myInitXYZ; // loaded position
gp_XY myInitUV;
double myInitU; // [0,1]
gp_Pnt myXYZ; // position to compute
std::list< TPoint* > & getShapePoints(const TopoDS_Shape& theShape);
// Return list of points located on theShape.
// A list of edge-points include vertex-points (for 2D pattern only).
- // A list of face-points doesnt include edge-points.
- // A list of volume-points doesnt include face-points.
+ // A list of face-points doesn't include edge-points.
+ // A list of volume-points doesn't include face-points.
std::list< TPoint* > & getShapePoints(const int theShapeID);
// Return list of points located on the shape
using namespace std;
+#ifdef _DEBUG_
+// enable printing algo + shape id + hypo used while meshing
+//#define PRINT_WHO_COMPUTE_WHAT
+#endif
+
//=============================================================================
/*!
* \brief Allocate some memory at construction and release it at destruction.
//=======================================================================
//function : CanAddHypothesis
//purpose : return true if theHypothesis can be attached to me:
-// its dimention is checked
+// its dimension is checked
//=======================================================================
bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) const
//=======================================================================
//function : IsApplicableHypotesis
-//purpose :
+//purpose : check if this sub-mesh can be computed using a hypothesis
+//=======================================================================
+
+bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis) const
+{
+ if ( !_father->HasShapeToMesh() && _subShape.ShapeType() == TopAbs_SOLID )
+ return true; // true for the PseudoShape
+
+ return IsApplicableHypotesis( theHypothesis, _subShape.ShapeType() );
+}
+
+//=======================================================================
+//function : IsApplicableHypotesis
+//purpose : compare shape type and hypothesis type
//=======================================================================
bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 ));
filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 ));
if ( SMESH_Algo * curAlgo = (SMESH_Algo*)_father->GetHypothesis( this, filter, true ))
- if ( !curAlgo->NeedDiscreteBoundary() )
+ if ( !curAlgo->NeedDiscreteBoundary() && curAlgo != anHyp )
algoRequiringCleaning = curAlgo;
}
}
_computeState = READY_TO_COMPUTE;
}
break;
+
+ case COMPUTE_NOGEOM: // no geometry; can be several algos
+ if ( !_father->HasShapeToMesh() )
+ {
+ algo = GetAlgo(); // current algo
+ if ( algo )
+ {
+ // apply algos in the order of increasing dimension
+ std::list< const SMESHDS_Hypothesis * > algos = _father->GetHypothesisList( _subShape );
+ for ( int t = SMESHDS_Hypothesis::ALGO_1D; t <= SMESHDS_Hypothesis::ALGO_3D; ++t )
+ {
+ std::list<const SMESHDS_Hypothesis *>::iterator al = algos.begin();
+ for ( ; al != algos.end(); ++al )
+ if ( (*al)->GetType() == t )
+ {
+ _algo = (SMESH_Algo*) *al;
+ _computeState = READY_TO_COMPUTE;
+ if ( !ComputeStateEngine( COMPUTE ))
+ break;
+ }
+ }
+ _algo = algo; // restore
+ }
+ break;
+ }
case COMPUTE:
case COMPUTE_SUBMESH:
{
!algo->isDegenerated( TopoDS::Edge( subS.Current() ))))
ret = false;
}
+#ifdef PRINT_WHO_COMPUTE_WHAT
+ for (subS.ReInit(); subS.More(); subS.Next())
+ {
+ const std::list <const SMESHDS_Hypothesis *> & hyps =
+ _algo->GetUsedHypothesis( *_father, _subShape );
+ SMESH_Comment hypStr;
+ if ( !hyps.empty() )
+ {
+ hypStr << hyps.front()->GetName() << " ";
+ ((SMESHDS_Hypothesis*)hyps.front())->SaveTo( hypStr.Stream() );
+ hypStr << " ";
+ }
+ cout << _algo->GetName()
+ << " " << _father->GetSubMesh( subS.Current() )->GetId()
+ << " " << hypStr << endl;
+ }
+#endif
// Set _computeError
if ( !ret && !isComputeErrorSet )
{
case COMPUTE_CANCELED: // nothing to do
break;
case CLEAN:
- cleanDependants(); // clean sub-meshes, dependant on this one, with event CLEAN
+ cleanDependants(); // clean sub-meshes, dependent on this one, with event CLEAN
removeSubMeshElementsAndNodes();
_computeState = NOT_READY;
if ( _algoState == HYP_OK )
SMESH_Hypothesis::Hypothesis_Status
SMESH_subMesh::CheckConcurentHypothesis (const int theHypType)
{
- MESSAGE ("SMESH_subMesh::CheckConcurentHypothesis");
-
// is there local hypothesis on me?
if ( getSimilarAttached( _subShape, 0, theHypType ) )
return SMESH_Hypothesis::HYP_OK;
//================================================================================
/*!
- * \brief Notify stored event listeners on the occured event
+ * \brief Notify stored event listeners on the occurred event
* \param event - algo_event or compute_event itself
* \param eventType - algo_event or compute_event
* \param hyp - hypothesis, if eventType is algo_event
* \brief Do something on a certain event
* \param event - algo_event or compute_event itself
* \param eventType - algo_event or compute_event
- * \param subMesh - the submesh where the event occures
+ * \param subMesh - the submesh where the event occurs
* \param data - listener data stored in the subMesh
* \param hyp - hypothesis, if eventType is algo_event
*
};
enum compute_event
{
- MODIF_ALGO_STATE, COMPUTE, COMPUTE_SUBMESH, COMPUTE_CANCELED,
+ MODIF_ALGO_STATE, COMPUTE, COMPUTE_SUBMESH, COMPUTE_NOGEOM, COMPUTE_CANCELED,
CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED,
MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
};
void setEventListener(EventListener* listener, EventListenerData* data);
/*!
- * \brief Notify stored event listeners on the occured event
+ * \brief Notify stored event listeners on the occurred event
* \param event - algo_event or compute_event itself
* \param eventType - algo_event or compute_event
* \param hyp - hypothesis, if eventType is algo_event
bool CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) const;
// return true if theHypothesis can be attached to me:
- // its dimention is checked
+ // its dimension is checked
static bool IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
const TopAbs_ShapeEnum theShapeType);
- bool IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis) const
- { return IsApplicableHypotesis( theHypothesis, _subShape.ShapeType() ); }
+ bool IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis) const;
// return true if theHypothesis can be used to mesh me:
// its shape type is checked
* \brief Do something on a certain event
* \param event - algo_event or compute_event itself (of SMESH_subMesh)
* \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
- * \param subMesh - the submesh where the event occures
+ * \param subMesh - the submesh where the event occurs
* \param data - listener data stored in the subMesh
* \param hyp - hypothesis, if eventType is algo_event
*
#ifndef _MEMOIRE_H_
#define _MEMOIRE_H_
+#ifdef __APPLE__
+#include <stdlib.h>
+#else
#include <malloc.h>
+#endif
#include <iostream>
void memostat(const char* f, int l);
void memostat(const char* f, int l)
{
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
//rnv: TODO: find alternative of the malloc_stats() on windows platform
#else
struct mallinfo mem = mallinfo();
bool SMESHDS_GroupBase::IsEmpty()
{
+ if ( myMesh->GetMeshInfo().NbElements( myType ) == 0 )
+ // avoid long iteration over sub-meshes of a complex sub-mesh of a group on geometry
+ return false;
SMDS_ElemIteratorPtr it = GetElements();
return ( !it || !it->more() );
}
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
${PYTHON_INCLUDE_DIRS}
${VTK_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
QStringList filter;
std::string myExtension;
- if ( theCommandID == SMESHOp::OpImportMED ) {
+ if ( theCommandID == SMESHOp::OpImportMED ||
+ theCommandID == SMESHOp::OpPopupImportMED ) {
filter.append( QObject::tr( "MED_FILES_FILTER" ) + " (*.*med)" );
filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" );
}
- else if ( theCommandID == SMESHOp::OpImportUNV ) {
+ else if ( theCommandID == SMESHOp::OpImportUNV ||
+ theCommandID == SMESHOp::OpPopupImportUNV ) {
filter.append( QObject::tr( "IDEAS_FILES_FILTER" ) + " (*.unv)" );
}
- else if ( theCommandID == SMESHOp::OpImportDAT ) {
+ else if ( theCommandID == SMESHOp::OpImportDAT ||
+ theCommandID == SMESHOp::OpPopupImportDAT ) {
filter.append( QObject::tr( "DAT_FILES_FILTER" ) + " (*.dat)" );
}
- else if ( theCommandID == SMESHOp::OpImportSTL ) {
+ else if ( theCommandID == SMESHOp::OpImportSTL ||
+ theCommandID == SMESHOp::OpPopupImportSTL ) {
filter.append( QObject::tr( "STL_FILES_FILTER" ) + " (*.stl)" );
}
- #ifdef WITH_CGNS
- else if ( theCommandID == SMESHOp::OpImportCGNS ) {
+ else if ( theCommandID == SMESHOp::OpImportCGNS ||
+ theCommandID == SMESHOp::OpPopupImportCGNS ) {
filter.append( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
}
- #endif
- else if ( theCommandID == SMESHOp::OpImportSAUV ) {
+ else if ( theCommandID == SMESHOp::OpImportSAUV ||
+ theCommandID == SMESHOp::OpPopupImportSAUV ) {
filter.append( QObject::tr( "SAUV files (*.sauv*)" ) );
filter.append( QObject::tr( "All files (*)" ) );
}
- else if ( theCommandID == SMESHOp::OpImportGMF ) {
+ else if ( theCommandID == SMESHOp::OpImportGMF ||
+ theCommandID == SMESHOp::OpPopupImportGMF ) {
filter.append( QObject::tr( "GMF_ASCII_FILES_FILTER" ) + " (*.mesh)" );
filter.append( QObject::tr( "GMF_BINARY_FILES_FILTER") + " (*.meshb)" );
}
try {
switch ( theCommandID ) {
case SMESHOp::OpImportDAT:
+ case SMESHOp::OpPopupImportDAT:
{
// DAT format (currently unsupported)
errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
break;
}
case SMESHOp::OpImportUNV:
+ case SMESHOp::OpPopupImportUNV:
{
// UNV format
aMeshes->length( 1 );
break;
}
case SMESHOp::OpImportMED:
+ case SMESHOp::OpPopupImportMED:
{
// MED format
SMESH::DriverMED_ReadStatus res;
break;
}
case SMESHOp::OpImportSTL:
+ case SMESHOp::OpPopupImportSTL:
{
// STL format
aMeshes->length( 1 );
}
break;
}
- #ifdef WITH_CGNS
case SMESHOp::OpImportCGNS:
+ case SMESHOp::OpPopupImportCGNS:
{
// CGNS format
SMESH::DriverMED_ReadStatus res;
}
break;
}
- #endif
case SMESHOp::OpImportSAUV:
+ case SMESHOp::OpPopupImportSAUV:
{
// SAUV format
SMESH::DriverMED_ReadStatus res;
break;
}
case SMESHOp::OpImportGMF:
+ case SMESHOp::OpPopupImportGMF:
{
// GMF format
SMESH::ComputeError_var res;
theCommandID == SMESHOp::OpPopupExportUNV );
const bool isSTL = ( theCommandID == SMESHOp::OpExportSTL ||
theCommandID == SMESHOp::OpPopupExportSTL );
-#ifdef WITH_CGNS
const bool isCGNS= ( theCommandID == SMESHOp::OpExportCGNS ||
theCommandID == SMESHOp::OpPopupExportCGNS );
-#else
- const bool isCGNS= false;
-#endif
const bool isSAUV= ( theCommandID == SMESHOp::OpExportSAUV ||
theCommandID == SMESHOp::OpPopupExportSAUV );
const bool isGMF = ( theCommandID == SMESHOp::OpExportGMF ||
QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
return;
}
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem );
- if ( aCheckWarn && !aGroup->_is_nil() ) {
- QMessageBox msgBox(SUIT_MessageBox::Warning,QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),QMessageBox::StandardButton::NoButton, SMESHGUI::desktop());
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem );
+ if ( aCheckWarn && !aGroup->_is_nil() )
+ {
+ QMessageBox msgBox(SUIT_MessageBox::Warning,
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),
+ QMessageBox::StandardButton::NoButton,
+ SMESHGUI::desktop());
QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX"));
msgBox.addButton(QMessageBox::Ok);
msgBox.addButton(QMessageBox::Cancel);
lt->addWidget(btnbox, lt->rowCount(), 0, lt->rowCount(), lt->columnCount());
if(msgBox.exec() == QMessageBox::Ok)
{
- if(dontShowCheckBox.checkState() == Qt::Checked)
- {
- if ( resMgr )
- resMgr->setValue( "SMESH", "show_warning", false);
- }
- aCheckWarn = false;
+ if(dontShowCheckBox.checkState() == Qt::Checked)
+ {
+ if ( resMgr )
+ resMgr->setValue( "SMESH", "show_warning", false);
+ }
+ aCheckWarn = false;
}
else
return;
case SMESHOp::OpImportUNV:
case SMESHOp::OpImportMED:
case SMESHOp::OpImportSTL:
-#ifdef WITH_CGNS
case SMESHOp::OpImportCGNS:
-#endif
case SMESHOp::OpImportSAUV:
case SMESHOp::OpImportGMF:
+ case SMESHOp::OpPopupImportDAT:
+ case SMESHOp::OpPopupImportUNV:
+ case SMESHOp::OpPopupImportMED:
+ case SMESHOp::OpPopupImportSTL:
+ case SMESHOp::OpPopupImportCGNS:
+ case SMESHOp::OpPopupImportSAUV:
+ case SMESHOp::OpPopupImportGMF:
{
if(checkLock(aStudy)) break;
::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
case SMESHOp::OpExportMED:
case SMESHOp::OpExportUNV:
case SMESHOp::OpExportSTL:
-#ifdef WITH_CGNS
case SMESHOp::OpExportCGNS:
-#endif
case SMESHOp::OpExportSAUV:
case SMESHOp::OpExportGMF:
case SMESHOp::OpPopupExportDAT:
case SMESHOp::OpPopupExportMED:
case SMESHOp::OpPopupExportUNV:
case SMESHOp::OpPopupExportSTL:
-#ifdef WITH_CGNS
case SMESHOp::OpPopupExportCGNS:
-#endif
case SMESHOp::OpPopupExportSAUV:
case SMESHOp::OpPopupExportGMF:
{
extractContainers( sel_objects, to_process );
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
if (vtkwnd) {
SALOME_ListIteratorOfListIO It( to_process );
for ( ; It.More(); It.Next())
//createSMESHAction( SMESHOp::OpImportDAT, "IMPORT_DAT", "", (Qt::CTRL+Qt::Key_B) );
createSMESHAction( SMESHOp::OpImportUNV, "IMPORT_UNV", "", (Qt::CTRL+Qt::Key_I) );
createSMESHAction( SMESHOp::OpImportMED, "IMPORT_MED", "", (Qt::CTRL+Qt::Key_M) );
- //createSMESHAction( 114, "NUM" );
createSMESHAction( SMESHOp::OpImportSTL, "IMPORT_STL" );
#ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpImportCGNS, "IMPORT_CGNS" );
#endif
createSMESHAction( SMESHOp::OpImportSAUV, "IMPORT_SAUV" );
createSMESHAction( SMESHOp::OpImportGMF, "IMPORT_GMF" );
+ createSMESHAction( SMESHOp::OpPopupImportUNV, "IMPORT_UNV");
+ createSMESHAction( SMESHOp::OpPopupImportMED, "IMPORT_MED");
+ createSMESHAction( SMESHOp::OpPopupImportSTL, "IMPORT_STL" );
+#ifdef WITH_CGNS
+ createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" );
+#endif
+ createSMESHAction( SMESHOp::OpPopupImportSAUV, "IMPORT_SAUV" );
+ createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" );
+
createSMESHAction( SMESHOp::OpExportDAT, "DAT" );
createSMESHAction( SMESHOp::OpExportMED, "MED" );
createSMESHAction( SMESHOp::OpExportUNV, "UNV" );
createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" );
createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" );
createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" );
- createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" );
+ createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" );
createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" );
createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" );
createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER");
createSMESHAction( SMESHOp::OpIntersectGroups, "INT_GROUP", "ICON_INTERSECT" );
createSMESHAction( SMESHOp::OpCutGroups, "CUT_GROUP", "ICON_CUT" );
createSMESHAction( SMESHOp::OpGroupUnderlyingElem, "UNDERLYING_ELEMS", "ICON_UNDERLYING_ELEMS" );
- createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD" );
- createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE" );
+ createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD_TO_GROUP" );
+ createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE_FROM_GROUP" );
createSMESHAction( SMESHOp::OpDeleteGroup, "DEL_GROUP", "ICON_DEL_GROUP" );
createSMESHAction( SMESHOp::OpMeshInformation , "ADV_INFO", "ICON_ADV_INFO" );
//createSMESHAction( SMESHOp::OpStdInfo, "STD_INFO", "ICON_STD_INFO" );
createSMESHAction( SMESHOp::OpBareBorderVolume, "BARE_BORDER_VOLUME", "ICON_BARE_BORDER_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpOverConstrainedVolume, "OVER_CONSTRAINED_VOLUME", "ICON_OVER_CONSTRAINED_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpEqualVolume, "EQUAL_VOLUME", "ICON_EQUAL_VOLUME", 0, true );
- createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY" );
+ createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY", "ICON_OVL_MESH_QUALITY" );
createSMESHAction( SMESHOp::OpNode, "NODE", "ICON_DLG_NODE" );
createSMESHAction( SMESHOp::OpElem0D, "ELEM0D", "ICON_DLG_ELEM0D" );
createSMESHAction( SMESHOp::OpPropertiesArea, "MEASURE_AREA", "ICON_MEASURE_AREA" );
createSMESHAction( SMESHOp::OpPropertiesVolume, "MEASURE_VOLUME", "ICON_MEASURE_VOLUME" );
- createSMESHAction( SMESHOp::OpHide, "HIDE" );
- createSMESHAction( SMESHOp::OpShow, "SHOW" );
+ createSMESHAction( SMESHOp::OpHide, "HIDE", "ICON_HIDE" );
+ createSMESHAction( SMESHOp::OpShow, "SHOW", "ICON_SHOW" );
createSMESHAction( SMESHOp::OpShowOnly, "DISPLAY_ONLY" );
createSMESHAction( SMESHOp::OpSortChild, "SORT_CHILD_ITEMS" );
group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ),
hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ),
algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ),
+ smesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::COMPONENT ) ),
elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ).
arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ).
hasNodes("(numberOfNodes > 0 ) && hasActor"),
hasElems("(count( elemTypes ) > 0)"),
hasDifferentElems("(count( elemTypes ) > 1)"),
+ hasDifferentObjElems("(count( objElemTypes ) > 1)"),
hasBalls("({'BallElem'} in elemTypes)"),
hasElems0d("({'Elem0d'} in elemTypes)"),
hasEdges("({'Edge'} in elemTypes)"),
createPopupItem( SMESHOp::OpPopupExportDAT, OB, mesh_group, only_one_non_empty, anId );
createPopupItem( SMESHOp::OpDelete, OB, mesh_part + " " + hyp_alg );
createPopupItem( SMESHOp::OpDeleteGroup, OB, group );
+
+ anId = popupMgr()->insert( tr( "MEN_IMPORT" ), -1, -1 ); // IMPORT submenu
+ createPopupItem( SMESHOp::OpPopupImportMED, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportUNV, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportSTL, OB, smesh, "", anId );
+#ifdef WITH_CGNS
+ createPopupItem( SMESHOp::OpPopupImportCGNS, OB, smesh, "", anId );
+#endif
+ createPopupItem( SMESHOp::OpPopupImportSAUV, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportGMF, OB, smesh, "", anId );
+ createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId );
popupMgr()->insert( separator(), -1, 0 );
// popup for viewer
createPopupItem( SMESHOp::OpEditGroup, View, group );
- createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems );
- createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems );
+ createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems, "&& guiState = 800" );
+ createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems, "&& guiState = 800" );
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( SMESHOp::OpUpdate, View, mesh_part );
popupMgr()->setRule( action( SMESHOp::OpDMShading ), "displayMode = 'eSurface'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( SMESHOp::OpDMNodes ), anId, -1 );
- popupMgr()->setRule( action( SMESHOp::OpDMNodes ), aMeshInVTK + "&&" + hasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( SMESHOp::OpDMNodes ), aMeshInVTK + "&&" + hasNodes + "&&" + hasElems, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( SMESHOp::OpDMNodes ), "displayMode = 'ePoint'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( SMESHOp::OpDEChoose ), anId, -1 );
- popupMgr()->setRule( action( SMESHOp::OpDEChoose ), aClient + "&& $type in {" + mesh + "} &&" + isNotEmpty, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( SMESHOp::OpDEChoose ), aClient + "&& $type in {" + mesh + "} &&" + hasDifferentObjElems, QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), anId, -1 );
// Controls
//-------------------------------------------------
QString
- aMeshInVtkHasNodes = aMeshInVTK + "&&" + hasNodes,
- aMeshInVtkHasEdges = aMeshInVTK + "&&" + hasEdges,
- aMeshInVtkHasFaces = aMeshInVTK + "&&" + hasFaces,
+ aMeshInVtkHasNodes = aMeshInVTK + "&&" + hasNodes,
+ aMeshInVtkHasEdges = aMeshInVTK + "&&" + hasEdges,
+ aMeshInVtkHasFaces = aMeshInVTK + "&&" + hasFaces,
aMeshInVtkHasVolumes = aMeshInVTK + "&&" + hasVolumes;
anId = popupMgr()->insert( tr( "MEN_CTRL" ), -1, -1 );
/*!
* \brief Set default selection mode
*
-* SLOT called when operation commited. Sets default selection mode
+* SLOT called when operation committed. Sets default selection mode
*/
//================================================================================
void SMESHGUI::onOperationCommited( SUIT_Operation* )
Handle(SALOME_InteractiveObject) io = aSmeshActor->getIO();
if (io->hasEntry())
{
- // entry is "encoded" = it does NOT contain component adress,
+ // entry is "encoded" = it does NOT contain component address,
// since it is a subject to change on next component loading
std::string entry = ip->encodeEntry(io->getEntry(), componentName);
for (std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt)
{
- // entry is a normal entry - it should be "decoded" (setting base adress of component)
+ // entry is a normal entry - it should be "decoded" (setting base address of component)
QString entry (ip->decodeEntry(*entIt).c_str());
// Check that the entry corresponds to a real object in the Study
void ResetState();
void SetState( int );
+ int GetState() const { return myState; }
bool DefineDlgPosition( QWidget*, int&, int& );
void switchToOperation( int );
CheckBoxMerge = new QCheckBox(tr("MERGE_NODES_AND_ELEMENTS"), GroupArgs);
TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs);
- TextLabelTol->setAlignment(Qt::AlignCenter);
+ //TextLabelTol->setAlignment(Qt::AlignCenter);
SpinBoxTol = new SMESHGUI_SpinBox(GroupArgs);
SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision" );
GroupArgsLayout->addWidget(ComboBoxUnion, 1, 3);
GroupArgsLayout->addWidget(CheckBoxCommon, 2, 0, 1, 4);
GroupArgsLayout->addWidget(CheckBoxMerge, 3, 0, 1, 4);
- GroupArgsLayout->addWidget(TextLabelTol, 4, 0, 1, 2);
- GroupArgsLayout->addWidget(SpinBoxTol, 4, 2, 1, 2);
+ GroupArgsLayout->addWidget(TextLabelTol, 4, 0);
+ GroupArgsLayout->addWidget(SpinBoxTol, 4, 1, 1, 3);
/***************************************************************/
GroupButtons = new QGroupBox(this);
if (!isValid())
return false;
+ SUIT_OverrideCursor aWaitCursor;
+
SMESH::SMESH_Mesh_var aMesh;
if (!myMesh->_is_nil())
QStringList anEntryList;
try {
- SUIT_OverrideCursor aWaitCursor;
aMesh = myMeshArray[0]->GetMesh();
aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
std::for_each( myPlanes.begin(),myPlanes.end(), TSetVisibility( PreviewCheckBox->isChecked() ) );
aPlaneData.Plane.GetPointer()->myActor->SetVisibility( false );
+ std::map< std::string, QListWidgetItem* > itemMap; // used to sort items by entry
+
VTK::ActorCollectionCopy aCopy( myViewWindow->getRenderer()->GetActors() );
vtkActorCollection* anAllActors = aCopy.GetActors();
anAllActors->InitTraversal();
if ( !aFatherName.isEmpty() )
aName = aFatherName + " / " + aName;
aName += QString(" (%1)").arg( aSObj->GetID().c_str() );
- QListWidgetItem* anItem = new ActorItem( anActor, aName, ActorList );
+ QListWidgetItem* anItem = new ActorItem( anActor, aName, 0 );
anItem->setCheckState( anIsChecked ? Qt::Checked : Qt::Unchecked );
- updateActorItem( anItem, true, false );
+ itemMap.insert( std::make_pair( aSObj->GetID(), anItem ));
}
}
}
}
+ std::map< std::string, QListWidgetItem* >::iterator s2i = itemMap.begin();
+ for ( ; s2i != itemMap.end(); ++s2i )
+ {
+ QListWidgetItem* anItem = s2i->second;
+ ActorList->addItem( anItem );
+ }
+ updateActorItem( 0, true, false );
}
/*!
SMESH::OrientedPlane* aPlane = SMESH::OrientedPlane::New(myViewWindow);
SMESH::TPlane aTPlane(aPlane);
aPlane->PlaneMode = CurrentMode;
- SMESH::TActorList anActorList;
+ SMESH::TActorList anActorList, aVisibleActorList;
VTK::ActorCollectionCopy aCopy( myViewWindow->getRenderer()->GetActors() );
vtkActorCollection* anAllActors = aCopy.GetActors();
anAllActors->InitTraversal();
while( vtkActor* aVTKActor = anAllActors->GetNextActor() )
if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) )
+ {
anActorList.push_back( anActor );
-
- SMESH::TPlaneData aPlaneData(aTPlane, anActorList);
-
+ if ( anActor->GetVisibility() )
+ aVisibleActorList.push_back( anActor );
+ }
+ SMESH::TPlaneData aPlaneData(aTPlane,
+ aVisibleActorList.empty() ? anActorList : aVisibleActorList);
myPlanes.push_back(aPlaneData);
#include <SUIT_Session.h>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
+#include <SVTK_Renderer.h>
#include <SalomeApp_Application.h>
// SALOME KERNEL includes
// VTK includes
#include <vtkProperty.h>
+#include <vtkRenderer.h>
// STL includes
#include <vector>
#include <set>
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
#include <sys/sysinfo.h>
#endif
QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
nbNodesLabel = new QLabel("0", this );
nbElemsLabel = new QLabel("0", this );
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
QLabel * freeRAMName = new QLabel(tr("SMESH_FREERAM"), this );
freeRAMLabel = new QLabel("", this );
#endif
layout->addWidget(nbNodesLabel, row++, 1);
layout->addWidget(nbElemsName, row, 0);
layout->addWidget(nbElemsLabel, row++, 1);
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
layout->addWidget(freeRAMName, row, 0);
layout->addWidget(freeRAMLabel, row++, 1);
#endif
{
nbNodesLabel->setText( QString("%1").arg( qthread.getMesh()->NbNodes() ));
nbElemsLabel->setText( QString("%1").arg( qthread.getMesh()->NbElements() ));
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
struct sysinfo si;
const int err = sysinfo( &si );
if ( err )
( (*anIter).second->GetID().c_str(), "SMESH", (*anIter).second->GetName().c_str() );
SMESH::Update(anIO, toDisplay);
+ if ( SVTK_ViewWindow* vtkWnd = SMESH::GetVtkViewWindow(SMESH::GetActiveWindow() ))
+ if ( vtkWnd->getRenderer() )
+ vtkWnd->getRenderer()->ResetCameraClippingRange();
+
if ( limitExceeded && !aMesh->_is_nil() )
{
QStringList hiddenMsg;
//================================================================================
/*!
- * \brief detect asigned mesh algorithms
+ * \brief detect assigned mesh algorithms
*/
//================================================================================
//=======================================================================
// function : onProject()
-// purpose : SLOT. Called when state of "Project nodes on ther face"
+// purpose : SLOT. Called when state of "Project nodes on other face"
// checkbox is changed
//=======================================================================
void SMESHGUI_CreatePatternDlg::onProject( bool )
//=======================================================================
void SMESHGUI_CreatePatternDlg::enterEvent( QEvent* )
{
- // there is a stange problem that enterEvent() comes after onSave()
+ // there is a strange problem that enterEvent() comes after onSave()
if ( isVisible () ) {
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled( true );
bool isValid();
- int checkEditLine( bool = true ); /*! Checking for indices, return 1 if all ok, esle -1*/
+ int checkEditLine( bool = true ); /*! Checking for indices, return 1 if all ok, else -1*/
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
hl->addWidget( nb0DElemsLab, 0, 1 );
my0DElemsTB->setEnabled( nbElements );
nb0DElemsLab->setEnabled( nbElements );
+ myNbTypes += ( nbElements > 0 );
// Edges
nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_Edge ) : aMesh->NbEdges();
hl->addWidget( nbEdgesLab, 1, 1 );
myEdgesTB->setEnabled( nbElements );
nbEdgesLab->setEnabled( nbElements );
+ myNbTypes += ( nbElements > 0 );
// Faces
nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_Face ) : aMesh->NbFaces();
hl->addWidget( nbFacesLab, 2, 1 );
myFacesTB->setEnabled( nbElements );
nbFacesLab->setEnabled( nbElements );
+ myNbTypes += ( nbElements > 0 );
// Volumes
nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_Volume ) : aMesh->NbVolumes();
hl->addWidget( nbVolumesLab, 3, 1 );
myVolumesTB->setEnabled( nbElements );
nbVolumesLab->setEnabled( nbElements );
+ myNbTypes += ( nbElements > 0 );
// Balls
nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_Ball ) : aMesh->NbBalls();
hl->addWidget( nbBallsLab, 4, 1 );
myBallsTB->setEnabled( nbElements );
nbBallsLab->setEnabled( nbElements );
+ myNbTypes += ( nbElements > 0 );
QVBoxLayout* aDlgLay = new QVBoxLayout( mainFrame() );
aDlgLay->setMargin( 0 );
button( OK )->setText( tr( "SMESH_BUT_OK" ) );
- connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
- connect( this, SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
+ connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ));
+ connect( this, SIGNAL( dlgOk() ), this, SLOT( onOk() ));
+
+ updateButtons();
}
/*
void SMESHGUI_DisplayEntitiesDlg::onChangeEntityMode( bool isChecked )
{
QCheckBox* aSender = (QCheckBox*)sender();
- if ( myNbCheckedButtons == 1 && !isChecked ) {
- SUIT_MessageBox::warning(this, tr("SMESH_WRN_WARNING"),
- tr("WRN_AT_LEAST_ONE"));
- disconnect( aSender, SIGNAL(toggled(bool)), this, SLOT(onChangeEntityMode(bool)) );
- aSender->setChecked( true );
- connect( aSender, SIGNAL(toggled(bool)), this, SLOT(onChangeEntityMode(bool)) );
- return;
- }
if ( my0DElemsTB == aSender )
InverseEntityMode( myEntityMode, SMESH_Actor::e0DElements );
else if ( myEdgesTB == aSender )
InverseEntityMode( myEntityMode, SMESH_Actor::eVolumes );
else if ( myBallsTB == aSender )
InverseEntityMode( myEntityMode, SMESH_Actor::eBallElem );
-
+
isChecked ? myNbCheckedButtons++ : myNbCheckedButtons--;
-
+ updateButtons();
}
/*!
SMESH::UpdateView( wnd, SMESH::eDisplay, entry );
}
}
+
+/*!
+ * \brief Enable/disable OK button depending on nb of selected entities
+ */
+void SMESHGUI_DisplayEntitiesDlg::updateButtons()
+{
+ setButtonEnabled( myNbCheckedButtons > 0 || myNbTypes == 0, OK );
+}
private:
void InverseEntityMode( unsigned int& theOutputMode,
unsigned int theMode );
+ void updateButtons();
private slots:
void onOk();
unsigned int myEntityMode;
SMESH_Actor *myActor;
int myNbCheckedButtons;
+ int myNbTypes;
QCheckBox* my0DElemsTB;
QCheckBox* myEdgesTB;
QCheckBox* myFacesTB;
//=======================================================================
// name : SMESHGUI_FilterTable::updateAdditionalWidget
-// Purpose : Enable/Disable widget with additonal parameters
+// Purpose : Enable/Disable widget with additional parameters
//=======================================================================
void SMESHGUI_FilterTable::updateAdditionalWidget()
{
//=======================================================================
// name : SMESHGUI_FilterTable::getCompareItem
-// Purpose : Get combo table item for operation of comparision
+// Purpose : Get combo table item for operation of comparison
//=======================================================================
QTableWidgetItem* SMESHGUI_FilterTable::getCompareItem () const
{
/* Init selection */
mySMESHGUI->SetActiveDialogBox(this);
- mySMESHGUI->SetState(800);
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
mySelectionMode = grpNoSelection;
mySortBtn->setEnabled ( !noElemsModif );
mySelectBox->setEnabled ( !noElemsModif );
myAllowElemsModif->setEnabled( !mySelectAll->isChecked() );
+ if ( noElemsModif ) mySMESHGUI->ResetState();
+ else mySMESHGUI->SetState(800);
int selMode = mySelectionMode;
mySelectionMode = grpNoSelection;
setEnabled(true);
mySelectionMode = grpNoSelection;
setSelectionMode(myTypeId);
- //mySMESHGUI->SetActiveDialogBox((QDialog*)this);
mySMESHGUI->SetActiveDialogBox(this);
- mySMESHGUI->SetState(800);
+ if ( mySelectBox->isEnabled() ) mySMESHGUI->SetState(800);
+ else mySMESHGUI->ResetState();
}
}
{
SMESH::SMESH_GroupBase_var aGrp = *anIter;
if ( CORBA::is_nil( aGrp ) )
- continue; // nonsence
+ continue; // nonsense
SMESH::SMESH_Mesh_var aMesh = aGrp->GetMesh();
if ( CORBA::is_nil( aMesh ) )
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
if (!libHandle) {
- // report any error, if occured
+ // report any error, if occurred
{
#ifdef WIN32
const char* anError = "Can't load client meshers plugin library";
void SetPointsData( SMDS_Mesh* theMesh, const TColStd_MapOfInteger & theNodesIdMap );
void SetElemsData ( const std::vector<int> & theElemsIdMap,
const std::list<gp_XYZ> & theGrCentersXYZ );
+ template< class INT_ITER, class XYZ_ITER >
+ void SetElemsData ( INT_ITER theElemsBegin, INT_ITER theElemsEnd,
+ XYZ_ITER theGrCentersBegin, XYZ_ITER theGrCentersEnd )
+ {
+ std::vector<int> elemsIds( theElemsBegin, theElemsEnd );
+ std::list<gp_XYZ> gcXYZ( theGrCentersBegin, theGrCentersEnd );
+ SetElemsData( elemsIds, gcXYZ );
+ }
void SetPointsLabeled( bool theIsPointsLabeled, bool theIsActorVisible = true );
void AddToRender ( vtkRenderer* theRenderer );
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <QtxMenu.h>
+#include <QtxToolButton.h>
// Qt includes
#include <QComboBox>
// Algorifm
QLabel* anAlgoLbl = new QLabel( tr( "ALGORITHM" ), this );
- myHypCombo[ Algo ] = new QComboBox( this );
+ myHypCombo[ Algo ] = new QtxToolButton( this );
// Hypothesis
QLabel* aHypLbl = new QLabel( tr( "HYPOTHESIS" ), this );
- myHypCombo[ MainHyp ] = new QComboBox( this );
+ myHypCombo[ MainHyp ] = new QtxToolButton( this );
myHypCombo[ MainHyp ]->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myCreateHypBtn[ MainHyp ] = new QToolButton( this );
myCreateHypBtn[ MainHyp ]->setIcon( aCreateIcon );
// Add. hypothesis
QLabel* anAddHypLbl = new QLabel( tr( "ADD_HYPOTHESIS" ), this );
- myHypCombo[ AddHyp ] = new QComboBox( this );
+ myHypCombo[ AddHyp ] = new QtxToolButton( this );
myHypCombo[ AddHyp ]->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myCreateHypBtn[ AddHyp ] = new QToolButton( this );
myCreateHypBtn[ AddHyp ]->setIcon( aCreateIcon );
aLay->addWidget( myMoreAddHypBtn, 4, 2 );
aLay->addWidget( myEditHypBtn[ MoreAddHyp ], 4, 3 );
aLay->addWidget( myLessAddHypBtn, 5, 2 );
+
aLay->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ), 6, 0 );
// Connect signals and slots
const int index,
const bool isGroup )
{
- const char* prefix = " ";
if ( type <= AddHyp )
{
if ( isGroup )
{
- int idx = myHypCombo[ type ]->count();
- myHypCombo[ type ]->addItem( txt.mid( 6 ), QVariant( index ));
- myHypCombo[ type ]->setItemData( idx, "separator", Qt::AccessibleDescriptionRole );
+ myHypCombo[ type ]->addSeparator( txt.mid( 6 ) );
}
else
{
- myHypCombo[ type ]->addItem( prefix + txt, QVariant( index ));
+ myHypCombo[ type ]->addItem( txt, QVariant( index ));
}
//myHypCombo[ type ]->setMaxVisibleItems( qMax( 10, myHypCombo[ type ]->count() ) );
}
else
{
- QListWidgetItem* item = new QListWidgetItem( prefix + txt, myAddHypList );
+ QListWidgetItem* item = new QListWidgetItem( txt, myAddHypList );
item->setData( Qt::UserRole, QVariant( index ));
}
}
QAction* a = 0;
if ( aHypNames[ i ].startsWith( "GROUP:" ))
{
- aPopup.appendGroupTitle( aHypNames[ i ].mid( 6 ));
+ aPopup.addGroup( aHypNames[ i ].mid( 6 ));
}
else
{
//================================================================================
/*!
* \brief Enable/disable tabs
- * \param int - maximum possible dimention
+ * \param int - maximum possible dimension
*/
//================================================================================
void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim )
//================================================================================
/*!
- * \brief SLOT called when a item of Geom selection popup is choosen
+ * \brief SLOT called when a item of Geom selection popup is chosen
*/
//================================================================================
void SMESHGUI_MeshDlg::onGeomPopup( QAction* a )
class QMenu;
class QTabWidget;
class QToolButton;
+class QtxToolButton;
/*!
* \brief Dialog for mech creation or editing
signals:
void createHyp( const int, const int );
- //!< Emited when "Create hypothesis" button clicked
+ //!< Emitted when "Create hypothesis" button clicked
void editHyp( const int, const int );
- //!< Emited when "Edit hypothesis" button clicked
+ //!< Emitted when "Edit hypothesis" button clicked
void selectAlgo( const int );
- //!< Emited when an algorithm is selected
+ //!< Emitted when an algorithm is selected
private slots:
void onCreateHyp();
QMap<int, QStringList> myAvailableHypTypes;
- QMap<int, QComboBox*> myHypCombo;
+ QMap<int, QtxToolButton*> myHypCombo;
QMap<int, QToolButton*> myCreateHypBtn;
QMap<int, QToolButton*> myEditHypBtn;
QToolButton* myMoreAddHypBtn;
QToolButton* myLessAddHypBtn;
QListWidget* myAddHypList; // 2-nd, etc. additional hyps
-
};
#endif // SMESHGUI_MESHDLG_H
#include "SMESHDS_Mesh.hxx"
#include "SMESHGUI.h"
#include "SMESHGUI_FilterUtils.h"
+#include "SMESHGUI_IdPreview.h"
#include "SMESHGUI_IdValidator.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_Utils.h"
{
setVisible( total > blockSize );
QString format = brief ? QString( "%1-%2 / %3" ) : SMESHGUI_MeshInfoDlg::tr( "X_FROM_Y_ITEMS_SHOWN" );
- current->setText( format.arg( index*blockSize+1 ).arg( qMin( index*blockSize+blockSize, total ) ).arg( total ) );
+ current->setText( format.arg( index*blockSize+1 ).arg( qMin( index*blockSize+blockSize, total )).arg( total ));
prev->setEnabled( index > 0 );
next->setEnabled( (index+1)*blockSize < total );
}
myLoadBtn = new QPushButton( tr( "BUT_LOAD_MESH" ), this );
myLoadBtn->setAutoDefault( true );
- connect( myLoadBtn, SIGNAL( clicked() ), this, SLOT( loadMesh() ) );
+ connect( myLoadBtn, SIGNAL( clicked() ), this, SLOT( loadMesh() ));
setFontAttributes( aNameLab, Bold );
setFontAttributes( aObjLab, Bold );
void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
{
clear();
- if ( !CORBA::is_nil( obj ) ) {
+ if ( !CORBA::is_nil( obj )) {
_PTR(SObject) sobj = SMESH::ObjectToSObject( obj );
if ( sobj )
myWidgets[iName][iSingle]->setProperty( "text", sobj->GetName().c_str() );
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( obj );
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( obj );
if ( !aMesh->_is_nil() ) {
- myWidgets[iObject][iSingle]->setProperty( "text", tr( "OBJECT_MESH" ) );
+ myWidgets[iObject][iSingle]->setProperty( "text", tr( "OBJECT_MESH" ));
}
else if ( !aSubMesh->_is_nil() ) {
- myWidgets[iObject][iSingle]->setProperty( "text", tr( "OBJECT_SUBMESH" ) );
+ myWidgets[iObject][iSingle]->setProperty( "text", tr( "OBJECT_SUBMESH" ));
}
else if ( !aGroup->_is_nil() ) {
QString objType;
myWidgets[iObject][iSingle]->setProperty( "text", objType );
}
SMESH::long_array_var info = obj->GetMeshInfo();
- myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Node] ) );
- myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_0D] ) );
- myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Ball] ) );
+ myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Node] ));
+ myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_0D] ));
+ myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Ball] ));
long nbEdges = info[SMDSEntity_Edge] + info[SMDSEntity_Quad_Edge];
- myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( nbEdges ) );
- myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Edge] ) );
- myWidgets[i1D][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Edge] ) );
+ myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( nbEdges ));
+ myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Edge] ));
+ myWidgets[i1D][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Edge] ));
long nbTriangles = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle];
long nbQuadrangles = info[SMDSEntity_Quadrangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
long nb2DPolygons = info[SMDSEntity_Polygon] + info[SMDSEntity_Quad_Polygon];
long nb2DTotal = nb2DLinear + nb2DQuadratic + nb2DBiQuadratic;
myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( nb2DTotal ));
- myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( nb2DLinear ) );
- myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( nb2DQuadratic ) );
- myWidgets[i2D][iBiQuadratic] ->setProperty( "text", QString::number( nb2DBiQuadratic ) );
- myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( nbTriangles ) );
- myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Triangle] ) );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] ) );
- myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Triangle] ) );
- myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( nbQuadrangles ) );
- myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Quadrangle] ) );
- myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] ) );
- myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Quadrangle] ) );
+ myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( nb2DLinear ));
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( nb2DQuadratic ));
+ myWidgets[i2D][iBiQuadratic] ->setProperty( "text", QString::number( nb2DBiQuadratic ));
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( nbTriangles ));
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Triangle] ));
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] ));
+ myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Triangle] ));
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( nbQuadrangles ));
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Quadrangle] ));
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] ));
+ myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Quadrangle] ));
myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( nb2DPolygons ));
- myWidgets[i2DPolygons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Polygon] ) );
- myWidgets[i2DPolygons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Polygon] ) );
+ myWidgets[i2DPolygons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Polygon] ));
+ myWidgets[i2DPolygons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Polygon] ));
long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
long nb3DBiQuadratic = info[SMDSEntity_TriQuad_Hexa];
long nb3DTotal = nb3DLinear + nb3DQuadratic + nb3DBiQuadratic;
- myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DTotal ) );
- myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ) );
- myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( nb3DQuadratic ) );
- myWidgets[i3D][iBiQuadratic] ->setProperty( "text", QString::number( nb3DBiQuadratic ) );
- myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( nbTetrahedrons ) );
- myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Tetra] ) );
- myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Tetra] ) );
- myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( nbHexahedrons ) );
- myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Hexa] ) );
- myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Hexa] ) );
- myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_TriQuad_Hexa] ) );
- myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( nbPyramids ) );
- myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Pyramid] ) );
- myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Pyramid] ) );
- myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ) );
- myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ) );
- myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ) );
- myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ) );
- myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ) );
+ myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DTotal ));
+ myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ));
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( nb3DQuadratic ));
+ myWidgets[i3D][iBiQuadratic] ->setProperty( "text", QString::number( nb3DBiQuadratic ));
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( nbTetrahedrons ));
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Tetra] ));
+ myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Tetra] ));
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( nbHexahedrons ));
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Hexa] ));
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Hexa] ));
+ myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_TriQuad_Hexa] ));
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( nbPyramids ));
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Pyramid] ));
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Pyramid] ));
+ myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ));
+ myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ));
+ myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ));
+ myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ));
+ myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ));
long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DTotal + nb3DTotal;
long nbElemLinerial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear;
long nbElemQuadratic = info[SMDSEntity_Quad_Edge] + nb2DQuadratic + nb3DQuadratic;
long nbElemBiQuadratic = nb2DBiQuadratic + nb3DBiQuadratic;
- myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( nbElemTotal ) );
- myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinerial ) );
- myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( nbElemQuadratic ) );
- myWidgets[iNb][iBiQuadratic]->setProperty( "text", QString::number( nbElemBiQuadratic ) );
+ myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( nbElemTotal ));
+ myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinerial ));
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( nbElemQuadratic ));
+ myWidgets[iNb][iBiQuadratic]->setProperty( "text", QString::number( nbElemBiQuadratic ));
// before full loading from study file, type of elements in a sub-mesh can't be defined
// in some cases
bool infoOK = obj->IsMeshInfoCorrect();
if ( selected.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) IO = selected.First();
SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
- if ( !CORBA::is_nil( obj ) ) {
+ if ( !CORBA::is_nil( obj )) {
SMESH::SMESH_Mesh_var mesh = obj->GetMesh();
if ( !mesh->_is_nil() )
{
{
myWidgets[iName][iSingle] ->setProperty( "text", QString() );
myWidgets[iObject][iSingle] ->setProperty( "text", QString() );
- myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DPolygons][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DPolygons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
- myWidgets[iNb][iBiQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i1D][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2D][iBiQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DTriangles][iBiQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DQuadrangles][iBiQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DPolygons][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DPolygons][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3D][iBiQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DTetrahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DHexahedrons][iBiQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( 0 ));
+ myWidgets[iNb][iBiQuadratic] ->setProperty( "text", QString::number( 0 ));
}
/*!
lab->setAlignment( Qt::AlignCenter );
lab->setAutoFillBackground( true );
QPalette pal = lab->palette();
- pal.setColor( QPalette::Window, QApplication::palette().color( QPalette::Active, QPalette::Base ) );
+ pal.setColor( QPalette::Window, QApplication::palette().color( QPalette::Active, QPalette::Base ));
lab->setPalette( pal );
lab->setMinimumWidth( 70 );
return lab;
out << QString( 9, '-' ) << "\n";
out << tr( "BASE_INFO" ) << "\n";
out << QString( 9, '-' ) << "\n";
- out << tr( "NAME_LAB" ) << " " << ( myWidgets[iName][iSingle]->property( "text" ) ).toString() << "\n";
- out << tr( "OBJECT_LAB" ) << " " << ( myWidgets[iObject][iSingle]->property( "text" ) ).toString() << "\n";
- out << tr( "NODES_LAB" ) << " " << ( myWidgets[iNodes][iTotal]->property( "text" ) ).toString() << "\n";
+ out << tr( "NAME_LAB" ) << " " << ( myWidgets[iName][iSingle]->property( "text" )).toString() << "\n";
+ out << tr( "OBJECT_LAB" ) << " " << ( myWidgets[iObject][iSingle]->property( "text" )).toString() << "\n";
+ out << tr( "NODES_LAB" ) << " " << ( myWidgets[iNodes][iTotal]->property( "text" )).toString() << "\n";
out << tr( "ELEMENTS_LAB" ) << "\n";
- out << QString( SPACING_INFO, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[iNb][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[iNb][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[iNb][iQuadratic]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[iNb][iBiQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[iNb][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[iNb][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[iNb][iQuadratic]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[iNb][iBiQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "0D_LAB" ) << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i0D][iTotal]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i0D][iTotal]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "BALL_LAB" ) << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[iBalls][iTotal]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[iBalls][iTotal]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "1D_LAB" ) << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i1D][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i1D][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i1D][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i1D][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i1D][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i1D][iQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "2D_LAB" ) << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2D][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2D][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2D][iQuadratic]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2D][iBiQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2D][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2D][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2D][iQuadratic]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2D][iBiQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TRIANGLES_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DTriangles][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DTriangles][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DTriangles][iQuadratic]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DTriangles][iBiQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DTriangles][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DTriangles][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DTriangles][iQuadratic]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DTriangles][iBiQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRANGLES_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iQuadratic]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iBiQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iQuadratic]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DQuadrangles][iBiQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "POLYGONS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DPolygons][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DPolygons][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DPolygons][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i2DPolygons][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i2DPolygons][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i2DPolygons][iQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO, ' ' ) << tr( "3D_LAB" ) << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3D][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3D][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3D][iQuadratic]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*2, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i3D][iBiQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3D][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3D][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3D][iQuadratic]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*2, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i3D][iBiQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "TETRAHEDRONS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DTetrahedrons][iQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "HEXAHEDONRS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iQuadratic]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iBiQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iQuadratic]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "BI_QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DHexahedrons][iBiQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "PYRAMIDS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPyramids][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DPyramids][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DPyramids][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPyramids][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DPyramids][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DPyramids][iQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "PRISMS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPrisms][iTotal]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DPrisms][iLinear]->property( "text" ) ).toString() << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DPrisms][iQuadratic]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPrisms][iTotal]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "LINEAR_LAB" ) << ": " << ( myWidgets[i3DPrisms][iLinear]->property( "text" )).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "QUADRATIC_LAB" ) << ": " << ( myWidgets[i3DPrisms][iQuadratic]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "HEX_PRISMS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DHexaPrisms][iTotal]->property( "text" ) ).toString() << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DHexaPrisms][iTotal]->property( "text" )).toString() << "\n";
out << QString( SPACING_INFO*2, ' ' ) << tr( "POLYHEDRONS_LAB" ) << "\n";
- out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPolyhedrons][iTotal]->property( "text" ) ).toString() << "\n" << "\n";
+ out << QString( SPACING_INFO*3, ' ' ) << tr( "TOTAL_LAB" ) << ": " << ( myWidgets[i3DPolyhedrons][iTotal]->property( "text" )).toString() << "\n" << "\n";
}
/*!
vbl->setSpacing( 0 );
vbl->addWidget( myFrame );
vbl->addWidget( myExtra );
- connect( myExtra->prev, SIGNAL( clicked() ), this, SLOT( showPrevious() ) );
- connect( myExtra->next, SIGNAL( clicked() ), this, SLOT( showNext() ) );
+ connect( myExtra->prev, SIGNAL( clicked() ), this, SLOT( showPrevious() ));
+ connect( myExtra->next, SIGNAL( clicked() ), this, SLOT( showNext() ));
clear();
}
myIsElement = isElem;
myIndex = 0;
updateControls();
- information( myIDs.mid( myIndex*MAXITEMS, MAXITEMS ) );
+ information( myIDs.mid( myIndex*MAXITEMS, MAXITEMS ));
}
/*!
QString SMESHGUI_ElemInfo::formatConnectivity( Connectivity connectivity, int type )
{
QStringList str;
- if ( connectivity.contains( type ) ) {
+ if ( connectivity.contains( type )) {
QList<int> elements = connectivity[ type ];
qSort( elements );
foreach( int id, elements )
*/
SMESHGUI_ElemInfo::XYZ SMESHGUI_ElemInfo::normal( const SMDS_MeshElement* element )
{
- gp_XYZ n = SMESH::getNormale( dynamic_cast<const SMDS_MeshFace*>( element ) );
+ gp_XYZ n = SMESH::getNormale( dynamic_cast<const SMDS_MeshFace*>( element ));
return XYZ(n.X(), n.Y(), n.Z());
}
{
myIndex = qMax( 0, myIndex-1 );
updateControls();
- information( myIDs.mid( myIndex*MAXITEMS, MAXITEMS ) );
+ information( myIDs.mid( myIndex*MAXITEMS, MAXITEMS ));
}
/*!
{
myIndex = qMin( myIndex+1, myIDs.count() / MAXITEMS );
updateControls();
- information( myIDs.mid( myIndex*MAXITEMS, MAXITEMS ) );
+ information( myIDs.mid( myIndex*MAXITEMS, MAXITEMS ));
}
/*!
int grp_details = SMESHGUI::resourceMgr()->booleanValue( "SMESH", "elem_info_grp_details", false );
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
int cprecision = -1;
- if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ) )
+ if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ))
cprecision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "controls_precision", -1 );
foreach ( long id, ids ) {
if ( !isElements() ) {
if ( !node ) return;
// node ID
- myInfo->append( QString( "<b>%1 #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "NODE" ) ).arg( id ) );
+ myInfo->append( QString( "<b>%1 #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "NODE" )).arg( id ));
// separator
myInfo->append( "" );
// coordinates
- myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "COORDINATES" ) ).
- arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
- arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
- arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "COORDINATES" )).
+ arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision )).
+ arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision )).
+ arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision )) );
// separator
myInfo->append( "" );
// connectivity
Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) {
- myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) ) );
+ myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONNECTIVITY" )) );
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "EDGES" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "EDGES" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Ball );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "FACES" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "FACES" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "VOLUMES" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "VOLUMES" )).arg( con ));
}
else {
- myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" ) ).arg( id ) );
+ myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" )).arg( id ));
}
// node position
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
- if ( !CORBA::is_nil( aMeshPtr ) ) {
+ if ( !CORBA::is_nil( aMeshPtr )) {
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
int shapeID = pos->shapeID;
if ( shapeID > 0 ) {
}
// separator
myInfo->append( "" );
- myInfo->append( QString( "<b>%1:" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" ) ) );
- myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( shapeType ).arg( shapeID ) );
+ myInfo->append( QString( "<b>%1:" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" )) );
+ myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( shapeType ).arg( shapeID ));
if ( pos->shapeType == GEOM::EDGE || pos->shapeType == GEOM::FACE ) {
- myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "U_POSITION" ) ).
- arg( QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )) ) );
+ myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "U_POSITION" )).
+ arg( QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )) ));
if ( pos->shapeType == GEOM::FACE ) {
- myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "V_POSITION" ) ).
- arg( QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )) ) );
+ myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "V_POSITION" )).
+ arg( QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )) ));
}
}
}
}
// groups node belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
- if ( !CORBA::is_nil( aMesh ) ) {
+ if ( !CORBA::is_nil( aMesh )) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
myInfo->append( "" ); // separator
bool top_created = false;
for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
- if ( CORBA::is_nil( aGrp ) ) continue;
+ if ( CORBA::is_nil( aGrp )) continue;
QString aName = aGrp->GetName();
- if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
+ if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id )) {
if ( !top_created ) {
- myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" ) ) );
+ myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" )) );
top_created = true;
}
- myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ) );
+ myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ));
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
- if ( !CORBA::is_nil( aStdGroup ) ) {
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) ) );
+ if ( !CORBA::is_nil( aStdGroup )) {
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" )) );
}
- else if ( !CORBA::is_nil( aGeomGroup ) ) {
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) ) );
+ else if ( !CORBA::is_nil( aGeomGroup )) {
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" )) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
- myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) ).arg( sobj->GetName().c_str() ) );
+ myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" )).arg( sobj->GetName().c_str() ));
}
}
- else if ( !CORBA::is_nil( aFltGroup ) ) {
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ) );
+ else if ( !CORBA::is_nil( aFltGroup )) {
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" )) );
}
// size
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" ) ).
- arg( QString::number( aGrp->Size() ) ) );
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" )).
+ arg( QString::number( aGrp->Size() )) );
// color
SALOMEDS::Color color = aGrp->GetColor();
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" ) ).
- arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ) );
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" )).
+ arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ));
}
}
}
break;
}
if ( stype.isEmpty() ) return;
- myInfo->append( QString( "<b>%1 #%2</b>" ).arg( stype ).arg( id ) );
+ myInfo->append( QString( "<b>%1 #%2</b>" ).arg( stype ).arg( id ));
// separator
myInfo->append( "" );
break;
}
if ( !gtype.isEmpty() )
- myInfo->append( QString( "<b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "TYPE" ) ).arg( gtype ) );
+ myInfo->append( QString( "<b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "TYPE" )).arg( gtype ));
// Quadratic flag (any element except 0D)
if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Ball ) {
- myInfo->append( QString( "<b>%1?</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "QUADRATIC" ) ).arg( e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" ) ) );
+ myInfo->append( QString( "<b>%1?</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "QUADRATIC" )).arg( e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" )) );
}
if ( const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>( e )) {
// Ball diameter
- myInfo->append( QString( "<b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" ) ).arg( ball->GetDiameter() ));
+ myInfo->append( QString( "<b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" )).arg( ball->GetDiameter() ));
}
// separator
myInfo->append( "" );
for ( int idx = 1; nodeIt->more(); idx++ ) {
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
// node number and ID
- myInfo->append( QString( "<b>%1 %2/%3</b> - #%4" ).arg( SMESHGUI_ElemInfo::tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ).arg( node->GetID() ) );
+ myInfo->append( QString( "<b>%1 %2/%3</b> - #%4" ).arg( SMESHGUI_ElemInfo::tr( "NODE" )).arg( idx ).arg( e->NbNodes() ).arg( node->GetID() ));
// node coordinates
- myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "COORDINATES" ) ).
- arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
- arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ).
- arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "COORDINATES" )).
+ arg( node->X(), 0, precision > 0 ? 'f' : 'g', qAbs( precision )).
+ arg( node->Y(), 0, precision > 0 ? 'f' : 'g', qAbs( precision )).
+ arg( node->Z(), 0, precision > 0 ? 'f' : 'g', qAbs( precision )) );
// node connectivity
Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) {
- myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) ) );
+ myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONNECTIVITY" )) );
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "EDGES" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "EDGES" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "FACES" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "FACES" )).arg( con ));
con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() )
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "VOLUMES" ) ).arg( con ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "VOLUMES" )).arg( con ));
}
else {
- myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" ) ).arg( id ) );
+ myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" )).arg( id ));
}
}
// separator
myInfo->append( "" );
// Controls
- myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONTROLS" ) ) );
+ myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONTROLS" )) );
//Length
if ( e->GetType() == SMDSAbs_Edge ) {
afunctor.reset( new SMESH::Controls::Length() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "LENGTH_EDGES" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "LENGTH_EDGES" )).arg( afunctor->GetValue( id )) );
}
if( e->GetType() == SMDSAbs_Face ) {
//Area
afunctor.reset( new SMESH::Controls::Area() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "AREA_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "AREA_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//Taper
afunctor.reset( new SMESH::Controls::Taper() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "TAPER_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "TAPER_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//AspectRatio2D
afunctor.reset( new SMESH::Controls::AspectRatio() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//Minimum angle
afunctor.reset( new SMESH::Controls::MinimumAngle() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MINIMUMANGLE_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MINIMUMANGLE_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//Wraping angle
afunctor.reset( new SMESH::Controls::Warping() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "WARP_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "WARP_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//Skew
afunctor.reset( new SMESH::Controls::Skew() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "SKEW_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "SKEW_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//ElemDiam2D
afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_2D" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_2D" )).arg( afunctor->GetValue( id )) );
}
if( e->GetType() == SMDSAbs_Volume ) {
//AspectRatio3D
afunctor.reset( new SMESH::Controls::AspectRatio3D() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_3D_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_3D_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//Volume
afunctor.reset( new SMESH::Controls::Volume() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUME_3D_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUME_3D_ELEMENTS" )).arg( afunctor->GetValue( id )) );
//ElementDiameter3D
afunctor.reset( new SMESH::Controls::Volume() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_3D" ) ).arg( afunctor->GetValue( id ) ) );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_3D" )).arg( afunctor->GetValue( id )) );
}
// separator
myInfo->append( "" );
// Gravity center
XYZ gc = gravityCenter( e );
- myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) );
+ myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" )).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ));
// Normal vector
if( e->GetType() == SMDSAbs_Face ) {
XYZ gc = normal( e );
- myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "NORMAL_VECTOR" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) );
+ myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "NORMAL_VECTOR" )).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ));
}
// Element position
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
- if ( !CORBA::is_nil( aMesh ) ) {
+ if ( !CORBA::is_nil( aMesh )) {
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
int shapeID = pos.shapeID;
if ( shapeID > 0 ) {
case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
}
- myInfo->append( QString( "<b>%1:</b> %2 #%3" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" ) ).arg( shapeType ).arg( shapeID ) );
+ myInfo->append( QString( "<b>%1:</b> %2 #%3" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" )).arg( shapeType ).arg( shapeID ));
}
}
}
// Groups the element belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
- if ( !CORBA::is_nil( aMesh ) ) {
+ if ( !CORBA::is_nil( aMesh )) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
myInfo->append( "" ); // separator
bool top_created = false;
for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
- if ( CORBA::is_nil( aGrp ) ) continue;
+ if ( CORBA::is_nil( aGrp )) continue;
QString aName = aGrp->GetName();
- if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
+ if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id )) {
if ( !top_created ) {
- myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" ) ) );
+ myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" )) );
top_created = true;
}
- myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ) );
+ myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ));
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
- if ( !CORBA::is_nil( aStdGroup ) ) {
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) ) );
+ if ( !CORBA::is_nil( aStdGroup )) {
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" )) );
}
- else if ( !CORBA::is_nil( aGeomGroup ) ) {
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) ) );
+ else if ( !CORBA::is_nil( aGeomGroup )) {
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" )) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
- myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) ).arg( sobj->GetName().c_str() ) );
+ myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" )).arg( sobj->GetName().c_str() ));
}
}
- else if ( !CORBA::is_nil( aFltGroup ) ) {
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
- arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ) );
+ else if ( !CORBA::is_nil( aFltGroup )) {
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
+ arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" )) );
}
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" ) ).
- arg( QString::number( aGrp->Size() ) ) );
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" )).
+ arg( QString::number( aGrp->Size() )) );
// color
SALOMEDS::Color color = aGrp->GetColor();
- myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" ) ).
- arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ) );
+ myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" )).
+ arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ));
}
}
}
QWidget* SMESHGUI_TreeElemInfo::ItemDelegate::createEditor( QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index ) const
{
QWidget* w = index.column() == 0 ? 0: QItemDelegate::createEditor( parent, option, index );
- if ( qobject_cast<QLineEdit*>( w ) ) qobject_cast<QLineEdit*>( w )->setReadOnly( true );
+ if ( qobject_cast<QLineEdit*>( w )) qobject_cast<QLineEdit*>( w )->setReadOnly( true );
return w;
}
{
myInfo = new QTreeWidget( frame() );
myInfo->setColumnCount( 2 );
- myInfo->setHeaderLabels( QStringList() << tr( "PROPERTY" ) << tr( "VALUE" ) );
+ myInfo->setHeaderLabels( QStringList() << tr( "PROPERTY" ) << tr( "VALUE" ));
myInfo->header()->setStretchLastSection( true );
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
myInfo->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
#else
myInfo->header()->setSectionResizeMode( 0, QHeaderView::ResizeToContents );
#endif
- myInfo->setItemDelegate( new ItemDelegate( myInfo ) );
+ myInfo->setItemDelegate( new ItemDelegate( myInfo ));
QVBoxLayout* l = new QVBoxLayout( frame() );
l->setMargin( 0 );
l->addWidget( myInfo );
- connect( myInfo, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( itemDoubleClicked( QTreeWidgetItem*, int ) ) );
+ connect( myInfo, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int )), this, SLOT( itemDoubleClicked( QTreeWidgetItem*, int )) );
+ connect( myInfo, SIGNAL( itemCollapsed( QTreeWidgetItem* )), this, SLOT( saveExpanded( QTreeWidgetItem* )) );
+ connect( myInfo, SIGNAL( itemExpanded( QTreeWidgetItem* )), this, SLOT( saveExpanded( QTreeWidgetItem* )) );
}
/*!
int grp_details = SMESHGUI::resourceMgr()->booleanValue( "SMESH", "elem_info_grp_details", false );
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
int cprecision = -1;
- if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ) )
+ if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ))
cprecision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "controls_precision", -1 );
foreach ( long id, ids ) {
if ( !isElements() ) {
// node ID
QTreeWidgetItem* nodeItem = createItem( 0, Bold | All );
- nodeItem->setText( 0, SMESHGUI_ElemInfo::tr( "NODE" ) );
- nodeItem->setText( 1, QString( "#%1" ).arg( id ) );
+ nodeItem->setText( 0, SMESHGUI_ElemInfo::tr( "NODE" ));
+ nodeItem->setText( 1, QString( "#%1" ).arg( id ));
// coordinates
QTreeWidgetItem* coordItem = createItem( nodeItem, Bold );
- coordItem->setText( 0, SMESHGUI_ElemInfo::tr( "COORDINATES" ) );
+ coordItem->setText( 0, SMESHGUI_ElemInfo::tr( "COORDINATES" ));
QTreeWidgetItem* xItem = createItem( coordItem );
xItem->setText( 0, "X" );
- xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* yItem = createItem( coordItem );
yItem->setText( 0, "Y" );
- yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* zItem = createItem( coordItem );
zItem->setText( 0, "Z" );
- zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
// connectivity
QTreeWidgetItem* conItem = createItem( nodeItem, Bold );
- conItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) );
+ conItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ));
Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) {
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ));
i->setText( 1, con );
}
con = formatConnectivity( connectivity, SMDSAbs_Ball );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
}
else {
- conItem->setText( 1, SMESHGUI_ElemInfo::tr( "FREE_NODE" ) );
+ conItem->setText( 1, SMESHGUI_ElemInfo::tr( "FREE_NODE" ));
}
// node position
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
- if ( !CORBA::is_nil( aMeshPtr ) ) {
+ if ( !CORBA::is_nil( aMeshPtr )) {
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
int shapeID = pos->shapeID;
if ( shapeID > 0 ) {
}
// groups node belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
- if ( !CORBA::is_nil( aMesh ) ) {
+ if ( !CORBA::is_nil( aMesh )) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
QTreeWidgetItem* groupsItem = 0;
for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
- if ( CORBA::is_nil( aGrp ) ) continue;
+ if ( CORBA::is_nil( aGrp )) continue;
QString aName = aGrp->GetName();
- if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
+ if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id )) {
if ( !groupsItem ) {
groupsItem = createItem( nodeItem, Bold );
- groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
+ groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ));
}
QTreeWidgetItem* it = createItem( groupsItem, Bold );
it->setText( 0, aName.trimmed() );
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( it );
- typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
- if ( !CORBA::is_nil( aStdGroup ) ) {
- typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
+ typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ));
+ if ( !CORBA::is_nil( aStdGroup )) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ));
}
- else if ( !CORBA::is_nil( aGeomGroup ) ) {
- typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
+ else if ( !CORBA::is_nil( aGeomGroup )) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ));
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
- gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
+ gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ));
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
- else if ( !CORBA::is_nil( aFltGroup ) ) {
- typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
+ else if ( !CORBA::is_nil( aFltGroup )) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ));
}
// size
QTreeWidgetItem* sizeItem = createItem( it );
- sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
- sizeItem->setText( 1, QString::number( aGrp->Size() ) );
+ sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ));
+ sizeItem->setText( 1, QString::number( aGrp->Size() ));
// color
SALOMEDS::Color color = aGrp->GetColor();
QTreeWidgetItem* colorItem = createItem( it );
- colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
- colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
+ colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ));
+ colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ));
}
}
}
if ( stype.isEmpty() ) return;
QTreeWidgetItem* elemItem = createItem( 0, Bold | All );
elemItem->setText( 0, stype );
- elemItem->setText( 1, QString( "#%1" ).arg( id ) );
+ elemItem->setText( 1, QString( "#%1" ).arg( id ));
// geometry type
QString gtype;
switch( e->GetEntityType() ) {
}
if ( !gtype.isEmpty() ) {
QTreeWidgetItem* typeItem = createItem( elemItem, Bold );
- typeItem->setText( 0, SMESHGUI_ElemInfo::tr( "TYPE" ) );
+ typeItem->setText( 0, SMESHGUI_ElemInfo::tr( "TYPE" ));
typeItem->setText( 1, gtype );
}
// quadratic flag (for edges, faces and volumes)
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
// quadratic flag
QTreeWidgetItem* quadItem = createItem( elemItem, Bold );
- quadItem->setText( 0, SMESHGUI_ElemInfo::tr( "QUADRATIC" ) );
- quadItem->setText( 1, e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" ) );
+ quadItem->setText( 0, SMESHGUI_ElemInfo::tr( "QUADRATIC" ));
+ quadItem->setText( 1, e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" ));
}
if ( const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>( e )) {
// ball diameter
QTreeWidgetItem* diamItem = createItem( elemItem, Bold );
- diamItem->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" ) );
+ diamItem->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" ));
diamItem->setText( 1, QString( "%1" ).arg( ball->GetDiameter() ));
}
// connectivity
QTreeWidgetItem* conItem = createItem( elemItem, Bold );
- conItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) );
+ conItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ));
if( e->GetGeomType() != SMDSGeom_POLYHEDRA ) {
const int nbFaces = vtool.NbFaces();
for( int face_id = 0; face_id < nbFaces; face_id++ ) {
QTreeWidgetItem* faceItem = createItem( conItem, Bold );
- faceItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "FACE" ) ).arg( face_id + 1 ).arg( nbFaces ) );
+ faceItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "FACE" )).arg( face_id + 1 ).arg( nbFaces ));
faceItem->setExpanded( true );
const SMDS_MeshNode** aNodeIds = vtool.GetFaceNodes( face_id );
}
//Controls
QTreeWidgetItem* cntrItem = createItem( elemItem, Bold );
- cntrItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONTROLS" ) );
+ cntrItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONTROLS" ));
//Length
- if( e->GetType()==SMDSAbs_Edge){
+ if( e->GetType()==SMDSAbs_Edge){
afunctor.reset( new SMESH::Controls::Length() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
QTreeWidgetItem* lenItem = createItem( cntrItem, Bold );
- lenItem->setText( 0, tr( "LENGTH_EDGES" ) );
- lenItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ lenItem->setText( 0, tr( "LENGTH_EDGES" ));
+ lenItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
}
if( e->GetType() == SMDSAbs_Face ) {
- //Area
- afunctor.reset( new SMESH::Controls::Area() );
+ //Area
+ afunctor.reset( new SMESH::Controls::Area() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
QTreeWidgetItem* areaItem = createItem( cntrItem, Bold );
- areaItem->setText( 0, tr( "AREA_ELEMENTS" ) );
- areaItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue(id) ) );
+ areaItem->setText( 0, tr( "AREA_ELEMENTS" ));
+ areaItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue(id) ));
//Taper
- afunctor.reset( new SMESH::Controls::Taper() );
- afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- afunctor->SetPrecision( cprecision );
- QTreeWidgetItem* taperlItem = createItem( cntrItem, Bold );
- taperlItem->setText( 0, tr( "TAPER_ELEMENTS" ) );
- taperlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ if ( e->NbNodes() == 4 ) // see SMESH_Controls.cxx
+ {
+ afunctor.reset( new SMESH::Controls::Taper() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ afunctor->SetPrecision( cprecision );
+ QTreeWidgetItem* taperlItem = createItem( cntrItem, Bold );
+ taperlItem->setText( 0, tr( "TAPER_ELEMENTS" ));
+ taperlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ //Wraping angle
+ afunctor.reset( new SMESH::Controls::Warping() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ afunctor->SetPrecision( cprecision );
+ QTreeWidgetItem* warpItem = createItem( cntrItem, Bold );
+ warpItem->setText( 0, tr( "WARP_ELEMENTS" ));
+ warpItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ }
//AspectRatio2D
- afunctor.reset( new SMESH::Controls::AspectRatio() );
- afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- QTreeWidgetItem* ratlItem = createItem( cntrItem, Bold );
- ratlItem->setText( 0, tr( "ASPECTRATIO_ELEMENTS" ));
- ratlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ if ( !e->IsPoly() )
+ {
+ afunctor.reset( new SMESH::Controls::AspectRatio() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ QTreeWidgetItem* ratlItem = createItem( cntrItem, Bold );
+ ratlItem->setText( 0, tr( "ASPECTRATIO_ELEMENTS" ));
+ ratlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ }
//Minimum angle
afunctor.reset( new SMESH::Controls::MinimumAngle() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
QTreeWidgetItem* minanglItem = createItem( cntrItem, Bold );
- minanglItem->setText( 0, tr( "MINIMUMANGLE_ELEMENTS" ) );
- minanglItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
- //Wraping angle
- afunctor.reset( new SMESH::Controls::Warping() );
- afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- afunctor->SetPrecision( cprecision );
- QTreeWidgetItem* warpItem = createItem( cntrItem, Bold );
- warpItem->setText( 0, tr( "WARP_ELEMENTS" ));
- warpItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
- //Skew
- afunctor.reset( new SMESH::Controls::Skew() );
- afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- afunctor->SetPrecision( cprecision );
- QTreeWidgetItem* skewItem = createItem( cntrItem, Bold );
- skewItem->setText( 0, tr( "SKEW_ELEMENTS" ) );
- skewItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
- //ElemDiam2D
- afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
- afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- QTreeWidgetItem* diamItem = createItem( cntrItem, Bold );
- diamItem->setText( 0, tr( "MAX_ELEMENT_LENGTH_2D" ));
- diamItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ minanglItem->setText( 0, tr( "MINIMUMANGLE_ELEMENTS" ));
+ minanglItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ //Skew
+ if ( e->NbNodes() == 3 || e->NbNodes() == 4 )
+ {
+ afunctor.reset( new SMESH::Controls::Skew() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ afunctor->SetPrecision( cprecision );
+ QTreeWidgetItem* skewItem = createItem( cntrItem, Bold );
+ skewItem->setText( 0, tr( "SKEW_ELEMENTS" ));
+ skewItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ }
+ //ElemDiam2D
+ if ( !e->IsPoly() )
+ {
+ afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ QTreeWidgetItem* diamItem = createItem( cntrItem, Bold );
+ diamItem->setText( 0, tr( "MAX_ELEMENT_LENGTH_2D" ));
+ diamItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ }
}
if( e->GetType() == SMDSAbs_Volume ) {
- //AspectRatio3D
- afunctor.reset( new SMESH::Controls::AspectRatio3D() );
- afunctor->SetMesh( actor()->GetObject()->GetMesh() );
- QTreeWidgetItem* ratlItem3 = createItem( cntrItem, Bold );
- ratlItem3->setText( 0, tr( "ASPECTRATIO_3D_ELEMENTS" ) );
- ratlItem3->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ if ( !e->IsPoly() )
+ {
+ //AspectRatio3D
+ afunctor.reset( new SMESH::Controls::AspectRatio3D() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ QTreeWidgetItem* ratlItem3 = createItem( cntrItem, Bold );
+ ratlItem3->setText( 0, tr( "ASPECTRATIO_3D_ELEMENTS" ));
+ ratlItem3->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ }
//Volume
afunctor.reset( new SMESH::Controls::Volume() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
QTreeWidgetItem* volItem = createItem( cntrItem, Bold );
- volItem->setText( 0, tr( "VOLUME_3D_ELEMENTS" ) );
- volItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ volItem->setText( 0, tr( "VOLUME_3D_ELEMENTS" ));
+ volItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
//ElementDiameter3D
afunctor.reset( new SMESH::Controls::MaxElementLength3D() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
QTreeWidgetItem* diam3Item = createItem( cntrItem, Bold );
- diam3Item->setText( 0, tr( "MAX_ELEMENT_LENGTH_3D" ) );
- diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ diam3Item->setText( 0, tr( "MAX_ELEMENT_LENGTH_3D" ));
+ diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
}
// gravity center
XYZ gc = gravityCenter( e );
QTreeWidgetItem* gcItem = createItem( elemItem, Bold );
- gcItem->setText( 0, SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ) );
+ gcItem->setText( 0, SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ));
QTreeWidgetItem* xItem = createItem( gcItem );
xItem->setText( 0, "X" );
- xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* yItem = createItem( gcItem );
yItem->setText( 0, "Y" );
- yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* zItem = createItem( gcItem );
zItem->setText( 0, "Z" );
- zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
// normal vector
if( e->GetType() == SMDSAbs_Face ) {
XYZ gc = normal( e );
QTreeWidgetItem* nItem = createItem( elemItem, Bold );
- nItem->setText( 0, SMESHGUI_ElemInfo::tr( "NORMAL_VECTOR" ) );
+ nItem->setText( 0, SMESHGUI_ElemInfo::tr( "NORMAL_VECTOR" ));
QTreeWidgetItem* xItem = createItem( nItem );
xItem->setText( 0, "X" );
- xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* yItem = createItem( nItem );
yItem->setText( 0, "Y" );
- yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* zItem = createItem( nItem );
zItem->setText( 0, "Z" );
- zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
}
// element position
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
- if ( !CORBA::is_nil( aMesh ) ) {
+ if ( !CORBA::is_nil( aMesh )) {
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
int shapeID = pos.shapeID;
if ( shapeID > 0 ) {
case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
}
- shItem->setText( 0, SMESHGUI_ElemInfo::tr( "POSITION" ) );
- shItem->setText( 1, QString( "%1 #%2" ).arg( shapeType ).arg( shapeID ) );
+ shItem->setText( 0, SMESHGUI_ElemInfo::tr( "POSITION" ));
+ shItem->setText( 1, QString( "%1 #%2" ).arg( shapeType ).arg( shapeID ));
}
}
}
// groups element belongs to
- if ( !CORBA::is_nil( aMesh ) ) {
+ if ( !CORBA::is_nil( aMesh )) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
QTreeWidgetItem* groupsItem = 0;
for ( CORBA::ULong i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
- if ( CORBA::is_nil( aGrp ) ) continue;
+ if ( CORBA::is_nil( aGrp )) continue;
QString aName = aGrp->GetName();
- if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
+ if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id )) {
if ( !groupsItem ) {
groupsItem = createItem( elemItem, Bold );
- groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
+ groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ));
}
QTreeWidgetItem* it = createItem( groupsItem, Bold );
it->setText( 0, aName.trimmed() );
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( it );
- typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
- if ( !CORBA::is_nil( aStdGroup ) ) {
- typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
+ typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ));
+ if ( !CORBA::is_nil( aStdGroup )) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ));
}
- else if ( !CORBA::is_nil( aGeomGroup ) ) {
- typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
+ else if ( !CORBA::is_nil( aGeomGroup )) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ));
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
- gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
+ gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ));
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
- else if ( !CORBA::is_nil( aFltGroup ) ) {
- typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
+ else if ( !CORBA::is_nil( aFltGroup )) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ));
}
// size
QTreeWidgetItem* sizeItem = createItem( it );
- sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
- sizeItem->setText( 1, QString::number( aGrp->Size() ) );
+ sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ));
+ sizeItem->setText( 1, QString::number( aGrp->Size() ));
// color
SALOMEDS::Color color = aGrp->GetColor();
QTreeWidgetItem* colorItem = createItem( it );
- colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
- colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
+ colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ));
+ colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ));
}
}
}
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
// node number and ID
QTreeWidgetItem* nodeItem = createItem( parentItem, Bold );
- nodeItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "NODE" ) ).arg( index ).arg( nbNodes ) );
- nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ) );
+ nodeItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "NODE" )).arg( index ).arg( nbNodes ));
+ nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ));
nodeItem->setData( 1, TypeRole, ElemConnectivity );
nodeItem->setData( 1, IdRole, node->GetID() );
nodeItem->setExpanded( false );
// node coordinates
QTreeWidgetItem* coordItem = createItem( nodeItem );
- coordItem->setText( 0, SMESHGUI_ElemInfo::tr( "COORDINATES" ) );
+ coordItem->setText( 0, SMESHGUI_ElemInfo::tr( "COORDINATES" ));
QTreeWidgetItem* xItem = createItem( coordItem );
xItem->setText( 0, "X" );
- xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ xItem->setText( 1, QString::number( node->X(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* yItem = createItem( coordItem );
yItem->setText( 0, "Y" );
- yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ yItem->setText( 1, QString::number( node->Y(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
QTreeWidgetItem* zItem = createItem( coordItem );
zItem->setText( 0, "Z" );
- zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ zItem->setText( 1, QString::number( node->Z(), precision > 0 ? 'f' : 'g', qAbs( precision )) );
// node connectivity
QTreeWidgetItem* nconItem = createItem( nodeItem );
- nconItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ) );
+ nconItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONNECTIVITY" ));
Connectivity connectivity = nodeConnectivity( node );
if ( !connectivity.isEmpty() ) {
QString con = formatConnectivity( connectivity, SMDSAbs_0DElement );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "0D_ELEMENTS" ));
i->setText( 1, con );
}
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Ball );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
- i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ) );
+ i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ));
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
}
QFont f = item->font( 0 );
f.setBold( true );
for ( int i = 0; i < myInfo->columnCount(); i++ ) {
- if ( ( flags & Bold ) && ( i == 0 || flags & All ) )
+ if ( ( flags & Bold ) && ( i == 0 || flags & All ))
item->setFont( i, f );
}
+ if ( parent && parent->childCount() == 1 && itemDepth( parent ) == 1 )
+ {
+ QString resName = expandedResource( parent );
+ parent->setExpanded( SMESHGUI::resourceMgr()->booleanValue("SMESH", resName, true ));
+ }
+
item->setExpanded( true );
return item;
}
int type = aTreeItem->data( 1, TypeRole ).toInt();
int id = aTreeItem->data( 1, IdRole ).toInt();
QMenu menu;
- QAction* a = menu.addAction( tr( "SHOW_ITEM_INFO" ) );
+ QAction* a = menu.addAction( tr( "SHOW_ITEM_INFO" ));
if ( type == ElemConnectivity && id > 0 && menu.exec( e->globalPos() ) == a )
- emit( itemInfo( id ) );
+ emit( itemInfo( id ));
else if ( type == NodeConnectivity && menu.exec( e->globalPos() ) == a )
- emit( itemInfo( aTreeItem->text( 1 ) ) );
+ emit( itemInfo( aTreeItem->text( 1 )) );
}
-void SMESHGUI_TreeElemInfo::itemDoubleClicked( QTreeWidgetItem* theItem, int theColumn )
+void SMESHGUI_TreeElemInfo::itemDoubleClicked( QTreeWidgetItem* theItem, int theColumn )
{
if ( theItem ) {
int type = theItem->data( 1, TypeRole ).toInt();
int id = theItem->data( 1, IdRole ).toInt();
if ( type == ElemConnectivity && id > 0 )
- emit( itemInfo( id ) );
+ emit( itemInfo( id ));
else if ( type == NodeConnectivity )
- emit( itemInfo( theItem->text( 1 ) ) );
+ emit( itemInfo( theItem->text( 1 )) );
}
}
+void SMESHGUI_TreeElemInfo::saveExpanded( QTreeWidgetItem* theItem )
+{
+ if ( theItem )
+ SMESHGUI::resourceMgr()->setValue("SMESH", expandedResource( theItem ), theItem->isExpanded() );
+}
+
+QString SMESHGUI_TreeElemInfo::expandedResource( QTreeWidgetItem* theItem )
+{
+ return QString("Expanded_") + ( isElements() ? "E_" : "N_" ) + theItem->text(0);
+}
+
void SMESHGUI_TreeElemInfo::saveInfo( QTextStream &out )
{
out << QString( 12, '-' ) << "\n";
myComputors.clear();
clear();
- if ( CORBA::is_nil( obj ) ) return;
+ if ( CORBA::is_nil( obj )) return;
_PTR(SObject) sobj = SMESH::ObjectToSObject( obj );
if ( !sobj ) return;
// name
QTreeWidgetItem* nameItem = createItem( 0, Bold | All );
- nameItem->setText( 0, tr( "NAME" ) );
+ nameItem->setText( 0, tr( "NAME" ));
nameItem->setText( 1, sobj->GetName().c_str() );
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( obj );
QFont f = item->font( 0 );
f.setBold( true );
for ( int i = 0; i < columnCount(); i++ ) {
- if ( ( flags & Bold ) && ( i == 0 || flags & All ) )
+ if ( ( flags & Bold ) && ( i == 0 || flags & All ))
item->setFont( i, f );
}
GEOM::GEOM_Object_var shape = mesh->GetShapeToMesh();
SMESH::MedFileInfo_var inf = mesh->GetMEDFileInfo();
QTreeWidgetItem* typeItem = createItem( parent, Bold );
- typeItem->setText( 0, tr( "TYPE" ) );
- if ( !CORBA::is_nil( shape ) ) {
- typeItem->setText( 1, tr( "MESH_ON_GEOMETRY" ) );
+ typeItem->setText( 0, tr( "TYPE" ));
+ if ( !CORBA::is_nil( shape )) {
+ typeItem->setText( 1, tr( "MESH_ON_GEOMETRY" ));
_PTR(SObject) sobj = SMESH::ObjectToSObject( shape );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
- gobjItem->setText( 0, tr( "GEOM_OBJECT" ) );
+ gobjItem->setText( 0, tr( "GEOM_OBJECT" ));
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
else if ( strlen( (char*)inf->fileName ) > 0 ) {
- typeItem->setText( 1, tr( "MESH_FROM_FILE" ) );
+ typeItem->setText( 1, tr( "MESH_FROM_FILE" ));
QTreeWidgetItem* fileItem = createItem( typeItem );
- fileItem->setText( 0, tr( "FILE_NAME" ) );
+ fileItem->setText( 0, tr( "FILE_NAME" ));
fileItem->setText( 1, (char*)inf->fileName );
}
else {
- typeItem->setText( 1, tr( "STANDALONE_MESH" ) );
+ typeItem->setText( 1, tr( "STANDALONE_MESH" ));
}
// groups
_PTR(SObject) sobj = SMESH::ObjectToSObject( subMesh->GetFather() );
if ( sobj ) {
QTreeWidgetItem* nameItem = createItem( parent, Bold );
- nameItem->setText( 0, tr( "PARENT_MESH" ) );
+ nameItem->setText( 0, tr( "PARENT_MESH" ));
nameItem->setText( 1, sobj->GetName().c_str() );
}
}
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( parent, Bold );
- gobjItem->setText( 0, tr( "GEOM_OBJECT" ) );
+ gobjItem->setText( 0, tr( "GEOM_OBJECT" ));
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
_PTR(SObject) sobj = SMESH::ObjectToSObject( grp->GetMesh() );
if ( sobj ) {
QTreeWidgetItem* nameItem = createItem( parent, Bold );
- nameItem->setText( 0, tr( "PARENT_MESH" ) );
+ nameItem->setText( 0, tr( "PARENT_MESH" ));
nameItem->setText( 1, sobj->GetName().c_str() );
}
}
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( parent, Bold );
- typeItem->setText( 0, tr( "TYPE" ) );
- if ( !CORBA::is_nil( aStdGroup ) ) {
- typeItem->setText( 1, tr( "STANDALONE_GROUP" ) );
+ typeItem->setText( 0, tr( "TYPE" ));
+ if ( !CORBA::is_nil( aStdGroup )) {
+ typeItem->setText( 1, tr( "STANDALONE_GROUP" ));
}
- else if ( !CORBA::is_nil( aGeomGroup ) ) {
- typeItem->setText( 1, tr( "GROUP_ON_GEOMETRY" ) );
+ else if ( !CORBA::is_nil( aGeomGroup )) {
+ typeItem->setText( 1, tr( "GROUP_ON_GEOMETRY" ));
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
- gobjItem->setText( 0, tr( "GEOM_OBJECT" ) );
+ gobjItem->setText( 0, tr( "GEOM_OBJECT" ));
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
- else if ( !CORBA::is_nil( aFltGroup ) ) {
- typeItem->setText( 1, tr( "GROUP_ON_FILTER" ) );
+ else if ( !CORBA::is_nil( aFltGroup )) {
+ typeItem->setText( 1, tr( "GROUP_ON_FILTER" ));
}
if ( !isShort ) {
break;
}
QTreeWidgetItem* etypeItem = createItem( parent, Bold );
- etypeItem->setText( 0, tr( "ENTITY_TYPE" ) );
+ etypeItem->setText( 0, tr( "ENTITY_TYPE" ));
etypeItem->setText( 1, etype );
}
groupSize = grp->Size();
QTreeWidgetItem* sizeItem = createItem( parent, Bold );
- sizeItem->setText( 0, tr( "SIZE" ) );
+ sizeItem->setText( 0, tr( "SIZE" ));
if ( groupSize > -1 ) {
- sizeItem->setText( 1, QString::number( groupSize ) );
+ sizeItem->setText( 1, QString::number( groupSize ));
}
else {
QPushButton* btn = new QPushButton( tr( meshLoaded ? "COMPUTE" : "LOAD"), this );
setItemWidget( sizeItem, 1, btn );
GrpComputor* comp = new GrpComputor( grp, sizeItem, this, /*size=*/true );
- connect( btn, SIGNAL( clicked() ), comp, SLOT( compute() ) );
+ connect( btn, SIGNAL( clicked() ), comp, SLOT( compute() ));
myComputors.append( comp );
if ( !meshLoaded )
- connect( btn, SIGNAL( clicked() ), this, SLOT( changeLoadToCompute() ) );
+ connect( btn, SIGNAL( clicked() ), this, SLOT( changeLoadToCompute() ));
}
// color
SALOMEDS::Color color = grp->GetColor();
QTreeWidgetItem* colorItem = createItem( parent, Bold );
- colorItem->setText( 0, tr( "COLOR" ) );
- colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
+ colorItem->setText( 0, tr( "COLOR" ));
+ colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ));
// nb of underlying nodes
if ( grp->GetType() != SMESH::NODE) {
QTreeWidgetItem* nodesItem = createItem( parent, Bold );
- nodesItem->setText( 0, tr( "NB_NODES" ) );
+ nodesItem->setText( 0, tr( "NB_NODES" ));
int nbNodesLimit = SMESHGUI::resourceMgr()->integerValue( "SMESH", "info_groups_nodes_limit", 100000 );
bool toShowNodes = groupSize >= 0 ? ( grp->IsNodeInfoAvailable() || nbNodesLimit <= 0 || groupSize <= nbNodesLimit ) : false;
if ( toShowNodes && meshLoaded ) {
// already calculated and up-to-date
- nodesItem->setText( 1, QString::number( grp->GetNumberOfNodes() ) );
+ nodesItem->setText( 1, QString::number( grp->GetNumberOfNodes() ));
}
else {
QPushButton* btn = new QPushButton( tr( meshLoaded ? "COMPUTE" : "LOAD"), this );
setItemWidget( nodesItem, 1, btn );
GrpComputor* comp = new GrpComputor( grp, nodesItem, this );
- connect( btn, SIGNAL( clicked() ), comp, SLOT( compute() ) );
+ connect( btn, SIGNAL( clicked() ), comp, SLOT( compute() ));
myComputors.append( comp );
if ( !meshLoaded )
- connect( btn, SIGNAL( clicked() ), this, SLOT( changeLoadToCompute() ) );
+ connect( btn, SIGNAL( clicked() ), this, SLOT( changeLoadToCompute() ));
}
}
}
for ( int i = 0; i < parent->childCount() && !itemGroups; i++ ) {
if ( parent->child( i )->data( 0, Qt::UserRole ).toInt() == GROUPS_ID ) {
itemGroups = parent->child( i );
- ExtraWidget* extra = dynamic_cast<ExtraWidget*>( itemWidget( itemGroups, 1 ) );
+ ExtraWidget* extra = dynamic_cast<ExtraWidget*>( itemWidget( itemGroups, 1 ));
if ( extra )
extra->updateControls( myGroups->length(), idx );
while ( itemGroups->childCount() ) delete itemGroups->child( 0 ); // clear child items
QMap<int, QTreeWidgetItem*> grpItems;
for ( int i = idx*MAXITEMS ; i < qMin( (idx+1)*MAXITEMS, (int)myGroups->length() ); i++ ) {
SMESH::SMESH_GroupBase_var grp = myGroups[i];
- if ( CORBA::is_nil( grp ) ) continue;
+ if ( CORBA::is_nil( grp )) continue;
_PTR(SObject) grpSObj = SMESH::ObjectToSObject( grp );
if ( !grpSObj ) continue;
if ( !itemGroups ) {
// create top-level groups container item
itemGroups = createItem( parent, Bold | All );
- itemGroups->setText( 0, tr( "GROUPS" ) );
+ itemGroups->setText( 0, tr( "GROUPS" ));
itemGroups->setData( 0, Qt::UserRole, GROUPS_ID );
// total number of groups > 10, show extra widgets for info browsing
if ((int) myGroups->length() > MAXITEMS ) {
ExtraWidget* extra = new ExtraWidget( this, true );
- connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousGroups() ) );
- connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextGroups() ) );
+ connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousGroups() ));
+ connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextGroups() ));
setItemWidget( itemGroups, 1, extra );
extra->updateControls( myGroups->length(), idx );
}
if ( grpItems.find( grpType ) == grpItems.end() ) {
grpItems[ grpType ] = createItem( itemGroups, Bold | All );
- grpItems[ grpType ]->setText( 0, tr( QString( "GROUPS_%1" ).arg( grpType ).toLatin1().constData() ) );
+ grpItems[ grpType ]->setText( 0, tr( QString( "GROUPS_%1" ).arg( grpType ).toLatin1().constData() ));
itemGroups->insertChild( grpType-1, grpItems[ grpType ] );
}
for ( int i = 0; i < parent->childCount() && !itemSubMeshes; i++ ) {
if ( parent->child( i )->data( 0, Qt::UserRole ).toInt() == SUBMESHES_ID ) {
itemSubMeshes = parent->child( i );
- ExtraWidget* extra = dynamic_cast<ExtraWidget*>( itemWidget( itemSubMeshes, 1 ) );
+ ExtraWidget* extra = dynamic_cast<ExtraWidget*>( itemWidget( itemSubMeshes, 1 ));
if ( extra )
extra->updateControls( mySubMeshes->length(), idx );
while ( itemSubMeshes->childCount() ) delete itemSubMeshes->child( 0 ); // clear child items
QMap<int, QTreeWidgetItem*> smItems;
for ( int i = idx*MAXITEMS ; i < qMin( (idx+1)*MAXITEMS, (int)mySubMeshes->length() ); i++ ) {
SMESH::SMESH_subMesh_var sm = mySubMeshes[i];
- if ( CORBA::is_nil( sm ) ) continue;
+ if ( CORBA::is_nil( sm )) continue;
_PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
if ( !smSObj ) continue;
GEOM::GEOM_Object_var gobj = sm->GetSubShape();
- if ( CORBA::is_nil(gobj ) ) continue;
+ if ( CORBA::is_nil(gobj )) continue;
int smType = gobj->GetShapeType();
if ( smType == GEOM::COMPSOLID ) smType = GEOM::COMPOUND;
if ( !itemSubMeshes ) {
itemSubMeshes = createItem( parent, Bold | All );
- itemSubMeshes->setText( 0, tr( "SUBMESHES" ) );
+ itemSubMeshes->setText( 0, tr( "SUBMESHES" ));
itemSubMeshes->setData( 0, Qt::UserRole, SUBMESHES_ID );
// total number of sub-meshes > 10, show extra widgets for info browsing
if ((int) mySubMeshes->length() > MAXITEMS ) {
ExtraWidget* extra = new ExtraWidget( this, true );
- connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousSubMeshes() ) );
- connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextSubMeshes() ) );
+ connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousSubMeshes() ));
+ connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextSubMeshes() ));
setItemWidget( itemSubMeshes, 1, extra );
extra->updateControls( mySubMeshes->length(), idx );
}
if ( smItems.find( smType ) == smItems.end() ) {
smItems[ smType ] = createItem( itemSubMeshes, Bold | All );
- smItems[ smType ]->setText( 0, tr( QString( "SUBMESHES_%1" ).arg( smType ).toLatin1().constData() ) );
+ smItems[ smType ]->setText( 0, tr( QString( "SUBMESHES_%1" ).arg( smType ).toLatin1().constData() ));
itemSubMeshes->insertChild( smType, smItems[ smType ] );
}
{
if ( QTreeWidgetItem* item = myComputors[i]->getItem() )
{
- if ( QPushButton* btn = qobject_cast<QPushButton*>( itemWidget ( item, 1 ) ) )
+ if ( QPushButton* btn = qobject_cast<QPushButton*>( itemWidget ( item, 1 )) )
btn->setText( tr("COMPUTE") );
}
}
while ( *it ) {
if ( !( ( *it )->text(0) ).isEmpty() ) {
out << QString( SPACING_INFO * itemDepth( *it ), ' ' ) << ( *it )->text(0);
- if ( ( *it )->text(0) == tr( "COLOR" ) ) {
+ if ( ( *it )->text(0) == tr( "COLOR" )) {
out << ": " << ( ( ( *it )->background(1) ).color() ).name();
}
else if ( !( ( *it )->text(1) ).isEmpty() ) out << ": " << ( *it )->text(1);
\param page specifies the dialog page to be shown at the start-up
*/
SMESHGUI_MeshInfoDlg::SMESHGUI_MeshInfoDlg( QWidget* parent, int page )
-: QDialog( parent ), myActor( 0 )
+ : QDialog( parent ), myActor( 0 )
{
setModal( false );
setAttribute( Qt::WA_DeleteOnClose, true );
- setWindowTitle( tr( "MESH_INFO" ) );
+ setWindowTitle( tr( "MESH_INFO" ));
setSizeGripEnabled( true );
myTabWidget = new QTabWidget( this );
- // base info
+ // base info
myBaseInfo = new SMESHGUI_MeshInfo( myTabWidget );
- myTabWidget->addTab( myBaseInfo, tr( "BASE_INFO" ) );
+ myTabWidget->addTab( myBaseInfo, tr( "BASE_INFO" ));
// elem info
-
+
QWidget* w = new QWidget( myTabWidget );
myMode = new QButtonGroup( this );
myMode->addButton( new QRadioButton( tr( "ELEM_MODE" ), w ), ElemMode );
myMode->button( NodeMode )->setChecked( true );
myID = new QLineEdit( w );
- myID->setValidator( new SMESHGUI_IdValidator( this ) );
+ myID->setValidator( new SMESHGUI_IdValidator( this ));
+ myIDPreviewCheck = new QCheckBox( tr( "SHOW_IDS" ), w );
+ myIDPreview = new SMESHGUI_IdPreview( SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ));
int mode = SMESHGUI::resourceMgr()->integerValue( "SMESH", "mesh_elem_info", 1 );
- mode = qMin( 1, qMax( 0, mode ) );
-
- if ( mode == 0 )
+ mode = qMin( 1, qMax( 0, mode ));
+
+ if ( mode == 0 )
myElemInfo = new SMESHGUI_SimpleElemInfo( w );
else
myElemInfo = new SMESHGUI_TreeElemInfo( w );
elemLayout->setSpacing( SPACING );
elemLayout->addWidget( myMode->button( NodeMode ), 0, 0 );
elemLayout->addWidget( myMode->button( ElemMode ), 0, 1 );
- elemLayout->addWidget( myID, 0, 2 );
- elemLayout->addWidget( myElemInfo, 1, 0, 1, 3 );
-
- myTabWidget->addTab( w, tr( "ELEM_INFO" ) );
+ elemLayout->addWidget( myID, 0, 2 );
+ elemLayout->addWidget( myIDPreviewCheck, 1, 0, 1, 2 );
+ elemLayout->addWidget( myElemInfo, 2, 0, 1, 3 );
+
+ myTabWidget->addTab( w, tr( "ELEM_INFO" ));
// additional info
myAddInfo = new SMESHGUI_AddInfo( myTabWidget );
- myTabWidget->addTab( myAddInfo, tr( "ADDITIONAL_INFO" ) );
+ myTabWidget->addTab( myAddInfo, tr( "ADDITIONAL_INFO" ));
// controls info
myCtrlInfo = new SMESHGUI_CtrlInfo( myTabWidget );
- myTabWidget->addTab( myCtrlInfo, tr( "CTRL_INFO" ) );
+ myTabWidget->addTab( myCtrlInfo, tr( "CTRL_INFO" ));
// buttons
l->addWidget( myTabWidget );
l->addLayout( btnLayout );
- myTabWidget->setCurrentIndex( qMax( (int)BaseInfo, qMin( (int)ElemInfo, page ) ) );
+ myTabWidget->setCurrentIndex( qMax( (int)BaseInfo, qMin( (int)ElemInfo, page )));
- connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( dumpBtn, SIGNAL( clicked() ), this, SLOT( dump() ) );
- connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ) );
- connect( myTabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( updateSelection() ) );
- connect( myMode, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged() ) );
- connect( myID, SIGNAL( textChanged( QString ) ), this, SLOT( idChanged() ) );
- connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ) );
- connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
- connect( myElemInfo, SIGNAL( itemInfo( int ) ), this, SLOT( showItemInfo( int ) ) );
- connect( myElemInfo, SIGNAL( itemInfo( QString ) ), this, SLOT( showItemInfo( QString ) ) );
+ connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ));
+ connect( dumpBtn, SIGNAL( clicked() ), this, SLOT( dump() ));
+ connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ));
+ connect( myTabWidget, SIGNAL( currentChanged( int )), this, SLOT( updateSelection() ));
+ connect( myMode, SIGNAL( buttonClicked( int )), this, SLOT( modeChanged() ));
+ connect( myID, SIGNAL( textChanged( QString )), this, SLOT( idChanged() ));
+ connect( myIDPreviewCheck, SIGNAL( toggled(bool) ), this, SLOT( idPreviewChange(bool) ));
+ connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ));
+ connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ));
+ connect( myElemInfo, SIGNAL( itemInfo( int )), this, SLOT( showItemInfo( int )));
+ connect( myElemInfo, SIGNAL( itemInfo( QString )), this, SLOT( showItemInfo( QString )));
updateSelection();
}
*/
SMESHGUI_MeshInfoDlg::~SMESHGUI_MeshInfoDlg()
{
+ delete myIDPreview;
}
/*!
myIO = IO;
SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
- if ( !CORBA::is_nil( obj ) )
+ if ( !CORBA::is_nil( obj ))
{
myAddInfo->showInfo( obj ); // nb of nodes in a group can be computed by myAddInfo,
myBaseInfo->showInfo( obj ); // and it will be used by myBaseInfo (IPAL52871)
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->SetSelectionMode( ActorSelection );
QDialog::reject();
+ myIDPreview->SetPointsLabeled(false);
}
/*!
disconnect( selMgr, 0, this, 0 );
selMgr->clearFilters();
- if ( myTabWidget->currentIndex() == BaseInfo || myTabWidget->currentIndex() == AddInfo || myTabWidget->currentIndex() == CtrlInfo ) {
+ if ( myTabWidget->currentIndex() == BaseInfo ||
+ myTabWidget->currentIndex() == AddInfo ||
+ myTabWidget->currentIndex() == CtrlInfo ) {
SMESH::SetPointRepresentation( false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->SetSelectionMode( ActorSelection );
SMESH_Actor* oldActor = myActor;
myID->clear();
- connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
+ connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ));
updateInfo();
if ( oldActor == myActor && myActor && !oldID.isEmpty() ) {
void SMESHGUI_MeshInfoDlg::deactivate()
{
myTabWidget->setEnabled( false );
- disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
+ disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ));
}
/*!
}
/*!
- \brief Caled when users prints mesh element ID in the corresponding field.
+ \brief Called when users prints mesh element ID in the corresponding field.
*/
void SMESHGUI_MeshInfoDlg::idChanged()
{
+ myIDPreview->SetPointsLabeled( false );
+
SVTK_Selector* selector = SMESH::GetSelector();
if ( myActor && selector ) {
Handle(SALOME_InteractiveObject) IO = myActor->getIO();
TColStd_MapOfInteger ID;
- QSet<long> ids;
+ QSet<long> ids;
+ std::vector<int> idVec;
+ std::list< gp_XYZ > aGrCentersXYZ;
QStringList idTxt = myID->text().split( " ", QString::SkipEmptyParts );
foreach ( QString tid, idTxt ) {
long id = tid.trimmed().toLong();
- const SMDS_MeshElement* e = myMode->checkedId() == ElemMode ?
+ const SMDS_MeshElement* e = myMode->checkedId() == ElemMode ?
myActor->GetObject()->GetMesh()->FindElement( id ) :
myActor->GetObject()->GetMesh()->FindNode( id );
if ( e ) {
ID.Add( id );
ids << id;
+ if ( myMode->checkedId() == ElemMode )
+ {
+ idVec.push_back( id );
+ aGrCentersXYZ.push_back( myElemInfo->getGravityCenter( e ));
+ }
}
}
selector->AddOrRemoveIndex( IO, ID, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) {
+
+ if ( myMode->checkedId() == NodeMode )
+ myIDPreview->SetPointsData( myActor->GetObject()->GetMesh(), ID );
+ else
+ myIDPreview->SetElemsData( idVec, aGrCentersXYZ );
+
+ bool showIDs = ( !ID.IsEmpty() &&
+ myIDPreviewCheck->isChecked() &&
+ myTabWidget->currentIndex() == ElemInfo );
+ myIDPreview->SetPointsLabeled( showIDs, myActor->GetVisibility() );
+
aViewWindow->highlight( IO, true, true );
aViewWindow->Repaint();
}
}
}
+/*!
+ * \brief Show IDs clicked
+ */
+void SMESHGUI_MeshInfoDlg::idPreviewChange( bool isOn )
+{
+ myIDPreview->SetPointsLabeled( isOn && !myID->text().simplified().isEmpty() );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
+ aViewWindow->Repaint();
+}
+
void SMESHGUI_MeshInfoDlg::showItemInfo( int id )
{
- if ( id > 0 && myActor->GetObject()->GetMesh()->FindNode( id ) ) {
+ if ( id > 0 && myActor->GetObject()->GetMesh()->FindNode( id )) {
myMode->button( NodeMode )->click();
- myID->setText( QString::number( id ) );
+ myID->setText( QString::number( id ));
}
}
_PTR( Study ) aStudy = appStudy->studyDS();
QStringList aFilters;
- aFilters.append( tr( "TEXT_FILES" ) );
+ aFilters.append( tr( "TEXT_FILES" ));
bool anIsBase = true;
bool anIsElem = true;
}
DumpFileDlg fd( this );
- fd.setWindowTitle( tr( "SAVE_INFO" ) );
+ fd.setWindowTitle( tr( "SAVE_INFO" ));
fd.setNameFilters( aFilters );
fd.myBaseChk->setChecked( anIsBase );
fd.myElemChk->setChecked( anIsElem );
return;
QFile aFile( aFileName );
- if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
+ if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ))
return;
QTextStream out( &aFile );
myWidgets << aName;
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- QIcon aComputeIcon( aResMgr->loadPixmap( "SMESH", tr( "ICON_COMPUTE" ) ) );
+ QIcon aComputeIcon( aResMgr->loadPixmap( "SMESH", tr( "ICON_COMPUTE" )) );
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
myToleranceWidget = new SMESHGUI_SpinBox( this );
myToleranceWidget->RangeStepAndValidator(0.0000000001, 1000000.0, 0.0000001, "length_precision" );
myToleranceWidget->setAcceptNames( false );
- myToleranceWidget->SetValue( SMESHGUI::resourceMgr()->doubleValue( "SMESH", "equal_nodes_tolerance", 1e-7 ) );
+ myToleranceWidget->SetValue( SMESHGUI::resourceMgr()->doubleValue( "SMESH", "equal_nodes_tolerance", 1e-7 ));
// edges info
QLabel* anEdgesLab = new QLabel( tr( "EDGES_INFO" ), this );
aComputeVolumeBtn->setIcon(aComputeIcon);
myButtons << aComputeVolumeBtn; //9
- connect( aComputeFaceBtn, SIGNAL( clicked() ), this, SLOT( computeAspectRatio() ) );
- connect( aComputeVolumeBtn, SIGNAL( clicked() ), this, SLOT( computeAspectRatio3D() ) );
- connect( aFreeNodesBtn, SIGNAL( clicked() ), this, SLOT( computeFreeNodesInfo() ) );
- connect( aNodesNbConnBtn, SIGNAL( clicked() ), this, SLOT( computeNodesNbConnInfo() ) );
- connect( aDoubleNodesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleNodesInfo() ) );
- connect( aDoubleEdgesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleEdgesInfo() ) );
- connect( aDoubleFacesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleFacesInfo() ) );
- connect( aOverContFacesBtn, SIGNAL( clicked() ), this, SLOT( computeOverConstrainedFacesInfo() ) );
- connect( aDoubleVolumesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleVolumesInfo() ) );
- connect( aOverContVolumesBtn,SIGNAL( clicked() ), this, SLOT( computeOverConstrainedVolumesInfo() ) );
+ connect( aComputeFaceBtn, SIGNAL( clicked() ), this, SLOT( computeAspectRatio() ));
+ connect( aComputeVolumeBtn, SIGNAL( clicked() ), this, SLOT( computeAspectRatio3D() ));
+ connect( aFreeNodesBtn, SIGNAL( clicked() ), this, SLOT( computeFreeNodesInfo() ));
+ connect( aNodesNbConnBtn, SIGNAL( clicked() ), this, SLOT( computeNodesNbConnInfo() ));
+ connect( aDoubleNodesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleNodesInfo() ));
+ connect( aDoubleEdgesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleEdgesInfo() ));
+ connect( aDoubleFacesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleFacesInfo() ));
+ connect( aOverContFacesBtn, SIGNAL( clicked() ), this, SLOT( computeOverConstrainedFacesInfo() ));
+ connect( aDoubleVolumesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleVolumesInfo() ));
+ connect( aOverContVolumesBtn,SIGNAL( clicked() ), this, SLOT( computeOverConstrainedVolumesInfo() ));
connect( myToleranceWidget, SIGNAL(valueChanged(double)), this, SLOT( setTolerance( double )));
setFontAttributes( aNameLab );
lab->setAlignment( Qt::AlignCenter );
lab->setAutoFillBackground( true );
QPalette pal = lab->palette();
- pal.setColor( QPalette::Window, QApplication::palette().color( QPalette::Active, QPalette::Base ) );
+ pal.setColor( QPalette::Window, QApplication::palette().color( QPalette::Active, QPalette::Base ));
lab->setPalette( pal );
lab->setMinimumWidth( 60 );
return lab;
aNumFun->SetMesh( mesh );
CORBA::Long cprecision = 6;
- if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ) )
+ if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ))
cprecision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "controls_precision", -1 );
aNumFun->SetPrecision( cprecision );
/*isLogarithmic=*/false,
myObject );
Plot2d_Histogram* aHistogram = new Plot2d_Histogram();
- aHistogram->setColor( palette().color( QPalette::Highlight ) );
+ aHistogram->setColor( palette().color( QPalette::Highlight ));
if ( &histogramVar.in() )
{
for ( size_t i = 0, nb = histogramVar->length(); i < nb; i++ )
: QDialog( parent )
{
setAttribute( Qt::WA_DeleteOnClose, true );
- setWindowTitle( tr( "CTRL_INFO" ) );
+ setWindowTitle( tr( "CTRL_INFO" ));
setMinimumSize( 400, 600 );
myCtrlInfo = new SMESHGUI_CtrlInfo( this );
l->addWidget( myCtrlInfo );
l->addLayout( btnLayout );
- connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( dumpBtn, SIGNAL( clicked() ), this, SLOT( dump() ) );
- connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ) );
- connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ) );
- connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
+ connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ));
+ connect( dumpBtn, SIGNAL( clicked() ), this, SLOT( dump() ));
+ connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ));
+ connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ));
+ connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ));
updateSelection();
}
*/
void SMESHGUI_CtrlInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO )
{
- if ( SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO ) )
+ if ( SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO ))
myCtrlInfo->showInfo( obj );
}
LightApp_SelectionMgr* selMgr = SMESHGUI::selectionMgr();
disconnect( selMgr, 0, this, 0 );
SMESH::SetPointRepresentation( false );
- connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
+ connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ));
updateInfo();
}
*/
void SMESHGUI_CtrlInfoDlg::deactivate()
{
- disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
+ disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ));
}
/*!
_PTR( Study ) aStudy = appStudy->studyDS();
QStringList aFilters;
- aFilters.append( tr( "TEXT_FILES" ) );
+ aFilters.append( tr( "TEXT_FILES" ));
DumpFileDlg fd( this );
- fd.setWindowTitle( tr( "SAVE_INFO" ) );
+ fd.setWindowTitle( tr( "SAVE_INFO" ));
fd.setNameFilters( aFilters );
fd.myBaseChk->hide();
fd.myElemChk->hide();
return;
QFile aFile( aFileName );
- if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
+ if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ))
return;
QTextStream out( &aFile );
class QAbstractButton;
class QButtonGroup;
+class QCheckBox;
class QContextMenuEvent;
+class QGridLayout;
class QLabel;
class QLineEdit;
class QPushButton;
class QTabWidget;
class QTextBrowser;
-class QGridLayout;
-class SMESH_Actor;
-class SMDS_MeshNode;
class SMDS_MeshElement;
+class SMDS_MeshNode;
+class SMESHGUI_IdPreview;
class SMESHGUI_SpinBox;
+class SMESH_Actor;
class ExtraWidget;
void clear();
virtual void saveInfo( QTextStream &out ) = 0;
+ gp_XYZ getGravityCenter( const SMDS_MeshElement* e ) { return gravityCenter(e); }
+
protected:
struct XYZ
{
double x() const { return myX; }
double y() const { return myY; }
double z() const { return myZ; }
+ operator gp_XYZ() const { return gp_XYZ( myX, myY, myZ ); }
};
typedef QMap< int, QList<int> > Connectivity;
private slots:
void itemDoubleClicked( QTreeWidgetItem*, int );
+ void saveExpanded( QTreeWidgetItem* );
private:
QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
+ QString expandedResource( QTreeWidgetItem* );
private:
QTreeWidget* myInfo;
void deactivate();
void modeChanged();
void idChanged();
+ void idPreviewChange(bool);
void showItemInfo( int );
void showItemInfo( const QString& );
void dump();
private:
- QTabWidget* myTabWidget;
- SMESHGUI_MeshInfo* myBaseInfo;
- QButtonGroup* myMode;
- QLineEdit* myID;
- SMESHGUI_ElemInfo* myElemInfo;
- SMESHGUI_AddInfo* myAddInfo;
- SMESHGUI_CtrlInfo* myCtrlInfo;
- SMESH_Actor* myActor;
+ QTabWidget* myTabWidget;
+ SMESHGUI_MeshInfo* myBaseInfo;
+ QButtonGroup* myMode;
+ QLineEdit* myID;
+ QCheckBox* myIDPreviewCheck;
+ SMESHGUI_IdPreview* myIDPreview;
+ SMESHGUI_ElemInfo* myElemInfo;
+ SMESHGUI_AddInfo* myAddInfo;
+ SMESHGUI_CtrlInfo* myCtrlInfo;
+ SMESH_Actor* myActor;
Handle(SALOME_InteractiveObject) myIO;
};
/*!
* \brief Selects a recently created mesh or sub-mesh if necessary
*
- * Virtual method redefined from base class called when operation is commited
+ * Virtual method redefined from base class called when operation is committed
* selects a recently created mesh or sub-mesh if necessary. Allows to perform
* selection when the custom selection filters are removed.
*/
}
}
else { // no geometry defined
- myDlg->enableTab( SMESH::DIM_3D );
- QStringList hypList;
- availableHyps( SMESH::DIM_3D, Algo, hypList,
- myAvailableHypData[SMESH::DIM_3D][Algo]);
- SMESHGUI_MeshTab* aTab = myDlg->tab( SMESH::DIM_3D );
- aTab->setAvailableHyps( Algo, hypList );
- for (int i = SMESH::DIM_0D;i < SMESH::DIM_3D; ++i) {
- myDlg->disableTab(i);
+ QStringList hypList;
+ for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
+ {
+ availableHyps( dim, Algo, hypList, myAvailableHypData[dim][Algo]);
+ myDlg->tab( dim )->setAvailableHyps( Algo, hypList );
+ if ( hypList.empty() ) myDlg->disableTab( dim );
+ else myDlg->enableTab( dim );
}
myMaxShapeDim = -1;
//Hide labels and fields (Mesh and Geometry)
//================================================================================
/*!
- * \Brief Returns tab dimention
+ * \Brief Returns tab dimension
* \param tab - the tab in the dlg
* \param dlg - my dialogue
- * \retval int - dimention
+ * \retval int - dimension
*/
//================================================================================
static int getTabDim (const QObject* tab, SMESHGUI_MeshDlg* dlg )
if ( myIgnoreAlgoSelection )
return;
- int aDim = theDim < 0 ? getTabDim( sender(), myDlg ): theDim;
+ int curDim = getTabDim( sender(), myDlg );
+ int aDim = theDim < 0 ? curDim : theDim;
if (aDim == -1)
return;
myDlg->tab( dim )->setAvailableHyps( Algo, anAvailable );
noCompatible = anAvailable.isEmpty();
algoIndex = myAvailableHypData[dim][Algo].indexOf( curAlgo );
- if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D) {
+ if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim == curDim ) {
// select the sole compatible algo
algoIndex = 0;
}
hypIndex = this->find( curHyp, myExistingHyps[ dim ][ type ]);
else
hypIndex = -1;
- if ( !isSubmesh && myToCreate && hypIndex < 0 && anExisting.count() == 1 ) {
+ if ( !isSubmesh && myToCreate && hypIndex < 0 && anExisting.count() == 1 && dim == curDim )
+ {
// none is yet selected => select the sole existing if it is not optional
CORBA::String_var hypTypeName = myExistingHyps[ dim ][ type ].first().first->GetName();
bool isOptional = true;
{
// Call hypothesis creation server method (without GUI)
SMESH::SMESH_Hypothesis_var aHyp =
- SMESH::CreateHypothesis(aHypName, aHypName, true);
+ SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
aHyp.out();
}
else
aCreator->create( true, aHypName, myDlg, 0, QString::null );
else {
SMESH::SMESH_Hypothesis_var aHyp =
- SMESH::CreateHypothesis(aHypName, aHypName, true);
+ SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
aHyp.out();
}
delete aCreator;
// Get hypotheses and algorithms assigned to the mesh/sub-mesh
QStringList anExisting;
- const int lastDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_3D;
+ const int lastDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_2D;
bool algoFound = false;
for ( int dim = SMESH::DIM_3D; dim >= lastDim; --dim )
{
/*!
* \brief Edits mesh or sub-mesh
* \param theMess - Output parameter intended for returning error message
- * \retval bool - TRUE if mesh is edited succesfully, FALSE otherwise
+ * \retval bool - TRUE if mesh is edited successfully, FALSE otherwise
*
* Assigns new name hypotheses and algoriths to the mesh or sub-mesh
*/
// Set new name
QString aName = myDlg->objectText( SMESHGUI_MeshDlg::Obj );
SMESH::SetName( pObj, aName );
- int aDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_3D;
+ int aDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_2D;
// First, remove old algos in order to avoid messages on algorithm hiding
for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ )
*
* method redefined from base class verifies whether given operator is valid for
* this one (i.e. can be started "above" this operator). In current implementation method
- * retuns false if theOtherOp operation is not intended for deleting objects or mesh
+ * returns false if theOtherOp operation is not intended for deleting objects or mesh
* elements.
*/
//================================================================================
}
if ( !myIsOnGeometry )
for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) {
- if ( i < SMESH::DIM_3D ) myDlg->disableTab( i );
- else myDlg->enableTab( i );
+ bool disable = myAvailableHypData[i][Algo].isEmpty();
+ if ( disable ) myDlg->disableTab( i );
+ else myDlg->enableTab( i );
}
else
for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) {
for (int i = 0, n = elemPoints->length(); i < n; i++)
aCellsSize += elemPoints[ i ].length();
- // Create unstructured grid and other usefull arrays
+ // Create unstructured grid and other useful arrays
vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
vtkCellArray* aConnectivity = vtkCellArray::New();
*
* Virtual method redefined from base class verifies whether given operator is valid for
* this one (i.e. can be started "above" this operator). In current implementation method
-* retuns false if theOtherOp operation is not intended for deleting objects or mesh
+* returns false if theOtherOp operation is not intended for deleting objects or mesh
* elements.
*/
bool SMESHGUI_Operation::isValid( SUIT_Operation* theOtherOp ) const
OpShowScalarBar = 1022, // SHOW SCALAR BAR
OpSaveDistribution = 1030, // SAVE DISTRIBUTION
OpShowDistribution = 1031, // SHOW DISTRIBUTION
-#ifndef DISABLE_PLOT2DVIEWER
OpPlotDistribution = 1032, // PLOT DISTRIBUTION
-#endif
OpFileInformation = 1040, // POPUP MENU - FILE INFORMATION
// Import -------------------------//--------------------------------
OpImportDAT = 1100, // MENU FILE - IMPORT - DAT FILE
OpImportUNV = 1101, // MENU FILE - IMPORT - UNV FILE
OpImportMED = 1102, // MENU FILE - IMPORT - MED FILE
OpImportSTL = 1103, // MENU FILE - IMPORT - STL FILE
-#ifdef WITH_CGNS
OpImportCGNS = 1104, // MENU FILE - IMPORT - CGNS FILE
-#endif
OpImportSAUV = 1105, // MENU FILE - IMPORT - SAUV FILE
OpImportGMF = 1106, // MENU FILE - IMPORT - GMF FILE
+ OpPopupImportDAT = 1120, // POPUP MENU - IMPORT - DAT FILE
+ OpPopupImportUNV = 1121, // POPUP MENU - IMPORT - UNV FILE
+ OpPopupImportMED = 1122, // POPUP MENU - IMPORT - MED FILE
+ OpPopupImportSTL = 1123, // POPUP MENU - IMPORT - STL FILE
+ OpPopupImportCGNS = 1124, // POPUP MENU - IMPORT - CGNS FILE
+ OpPopupImportSAUV = 1125, // POPUP MENU - IMPORT - SAUV FILE
+ OpPopupImportGMF = 1126, // POPUP MENU - IMPORT - GMF FILE
// Export -------------------------//--------------------------------
OpExportDAT = 1200, // MENU FILE - EXPORT - DAT FILE
OpExportMED = 1201, // MENU FILE - EXPORT - MED FILE
OpExportUNV = 1202, // MENU FILE - EXPORT - UNV FILE
OpExportSTL = 1203, // MENU FILE - EXPORT - STL FILE
-#ifdef WITH_CGNS
OpExportCGNS = 1204, // MENU FILE - EXPORT - CGNS FILE
-#endif
OpExportSAUV = 1205, // MENU FILE - EXPORT - SAUV FILE
OpExportGMF = 1206, // MENU FILE - EXPORT - GMF FILE
OpPopupExportDAT = 1210, // POPUP MENU - EXPORT - DAT FILE
OpPopupExportMED = 1211, // POPUP MENU - EXPORT - MED FILE
OpPopupExportUNV = 1212, // POPUP MENU - EXPORT - UNV FILE
OpPopupExportSTL = 1213, // POPUP MENU - EXPORT - STL FILE
-#ifdef WITH_CGNS
OpPopupExportCGNS = 1214, // POPUP MENU - EXPORT - CGNS FILE
-#endif
OpPopupExportSAUV = 1215, // POPUP MENU - EXPORT - SAUV FILE
OpPopupExportGMF = 1216, // POPUP MENU - EXPORT - GMF FILE
// Mesh ---------------------------//--------------------------------
myDY->SetValue(0);
myDZ->SetValue(0);
- myDX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myDY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- myDZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ myDX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 1.0, "length_precision");
+ myDY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 1.0, "length_precision");
+ myDZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 1.0, "length_precision");
width = Max( aFaceBut->fontMetrics().width( tr("SMESH_X")),
aFaceBut->fontMetrics().width( tr("SMESH_DX")));
// SMESH includes
#include "SMESHGUI_Selection.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_GEOMGenUtils.h"
+#include "SMESHGUI.h"
#include "SMESHGUI_ComputeDlg.h"
#include "SMESHGUI_ConvToQuadOp.h"
+#include "SMESHGUI_GEOMGenUtils.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_VTKUtils.h"
#include <SMESH_Type.h>
#include <SMESH_Actor.h>
if ( p=="client" ) val = QVariant( LightApp_Selection::parameter( p ) );
else if ( p=="type" ) val = QVariant( myTypes[ind] );
else if ( p=="hasActor" ) val = QVariant( getActor( ind ) != 0 );
- else if ( p=="elemTypes" ) val = QVariant( elemTypes( ind ) );
+ else if ( p=="elemTypes" ) val = QVariant( elemTypes( ind, false ) );
+ else if ( p=="objElemTypes" ) val = QVariant( elemTypes( ind, true ) );
else if ( p=="isAutoColor" ) val = QVariant( isAutoColor( ind ) );
else if ( p=="numberOfNodes" ) val = QVariant( numberOfNodes( ind ) );
else if ( p=="dim" ) val = QVariant( dim( ind ) );
else if ( p=="hasChildren") val = QVariant( hasChildren( ind ) );
else if ( p=="nbChildren") val = QVariant( nbChildren( ind ) );
else if ( p=="isContainer") val = QVariant( isContainer( ind ) );
+ else if ( p=="guiState") val = QVariant( guiState() );
if ( val.isValid() )
return val;
//=======================================================================
//function : getVtkOwner
-//purpose :
+//purpose :
//=======================================================================
SMESH_Actor* SMESHGUI_Selection::getActor( int ind ) const
//purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume' 'BallElem'} at most
//=======================================================================
-QList<QVariant> SMESHGUI_Selection::elemTypes( int ind ) const
+QList<QVariant> SMESHGUI_Selection::elemTypes( int ind, bool fromObj ) const
{
QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
TVisualObjPtr object = actor->GetObject();
if ( object ) {
- if ( object->GetNbEntities( SMDSAbs_0DElement )) types.append( "Elem0d" );
- if ( object->GetNbEntities( SMDSAbs_Ball )) types.append( "BallElem" );
if ( object->GetNbEntities( SMDSAbs_Edge )) types.append( "Edge" );
if ( object->GetNbEntities( SMDSAbs_Face )) types.append( "Face" );
if ( object->GetNbEntities( SMDSAbs_Volume )) types.append( "Volume" );
+ if ( object->GetNbEntities( SMDSAbs_0DElement )) types.append( "Elem0d" );
+ if ( object->GetNbEntities( SMDSAbs_Ball )) types.append( "BallElem" );
+ }
+ }
+ else if ( fromObj )
+ {
+ if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
+ {
+ _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+ SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
+ if ( !CORBA::is_nil( idSrc ) )
+ {
+ SMESH::array_of_ElementType_var typeVar = idSrc->GetTypes();
+ for ( CORBA::ULong i = 0; i < typeVar->length(); ++i )
+ switch ( typeVar[i] ) {
+ case SMESH::EDGE: types.append( "Edge" ); break;
+ case SMESH::FACE: types.append( "Face" ); break;
+ case SMESH::VOLUME: types.append( "Volume" ); break;
+ case SMESH::ELEM0D: types.append( "Elem0d" ); break;
+ case SMESH::BALL: types.append( "BallElem" ); break;
+ case SMESH::ALL:
+ case SMESH::NODE:
+ case SMESH::NB_ELEMENT_TYPES: break;
+ }
+ }
}
}
return types;
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
_PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
-
- if ( !CORBA::is_nil( obj ) ) {
- SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
- if ( !CORBA::is_nil( mesh ) )
- return mesh->GetAutoColor();
- }
+ CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+ SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
+ if ( !CORBA::is_nil( mesh ) )
+ return mesh->GetAutoColor();
}
return false;
}
return res;
}
+//=======================================================================
+//function : guiState
+//purpose :
+//=======================================================================
+
+int SMESHGUI_Selection::guiState()
+{
+ return SMESHGUI::GetSMESHGUI() ? SMESHGUI::GetSMESHGUI()->GetState() : -1;
+}
+
//=======================================================================
//function : groupType
//purpose :
virtual int nbChildren( int ) const;
virtual bool isContainer( int ) const;
- // parameters got from actor return nothing if an actor is not visible
- virtual QList<QVariant> elemTypes( int ) const;
+ // parameters got from actor, return nothing if an actor is not visible
+ virtual QList<QVariant> elemTypes( int, bool ) const; // == objElemTypes w/o actor
virtual QList<QVariant> labeledTypes( int ) const;
virtual QString displayMode( int ) const;
virtual QString shrinkMode( int ) const;
static int type( const QString&, _PTR(Study) );
static QString typeName( const int );
-
+ static int guiState();
+
bool isImported( const int ) const;
private:
typedef SALOME::GenericObj_wrap<SMESH_IDSource> IDSource_wrap;
/*!
- * \brief Class usefull to convert a string returned from a CORBA call
+ * \brief Class useful to convert a string returned from a CORBA call
* to other string types w/o memory leak.
*
* Usage (of instantiations): QString s = toQStr( objVar->GetName() );
if ( freeMB > 0 && usedMB * 5 > freeMB ) {
bool continu = false;
if ( usedMB * 3 > freeMB )
- // even dont try to show
+ // don't even try to show
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
else
if ((anActor = CreateActor(aDocument,theEntry,true))) {
bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
DisplayActor(theWnd,anActor);
+ anActor->SetVisibility(true);
aStudy->setVisibilityState(theEntry, Qtx::ShownState);
// FitAll(); - PAL16770(Display of a group performs an automatic fit all)
if (needFitAll) FitAll();
*/
if( !myClientLib.isEmpty() )
{
-#ifdef WIN32
+#if defined(WIN32)
//myServerLib += ".dll";
myClientLib += ".dll";
+#elif defined(__APPLE__)
+ myClientLib = "lib" + myClientLib + ".dylib";
#else
- //myServerLib = "lib" + myServerLib + ".so";
myClientLib = "lib" + myClientLib + ".so";
#endif
}
<source>ICON_COMPUTE</source>
<translation>mesh_compute.png</translation>
</message>
+ <message>
+ <source>ICON_OVL_MESH_QUALITY</source>
+ <translation>mesh_quality.png</translation>
+ </message>
<message>
<source>ICON_EVALUATE</source>
<translation>mesh_evaluate.png</translation>
<source>ICON_MEASURE_BND_BOX</source>
<translation>mesh_bounding_box.png</translation>
</message>
+ <message>
+ <source>ICON_SHOW</source>
+ <translation>mesh_show.png</translation>
+ </message>
+ <message>
+ <source>ICON_HIDE</source>
+ <translation>mesh_hide.png</translation>
+ </message>
</context>
</TS>
<source>MEN_DEL_GROUP</source>
<translation>Delete Groups with Contents</translation>
</message>
+ <message>
+ <source>MEN_ADD_TO_GROUP</source>
+ <translation>Add to Group</translation>
+ </message>
+ <message>
+ <source>MEN_REMOVE_FROM_GROUP</source>
+ <translation>Remove from Group</translation>
+ </message>
+ <message>
+ <source>STB_ADD_TO_GROUP</source>
+ <translation>Add selected elements to group</translation>
+ </message>
+ <message>
+ <source>STB_REMOVE_FROM_GROUP</source>
+ <translation>Remove selected elements from group</translation>
+ </message>
<message>
<source>MEN_FACE_ORIENTATION</source>
<translation>Orientation of Faces</translation>
</message>
<message>
<source>SMESH_HYP_9</source>
- <translation>Such dimention hypothesis is already assigned to the shape</translation>
+ <translation>Such dimension hypothesis is already assigned to the shape</translation>
</message>
<message>
<source>SMESH_ID_DIAGONAL</source>
<source>SEPARATE_CORNERS_AND_MEDIUM</source>
<translation>No merge of corner and medium nodes of quadratic cells</translation>
</message>
+ <message>
+ <source>AVOID_MAKING_HOLES</source>
+ <translation>Avoid making holes</translation>
+ </message>
<message>
<source>KEEP_NODES</source>
<translation>Nodes to keep during the merge</translation>
<source>ELEM_MODE</source>
<translation>Element</translation>
</message>
+ <message>
+ <source>SHOW_IDS</source>
+ <translation>Show IDs</translation>
+ </message>
<message>
<source>BUT_DUMP_MESH</source>
<translation>&Dump</translation>
</message>
<message>
<source>RADIOBTN_1</source>
- <translation>Convertir en éléments quadratiques</translation>
+ <translation>Convertir en éléments linéaires</translation>
</message>
<message>
<source>RADIOBTN_2</source>
- <translation>Convertir à partir d'éléments quadratiques</translation>
+ <translation>Convertir en éléments quadratiques</translation>
</message>
<message>
<source>RADIOBTN_3</source>
</message>
<message>
<source>MT_TETRAHEDRAL</source>
- <translation>Tetrahèdre</translation>
+ <translation>Tetraèdre</translation>
</message>
<message>
<source>MT_TRIANGULAR</source>
SMESH_MAT2d.cxx
SMESH_FreeBorders.cxx
SMESH_ControlPnt.cxx
-)
+ SMESH_DeMerge.cxx
+ )
# --- rules ---
dy *= 1.2;
xSol = 0.5 * (xMax + xMin) ;
ySol = 0.5 * (yMax + yMin) ;
- if ( xMin == 0. && yMin == 0. && xMax == 1. && yMax == 1. ) // avoid infinit loop
+ if ( xMin == 0. && yMin == 0. && xMax == 1. && yMax == 1. ) // avoid infinite loop
{
#ifdef _DEBUG_REFINE_
cout << "SMESH_Block::refineParametersOnFace(): tface.IsUVInQuad() fails" << endl;
if ( saveBetterSolution( sol, theParams, thePoint.SquareDistance( tface.Point( sol ))))
{
#ifdef _DEBUG_REFINE_
- cout << "SMESH_Block::refineParametersOnFace(): dividing suceeded" << endl;
+ cout << "SMESH_Block::refineParametersOnFace(): dividing succeeded" << endl;
cout << " nbGetUV = " << nbGetUV << endl;
#endif
return true;
// TFace, TEdge's and points for that face only
// Note 2: curve adaptors need to have only Value(double), FirstParameter() and
- // LastParameter() defined to be used by Block algoritms
+ // LastParameter() defined to be used by Block algorithms
class SMESHUtils_EXPORT TEdge {
int myCoordInd;
// =============================================================
/*!
- * \brief Contains an algorithm and description of an occured error
+ * \brief Contains an algorithm and description of an occurred error
*/
// =============================================================
--- /dev/null
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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, 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
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SMESH_DeMerge.hxx
+// Created : Fri Mar 10 16:06:54 2017
+// Author : Edward AGAPOV (eap)
+
+// Implementation of SMESH_MeshAlgos::DeMerge()
+
+#include "SMESH_MeshAlgos.hxx"
+
+#include "SMDS_VolumeTool.hxx"
+#include "SMDS_MeshVolume.hxx"
+
+namespace
+{
+ bool isDegenFace(const std::vector< const SMDS_MeshNode* >& nodes)
+ {
+ // in a degenerated face each link sticks to another
+
+ typedef std::map< SMESH_TLink , int > TLink2Nb;
+ TLink2Nb link2nb;
+ for ( size_t iPrev = nodes.size() - 1, i = 0; i < nodes.size(); iPrev = i++ )
+ {
+ SMESH_TLink link( nodes[iPrev], nodes[i] );
+ TLink2Nb::iterator l2n = link2nb.insert( std::make_pair( link, 0 )).first;
+ l2n->second++;
+ }
+
+ if ( link2nb.size() == 1 )
+ return true;
+
+ for ( TLink2Nb::iterator l2n = link2nb.begin(); l2n != link2nb.end(); ++l2n )
+ if ( l2n->second == 1 )
+ return false;
+
+ return true;
+ }
+
+ void deMergeFace(const SMDS_MeshElement* face,
+ std::vector< const SMDS_MeshNode* >& newNodes,
+ std::vector< const SMDS_MeshNode* >& noMergeNodes)
+ {
+ if ( face->IsQuadratic() )
+ {
+ const int nbCorners = face->NbCornerNodes();
+ const int nbNodes = (int) newNodes.size();
+
+ // de-merge sticking medium nodes
+ for ( int i = 1; i < nbNodes; i += 2 ) // loop om medium nodes
+ {
+ int iPrev = ( i - 1 );
+ int iNext = ( i + 1 ) % nbNodes;
+ if ( newNodes[ iPrev ] == newNodes[ iNext ] )
+ {
+ if ( newNodes[ iPrev ] != newNodes[ i ] || nbCorners == 3 )
+ {
+ // corners stick but the medium does not, or a link of triangle collapses
+ noMergeNodes.push_back( face->GetNode( iPrev / 2 ));
+ noMergeNodes.push_back( face->GetNode( iNext / 2 ));
+ noMergeNodes.push_back( face->GetNode( nbCorners + i / 2 ));
+ }
+ }
+ else if ( newNodes[ i ] == newNodes[ iPrev ] )
+ {
+ // the medium node sticks to a neighbor corner one
+ noMergeNodes.push_back( face->GetNode( nbCorners + i / 2 ));
+ noMergeNodes.push_back( face->GetNode( iPrev / 2 ));
+ }
+ else if ( newNodes[ i ] == newNodes[ iNext ] )
+ {
+ // the medium node sticks to a neighbor corner one
+ noMergeNodes.push_back( face->GetNode( nbCorners + i / 2 ));
+ noMergeNodes.push_back( face->GetNode( iNext / 2 ));
+ }
+ else
+ {
+ // find if the medium sticks to any other node
+ std::vector<const SMDS_MeshNode*>::iterator pos;
+ pos = std::find( newNodes.begin(), newNodes.begin() + iPrev, newNodes[i] );
+ if ( pos == newNodes.begin() + iPrev )
+ pos = std::find( newNodes.begin() + i + 1, newNodes.end(), newNodes[i] );
+ if ( pos == newNodes.end() )
+ continue;
+
+ int iStick = std::distance( newNodes.begin(), pos );
+ if ( iStick % 2 == 0 )
+ {
+ // the medium sticks to a distant corner
+ noMergeNodes.push_back( face->GetNode( nbCorners + i / 2 ));
+ noMergeNodes.push_back( face->GetNode( iStick / 2 ));
+ }
+ else
+ {
+ // the medium sticks to a distant medium;
+ // it's OK if two links stick
+ int iPrev2 = ( iStick - 1 );
+ int iNext2 = ( iStick + 1 ) % nbNodes;
+ if (( newNodes[ iPrev ] == newNodes[ iPrev2 ] &&
+ newNodes[ iNext ] == newNodes[ iNext2 ] )
+ ||
+ ( newNodes[ iPrev ] == newNodes[ iNext2 ] &&
+ newNodes[ iNext ] == newNodes[ iPrev2 ] ))
+ ; // OK
+ else
+ {
+ noMergeNodes.push_back( face->GetNode( nbCorners + i / 2 ));
+ noMergeNodes.push_back( face->GetNode( nbCorners + iStick / 2 ));
+ }
+ }
+ }
+ }
+ }
+ } // deMergeFace()
+
+ bool isDegenVolume(const SMDS_VolumeTool& vt)
+ {
+ // TMP: it's necessary to use a topological check instead of a geometrical one
+ return vt.GetSize() < 1e-100;
+ }
+
+ void deMergeVolume(const SMDS_VolumeTool& vt,
+ std::vector< const SMDS_MeshNode* >& noMergeNodes)
+ {
+ // temporary de-merge all nodes
+ for ( int i = 0; i < vt.NbNodes(); ++i )
+ {
+ const SMDS_MeshNode* n = vt.GetNodes()[i];
+ if ( n != vt.Element()->GetNode( i ))
+ noMergeNodes.push_back( n );
+ }
+ }
+
+} // namespace
+
+//================================================================================
+/*!
+ * \brief Find nodes whose merge makes the element invalid. (Degenerated elem is OK)
+ * \param [in] elem - the element
+ * \param [in] newNodes - nodes of the element after the merge
+ * \param [out] noMergeNodes - nodes to undo merge
+ */
+//================================================================================
+
+void SMESH_MeshAlgos::DeMerge(const SMDS_MeshElement* elem,
+ std::vector< const SMDS_MeshNode* >& newNodes,
+ std::vector< const SMDS_MeshNode* >& noMergeNodes)
+{
+ switch ( elem->GetType() )
+ {
+ case SMDSAbs_Face:
+ {
+ if ( newNodes.size() <= 4 )
+ return; // degenerated
+
+ if ( elem->IsQuadratic() )
+ SMDS_MeshCell::applyInterlace // interlace medium and corner nodes
+ ( SMDS_MeshCell::interlacedSmdsOrder( elem->GetEntityType(), newNodes.size() ), newNodes );
+
+ if ( isDegenFace( newNodes ))
+ return;
+
+ deMergeFace( elem, newNodes, noMergeNodes );
+ }
+ break;
+
+ case SMDSAbs_Volume:
+ {
+ if ( newNodes.size() <= 4 )
+ return; // degenerated
+
+ SMDS_VolumeTool vt;
+ if ( !vt.Set( elem, /*skipCentral=*/true, &newNodes ))
+ return; // strange
+
+ if ( isDegenVolume( vt ))
+ return;
+
+ deMergeVolume( elem, noMergeNodes );
+ }
+ break;
+
+ case SMDSAbs_Edge:
+ {
+ if ( newNodes.size() == 3 )
+ if (( newNodes[2] == newNodes[0] && newNodes[2] != newNodes[1] ) ||
+ ( newNodes[2] == newNodes[1] && newNodes[2] != newNodes[0]))
+ {
+ // the medium node sticks to a corner
+ noMergeNodes.push_back( newNodes[2] );
+ noMergeNodes.push_back( newNodes[ newNodes[2] == newNodes[1] ]);
+ }
+ }
+ break;
+ default:;
+ }
+}
return ( _inSeg->getGeomEdge( _edge->twin()->cell() ) != theNoEdgeID );
}
- // check a next segment in CW order
+ // check a next segment in CCW order
bool isSameBranch( const BndSeg& seg2 )
{
if ( !_edge || !seg2._edge )
int branchID = 1; // we code orientation as branchID sign
branchEdges.resize( branchID );
+ vector< std::pair< int, const TVDVertex* > > branchesToCheckEnd;
+
for ( size_t iE = 0; iE < bndSegsPerEdge.size(); ++iE )
{
vector< BndSeg >& bndSegs = bndSegsPerEdge[ iE ];
{
branchEdges.resize(( branchID = branchEdges.size()) + 1 );
if ( bndSegs[i]._edge && bndSegs[i]._prev )
+ {
endType.insert( make_pair( bndSegs[i]._edge->vertex1(), SMESH_MAT2d::BE_BRANCH_POINT ));
+ if ( bndSegs[i]._prev->_branchID < 0 )
+ // 0023404: a branch-point is inside a branch
+ branchesToCheckEnd.push_back( make_pair( bndSegs[i]._prev->branchID(),
+ bndSegs[i]._edge->vertex1() ));
+ }
}
else if ( bndSegs[i]._prev->_branchID )
{
}
}
+ if ( !ignoreCorners && !branchesToCheckEnd.empty() )
+ {
+ // split branches having branch-point inside
+ // (a branch-point was not detected since another branch is joined at the opposite side)
+ for ( size_t i = 0; i < branchesToCheckEnd.size(); ++i )
+ {
+ vector<const TVDEdge*> & branch = branchEdges[ branchesToCheckEnd[i].first ];
+ const TVDVertex* branchPoint = branchesToCheckEnd[i].second;
+ if ( branch.front()->vertex1() == branchPoint ||
+ branch.back ()->vertex0() == branchPoint )
+ continue; // OK - branchPoint is at a branch end
+
+ // find a MA edge where another branch begins
+ size_t iE;
+ for ( iE = 0; iE < branch.size(); ++iE )
+ if ( branch[iE]->vertex1() == branchPoint )
+ break;
+ if ( iE < branch.size() )
+ {
+ // split the branch
+ branchEdges.resize(( branchID = branchEdges.size()) + 1 );
+ vector<const TVDEdge*> & branch2 = branchEdges[ branchID ];
+ branch2.assign( branch.begin()+iE, branch.end() );
+ branch.resize( iE );
+ for ( iE = 0; iE < branch2.size(); ++iE )
+ if ( BndSeg* bs = BndSeg::getBndSegOfEdge( branch2[iE], bndSegsPerEdge ))
+ bs->setBranch( branchID, bndSegsPerEdge );
+ }
+ }
+ }
+
// join the 1st and the last branch edges if it is the same branch
// if ( bndSegs.back().branchID() != bndSegs.front().branchID() &&
// bndSegs.back().isSameBranch( bndSegs.front() ))
// br2.clear();
// }
- // remove branches ending at BE_ON_VERTEX
+ // remove branches ending at BE_ON_VERTEX and BE_END
vector<bool> isBranchRemoved( branchEdges.size(), false );
+ std::set< SMESH_MAT2d::BranchEndType > endTypeToRm;
+ endTypeToRm.insert( SMESH_MAT2d::BE_ON_VERTEX );
+ endTypeToRm.insert( SMESH_MAT2d::BE_END );
+
if ( ignoreCorners && branchEdges.size() > 2 && !branchEdges[2].empty() )
{
// find branches to remove
const TVDVertex* v0 = branchEdges[iB][0]->vertex1();
const TVDVertex* v1 = branchEdges[iB].back()->vertex0();
v2et = endType.find( v0 );
- if ( v2et != endType.end() && v2et->second == SMESH_MAT2d::BE_ON_VERTEX )
+ if ( v2et != endType.end() && endTypeToRm.count( v2et->second ))
isBranchRemoved[ iB ] = true;
v2et = endType.find( v1 );
- if ( v2et != endType.end() && v2et->second == SMESH_MAT2d::BE_ON_VERTEX )
+ if ( v2et != endType.end() && endTypeToRm.count( v2et->second ))
isBranchRemoved[ iB ] = true;
}
// try to join not removed branches into one
{
return new SMESH_ElementSearcherImpl( mesh, tolerance, elemIt );
}
-
-// TMP for ASERIS in V8_2_BR -- to remove when merging to master
-void SMESH_MeshAlgos::DeMerge(const SMDS_MeshElement* elem,
- std::vector< const SMDS_MeshNode* >& newNodes,
- std::vector< const SMDS_MeshNode* >& noMergeNodes)
-{
-// TMP for ASERIS in V8_2_BR -- to remove when merging to master
-}
-// TMP for ASERIS in V8_2_BR -- to remove when merging to master
if ( !ListOfCoincidentNodes.empty() )
{
- // We build a list {n1 + his neigbours} and add this list in theGroupsOfNodes
+ // We build a list {n1 + his neighbors} and add this list in theGroupsOfNodes
if ( idLess( n1, ListOfCoincidentNodes.front() )) ListOfCoincidentNodes.push_front( n1 );
else ListOfCoincidentNodes.push_back ( n1 );
ListOfCoincidentNodes.sort( idLess );
* \param theRemovedObjIDs - entries of objects whose created commands were removed
* \param theHistoricalDump - true means to keep all commands, false means
* to exclude commands relating to objects removed from study
- * \retval TCollection_AsciiString - Convertion result
+ * \retval TCollection_AsciiString - Conversion result
*/
//================================================================================
_AString indent = aCommand->GetIndentation();
_AString tryStr = indent + "try:";
_AString newCmd = indent + tab + ( aCommand->GetString().ToCString() + indent.Length() );
+ _AString pasCmd = indent + tab + "pass"; // to keep valid if newCmd is erased
_AString excStr = indent + "except:";
_AString msgStr = indent + "\tprint '"; msgStr += method + "() failed. Invalid file name?'";
aCommand->Clear();
aCommand->GetString() = newCmd;
aCommand->SetOrderNb( ++myNbCommands );
+ myCommands.push_back( new _pyCommand( pasCmd, ++myNbCommands ));
myCommands.push_back( new _pyCommand( excStr, ++myNbCommands ));
myCommands.push_back( new _pyCommand( msgStr, ++myNbCommands ));
}
* \brief Find algorithm able to create a hypothesis
* \param theGeom - The shape ID the algorithm was created on
* \param theMesh - The mesh ID that created the algorithm
- * \param theHypothesis - The hypothesis the algorithm sould be able to create
+ * \param theHypothesis - The hypothesis the algorithm should be able to create
* \retval Handle(_pyHypothesis) - The found algo
*/
//================================================================================
{
addCmd = *cmd;
cmd = addHypCmds.erase( cmd );
- if ( !theGen->IsToKeepAllCommands() && CanClear() ) {
+ if ( !theGen->IsToKeepAllCommands() /*&& CanClear()*/ ) {
addCmd->Clear();
theCommand->Clear();
}
for ( ; m != fatherMeshes.end(); ++m )
addFatherMesh( *m );
// if ( removedGeom )
- // SetRemovedFromStudy(); // as reffered geometry not in study
+ // SetRemovedFromStudy(); // as referred geometry not in study
}
if ( myGeomNotInStudy )
return;
* \brief Convert the command adding a hypothesis to mesh into a smesh command
* \param theCmd - The command like mesh.AddHypothesis( geom, hypo )
* \param theAlgo - The algo that can create this hypo
- * \retval bool - false if the command cant be converted
+ * \retval bool - false if the command can't be converted
*/
//================================================================================
//================================================================================
/*!
- * \brief clear creation, arg and unkown commands
+ * \brief clear creation, arg and unknown commands
*/
//================================================================================
* \brief additionally to Addition2Creation, clears SetDistrType() command
* \param theCmd - AddHypothesis() command
* \param theMesh - mesh to which a hypothesis is added
- * \retval bool - convertion result
+ * \retval bool - conversion result
*/
//================================================================================
* into regular1D.LengthNearVertex( length, vertex )
* \param theCmd - The command like mesh.AddHypothesis( vertex, SegmentLengthAroundVertex )
* \param theMesh - The mesh needing this hypo
- * \retval bool - false if the command cant be converted
+ * \retval bool - false if the command can't be converted
*/
//================================================================================
_pyID vertex = theCmd->GetArg( 1 );
- // the problem here is that segment algo will not be found
+ // the problem here is that segment algo can be not found
// by pyHypothesis::Addition2Creation() for <vertex>, so we try to find
// geometry where segment algorithm is assigned
- Handle(_pyHypothesis) algo;
_pyID geom = vertex;
+ Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMeshID, this );
while ( algo.IsNull() && !geom.IsEmpty()) {
// try to find geom as a father of <vertex>
geom = FatherID( geom );
algo = theGen->FindAlgo( geom, theMeshID, this );
}
- if ( algo.IsNull() )
+ if ( algo.IsNull() || geom.IsEmpty() )
return false; // also possible to find geom as brother of veretex...
+
// set geom instead of vertex
theCmd->SetArg( 1, geom );
- // set vertex as a second arg
- if ( myCurCrMethod->myArgs.size() < 1) setCreationArg( 1, "1" ); // :(
- setCreationArg( 2, vertex );
-
// mesh.AddHypothesis(vertex, SegmentLengthAroundVertex) -->
- // theMeshID.LengthNearVertex( length, vertex )
- return _pyHypothesis::Addition2Creation( theCmd, theMeshID );
+ // SegmentLengthAroundVertex = Regular_1D.LengthNearVertex( length )
+ if ( _pyHypothesis::Addition2Creation( theCmd, theMeshID ))
+ {
+ // set vertex as a second arg
+ theCmd->SetArg( 2, vertex );
+
+ return true;
+ }
}
return false;
}
* \brief Convert the command adding an algorithm to mesh
* \param theCmd - The command like mesh.AddHypothesis( geom, algo )
* \param theMesh - The mesh needing this algo
- * \retval bool - false if the command cant be converted
+ * \retval bool - false if the command can't be converted
*/
//================================================================================
TColStd_SequenceOfAsciiString myArgs; //!< found arguments
TColStd_SequenceOfAsciiString myResults; //!< found results
TColStd_SequenceOfInteger myBegPos; //!< where myRes, myObj, ... begin
- std::list< Handle(_pyCommand) > myDependentCmds; //!< commands that sould follow me in the script
+ std::list< Handle(_pyCommand) > myDependentCmds; //!< commands that should follow me in the script
enum { UNKNOWN=-1, EMPTY=0, RESULT_IND, OBJECT_IND, METHOD_IND, ARG1_IND };
int GetBegPos( int thePartIndex ) const;
lines.push_back( theSavedTrace.SubString( from, to - 1 ));
from = to + 1;
}
- // For the convertion of IDL API calls -> smeshBuilder.py API, "smesh" standing for SMESH_Gen
+ // For the conversion of IDL API calls -> smeshBuilder.py API, "smesh" standing for SMESH_Gen
// was replaces with "smeshgen" (==TPythonDump::SMESHGenName()).
// Change "smesh" -> "smeshgen" in the trace saved before passage to smeshBuilder.py API
bool isNewVersion =
/*
Class : GroupColor_i
- Description : Functor for check color of group to whic mesh element belongs to
+ Description : Functor for check color of group to which mesh element belongs to
*/
GroupColor_i::GroupColor_i()
{
/*
Class : GroupColor_i
- Description : Functor for check color of group to whic mesh element belongs to
+ Description : Functor for check color of group to which mesh element belongs to
*/
class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
public virtual Predicate_i
#include <process.h>
#else
#include <dlfcn.h>
+ #include <libgen.h> // for basename function
#endif
#ifdef WIN32
!strcmp( theLibName+libNameLen-3, ".so" ))
{
//the old format
-#ifdef WIN32
+#if defined(WIN32)
aPlatformLibName = std::string( theLibName+3, libNameLen-6 ) + ".dll";
+#elif defined(__APPLE__)
+ aPlatformLibName = std::string( theLibName, libNameLen-3 ) + ".dylib";
#else
aPlatformLibName = theLibName;
#endif
else
{
//try to use new format
-#ifdef WIN32
+#if defined(WIN32)
aPlatformLibName = theLibName;
aPlatformLibName += ".dll";
+#elif defined(__APPLE__)
+ aPlatformLibName = std::string( "lib" ) + std::string( theLibName ) + ".dylib";
#else
- aPlatformLibName = "lib" + std::string( theLibName ) + ".so";
+ aPlatformLibName = std::string( "lib" ) + std::string( theLibName ) + ".so";
#endif
}
}
LibHandle libHandle = LoadLib( aPlatformLibName.c_str() );
if (!libHandle)
{
- // report any error, if occured
+ // report any error, if occurred
#ifndef WIN32
const char* anError = dlerror();
throw(SALOME_Exception(anError));
_splitpath( theFileNameForPython, NULL, NULL, bname, NULL );
string aFileName = bname;
#else
- string aFileName = basename( theFileNameForPython );
+ string aFileName = basename( const_cast<char *>(theFileNameForPython) );
#endif
// Retrieve mesh names from the file
DriverMED_R_SMESHDS_Mesh myReader;
// - as names of meshes are stored in MED file, we use them for data publishing
// - as mesh name is not stored in UNV file, we use file name as name of mesh when publishing data
aSO = PublishMesh( myCurrentStudy, mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
+
+ // Python Dump
if ( !aSO->_is_nil() ) {
- // Python Dump
aPythonDump << aSO;
} else {
- // Python Dump
aPythonDump << "mesh_" << i;
}
_splitpath( theFileName, NULL, NULL, bname, NULL );
string aFileName = bname;
#else
- string aFileName = basename( theFileName );
+ string aFileName = basename( const_cast<char *>(theFileName) );
#endif
// publish mesh in the study
if ( CanPublishInStudy( aMesh ) ) {
_splitpath( theFileName, NULL, NULL, bname, NULL );
string aFileName = bname;
#else
- string aFileName = basename( theFileName );
+ string aFileName = basename( const_cast<char *>(theFileName) );
#endif
// publish mesh in the study
if ( CanPublishInStudy( aMesh ) ) {
if( libname_len > 4 )
libname.resize( libname_len - 4 );
#else
- // PAL17753 (Regresion: missing hypothesis in restored study)
+ // PAL17753 (Regression: missing hypothesis in restored study)
// "lib" also should be removed from the beginning
//if( libname_len > 3 )
//libname.resize( libname_len - 3 );
if( libname_len > 4 )
libname.resize( libname_len - 4 );
#else
- // PAL17753 (Regresion: missing hypothesis in restored study)
+ // PAL17753 (Regression: missing hypothesis in restored study)
// "lib" also should be removed from the beginning
//if( libname_len > 3 )
//libname.resize( libname_len - 3 );
SO = aStudyBuilder->NewObjectToTag( theFatherObject, theTag );
isNewSO = true;
}
+ else
+ {
+ isInUseCaseTree = useCaseBuilder->IsUseCaseNode( SO );
+ }
}
else
{
{
// define the next tag after given one in the data tree to insert SObject
SALOMEDS::SObject_wrap curObj, objAfter;
- if ( theFatherObject->GetLastChildTag() > theTag )
+ if ( theFatherObject->GetLastChildTag() > theTag && theTag > 0 )
{
SALOMEDS::UseCaseIterator_wrap
anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);
"Groups of Faces", "Groups of Volumes", "Groups of 0D Elements",
"Groups of Balls" };
- // Currently, groups with heterogenous content are not supported
+ // Currently, groups with heterogeneous content are not supported
if ( aType != SMESH::ALL )
{
long aRootTag = GetNodeGroupsTag() + aType - 1;
if ( aMeshSO->_is_nil() || aHypSO->_is_nil())
return false;
- // Find a mesh or submesh refering to theShape
+ // Find a mesh or submesh referring to theShape
SALOMEDS::SObject_wrap aMeshOrSubMesh =
GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
if ( aMeshOrSubMesh->_is_nil() )
if ( pos < varStr.size() )
{
varFound = ( varStr.compare( pos, myLastParameters[i].size(), myLastParameters[i] ) == 0 &&
- // same string begining but is length same?
+ // same string beginning but is length same?
( pos + myLastParameters[i].size() >= varStr.size() ||
separators.find( varStr[ pos+1 ]) != std::string::npos ));
if ( varFound )
if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;)
std::sort( &aRes[0], &aRes[0]+aSize );
}
- MESSAGE("get list of IDs of a vague group");
return aRes._retn();
}
aGroupDS->SetColorGroup(color);
TPythonDump()<<SMESH::SMESH_GroupBase_var(_this())<<".SetColorNumber( "<<color<<" )";
}
- MESSAGE("set color number of a group");
return ;
}
SMESH_Hypothesis_i::~SMESH_Hypothesis_i()
{
- MESSAGE( "SMESH_Hypothesis_i::~SMESH_Hypothesis_i" );
+ //MESSAGE( "SMESH_Hypothesis_i::~SMESH_Hypothesis_i" );
if ( myBaseImpl )
delete myBaseImpl;
};
SMESH_TRY;
// Read mesh with name = <theMeshName> into SMESH_Mesh
- _impl->STLToMesh( theFileName );
+ std::string name = _impl->STLToMesh( theFileName );
+ if ( !name.empty() )
+ {
+ SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
+ SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( study, _this() );
+ _gen_i->SetName( meshSO, name.c_str() );
+ }
SMESH_CATCH( SMESH::throwCorbaException );
if ( n->NbInverseElements() == 0 )
_impl->GetMeshDS()->RemoveFreeNode( n, /*sm=*/0 );
- TPythonDump pyDump; // Supress dump from RemoveGroup()
+ TPythonDump pyDump; // Suppress dump from RemoveGroup()
// Update Python script (theGroup must be alive for this)
pyDump << SMESH::SMESH_Mesh_var(_this())
if ( !aFile.openForWriting() ) {
msg << "You cannot create the file "
<< aFile.getName()
- << ". Check the directory existance and access rights";
+ << ". Check the directory existence and access rights";
}
aFile.remove();
}
TPythonDump() << SMESH::SMESH_Mesh_var(_this())
<< ".ExportSTL( r'" << file << "', " << isascii << " )";
+ CORBA::String_var name;
+ SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
+ SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, _this() );
+ if ( !so->_is_nil() )
+ name = so->GetName();
+
// Perform Export
- PrepareForWriting(file);
- _impl->ExportSTL(file, isascii);
+ PrepareForWriting( file );
+ _impl->ExportSTL( file, isascii, name.in() );
}
//================================================================================
PrepareForWriting(file);
+ CORBA::String_var name;
+ SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
+ SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
+ if ( !so->_is_nil() )
+ name = so->GetName();
+
SMESH_MeshPartDS partDS( meshPart );
- _impl->ExportSTL(file, isascii, &partDS);
+ _impl->ExportSTL( file, isascii, name.in(), &partDS );
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( "
<< meshPart<< ", r'" << file << "', " << isascii << ")";
/*!
* \brief Replace parameters of the functions on the Salome NoteBook Variables
* \param theString - Input string
- * \retval TCollection_AsciiString - Convertion result
+ * \retval TCollection_AsciiString - Conversion result
*/
//================================================================================
void SMESH_NoteBook::ReplaceVariables()
* \param theRemovedObjIDs - entries of objects whose created commands were removed
* \param theHistoricalDump - true means to keep all commands, false means
* to exclude commands relating to objects removed from study
- * \retval TCollection_AsciiString - Convertion result
+ * \retval TCollection_AsciiString - Conversion result
*/
static void
ConvertScript(std::list< TCollection_AsciiString >& theScriptLines,
SMESH_subMesh_i::~SMESH_subMesh_i()
{
- MESSAGE("SMESH_subMesh_i::~SMESH_subMesh_i");
if ( _preMeshInfo ) delete _preMeshInfo;
_preMeshInfo = NULL;
}
def GetNewNodes(mesh,Elems,OldNodes):
"""
- Auxilary function, which return list of nodes from
+ Auxiliary function, which return list of nodes from
given Elems avoided nodes from OldNodes
"""
newnodes = []
pass
# 0D algorithm
if self.geom is None:
- raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
+ self.geom = store_geom
+ raise RuntimeError, "Attempt to create SegmentAroundVertex_0D algorithm on None shape"
from salome.smesh.smeshBuilder import AssureGeomPublished, GetName, TreatHypoStatus
AssureGeomPublished( self.mesh, self.geom )
name = GetName(self.geom)
# several functions, they must be accompanied by relative coordinates of
# points dividing the whole shape into ranges where the functions apply; points
# coodrinates should vary within (0.0, 1.0) range. Parameter \a t of the spacing
- # function f(t) varies from 0.0 to 1.0 witin a shape range.
+ # function f(t) varies from 0.0 to 1.0 within a shape range.
# Examples:
# - "10.5" - defines a grid with a constant spacing
# - [["1", "1+10*t", "11"] [0.1, 0.6]] - defines different spacing in 3 ranges.
pass # end of StdMeshersBuilder_Cartesian_3D class
## Defines a stub 1D algorithm, which enables "manual" creation of nodes and
-# segments usable by 2D algoritms
+# segments usable by 2D algorithms
#
# It is created by calling smeshBuilder.Mesh.UseExistingSegments(geom=0)
#
pass # end of StdMeshersBuilder_UseExisting_1D class
## Defines a stub 2D algorithm, which enables "manual" creation of nodes and
-# faces usable by 3D algoritms
+# faces usable by 3D algorithms
#
# It is created by calling smeshBuilder.Mesh.UseExistingFaces(geom=0)
#
## Private method.
def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
if geom is None and mesh.mesh.HasShapeToMesh():
- raise RuntimeError, "Attemp to create " + hypo + " algoritm on None shape"
+ raise RuntimeError, "Attempt to create " + hypo + " algorithm on None shape"
algo = self.FindAlgorithm(hypo, mesh.smeshpyD)
if algo is None:
algo = mesh.smeshpyD.CreateHypothesis(hypo, so)
def Assign(self, algo, mesh, geom):
from salome.smesh.smeshBuilder import AssureGeomPublished, TreatHypoStatus, GetName
if geom is None and mesh.mesh.HasShapeToMesh():
- raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape"
+ raise RuntimeError, "Attempt to create " + algo + " algorithm on None shape"
self.mesh = mesh
if not geom or geom.IsSame( mesh.geom ):
self.geom = mesh.geom
raise TypeError, "ViscousLayers are supported by 3D algorithms only"
if not "ViscousLayers" in self.GetCompatibleHypothesis():
raise TypeError, "ViscousLayers are not supported by %s"%self.algo.GetName()
+ if faces and isinstance( faces, geomBuilder.GEOM._objref_GEOM_Object ):
+ faces = [ faces ]
if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ):
faceIDs = []
for shape in faces:
raise TypeError, "ViscousLayers2D are supported by 2D algorithms only"
if not "ViscousLayers2D" in self.GetCompatibleHypothesis():
raise TypeError, "ViscousLayers2D are not supported by %s"%self.algo.GetName()
+ if edges and not isinstance( edges, list ) and not isinstance( edges, tuple ):
+ edges = [edges]
if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
edgeIDs = []
for shape in edges:
//===============================================================
const char* SMESH_Swig::AddNewMesh(const char* theIOR)
{
- MESSAGE("AddNewMesh");
// VSR: added temporarily - to be removed - objects are published automatically by engine
SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
//===============================================================
const char* SMESH_Swig::AddNewHypothesis(const char* theIOR)
{
- MESSAGE("AddNewHypothesis");
-
SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
mySComponentMesh,
myStudyBuilder);
//===============================================================
const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
{
- MESSAGE("AddNewAlgorithms");
-
SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
mySComponentMesh,
myStudyBuilder);
return "";
}
+/*!
+ \brief Gets window with specified identifier
+ \internal
+ \param id window identifier
+ \return pointer on the window
+*/
+
+SUIT_ViewWindow* getWnd( const int id )
+{
+ SUIT_ViewWindow* resWnd = 0;
+ SUIT_Session* aSession = SUIT_Session::session();
+ SUIT_Application* anApplication = aSession->activeApplication();
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(anApplication);
+ if ( app ) {
+ ViewManagerList vmlist = app->viewManagers();
+ foreach( SUIT_ViewManager* vm, vmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ if ( id == vw->getId() ) {
+ resWnd = vw;
+ break;
+ }
+ }
+ }
+ }
+ return resWnd;
+}
+
+class TGetActorAspect: public SALOME_Event
+{
+public:
+ typedef actorAspect TResult;
+ TResult myResult;
+ const char* _entry;
+ int _wid;
+ TGetActorAspect( const char* Mesh_Entry, int viewId )
+ {
+ _entry = Mesh_Entry;
+ _wid = viewId;
+ }
+ virtual void Execute()
+ {
+ SMESH_Actor* anActor;
+ if (_wid)
+ {
+ SUIT_ViewWindow* w = getWnd(_wid);
+ anActor = SMESH::FindActorByEntry( w, _entry );
+ }
+ else
+ anActor = SMESH::FindActorByEntry( _entry );
+ if ( !anActor )
+ {
+ MESSAGE("GetActorAspect: no actor corresponding to: " << _entry);
+ return;
+ }
+ anActor->GetSufaceColor(myResult.surfaceColor.r,
+ myResult.surfaceColor.g,
+ myResult.surfaceColor.b,
+ myResult.surfaceColor.delta);
+ anActor->GetVolumeColor(myResult.volumeColor.r,
+ myResult.volumeColor.g,
+ myResult.volumeColor.b,
+ myResult.volumeColor.delta);
+ anActor->GetEdgeColor(myResult.edgeColor.r,
+ myResult.edgeColor.g,
+ myResult.edgeColor.b);
+ anActor->GetNodeColor(myResult.nodeColor.r,
+ myResult.nodeColor.g,
+ myResult.nodeColor.b);
+ myResult.opacity= anActor->GetOpacity();
+ MESSAGE("opacity: " << myResult.opacity);
+ }
+};
+
+actorAspect SMESH_Swig::GetActorAspect( const char* Mesh_Entry, int viewId )
+{
+ return ProcessEvent(new TGetActorAspect( Mesh_Entry, viewId));
+}
+
+void SMESH_Swig::SetActorAspect( const actorAspect& actorPres, const char* Mesh_Entry, int viewId )
+{
+ class TSetActorAspect: public SALOME_Event
+ {
+ public:
+ const char* _entry;
+ actorAspect _actorPres;
+ int _wid;
+ TSetActorAspect(const actorAspect& actorPres, const char* Mesh_Entry, int viewId )
+ {
+ _entry = Mesh_Entry;
+ _actorPres = actorPres;
+ _wid = viewId;
+ }
+ virtual void Execute()
+ {
+ SMESH_Actor* anActor;
+ if (_wid)
+ {
+ SUIT_ViewWindow* w = getWnd(_wid);
+ anActor = SMESH::FindActorByEntry( w, _entry );
+ }
+ else
+ anActor = SMESH::FindActorByEntry( _entry );
+ if ( !anActor )
+ {
+ MESSAGE("SetActorAspect: no actor corresponding to: " << _entry);
+ return;
+ }
+ anActor->SetSufaceColor(_actorPres.surfaceColor.r,
+ _actorPres.surfaceColor.g,
+ _actorPres.surfaceColor.b,
+ _actorPres.surfaceColor.delta);
+ anActor->SetVolumeColor(_actorPres.volumeColor.r,
+ _actorPres.volumeColor.g,
+ _actorPres.volumeColor.b,
+ _actorPres.volumeColor.delta);
+ anActor->SetEdgeColor(_actorPres.edgeColor.r,
+ _actorPres.edgeColor.g,
+ _actorPres.edgeColor.b);
+ anActor->SetNodeColor(_actorPres.nodeColor.r,
+ _actorPres.nodeColor.g,
+ _actorPres.nodeColor.b);
+ anActor->SetOpacity(_actorPres.opacity);
+ if (_wid)
+ {
+ SUIT_ViewWindow* w = getWnd(_wid);
+ w->repaint();
+ }
+ else
+ {
+ SUIT_Session* aSession = SUIT_Session::session();
+ SUIT_Application* anApplication = aSession->activeApplication();
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(anApplication);
+ SUIT_ViewManager* vman = anApp->getViewManager(VTKViewer_Viewer::Type(),true);
+ vman->getActiveView()->repaint();
+ }
+ }
+ };
+
+ ProcessVoidEvent(new TSetActorAspect(actorPres, Mesh_Entry, viewId));
+}
+
void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry )
{
// SMESH_Actor* Mesh = smeshGUI->ReadScript(aM);
Ball = BallSelection
} SelectionMode;
+typedef struct
+{
+ double r, g, b;
+ int delta;
+} surfaceColorStruct;
+
+typedef struct
+{
+ double r, g, b;
+ int delta;
+} volumeColorStruct;
+
+typedef struct
+{
+ double r, g, b;
+} edgeColorStruct;
+
+typedef struct
+{
+ double r, g, b;
+} nodeColorStruct;
+
+struct actorAspect
+{
+ surfaceColorStruct surfaceColor;
+ volumeColorStruct volumeColor;
+ edgeColorStruct edgeColor;
+ nodeColorStruct nodeColor;
+ double opacity;
+};
+
class SMESH_SWIG_EXPORT SMESH_Swig
{
public:
*/
void SetMeshIcon( const char*, const bool, const bool );
+ actorAspect GetActorAspect(const char* Mesh_Entry, int viewId = 0 );
+ void SetActorAspect( const actorAspect& actorPres, const char* Mesh_Entry, int viewId = 0 );
+
void setSelectionMode( SelectionMode selectionMode );
std::vector<int> getSelected( const char* Mesh_Entry );
std::vector<std::pair<int, int> > getSelectedEdgeOfCell( const char* Mesh_Entry );
Ball
};
+typedef struct
+{
+ double r, g, b;
+ int delta;
+} surfaceColorStruct;
+
+typedef struct
+{
+ double r, g, b;
+ int delta;
+} volumeColorStruct;
+
+typedef struct
+{
+ double r, g, b;
+} edgeColorStruct;
+
+typedef struct
+{
+ double r, g, b;
+} nodeColorStruct;
+
+struct actorAspect
+{
+ surfaceColorStruct surfaceColor;
+ volumeColorStruct volumeColor;
+ edgeColorStruct edgeColor;
+ nodeColorStruct nodeColor;
+ double opacity;
+};
+
class SMESH_Swig
{
public:
std::vector<int> getSelected( const char* Mesh_Entry );
std::vector<std::pair<int,int> > getSelectedEdgeOfCell( const char* Mesh_Entry );
+ actorAspect GetActorAspect(const char* Mesh_Entry, int viewId = 0 );
+ void SetActorAspect( const actorAspect& actorPres, const char* Mesh_Entry, int viewId = 0 );
+
// --------------------- for the test purposes -----------------------
SelectionMode getSelectionMode();
void select( const char *id, std::vector<int> ids, bool append = false );
NbSeg += ( Lrat2 - Lratio ) / ( Lrat2 - Lrat1 ) * ( NbSegMax - NbSegMin );
double S0 = Lmin / (int) NbSeg;
- MESSAGE( "S0 = " << S0 << ", Lmin = " << Lmin << ", Nbseg = " << (int) NbSeg);
+ //MESSAGE( "S0 = " << S0 << ", Lmin = " << Lmin << ", Nbseg = " << (int) NbSeg);
// Compute segments length for all edges
* \param spaceFunctions - functions defining spacing values at given point on axis
* \param internalPoints - points dividing a grid into parts along each direction
*
- * Parameter t of spaceFunction f(t) is a position [0,1] withing bounding box of
+ * Parameter t of spaceFunction f(t) is a position [0,1] within bounding box of
* the shape to mesh
*/
void SetGridSpacing(std::vector<std::string>& spaceFunctions,
else if ( eMidOut != edges.end() )
edges.splice( edges.end(), edges, edges.begin(), eMidOut );
- // sort nodes accoring to the order of edges
+ // sort nodes according to the order of edges
_Node* orderNodes [20];
//TGeomID orderShapeIDs[20];
size_t nbN = 0;
const F_IntersectPoint* firstIntPnt = 0;
if ( link._nodes[0]->Node() ) // 1st node is a hexa corner
{
- curIntPnt._paramOnLine = coords[ ijk[ iDir ]] - coords[0];
+ curIntPnt._paramOnLine = coords[ ijk[ iDir ]] - coords[0] + _grid->_tol;
const GridLine& line = _grid->_lines[ iDir ][ lineIndex[ iL ]];
multiset< F_IntersectPoint >::const_iterator ip =
line._intPoints.upper_bound( curIntPnt );
* \brief Restore nodes on internal vertices of a complex side
* \param event - algo_event or compute_event itself (of SMESH_subMesh)
* \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
- * \param subMesh - the submesh where the event occures
+ * \param subMesh - the submesh where the event occurs
* \param data - listener data stored in the subMesh
* \param hyp - hypothesis, if eventType is algo_event
*/
SMESH_Gen * gen)
:StdMeshers_Regular_1D(hypId, studyId, gen)
{
- MESSAGE("StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D");
_name = AlgoName();
}
if ( side->NbEdges() < 2 )
return StdMeshers_Regular_1D::Compute( aMesh, aShape );
- // update segment lenght computed by StdMeshers_AutomaticLength
+ // update segment length computed by StdMeshers_AutomaticLength
const list <const SMESHDS_Hypothesis * > & hyps = GetUsedHypothesis(aMesh, aShape);
if ( !hyps.empty() ) {
StdMeshers_AutomaticLength * autoLenHyp = const_cast<StdMeshers_AutomaticLength *>
* \brief Constructor of a side of one edge
* \param theFace - the face
* \param theEdge - the edge
- */
+ */
//================================================================================
StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes,
+ SMESH_MesherHelper* theFaceHelper,
SMESH_ProxyMesh::Ptr theProxyMesh)
{
std::list<TopoDS_Edge> edges(1,theEdge);
- *this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward,
- theIgnoreMediumNodes, theProxyMesh );
+ StdMeshers_FaceSide tmp( theFace, edges, theMesh, theIsForward,
+ theIgnoreMediumNodes, theFaceHelper, theProxyMesh );
+ *this = tmp;
+
+ tmp.myHelper = NULL;
}
//================================================================================
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes,
+ SMESH_MesherHelper* theFaceHelper,
SMESH_ProxyMesh::Ptr theProxyMesh)
{
int nbEdges = theEdges.size();
myMissingVertexNodes = false;
myIgnoreMediumNodes = theIgnoreMediumNodes;
myDefaultPnt2d = gp_Pnt2d( 1e+100, 1e+100 );
+ myHelper = NULL;
if ( !myProxyMesh ) myProxyMesh.reset( new SMESH_ProxyMesh( *theMesh ));
+ if ( theFaceHelper && theFaceHelper->GetSubShape() == myFace )
+ {
+ myHelper = new SMESH_MesherHelper( * myProxyMesh->GetMesh() );
+ myHelper->CopySubShapeInfo( *theFaceHelper );
+ }
if ( nbEdges == 0 ) return;
SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
myLast.push_back ( theULast );
myNormPar.push_back ( 1. );
myIsUniform.push_back( true );
+ myHelper = NULL;
myLength = 0;
myProxyMesh = theSide->myProxyMesh;
myDefaultPnt2d = *thePnt2d1;
}
myFace = theFace;
+ myHelper = NULL;
myPoints = theSideNodes;
myNbPonits = myPoints.size();
myNbSegments = myNbPonits + 1;
myEdgeLength.resize( 1, myLength );
}
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+
+StdMeshers_FaceSide::~StdMeshers_FaceSide()
+{
+ delete myHelper; myHelper = NULL;
+}
+
//================================================================================
/*
* Return info on nodes on the side
if ( NbEdges() == 0 ) return myPoints;
StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
- SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
- SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
- fHelper.SetSubShape( myFace );
- bool paramOK;
+ bool paramOK = true;
double eps = 1e-100;
+ SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
+ SMESH_MesherHelper& fHelper = *FaceHelper();
+
// sort nodes of all edges by putting them into a map
map< double, const SMDS_MeshNode*> u2node;
if ( proxySubMesh[ iE ] ) // copy data from a proxy sub-mesh
{
const UVPtStructVec& edgeUVPtStruct = proxySubMesh[iE]->GetUVPtStructVec();
- std::copy( edgeUVPtStruct.begin(), edgeUVPtStruct.end(), & points[iPt] );
+ UVPtStruct* pointsPtr = & points[iPt];
+ std::copy( edgeUVPtStruct.begin(), edgeUVPtStruct.end(), pointsPtr );
// check orientation
double du1 = edgeUVPtStruct.back().param - edgeUVPtStruct[0].param;
double du2 = myLast[iE] - myFirst[iE];
if ( du1 * du2 < 0 )
{
- std::reverse( & points[iPt], & points[iPt + edgeUVPtStruct.size()]);
+ std::reverse( pointsPtr, pointsPtr + edgeUVPtStruct.size());
for ( size_t i = 0; i < edgeUVPtStruct.size(); ++i )
- points[iPt+i].normParam = 1. - points[iPt+i].normParam;
+ pointsPtr[i].normParam = 1. - pointsPtr[i].normParam;
}
// update normalized params
if ( myEdge.size() > 1 ) {
- for ( size_t i = 0; i < edgeUVPtStruct.size(); ++i, ++iPt )
+ for ( size_t i = 0; i < edgeUVPtStruct.size(); ++i )
{
- UVPtStruct & uvPt = points[iPt];
+ UVPtStruct & uvPt = pointsPtr[i];
uvPt.normParam = prevNormPar + uvPt.normParam * paramSize;
uvPt.x = uvPt.y = uvPt.normParam;
}
- --iPt; // to point to the 1st VERTEX of the next EDGE
+ iPt += edgeUVPtStruct.size() - 1; // to point to the 1st VERTEX of the next EDGE
+ }
+ // update UV on a seam EDGE
+ if ( fHelper.IsRealSeam( myEdgeID[ iE ]))
+ {
+ // check if points lye on the EDGE
+ const UVPtStruct& pm = edgeUVPtStruct[ edgeUVPtStruct.size()/2 ];
+ gp_Pnt pNode = SMESH_TNodeXYZ( pm.node );
+ gp_Pnt pCurv = myC3dAdaptor[ iE ].Value( pm.param );
+ double tol = BRep_Tool::Tolerance( myEdge[ iE ]) * 10;
+ bool isPointOnEdge = ( pNode.SquareDistance( pCurv ) < tol * tol );
+ if ( isPointOnEdge )
+ for ( size_t i = 0; i < edgeUVPtStruct.size(); ++i )
+ pointsPtr[i].SetUV( myC2d[ iE ]->Value( pointsPtr[i].param ).XY() );
}
}
else
for ( ; u_node != u2node.end(); ++u_node, ++iPt )
{
if ( myNormPar[ iE ]-eps < u_node->first )
- break; // u_node is at VERTEX of the next EDGE
+ break; // u_node is at VERTEX of the next EDGE
UVPtStruct & uvPt = points[iPt];
uvPt.node = u_node->second;
if ( NbEdges() == 0 ) return resultNodes;
//SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
- SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
- SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
- fHelper.SetSubShape( myFace );
+ SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
+ SMESH_MesherHelper& fHelper = * FaceHelper();
bool paramOK = true;
// Sort nodes of all edges putting them into a map
}
}
- SMESH_MesherHelper helper( *myProxyMesh->GetMesh() );
- helper.SetSubShape( myFace );
+ SMESH_MesherHelper* helper = FaceHelper();
std::set< const SMDS_MeshNode* > vNodes;
const int nbV = NbEdges() + !IsClosed();
if ( const SMDS_MeshNode* n = VertexNode( i ))
{
if ( !vNodes.insert( n ).second &&
- ( helper.IsRealSeam ( n->getshapeId() ) ||
- helper.IsDegenShape( n->getshapeId() )))
+ ( helper->IsRealSeam ( n->getshapeId() ) ||
+ helper->IsDegenShape( n->getshapeId() )))
me->myNbPonits++;
}
else
SMESH_Mesh & theMesh,
const bool theIgnoreMediumNodes,
TError & theError,
+ SMESH_MesherHelper* theFaceHelper,
SMESH_ProxyMesh::Ptr theProxyMesh,
const bool theCheckVertexNodes)
{
+ SMESH_MesherHelper helper( theMesh );
+ if ( theFaceHelper && theFaceHelper->GetSubShape() == theFace )
+ helper.CopySubShapeInfo( *theFaceHelper );
+
list< TopoDS_Edge > edges, internalEdges;
list< int > nbEdgesInWires;
int nbWires = SMESH_Block::GetOrderedEdges (theFace, edges, nbEdgesInWires);
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
/*isForward=*/true, theIgnoreMediumNodes,
- theProxyMesh );
+ &helper, theProxyMesh );
wires[ iW ] = StdMeshers_FaceSidePtr( wire );
from = to;
}
{
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, internalEdges.back(), &theMesh,
/*isForward=*/true, theIgnoreMediumNodes,
- theProxyMesh );
+ &helper, theProxyMesh );
wires.push_back( StdMeshers_FaceSidePtr( wire ));
internalEdges.pop_back();
}
{
return myEdge.empty() ? false : FirstVertex().IsSame( LastVertex() );
}
+
+//================================================================================
+/*!
+ * \brief Return a helper initialized with the FACE
+ */
+//================================================================================
+
+SMESH_MesherHelper* StdMeshers_FaceSide::FaceHelper() const
+{
+ StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
+ if ( !myHelper && myProxyMesh )
+ {
+ me->myHelper = new SMESH_MesherHelper( *myProxyMesh->GetMesh() );
+ me->myHelper->SetSubShape( myFace );
+ }
+ return me->myHelper;
+}
#include <list>
#include <boost/shared_ptr.hpp>
-class SMDS_MeshNode;
-class SMESH_Mesh;
class Adaptor2d_Curve2d;
class Adaptor3d_Curve;
class BRepAdaptor_CompCurve;
-struct SMESH_ComputeError;
+class SMDS_MeshNode;
+class SMESH_Mesh;
+class SMESH_MesherHelper;
class StdMeshers_FaceSide;
+struct SMESH_ComputeError;
typedef boost::shared_ptr< SMESH_ComputeError > TError;
typedef boost::shared_ptr< StdMeshers_FaceSide > StdMeshers_FaceSidePtr;
class STDMESHERS_EXPORT StdMeshers_FaceSide
{
public:
+
+ enum { ALL_EDGES = -1, LAST_EDGE = -1 }; //!< constants
+
/*!
* \brief Wrap one edge
*/
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes,
+ SMESH_MesherHelper* theFaceHelper = NULL,
SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr());
/*!
* \brief Wrap several edges. Edges must be properly ordered and oriented.
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes,
+ SMESH_MesherHelper* theFaceHelper = NULL,
SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr());
/*!
* \brief Simulate a side from a vertex using data from other FaceSide
StdMeshers_FaceSide(const StdMeshers_FaceSide* theSide,
const SMDS_MeshNode* theNode,
const gp_Pnt2d* thePnt2d1,
- const gp_Pnt2d* thePnt2d2=NULL,
- const Handle(Geom2d_Curve)& theC2d=NULL,
- const double theUFirst=0.,
- const double theULast=1.);
+ const gp_Pnt2d* thePnt2d2 = NULL,
+ const Handle(Geom2d_Curve)& theC2d = NULL,
+ const double theUFirst = 0.,
+ const double theULast = 1.);
/*!
* \brief Create a side from an UVPtStructVec
*/
const TopoDS_Edge& theEdge = TopoDS_Edge(),
SMESH_Mesh* theMesh = 0);
+ ~StdMeshers_FaceSide();
+
// static "consrtuctors"
static StdMeshers_FaceSidePtr New(const TopoDS_Face& Face,
const TopoDS_Edge& Edge,
SMESH_Mesh* Mesh,
const bool IsForward,
const bool IgnoreMediumNodes,
+ SMESH_MesherHelper* FaceHelper = NULL,
SMESH_ProxyMesh::Ptr ProxyMesh = SMESH_ProxyMesh::Ptr())
{ return StdMeshers_FaceSidePtr
- ( new StdMeshers_FaceSide( Face,Edge,Mesh,IsForward,IgnoreMediumNodes,ProxyMesh ));
+ ( new StdMeshers_FaceSide( Face,Edge,Mesh,IsForward,IgnoreMediumNodes,FaceHelper,ProxyMesh ));
}
static StdMeshers_FaceSidePtr New (const TopoDS_Face& Face,
std::list<TopoDS_Edge>& Edges,
SMESH_Mesh* Mesh,
const bool IsForward,
const bool IgnoreMediumNodes,
+ SMESH_MesherHelper* FaceHelper = NULL,
SMESH_ProxyMesh::Ptr ProxyMesh = SMESH_ProxyMesh::Ptr())
{ return StdMeshers_FaceSidePtr
- ( new StdMeshers_FaceSide( Face,Edges,Mesh,IsForward,IgnoreMediumNodes,ProxyMesh ));
+ ( new StdMeshers_FaceSide( Face,Edges,Mesh,IsForward,IgnoreMediumNodes,FaceHelper,ProxyMesh ));
}
static StdMeshers_FaceSidePtr New (const StdMeshers_FaceSide* Side,
const SMDS_MeshNode* Node,
const gp_Pnt2d* Pnt2d1,
- const gp_Pnt2d* Pnt2d2=NULL,
- const Handle(Geom2d_Curve)& C2d=NULL,
- const double UFirst=0.,
- const double ULast=1.)
+ const gp_Pnt2d* Pnt2d2 = NULL,
+ const Handle(Geom2d_Curve)& C2d = NULL,
+ const double UFirst = 0.,
+ const double ULast = 1.)
{ return StdMeshers_FaceSidePtr
( new StdMeshers_FaceSide( Side,Node,Pnt2d1,Pnt2d2,C2d,UFirst,ULast ));
}
SMESH_Mesh & theMesh,
const bool theIgnoreMediumNodes,
TError & theError,
+ SMESH_MesherHelper* theFaceHelper = NULL,
SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr(),
- const bool theCheckVertexNodes=true);
+ const bool theCheckVertexNodes = true);
/*!
* \brief Change orientation of side geometry
*/
* Missing nodes are allowed only on internal vertices.
* For a closed side, the 1st point repeats at end
*/
- const UVPtStructVec& GetUVPtStruct(bool isXConst =0, double constValue =0) const;
+ const UVPtStructVec& GetUVPtStruct( bool isXConst = 0, double constValue = 0 ) const;
/*!
* \brief Simulates detailed data on nodes
* \param isXConst - true if normalized parameter X is constant
double constValue = 0) const;
/*!
* \brief Return nodes in the order they encounter while walking along
- * the while side or a specified EDGE.
- * For a closed side, the 1st point repeats at end
+ * the while side or a specified EDGE. For a closed side, the 1st point repeats at end.
+ * \param iE - index of the EDGE. Default is "all EDGEs".
*/
- std::vector<const SMDS_MeshNode*> GetOrderedNodes(int iE=-1) const;
+ std::vector<const SMDS_MeshNode*> GetOrderedNodes( int iE = ALL_EDGES ) const;
/*!
* \brief Return nodes of the i-th EDGE.
/*!
* \brief Return last vertex of the i-th edge (count starts from zero)
*/
- TopoDS_Vertex LastVertex(int i=-1) const;
+ TopoDS_Vertex LastVertex(int i = LAST_EDGE) const;
/*!
* \brief Return \c true if the chain of EDGEs is closed
*/
*/
inline int EdgeIndex( double U ) const;
- //virtual gp_Pnt Value(double U) const;
-
void dump(const char* msg=0) const;
/*!
* \brief Return orientation of i-th wrapped edge (count starts from zero)
*/
inline bool IsReversed(int i) const;
+ /*!
+ * \brief Return a helper initialized with the FACE
+ */
+ SMESH_MesherHelper* FaceHelper() const;
protected:
SMESH_ProxyMesh::Ptr myProxyMesh;
bool myMissingVertexNodes, myIgnoreMediumNodes;
gp_Pnt2d myDefaultPnt2d;
+ SMESH_MesherHelper* myHelper;
};
StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen)
:SMESH_3D_Algo(hypId, studyId, gen)
{
- MESSAGE("StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D");
_name = "HexaFromSkin_3D";
}
StdMeshers_HexaFromSkin_3D::~StdMeshers_HexaFromSkin_3D()
{
- MESSAGE("StdMeshers_HexaFromSkin_3D::~StdMeshers_HexaFromSkin_3D");
}
//================================================================================
StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen * gen)
:SMESH_3D_Algo(hypId, studyId, gen)
{
- MESSAGE("StdMeshers_Hexa_3D::StdMeshers_Hexa_3D");
_name = "Hexa_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type
_requireShape = false;
StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D()
{
- MESSAGE("StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D");
}
//=============================================================================
StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen);
for ( int i = 0; i < 6; ++i )
{
- if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 )))))
+ if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ),
+ /*considerMesh=*/true))))
return error( quadAlgo.GetComputeError() );
if ( quad[i]->side.size() != 4 )
return error( COMPERR_BAD_SHAPE, "Not a quadrangular box side" );
StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen * gen)
:SMESH_1D_Algo(hypId, studyId, gen), _sourceHyp(0)
{
- MESSAGE("StdMeshers_Import_1D::StdMeshers_Import_1D");
_name = "Import_1D";
_shapeType = (1 << TopAbs_EDGE);
//--------------------------------------------------------------------------------
/*!
* \brief Remove imported mesh and/or groups if needed
- * \param sm - submesh loosing Import algo
+ * \param sm - submesh losing Import algo
* \param data - data holding imported groups
*/
void _Listener::removeSubmesh( SMESH_subMesh* sm, _ListenerData* data )
//--------------------------------------------------------------------------------
/*!
* \brief Clear _ImportData::_n2n.
- * _n2n is usefull within one mesh.Compute() only
+ * _n2n is useful within one mesh.Compute() only
*/
void _Listener::clearN2N( SMESH_Mesh* tgtMesh )
{
StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen * gen)
:SMESH_2D_Algo(hypId, studyId, gen), _sourceHyp(0)
{
- MESSAGE("StdMeshers_Import_1D2D::StdMeshers_Import_1D2D");
_name = "Import_1D2D";
_shapeType = (1 << TopAbs_FACE);
StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution()
{
- MESSAGE( "StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution" );
}
//=============================================================================
StdMeshers_LayerDistribution2D::~StdMeshers_LayerDistribution2D()
{
- MESSAGE( "StdMeshers_LayerDistribution2D::~StdMeshers_LayerDistribution2D" );
}
// get all edges of a face
TError problem;
TWireVector wires =
- StdMeshers_FaceSide::GetFaceWires( F, aMesh, skipMediumNodes, problem, proxyMesh );
+ StdMeshers_FaceSide::GetFaceWires( F, aMesh, skipMediumNodes, problem, _helper, proxyMesh );
int nbWires = wires.size();
if ( problem && !problem->IsOK() ) return error( problem );
if ( nbWires == 0 ) return error( "Problem in StdMeshers_FaceSide::GetFaceWires()");
bool isDegen = ( _helper->HasDegeneratedEdges() &&
( nn[0] == nn[1] || nn[1] == nn[2] || nn[2] == nn[0] ));
- // It was an attemp to fix a problem of a zero area face whose all nodes
+ // It was an attempt to fix a problem of a zero area face whose all nodes
// are on one staight EDGE. But omitting this face makes a hole in the mesh :(
// if ( !isDegen && allNodesAreOld )
// isDegen = isDegenTria( nn );
StdMeshers_MaxElementVolume::~StdMeshers_MaxElementVolume()
{
- MESSAGE("StdMeshers_MaxElementVolume::~StdMeshers_MaxElementVolume");
}
//=============================================================================
StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers()
{
- MESSAGE( "StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers" );
}
//=============================================================================
StdMeshers_NumberOfLayers2D::~StdMeshers_NumberOfLayers2D()
{
- MESSAGE( "StdMeshers_NumberOfLayers2D::~StdMeshers_NumberOfLayers2D" );
}
bool StdMeshers_Penta_3D::Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)
{
- MESSAGE("StdMeshers_Penta_3D::Compute()");
- //
bool bOK=false;
//
myShape=aShape;
// suporting shape ID
ShapeSupportID(bIsUpperLayer, aBNSSID, aSSID);
if (!myErrorStatus->IsOK()) {
- MESSAGE("StdMeshers_Penta_3D::MakeNodes() ");
+ MESSAGE("StdMeshers_Penta_3D::MakeNodes() pb");
return;
}
//
}
}
if (!myErrorStatus->IsOK()) {
- MESSAGE("StdMeshers_Penta_3D::MakeNodes() ");
+ MESSAGE("StdMeshers_Penta_3D::MakeNodes() err");
return;
}
//
aID0 = pNode->GetID();
aJ[k] = GetIndexOnLayer(aID0);
if (!myErrorStatus->IsOK()) {
- MESSAGE("StdMeshers_Penta_3D::MakeVolumeMesh");
+ MESSAGE("StdMeshers_Penta_3D::MakeVolumeMesh pb");
return;
}
}
aID0 = pNode->GetID();
aJ = GetIndexOnLayer(aID0);
if (!myErrorStatus->IsOK()) {
- MESSAGE("StdMeshers_Penta_3D::MakeMeshOnFxy1() ");
+ MESSAGE("StdMeshers_Penta_3D::MakeMeshOnFxy1() pb");
return;
}
//
if (iCnt>1) {
// \begin{E.A.}
// The current algorithm fails if there is more that one
- // face wich contains triangles ...
+ // face which contains triangles ...
// In that case, replace return by break to try another
// method (coded in "if (iCnt != 1) { ... }")
//
// 1.1 Base vertex V000
iNbE = aME.Extent();
if (iNbE!= NB_WALL_FACES ){
- MESSAGE("StdMeshers_Penta_3D::MakeBlock() ");
+ MESSAGE("StdMeshers_Penta_3D::MakeBlock() err");
myErrorStatus->myName=7; // too few edges are in base face aFTr
myErrorStatus->myComment=SMESH_Comment("Not a quadrilateral face #")
<<pMesh->GetMeshDS()->ShapeToIndex( aFTr )<<": "<<iNbE<<" edges" ;
}
iNbEV=aMEV.Extent();
if (iNbEV!=3){
- MESSAGE("StdMeshers_Penta_3D::MakeBlock() ");
+ MESSAGE("StdMeshers_Penta_3D::MakeBlock() err");
myErrorStatus->myName=7; // too few edges meet in base vertex
myErrorStatus->myComment=SMESH_Comment("3 edges must share vertex #")
<<pMesh->GetMeshDS()->ShapeToIndex( aV000 )<<" but there are "<<iNbEV<<" edges";
}
//
if (!bFound) {
- MESSAGE("StdMeshers_Penta_3D::MakeBlock() ");
+ MESSAGE("StdMeshers_Penta_3D::MakeBlock() err");
myErrorStatus->myName=8; // can not find reper V001
myErrorStatus->myComment=SMESH_Comment("Can't find opposite vertex for vertex #")
<<pMesh->GetMeshDS()->ShapeToIndex( aV000 );
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap)
{
- MESSAGE("StdMeshers_Penta_3D::Evaluate()");
-
// find face contains only triangles
vector < SMESH_subMesh * >meshFaces;
TopTools_SequenceOfShape aFaces;
if ( !proxyMesh )
return false;
- TError erorr;
+ TError err;
TSideVector wires = StdMeshers_FaceSide::GetFaceWires(face, theMesh,
/*skipMediumNodes=*/_quadraticMesh,
- erorr, proxyMesh,
+ err, &helper, proxyMesh,
/*checkVertexNodes=*/false);
if ( wires.size() != 1 )
return error( COMPERR_BAD_SHAPE, SMESH_Comment("One wire required, not ") << wires.size() );
// TODO. there are other ways to find out the source FACE:
- // propagation, topological similarity, ect.
+ // propagation, topological similarity, etc...
// simply try to mesh all not meshed SOLIDs
if ( meshedFaces.empty() )
if ( ! fSM->IsMeshComputed() )
{
// Top EDGEs must be projections from the bottom ones
- // to compute stuctured quad mesh on wall FACEs
+ // to compute structured quad mesh on wall FACEs
// ---------------------------------------------------
const TopoDS_Edge& botE = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge(0);
const TopoDS_Edge& topE = (*quad)->side[ QUAD_TOP_SIDE ].grid->Edge(0);
"Non-quadrilateral faces are not opposite"));
// check that the found top and bottom FACEs are opposite
+ TopTools_IndexedMapOfShape topEdgesMap( thePrism.myBottomEdges.size() );
+ TopExp::MapShapes( thePrism.myTop, topEdgesMap );
list< TopoDS_Edge >::iterator edge = thePrism.myBottomEdges.begin();
for ( ; edge != thePrism.myBottomEdges.end(); ++edge )
- if ( myHelper->IsSubShape( *edge, thePrism.myTop ))
+ if ( topEdgesMap.Contains( *edge ))
return toSM( error
(notQuadGeomSubMesh.empty() ? COMPERR_BAD_INPUT_MESH : COMPERR_BAD_SHAPE,
"Non-quadrilateral faces are not opposite"));
StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D()
{
- MESSAGE( "StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D" );
}
//=============================================================================
- /*!
- * Sets source <edge> to take a mesh pattern from
- */
+/*!
+ * Sets source <edge> to take a mesh pattern from
+ */
//=============================================================================
void StdMeshers_ProjectionSource1D::SetSourceEdge(const TopoDS_Shape& edge)
StdMeshers_ProjectionSource2D::~StdMeshers_ProjectionSource2D()
{
- MESSAGE( "StdMeshers_ProjectionSource2D::~StdMeshers_ProjectionSource2D" );
}
//=============================================================================
- /*!
- * Sets a source <face> to take a mesh pattern from
- */
+/*!
+ * Sets a source <face> to take a mesh pattern from
+ */
//=============================================================================
void StdMeshers_ProjectionSource2D::SetSourceFace(const TopoDS_Shape& Face)
StdMeshers_ProjectionSource3D::~StdMeshers_ProjectionSource3D()
{
- MESSAGE( "StdMeshers_ProjectionSource3D::~StdMeshers_ProjectionSource3D" );
}
//=============================================================================
- /*!
- * Sets a source <face> to take a mesh pattern from
- */
+/*!
+ * Sets a source shape to take a mesh pattern from
+ */
//=============================================================================
void StdMeshers_ProjectionSource3D::SetSource3DShape(const TopoDS_Shape& Shape)
int nbE = FindFaceAssociation( face1, VV1, face2, VV2, edges1, edges2, isVCloseness );
if ( !nbE ) RETURN_BAD_RESULT("FindFaceAssociation() failed");
InsertAssociation( face1, face2, theMap ); // assoc faces
- MESSAGE("Assoc FACE " << theMesh1->GetMeshDS()->ShapeToIndex( face1 )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( face2 ));
+ // MESSAGE("Assoc FACE " << theMesh1->GetMeshDS()->ShapeToIndex( face1 )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( face2 ));
if ( nbE == 2 && (edge1.IsSame( edges1.front())) != (edge2.IsSame( edges2.front())))
{
reverseEdges( edges2, nbE );
}
// Associate shells
//
- int nbFaces1 = SMESH_MesherHelper:: Count( shell1, TopAbs_FACE, 0 );
- int nbFaces2 = SMESH_MesherHelper:: Count( shell2, TopAbs_FACE, 0 );
+ int nbFaces1 = SMESH_MesherHelper::Count( shell1, TopAbs_FACE, 0 );
+ int nbFaces2 = SMESH_MesherHelper::Count( shell2, TopAbs_FACE, 0 );
if ( nbFaces1 != nbFaces2 )
RETURN_BAD_RESULT("Different nb of faces found for shells");
if ( nbFaces1 > 0 ) {
v2e[0].UnBind( V[0] );
v2e[1].UnBind( V[1] );
InsertAssociation( e0, e1, theMap );
- MESSAGE("Assoc edge " << theMesh1->GetMeshDS()->ShapeToIndex( e0 )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( e1 ));
+ // MESSAGE("Assoc edge " << theMesh1->GetMeshDS()->ShapeToIndex( e0 )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( e1 ));
V[0] = GetNextVertex( e0, V[0] );
V[1] = GetNextVertex( e1, V[1] );
if ( !V[0].IsNull() ) {
InsertAssociation( V[0], V[1], theMap );
- MESSAGE("Assoc vertex " << theMesh1->GetMeshDS()->ShapeToIndex( V[0] )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( V[1] ));
+ // MESSAGE("Assoc vertex " << theMesh1->GetMeshDS()->ShapeToIndex( V[0] )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( V[1] ));
}
}
else if ( nbE0 == 2 )
InsertAssociation( e0b, e1b, theMap );
InsertAssociation( e0n, e1n, theMap );
InsertAssociation( v0n, v1n, theMap );
- MESSAGE("Assoc edge " << theMesh1->GetMeshDS()->ShapeToIndex( e0b )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( e1b ));
- MESSAGE("Assoc edge " << theMesh1->GetMeshDS()->ShapeToIndex( e0n )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( e1n ));
- MESSAGE("Assoc vertex " << theMesh1->GetMeshDS()->ShapeToIndex( v0n )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( v1n ));
+ // MESSAGE("Assoc edge " << theMesh1->GetMeshDS()->ShapeToIndex( e0b )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( e1b ));
+ // MESSAGE("Assoc edge " << theMesh1->GetMeshDS()->ShapeToIndex( e0n )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( e1n ));
+ // MESSAGE("Assoc vertex " << theMesh1->GetMeshDS()->ShapeToIndex( v0n )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( v1n ));
v2e[0].UnBind( V[0] );
v2e[1].UnBind( V[1] );
V[0] = v0n;
InsertAssociation( VV1[ 0 ], VV2[ 0 ], theMap );
InsertAssociation( VV1[ 1 ], VV2[ 1 ], theMap );
- MESSAGE("Initial assoc VERT " << theMesh1->GetMeshDS()->ShapeToIndex( VV1[ 0 ] )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( VV2[ 0 ] )<<
- "\nand VERT " << theMesh1->GetMeshDS()->ShapeToIndex( VV1[ 1 ] )<<
- " to " << theMesh2->GetMeshDS()->ShapeToIndex( VV2[ 1 ] ));
+ // MESSAGE("Initial assoc VERT " << theMesh1->GetMeshDS()->ShapeToIndex( VV1[ 0 ] )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( VV2[ 0 ] )<<
+ // "\nand VERT " << theMesh1->GetMeshDS()->ShapeToIndex( VV1[ 1 ] )<<
+ // " to " << theMesh2->GetMeshDS()->ShapeToIndex( VV2[ 1 ] ));
if ( theShape1.ShapeType() == TopAbs_EDGE ) {
InsertAssociation( theShape1, theShape2, theMap );
return true;
std::advance( edge2End, *nbE2 );
if ( *nbE1 == *nbE2 && iW2 >= iW1 )
{
- // rotate edge2 untill coincidence with edge1 in 2D
+ // rotate edge2 until coincides with edge1 in 2D
int i = *nbE2;
bool sameUV = false;
while ( !( sameUV = sameVertexUV( *edge2Beg, face2, 0, v0f1UV, vTolUV )) && --i > 0 )
break;
}
}
- // prepare to the next wire loop
+ // prepare for the next wire loop
edge2Beg = edge2End;
}
edge1Beg = edge1End;
if ( !sm || sm->GetAlgoState() != SMESH_subMesh::NO_ALGO )
return usualMessage; // algo is OK, anything else is KO.
- // Try to find a type of all-dimentional algorithm that would compute the
+ // Try to find a type of all-dimensional algorithm that would compute the
// given sub-mesh if it could be launched before projection
const TopoDS_Shape shape = sm->GetSubShape();
const int shapeDim = SMESH_Gen::GetShapeDim( shape );
//================================================================================
/*!
- * \brief Computes transformation beween two sets of 2D points using
+ * \brief Computes transformation between two sets of 2D points using
* a least square approximation
*
* See "Surface Mesh Projection For Hexahedral Mesh Generation By Sweeping"
//================================================================================
/*!
- * \brief Computes transformation beween two sets of 3D points using
+ * \brief Computes transformation between two sets of 3D points using
* a least square approximation
*
* See "Surface Mesh Projection For Hexahedral Mesh Generation By Sweeping"
/*!
- * \brief Finds transformation beween two sets of 2D points using
+ * \brief Finds transformation between two sets of 2D points using
* a least square approximation
*/
class TrsfFinder2D
bool IsIdentity() const { return ( _trsf.Form() == gp_Identity ); }
};
/*!
- * \brief Finds transformation beween two sets of 3D points using
+ * \brief Finds transformation between two sets of 3D points using
* a least square approximation
*/
class TrsfFinder3D
/*!
* \brief Structure used to temporary remove EventProparatorToEdges from faceSubMesh
* in order to prevent propagation of CLEAN event from FACE to EDGEs during
- * StdMeshers_Projection_1D2D::Compute(). The CLEAN event is emmited by Pattern mapper
+ * StdMeshers_Projection_1D2D::Compute(). The CLEAN event is emitted by Pattern mapper
* and causes removal of faces generated on adjacent FACEs.
*/
struct UnsetterOfEventProparatorToEdges
}
TopoDS_Face F = TopoDS::Face( theShape );
TError err;
- TSideVector wires = StdMeshers_FaceSide::GetFaceWires( F, theMesh,
- /*ignoreMediumNodes=*/false, err);
+ TSideVector wires = StdMeshers_FaceSide::GetFaceWires( F, theMesh, /*ignoreMediumNodes=*/false,
+ err, &helper);
if ( err && !err->IsOK() )
return error( err );
using namespace std;
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
+#ifdef _DEBUG_
+// enable printing algo + projection shapes while meshing
+//#define PRINT_WHO_COMPUTE_WHAT
+#endif
namespace TAssocTool = StdMeshers_ProjectionUtils;
//typedef StdMeshers_ProjectionUtils TAssocTool;
const TopoDS_Face& srcFace,
SMESH_Mesh * tgtMesh,
SMESH_Mesh * srcMesh,
+ SMESH_MesherHelper* tgtHelper,
const TAssocTool::TShapeShapeMap& shape2ShapeMap,
TSideVector& srcWires,
TSideVector& tgtWires,
// get ordered src EDGEs
TError err;
- srcWires = StdMeshers_FaceSide::GetFaceWires( srcFace, *srcMesh,/*skipMediumNodes=*/0, err);
+ srcWires = StdMeshers_FaceSide::GetFaceWires( srcFace, *srcMesh,/*skipMediumNodes=*/0, err );
if (( err && !err->IsOK() ) ||
( srcWires.empty() ))
return err;
-
- SMESH_MesherHelper srcHelper( *srcMesh );
- srcHelper.SetSubShape( srcFace );
+#ifdef PRINT_WHO_COMPUTE_WHAT
+ cout << "Projection_2D" << " F "
+ << tgtMesh->GetMeshDS()->ShapeToIndex( tgtFace ) << " <- "
+ << srcMesh->GetMeshDS()->ShapeToIndex( srcFace ) << endl;
+#endif
// make corresponding sequence of tgt EDGEs
tgtWires.resize( srcWires.size() );
tgtWires[ iW ].reset( new StdMeshers_FaceSide( tgtFace, tgtEdges, tgtMesh,
/*theIsForward = */ true,
- /*theIgnoreMediumNodes = */false));
+ /*theIgnoreMediumNodes = */false,
+ tgtHelper ));
StdMeshers_FaceSidePtr tgtWire = tgtWires[ iW ];
// Fill map of src to tgt nodes with nodes on edges
for ( int iE = 0; iE < srcWire->NbEdges(); ++iE )
{
+#ifdef PRINT_WHO_COMPUTE_WHAT
+ if ( tgtMesh->GetSubMesh( tgtWire->Edge(iE) )->IsEmpty() )
+ cout << "Projection_2D" << " E "
+ << tgtWire->EdgeID(iE) << " <- " << srcWire->EdgeID(iE) << endl;
+#endif
if ( srcMesh->GetSubMesh( srcWire->Edge(iE) )->IsEmpty() ||
tgtMesh->GetSubMesh( tgtWire->Edge(iE) )->IsEmpty() )
{
else
{
const bool skipMedium = true, isFwd = true;
- StdMeshers_FaceSide srcEdge( srcFace, srcWire->Edge(iE), srcMesh, isFwd, skipMedium);
- StdMeshers_FaceSide tgtEdge( tgtFace, tgtWire->Edge(iE), tgtMesh, isFwd, skipMedium);
-
+ StdMeshers_FaceSide srcEdge( srcFace, srcWire->Edge(iE),
+ srcMesh, isFwd, skipMedium, srcWires[0]->FaceHelper() );
+ StdMeshers_FaceSide tgtEdge( tgtFace, tgtWire->Edge(iE),
+ tgtMesh, isFwd, skipMedium, tgtHelper);
+
vector< const SMDS_MeshNode* > srcNodes = srcEdge.GetOrderedNodes();
vector< const SMDS_MeshNode* > tgtNodes = tgtEdge.GetOrderedNodes();
//================================================================================
/*!
- * \brief Preform projection in case if tgtFace.IsPartner( srcFace ) and in case
+ * \brief Perform projection in case if tgtFace.IsPartner( srcFace ) and in case
* if projection by 3D transformation is possible
*/
//================================================================================
TAssocTool::TNodeNodeMap& src2tgtNodes,
const bool is1DComputed)
{
- SMESH_Mesh * tgtMesh = tgtWires[0]->GetMesh();
- SMESH_Mesh * srcMesh = srcWires[0]->GetMesh();
- SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS();
- SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS();
- SMESH_MesherHelper helper( *tgtMesh );
+ SMESH_Mesh * tgtMesh = tgtWires[0]->GetMesh();
+ SMESH_Mesh * srcMesh = srcWires[0]->GetMesh();
+ SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS();
+ SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS();
+ SMESH_MesherHelper* helper = tgtWires[0]->FaceHelper();
const double tol = 1.e-7 * srcMeshDS->getMaxDim();
0.123 * ( srcSurf.FirstVParameter() + srcSurf.LastVParameter() ));
gp_Pnt tgtTrsfP = trsf.Transform( srcP );
TopLoc_Location loc;
- GeomAPI_ProjectPointOnSurf& proj = helper.GetProjector( tgtFace, loc, 0.1*tol );
+ GeomAPI_ProjectPointOnSurf& proj = helper->GetProjector( tgtFace, loc, 0.1*tol );
if ( !loc.IsIdentity() )
tgtTrsfP.Transform( loc.Transformation().Inverted() );
proj.Perform( tgtTrsfP );
// Make new faces
// prepare the helper to adding quadratic elements if necessary
- //helper.SetSubShape( tgtFace );
- helper.IsQuadraticSubMesh( tgtFace );
+ helper->IsQuadraticSubMesh( tgtFace );
SMESHDS_SubMesh* srcSubDS = srcMeshDS->MeshElements( srcFace );
if ( !is1DComputed && srcSubDS->NbElements() )
- helper.SetIsQuadratic( srcSubDS->GetElements()->next()->IsQuadratic() );
+ helper->SetIsQuadratic( srcSubDS->GetElements()->next()->IsQuadratic() );
- SMESH_MesherHelper srcHelper( *srcMesh );
- srcHelper.SetSubShape( srcFace );
- SMESH_MesherHelper edgeHelper( *tgtMesh );
+ SMESH_MesherHelper* srcHelper = srcWires[0]->FaceHelper();
+ SMESH_MesherHelper edgeHelper( *tgtMesh );
edgeHelper.ToFixNodeParameters( true );
const SMDS_MeshNode* nullNode = 0;
const SMDS_MeshElement* elem = elemIt->next();
const int nbN = elem->NbCornerNodes();
tgtNodes.resize( nbN );
- helper.SetElementsOnShape( false );
+ helper->SetElementsOnShape( false );
for ( int i = 0; i < nbN; ++i ) // loop on nodes of the source element
{
const SMDS_MeshNode* srcNode = elem->GetNode(i);
{
// create a new node
gp_Pnt tgtP = trsf.Transform( SMESH_TNodeXYZ( srcNode ));
- SMDS_MeshNode* n = helper.AddNode( tgtP.X(), tgtP.Y(), tgtP.Z() );
+ SMDS_MeshNode* n = helper->AddNode( tgtP.X(), tgtP.Y(), tgtP.Z() );
srcN_tgtN->second = n;
switch ( srcNode->GetPosition()->GetTypeOfPosition() )
{
case SMDS_TOP_FACE:
{
- gp_Pnt2d srcUV = srcHelper.GetNodeUV( srcFace, srcNode );
- tgtMeshDS->SetNodeOnFace( n, helper.GetSubShapeID(), srcUV.X(), srcUV.Y() );
+ gp_Pnt2d srcUV = srcHelper->GetNodeUV( srcFace, srcNode );
+ tgtMeshDS->SetNodeOnFace( n, helper->GetSubShapeID(), srcUV.X(), srcUV.Y() );
break;
}
case SMDS_TOP_EDGE:
{
const TopoDS_Edge& srcE = TopoDS::Edge( srcMeshDS->IndexToShape( srcNode->getshapeId()));
const TopoDS_Edge& tgtE = TopoDS::Edge( shape2ShapeMap( srcE, /*isSrc=*/true ));
- double srcU = srcHelper.GetNodeU( srcE, srcNode );
+ double srcU = srcHelper->GetNodeU( srcE, srcNode );
tgtMeshDS->SetNodeOnEdge( n, tgtE, srcU );
if ( !tgtFace.IsPartner( srcFace ))
{
tgtNodes[i] = srcN_tgtN->second;
}
// create a new face
- helper.SetElementsOnShape( true );
+ helper->SetElementsOnShape( true );
switch ( nbN )
{
- case 3: helper.AddFace(tgtNodes[0], tgtNodes[tri1], tgtNodes[tri2]); break;
- case 4: helper.AddFace(tgtNodes[0], tgtNodes[quad1], tgtNodes[2], tgtNodes[quad3]); break;
+ case 3: helper->AddFace(tgtNodes[0], tgtNodes[tri1], tgtNodes[tri2]); break;
+ case 4: helper->AddFace(tgtNodes[0], tgtNodes[quad1], tgtNodes[2], tgtNodes[quad3]); break;
default:
if ( isReverse ) std::reverse( tgtNodes.begin(), tgtNodes.end() );
- helper.AddPolygonalFace( tgtNodes );
+ helper->AddPolygonalFace( tgtNodes );
}
}
if ( !tgtFace.IsPartner( srcFace ) )
{
- helper.ToFixNodeParameters( true );
+ helper->ToFixNodeParameters( true );
int nbOkPos = 0;
const double tol2d = 1e-12;
case SMDS_TOP_FACE:
{
if ( nbOkPos > 10 ) break;
- gp_XY uv = helper.GetNodeUV( tgtFace, n ), uvBis = uv;
- if (( helper.CheckNodeUV( tgtFace, n, uv, tol )) &&
+ gp_XY uv = helper->GetNodeUV( tgtFace, n ), uvBis = uv;
+ if (( helper->CheckNodeUV( tgtFace, n, uv, tol )) &&
(( uv - uvBis ).SquareModulus() < tol2d ))
++nbOkPos;
else
//================================================================================
/*!
- * \brief Preform projection in case if the faces are similar in 2D space
+ * \brief Perform projection in case if the faces are similar in 2D space
*/
//================================================================================
SMESHDS_SubMesh* srcSubDS = srcMesh->GetMeshDS()->MeshElements( srcFace );
- SMESH_MesherHelper helper( *tgtMesh );
- helper.SetSubShape( tgtFace );
+ SMESH_MesherHelper* helper = tgtWires[0]->FaceHelper();
if ( is1DComputed )
- helper.IsQuadraticSubMesh( tgtFace );
+ helper->IsQuadraticSubMesh( tgtFace );
else
- helper.SetIsQuadratic( srcSubDS->GetElements()->next()->IsQuadratic() );
- helper.SetElementsOnShape( true );
+ helper->SetIsQuadratic( srcSubDS->GetElements()->next()->IsQuadratic() );
+ helper->SetElementsOnShape( true );
Handle(Geom_Surface) tgtSurface = BRep_Tool::Surface( tgtFace );
SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS();
- SMESH_MesherHelper srcHelper( *srcMesh );
- srcHelper.SetSubShape( srcFace );
+ SMESH_MesherHelper* srcHelper = srcWires[0]->FaceHelper();
const SMDS_MeshNode* nullNode = 0;
TAssocTool::TNodeNodeMap::iterator srcN_tgtN;
while ( elemIt->more() ) // loop on all mesh faces on srcFace
{
const SMDS_MeshElement* elem = elemIt->next();
- const int nbN = elem->NbCornerNodes();
+ const int nbN = elem->NbCornerNodes();
tgtNodes.resize( nbN );
for ( int i = 0; i < nbN; ++i ) // loop on nodes of the source element
{
if ( srcN_tgtN->second == nullNode )
{
// create a new node
- gp_Pnt2d srcUV = srcHelper.GetNodeUV( srcFace, srcNode,
- elem->GetNode( helper.WrapIndex(i+1,nbN)), &uvOK);
+ gp_Pnt2d srcUV = srcHelper->GetNodeUV( srcFace, srcNode,
+ elem->GetNode( helper->WrapIndex(i+1,nbN)), &uvOK);
gp_Pnt2d tgtUV = trsf.Transform( srcUV );
gp_Pnt tgtP = tgtSurface->Value( tgtUV.X(), tgtUV.Y() );
SMDS_MeshNode* n = tgtMeshDS->AddNode( tgtP.X(), tgtP.Y(), tgtP.Z() );
switch ( srcNode->GetPosition()->GetTypeOfPosition() )
{
case SMDS_TOP_FACE: {
- tgtMeshDS->SetNodeOnFace( n, helper.GetSubShapeID(), tgtUV.X(), tgtUV.Y() );
+ tgtMeshDS->SetNodeOnFace( n, helper->GetSubShapeID(), tgtUV.X(), tgtUV.Y() );
break;
}
case SMDS_TOP_EDGE: {
- TopoDS_Shape srcEdge = srcHelper.GetSubShapeByNode( srcNode, srcHelper.GetMeshDS() );
+ TopoDS_Shape srcEdge = srcHelper->GetSubShapeByNode( srcNode, srcHelper->GetMeshDS() );
TopoDS_Edge tgtEdge = TopoDS::Edge( shape2ShapeMap( srcEdge, /*isSrc=*/true ));
double U = Precision::Infinite();
- helper.CheckNodeU( tgtEdge, n, U, Precision::PConfusion());
+ helper->CheckNodeU( tgtEdge, n, U, Precision::PConfusion());
tgtMeshDS->SetNodeOnEdge( n, TopoDS::Edge( tgtEdge ), U );
break;
}
case SMDS_TOP_VERTEX: {
- TopoDS_Shape srcV = srcHelper.GetSubShapeByNode( srcNode, srcHelper.GetMeshDS() );
+ TopoDS_Shape srcV = srcHelper->GetSubShapeByNode( srcNode, srcHelper->GetMeshDS() );
TopoDS_Shape tgtV = shape2ShapeMap( srcV, /*isSrc=*/true );
tgtMeshDS->SetNodeOnVertex( n, TopoDS::Vertex( tgtV ));
break;
// create a new face (with reversed orientation)
switch ( nbN )
{
- case 3: helper.AddFace(tgtNodes[0], tgtNodes[2], tgtNodes[1]); break;
- case 4: helper.AddFace(tgtNodes[0], tgtNodes[3], tgtNodes[2], tgtNodes[1]); break;
+ case 3: helper->AddFace(tgtNodes[0], tgtNodes[2], tgtNodes[1]); break;
+ case 4: helper->AddFace(tgtNodes[0], tgtNodes[3], tgtNodes[2], tgtNodes[1]); break;
}
} // loop on all mesh faces on srcFace
//================================================================================
/*!
- * \brief Preform projection in case of quadrilateral faces
+ * \brief Perform projection in case of quadrilateral faces
*/
//================================================================================
// }
// else
// {
- // // find XY of src node withing the quadrilateral srcFace
+ // // find XY of src node within the quadrilateral srcFace
// if ( !block.ComputeParameters( SMESH_TNodeXYZ( srcNode ),
// tgtNodeOrXY.second, srcFaceBID ))
// return false;
// // as all XY are computed, create tgt nodes and faces
- // SMESH_MesherHelper helper( *tgtMesh );
- // helper.SetSubShape( tgtFace );
+ // SMESH_MesherHelper helper = *tgtWires[0]->FaceHelper();
// if ( is1DComputed )
// helper.IsQuadraticSubMesh( tgtFace );
// else
// helper.SetElementsOnShape( true );
// Handle(Geom_Surface) tgtSurface = BRep_Tool::Surface( tgtFace );
- // SMESH_MesherHelper srcHelper( *srcMesh );
- // srcHelper.SetSubShape( srcFace );
+ // SMESH_MesherHelper srcHelper = *srcWires[0]->FaceHelper();
// vector< const SMDS_MeshNode* > tgtNodes;
// gp_XY uv;
// get ordered src and tgt EDGEs
TSideVector srcWires, tgtWires;
bool is1DComputed = false; // if any tgt EDGE is meshed
- TError err = getWires( tgtFace, srcFace, tgtMesh, srcMesh,
+ TError err = getWires( tgtFace, srcFace, tgtMesh, srcMesh, &helper,
shape2ShapeMap, srcWires, tgtWires, _src2tgtNodes, is1DComputed );
if ( err && !err->IsOK() )
return error( err );
// boundary, also bad face can be created if EDGEs already discretized
// --> fix bad faces by smoothing
// ----------------------------------------------------------------
- if ( helper.IsDistorted2D( tgtSubMesh, /*checkUV=*/false ))
+ if ( helper.IsDistorted2D( tgtSubMesh, /*checkUV=*/false, &helper ))
{
morph( helper, tgtFace, srcFace, tgtWires, srcWires, _src2tgtNodes );
if ( ! ( theDivPoints[0]._iEdge == 0 &&
theDivPoints[0]._edgeParam == 0. )) // recursive call
{
- SMESH_MAT2d::BranchPoint brp( &branch, 0, 0 );
+ SMESH_MAT2d::BranchPoint brp( &branch, 0, 0. );
vector< SMESH_MAT2d::BranchPoint > divPoint( 1, brp );
vector< std::size_t > edgeIDs1(2), edgeIDs2(2);
edgeIDs1[0] = theEdgeIDs1.back();
}
}
- // project theDivPoints
+ // project theDivPoints and keep projections to merge
TMAPar2NPoints::iterator u2NP;
+ vector< TMAPar2NPoints::iterator > projToMerge;
for ( size_t i = 0; i < theDivPoints.size(); ++i )
{
if ( !branch.getParameter( theDivPoints[i], uMA ))
if ( isVertex[0] && isVertex[1] )
continue;
- bool isOppComputed = theIsEdgeComputed[ np[ iNode ]._edgeInd ];
- if ( !isOppComputed )
- continue;
+ // bool isOppComputed = theIsEdgeComputed[ np[ iNode ]._edgeInd ];
+ // if ( isOppComputed )
+ projToMerge.push_back( u2NP );
+ }
+
+ // merge projections
+
+ for ( size_t i = 0; i < projToMerge.size(); ++i )
+ {
+ u2NP = projToMerge[i];
+ const size_t iVert = get( u2NP->second, 0 )._node ? 0 : 1; // side with a VERTEX
+ const size_t iNode = 1 - iVert; // opposite (meshed?) side
// a VERTEX is projected on a meshed EDGE; there are two options:
// 1) a projected point is joined with a closet node if a strip between this and neighbor
bool isShortPrev[2], isShortNext[2], isPrevCloser[2];
TMAPar2NPoints::iterator u2NPPrev = u2NP, u2NPNext = u2NP;
--u2NPPrev; ++u2NPNext;
- // bool hasPrev = ( u2NP != thePointsOnE.begin() );
- // bool hasNext = ( u2NPNext != thePointsOnE.end() );
- // if ( !hasPrev ) u2NPPrev = u2NP0;
- // if ( !hasNext ) u2NPNext = u2NP1;
for ( int iS = 0; iS < 2; ++iS ) // side with Vertex and side with Nodes
{
NodePoint np = get( u2NP->second, iS );
double distNext = p.Distance( pNext );
double r = distPrev / ( distPrev + distNext );
isShortPrev [iS] = ( r < rShort );
- isShortNext [iS] = (( 1 - r ) > ( 1 - rShort ));
- isPrevCloser[iS] = (( r < 0.5 ) && ( u2NPPrev->first > 0 ));
+ isShortNext [iS] = (( 1 - r ) < rShort );
+ isPrevCloser[iS] = (( r < 0.5 ) && ( theSinuFace.IsRing() || u2NPPrev->first > 0 ));
}
- // if ( !hasPrev ) isShortPrev[0] = isShortPrev[1] = false;
- // if ( !hasNext ) isShortNext[0] = isShortNext[1] = false;
TMAPar2NPoints::iterator u2NPClose;
{
u2NPClose = isPrevCloser[0] ? u2NPPrev : u2NPNext;
NodePoint& npProj = get( u2NP->second, iNode ); // NP of VERTEX projection
+ NodePoint& npVert = get( u2NP->second, iVert ); // NP of VERTEX
NodePoint npCloseN = get( u2NPClose->second, iNode ); // NP close to npProj
- NodePoint npCloseV = get( u2NPClose->second, iVert ); // NP close to VERTEX
- if ( !npCloseV._node )
+ NodePoint npCloseV = get( u2NPClose->second, iVert ); // NP close to npVert
+ if ( !npCloseV._node || npCloseV._node == npVert._node )
{
npProj = npCloseN;
- thePointsOnE.erase( isPrevCloser[0] ? u2NPPrev : u2NPNext );
+ thePointsOnE.erase( u2NPClose );
continue;
}
else
{
- // can't remove the neighbor projection as it is also from VERTEX, -> option 1)
+ // can't remove the neighbor projection as it is also from VERTEX -> option 1)
}
}
// else: option 1) - wide enough -> "duplicate" existing node
const SMESH_MAT2d::MedialAxis& theMA,
TMAPar2NPoints & thePointsOnE )
{
+ SMESH_Mesh* mesh = theHelper.GetMesh();
+ SMESHDS_Mesh* meshDS = theHelper.GetMeshDS();
+
list< TopoDS_Edge > ee1( theSinuFace._sinuSide [0].begin(), theSinuFace._sinuSide [0].end() );
list< TopoDS_Edge > ee2( theSinuFace._sinuSide [1].begin(), theSinuFace._sinuSide [1].end() );
- StdMeshers_FaceSide sideOut( theSinuFace.Face(), ee1, theHelper.GetMesh(), true, true );
- StdMeshers_FaceSide sideIn ( theSinuFace.Face(), ee2, theHelper.GetMesh(), true, true );
+ StdMeshers_FaceSide sideOut( theSinuFace.Face(), ee1, mesh, true, true, &theHelper );
+ StdMeshers_FaceSide sideIn ( theSinuFace.Face(), ee2, mesh, true, true, &theHelper );
const UVPtStructVec& uvsOut = sideOut.GetUVPtStruct();
const UVPtStructVec& uvsIn = sideIn.GetUVPtStruct();
// if ( uvs1.size() != uvs2.size() )
const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0);
SMESH_MAT2d::BoundaryPoint bp[2];
SMESH_MAT2d::BranchPoint brp;
- SMESHDS_Mesh* meshDS = theHelper.GetMeshDS();
map< double, const SMDS_MeshNode* > nodeParams; // params of existing nodes
map< double, const SMDS_MeshNode* >::iterator u2n;
for ( int i = 0; i < 4; ++i )
{
theFace._quad->side[i] = StdMeshers_FaceSide::New( face, side[i], mesh, i < QUAD_TOP_SIDE,
- /*skipMediumNodes=*/true, proxyMesh );
+ /*skipMediumNodes=*/true,
+ &theHelper, proxyMesh );
}
if ( theFace.IsRing() )
continue;
StdMeshers_FaceSide side( face, theSinuEdges[i], mesh,
- /*isFwd=*/true, /*skipMediumNodes=*/true );
+ /*isFwd=*/true, /*skipMediumNodes=*/true, &theHelper );
vector<const SMDS_MeshNode*> nodes = side.GetOrderedNodes();
for ( size_t in = 1; in < nodes.size(); ++in )
{
gp_XYZ vert1 = P2.XYZ();
gp_XYZ vert2 = P3.XYZ();
- /* calculate distance from vert0 to ray origin */
- gp_XYZ tvec = orig - vert0;
-
gp_XYZ edge1 = vert1 - vert0;
gp_XYZ edge2 = vert2 - vert0;
/* if determinant is near zero, ray lies in plane of triangle */
double det = edge1 * pvec;
- if (det > -EPSILON && det < EPSILON)
+ const double ANGL_EPSILON = 1e-12;
+ if ( det > -ANGL_EPSILON && det < ANGL_EPSILON )
return false;
+ /* calculate distance from vert0 to ray origin */
+ gp_XYZ tvec = orig - vert0;
+
/* calculate U parameter and test bounds */
double u = ( tvec * pvec ) / det;
//if (u < 0.0 || u > 1.0)
myQuadType(QUAD_STANDARD),
myHelper( NULL )
{
- MESSAGE("StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D");
_name = "Quadrangle_2D";
_shapeType = (1 << TopAbs_FACE);
_compatibleHypothesis.push_back("QuadrangleParams");
StdMeshers_Quadrangle_2D::~StdMeshers_Quadrangle_2D()
{
- MESSAGE("StdMeshers_Quadrangle_2D::~StdMeshers_Quadrangle_2D");
}
//=============================================================================
myNeedSmooth = false;
myCheckOri = false;
- FaceQuadStruct::Ptr quad = CheckNbEdges( aMesh, F, /*considerMesh=*/true );
+ FaceQuadStruct::Ptr quad = CheckNbEdges( aMesh, F, /*considerMesh=*/true, myHelper );
if (!quad)
return false;
myQuadList.clear();
int nbright = (int) uv_e1.size();
int nbleft = (int) uv_e3.size();
- if (quad->nbNodeOut(0) && nbvertic == 2) // this should not occure
+ if (quad->nbNodeOut(0) && nbvertic == 2) // this should not occur
{
// Down edge is out
//
}
// right or left boundary quadrangles
- if (quad->nbNodeOut( QUAD_RIGHT_SIDE ) && nbhoriz == 2) // this should not occure
+ if (quad->nbNodeOut( QUAD_RIGHT_SIDE ) && nbhoriz == 2) // this should not occur
{
int g = 0; // last processed node in the grid
int stop = nbright - 1;
// find node c in the grid, nearest to the b
c = 0;
int near = g;
- if (i == stop - 1) { // up bondary reached
+ if (i == stop - 1) { // up boundary reached
c = quad->uv_grid[nbhoriz*(jup + 1) - 2].node;
near = jup;
} else {
// find node c in the grid, nearest to the b
int near = g;
- if (i == stop + 1) { // down bondary reached
+ if (i == stop + 1) { // down boundary reached
c = quad->uv_grid[nbhoriz*jlow + 1].node;
near = jlow;
}
FaceQuadStruct::Ptr StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
- const bool considerMesh)
+ const bool considerMesh,
+ SMESH_MesherHelper* aFaceHelper)
{
if ( !myQuadList.empty() && myQuadList.front()->face.IsSame( aShape ))
return myQuadList.front();
}
// find corner vertices of the quad
+ myHelper = ( aFaceHelper && aFaceHelper->GetSubShape() == aShape ) ? aFaceHelper : NULL;
vector<TopoDS_Vertex> corners;
int nbDegenEdges, nbSides = getCorners( F, aMesh, edges, corners, nbDegenEdges, considerMesh );
if ( nbSides == 0 )
sideEdges.push_back( *edgeIt++ );
if ( !sideEdges.empty() )
quad->side.push_back( StdMeshers_FaceSide::New(F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
- ignoreMediumNodes, myProxyMesh));
+ ignoreMediumNodes, myHelper, myProxyMesh));
else
--iSide;
}
{
quad->side.push_back
( StdMeshers_FaceSide::New( F, sideEdges, &aMesh, iSide < QUAD_TOP_SIDE,
- ignoreMediumNodes, myProxyMesh ));
+ ignoreMediumNodes, myHelper, myProxyMesh ));
++iSide;
}
if ( quad->side.size() == 4 )
//=======================================================================
//function : ShiftQuad
-//purpose : auxilary function for computeQuadPref
+//purpose : auxiliary function for computeQuadPref
//=======================================================================
void StdMeshers_Quadrangle_2D::shiftQuad(FaceQuadStruct::Ptr& quad, const int num )
//=======================================================================
//function : calcUV
-//purpose : auxilary function for computeQuadPref
+//purpose : auxiliary function for computeQuadPref
//=======================================================================
static gp_UV calcUV(double x0, double x1, double y0, double y1,
//=======================================================================
//function : calcUV2
-//purpose : auxilary function for computeQuadPref
+//purpose : auxiliary function for computeQuadPref
//=======================================================================
static gp_UV calcUV2(double x, double y,
}
int nnn = Min(nr,nl);
- // auxilary sequence of XY for creation nodes
+ // auxiliary sequence of XY for creation nodes
// in the bottom part of central domain
// Length of UVL and UVR must be == nbv-nnn
TColgp_SequenceOfXY UVL, UVR, UVT;
MapShapeNbElems& aResMap,
bool IsQuadratic)
{
- // Auxilary key in order to keep old variant
+ // Auxiliary key in order to keep old variant
// of meshing after implementation new variant
// for bug 0016220 from Mantis.
bool OldVersion = false;
gp_XY a3 (uv_et.front().u, uv_et.front().v);
int nnn = Min(nr,nl);
- // auxilary sequence of XY for creation of nodes
+ // auxiliary sequence of XY for creation of nodes
// in the bottom part of central domain
// it's length must be == nbv-nnn-1
TColgp_SequenceOfXY UVL;
}
}
- // define refernce orientation in 2D
+ // define reference orientation in 2D
TNo2SmooNoMap::iterator n2sn = smooNoMap.begin();
for ( ; n2sn != smooNoMap.end(); ++n2sn )
if ( !n2sn->second._triangles.empty() )
{
TError err;
TSideVector wireVec =
- StdMeshers_FaceSide::GetFaceWires( geomFace, *myHelper->GetMesh(), true, err );
+ StdMeshers_FaceSide::GetFaceWires( geomFace, *myHelper->GetMesh(), true, err, myHelper );
StdMeshers_FaceSidePtr wire = wireVec[0];
// find a right angle VERTEX
theNbDegenEdges = 0;
SMESH_MesherHelper helper( theMesh );
- StdMeshers_FaceSide faceSide( theFace, theWire, &theMesh, /*isFwd=*/true, /*skipMedium=*/true);
+ if ( myHelper )
+ helper.CopySubShapeInfo( *myHelper );
+ StdMeshers_FaceSide faceSide( theFace, theWire, &theMesh,
+ /*isFwd=*/true, /*skipMedium=*/true, &helper );
// sort theVertices by angle
multimap<double, TopoDS_Vertex> vertexByAngle;
// move corners to make sides equal by length
int nbEqualV = equVerts.size();
int nbExcessV = nbEqualV - ( 1 + nbC[0] + nbC[1] );
- if ( nbExcessV > 0 ) // there is nbExcessV vertices that can become corners
+ if ( nbExcessV > 0 ) // there are nbExcessV vertices that can become corners
{
// calculate normalized length of each "side" enclosed between neighbor equVerts
vector< double > accuLength;
if ( iBestEV > iS-1 + nbExcessV )
iBestEV = iS-1 + nbExcessV;
theVertices[ iCorner ] = helper.IthVertex( 0, edgeVec[ evVec[ iBestEV ]]);
+ cornerInd [ iCorner ] = evVec[ iBestEV ];
refinedCorners.insert( evVec[ iBestEV ]);
iCorner = helper.WrapIndex( iCorner + 1, cornerInd.size() );
}
FaceQuadStruct::Ptr CheckNbEdges(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
- const bool considerMesh=false);
+ const bool considerMesh = false,
+ SMESH_MesherHelper* aFaceHelper = 0);
static bool IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll);
SMESH_Mesh* aMesh,
StdMeshers_FaceSidePtr& aCircSide,
StdMeshers_FaceSidePtr& aLinSide1,
- StdMeshers_FaceSidePtr& aLinSide2)
+ StdMeshers_FaceSidePtr& aLinSide2,
+ SMESH_MesherHelper* helper)
{
const TopoDS_Face& face = TopoDS::Face( aShape );
aCircSide.reset(); aLinSide1.reset(); aLinSide2.reset();
StdMeshers_FaceSidePtr side;
if ( aMesh )
side = StdMeshers_FaceSide::New( face, sideEdges, aMesh,
- /*isFwd=*/true, /*skipMedium=*/ true );
+ /*isFwd=*/true, /*skipMedium=*/ true, helper );
sides.push_back( side );
}
edges.push_back( aCircSide->Edge( iE % aCircSide->NbEdges() ));
aCircSide = StdMeshers_FaceSide::New( face, edges, aMesh,
- /*isFwd=*/true, /*skipMedium=*/ true );
+ /*isFwd=*/true, /*skipMedium=*/ true, helper );
}
}
StdMeshers_Quadrangle_2D::myCheckOri = false;
StdMeshers_Quadrangle_2D::myQuadList.clear();
+ myHelper->SetSubShape( aShape );
+ myHelper->SetElementsOnShape( true );
+
StdMeshers_FaceSidePtr circSide, linSide1, linSide2;
- int nbSides = analyseFace( aShape, &aMesh, circSide, linSide1, linSide2 );
+ int nbSides = analyseFace( aShape, &aMesh, circSide, linSide1, linSide2, myHelper );
if( nbSides > 3 || nbSides < 1 )
return error("The face must be a full ellipse or a part of ellipse (i.e. the number "
"of edges is less or equal to 3 and one of them is an ellipse curve)");
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
myHelper->IsQuadraticSubMesh( aShape );
- myHelper->SetElementsOnShape( true );
vector< double > layerPositions; // [0,1]
TopoDS_Edge linEdge = makeEdgeToCenter( circSide, F, circNode );
StdMeshers_FaceSidePtr tmpSide =
- StdMeshers_FaceSide::New( F, linEdge, &aMesh, /*isFrw=*/true, /*skipMedium=*/true );
+ StdMeshers_FaceSide::New( F, linEdge, &aMesh, /*isFrw=*/true, /*skipMedium=*/true, myHelper );
if ( !computeLayerPositions( tmpSide, layerPositions ))
return false;
isVIn0Shared = vIn0.IsSame( circSide->FirstVertex( iE ));
linSide1 = StdMeshers_FaceSide::New( F, edges, &aMesh,
- /*isFrw=*/isVIn0Shared, /*skipMedium=*/true );
+ /*isFrw=*/isVIn0Shared, /*skipMedium=*/true, myHelper );
int nbMeshedEdges;
if ( !computeLayerPositions( linSide1, layerPositions, &nbMeshedEdges ))
TNodeDistributor* algo1d = TNodeDistributor::GetDistributor(aMesh);
StdMeshers_FaceSidePtr circSide, linSide1, linSide2;
- int nbSides = analyseFace( aShape, &aMesh, circSide, linSide1, linSide2 );
+ int nbSides = analyseFace( aShape, &aMesh, circSide, linSide1, linSide2, myHelper );
if( nbSides > 3 || nbSides < 1 )
return false;
TopoDS_Edge linEdge = makeEdgeToCenter( circSide, F, circNode );
StdMeshers_FaceSidePtr tmpSide =
- StdMeshers_FaceSide::New( F, linEdge, &aMesh, /*isFrw=*/true, /*skipMedium=*/true );
+ StdMeshers_FaceSide::New( F, linEdge, &aMesh, /*isFrw=*/true, /*skipMedium=*/true, myHelper );
if ( !computeLayerPositions( tmpSide, layerPositions ))
return false;
for (TopExp_Explorer exp( aShape, TopAbs_FACE ); exp.More(); exp.Next(), ++nbFoundFaces )
{
StdMeshers_FaceSidePtr circSide, linSide1, linSide2;
- int nbSides = analyseFace( exp.Current(), NULL, circSide, linSide1, linSide2 );
+ int nbSides = analyseFace( exp.Current(), NULL, circSide, linSide1, linSide2, NULL );
bool ok = ( 0 < nbSides && nbSides <= 3 &&
isCornerInsideCircle( circSide, linSide1, linSide2 ));
if( toCheckAll && !ok ) return false;
#include "StdMeshers_SegmentLengthAroundVertex.hxx"
#include "StdMeshers_StartEndLength.hxx"
-#include "Utils_SALOME_Exception.hxx"
-#include "utilities.h"
+#include <Utils_SALOME_Exception.hxx>
+#include <utilities.h>
#include <BRepAdaptor_Curve.hxx>
#include <BRep_Tool.hxx>
const TopoDS_Shape& aShape,
Hypothesis_Status& aStatus )
{
- _hypType = NONE;
- _quadraticMesh = false;
+ _hypType = NONE;
+ _quadraticMesh = false;
_onlyUnaryInput = true;
+ // check propagation in a redefined GetUsedHypothesis()
const list <const SMESHDS_Hypothesis * > & hyps =
GetUsedHypothesis(aMesh, aShape, /*ignoreAuxiliaryHyps=*/false);
string hypName = theHyp->GetName();
- if ( hypName == "LocalLength" )
+ if ( !_mainEdge.IsNull() && _hypType == DISTRIB_PROPAGATION )
+ {
+ aStatus = SMESH_Hypothesis::HYP_OK;
+ }
+ else if ( hypName == "LocalLength" )
{
const StdMeshers_LocalLength * hyp =
dynamic_cast <const StdMeshers_LocalLength * >(theHyp);
ASSERT(hyp);
_value[ BEG_LENGTH_IND ] = hyp->GetLength();
- _value[ PRECISION_IND ] = hyp->GetPrecision();
+ _value[ PRECISION_IND ] = hyp->GetPrecision();
ASSERT( _value[ BEG_LENGTH_IND ] > 0 );
_hypType = LOCAL_LENGTH;
aStatus = SMESH_Hypothesis::HYP_OK;
}
if ( theReverse )
theParams.reverse();
+
return true;
}
//================================================================================
/*!
* \brief adjust internal node parameters so that the last segment length == an
- * \param a1 - the first segment length
- * \param an - the last segment length
- * \param U1 - the first edge parameter
- * \param Un - the last edge parameter
- * \param length - the edge length
- * \param C3d - the edge curve
- * \param theParams - internal node parameters to adjust
- * \param adjustNeighbors2an - to adjust length of segments next to the last one
- * and not to remove parameters
+ * \param a1 - the first segment length
+ * \param an - the last segment length
+ * \param U1 - the first edge parameter
+ * \param Un - the last edge parameter
+ * \param length - the edge length
+ * \param C3d - the edge curve
+ * \param theParams - internal node parameters to adjust
+ * \param adjustNeighbors2an - to adjust length of segments next to the last one
+ * and not to remove parameters
*/
//================================================================================
// * \brief Clean mesh on edges
// * \param event - algo_event or compute_event itself (of SMESH_subMesh)
// * \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
-// * \param subMesh - the submesh where the event occures
+// * \param subMesh - the submesh where the event occurs
// */
// void ProcessEvent(const int event, const int eventType, SMESH_subMesh* subMesh,
// EventListenerData*, const SMESH_Hypothesis*)
// Propagation Of Distribution
//
- if ( !_mainEdge.IsNull() && _isPropagOfDistribution )
+ if ( !_mainEdge.IsNull() && _hypType == DISTRIB_PROPAGATION )
{
TopoDS_Edge mainEdge = TopoDS::Edge( _mainEdge ); // should not be a reference!
_gen->Compute( theMesh, mainEdge, SMESH_Gen::SHAPE_ONLY_UPWARD );
// take into account reversing the edge the hypothesis is propagated from
// (_mainEdge.Orientation() marks mutual orientation of EDGEs in propagation chain)
reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
- if ( !_isPropagOfDistribution ) {
+ if ( _hypType != DISTRIB_PROPAGATION ) {
int mainID = meshDS->ShapeToIndex(_mainEdge);
if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end())
reversed = !reversed;
*/
//=============================================================================
-bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh,
+bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh,
const TopoDS_Shape & theShape,
- MapShapeNbElems& aResMap)
+ MapShapeNbElems& theResMap)
{
if ( _hypType == NONE )
return false;
if ( _hypType == ADAPTIVE )
{
_adaptiveHyp->GetAlgo()->InitComputeError();
- _adaptiveHyp->GetAlgo()->Evaluate( theMesh, theShape, aResMap );
+ _adaptiveHyp->GetAlgo()->Evaluate( theMesh, theShape, theResMap );
return error( _adaptiveHyp->GetAlgo()->GetComputeError() );
}
BRepAdaptor_Curve C3d( E );
if ( ! computeInternalParameters( theMesh, C3d, length, f, l, params, false, true )) {
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
- aResMap.insert(std::make_pair(sm,aVec));
+ theResMap.insert(std::make_pair(sm,aVec));
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
return false;
redistributeNearVertices( theMesh, C3d, length, params, VFirst, VLast );
if(_quadraticMesh) {
- aVec[SMDSEntity_Node] = 2*params.size() + 1;
+ aVec[SMDSEntity_Node ] = 2*params.size() + 1;
aVec[SMDSEntity_Quad_Edge] = params.size() + 1;
}
else {
else {
// Edge is a degenerated Edge : We put n = 5 points on the edge.
if ( _quadraticMesh ) {
- aVec[SMDSEntity_Node] = 11;
+ aVec[SMDSEntity_Node ] = 11;
aVec[SMDSEntity_Quad_Edge] = 6;
}
else {
}
}
- SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
- aResMap.insert(std::make_pair(sm,aVec));
+ SMESH_subMesh * sm = theMesh.GetSubMesh( theShape );
+ theResMap.insert( std::make_pair( sm, aVec ));
return true;
}
if (nbHyp == 0 && aShape.ShapeType() == TopAbs_EDGE)
{
// Check, if propagated from some other edge
+ bool isPropagOfDistribution = false;
_mainEdge = StdMeshers_Propagation::GetPropagationSource( aMesh, aShape,
- _isPropagOfDistribution );
+ isPropagOfDistribution );
if ( !_mainEdge.IsNull() )
{
+ if ( isPropagOfDistribution )
+ _hypType = DISTRIB_PROPAGATION;
// Propagation of 1D hypothesis from <aMainEdge> on this edge;
// get non-auxiliary assigned to _mainEdge
nbHyp = aMesh.GetHypotheses( _mainEdge, *compatibleFilter, _usedHypList, true );
StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh,
const TopoDS_Vertex & theV);
- enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, GEOMETRIC_1D, NONE };
+ enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, GEOMETRIC_1D, DISTRIB_PROPAGATION, NONE };
enum ValueIndex {
SCALE_FACTOR_IND = 0,
// a source of propagated hypothesis, is set by CheckHypothesis()
// always called before Compute()
TopoDS_Shape _mainEdge;
- bool _isPropagOfDistribution;
};
#endif
gp_XYZ _normal; // to boundary of solid
vector<gp_XYZ> _pos; // points computed during inflation
- double _len; // length achived with the last inflation step
+ double _len; // length achieved with the last inflation step
double _maxLen; // maximal possible length
double _cosin; // of angle (_normal ^ surface)
double _minAngle; // of _simplices
SMOOTHED_C1 = 0x0000800, // is on _eosC1
DISTORTED = 0x0001000, // was bad before smoothing
RISKY_SWOL = 0x0002000, // SWOL is parallel to a source FACE
- UNUSED_FLAG = 0x0100000
+ SHRUNK = 0x0004000, // target node reached a tgt position while shrink()
+ UNUSED_FLAG = 0x0100000 // to add use flags after
};
bool Is ( int flag ) const { return _flags & flag; }
void Set ( int flag ) { _flags |= flag; }
void Unset( int flag ) { _flags &= ~flag; }
+ std::string DumpFlags() const; // debug
void SetNewLength( double len, _EdgesOnShape& eos, SMESH_MesherHelper& helper );
bool SetNewLength2d( Handle(Geom_Surface)& surface,
{
typedef const StdMeshers_ViscousLayers* THyp;
TopoDS_Shape _solid;
+ TopTools_MapOfShape _before; // SOLIDs to be computed before _solid
TGeomID _index; // SOLID id
_MeshOfSolid* _proxyMesh;
list< THyp > _hyps;
private:
bool findSolidsWithLayers();
+ bool setBefore( _SolidData& solidBefore, _SolidData& solidAfter );
bool findFacesWithLayers(const bool onlyWith=false);
void getIgnoreFaces(const TopoDS_Shape& solid,
const StdMeshers_ViscousLayers* hyp,
_LayerEdge& edge,
const gp_XYZ& newNormal);
bool refine(_SolidData& data);
- bool shrink();
+ bool shrink(_SolidData& data);
bool prepareEdgeToShrink( _LayerEdge& edge, _EdgesOnShape& eos,
SMESH_MesherHelper& helper,
const SMESHDS_SubMesh* faceSubMesh );
const bool is2D,
const int step,
set<const SMDS_MeshNode*> * involvedNodes=NULL);
- bool addBoundaryElements();
+ bool addBoundaryElements(_SolidData& data);
bool error( const string& text, int solidID=-1 );
SMESHDS_Mesh* getMeshDS() const { return _mesh->GetMeshDS(); }
// debug
void makeGroupOfLE();
- SMESH_Mesh* _mesh;
- SMESH_ComputeErrorPtr _error;
+ SMESH_Mesh* _mesh;
+ SMESH_ComputeErrorPtr _error;
- vector< _SolidData > _sdVec;
- int _tmpFaceID;
+ vector< _SolidData > _sdVec;
+ TopTools_IndexedMapOfShape _solids; // to find _SolidData by a solid
+ TopTools_MapOfShape _shrinkedFaces;
+
+ int _tmpFaceID;
};
//--------------------------------------------------------------------------------
/*!
const bool toMakeN2NMap) const
{
using namespace VISCOUS_3D;
- _ViscousBuilder bulder;
- SMESH_ComputeErrorPtr err = bulder.Compute( theMesh, theShape );
+ _ViscousBuilder builder;
+ SMESH_ComputeErrorPtr err = builder.Compute( theMesh, theShape );
if ( err && !err->IsOK() )
return SMESH_ProxyMesh::Ptr();
_ViscousListener::GetSolidMesh( &theMesh, exp.Current(), /*toCreate=*/false))
{
if ( toMakeN2NMap && !pm->_n2nMapComputed )
- if ( !bulder.MakeN2NMap( pm ))
+ if ( !builder.MakeN2NMap( pm ))
return SMESH_ProxyMesh::Ptr();
components.push_back( SMESH_ProxyMesh::Ptr( pm ));
pm->myIsDeletable = false; // it will de deleted by boost::shared_ptr
const TopoDS_Shape& theShape,
SMESH_Hypothesis::Hypothesis_Status& theStatus)
{
- VISCOUS_3D::_ViscousBuilder bulder;
- SMESH_ComputeErrorPtr err = bulder.CheckHypotheses( theMesh, theShape );
+ VISCOUS_3D::_ViscousBuilder builder;
+ SMESH_ComputeErrorPtr err = builder.CheckHypotheses( theMesh, theShape );
if ( err && !err->IsOK() )
theStatus = SMESH_Hypothesis::HYP_INCOMPAT_HYPS;
else
SMESH_ComputeErrorPtr _ViscousBuilder::Compute(SMESH_Mesh& theMesh,
const TopoDS_Shape& theShape)
{
- // TODO: set priority of solids during Gen::Compute()
-
_mesh = & theMesh;
// check if proxy mesh already computed
for ( size_t i = 0; i < _sdVec.size(); ++i )
{
- if ( ! makeLayer(_sdVec[i]) )
+ size_t iSD = 0;
+ for ( iSD = 0; iSD < _sdVec.size(); ++iSD ) // find next SOLID to compute
+ if ( _sdVec[iSD]._before.IsEmpty() &&
+ !_sdVec[iSD]._solid.IsNull() &&
+ _sdVec[iSD]._n2eMap.empty() )
+ break;
+
+ if ( ! makeLayer(_sdVec[iSD]) ) // create _LayerEdge's
return _error;
- if ( _sdVec[i]._n2eMap.size() == 0 )
+ if ( _sdVec[iSD]._n2eMap.size() == 0 ) // no layers in a SOLID
+ {
+ _sdVec[iSD]._solid.Nullify();
continue;
-
- if ( ! inflate(_sdVec[i]) )
+ }
+
+ if ( ! inflate(_sdVec[iSD]) ) // increase length of _LayerEdge's
return _error;
- if ( ! refine(_sdVec[i]) )
+ if ( ! refine(_sdVec[iSD]) ) // create nodes and prisms
return _error;
- }
- if ( !shrink() )
- return _error;
- addBoundaryElements();
+ if ( ! shrink(_sdVec[iSD]) ) // shrink 2D mesh on FACEs w/o layer
+ return _error;
+
+ addBoundaryElements(_sdVec[iSD]); // create quadrangles on prism bare sides
+
+ const TopoDS_Shape& solid = _sdVec[iSD]._solid;
+ for ( iSD = 0; iSD < _sdVec.size(); ++iSD )
+ _sdVec[iSD]._before.Remove( solid );
+ }
makeGroupOfLE(); // debug
debugDump.Finish();
TopExp::MapShapes( _mesh->GetShapeToMesh(), TopAbs_SOLID, allSolids );
_sdVec.reserve( allSolids.Extent());
- SMESH_Gen* gen = _mesh->GetGen();
SMESH_HypoFilter filter;
for ( int i = 1; i <= allSolids.Extent(); ++i )
{
// find StdMeshers_ViscousLayers hyp assigned to the i-th solid
- SMESH_Algo* algo = gen->GetAlgo( *_mesh, allSolids(i) );
+ SMESH_subMesh* sm = _mesh->GetSubMesh( allSolids(i) );
+ if ( sm->GetSubMeshDS() && sm->GetSubMeshDS()->NbElements() > 0 )
+ continue; // solid is already meshed
+ SMESH_Algo* algo = sm->GetAlgo();
if ( !algo ) continue;
// TODO: check if algo is hidden
const list <const SMESHDS_Hypothesis *> & allHyps =
soData->_index = getMeshDS()->ShapeToIndex( allSolids(i));
soData->_helper = new SMESH_MesherHelper( *_mesh );
soData->_helper->SetSubShape( allSolids(i) );
+ _solids.Add( allSolids(i) );
}
soData->_hyps.push_back( viscHyp );
soData->_hypShapes.push_back( hypShape );
//================================================================================
/*!
- * \brief
+ * \brief Set a _SolidData to be computed before another
+ */
+//================================================================================
+
+bool _ViscousBuilder::setBefore( _SolidData& solidBefore, _SolidData& solidAfter )
+{
+ // check possibility to set this order; get all solids before solidBefore
+ TopTools_IndexedMapOfShape allSolidsBefore;
+ allSolidsBefore.Add( solidBefore._solid );
+ for ( int i = 1; i <= allSolidsBefore.Extent(); ++i )
+ {
+ int iSD = _solids.FindIndex( allSolidsBefore(i) );
+ if ( iSD )
+ {
+ TopTools_MapIteratorOfMapOfShape soIt( _sdVec[ iSD-1 ]._before );
+ for ( ; soIt.More(); soIt.Next() )
+ allSolidsBefore.Add( soIt.Value() );
+ }
+ }
+ if ( allSolidsBefore.Contains( solidAfter._solid ))
+ return false;
+
+ for ( int i = 1; i <= allSolidsBefore.Extent(); ++i )
+ solidAfter._before.Add( allSolidsBefore(i) );
+
+ return true;
+}
+
+//================================================================================
+/*!
+ * \brief
*/
//================================================================================
{
SMESH_MesherHelper helper( *_mesh );
TopExp_Explorer exp;
- TopTools_IndexedMapOfShape solids;
// collect all faces-to-ignore defined by hyp
for ( size_t i = 0; i < _sdVec.size(); ++i )
{
- solids.Add( _sdVec[i]._solid );
-
// get faces-to-ignore defined by each hyp
typedef const StdMeshers_ViscousLayers* THyp;
typedef std::pair< set<TGeomID>, THyp > TFacesOfHyp;
}
}
- // Find faces to shrink mesh on (solution 2 in issue 0020832);
+ // Find FACEs to shrink mesh on (solution 2 in issue 0020832): fill in _shrinkShape2Shape
TopTools_IndexedMapOfShape shapes;
+ std::string structAlgoName = "Hexa_3D";
for ( size_t i = 0; i < _sdVec.size(); ++i )
{
shapes.Clear();
for ( int iE = 1; iE <= shapes.Extent(); ++iE )
{
const TopoDS_Shape& edge = shapes(iE);
- // find 2 faces sharing an edge
+ // find 2 FACEs sharing an EDGE
TopoDS_Shape FF[2];
- PShapeIteratorPtr fIt = helper.GetAncestors(edge, *_mesh, TopAbs_FACE);
+ PShapeIteratorPtr fIt = helper.GetAncestors(edge, *_mesh, TopAbs_FACE, &_sdVec[i]._solid);
while ( fIt->more())
{
const TopoDS_Shape* f = fIt->next();
- if ( helper.IsSubShape( *f, _sdVec[i]._solid))
- FF[ int( !FF[0].IsNull()) ] = *f;
+ FF[ int( !FF[0].IsNull()) ] = *f;
}
if( FF[1].IsNull() ) continue; // seam edge can be shared by 1 FACE only
+
// check presence of layers on them
int ignore[2];
for ( int j = 0; j < 2; ++j )
- ignore[j] = _sdVec[i]._ignoreFaceIds.count ( getMeshDS()->ShapeToIndex( FF[j] ));
+ ignore[j] = _sdVec[i]._ignoreFaceIds.count( getMeshDS()->ShapeToIndex( FF[j] ));
if ( ignore[0] == ignore[1] )
continue; // nothing interesting
TopoDS_Shape fWOL = FF[ ignore[0] ? 0 : 1 ];
- // check presence of layers on fWOL within an adjacent SOLID
- bool collision = false;
- PShapeIteratorPtr sIt = helper.GetAncestors( fWOL, *_mesh, TopAbs_SOLID );
- while ( const TopoDS_Shape* solid = sIt->next() )
- if ( !solid->IsSame( _sdVec[i]._solid ))
- {
- int iSolid = solids.FindIndex( *solid );
- int iFace = getMeshDS()->ShapeToIndex( fWOL );
- if ( iSolid > 0 && !_sdVec[ iSolid-1 ]._ignoreFaceIds.count( iFace ))
- {
- //_sdVec[i]._noShrinkShapes.insert( iFace );
- //fWOL.Nullify();
- collision = true;
- }
- }
- // add edge to maps
+
+ // add EDGE to maps
if ( !fWOL.IsNull())
{
TGeomID edgeInd = getMeshDS()->ShapeToIndex( edge );
_sdVec[i]._shrinkShape2Shape.insert( make_pair( edgeInd, fWOL ));
- if ( collision )
- {
- // _shrinkShape2Shape will be used to temporary inflate _LayerEdge's based
- // on the edge but shrink won't be performed
- _sdVec[i]._noShrinkShapes.insert( edgeInd );
- }
}
}
}
- // Exclude from _shrinkShape2Shape FACE's that can't be shrinked since
- // the algo of the SOLID sharing the FACE does not support it
- set< string > notSupportAlgos; notSupportAlgos.insert("Hexa_3D");
- for ( size_t i = 0; i < _sdVec.size(); ++i )
- {
- map< TGeomID, TopoDS_Shape >::iterator e2f = _sdVec[i]._shrinkShape2Shape.begin();
- for ( ; e2f != _sdVec[i]._shrinkShape2Shape.end(); ++e2f )
- {
- const TopoDS_Shape& fWOL = e2f->second;
- const TGeomID edgeID = e2f->first;
- bool notShrinkFace = false;
- PShapeIteratorPtr soIt = helper.GetAncestors(fWOL, *_mesh, TopAbs_SOLID);
- while ( soIt->more() )
- {
- const TopoDS_Shape* solid = soIt->next();
- if ( _sdVec[i]._solid.IsSame( *solid )) continue;
- SMESH_Algo* algo = _mesh->GetGen()->GetAlgo( *_mesh, *solid );
- if ( !algo || !notSupportAlgos.count( algo->GetName() )) continue;
- notShrinkFace = true;
- size_t iSolid = 0;
- for ( ; iSolid < _sdVec.size(); ++iSolid )
- {
- if ( _sdVec[iSolid]._solid.IsSame( *solid ) ) {
- if ( _sdVec[iSolid]._shrinkShape2Shape.count( edgeID ))
- notShrinkFace = false;
- break;
- }
- }
- if ( notShrinkFace )
- {
- _sdVec[i]._noShrinkShapes.insert( edgeID );
-
- // add VERTEXes of the edge in _noShrinkShapes
- TopoDS_Shape edge = getMeshDS()->IndexToShape( edgeID );
- for ( TopoDS_Iterator vIt( edge ); vIt.More(); vIt.Next() )
- _sdVec[i]._noShrinkShapes.insert( getMeshDS()->ShapeToIndex( vIt.Value() ));
-
- // check if there is a collision with to-shrink-from EDGEs in iSolid
- if ( iSolid == _sdVec.size() )
- continue; // no VL in the solid
- shapes.Clear();
- TopExp::MapShapes( fWOL, TopAbs_EDGE, shapes);
- for ( int iE = 1; iE <= shapes.Extent(); ++iE )
- {
- const TopoDS_Edge& E = TopoDS::Edge( shapes( iE ));
- const TGeomID eID = getMeshDS()->ShapeToIndex( E );
- if ( eID == edgeID ||
- !_sdVec[iSolid]._shrinkShape2Shape.count( eID ) ||
- _sdVec[i]._noShrinkShapes.count( eID ))
- continue;
- for ( int is1st = 0; is1st < 2; ++is1st )
- {
- TopoDS_Vertex V = helper.IthVertex( is1st, E );
- if ( _sdVec[i]._noShrinkShapes.count( getMeshDS()->ShapeToIndex( V ) ))
- {
- // _sdVec[i]._noShrinkShapes.insert( eID );
- // V = helper.IthVertex( !is1st, E );
- // _sdVec[i]._noShrinkShapes.insert( getMeshDS()->ShapeToIndex( V ));
- //iE = 0; // re-start the loop on EDGEs of fWOL
- return error("No way to make a conformal mesh with "
- "the given set of faces with layers", _sdVec[i]._index);
- }
- }
- }
- }
-
- } // while ( soIt->more() )
- } // loop on _sdVec[i]._shrinkShape2Shape
- } // loop on _sdVec to fill in _SolidData::_noShrinkShapes
// Find the SHAPE along which to inflate _LayerEdge based on VERTEX
// find faces WOL sharing the vertex
vector< TopoDS_Shape > facesWOL;
size_t totalNbFaces = 0;
- PShapeIteratorPtr fIt = helper.GetAncestors(vertex, *_mesh, TopAbs_FACE);
+ PShapeIteratorPtr fIt = helper.GetAncestors(vertex, *_mesh, TopAbs_FACE, &_sdVec[i]._solid );
while ( fIt->more())
{
const TopoDS_Shape* f = fIt->next();
- if ( helper.IsSubShape( *f, _sdVec[i]._solid ) )
- {
- totalNbFaces++;
- const int fID = getMeshDS()->ShapeToIndex( *f );
- if ( _sdVec[i]._ignoreFaceIds.count ( fID ) /*&&
- !_sdVec[i]._noShrinkShapes.count( fID )*/)
- facesWOL.push_back( *f );
- }
+ totalNbFaces++;
+ const int fID = getMeshDS()->ShapeToIndex( *f );
+ if ( _sdVec[i]._ignoreFaceIds.count ( fID ) /*&& !_sdVec[i]._noShrinkShapes.count( fID )*/)
+ facesWOL.push_back( *f );
}
if ( facesWOL.size() == totalNbFaces || facesWOL.empty() )
continue; // no layers at this vertex or no WOL
}
}
- // add FACEs of other SOLIDs to _ignoreFaceIds
+ // Add to _noShrinkShapes sub-shapes of FACE's that can't be shrinked since
+ // the algo of the SOLID sharing the FACE does not support it or for other reasons
+ set< string > notSupportAlgos; notSupportAlgos.insert( structAlgoName );
+ for ( size_t i = 0; i < _sdVec.size(); ++i )
+ {
+ map< TGeomID, TopoDS_Shape >::iterator e2f = _sdVec[i]._shrinkShape2Shape.begin();
+ for ( ; e2f != _sdVec[i]._shrinkShape2Shape.end(); ++e2f )
+ {
+ const TopoDS_Shape& fWOL = e2f->second;
+ const TGeomID edgeID = e2f->first;
+ TGeomID faceID = getMeshDS()->ShapeToIndex( fWOL );
+ TopoDS_Shape edge = getMeshDS()->IndexToShape( edgeID );
+ if ( edge.ShapeType() != TopAbs_EDGE )
+ continue; // shrink shape is VERTEX
+
+ TopoDS_Shape solid;
+ PShapeIteratorPtr soIt = helper.GetAncestors(fWOL, *_mesh, TopAbs_SOLID);
+ while ( soIt->more() && solid.IsNull() )
+ {
+ const TopoDS_Shape* so = soIt->next();
+ if ( !so->IsSame( _sdVec[i]._solid ))
+ solid = *so;
+ }
+ if ( solid.IsNull() )
+ continue;
+
+ bool noShrinkE = false;
+ SMESH_Algo* algo = _mesh->GetSubMesh( solid )->GetAlgo();
+ bool isStructured = ( algo && algo->GetName() == structAlgoName );
+ size_t iSolid = _solids.FindIndex( solid ) - 1;
+ if ( iSolid < _sdVec.size() && _sdVec[ iSolid ]._ignoreFaceIds.count( faceID ))
+ {
+ // the adjacent SOLID has NO layers on fWOL;
+ // shrink allowed if
+ // - there are layers on the EDGE in the adjacent SOLID
+ // - there are NO layers in the adjacent SOLID && algo is unstructured and computed later
+ bool hasWLAdj = (_sdVec[iSolid]._shrinkShape2Shape.count( edgeID ));
+ bool shrinkAllowed = (( hasWLAdj ) ||
+ ( !isStructured && setBefore( _sdVec[ i ], _sdVec[ iSolid ] )));
+ noShrinkE = !shrinkAllowed;
+ }
+ else if ( iSolid < _sdVec.size() )
+ {
+ // the adjacent SOLID has layers on fWOL;
+ // check if SOLID's mesh is unstructured and then try to set it
+ // to be computed after the i-th solid
+ if ( isStructured || !setBefore( _sdVec[ i ], _sdVec[ iSolid ] ))
+ noShrinkE = true; // don't shrink fWOL
+ }
+ else
+ {
+ // the adjacent SOLID has NO layers at all
+ noShrinkE = isStructured;
+ }
+
+ if ( noShrinkE )
+ {
+ _sdVec[i]._noShrinkShapes.insert( edgeID );
+
+ // check if there is a collision with to-shrink-from EDGEs in iSolid
+ // if ( iSolid < _sdVec.size() )
+ // {
+ // shapes.Clear();
+ // TopExp::MapShapes( fWOL, TopAbs_EDGE, shapes);
+ // for ( int iE = 1; iE <= shapes.Extent(); ++iE )
+ // {
+ // const TopoDS_Edge& E = TopoDS::Edge( shapes( iE ));
+ // const TGeomID eID = getMeshDS()->ShapeToIndex( E );
+ // if ( eID == edgeID ||
+ // !_sdVec[iSolid]._shrinkShape2Shape.count( eID ) ||
+ // _sdVec[i]._noShrinkShapes.count( eID ))
+ // continue;
+ // for ( int is1st = 0; is1st < 2; ++is1st )
+ // {
+ // TopoDS_Vertex V = helper.IthVertex( is1st, E );
+ // if ( _sdVec[i]._noShrinkShapes.count( getMeshDS()->ShapeToIndex( V ) ))
+ // {
+ // return error("No way to make a conformal mesh with "
+ // "the given set of faces with layers", _sdVec[i]._index);
+ // }
+ // }
+ // }
+ // }
+ }
+
+ // add VERTEXes of the edge in _noShrinkShapes, which is necessary if
+ // _shrinkShape2Shape is different in the adjacent SOLID
+ for ( TopoDS_Iterator vIt( edge ); vIt.More(); vIt.Next() )
+ {
+ TGeomID vID = getMeshDS()->ShapeToIndex( vIt.Value() );
+ bool noShrinkV = false;
+
+ if ( iSolid < _sdVec.size() )
+ {
+ if ( _sdVec[ iSolid ]._ignoreFaceIds.count( faceID ))
+ {
+ map< TGeomID, TopoDS_Shape >::iterator i2S, i2SAdj;
+ i2S = _sdVec[i ]._shrinkShape2Shape.find( vID );
+ i2SAdj = _sdVec[iSolid]._shrinkShape2Shape.find( vID );
+ if ( i2SAdj == _sdVec[iSolid]._shrinkShape2Shape.end() )
+ noShrinkV = ( i2S->second.ShapeType() == TopAbs_EDGE || isStructured );
+ else
+ noShrinkV = ( ! i2S->second.IsSame( i2SAdj->second ));
+ }
+ else
+ {
+ noShrinkV = noShrinkE;
+ }
+ }
+ else
+ {
+ // the adjacent SOLID has NO layers at all
+ noShrinkV = ( isStructured ||
+ _sdVec[i]._shrinkShape2Shape[ vID ].ShapeType() == TopAbs_EDGE );
+ }
+ if ( noShrinkV )
+ _sdVec[i]._noShrinkShapes.insert( vID );
+ }
+
+ } // loop on _sdVec[i]._shrinkShape2Shape
+ } // loop on _sdVec to fill in _SolidData::_noShrinkShapes
+
+
+ // add FACEs of other SOLIDs to _ignoreFaceIds
for ( size_t i = 0; i < _sdVec.size(); ++i )
{
shapes.Clear();
//const double tgtThick = /*Min( 0.5 * data._geomSize, */data._maxThickness;
// Find shapes needing smoothing; such a shape has _LayerEdge._normal on it's
- // boundry inclined to the shape at a sharp angle
+ // boundary inclined to the shape at a sharp angle
//list< TGeomID > shapesToSmooth;
TopTools_MapOfShape edgesOfSmooFaces;
//================================================================================
/*!
* \brief Copy data from a _LayerEdge of other SOLID and based on the same node;
- * this and other _LayerEdge's are inflated along a FACE or an EDGE
+ * this and the other _LayerEdge are inflated along a FACE or an EDGE
*/
//================================================================================
const double shapeTgtThick = eos._hyp.GetTotalThickness();
for ( size_t i = 0; i < eos._edges.size(); ++i )
{
- avgThick += Min( 1., eos._edges[i]->_len / shapeTgtThick );
+ if ( eos._edges[i]->_nodes.size() > 1 )
+ avgThick += Min( 1., eos._edges[i]->_len / shapeTgtThick );
+ else
+ avgThick += shapeTgtThick;
nbActiveEdges += ( ! eos._edges[i]->Is( _LayerEdge::BLOCKED ));
}
}
else // edge inflates along a FACE
{
TopoDS_Shape V = helper.GetSubShapeByNode( edge->_nodes[0], getMeshDS() );
- PShapeIteratorPtr eIt = helper.GetAncestors( V, *_mesh, TopAbs_EDGE );
+ PShapeIteratorPtr eIt = helper.GetAncestors( V, *_mesh, TopAbs_EDGE, &eos->_sWOL );
while ( const TopoDS_Shape* E = eIt->next() )
{
- if ( !helper.IsSubShape( *E, /*FACE=*/eos->_sWOL ))
- continue;
gp_Vec edgeDir = getEdgeDir( TopoDS::Edge( *E ), TopoDS::Vertex( V ));
double angle = edgeDir.Angle( newEdge._normal ); // [0,PI]
if ( angle < M_PI / 2 )
const gp_Dir& dir = lastSegment.Direction();
/* calculate distance from vert0 to ray origin */
- gp_XYZ tvec = orig.XYZ() - vert0;
+ //gp_XYZ tvec = orig.XYZ() - vert0;
//if ( tvec * dir > EPSILON )
// intersected face is at back side of the temporary face this _LayerEdge belongs to
if ( det > -ANGL_EPSILON && det < ANGL_EPSILON )
return false;
+ /* calculate distance from vert0 to ray origin */
+ gp_XYZ tvec = orig.XYZ() - vert0;
+
/* calculate U parameter and test bounds */
double u = ( tvec * pvec ) / det;
//if (u < 0.0 || u > 1.0)
{
gp_XYZ newPos(0,0,0);
- // get a plane to seach a solution on
+ // get a plane to search a solution on
vector< gp_XYZ > vecs( _simplices.size() + 1 );
size_t i;
{ ////////////////////////////////// NEW
gp_XYZ newPos(0,0,0);
- // get a plane to seach a solution on
+ // get a plane to search a solution on
size_t i;
gp_XYZ center(0,0,0);
minDist = Min( pSrc.SquareDistance( pTgtN ), minDist );
minDist = Min( pTgt.SquareDistance( pSrcN ), minDist );
double newMaxLen = edge->_maxLen + 0.5 * Sqrt( minDist );
- if ( edge->_nodes[0]->getshapeId() == neibor->_nodes[0]->getshapeId() )
+ //if ( edge->_nodes[0]->getshapeId() == neibor->_nodes[0]->getshapeId() ) viscous_layers_00/A3
{
newMaxLen *= edge->_lenFactor / neibor->_lenFactor;
}
//================================================================================
/*!
- * \brief Create layers of prisms
+ * \brief Print flags
*/
//================================================================================
+std::string _LayerEdge::DumpFlags() const
+{
+ SMESH_Comment dump;
+ for ( int flag = 1; flag < 0x1000000; flag *= 2 )
+ if ( _flags & flag )
+ {
+ EFlags f = (EFlags) flag;
+ switch ( f ) {
+ case TO_SMOOTH: dump << "TO_SMOOTH"; break;
+ case MOVED: dump << "MOVED"; break;
+ case SMOOTHED: dump << "SMOOTHED"; break;
+ case DIFFICULT: dump << "DIFFICULT"; break;
+ case ON_CONCAVE_FACE: dump << "ON_CONCAVE_FACE"; break;
+ case BLOCKED: dump << "BLOCKED"; break;
+ case INTERSECTED: dump << "INTERSECTED"; break;
+ case NORMAL_UPDATED: dump << "NORMAL_UPDATED"; break;
+ case MARKED: dump << "MARKED"; break;
+ case MULTI_NORMAL: dump << "MULTI_NORMAL"; break;
+ case NEAR_BOUNDARY: dump << "NEAR_BOUNDARY"; break;
+ case SMOOTHED_C1: dump << "SMOOTHED_C1"; break;
+ case DISTORTED: dump << "DISTORTED"; break;
+ case RISKY_SWOL: dump << "RISKY_SWOL"; break;
+ case SHRUNK: dump << "SHRUNK"; break;
+ case UNUSED_FLAG: dump << "UNUSED_FLAG"; break;
+ }
+ dump << " ";
+ }
+ cout << dump << endl;
+ return dump;
+}
+
+//================================================================================
+/*!
+ case brief:
+ default:
+*/
+//================================================================================
+
bool _ViscousBuilder::refine(_SolidData& data)
{
SMESH_MesherHelper& helper = data.GetHelper();
set< vector<const SMDS_MeshNode*>* > nnSet;
set< int > degenEdgeInd;
vector<const SMDS_MeshElement*> degenVols;
- vector<int> isRiskySWOL;
TopExp_Explorer exp( data._solid, TopAbs_FACE );
for ( ; exp.More(); exp.Next() )
nnVec.resize( nbNodes );
nnSet.clear();
degenEdgeInd.clear();
- isRiskySWOL.resize( nbNodes );
size_t maxZ = 0, minZ = std::numeric_limits<size_t>::max();
SMDS_NodeIteratorPtr nIt = face->nodeIterator();
for ( int iN = 0; iN < nbNodes; ++iN )
nnVec[ i ] = & edge->_nodes;
maxZ = std::max( maxZ, nnVec[ i ]->size() );
minZ = std::min( minZ, nnVec[ i ]->size() );
- //isRiskySWOL[ i ] = edge->Is( _LayerEdge::RISKY_SWOL );
if ( helper.HasDegeneratedEdges() )
nnSet.insert( nnVec[ i ]);
if ( !err || err->IsOK() )
{
err.reset( new SMESH_ComputeError( COMPERR_WARNING,
- "Degenerated volumes created" ));
+ "Bad quality volumes created" ));
err->myBadElements.insert( err->myBadElements.end(),
degenVols.begin(),degenVols.end() );
}
*/
//================================================================================
-bool _ViscousBuilder::shrink()
+bool _ViscousBuilder::shrink(_SolidData& theData)
{
- // make map of (ids of FACEs to shrink mesh on) to (_SolidData containing _LayerEdge's
- // inflated along FACE or EDGE)
- map< TGeomID, _SolidData* > f2sdMap;
+ // make map of (ids of FACEs to shrink mesh on) to (list of _SolidData containing
+ // _LayerEdge's inflated along FACE or EDGE)
+ map< TGeomID, list< _SolidData* > > f2sdMap;
for ( size_t i = 0 ; i < _sdVec.size(); ++i )
{
_SolidData& data = _sdVec[i];
- TopTools_MapOfShape FFMap;
map< TGeomID, TopoDS_Shape >::iterator s2s = data._shrinkShape2Shape.begin();
for (; s2s != data._shrinkShape2Shape.end(); ++s2s )
- if ( s2s->second.ShapeType() == TopAbs_FACE )
+ if ( s2s->second.ShapeType() == TopAbs_FACE && !_shrinkedFaces.Contains( s2s->second ))
{
- f2sdMap.insert( make_pair( getMeshDS()->ShapeToIndex( s2s->second ), &data ));
+ f2sdMap[ getMeshDS()->ShapeToIndex( s2s->second )].push_back( &data );
- if ( FFMap.Add( (*s2s).second ))
- // Put mesh faces on the shrinked FACE to the proxy sub-mesh to avoid
- // usage of mesh faces made in addBoundaryElements() by the 3D algo or
- // by StdMeshers_QuadToTriaAdaptor
- if ( SMESHDS_SubMesh* smDS = getMeshDS()->MeshElements( s2s->second ))
+ // Put mesh faces on the shrinked FACE to the proxy sub-mesh to avoid
+ // usage of mesh faces made in addBoundaryElements() by the 3D algo or
+ // by StdMeshers_QuadToTriaAdaptor
+ if ( SMESHDS_SubMesh* smDS = getMeshDS()->MeshElements( s2s->second ))
+ {
+ SMESH_ProxyMesh::SubMesh* proxySub =
+ data._proxyMesh->getFaceSubM( TopoDS::Face( s2s->second ), /*create=*/true);
+ if ( proxySub->NbElements() == 0 )
{
- SMESH_ProxyMesh::SubMesh* proxySub =
- data._proxyMesh->getFaceSubM( TopoDS::Face( s2s->second ), /*create=*/true);
SMDS_ElemIteratorPtr fIt = smDS->GetElements();
while ( fIt->more() )
- proxySub->AddElement( fIt->next() );
- // as a result 3D algo will use elements from proxySub and not from smDS
+ {
+ const SMDS_MeshElement* f = fIt->next();
+ // as a result 3D algo will use elements from proxySub and not from smDS
+ proxySub->AddElement( f );
+ f->setIsMarked( true );
+
+ // Mark nodes on the FACE to discriminate them from nodes
+ // added by addBoundaryElements(); marked nodes are to be smoothed while shrink()
+ for ( int iN = 0, nbN = f->NbNodes(); iN < nbN; ++iN )
+ {
+ const SMDS_MeshNode* n = f->GetNode( iN );
+ if ( n->GetPosition()->GetDim() == 2 )
+ n->setIsMarked( true );
+ }
+ }
}
+ }
}
}
SMESH_MesherHelper helper( *_mesh );
helper.ToFixNodeParameters( true );
- // EDGE's to shrink
+ // EDGEs to shrink
map< TGeomID, _Shrinker1D > e2shrMap;
vector< _EdgesOnShape* > subEOS;
vector< _LayerEdge* > lEdges;
- // loop on FACES to srink mesh on
- map< TGeomID, _SolidData* >::iterator f2sd = f2sdMap.begin();
+ // loop on FACEs to srink mesh on
+ map< TGeomID, list< _SolidData* > >::iterator f2sd = f2sdMap.begin();
for ( ; f2sd != f2sdMap.end(); ++f2sd )
{
- _SolidData& data = *f2sd->second;
+ list< _SolidData* > & dataList = f2sd->second;
+ if ( dataList.front()->_n2eMap.empty() ||
+ dataList.back() ->_n2eMap.empty() )
+ continue; // not yet computed
+ if ( dataList.front() != &theData &&
+ dataList.back() != &theData )
+ continue;
+
+ _SolidData& data = *dataList.front();
+ _SolidData* data2 = dataList.size() > 1 ? dataList.back() : 0;
const TopoDS_Face& F = TopoDS::Face( getMeshDS()->IndexToShape( f2sd->first ));
SMESH_subMesh* sm = _mesh->GetSubMesh( F );
SMESHDS_SubMesh* smDS = sm->GetSubMeshDS();
- Handle(Geom_Surface) surface = BRep_Tool::Surface(F);
+ Handle(Geom_Surface) surface = BRep_Tool::Surface( F );
- helper.SetSubShape(F);
+ _shrinkedFaces.Add( F );
+ helper.SetSubShape( F );
// ===========================
// Prepare data for shrinking
// ===========================
- // Collect nodes to smooth, as src nodes are not yet replaced by tgt ones
- // and hence all nodes on a FACE connected to 2d elements are to be smoothed
+ // Collect nodes to smooth (they are marked at the beginning of this method)
vector < const SMDS_MeshNode* > smoothNodes;
{
SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
while ( nIt->more() )
{
const SMDS_MeshNode* n = nIt->next();
- if ( n->NbInverseElements( SMDSAbs_Face ) > 0 )
+ if ( n->isMarked() )
smoothNodes.push_back( n );
}
}
{
vector<_Simplex> simplices;
_Simplex::GetSimplices( smoothNodes[0], simplices, ignoreShapes );
- helper.GetNodeUV( F, simplices[0]._nPrev, 0, &isOkUV ); // fix UV of silpmex nodes
+ helper.GetNodeUV( F, simplices[0]._nPrev, 0, &isOkUV ); // fix UV of simplex nodes
helper.GetNodeUV( F, simplices[0]._nNext, 0, &isOkUV );
gp_XY uv = helper.GetNodeUV( F, smoothNodes[0], 0, &isOkUV );
- if ( !simplices[0].IsForward(uv, smoothNodes[0], F, helper,refSign) )
+ if ( !simplices[0].IsForward(uv, smoothNodes[0], F, helper, refSign ))
refSign = -1;
}
if ( data._noShrinkShapes.count( subID ))
continue;
_EdgesOnShape* eos = data.GetShapeEdges( subID );
- if ( !eos || eos->_sWOL.IsNull() ) continue;
-
+ if ( !eos || eos->_sWOL.IsNull() )
+ if ( data2 ) // check in adjacent SOLID
+ {
+ eos = data2->GetShapeEdges( subID );
+ if ( !eos || eos->_sWOL.IsNull() )
+ continue;
+ }
subEOS.push_back( eos );
for ( size_t i = 0; i < eos->_edges.size(); ++i )
while ( fIt->more() )
{
const SMDS_MeshElement* f = fIt->next();
- if ( !smDS->Contains( f ))
+ if ( !smDS->Contains( f ) || !f->isMarked() )
continue;
SMDS_NodeIteratorPtr nIt = f->nodeIterator();
for ( int iN = 0; nIt->more(); ++iN )
{
const SMDS_MeshNode* n = smoothNodes[i];
nodesToSmooth[ i ]._node = n;
- // src nodes must be replaced by tgt nodes to have tgt nodes in _simplices
+ // src nodes must be already replaced by tgt nodes to have tgt nodes in _simplices
_Simplex::GetSimplices( n, nodesToSmooth[ i ]._simplices, ignoreShapes, 0, sortSimplices);
// fix up incorrect uv of nodes on the FACE
helper.GetNodeUV( F, n, 0, &isOkUV);
{
_LayerEdge& edge = * eos._edges[i];
_Simplex::GetSimplices( /*tgtNode=*/edge._nodes.back(), edge._simplices, ignoreShapes );
+
+ // additionally mark tgt node; only marked nodes will be used in SetNewLength2d()
+ // not-marked nodes are those added by refine()
+ edge._nodes.back()->setIsMarked( true );
}
}
}
if ( !errMsg.empty() ) // Try to re-compute the shrink FACE
{
+ debugMsg( "Re-compute FACE " << f2sd->first << " because " << errMsg );
+
// remove faces
SMESHDS_SubMesh* psm = data._proxyMesh->getFaceSubM( F );
{
{
_LayerEdge* edge = subEOS[iS]->_edges[i];
SMDS_MeshNode* tgtNode = const_cast< SMDS_MeshNode*& >( edge->_nodes.back() );
- if ( edge->_pos.empty() ) continue;
+ if ( edge->_pos.empty() ||
+ edge->Is( _LayerEdge::SHRUNK )) continue;
if ( subEOS[iS]->SWOLType() == TopAbs_FACE )
{
SMDS_FacePosition* pos = static_cast<SMDS_FacePosition*>( tgtNode->GetPosition() );
// Set an event listener to clear FACE sub-mesh together with SOLID sub-mesh
VISCOUS_3D::ToClearSubWithMain( sm, data._solid );
+ if ( data2 )
+ VISCOUS_3D::ToClearSubWithMain( sm, data2->_solid );
} // loop on FACES to srink mesh on
if ( tgtNode->GetPosition()->GetDim() != 2 ) // not inflated edge
{
edge._pos.clear();
+ edge.Set( _LayerEdge::SHRUNK );
return srcNode == tgtNode;
}
gp_XY srcUV ( edge._pos[0].X(), edge._pos[0].Y() ); //helper.GetNodeUV( F, srcNode );
edge._normal.SetCoord( uvDir.X(),uvDir.Y(), 0 );
edge._len = uvLen;
- edge._pos.resize(1);
+ //edge._pos.resize(1);
edge._pos[0].SetCoord( tgtUV.X(), tgtUV.Y(), 0 );
// set UV of source node to target node
if ( tgtNode->GetPosition()->GetDim() != 1 ) // not inflated edge
{
edge._pos.clear();
+ edge.Set( _LayerEdge::SHRUNK );
return srcNode == tgtNode;
}
const TopoDS_Edge& E = TopoDS::Edge( eos._sWOL );
double uSrc = helper.GetNodeU( E, srcNode, n2 );
double uTgt = helper.GetNodeU( E, tgtNode, srcNode );
- double u2 = helper.GetNodeU( E, n2, srcNode );
+ double u2 = helper.GetNodeU( E, n2, srcNode );
- edge._pos.clear();
+ //edge._pos.clear();
if ( fabs( uSrc-uTgt ) < 0.99 * fabs( uSrc-u2 ))
{
// tgtNode is located so that it does not make faces with wrong orientation
+ edge.Set( _LayerEdge::SHRUNK );
return true;
}
- edge._pos.resize(1);
+ //edge._pos.resize(1);
edge._pos[0].SetCoord( U_TGT, uTgt );
edge._pos[0].SetCoord( U_SRC, uSrc );
edge._pos[0].SetCoord( LEN_TGT, fabs( uSrc-uTgt ));
_EdgesOnShape& eos,
SMESH_MesherHelper& helper )
{
- if ( _pos.empty() )
+ if ( Is( SHRUNK ))
return false; // already at the target position
SMDS_MeshNode* tgtNode = const_cast< SMDS_MeshNode*& >( _nodes.back() );
double stepSize = 1e100;
for ( size_t i = 0; i < _simplices.size(); ++i )
{
+ if ( !_simplices[i]._nPrev->isMarked() ||
+ !_simplices[i]._nNext->isMarked() )
+ continue; // simplex of quadrangle created by addBoundaryElements()
+
// find intersection of 2 lines: curUV-tgtUV and that connecting simplex nodes
gp_XY uvN1 = helper.GetNodeUV( F, _simplices[i]._nPrev );
gp_XY uvN2 = helper.GetNodeUV( F, _simplices[i]._nNext );
if ( uvLen <= stepSize )
{
newUV = tgtUV;
- _pos.clear();
+ Set( SHRUNK );
+ //_pos.clear();
}
else if ( stepSize > 0 )
{
double newU = _pos[0].Coord( U_TGT );
if ( lenTgt < 0.99 * fabs( uSrc-u2 )) // n2 got out of src-tgt range
{
- _pos.clear();
+ Set( _LayerEdge::SHRUNK );
+ //_pos.clear();
}
else
{
_done = false;
}
// check _LayerEdge
- if ( e == _edges[0] || e == _edges[1] )
+ if ( e == _edges[0] || e == _edges[1] || e->_nodes.size() < 2 )
return;
if ( eos.SWOLType() != TopAbs_EDGE )
throw SALOME_Exception(LOCALIZED("Wrong _LayerEdge is added"));
while ( nIt->more() )
{
const SMDS_MeshNode* node = nIt->next();
+
+ // skip refinement nodes
if ( node->NbInverseElements(SMDSAbs_Edge) == 0 ||
node == tgtNode0 || node == tgtNode1 )
- continue; // refinement nodes
+ continue;
+ bool hasMarkedFace = false;
+ SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator(SMDSAbs_Face);
+ while ( fIt->more() && !hasMarkedFace )
+ hasMarkedFace = fIt->next()->isMarked();
+ if ( !hasMarkedFace )
+ continue;
+
_nodes.push_back( node );
_initU.push_back( helper.GetNodeU( _geomEdge, node ));
double len = GCPnts_AbscissaPoint::Length(aCurve, f, _initU.back());
if ( !e ) e = _edges[1];
if ( !e ) return;
- _done = (( !_edges[0] || _edges[0]->_pos.empty() ) &&
- ( !_edges[1] || _edges[1]->_pos.empty() ));
+ _done = (( !_edges[0] || _edges[0]->Is( _LayerEdge::SHRUNK )) &&
+ ( !_edges[1] || _edges[1]->Is( _LayerEdge::SHRUNK )));
double f,l;
if ( set3D || _done )
if ( !eSubMesh ) return;
const SMDS_MeshNode* srcNode = _edges[i]->_nodes[0];
const SMDS_MeshNode* tgtNode = _edges[i]->_nodes.back();
+ const SMDS_MeshNode* scdNode = _edges[i]->_nodes[1];
SMDS_ElemIteratorPtr eIt = srcNode->GetInverseElementIterator(SMDSAbs_Edge);
while ( eIt->more() )
{
const SMDS_MeshElement* e = eIt->next();
- if ( !eSubMesh->Contains( e ))
+ if ( !eSubMesh->Contains( e ) || e->GetNodeIndex( scdNode ) >= 0 )
continue;
SMDS_ElemIteratorPtr nIt = e->nodesIterator();
for ( int iN = 0; iN < e->NbNodes(); ++iN )
*/
//================================================================================
-bool _ViscousBuilder::addBoundaryElements()
+bool _ViscousBuilder::addBoundaryElements(_SolidData& data)
{
SMESH_MesherHelper helper( *_mesh );
vector< const SMDS_MeshNode* > faceNodes;
- for ( size_t i = 0; i < _sdVec.size(); ++i )
+ //for ( size_t i = 0; i < _sdVec.size(); ++i )
{
- _SolidData& data = _sdVec[i];
+ //_SolidData& data = _sdVec[i];
TopTools_IndexedMapOfShape geomEdges;
TopExp::MapShapes( data._solid, TopAbs_EDGE, geomEdges );
for ( int iE = 1; iE <= geomEdges.Extent(); ++iE )
{
const TopoDS_Edge& E = TopoDS::Edge( geomEdges(iE));
- if ( data._noShrinkShapes.count( getMeshDS()->ShapeToIndex( E )))
+ const TGeomID edgeID = getMeshDS()->ShapeToIndex( E );
+ if ( data._noShrinkShapes.count( edgeID ))
continue;
// Get _LayerEdge's based on E
// Find out orientation and type of face to create
bool reverse = false, isOnFace;
-
- map< TGeomID, TopoDS_Shape >::iterator e2f =
- data._shrinkShape2Shape.find( getMeshDS()->ShapeToIndex( E ));
TopoDS_Shape F;
+
+ map< TGeomID, TopoDS_Shape >::iterator e2f = data._shrinkShape2Shape.find( edgeID );
if (( isOnFace = ( e2f != data._shrinkShape2Shape.end() )))
{
F = e2f->second.Oriented( TopAbs_FORWARD );
if ( helper.IsReversedSubMesh( TopoDS::Face(F) ))
reverse = !reverse;
}
- else
+ else if ( !data._ignoreFaceIds.count( e2f->first ))
{
// find FACE with layers sharing E
- PShapeIteratorPtr fIt = helper.GetAncestors( E, *_mesh, TopAbs_FACE );
- while ( fIt->more() && F.IsNull() )
- {
- const TopoDS_Shape* pF = fIt->next();
- if ( helper.IsSubShape( *pF, data._solid) &&
- !data._ignoreFaceIds.count( e2f->first ))
- F = *pF;
- }
+ PShapeIteratorPtr fIt = helper.GetAncestors( E, *_mesh, TopAbs_FACE, &data._solid );
+ if ( fIt->more() )
+ F = *( fIt->next() );
}
// Find the sub-mesh to add new faces
SMESHDS_SubMesh* sm = 0;
if ( !sm )
return error("error in addBoundaryElements()", data._index);
+ // Find a proxy sub-mesh of the FACE of an adjacent SOLID, which will use the new boundary
+ // faces for 3D meshing (PAL23414)
+ SMESHDS_SubMesh* adjSM = 0;
+ if ( isOnFace )
+ {
+ const TGeomID faceID = sm->GetID();
+ PShapeIteratorPtr soIt = helper.GetAncestors( F, *_mesh, TopAbs_SOLID );
+ while ( const TopoDS_Shape* solid = soIt->next() )
+ if ( !solid->IsSame( data._solid ))
+ {
+ size_t iData = _solids.FindIndex( *solid ) - 1;
+ if ( iData < _sdVec.size() &&
+ _sdVec[ iData ]._ignoreFaceIds.count( faceID ) &&
+ _sdVec[ iData ]._shrinkShape2Shape.count( edgeID ) == 0 )
+ {
+ SMESH_ProxyMesh::SubMesh* proxySub =
+ _sdVec[ iData ]._proxyMesh->getFaceSubM( TopoDS::Face( F ), /*create=*/false);
+ if ( proxySub && proxySub->NbElements() > 0 )
+ adjSM = proxySub;
+ }
+ }
+ }
+
// Make faces
const int dj1 = reverse ? 0 : 1;
const int dj2 = reverse ? 1 : 0;
+ vector< const SMDS_MeshElement*> ff; // new faces row
+ SMESHDS_Mesh* m = getMeshDS();
for ( size_t j = 1; j < ledges.size(); ++j )
{
vector< const SMDS_MeshNode*>& nn1 = ledges[j-dj1]->_nodes;
vector< const SMDS_MeshNode*>& nn2 = ledges[j-dj2]->_nodes;
+ ff.resize( std::max( nn1.size(), nn2.size() ), NULL );
if ( nn1.size() == nn2.size() )
{
if ( isOnFace )
for ( size_t z = 1; z < nn1.size(); ++z )
- sm->AddElement( getMeshDS()->AddFace( nn1[z-1], nn2[z-1], nn2[z], nn1[z] ));
+ sm->AddElement( ff[z-1] = m->AddFace( nn1[z-1], nn2[z-1], nn2[z], nn1[z] ));
else
for ( size_t z = 1; z < nn1.size(); ++z )
sm->AddElement( new SMDS_FaceOfNodes( nn1[z-1], nn2[z-1], nn2[z], nn1[z] ));
{
if ( isOnFace )
for ( size_t z = 1; z < nn2.size(); ++z )
- sm->AddElement( getMeshDS()->AddFace( nn1[0], nn2[z-1], nn2[z] ));
+ sm->AddElement( ff[z-1] = m->AddFace( nn1[0], nn2[z-1], nn2[z] ));
else
for ( size_t z = 1; z < nn2.size(); ++z )
sm->AddElement( new SMDS_FaceOfNodes( nn1[0], nn2[z-1], nn2[z] ));
{
if ( isOnFace )
for ( size_t z = 1; z < nn1.size(); ++z )
- sm->AddElement( getMeshDS()->AddFace( nn1[z-1], nn2[0], nn1[z] ));
+ sm->AddElement( ff[z-1] = m->AddFace( nn1[z-1], nn2[0], nn1[z] ));
else
for ( size_t z = 1; z < nn1.size(); ++z )
sm->AddElement( new SMDS_FaceOfNodes( nn1[z-1], nn2[0], nn2[z] ));
}
+
+ if ( adjSM ) // add faces to a proxy SM of the adjacent SOLID
+ {
+ for ( size_t z = 0; z < ff.size(); ++z )
+ if ( ff[ z ])
+ adjSM->AddElement( ff[ z ]);
+ ff.clear();
+ }
}
// Make edges
if ( eos && eos->SWOLType() == TopAbs_EDGE )
{
vector< const SMDS_MeshNode*>& nn = edge->_nodes;
- if ( nn.size() < 2 || nn[1]->GetInverseElementIterator( SMDSAbs_Edge )->more() )
+ if ( nn.size() < 2 || nn[1]->NbInverseElements( SMDSAbs_Edge ) >= 2 )
continue;
helper.SetSubShape( eos->_sWOL );
helper.SetElementsOnShape( true );
VISCOUS_2D::_ViscousBuilder2D builder( theMesh, face, hyps, hypShapes );
builder._faceSideVec =
StdMeshers_FaceSide::GetFaceWires( face, theMesh, true, error,
- SMESH_ProxyMesh::Ptr(),
+ NULL, SMESH_ProxyMesh::Ptr(),
/*theCheckVertexNodes=*/false);
if ( error->IsOK() && !builder.findEdgesWithLayers())
{
SMESH_ProxyMesh::Ptr _ViscousBuilder2D::Compute()
{
- _faceSideVec = StdMeshers_FaceSide::GetFaceWires( _face, *_mesh, true, _error);
+ _faceSideVec = StdMeshers_FaceSide::GetFaceWires( _face, *_mesh, true, _error, &_helper );
if ( !_error->IsOK() )
return _proxyMesh;
if ( isR )
LR._lEdges.erase( LR._lEdges.begin()+1, eIt );
else
- LL._lEdges.erase( eIt, --LL._lEdges.end() );
+ LL._lEdges.erase( eIt+1, --LL._lEdges.end() );
// eIt = isR ? L._lEdges.begin()+1 : L._lEdges.end()-2;
// for ( size_t i = 1; i < iLE; ++i, eIt += dIt )
// eIt->_isBlocked = true;
}
} // loop on FACEs sharing E
+ // Check if L is an already shrinked seam
+ if ( adjFace.IsNull() && _helper.IsRealSeam( edgeID ))
+ if ( L._wire->Edge( L._edgeInd ).Orientation() == TopAbs_FORWARD )
+ continue;
// Commented as a case with a seam EDGE (issue 0052461) is hard to support
// because SMESH_ProxyMesh can't hold different sub-meshes for two
// 2D representations of the seam. But such a case is not a real practice one.
- // Check if L is an already shrinked seam
- // if ( adjFace.IsNull() && _helper.IsRealSeam( edgeID ))
// {
// for ( int iL2 = iL1-1; iL2 > -1; --iL2 )
// {
vector< double > segLen( L._lEdges.size() );
segLen[0] = 0.0;
- // check if length modification is usefull: look for _LayerEdge's
+ // check if length modification is useful: look for _LayerEdge's
// with length limited due to collisions
bool lenLimited = false;
for ( size_t iLE = 1; ( iLE < L._lEdges.size()-1 && !lenLimited ); ++iLE )
nodeDataVec.front().param = L._wire->FirstU( L._edgeInd );
nodeDataVec.back() .param = L._wire->LastU ( L._edgeInd );
+ if (( nodeDataVec[0].node == nodeDataVec.back().node ) &&
+ ( _helper.GetPeriodicIndex() == 1 || _helper.GetPeriodicIndex() == 2 )) // closed EDGE
+ {
+ const int iCoord = _helper.GetPeriodicIndex();
+ gp_XY uv = nodeDataVec[0].UV();
+ uv.SetCoord( iCoord, L._lEdges[0]._uvOut.Coord( iCoord ));
+ nodeDataVec[0].SetUV( uv );
+
+ uv = nodeDataVec.back().UV();
+ uv.SetCoord( iCoord, L._lEdges.back()._uvOut.Coord( iCoord ));
+ nodeDataVec.back().SetUV( uv );
+ }
+
_ProxyMeshOfFace::_EdgeSubMesh* edgeSM
= getProxyMesh()->GetEdgeSubMesh( L._wire->EdgeID( L._edgeInd ));
edgeSM->SetUVPtStructVec( nodeDataVec );
//================================================================================
/*!
- * \brief Tranfer parameters from hypothesis to widgets
+ * \brief Transfer parameters from hypothesis to widgets
*/
//================================================================================
//================================================================================
/*!
- * \brief Tranfer parameters from widgets to hypothesis
+ * \brief Transfer parameters from widgets to hypothesis
*/
//================================================================================
argMinimum( int r ) const
{
// for the first row the minimum value is always 0.0
- // for the other rows the minumum value is the above row's value
+ // for the other rows the minimum value is the above row's value
double val = 0.0;
if ( r > 0 && r < rowCount() )
val = value( r-1, ArgColumn );
argMaximum( int r ) const
{
// for the last row the maximum value is always 1.0
- // for the other rows the maxumum value is the below row's value
+ // for the other rows the maximum value is the below row's value
double val = 1.0;
if ( r >= 0 && r < rowCount()-1 ) {
val = value( r+1, ArgColumn );
//================================================================================
/*!
- * \brief Creates a given nubmer of button labels with given labels (QString's)
+ * \brief Creates a given number of button labels with given labels (QString's)
*/
//================================================================================
#include <SALOME_ListIO.hxx>
#include <SUIT_OverrideCursor.h>
#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
#include <SVTK_Selector.h>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
StdMeshersGUI_SubShapeSelectorWdg
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent,
TopAbs_ShapeEnum subShType,
- const bool toShowList ):
+ const bool toShowList,
+ const bool toShowActivateBtn ):
QWidget( parent ),
myMaxSize( -1 ),
myPreviewActor( 0 )
{
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
- QGridLayout* edgesLayout = new QGridLayout( this );
- edgesLayout->setMargin( MARGIN );
- edgesLayout->setSpacing( SPACING );
+ QGridLayout* layout = new QGridLayout( this );
+ layout->setMargin( MARGIN );
+ layout->setSpacing( SPACING );
if ( toShowList )
{
- myListWidget = new QListWidget( this );
- myAddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), this );
- myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );
+ QPixmap iconSelect (SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+ myListWidget = new QListWidget( this );
+ myActivateButton = new QPushButton( iconSelect, "", this );
+ myAddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), this );
+ myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );
myListWidget->setSelectionMode( QListWidget::ExtendedSelection );
myListWidget->setMinimumWidth(300);
+ myListWidget->setWrapping(true);
+ myActivateButton->setCheckable( true );
}
else
{
- myListWidget = 0;
- myAddButton = 0;
- myRemoveButton = 0;
+ myListWidget = 0;
+ myActivateButton = 0;
+ myAddButton = 0;
+ myRemoveButton = 0;
}
myInfoLabel = new QLabel( this );
myPrevButton = new QPushButton( "<<", this );
if ( myListWidget )
{
- edgesLayout->addWidget(myListWidget, 0, 0, 3, 3);
- edgesLayout->addWidget(myAddButton, 0, 3);
- edgesLayout->addWidget(myRemoveButton, 1, 3);
- edgesLayout->addWidget(myInfoLabel, 3, 0, 1, 3);
- edgesLayout->addWidget(myPrevButton, 4, 0);
- edgesLayout->addWidget(myNextButton, 4, 2);
-
- edgesLayout->setRowStretch(2, 5);
- edgesLayout->setColumnStretch(1, 5);
+ int row = 0;
+ layout->addWidget(myListWidget, row, 0, 3+toShowActivateBtn, 3);
+ if ( toShowActivateBtn )
+ layout->addWidget( myActivateButton, row++, 3 );
+ else
+ myActivateButton->hide();
+ layout->addWidget(myAddButton, row, 3);
+ layout->addWidget(myRemoveButton, ++row, 3);
+ ++row;
+ layout->addWidget(myInfoLabel, ++row, 0, 1, 3);
+ layout->addWidget(myPrevButton, ++row, 0);
+ layout->addWidget(myNextButton, row, 2);
+
+ layout->setRowStretch(row-2, 5);
+ layout->setColumnStretch(1, 5);
}
else // show only Prev and Next buttons
{
- edgesLayout->addWidget(myInfoLabel, 0, 0, 1, 2);
- edgesLayout->addWidget(myPrevButton, 1, 0);
- edgesLayout->addWidget(myNextButton, 1, 1);
+ layout->addWidget(myInfoLabel, 0, 0, 1, 2);
+ layout->addWidget(myPrevButton, 1, 0);
+ layout->addWidget(myNextButton, 1, 1);
}
//myInfoLabel->setMinimumWidth(300);
//myInfoLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
myRemoveButton->setEnabled( false );
connect( myListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
+ connect( myActivateButton, SIGNAL( toggled(bool) ), SLOT( ActivateSelection(bool)));
connect( myAddButton, SIGNAL(clicked()), SLOT(onAdd()));
connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
}
void StdMeshersGUI_SubShapeSelectorWdg::ActivateSelection( bool toActivate )
{
+ // adjust state of myActivateButton
+ if ( myActivateButton &&
+ myActivateButton != sender() &&
+ myActivateButton->isChecked() != toActivate )
+ {
+ myActivateButton->toggle();
+ return;
+ }
+
if ( !mySelectionMgr ) return;
if ( toActivate )
{
disconnect(mySelectionMgr, 0, this, 0 );
}
+
+ if ( sender() == myActivateButton )
+ ShowPreview( toActivate );
}
//================================================================================
myAddButton->setEnabled(( myListWidget->count() < myMaxSize || myMaxSize == -1 ) &&
( mySelectedIDs.size() > 0 ) &&
( mySelectedIDs.size() <= myMaxSize || myMaxSize == -1 ) );
+ myRemoveButton->setEnabled( mySelectedIDs.size() > 0 );
//Connect Selected Ids in viewer and dialog's Ids list
bool signalsBlocked = myListWidget->blockSignals( true );
public:
StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
TopAbs_ShapeEnum subShType = TopAbs_EDGE,
- const bool toShowList = true);
+ const bool toShowList = true,
+ const bool toShowActivateBtn = false);
~StdMeshersGUI_SubShapeSelectorWdg();
SMESH::long_array_var GetListOfIDs();
vtkRenderer* GetRenderer() { return myRenderer; }
SMESH_PreviewActorsCollection* GetActorCollection() { return myPreviewActor; }
void ClearSelected();
+
+public slots:
void ActivateSelection( bool );
signals:
vtkRenderer* myRenderer;
QListWidget* myListWidget;
+ QPushButton* myActivateButton;
QPushButton* myAddButton;
QPushButton* myRemoveButton;
QLabel* myInfoLabel;
<source>ICON_SMESH_TREE_ALGO_Projection_2D</source>
<translation>mesh_tree_algo_projection_2d.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Projection_1D2D</source>
+ <translation>mesh_tree_algo_projection_2d.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_ALGO_Projection_3D</source>
<translation>mesh_tree_hypo_projection_3d.png</translation>
<source>ICON_SMESH_TREE_HYPO_Arithmetic1D</source>
<translation>mesh_tree_hypo_length.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_CartesianParameters3D</source>
+ <translation>mesh_tree_hypo_cartesian.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_HYPO_Geometric1D</source>
<translation>mesh_tree_hypo_length.png</translation>
<source>ICON_SMESH_TREE_HYPO_QuadranglePreference</source>
<translation>mesh_tree_algo_quad.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_QuadrangleParams</source>
+ <translation>mesh_tree_algo_quad.png</translation>
+ </message>
<message>
<source>ICON_SMESH_TREE_HYPO_TrianglePreference</source>
<translation>mesh_tree_algo_mefisto.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_QuadraticMesh</source>
- <translation>mesh_tree_hypo_length.png</translation>
+ <translation>mesh_tree_hypo_quadratic.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_SegmentLengthAroundVertex</source>
StdMeshers_Adaptive1D_i::~StdMeshers_Adaptive1D_i()
{
- MESSAGE( "StdMeshers_Adaptive1D_i::~StdMeshers_Adaptive1D_i" );
}
//=======================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i" );
myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Arithmetic1D_i::~StdMeshers_Arithmetic1D_i()
{
- MESSAGE( "StdMeshers_Arithmetic1D_i::~StdMeshers_Arithmetic1D_i" );
}
//=============================================================================
CORBA::Boolean theIsStart )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_StartEndLength_i::SetLength" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetLength( theLength, theIsStart );
CORBA::Double StdMeshers_Arithmetic1D_i::GetLength( CORBA::Boolean theIsStart)
{
- MESSAGE( "StdMeshers_Arithmetic1D_i::GetLength" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetLength( theIsStart );
}
char* StdMeshers_Arithmetic1D_i::GetObjectEntry()
{
- MESSAGE( "StdMeshers_Arithmetic1D_i::SetObjectEntry" );
ASSERT( myBaseImpl );
const char* entry;
try {
SMESH::long_array* StdMeshers_Arithmetic1D_i::GetReversedEdges()
{
- MESSAGE( "StdMeshers_StartEndLength_i::GetReversedEdges" );
ASSERT( myBaseImpl );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
::StdMeshers_Arithmetic1D* StdMeshers_Arithmetic1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Arithmetic1D_i::GetImpl" );
return ( ::StdMeshers_Arithmetic1D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_AutomaticLength_i::StdMeshers_AutomaticLength_i" );
myBaseImpl = new ::StdMeshers_AutomaticLength( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_AutomaticLength_i::~StdMeshers_AutomaticLength_i()
{
- MESSAGE( "StdMeshers_AutomaticLength_i::~StdMeshers_AutomaticLength_i" );
}
//=============================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_CartesianParameters3D_i::StdMeshers_CartesianParameters3D_i" );
myBaseImpl = new ::StdMeshers_CartesianParameters3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_CartesianParameters3D_i::~StdMeshers_CartesianParameters3D_i()
{
- MESSAGE( "StdMeshers_CartesianParameters3D_i::~StdMeshers_CartesianParameters3D_i" );
}
//=============================================================================
//\brief Set grid spacing along the three axes
// \param spaceFunctions - functions defining spacing values at given point on axis
// \param internalPoints - points dividing a grid into parts along each direction
-// Parameter t of spaceFunction f(t) is a position [0,1] withing bounding box of
-// the shape to mesh or withing an interval defined by internal points
+// Parameter t of spaceFunction f(t) is a position [0,1] within bounding box of
+// the shape to mesh or within an interval defined by internal points
//=======================================================================
void StdMeshers_CartesianParameters3D_i::SetGridSpacing(const SMESH::string_array& spaceFunctions,
::StdMeshers_CartesianParameters3D* StdMeshers_CartesianParameters3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_CartesianParameters3D_i::GetImpl" );
return ( ::StdMeshers_CartesianParameters3D* )myBaseImpl;
}
* \param internalPoints - points dividing a grid into parts along each direction
* \param axis - index of an axis counterd from zero, i.e. 0==X, 1==Y, 2==Z
*
- * Parameter t of spaceFunction f(t) is a position [0,1] withing bounding box of
- * the shape to mesh or withing an interval defined by internal points
+ * Parameter t of spaceFunction f(t) is a position [0,1] within bounding box of
+ * the shape to mesh or within an interval defined by internal points
*/
void SetGridSpacing(const SMESH::string_array& spaceFunctions,
const SMESH::double_array& internalPoints,
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i" );
myBaseImpl = new ::StdMeshers_Cartesian_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Cartesian_3D_i::~StdMeshers_Cartesian_3D_i()
{
- MESSAGE( "StdMeshers_Cartesian_3D_i::~StdMeshers_Cartesian_3D_i" );
}
//=============================================================================
::StdMeshers_Cartesian_3D* StdMeshers_Cartesian_3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Cartesian_3D_i::GetImpl" );
return ( ::StdMeshers_Cartesian_3D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i" );
myBaseImpl = new ::StdMeshers_CompositeSegment_1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_CompositeSegment_1D_i::~StdMeshers_CompositeSegment_1D_i()
{
- MESSAGE( "StdMeshers_CompositeSegment_1D_i::~StdMeshers_CompositeSegment_1D_i" );
}
//=============================================================================
::StdMeshers_CompositeSegment_1D* StdMeshers_CompositeSegment_1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_CompositeSegment_1D_i::GetImpl" );
return ( ::StdMeshers_CompositeSegment_1D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i" );
myBaseImpl = new ::StdMeshers_Deflection1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Deflection1D_i::~StdMeshers_Deflection1D_i()
{
- MESSAGE( "StdMeshers_Deflection1D_i::~StdMeshers_Deflection1D_i" );
}
//=============================================================================
void StdMeshers_Deflection1D_i::SetDeflection( CORBA::Double theValue )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_Deflection1D_i::SetDeflection" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetDeflection( theValue );
CORBA::Double StdMeshers_Deflection1D_i::GetDeflection()
{
- MESSAGE( "StdMeshers_Deflection1D_i::GetDeflection" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetDeflection();
}
::StdMeshers_Deflection1D* StdMeshers_Deflection1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Deflection1D_i::GetImpl" );
return ( ::StdMeshers_Deflection1D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i" );
myBaseImpl = new ::StdMeshers_FixedPoints1D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
StdMeshers_FixedPoints1D_i::~StdMeshers_FixedPoints1D_i()
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::~StdMeshers_FixedPoints1D_i" );
}
//=============================================================================
void StdMeshers_FixedPoints1D_i::SetNbSegments(const SMESH::long_array& listNbSeg)
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::SetNbSegments" );
ASSERT( myBaseImpl );
try {
std::vector<int> nbsegs( listNbSeg.length() );
void StdMeshers_FixedPoints1D_i::SetPoints(const SMESH::double_array& listParams)
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::SetPoints" );
ASSERT( myBaseImpl );
try {
std::vector<double> params( listParams.length() );
SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints()
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::GetPoints" );
ASSERT( myBaseImpl );
SMESH::double_array_var anArray = new SMESH::double_array;
std::vector<double> params = this->GetImpl()->GetPoints();
SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments()
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::GetNbSegments" );
ASSERT( myBaseImpl );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> nbsegs = this->GetImpl()->GetNbSegments();
char* StdMeshers_FixedPoints1D_i::GetObjectEntry()
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::SetObjectEntry" );
ASSERT( myBaseImpl );
const char* entry;
try {
SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges()
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::GetReversedEdges" );
ASSERT( myBaseImpl );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
::StdMeshers_FixedPoints1D* StdMeshers_FixedPoints1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_FixedPoints1D_i::GetImpl" );
return ( ::StdMeshers_FixedPoints1D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i" );
myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Hexa_3D_i::~StdMeshers_Hexa_3D_i()
{
- MESSAGE( "StdMeshers_Hexa_3D_i::~StdMeshers_Hexa_3D_i" );
}
//=============================================================================
::StdMeshers_Hexa_3D* StdMeshers_Hexa_3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Hexa_3D_i::GetImpl" );
return ( ::StdMeshers_Hexa_3D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_ImportSource1D_i::StdMeshers_ImportSource1D_i" );
myBaseImpl = new ::StdMeshers_ImportSource1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_ImportSource1D_i::~StdMeshers_ImportSource1D_i()
{
- MESSAGE( "StdMeshers_ImportSource1D_i::~StdMeshers_ImportSource1D_i" );
}
//=============================================================================
void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& groups)
{
- MESSAGE( "StdMeshers_ImportSource1D_i::SetSourceEdges" );
ASSERT( myBaseImpl );
try
{
SMESH::string_array* StdMeshers_ImportSource1D_i::GetSourceEdges()
{
- MESSAGE( "StdMeshers_ImportSource1D_i::GetImportSource" );
SMESH::string_array_var res = new SMESH::string_array( _groupEntries );
return res._retn();
}
::StdMeshers_ImportSource1D* StdMeshers_ImportSource1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_ImportSource1D_i::GetImpl" );
return ( ::StdMeshers_ImportSource1D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_ImportSource2D_i::StdMeshers_ImportSource2D_i" );
myBaseImpl = new ::StdMeshers_ImportSource2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_ImportSource2D_i::~StdMeshers_ImportSource2D_i()
{
- MESSAGE( "StdMeshers_ImportSource2D_i::~StdMeshers_ImportSource2D_i" );
}
//=============================================================================
void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& groups)
{
- MESSAGE( "StdMeshers_ImportSource2D_i::SetSourceFaces" );
ASSERT( myBaseImpl );
try
{
SMESH::string_array* StdMeshers_ImportSource2D_i::GetSourceFaces()
{
- MESSAGE( "StdMeshers_ImportSource2D_i::GetImportSource" );
SMESH::string_array_var res = new SMESH::string_array( _groupEntries );
return res._retn();
}
::StdMeshers_ImportSource2D* StdMeshers_ImportSource2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_ImportSource2D_i::GetImpl" );
return ( ::StdMeshers_ImportSource2D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i" );
myBaseImpl = new ::StdMeshers_Import_1D2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Import_1D2D_i::~StdMeshers_Import_1D2D_i()
{
- MESSAGE( "StdMeshers_Import_1D2D_i::~StdMeshers_Import_1D2D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_Import_1D2D* StdMeshers_Import_1D2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Import_1D2D_i::GetImpl" );
return ( ::StdMeshers_Import_1D2D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Import_1D_i::StdMeshers_Import_1D_i" );
myBaseImpl = new ::StdMeshers_Import_1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Import_1D_i::~StdMeshers_Import_1D_i()
{
- MESSAGE( "StdMeshers_Import_1D_i::~StdMeshers_Import_1D_i" );
}
//=============================================================================
::StdMeshers_Import_1D* StdMeshers_Import_1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Import_1D_i::GetImpl" );
return ( ::StdMeshers_Import_1D* )myBaseImpl;
}
:SMESH_Hypothesis_i( thePOA ),
StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl)
{
- MESSAGE( "StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i" );
myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
StdMeshers_LayerDistribution2D_i::~StdMeshers_LayerDistribution2D_i()
{
- MESSAGE("StdMeshers_LayerDistribution2D_i::~StdMeshers_LayerDistribution2D_i");
}
//=============================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i" );
myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i()
{
- MESSAGE( "StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i" );
if ( !myHyp->_is_nil() )
myHyp->UnRegister();
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i" );
myBaseImpl = new ::StdMeshers_LengthFromEdges( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_LengthFromEdges_i::~StdMeshers_LengthFromEdges_i()
{
- MESSAGE( "StdMeshers_LengthFromEdges_i::~StdMeshers_LengthFromEdges_i" );
}
//=============================================================================
void StdMeshers_LengthFromEdges_i::SetMode( CORBA::Long theMode )
throw (SALOME::SALOME_Exception)
{
- MESSAGE( "StdMeshers_LengthFromEdges_i::SetMode" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetMode( theMode );
CORBA::Long StdMeshers_LengthFromEdges_i::GetMode()
{
- MESSAGE( "StdMeshers_LengthFromEdges_i::GetMode" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetMode();
}
::StdMeshers_LengthFromEdges* StdMeshers_LengthFromEdges_i::GetImpl()
{
- MESSAGE( "StdMeshers_LengthFromEdges_i::GetImpl" );
return ( ::StdMeshers_LengthFromEdges* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_LocalLength_i::StdMeshers_LocalLength_i" );
myBaseImpl = new ::StdMeshers_LocalLength( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_LocalLength_i::~StdMeshers_LocalLength_i()
{
- MESSAGE( "StdMeshers_LocalLength_i::~StdMeshers_LocalLength_i" );
}
//=============================================================================
void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_LocalLength_i::SetLength" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetLength( theLength );
void StdMeshers_LocalLength_i::SetPrecision( CORBA::Double thePrecision )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_LocalLength_i::SetPrecision" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetPrecision( thePrecision );
//=============================================================================
CORBA::Double StdMeshers_LocalLength_i::GetLength()
{
- MESSAGE( "StdMeshers_LocalLength_i::GetLength" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetLength();
}
//=============================================================================
CORBA::Double StdMeshers_LocalLength_i::GetPrecision()
{
- MESSAGE( "StdMeshers_LocalLength_i::GetPrecision" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetPrecision();
}
//=============================================================================
::StdMeshers_LocalLength* StdMeshers_LocalLength_i::GetImpl()
{
- MESSAGE( "StdMeshers_LocalLength_i::GetImpl" );
return ( ::StdMeshers_LocalLength* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i" );
myBaseImpl = new ::StdMeshers_MEFISTO_2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_MEFISTO_2D_i::~StdMeshers_MEFISTO_2D_i()
{
- MESSAGE( "StdMeshers_MEFISTO_2D_i::~StdMeshers_MEFISTO_2D_i" );
}
//=============================================================================
::StdMeshers_MEFISTO_2D* StdMeshers_MEFISTO_2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_MEFISTO_2D_i::GetImpl" );
return ( ::StdMeshers_MEFISTO_2D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i" );
myBaseImpl = new ::StdMeshers_MaxElementArea( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_MaxElementArea_i::~StdMeshers_MaxElementArea_i()
{
- MESSAGE( "StdMeshers_MaxElementArea_i::~StdMeshers_MaxElementArea_i" );
}
//=============================================================================
void StdMeshers_MaxElementArea_i::SetMaxElementArea( CORBA::Double theArea )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_MaxElementArea_i::SetMaxElementArea" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetMaxArea( theArea );
CORBA::Double StdMeshers_MaxElementArea_i::GetMaxElementArea()
{
- MESSAGE( "StdMeshers_MaxElementArea_i::GetMaxElementArea" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetMaxArea();
}
::StdMeshers_MaxElementArea* StdMeshers_MaxElementArea_i::GetImpl()
{
- MESSAGE( "StdMeshers_MaxElementArea_i::GetImpl" );
return ( ::StdMeshers_MaxElementArea* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i" );
myBaseImpl = new ::StdMeshers_MaxElementVolume( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_MaxElementVolume_i::~StdMeshers_MaxElementVolume_i()
{
- MESSAGE( "StdMeshers_MaxElementVolume_i::~StdMeshers_MaxElementVolume_i()" );
}
//=============================================================================
void StdMeshers_MaxElementVolume_i::SetMaxElementVolume( CORBA::Double theVolume )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_MaxElementVolume_i::SetMaxElementVolume" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetMaxVolume( theVolume );
CORBA::Double StdMeshers_MaxElementVolume_i::GetMaxElementVolume()
{
- MESSAGE( "StdMeshers_MaxElementVolume_i::GetMaxElementVolume" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetMaxVolume();
}
::StdMeshers_MaxElementVolume* StdMeshers_MaxElementVolume_i::GetImpl()
{
- MESSAGE( "StdMeshers_MaxElementVolume_i::GetImpl" );
return ( ::StdMeshers_MaxElementVolume* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE("StdMeshers_NotConformAllowed_i::StdMeshers_NotConformAllowed_i");
myBaseImpl = new ::StdMeshers_NotConformAllowed(genImpl->GetANewId(),
studyId,
genImpl);
:SMESH_Hypothesis_i( thePOA ),
StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl)
{
- MESSAGE("StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i");
myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
StdMeshers_NumberOfLayers2D_i::~StdMeshers_NumberOfLayers2D_i()
{
- MESSAGE( "StdMeshers_NumberOfLayers2D_i::~StdMeshers_NumberOfLayers2D_i" );
}
//=============================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i" );
myBaseImpl = new ::StdMeshers_NumberOfLayers( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_NumberOfLayers_i::~StdMeshers_NumberOfLayers_i()
{
- MESSAGE( "StdMeshers_NumberOfLayers_i::~StdMeshers_NumberOfLayers_i" );
}
//=============================================================================
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i" );
myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_NumberOfSegments_i::~StdMeshers_NumberOfSegments_i()
{
- MESSAGE( "StdMeshers_NumberOfSegments_i::~StdMeshers_NumberOfSegments_i" );
}
//=============================================================================
SMESH::long_array* StdMeshers_NumberOfSegments_i::GetReversedEdges()
{
- MESSAGE( "StdMeshers_NumberOfSegments_i::GetReversedEdges" );
ASSERT( myBaseImpl );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- //MESSAGE( "StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i" );
myBaseImpl = new ::StdMeshers_PolygonPerFace_2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_PolygonPerFace_2D_i::~StdMeshers_PolygonPerFace_2D_i()
{
- //MESSAGE( "StdMeshers_PolygonPerFace_2D_i::~StdMeshers_PolygonPerFace_2D_i" );
}
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i" );
myBaseImpl = new ::StdMeshers_Prism_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Prism_3D_i::~StdMeshers_Prism_3D_i()
{
- MESSAGE( "StdMeshers_Prism_3D_i::~StdMeshers_Prism_3D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_Prism_3D* StdMeshers_Prism_3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Prism_3D_i::GetImpl" );
return ( ::StdMeshers_Prism_3D* )myBaseImpl;
}
//-----------------------------------------------------------------------------
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i" );
myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_RadialPrism_3D_i::~StdMeshers_RadialPrism_3D_i()
{
- MESSAGE( "StdMeshers_RadialPrism_3D_i::~StdMeshers_RadialPrism_3D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_RadialPrism_3D* StdMeshers_RadialPrism_3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_RadialPrism_3D_i::GetImpl" );
return ( ::StdMeshers_RadialPrism_3D* )myBaseImpl;
}
//-----------------------------------------------------------------------------
::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i" );
myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i()
{
- MESSAGE( "StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i" );
}
//=============================================================================
::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i" );
myBaseImpl = new ::StdMeshers_ProjectionSource2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i()
{
- MESSAGE( "StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i" );
}
//=============================================================================
::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i" );
myBaseImpl = new ::StdMeshers_ProjectionSource3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i()
{
- MESSAGE( "StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i" );
}
//=============================================================================
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i" );
myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Projection_3D_i::~StdMeshers_Projection_3D_i()
{
- MESSAGE( "StdMeshers_Projection_3D_i::~StdMeshers_Projection_3D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_Projection_3D* StdMeshers_Projection_3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Projection_3D_i::GetImpl" );
return ( ::StdMeshers_Projection_3D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i" );
myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Projection_2D_i::~StdMeshers_Projection_2D_i()
{
- MESSAGE( "StdMeshers_Projection_2D_i::~StdMeshers_Projection_2D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_Projection_2D* StdMeshers_Projection_2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Projection_2D_i::GetImpl" );
return ( ::StdMeshers_Projection_2D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i" );
myBaseImpl = new ::StdMeshers_Projection_1D2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Projection_1D2D_i::~StdMeshers_Projection_1D2D_i()
{
- MESSAGE( "StdMeshers_Projection_1D2D_i::~StdMeshers_Projection_1D2D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_Projection_1D2D* StdMeshers_Projection_1D2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Projection_1D2D_i::GetImpl" );
return ( ::StdMeshers_Projection_1D2D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i" );
myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_Projection_1D_i::~StdMeshers_Projection_1D_i()
{
- MESSAGE( "StdMeshers_Projection_1D_i::~StdMeshers_Projection_1D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_Projection_1D* StdMeshers_Projection_1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_Projection_1D_i::GetImpl" );
return ( ::StdMeshers_Projection_1D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_Propagation_i::StdMeshers_Propagation_i" );
myBaseImpl = new ::StdMeshers_Propagation(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i" );
myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i()
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::~StdMeshers_QuadrangleParams_i" );
}
//=============================================================================
void StdMeshers_QuadrangleParams_i::SetTriaVertex(CORBA::Long vertID)
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::SetTriaVertex" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetTriaVertex( vertID );
CORBA::Long StdMeshers_QuadrangleParams_i::GetTriaVertex()
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::GetTriaVertex" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetTriaVertex();
}
void StdMeshers_QuadrangleParams_i::SetObjectEntry( const char* entry )
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
ASSERT( myBaseImpl );
try {
char* StdMeshers_QuadrangleParams_i::GetObjectEntry()
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::SetObjectEntry" );
ASSERT( myBaseImpl );
const char* entry;
try {
//=============================================================================
void StdMeshers_QuadrangleParams_i::SetQuadType(StdMeshers::QuadType type)
{
- MESSAGE("StdMeshers_QuadrangleParams_i::SetQuadType");
ASSERT(myBaseImpl);
if (int(type) >= int(StdMeshers::QUAD_NB_TYPES)) {
//=============================================================================
StdMeshers::QuadType StdMeshers_QuadrangleParams_i::GetQuadType()
{
- MESSAGE("StdMeshers_QuadrangleParams_i::GetQuadType");
ASSERT(myBaseImpl);
return StdMeshers::QuadType(int(this->GetImpl()->GetQuadType()));
}
::StdMeshers_QuadrangleParams* StdMeshers_QuadrangleParams_i::GetImpl()
{
- MESSAGE( "StdMeshers_QuadrangleParams_i::GetImpl" );
return ( ::StdMeshers_QuadrangleParams* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i" );
myBaseImpl = new ::StdMeshers_RadialQuadrangle_1D2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_RadialQuadrangle_1D2D_i::~StdMeshers_RadialQuadrangle_1D2D_i()
{
- MESSAGE( "StdMeshers_RadialQuadrangle_1D2D_i::~StdMeshers_RadialQuadrangle_1D2D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_RadialQuadrangle_1D2D* StdMeshers_RadialQuadrangle_1D2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_RadialQuadrangle_1D2D_i::GetImpl" );
return ( ::StdMeshers_RadialQuadrangle_1D2D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_0D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i" );
myBaseImpl = new ::StdMeshers_SegmentAroundVertex_0D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_SegmentAroundVertex_0D_i::~StdMeshers_SegmentAroundVertex_0D_i()
{
- MESSAGE( "StdMeshers_SegmentAroundVertex_0D_i::~StdMeshers_SegmentAroundVertex_0D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_SegmentAroundVertex_0D* StdMeshers_SegmentAroundVertex_0D_i::GetImpl()
{
- MESSAGE( "StdMeshers_SegmentAroundVertex_0D_i::GetImpl" );
return ( ::StdMeshers_SegmentAroundVertex_0D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_SegmentLengthAroundVertex_i::StdMeshers_SegmentLengthAroundVertex_i" );
myBaseImpl = new ::StdMeshers_SegmentLengthAroundVertex( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_SegmentLengthAroundVertex_i::~StdMeshers_SegmentLengthAroundVertex_i()
{
- MESSAGE( "StdMeshers_SegmentLengthAroundVertex_i::~StdMeshers_SegmentLengthAroundVertex_i" );
}
//=============================================================================
void StdMeshers_SegmentLengthAroundVertex_i::SetLength( CORBA::Double theLength )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_SegmentLengthAroundVertex_i::SetLength" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetLength( theLength );
CORBA::Double StdMeshers_SegmentLengthAroundVertex_i::GetLength()
{
- MESSAGE( "StdMeshers_SegmentLengthAroundVertex_i::GetLength" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetLength();
}
::StdMeshers_SegmentLengthAroundVertex* StdMeshers_SegmentLengthAroundVertex_i::GetImpl()
{
- MESSAGE( "StdMeshers_SegmentLengthAroundVertex_i::GetImpl" );
return ( ::StdMeshers_SegmentLengthAroundVertex* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i" );
myBaseImpl = new ::StdMeshers_StartEndLength( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_StartEndLength_i::~StdMeshers_StartEndLength_i()
{
- MESSAGE( "StdMeshers_StartEndLength_i::~StdMeshers_StartEndLength_i" );
}
//=============================================================================
CORBA::Boolean theIsStart )
throw ( SALOME::SALOME_Exception )
{
- MESSAGE( "StdMeshers_StartEndLength_i::SetLength" );
ASSERT( myBaseImpl );
try {
this->GetImpl()->SetLength( theLength, theIsStart );
CORBA::Double StdMeshers_StartEndLength_i::GetLength( CORBA::Boolean theIsStart)
{
- MESSAGE( "StdMeshers_StartEndLength_i::GetLength" );
ASSERT( myBaseImpl );
return this->GetImpl()->GetLength( theIsStart );
}
::StdMeshers_StartEndLength* StdMeshers_StartEndLength_i::GetImpl()
{
- MESSAGE( "StdMeshers_StartEndLength_i::GetImpl" );
return ( ::StdMeshers_StartEndLength* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i" );
myBaseImpl = new ::StdMeshers_UseExisting_1D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_UseExisting_1D_i::~StdMeshers_UseExisting_1D_i()
{
- MESSAGE( "StdMeshers_UseExisting_1D_i::~StdMeshers_UseExisting_1D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_UseExisting_1D* StdMeshers_UseExisting_1D_i::GetImpl()
{
- MESSAGE( "StdMeshers_UseExisting_1D_i::GetImpl" );
return ( ::StdMeshers_UseExisting_1D* )myBaseImpl;
}
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
- MESSAGE( "StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i" );
myBaseImpl = new ::StdMeshers_UseExisting_2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_UseExisting_2D_i::~StdMeshers_UseExisting_2D_i()
{
- MESSAGE( "StdMeshers_UseExisting_2D_i::~StdMeshers_UseExisting_2D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_UseExisting_2D* StdMeshers_UseExisting_2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_UseExisting_2D_i::GetImpl" );
return ( ::StdMeshers_UseExisting_2D* )myBaseImpl;
}
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_ViscousLayers2D_i::StdMeshers_ViscousLayers2D_i" );
myBaseImpl = new ::StdMeshers_ViscousLayers2D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
StdMeshers_ViscousLayers2D_i::~StdMeshers_ViscousLayers2D_i()
{
- MESSAGE( "StdMeshers_ViscousLayers2D_i::~StdMeshers_ViscousLayers2D_i" );
}
//================================================================================
::StdMeshers_ViscousLayers2D* StdMeshers_ViscousLayers2D_i::GetImpl()
{
- MESSAGE( "StdMeshers_ViscousLayers2D_i::GetImpl" );
return ( ::StdMeshers_ViscousLayers2D* )myBaseImpl;
}
self.num=1
self.__selectedMesh=None
- # complex whith QResources: not used
+ # complex with QResources: not used
# The icon are supposed to be located in the $SMESH_ROOT_DIR/share/salome/resources/smesh folder,
# other solution could be in the same folder than this python module file:
# iconfolder=os.path.dirname(os.path.abspath(__file__))
# General substitutions.
project = 'MGCleaner Plug-in'
-copyright = '2013-2016, EDF R&D'
+copyright = '2013-2017, EDF R&D'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
Example 2: [(0,0,0,1,0,0),(50,0,0,0,1,0)]: in addition to the first plane cut, cut through a plane passing by (50,0,0) and normal to the y axis.
Note that the plane size us determined automatically from the size of the geometry in question (using a very big trim size = 100 x length of geometry!)
- OutLvlLst is a list containing integers that represent the inner sectioning level with respect to the original geometry type
- A value of 1 means that the section will provide elements of one level lower than the original type. For exemple a solid sectioned at level 1 will produce faces. A Face sectioned at level 1 will produce edges.
+ A value of 1 means that the section will provide elements of one level lower than the original type. For example a solid sectioned at level 1 will produce faces. A Face sectioned at level 1 will produce edges.
A value of 2 means that a deeper sectioning will be applied. A solid sectioned with level 2 will give faces and edges. A face will give edges and vertices. An edge will give only vertices
The number of elements in this list should be (this is verified in the code) equal to the number of elements in the plane cut list. This is logical.
Example 1: [1]
Example 1: [(0,0,0,1,0,0,5)]: cut along a plane passing through the origin and normal to the x-axis with a trim size of 5
Example 2: [(0,0,0,1,0,0,5),(50,0,0,0,1,0,10)]: in addition to the first plane cut, cut through a plane passing by (50,0,0) and normal to the y axis with a trim size of 10
- OutLvlLst is a list containing integers that represent the inner sectioning level with respect to the original geometry type
- A value of 1 means that the section will provide elements of one level lower than the original type. For exemple a solid sectioned at level 1 will produce faces. A Face sectioned at level 1 will produce edges.
+ A value of 1 means that the section will provide elements of one level lower than the original type. For example a solid sectioned at level 1 will produce faces. A Face sectioned at level 1 will produce edges.
A value of 2 means that a deeper sectioning will be applied. A solid sectioned with level 2 will give faces and edges. A face will give edges and vertices. An edge will give only vertices
The number of elements in this list should be (this is verified in the code) equal to the number of elements in the plane cut list. This is logical.
Example 1: [1]
def PrincipleBoxes (self):
"""
This function returns all possible combination rectangular shape objects that can contain at least 3 of the principle vertices
- constituting the MacObject. This is indispensible for the Non-ortho types and shall return a number of 24 possible combinations
+ constituting the MacObject. This is indispensable for the Non-ortho types and shall return a number of 24 possible combinations
"""
from itertools import combinations
Boxes = []
//int NG[4]; // Num. globaux des sommets
// Acquisition maillage initial
- //cout << chrono() << " - Acquisition du maillage initial" << endl;
+ //cout << salome_chrono() << " - Acquisition du maillage initial" << endl;
MAILLAGE1 = new Maillage((string) "TEMP");
MAILLAGE1->inputMED(ficMEDin);
- cout << chrono() << " - End of mesh read" << endl;
+ cout << salome_chrono() << " - End of mesh read" << endl;
indexNouveauxNoeuds = MAILLAGE1->nombreNoeudsMaillage;
// Le maillage ne contient aucun TETRA4 : on rend le maillage initial sans modification
cout << "WARNING: mesh does not contain tetra4 elements, it will not be modified" << endl;
MAILLAGE1->ID = str_id_maillagenew;
MAILLAGE1->outputMED(ficMEDout);
- cout << chrono() << " - Finished!" << endl << endl;
+ cout << salome_chrono() << " - Finished!" << endl << endl;
exit(0);
}
// A partir de cet instant le maillage contient forcément des TETRA4
DNP = (float*) malloc(sizeof(float) * MAILLAGE1->nombreNoeudsMaillage);
for (int k = 0; k < MAILLAGE1->nombreNoeudsMaillage; k++)
DNP[k] = distanceNoeudPlan(k + 1);
- cout << chrono() << " - End of computation of distances between nodes and plane" << endl;
+ cout << salome_chrono() << " - End of computation of distances between nodes and plane" << endl;
// Longueur d'arête moyenne des T4 intersectant le plan de coupe
float LONGUEURS = 0.0;
<< endl;
MAILLAGE1->ID = str_id_maillagenew;
MAILLAGE1->outputMED(ficMEDout);
- cout << chrono() << " - Finished!" << endl << endl;
+ cout << salome_chrono() << " - Finished!" << endl << endl;
exit(0);
}
// A partir de cet instant le maillage contient forcément des TETRA4 intersectant le plan de coupe
epsilon = tolerance * longueurMoyenne;
int nT4coupe = cptLONGUEURS / 6;
- cout << chrono() << " - End of computation of mean length of tetra4 edges near the cut plane" << endl;
+ cout << salome_chrono() << " - End of computation of mean length of tetra4 edges near the cut plane" << endl;
cout << "Number of tetra4 to be cut = " << nT4coupe << endl;
cout << "Mean length = " << longueurMoyenne << endl;
else
POSN[k] = 0;
}
- cout << chrono() << " - End of nodes qualification above or below the cut plane" << endl;
+ cout << salome_chrono() << " - End of nodes qualification above or below the cut plane" << endl;
cout << "Start of iteration on tetra4" << endl;
for (int it4 = 0; it4 < MAILLAGE1->EFFECTIFS_TYPES[TETRA4]; it4++)
ERREUR("Case not taken into account");
}
- cout << chrono() << " - End of iteration on tetra4" << endl;
+ cout << salome_chrono() << " - End of iteration on tetra4" << endl;
// cout << "indexNouveauxNoeuds = " << indexNouveauxNoeuds << endl;
newXX.resize(indexNouveauxNoeuds - MAILLAGE1->nombreNoeudsMaillage);
// 2. Constitution du maillage final
// =========================================================================================
- cout << chrono() << " - Constitution of final mesh" << endl;
+ cout << salome_chrono() << " - Constitution of final mesh" << endl;
MAILLAGE2 = new Maillage(str_id_maillagenew);
MAILLAGE2->dimensionMaillage = MAILLAGE1->dimensionMaillage;
MAILLAGE2->eliminationMailles(TETRA4, cutTetras);
- cout << chrono() << " - MED file writing" << endl;
+ cout << salome_chrono() << " - MED file writing" << endl;
MAILLAGE2->outputMED(ficMEDout);
- cout << chrono() << " - Finished!" << endl << endl;
+ cout << salome_chrono() << " - Finished!" << endl << endl;
return 0;
return typeBanaliseMED;
}
-int MESHCUT::chrono()
+int MESHCUT::salome_chrono()
{
return clock() / CLOCKS_PER_SEC;
}
int copieFichier(std::string source, std::string cible);
med_geometry_type InstanceMGE(TYPE_MAILLE TYPE);
- int chrono();
+ int salome_chrono();
TYPE_MAILLE typeMaille(std::string type);
std::string MGE2string(med_geometry_type MGE);
std::string TM2string(TYPE_MAILLE MGE);
# General substitutions.
project = 'Verima Plug-in'
-copyright = '2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE'
+copyright = '2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
<property name="toolTip">
<string>This parameter allows the user to prescribe a maximal size hmax
for the mesh elements i.e., the lengths of the edges with respect to the specified
- size map. The corresponding values are either relative or absolute depending on the choosen parameter.
+ size map. The corresponding values are either relative or absolute depending on the chosen parameter.
The default values are automatically set based on the surface geometry (curvature dependent) and its
bounding box size.
Please note that, as it is not strictly possible to obey the given or computed size map, the actual maximal
<property name="toolTip">
<string>This parameter allows the user to prescribe a maximal size hmax
for the mesh elements i.e., the lengths of the edges with respect to the specified
- size map. The corresponding values are either relative or absolute depending on the choosen parameter.
+ size map. The corresponding values are either relative or absolute depending on the chosen parameter.
The default values are automatically set based on the surface geometry (curvature dependent) and its
bounding box size.
Please note that, as it is not strictly possible to obey the given or computed size map, the actual maximal
# General substitutions.
project = 'MeshGems-SurfOpt Plug-in'
-copyright = '2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE'
+copyright = '2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
self.num=1
self.__selectedMesh=None
- # complex whith QResources: not used
+ # complex with QResources: not used
# The icon are supposed to be located in the $SMESH_ROOT_DIR/share/salome/resources/smesh folder,
# other solution could be in the same folder than this python module file:
# iconfolder=os.path.dirname(os.path.abspath(__file__))
import main, genereCrack, Zset
import utilityFunctions as uF
+os.environ['QT_QPA_PLATFORM_PLUGIN_PATH']=os.path.join(os.environ['QTDIR'],'plugins','platforms')
+
#commande="/bin/bash -c ""source $HOME/zebulon/Z8.6.6_NEW/do_config_bash"""
#os.system(commande)
def IHM():
- try:
- from PyQt5.QtWidgets import QApplication
- except:
- from PyQt4.QtGui import QApplication
+ from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
myapp = main.ShipHolderApplication()
print data
- tmpdir=tempfile.mkdtemp()
- uF.removeFromSessionPath('LD_LIBRARY_PATH', 'Meshgems-2111')
+ tmpdir=tempfile.mkdtemp(prefix='tmpZcracks')
if names==None: names={'saneGeoName':'salome_sane', 'crackGeoName':'salome_crack', 'crackedGeoName':'salome_cracked'}
#tmpdir = "/local00/home/B27118/projets/Zcracks/Zcracks/casTests/tmpdir"
#if not os.path.isdir(tmpdir): os.mkdir(tmpdir)
-tmpdir=tempfile.mktemp(prefix='tmpZcracks')
+tmpdir=tempfile.mkdtemp(prefix='tmpZcracks')
print "tmpdir=", tmpdir
-meshgemsdir=os.environ('MESHGEMSHOME')
-if len(meshgemsdir) > 0:
- meshgems=string.split(meshgemsdir,os.sep)[-1]
- uF.removeFromSessionPath('LD_LIBRARY_PATH', meshgems)
+#meshgemsdir=os.environ('MESHGEMSHOME')
+#if len(meshgemsdir) > 0:
+ #meshgems=string.split(meshgemsdir,os.sep)[-1]
+ #uF.removeFromSessionPath('LD_LIBRARY_PATH', meshgems)
def LAUNCH(listCas=[]):
if type(listCas)!=list: listCas=[listCas]
# General substitutions.
project = 'ZCracks Plug-in'
-copyright = '2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE'
+copyright = '2007-2017 CEA/DEN, EDF R&D, OPEN CASCADE'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
import sys, pickle, tempfile, shutil
from os import path, getpid, environ, remove, system
-try:
- from PyQt5.QtCore import *
- from PyQt5.QtGui import *
- from PyQt5.QtWidgets import *
-except:
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
import utilityFunctions as uF
import genereCrack, Zset, output, zcracks_ui
# ---------------------
-uF.removeFromSessionPath('LD_LIBRARY_PATH', 'Meshgems-2111')
-
def stringToFloat(string, typ=float):
if str(string).replace(' ','')=='':
out=[]
self.verbose=1
- #self.connect(self.ui.CBQuad, SIGNAL("toggled(bool)"),self.pressQuad)
- #self.connect(self.ui.btReset, SIGNAL("clicked()"),self.pressReset)
- #self.connect(self.ui.btCancel, SIGNAL("clicked()"),self.pressCancel)
- #self.connect(self.ui.btApply, SIGNAL("clicked()"),self.pressApply)
- #self.connect(self.ui.btApplyClose, SIGNAL("clicked()"),self.pressApplyClose)
- #self.connect(self.ui.btLoad, SIGNAL("clicked()"),self.pressCharger)
- #self.connect(self.ui.btSave, SIGNAL("clicked()"),self.pressSauver)
- #self.connect(self.ui.btLoadCracked, SIGNAL("clicked()"),self.pressLoadCracked)
- #self.connect(self.ui.btLoadSane, SIGNAL("clicked()"),self.pressLoadSane)
-
- #self.connect(self.ui.btGrVol, SIGNAL("clicked()"),self.pressLoadGroupVOL)
- #self.connect(self.ui.btGrFace, SIGNAL("clicked()"),self.pressLoadGroupFACE)
- #self.connect(self.ui.btGrEdge, SIGNAL("clicked()"),self.pressLoadGroupEDGE)
- #self.connect(self.ui.btGrNode, SIGNAL("clicked()"),self.pressLoadGroupNODE)
- #self.connect(self.ui.btGrAll, SIGNAL("clicked()"),self.pressLoadGroupALL)
- #self.connect(self.ui.btVisu, SIGNAL("clicked()"),self.pressVisu)
-
- #self.connect(self.ui.CBAdvanced, SIGNAL("toggled(bool)"),self.pressAdvanced)
-
self.ui.CBQuad.toggled.connect(self.pressQuad)
self.ui.btReset.clicked.connect(self.pressReset)
self.ui.btCancel.clicked.connect(self.pressCancel)
def pressQuad(self):
if self.ui.CBQuad.isChecked():
self.ui.CBBarsoum.setEnabled(True)
- self.ui.valGradation.setText(QString('2.3'))
+ self.ui.valGradation.setText('2.3')
else:
- self.ui.valGradation.setText(QString('1.3'))
+ self.ui.valGradation.setText('1.3')
self.ui.CBBarsoum.setChecked(False)
self.ui.CBBarsoum.setEnabled(False)
tab=onglet.findChildren(QTableWidget)[0]
for irow in range(tab.rowCount()):
if tab.item(irow,0) != None:
- tab.item(irow,0).setText(QString(''))
- self.ui.valGradation.setText(QString('1.3'))
- self.ui.valLayers.setText(QString('5'))
- self.ui.valIterations.setText(QString('2'))
+ tab.item(irow,0).setText('')
+ self.ui.valGradation.setText('1.3')
+ self.ui.valLayers.setText('6')
+ self.ui.valIterations.setText('2')
self.ui.CBIs2D.setChecked(False)
self.ui.CBRefine.setChecked(False)
fileNames = fileDiag.selectedFiles()
filedef = fileNames[0]
filedef = addExtension(str(filedef), 'med')
- self.ui.valCrackedName.setText(QString(filedef))
+ self.ui.valCrackedName.setText(filedef)
def pressLoadSane(self):
if fileDiag.exec_() :
fileNames = fileDiag.selectedFiles()
filedef = fileNames[0]
- self.ui.valSaneName.setText(QString(filedef))
+ self.ui.valSaneName.setText(filedef)
def pressCharger(self):
for cont, obj in enumerate(self.lineEditObjects):
if self.lineEditTypes[cont] in [float, int]:
- obj.setText(QString(self.data['TXT'+self.lineEditNames[cont]]))
+ obj.setText(self.data['TXT'+self.lineEditNames[cont]])
else:
- obj.setText(QString(self.data[self.lineEditNames[cont]]))
+ obj.setText(self.data[self.lineEditNames[cont]])
self.ui.CBQuad.setChecked(True if 'quad' in self.data.keys() and self.data['quad'] else False)
self.ui.CBBarsoum.setChecked(True if 'barsoum' in self.data.keys() and self.data['barsoum'] else False)
self.ui.CBIs2D.setChecked(True if 'is2D' in self.data.keys() and self.data['is2D'] else False)
self.ui.CBRefine.setChecked(True if 'refine' in self.data.keys() and self.data['refine'] else False)
-
-
-
-
- #if self.data['quad']: self.ui.CBQuad.setChecked(True)
- #if self.data['barsoum']: self.ui.CBBarsoum.setChecked(True)
- #if self.data['is2D']: self.ui.CBIs2D.setChecked(True)
- #if self.data['refine']: self.ui.CBRefine.setChecked(True)
self.setTableParameters()
if tab.item(irow,0) == None:
item = QTableWidgetItem()
tab.setItem(irow, 0, item)
- tab.item(irow,0).setText(QString(self.data['TXTcrack'][str(self.ui.tabWidget.tabText(iongl))][str(label)]))
+ tab.item(irow,0).setText(self.data['TXTcrack'][str(self.ui.tabWidget.tabText(iongl))][str(label)])
if str(self.ui.tabWidget.tabText(iongl)) == self.data['TXTcrack']['actif']:
self.ui.tabWidget.setCurrentWidget(onglet)
for group in objetSain.GetGroups():
if (self.GroupToLoad in ['VOL','ALL']) and (group.GetType()==SMESH.VOLUME):
- groupsVOL+=group.GetName().replace(' ','')+" "
+ groupsVOL+=self.cleanGroupName(group)
nGr+=1
if (self.GroupToLoad in ['FACE','ALL']) and (group.GetType()==SMESH.FACE):
- groupsFAC+=group.GetName().replace(' ','')+" "
+ groupsFAC+=self.cleanGroupName(group)
nGr+=1
if (self.GroupToLoad in ['EDGE','ALL']) and (group.GetType()==SMESH.EDGE):
- groupsEDG+=group.GetName().replace(' ','')+" "
+ groupsEDG+=self.cleanGroupName(group)
nGr+=1
if (self.GroupToLoad in ['NODE','ALL']) and (group.GetType()==SMESH.NODE):
- groupsNOD+=group.GetName().replace(' ','')+" "
+ groupsNOD+=self.cleanGroupName(group)
nGr+=1
if groupsVOL!='': self.ui.valGrVol.setText(groupsVOL)
remove(f)
except:
pass
+
+ def cleanGroupName(self, group):
+ name=group.GetName()
+ while name.endswith(' '): name=name[:-1]
+ if ' ' in name:
+ message('A','%s group has a space in its name --> ignored' %name)
+ return('')
+ else:
+ return(name+" ")
+
+ def checkNamesSpaces(self, names):
+ if type(names) is str: names=[names]
+ ok=True
+ for n in names:
+ if ' ' in n:
+ message('E','%s has a space in its name, please remove it' %n, goOn=True)
+ ok=False
+ return(ok)
# ---------------------------------
pass
f = open(self.tmpFile,'w')
f.write('\n ------------------------------\n')
- f.write(' | BIENVENU DANS L\'INTERFACE |\n')
+ f.write(' | BIENVENUE DANS L\'INTERFACE |\n')
f.write(' | ZCRACKS DE SALOME |\n')
- f.write(' | VERSION ALPHA |\n')
+ f.write(' | VERSION BETA |\n')
f.write(' ------------------------------\n\n')
f.close()
smesh = smeshBuilder.New(theStudy)
([mesh], status) = smesh.CreateMeshesFromMED(meshFile)
-
+
+ if mesh.NbVolumes()>0:
+ case2D=False
+ mesh.Reorient2DBy3D( [ mesh ], mesh, 1 )
+ else:
+ case2D=True
+
mesh=cleanGroups(mesh)
# Node color status
return(float(maxAR))
-#def extendElsets(meshFile):
- #if not path.isfile(meshFile):
- #message('E','Mesh med file is not valid')
- #return(-1)
-
- #import SMESH, salome
- ##salome.salome_init()
- #theStudy = salome.myStudy
- #from salome.smesh import smeshBuilder
- #smesh = smeshBuilder.New(theStudy)
-
- #([mesh], status) = smesh.CreateMeshesFromMED(meshFile)
-
- ## Node color status
- #nodeList=mesh.GetNodesId()
- #colorList=[0]*len(nodeList)
-
- ## Init using SIDE0 SIDE1
- #for group in mesh.GetGroups():
- #if group.GetType()==SMESH.FACE :
- #color=0
- #if group.GetName()[0:4]=='SIDE0' :
- #color=1
- #elif group.GetName()[0:4]=='SIDE1' :
- #color=2
- #else : continue
- ## Get faces
- #faces=group.GetIDs()
- ## Set faces nodes to given color
- #for face_id in faces :
- #for face_node_id in mesh.GetElemNodes(face_id) :
- #colorList[face_node_id-1]=color
-
- ## Propagates color using elem connectivity
- ## Always propagates max color
- #volElemList=mesh.GetElementsByType(SMESH.VOLUME)
- #ifChanged=True
- #while ifChanged :
- #ifChanged=False
- #minColor=100
- #maxColor=0
- #for elemId in volElemList:
- #for elemNodeId in mesh.GetElemNodes(elemId) :
- #nodeColor=colorList[elemNodeId-1]
- #if nodeColor<minColor : minColor=nodeColor
- #if nodeColor>maxColor : maxColor=nodeColor
- #if minColor!=maxColor :
- #ifChanged = True
- #for elemNodeId in mesh.GetElemNodes(elemId) :
- #colorList[elemNodeId-1]=maxColor
-
- #velem0 = []
- #velem1 = []
- #for elemId in volElemList:
- #elemNodesId=mesh.GetElemNodes(elemId)
- #elemColor=colorList[elemNodesId[0]-1]
- #if(elemColor==1) : velem0.append(elemId)
- #if(elemColor==2) : velem1.append(elemId)
-
- #mesh.MakeGroupByIds('SIDE_co',SMESH.VOLUME,velem0)
- #mesh.MakeGroupByIds('SIDE_ext',SMESH.VOLUME,velem1)
-
- #surfElemList=mesh.GetElementsByType(SMESH.FACE)
- #selem0 = []
- #selem1 = []
- #nbelem0=0
- #nbelem1=0
-
- #for elemId in surfElemList:
- #elemNodesId=mesh.GetElemNodes(elemId)
- #elemColor=colorList[elemNodesId[0]-1]
- #if(elemColor==1) : selem0.append(elemId)
- #if(elemColor==2) : selem1.append(elemId)
-
- #mesh.MakeGroupByIds('SIDE_co',SMESH.FACE,selem0)
- #mesh.MakeGroupByIds('SIDE_ext',SMESH.FACE,selem1)
-
- #maxAR=0.
- #for elem in volElemList:
- #maxAR=max(mesh.GetAspectRatio(elem),maxAR)
- #for elem in surfElemList:
- #maxAR=max(mesh.GetAspectRatio(elem),maxAR)
-
- #mesh.ExportMED(meshFile, 0, SMESH.MED_V2_2, 1, None ,1)
- #return(maxAR)
def removeFromSessionPath(envVar, patern):
</size>
</property>
<property name="toolTip">
- <string>Clear all paramters</string>
+ <string>Clear all parameters</string>
</property>
<property name="text">
<string>Reset</string>
</size>
</property>
<property name="toolTip">
- <string>file adress (ex: /home/A123456/cracked.med)</string>
+ <string>file address (ex: /home/A123456/cracked.med)</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
<item row="1" column="1">
<widget class="QLineEdit" name="valSaneName">
<property name="toolTip">
- <string notr="true">file adress (ex: /home/A123456/cuve.med)</string>
+ <string notr="true">file address (ex: /home/A123456/cuve.med)</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
self.txtSaneName.setObjectName(_fromUtf8("txtSaneName"))
self.gridLayout.addWidget(self.txtSaneName, 1, 0, 1, 1)
self.valSaneName = QtGui.QLineEdit(self.gridLayoutWidget)
- self.valSaneName.setToolTip(_fromUtf8("file adress (ex: /home/A123456/cuve.med)"))
+ self.valSaneName.setToolTip(_fromUtf8("file address (ex: /home/A123456/cuve.med)"))
self.valSaneName.setAutoFillBackground(True)
self.valSaneName.setInputMask(_fromUtf8(""))
self.valSaneName.setText(_fromUtf8(""))
def retranslateUi(self, Zui):
Zui.setWindowTitle(_translate("Zui", "Zcracks interface - version dev", None))
- self.btReset.setToolTip(_translate("Zui", "Clear all paramters", None))
+ self.btReset.setToolTip(_translate("Zui", "Clear all parameters", None))
self.btReset.setText(_translate("Zui", "Reset", None))
self.btSave.setToolTip(_translate("Zui", "Save parameters in a file", None))
self.btSave.setText(_translate("Zui", "Save", None))
self.btApplyClose.setText(_translate("Zui", "Apply and close", None))
self.txtCrackedName.setToolTip(_translate("Zui", "Name of the resulting cracked mesh", None))
self.txtCrackedName.setText(_translate("Zui", "Cracked name", None))
- self.valCrackedName.setToolTip(_translate("Zui", "file adress (ex: /home/A123456/cracked.med)", None))
+ self.valCrackedName.setToolTip(_translate("Zui", "file address (ex: /home/A123456/cracked.med)", None))
self.txtSaneName.setToolTip(_translate("Zui", "Name of the sane mesh", None))
self.txtSaneName.setText(_translate("Zui", "Sane mesh", None))
self.btLoadCracked.setText(_translate("Zui", "...", None))
shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/CubeAngleFiss.brep"), "BREP")
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
- geompy.UnionIDs(fondFiss, [4])
+ geompy.UnionIDs(fondFiss, [3])
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
dicoParams = dict(nomCas = 'cubeCoin',
maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'),
brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Coin.brep"),
- edgeFissIds = [7],
+ edgeFissIds = [6],
lgInfluence = 50,
meshBrep = (5,10),
rayonPipe = 10,
dicoParams = dict(nomCas = 'cubeMilieu',
maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/cubeFin.med'),
brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/cubeFin_Milieu.brep"),
- edgeFissIds = [7],
+ edgeFissIds = [6],
lgInfluence = 50,
meshBrep = (5,10),
rayonPipe = 10,
shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/FissInCylindre2.brep"), "BREP")
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
- geompy.UnionIDs(fondFiss, [7])
+ geompy.UnionIDs(fondFiss, [6])
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
dicoParams = dict(nomCas = 'disque',
maillageSain = os.path.join(gmu.pathBloc, 'materielCasTests/disque.med'),
brepFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests/ellipse_disque.brep"),
- edgeFissIds = [4],
+ edgeFissIds = [3],
lgInfluence = 10,
meshBrep = (0.5,2.5),
rayonPipe = 1.0,
# logging.info("genereGeometrieSaine %s", self.nomCas)
# box = geompy.MakeBox(0, -500, 0, 400, 500, 800, "boiteSaine")
# return [box]
-
+
# ---------------------------------------------------------------------------
def genereMaillageSain(self, geometriesSaines, meshParams):
logging.info("genereMaillageSain %s", self.nomCas)
shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/ellipse1.brep"), "BREP")
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
- geompy.UnionIDs(fondFiss, [4])
+ geompy.UnionIDs(fondFiss, [3])
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"), "BREP")
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
- geompy.UnionIDs(fondFiss, [4])
+ geompy.UnionIDs(fondFiss, [3])
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
# --- peau tube exterieur (PEAUEXT)
- cercle1 = geompy.MakeCircle(centre, OZ, de/2.)
- extru1 = geompy.MakePrismVecH(cercle1, OZ, l_tube_p1)
- revol1 = geompy.MakeRevolution(cercle1, axe, angleCoude*math.pi/180.0)
- rot1 = geompy.MakeRotation(cercle1, axe, angleCoude*math.pi/180.0)
+ Disk_3 = geompy.MakeDiskPntVecR(centre, OZ, de/2. +epais)
+ couronne1 = geompy.MakeCut(Disk_3, Disk_1)
+ extru1 = geompy.MakePrismVecH(couronne1, OZ, l_tube_p1)
+ revol1 = geompy.MakeRevolution(couronne1, axe, angleCoude*math.pi/180.0)
+ rot1 = geompy.MakeRotation(couronne1, axe, angleCoude*math.pi/180.0)
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe)
azimut = -azimut # axe inverse / ASCOUF
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
-
+
if not lgInfluence:
lgInfluence = profondeur
shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/visFiss.brep"), "BREP")
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
- geompy.UnionIDs(fondFiss, [7, 9])
+ geompy.UnionIDs(fondFiss, [6, 8])
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
# General substitutions.
project = 'Plug-in blocFissure'
-copyright = '2010-2016 EDF R&D'
+copyright = '2010-2017 EDF R&D'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
facesPipePeau, edgeRadFacePipePeau, nbsegCercle):
"""
- construction des listes d'edges radiales sur chaque extrémité débouchante
+ construction des listes d'edges radiales sur chaque extrémité débouchante
"""
logging.info('start')
-
+
# --- listes de nappes radiales en filling à chaque extrémité débouchante
-
+
facesDebouchantes = [False, False]
idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau)
listNappes =[]
geomPublish(initLog.debug, nappe, name)
facesDebouchantes[i] = True
listNappes.append(nappes)
-
+
# --- mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)
for i, nappes in enumerate(listNappes):
if facesDebouchantes[i]:
else:
maxl = geompy.BasicProperties(edge)[0]
if maxl < 0.01: # problème MakeSection
- logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
+ logging.info("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0)
edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False)
ednouv = []
for ii, ed in enumerate(edps):
+ dmax=100.
vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
distx = [geompy.MinDistance(vx, face) for vx in vxs]
distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs]
dmax = max(distx)
- logging.debug(" dmax %s",dmax)
- if dmax < 0.01:
+ lgedge = geompy.BasicProperties(ed)[0]
+ logging.debug(" dmax %s, longueur edge %s",dmax, lgedge)
+ if dmax < 0.01 and lgedge > 0.01:
ednouv.append(ed)
- logging.debug(" edges issues de la partition: %s", ednouv)
- for ii, ed in enumerate(ednouv):
- geomPublish(initLog.debug, ed, "ednouv%d"%ii)
- [edsorted, minl,maxl] = sortEdges(ednouv)
- logging.debug(" longueur edge trouvée: %s", maxl)
- edge = edsorted[-1]
+ if (len(ednouv) > 0):
+ logging.debug(" edges issues de la partition: %s", ednouv)
+ for ii, ed in enumerate(ednouv):
+ geomPublish(initLog.debug, ed, "ednouv%d"%ii)
+ [edsorted, minl,maxl] = sortEdges(ednouv)
+ logging.debug(" longueur edge trouvée: %s", maxl)
+ edge = edsorted[-1]
+ else:
+ logging.info("problème partition recherche edge radiale %s", k)
+ vxs = geompy.ExtractShapes(partNappeFace, geompy.ShapeType["VERTEX"], False)
+ vxnouv=[]
+ for ii,vx in enumerate(vxs):
+ distx = geompy.MinDistance(vx, face)
+ distx += geompy.MinDistance(vx, nappes[k])
+ logging.debug("vertex distance: %s", distx)
+ if distx < 0.005:
+ vxnouv.append(vx)
+ logging.debug("nombre vertex candidats %s", len(vxnouv))
+ if len(vxnouv) >= 2:
+ eds = [geompy.MakeEdge(vxnouv[j],vxnouv[(j+1)%len(vxnouv)]) for j in range(len(vxnouv))]
+ [edsorted2, minl,maxl] = sortEdges(eds)
+ edge = edsorted2[-1]
+ logging.debug("lg edge: %s", maxl)
+ else:
+ logging.debug("problème recherche edge radiale %s non résolu", k)
edges.append(edge)
name = 'edgeEndPipe%d'%k
geomPublish(initLog.debug, edge, name)
listEdges.append(edges)
-
+
return (listEdges, idFacesDebouchantes)
\ No newline at end of file
# --- peau tube exterieur (PEAUEXT)
- cercle1 = geompy.MakeCircle(centre, OZ, de/2.)
- extru1 = geompy.MakePrismVecH(cercle1, OZ, l_tube_p1)
- revol1 = geompy.MakeRevolution(cercle1, axe, angleCoude*math.pi/180.0)
- rot1 = geompy.MakeRotation(cercle1, axe, angleCoude*math.pi/180.0)
+ Disk_3 = geompy.MakeDiskPntVecR(centre, OZ, de/2. +epais)
+ extru1 = geompy.MakePrismVecH(Disk_3, OZ, l_tube_p1)
+ revol1 = geompy.MakeRevolution(Disk_3, axe, angleCoude*math.pi/180.0)
+ rot1 = geompy.MakeRotation(Disk_3, axe, angleCoude*math.pi/180.0)
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe)
self.elliptique = False
if shapeFissureParams.has_key('elliptique'):
self.elliptique = shapeFissureParams['elliptique']
-
+
azimut = -azimut # axe inverse / ASCOUF
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
geomPublish(initLog.debug, axe,"axe")
-
+
if not lgInfluence:
lgInfluence = profondeur
lgfond = longueur -2*profondeur
angle = lgfond/(2*raybor)
pb = geompy.MakeVertex(raybor, 0, 0)
- pi = geompy.MakeVertex(rayint, 0, 0)
+ pi = geompy.MakeVertex(rayint, 0, 0)
pbl = geompy.MakeRotation(pb, OZ, angle)
pbr = geompy.MakeRotation(pb, OZ, -angle)
geomPublish(initLog.debug, pbl,"pbl")
pt = geompy.MakeRotation(pil, axl, angi)
points.append(pt)
for i in range(nbp):
- angi = angle -2.0*i*angle/nbp
+ angi = angle -2.0*i*angle/nbp
pt = geompy.MakeRotation(pi, OZ, angi)
points.append(pt)
for i in range(nbp+1):
pt = geompy.MakeTranslation(pt, 0, 0, -l_tube_p1)
pt = geompy.MakeRotation(pt, axe, alpha*math.pi/180.)
points[i] = pt
- wire0 = geompy.MakeInterpol(points[0:nbp+1])
- wire1 = geompy.MakeInterpol(points[nbp:2*nbp+1])
- wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
+ wire0 = geompy.MakeInterpol(points[0:nbp+1])
+ wire1 = geompy.MakeInterpol(points[nbp:2*nbp+1])
+ wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
#wiretube = geompy.MakeInterpol(points)
wiretube=geompy.MakeWire([wire0,wire1,wire2])
geomPublish(initLog.debug, wiretube,"wiretube")
-
+
pe = geompy.MakeVertex(rayext, 0, 0)
pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
pe = geompy.MakeTranslation(pe, 0, 0, -l_tube_p1)
pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
-
+
arce = geompy.MakeArc(points[0], pe, points[-1])
geomPublish(initLog.debug, arce,"arce")
-
+
facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
-
+
pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
geomPublish(initLog.debug, centre, 'centrefissPlace' )
-
+
wiretube = geompy.GetInPlace(facefiss, wiretube)
geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
try:
else:
raybor = de/2. - epais
dp = +1.0
- prof = dp * profondeur
+ prof = dp * profondeur
lgfond = longueur -2*profondeur
cosaz = math.cos(azimut*math.pi/180.)
sinaz = math.sin(azimut*math.pi/180.)
for i in range(nbp+2):
x = math.sin(i*math.pi/(nbp+1)) # fonction de répartition des points : distance relative
x2 = x*x
- totx += x2
+ totx += x2
xs.append(totx)
- logging.debug("x2: %s, totx: %s", x2, totx)
+ logging.debug("x2: %s, totx: %s", x2, totx)
for i in range(nbp+1):
#posi = nbp -i # répartition équidistante des points sur la courbe
posi = nbp*(1 -xs[i]/totx) # points plus resserrés aux extrémités de la courbe
x = math.sin(i*math.pi/nbp)
#x = 1.0 # répartition équidistante des points sur la courbe
x2 = x*x # points plus resserrés aux extrémités de la courbe
- totx += x2
+ totx += x2
xs.append(totx)
- logging.debug("x2: %s, totx: %s", x2, totx)
+ logging.debug("x2: %s, totx: %s", x2, totx)
for i in range(nbp):
- angi = alfrd -angle +2.0*angle*xs[i]/totx
+ angi = alfrd -angle +2.0*angle*xs[i]/totx
pt = geompy.MakeRotation(pi, axe, angi)
points.append(pt)
curves.append(geompy.MakeInterpol(points))
for i in range(nbp+2):
x = math.sin(i*math.pi/(nbp+1))
x2 = x*x
- totx += x2
+ totx += x2
xs.append(totx)
- logging.debug("x2: %s, totx: %s", x2, totx)
+ logging.debug("x2: %s, totx: %s", x2, totx)
for i in range(nbp+1):
#posi = nbp -i # répartition équidistante des points sur la courbe
posi = nbp*xs[i]/totx # points plus resserrés aux extrémités de la courbe
# for i, pt in enumerate(points):
# name = "point%d"%i
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
-
+
wiretube = geompy.MakeWire(curves)
geomPublish(initLog.debug, wiretube,"wiretube")
try:
except:
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
edgetube = None
-
+
pts = []
pts.append(point0)
dpr = prof*math.cos(5.0*math.pi/8.0)
pe = geompy.MakeTranslation(pb, dpr*cosaz, dpr*sinaz, 0., "pe")
for i in range(nbp):
- angi = alfrd -angle +2.0*i*angle/nbp
+ angi = alfrd -angle +2.0*i*angle/nbp
pt = geompy.MakeRotation(pe, axe, angi)
pts.append(pt)
pts.append(point1)
arce = geompy.MakeInterpol(pts)
geomPublish(initLog.debug, arce,"arce")
-
+
facefiss = geompy.MakeFaceWires([arce, wiretube], 0)
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
-
+
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
centre = geompy.MakeRotation(pc, axe, alfrd)
geomPublish(initLog.debug, centre, 'centrefissPlace' )
-
+
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
edgesTriees, minl, maxl = sortEdges(edges)
edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine
else:
raybor = de/2. - epais
dp = +1.0
- prof = dp * profondeur
+ prof = dp * profondeur
cosaz = math.cos(azimut*math.pi/180.)
sinaz = math.sin(azimut*math.pi/180.)
alfrd = alpha*math.pi/180.
cox = geompy.VectorCoordinates(ax1)
coy = geompy.VectorCoordinates(ay1)
localLCS = geompy.MakeMarker(coo[0], coo[1], coo[2], cox[0], cox[1], cox[2], coy[0], coy[1], coy[2], "localLCS")
-
+
pco = geompy.MakeVertex(0, 0, -profondeur, "pco")
pao = geompy.MakeRotation(pco, OY, 0.6*math.pi, "pao")
pbo = geompy.MakeRotation(pco, OY, -0.6*math.pi, "pbo")
edgesTriees, minl, maxl = sortEdges(edges)
edgetube = edgesTriees[-1] # la plus grande correspond à arci
wiretube = edgetube
-
+
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
centre = geompy.MakeRotation(pc, axe, alfrd)
geomPublish(initLog.debug, centre, 'centrefissPlace' )
identification précise des edges et disques des faces de peau selon index extremité fissure
"""
logging.info('start')
-
+
facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
edgeRadFacePipePeau = [None for i in range(len(edgesFissExtPipe))]
-
+
edgesListees = []
edgesCircPeau = []
verticesCircPeau = []
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
-
+
for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
logging.debug("examen face debouchante circulaire")
for i,efep in enumerate(edgesFissExtPipe):
pass
pass
pass
-
+
# --- edges circulaires de la face de peau et points de jonction de la face externe de fissure
logging.debug("facesPipePeau: %s", facesPipePeau)
edgesCircPeau = [None for i in range(len(facesPipePeau))]
- verticesCircPeau = [None for i in range(len(facesPipePeau))]
+ verticesCircPeau = [None for i in range(len(facesPipePeau))]
for i,fcirc in enumerate(facesPipePeau):
edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesBords)
bordsVifs = None
if aretesVivesC is not None:
- logging.debug("identification des bords vifs par GetInPlace (old)")
+ logging.debug("identification des bords vifs par GetInPlace")
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
+ if bordsVifs is None:
+ logging.debug("pas d'identification des bords vifs par GetInPlace: test par distance")
+ edvifs = []
+ arvives = geompy.ExtractShapes(aretesVivesC, geompy.ShapeType["EDGE"], False)
+ edgs = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
+ for ed in edgs:
+ vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
+ for ar in arvives:
+ d = geompy.MinDistance(vxs[0], ar)
+ d += geompy.MinDistance(vxs[1], ar)
+ logging.debug("test distance bord face peau - arete vive: %s",d)
+ if d < 0.001:
+ edvifs.append(ed)
+ break
+ if len(edvifs) >0:
+ bordsVifs = geompy.CreateGroup(facePeau,geompy.ShapeType["EDGE"])
+ for ed in edvifs:
+ geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, ed))
if bordsVifs is not None:
geomPublishInFather(initLog.debug, facePeau, bordsVifs, "bordsVifs")
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
aretesVivesCoupees += edv
logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
geomPublishInFather(initLog.debug, facePeau, groupEdgesBordPeau , "EdgesBords")
-
+
# --- edges de la face de peau partagées avec la face de fissure
-
+
edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
edgesFissurePeau = []
edgesFissurePeau.append(edge)
name = "edgeFissurePeau%d"%i
geomPublishInFather(initLog.debug, facePeau, edge, name)
-
+
return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
bordsVifs, edgesFissurePeau, aretesVivesCoupees)
defaultres = local
# The following sections defines the available configurations.
-# The name of the section can be choosen arbitrary. But the value of
+# The name of the section can be chosen arbitrarily. But the value of
# the resname key MUST be the name of a SALOME resource defined in the
# catalog of resources (CatalogResources.xml).
enum FileType {MED_CONCRETE, MED_STEELBAR};
// This defines a single parameter for the job initialization (a med file)
- struct MeshJobParameter
+ struct MeshJobFile
{
string file_name;
FileType file_type;
string group_name;
};
+ // This defines a set of parameters for the job initialization
+ typedef sequence<MESHJOB::MeshJobFile> MeshJobFileList;
+
+ // This defines a single parameter for the job initialization
+ struct MeshJobParameter
+ {
+ string name;
+ string value;
+ };
+
// This defines a set of parameters for the job initialization
typedef sequence<MESHJOB::MeshJobParameter> MeshJobParameterList;
raises (SALOME::SALOME_Exception);
/*! Initialize a smesh computation job and return the job identifier */
- long initialize(in MESHJOB::MeshJobParameterList meshJobParameterList, in string configId)
+ long initialize(in MESHJOB::MeshJobFileList meshJobFileList,
+ in MESHJOB::MeshJobParameterList MeshJobParameterList,
+ in string configId)
raises (SALOME::SALOME_Exception);
/*! Submit the job execution and return true if submission is OK */
#include <direct.h> // to get _mkdir
#else
#include <unistd.h> // to get basename
+#include <libgen.h> // to get basename - as per posix
#include <sys/stat.h> // to get mkdir
#include <sys/types.h> // to get mkdir options
#endif
* <steelBarMeshFile_N> <steelBarGroupName_N>
* <outputMedFile>
*/
-const char * MeshJobManager_i::_writeDataFile(std::vector<MESHJOB::MeshJobParameter> listConcreteMesh,
- std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh) {
+const char * MeshJobManager_i::_writeDataFile(std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
+ std::vector<MESHJOB::MeshJobFile> listSteelBarMesh,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList) {
#ifdef WIN32
_mkdir(LOCAL_INPUTDIR.c_str());
#else
dataFile << line.c_str() << std::endl;
}
- // Finally, we conclude with the name of the output file
+ // We conclude the list of files with the name of the output file
line = OUTPUTFILE;
dataFile << line.c_str() << std::endl;
+
+ // We put the numerical parameters at the end of the data file
+ for(CORBA::ULong i=0; i<meshJobParameterList.length(); i++) {
+ MESHJOB::MeshJobParameter param = meshJobParameterList[i];
+ line = std::string(param.name) + " " + std::string(param.value);
+ dataFile << line.c_str() << std::endl;
+ }
+
dataFile.close();
return dataFilename->c_str();
}
/*!
- * This function creates a shell script that runs padder whith the
+ * This function creates a shell script that runs padder with the
* specified data file, and returns the path of the created script
* file. The config id is used to retrieve the path to the binary file
* and other required files.
_splitpath( dataFileName, NULL, NULL, fname, NULL );
const char* bname = &fname[0];
#else
- const char* bname = basename(dataFileName);
+ const char* bname = basename(const_cast<char *>(dataFileName));
#endif
long MeshJobManager_i::JOBID_UNDEFINED = -1;
/*! Initialize a smesh computation job and return the job identifier */
-CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobParameterList & meshJobParameterList,
+CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJobFileList,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList,
const char * configId)
{
beginService("MeshJobManager_i::initialize");
//
// We first analyse the CORBA sequence to store data in C++ vectors
//
- std::vector<MESHJOB::MeshJobParameter> listConcreteMesh;
- std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh;
- for(CORBA::ULong i=0; i<meshJobParameterList.length(); i++) {
- MESHJOB::MeshJobParameter currentMesh = meshJobParameterList[i];
+ std::vector<MESHJOB::MeshJobFile> listConcreteMesh;
+ std::vector<MESHJOB::MeshJobFile> listSteelBarMesh;
+ for(CORBA::ULong i=0; i<meshJobFileList.length(); i++) {
+ MESHJOB::MeshJobFile currentMesh = meshJobFileList[i];
switch ( currentMesh.file_type ) {
case MESHJOB::MED_CONCRETE:
listConcreteMesh.push_back(currentMesh);
// data is a text file containing the list of file names and group
// names.
//
- const char * dataFilename = this->_writeDataFile(listConcreteMesh, listSteelBarMesh);
+ const char * dataFilename = this->_writeDataFile(listConcreteMesh, listSteelBarMesh, meshJobParameterList);
LOG("dataFilename = " << dataFilename);
const char * scriptFilename = this->_writeScriptFile(dataFilename, configId);
LOG("scriptFilename = " << scriptFilename);
}
}
- // Then, we have to specify the existance of an output filename. The
+ // Then, we have to specify the existence of an output filename. The
// path is supposed to be a path on the remote resource, i.e. where
// the job is executed.
jobParameters->out_files.length(1);
// account not only the data that could be loaded by the batch
// process but also the linked dynamic library.
//
- // A possible problem, for exemple in the case where you use the ssh
+ // A possible problem, for example in the case where you use the ssh
// emulation of a batch system, is to get an error message as below
// when libBatch try to run the ssh command:
//
// ## /usr/bin/ssh: error while loading shared libraries: libcrypto.so.0.9.8: failed
// ## to map segment from shared object: Cannot allocate memory
//
- // In this exemple, the mem_mb was set to 1MB, value that is not
+ // In this example, the mem_mb was set to 1MB, value that is not
// sufficient to load the dynamic libraries linked to the ssh
// executable (libcrypto.so in the error message).
//
bool configure (const char *configId,
const MESHJOB::ConfigParameter & configParameter);
- CORBA::Long initialize (const MESHJOB::MeshJobParameterList & meshJobParameterList,
+ CORBA::Long initialize (const MESHJOB::MeshJobFileList & meshJobFileList,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList,
const char *configId);
bool start (CORBA::Long jobId);
char* getState (CORBA::Long jobId);
std::map<long, long> _jobDateTimeMap;
std::map<long, MESHJOB::MeshJobPaths*> _jobPathsMap;
- const char* _writeDataFile (std::vector<MESHJOB::MeshJobParameter> listConcreteMesh,
- std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh);
+ const char* _writeDataFile (std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
+ std::vector<MESHJOB::MeshJobFile> listSteelBarMesh,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList);
const char* _writeScriptFile (const char * dataFileName, const char * configId);
std::vector<std::string> * _getResourceNames();
//
extern "C"
{
- PortableServer::ObjectId * SPADDERPluginTesterEngine_factory( CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName)
+ SPADDERPLUGINTESTERENGINE_EXPORT PortableServer::ObjectId *
+ SPADDERPluginTesterEngine_factory( CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName)
{
MESSAGE("PortableServer::ObjectId * SPADDERPluginTesterEngine_factory()");
SPADDERPluginTester_i * myEngine = new SPADDERPluginTester_i(orb, poa, contId, instanceName, interfaceName);
#ifndef _SPADDER_PLUGINTESTER_HXX_
#define _SPADDER_PLUGINTESTER_HXX_
+#ifdef WIN32
+ #if defined SPADDERPLUGINTESTERENGINE_EXPORTS || defined SPADDERPluginTesterEngine_EXPORTS
+ #define SPADDERPLUGINTESTERENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define SPADDERPLUGINTESTERENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define SPADDERPLUGINTESTERENGINE_EXPORT
+#endif
+
// include the stubs generating from SPADDERPluginTest.idl
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SPADDERPluginTest)
#include <SALOME_Component.hh>
#include "SALOME_Component_i.hxx"
-class SPADDERPluginTester_i:
+class SPADDERPLUGINTESTERENGINE_EXPORT SPADDERPluginTester_i:
public virtual POA_SPADDERPluginTest::SPADDERPluginTester,
public Engines_Component_i
{
return datadir
import MESHJOB # to get the enum constant values
-from MESHJOB import MeshJobParameter, MeshJobParameterList
+from MESHJOB import MeshJobFile, MeshJobFileList
DEFAULT_CONCRETE_FILENAME=os.path.join(getTestDataDir(),'concrete.med')
DEFAULT_STEELBAR_LISTFILENAME=[
os.path.join(getTestDataDir(),'ferraill.med')
]
-def getMeshJobParameterList(concrete_filename=DEFAULT_CONCRETE_FILENAME,
+def getMeshJobFileList(concrete_filename=DEFAULT_CONCRETE_FILENAME,
steelbar_listfilename=DEFAULT_STEELBAR_LISTFILENAME):
'''
This helper function creates a complete set of parameters (a
- MeshJobParameterList) for a simple test case, i.e. a case with a
+ MeshJobFileList) for a simple test case, i.e. a case with a
concrete filename and a single steelbar filename.
'''
- # Note that a CORBA sequence (MeshJobParameterList) is mapped on a
+ # Note that a CORBA sequence (MeshJobFileList) is mapped on a
# simple list in python
- meshJobParameterList = []
+ meshJobFileList = []
# We can add some parameters
- param = MeshJobParameter(
+ param = MeshJobFile(
file_name = concrete_filename,
file_type = MESHJOB.MED_CONCRETE,
group_name = "concrete")
- meshJobParameterList.append(param)
+ meshJobFileList.append(param)
for steelbar_filename in steelbar_listfilename:
- param = MeshJobParameter(
+ param = MeshJobFile(
file_name = steelbar_filename,
file_type = MESHJOB.MED_STEELBAR,
group_name = "steelbar")
- meshJobParameterList.append(param)
+ meshJobFileList.append(param)
- return meshJobParameterList
+ return meshJobFileList
def getSpadderCatalogFilename():
# __MEM__: Note that this module does not depend on the SPADDER
# component on purpose (we could have use a derived structure of
-# SPADDER_ORB.MeshJobParameter). This choice is made to ease the test
+# SPADDER_ORB.MeshJobFile). This choice is made to ease the test
# and development of the gui part of the plugin. If this data
# structure becomes too important, we could make another arrangement
-# and use directly a SPADDER_ORB.MeshJobParameter.
+# and use directly a SPADDER_ORB.MeshJobFile.
class InputData(DataModeler):
MESHTYPES=Enumerate([
DEBUG_MODE=True
GROUPNAME_MAXLENGTH=8
+INPUTDATA_KEY_FILES="meshfiles"
+INPUTDATA_KEY_PARAM="parameters"
+
+PARAM_KEY_NBITER = "NbIteration"
+PARAM_KEY_RMAXRMIN = "RmaxRmin"
+PARAM_NBITER_DEFAULT_VALUE = 10
+PARAM_RMAXRMIN_DEFAULT_VALUE = 3
+
class InputDialog(GenericDialog):
TBL_HEADER_LABEL=["Input Mesh", "Output group name"]
-
+
inputValidated = pyqtSignal()
def __init__(self, parent=None, name="InputDialog", modal=0):
icon.addFile(os.path.join(iconfolder,"steelbar.png"))
self.__ui.cmbMeshType.setItemIcon(meshTypeIndex, icon)
self.MESHTYPE_ICONS[meshTypeIndex] = icon
-
+
# The click on btnSmeshObject (signal clicked() emitted by the
# button btnSmeshObject) is connected to the slot
# onSelectSmeshObject, etc ...
self.__ui.tblListInput.horizontalHeader().setStretchLastSection(True)
# Note that the type is not display explicitly in the Qt table
# because it is specified using an icon on the text of the
- # name item.
+ # name item.
+
+ # Setup default values for numerical parameters
+ self.__ui.txtParamNbIter.setValue(PARAM_NBITER_DEFAULT_VALUE)
+ self.__ui.txtParamRmaxRmin.setValue(PARAM_RMAXRMIN_DEFAULT_VALUE)
# Note that PADDER does not support group name longer than 8
# characters. We apply then this limit in the gui field.
self.__ui.txtSmeshObject.setEnabled(False)
self.__ui.btnAddInput.setEnabled(False)
self.__selectedMesh = None
- self.__dictInputData = {}
+ self.__dictInputFiles = {}
self.__nbConcreteMesh = 0
self.__nbSteelbarMesh = 0
"""
# if the entry already exists, we remove it to replace by a
# new one
- if self.__dictInputData.has_key(meshName):
+ if self.__dictInputFiles.has_key(meshName):
self.__delInputFromMap(meshName)
-
+
inputData = InputData()
inputData.meshName = meshName
inputData.meshObject = meshObject
inputData.meshType = meshType
inputData.groupName = groupName
# The key of the map is the mesh name
- self.__dictInputData[meshName] = inputData
+ self.__dictInputFiles[meshName] = inputData
if inputData.meshType == InputData.MESHTYPES.CONCRETE:
self.__nbConcreteMesh += 1
else:
print "meshType = ",inputData.meshType
print "nb concrete mesh ",self.__nbConcreteMesh
print "nb steelbar mesh ",self.__nbSteelbarMesh
-
+
def onDeleteInput(self):
"""
def __delInputFromMap(self, meshName):
"""
This function removes the specified entry from the internal
- map (for data management purpose)
+ map (for data management purpose)
"""
- inputData = self.__dictInputData.pop(meshName)
+ inputData = self.__dictInputFiles.pop(meshName)
if inputData.meshType == InputData.MESHTYPES.CONCRETE:
self.__nbConcreteMesh -= 1
else:
print "nb steelbar mesh ",self.__nbSteelbarMesh
- def setData(self, listInputData=[]):
+ def setData(self, dictInputData={}):
"""
This function fills the dialog widgets with values provided by
the specified data list.
"""
self.clear()
- for inputData in listInputData:
+ if dictInputData.has_key(INPUTDATA_KEY_FILES):
+ listInputData = dictInputData["meshfiles"]
+ for inputData in listInputData:
- meshName = inputData.meshName
- meshObject = inputData.meshObject
- meshType = inputData.meshType
- groupName = inputData.groupName
-
- self.__addInputInGui(meshName, meshObject, meshType, groupName)
- self.__addInputInMap(meshName, meshObject, meshType, groupName)
+ meshName = inputData.meshName
+ meshObject = inputData.meshObject
+ meshType = inputData.meshType
+ groupName = inputData.groupName
- if not DEBUG_MODE:
- self.onSelectSmeshObject()
+ self.__addInputInGui(meshName, meshObject, meshType, groupName)
+ self.__addInputInMap(meshName, meshObject, meshType, groupName)
+
+ if not DEBUG_MODE:
+ self.onSelectSmeshObject()
+
+ if dictInputData.has_key(INPUTDATA_KEY_PARAM):
+ dictInputParameters = dictInputData[INPUTDATA_KEY_PARAM]
+ if dictInputParameters.has_key(PARAM_KEY_NBITER):
+ self.__ui.txtParamNbIter.setValue(dictInputParameters[PARAM_KEY_NBITER])
+ if dictInputParameters.has_key(PARAM_KEY_RMAXRMIN):
+ self.__ui.txtParamRmaxRmin.setValue(dictInputParameters[PARAM_KEY_RMAXRMIN])
def getData(self):
"""
This function returns a list of InputData that corresponds to
the data in the dialog widgets of the current dialog.
"""
+ # Get the list of mesh files
# Note that the values() function returns a copy of the list
# of values.
- return self.__dictInputData.values()
-
+ dictInputData={}
+ dictInputData[INPUTDATA_KEY_FILES] = self.__dictInputFiles.values()
+
+ # Get the list of additionnal parameters
+ dictInputParameters = {}
+ dictInputParameters[PARAM_KEY_NBITER] = self.__ui.txtParamNbIter.value()
+ dictInputParameters[PARAM_KEY_RMAXRMIN] = self.__ui.txtParamRmaxRmin.value()
+ dictInputData[INPUTDATA_KEY_PARAM] = dictInputParameters
+ return dictInputData
+
def checkData(self):
"""
This function checks if the data are valid, from the dialog
"""
if self.__nbConcreteMesh == 0 and self.__nbSteelbarMesh == 0:
self.checkDataMessage = "You must define at least one mesh (CONCRETE or STEELBAR)"
- return False
+ return False
if self.__nbConcreteMesh > 1:
self.checkDataMessage = "You define multiple CONCRETE meshes."
self.checkDataMessage += "You should verify first that your version of PADDER support this configuration."
inputData.groupName = "myGroup"
listInputData = []
listInputData.append(inputData)
-
+
dlg.setData2(listInputData)
-
+
dlg.displayAndWait()
if dlg.wasOk():
print "OK has been pressed"
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>InputFrame</class>
- <widget class="QDialog" name="InputFrame" >
- <property name="geometry" >
+ <widget class="QDialog" name="InputFrame">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>509</width>
- <height>307</height>
+ <width>759</width>
+ <height>656</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Input parameters</string>
</property>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
<item>
- <widget class="QLabel" name="lblSmeshObject" >
- <property name="text" >
- <string>Input MESH / Output group name / Type :</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
+ <widget class="QLabel" name="lblSmeshObject">
+ <property name="text">
+ <string>Input MESH / Output group name / Type :</string>
</property>
- <property name="spacing" >
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QPushButton" name="btnSmeshObject" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize" >
- <size>
- <width>31</width>
- <height>16777215</height>
- </size>
+ <layout class="QHBoxLayout">
+ <property name="spacing">
+ <number>6</number>
</property>
- <property name="text" >
- <string/>
+ <property name="margin">
+ <number>0</number>
</property>
- <property name="icon" >
- <iconset>select.png</iconset>
+ <item>
+ <widget class="QPushButton" name="btnSmeshObject">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>31</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>select.png</normaloff>select.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="txtSmeshObject">
+ <property name="toolTip">
+ <string comment="Select the input mesh in the object browser"/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="txtSmeshObject" >
- <property name="toolTip" >
- <string comment="Select the input mesh in the object browser" />
+ <widget class="QLineEdit" name="txtGroupName">
+ <property name="toolTip">
+ <string comment="Specify the name of the associated group in the output mesh"/>
</property>
</widget>
</item>
- </layout>
- </item>
- <item>
- <widget class="Line" name="line" >
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="txtGroupName" >
- <property name="toolTip" >
- <string comment="Specify the name of the associated group in the output mesh" />
- </property>
- </widget>
- </item>
- <item>
- <widget class="Line" name="line_2" >
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="cmbMeshType" >
- <property name="toolTip" >
- <string comment="Select the type of the mesh" />
- </property>
<item>
- <property name="text" >
- <string>Béton</string>
- </property>
- <property name="icon" >
- <iconset>concrete.png</iconset>
- </property>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
</item>
<item>
- <property name="text" >
- <string>Acier</string>
- </property>
- <property name="icon" >
- <iconset>steelbar.png</iconset>
- </property>
+ <widget class="QComboBox" name="cmbMeshType">
+ <property name="toolTip">
+ <string comment="Select the type of the mesh"/>
+ </property>
+ <item>
+ <property name="text">
+ <string>Beton</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>concrete.png</normaloff>concrete.png</iconset>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Acier</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>steelbar.png</normaloff>steelbar.png</iconset>
+ </property>
+ </item>
+ </widget>
</item>
- </widget>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTableView" name="tblListInput"/>
</item>
</layout>
</item>
- <item>
- <widget class="QTableView" name="tblListInput" />
- </item>
</layout>
</item>
<item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QPushButton" name="btnAddInput" >
- <property name="text" >
+ <widget class="QPushButton" name="btnAddInput">
+ <property name="text">
<string/>
</property>
- <property name="icon" >
- <iconset>addinput.png</iconset>
+ <property name="icon">
+ <iconset>
+ <normaloff>addinput.png</normaloff>addinput.png</iconset>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="btnDeleteInput" >
- <property name="text" >
+ <widget class="QPushButton" name="btnDeleteInput">
+ <property name="text">
<string/>
</property>
- <property name="icon" >
- <iconset>deleteinput.png</iconset>
+ <property name="icon">
+ <iconset>
+ <normaloff>deleteinput.png</normaloff>deleteinput.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</item>
</layout>
</item>
+ <item>
+ <widget class="Line" name="line_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="lblNumericalParameters">
+ <property name="text">
+ <string>Paramètres numériques:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="lblParamNbIter">
+ <property name="text">
+ <string>Nb. Itérations</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lblParamRmaxRmin">
+ <property name="text">
+ <string>Rmax / Rmin</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QSpinBox" name="txtParamNbIter"/>
+ </item>
+ <item>
+ <widget class="QDoubleSpinBox" name="txtParamRmaxRmin"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
</layout>
from qtsalome import QDialog, QIcon, Qt
from plugindialog_ui import Ui_PluginDialog
-from inputdialog import InputDialog
+from inputdialog import InputDialog, INPUTDATA_KEY_FILES, INPUTDATA_KEY_PARAM
+from inputdialog import PARAM_KEY_NBITER, PARAM_KEY_RMAXRMIN
from inputdata import InputData
# __GBO__: uncomment this line and comment the previous one to use the
# demo input dialog instead of the real one.
self.clear()
self.setupJobManager()
-
+
def setupJobManager(self):
'''
the initialize step, by specifing the name of the resource to
be used.
'''
- # We first
-
+ # We first
+
configReader = ConfigReader()
config = configReader.getLocalConfig()
configId = config.resname
# items in the object browser:
self.__inputDialog.setWindowFlags(
self.__inputDialog.windowFlags() | Qt.WindowStaysOnTopHint)
- # The signal inputValidated emited from inputDialog is
+ # The signal inputValidated emitted from inputDialog is
# connected to the slot function onProcessInput:
self.__inputDialog.inputValidated.connect( self.onProcessInput )
-
+
else:
self.__ui.frameInput.setVisible(True)
self.__ui.btnInput.setVisible(False)
def getInputFrame(self):
return self.__ui.frameInput
-
+
def __setGuiState(self,states=["CAN_SELECT"]):
if "CAN_SELECT" in states:
self.__ui.btnInput.setEnabled(True)
else:
self.__ui.btnInput.setEnabled(False)
-
+
if "CAN_COMPUTE" in states:
self.__ui.btnCompute.setEnabled(True)
else:
def __log(self, message):
"""
This function prints the specified message in the log area
- """
+ """
self.__ui.txtLog.append(message)
def __exportMesh(self, meshName, meshObject):
This function clears the log area and the states of the buttons
"""
self.__listInputData = []
+ self.__dictInputParameters = {}
self.__ui.txtLog.clear()
self.__setGuiState(["CAN_SELECT"])
self.__isRunning = False
windows to process the validation event (see the slot
onProcessInput which is connected to this event).
'''
- self.__inputDialog.setData(self.__listInputData)
+ dictInputData = {}
+ dictInputData[INPUTDATA_KEY_FILES] = self.__listInputData
+ dictInputData[INPUTDATA_KEY_PARAM] = self.__dictInputParameters
+ self.__inputDialog.setData(dictInputData)
self.__inputDialog.open()
def onProcessInput(self):
"""
# The processing simply consists in requesting the input data
# from the dialog window.
- self.__listInputData = self.__inputDialog.getData()
+ dictInputData = self.__inputDialog.getData()
+ self.__listInputData = dictInputData[INPUTDATA_KEY_FILES]
+ self.__dictInputParameters = dictInputData[INPUTDATA_KEY_PARAM]
+
self.__ui.lblStatusBar.setText("Input data OK")
self.__log("INF: Press \"Compute\" to start the job")
self.__setGuiState(["CAN_SELECT", "CAN_COMPUTE"])
-
+
def onCompute(self):
'''
This function is the slot connected to the Compute button. It
initializes a mesh computation job and start it using the
- SALOME launcher.
+ SALOME launcher.
'''
# We first have to create the list of parameters for the
# initialize function. For that, we have to create the files
# from the mesh objects:
- meshJobParameterList=[]
+ meshJobFileList=[]
concreteIndex=0
for inputData in self.__listInputData:
# For each input data, we have to create a
- # MeshJobParameter and add it to the list.
+ # MeshJobFile and add it to the list.
filename = self.__exportMesh(inputData.meshName, inputData.meshObject)
if inputData.meshType == InputData.MESHTYPES.CONCRETE:
filetype = MESHJOB.MED_CONCRETE
else:
filetype = MESHJOB.MED_STEELBAR
- parameter = MESHJOB.MeshJobParameter(
+ parameter = MESHJOB.MeshJobFile(
file_name = filename,
file_type = filetype,
group_name = inputData.groupName)
+ meshJobFileList.append(parameter)
+
+ # And to create a list of the additional parameters.
+ # WARN: the CORBA interface requires string values.
+ meshJobParameterList=[]
+ for inputParameterKey in self.__dictInputParameters.keys():
+ value = self.__dictInputParameters[inputParameterKey]
+ parameter = MESHJOB.MeshJobParameter(name=inputParameterKey,value=str(value))
meshJobParameterList.append(parameter)
jobManager = self.__getJobManager()
- self.__jobid = jobManager.initialize(meshJobParameterList, self.__configId)
+ self.__jobid = jobManager.initialize(meshJobFileList, meshJobParameterList, self.__configId)
if self.__jobid < 0:
self.__log("ERR: the job can't be initialized")
self.__log("ERR: %s"%jobManager.getLastErrorMessage())
return
self.__log("INF: the job has been initialized with jobid = "+str(self.__jobid))
-
+
startOk = jobManager.start(self.__jobid)
if not startOk:
self.__log("ERR: the job with jobid = "+str(self.__jobid)+" can't be started")
This function is the slot connected on the Publish button. It
requests the mesh job manager to download the results data
from the computation resource host and load the med file in
- the SALOME study.
+ the SALOME study.
"""
jobManager = self.__getJobManager()
state = jobManager.getState(self.__jobid)
one is running.
"""
self.clear()
-
+
__dialog=None
def getDialog():
"""
- This function returns a singleton instance of the plugin dialog.
+ This function returns a singleton instance of the plugin dialog.
"""
global __dialog
if __dialog is None:
if __name__ == "__main__":
TEST_PluginDialog()
-
+
defaultres = local
# The following sections defines the available configurations.
-# The name of the section can be choosen arbitrary. But the value of
+# The name of the section can be chosen arbitrarily. But the value of
# the resname key MUST be the name of a SALOME resource defined in the
# catalog of resources (CatalogResources.xml).
# padder.cfg).
#
def test00_parameters():
- """Test using a concrete mesh and a single steelbar mesh"""
+ """Test using a concrete mesh and a single steelbar mesh"""
file_concrete=os.path.join(spadder.getTestDataDir(),"concrete.med")
file_steelbar=os.path.join(spadder.getTestDataDir(),"ferraill.med")
- meshJobParameterList = []
- param = MESHJOB.MeshJobParameter(file_name=file_concrete,
+ meshJobFileList = []
+ param = MESHJOB.MeshJobFile(file_name=file_concrete,
file_type=MESHJOB.MED_CONCRETE,
group_name="concrete")
- meshJobParameterList.append(param)
+ meshJobFileList.append(param)
- param = MESHJOB.MeshJobParameter(file_name=file_steelbar,
+ param = MESHJOB.MeshJobFile(file_name=file_steelbar,
file_type=MESHJOB.MED_STEELBAR,
group_name="steelbar")
- meshJobParameterList.append(param)
- return meshJobParameterList
+ meshJobFileList.append(param)
+ return meshJobFileList
def test01_parameters():
"""One concrete mesh and two steelbar meshes"""
datadir = os.path.join(PADDERTESTDIR,"test01")
- meshJobParameterList = []
+ meshJobFileList = []
medfile = os.path.join(datadir,"concrete.med")
- param = MESHJOB.MeshJobParameter(file_name=medfile,
+ param = MESHJOB.MeshJobFile(file_name=medfile,
file_type=MESHJOB.MED_CONCRETE,
group_name="concrete")
- meshJobParameterList.append(param)
-
+ meshJobFileList.append(param)
+
medfile = os.path.join(datadir,"ferraill.med")
- param = MESHJOB.MeshJobParameter(file_name=medfile,
+ param = MESHJOB.MeshJobFile(file_name=medfile,
file_type=MESHJOB.MED_STEELBAR,
group_name="ferraill")
- meshJobParameterList.append(param)
+ meshJobFileList.append(param)
medfile = os.path.join(datadir,"ferrtran.med")
- param = MESHJOB.MeshJobParameter(file_name=medfile,
+ param = MESHJOB.MeshJobFile(file_name=medfile,
file_type=MESHJOB.MED_STEELBAR,
group_name="ferrtran")
- meshJobParameterList.append(param)
-
- return meshJobParameterList
+ meshJobFileList.append(param)
+
+ return meshJobFileList
def test02_parameters():
"""One steelbar mesh only, without a concrete mesh"""
datadir = os.path.join(PADDERTESTDIR,"test02")
- meshJobParameterList = []
+ meshJobFileList = []
medfile = os.path.join(datadir,"cadreef.med")
- param = MESHJOB.MeshJobParameter(file_name=medfile,
+ param = MESHJOB.MeshJobFile(file_name=medfile,
file_type=MESHJOB.MED_STEELBAR,
group_name="cadre")
- meshJobParameterList.append(param)
- return meshJobParameterList
+ meshJobFileList.append(param)
+ return meshJobFileList
def test03_parameters():
"""One concrete mesh only, without a steelbar mesh"""
datadir = os.path.join(PADDERTESTDIR,"test03")
- meshJobParameterList = []
+ meshJobFileList = []
medfile = os.path.join(datadir,"concrete.med")
- param = MESHJOB.MeshJobParameter(file_name=medfile,
+ param = MESHJOB.MeshJobFile(file_name=medfile,
file_type=MESHJOB.MED_CONCRETE,
group_name="concrete")
- meshJobParameterList.append(param)
- return meshJobParameterList
+ meshJobFileList.append(param)
+ return meshJobFileList
#
# =======================================================================
#
# Choose here the use case
-#meshJobParameterList = test00_parameters()
-#meshJobParameterList = test01_parameters()
-#meshJobParameterList = test02_parameters()
-meshJobParameterList = test03_parameters()
+#meshJobFileList = test00_parameters()
+#meshJobFileList = test01_parameters()
+#meshJobFileList = test02_parameters()
+meshJobFileList = test03_parameters()
+
+meshJobParameterList = []
+param = MESHJOB.MeshJobParameter(name="RmaxRmin",value="1.5")
+meshJobParameterList.append(param)
+param = MESHJOB.MeshJobParameter(name="NbIteration",value="3")
+meshJobParameterList.append(param)
#
# Prepare, start and follow-up the job
#
-jobid = component.initialize(meshJobParameterList, configId)
+jobid = component.initialize(meshJobFileList, meshJobParameterList, configId)
if jobid<0:
msg = component.getLastErrorMessage()
print "ERR: %s"%msg
sys.exit(1)
-
+
created = False
nbiter = 0
while not created:
ended=True
time.sleep(0.5)
nbiter+=1
-
+
if state not in end_states:
print "ERR: jobid = "+str(jobid)+" ended abnormally with state="+str(state)
msg = component.getLastErrorMessage()
- print "ERR: %s"%msg
+ print "ERR: %s"%msg
else:
print "OK: jobid = "+str(jobid)+" ended with state="+str(state)
meshJobResults = component.finalize(jobid)