in long SecondNodeIDOnFreeBorder,
in long LastNodeIDOnFreeBorder,
in long FirstNodeIDOnSide,
- in long LastNodeIDOnSide);
+ in long LastNodeIDOnSide,
+ in boolean CreatePoly);
Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
in long_array IDsOfSide2Elements,
}
-#define DUMPSO(txt) \
+/*#define DUMPSO(txt) \
// cout << txt << endl;
//=============================================================================
-/*!
- *
- */
+//
+//
+//
//=============================================================================
static void swap( int i1, int i2, int idNodes[], gp_Pnt P[] )
{
// }
return true;
-}
+}*/
//=======================================================================
//function : laplacianSmooth
LinkID_Gen aLinkID_Gen( GetMeshDS() );
set<long> foundSideLinkIDs, checkedLinkIDs;
SMDS_VolumeTool volume;
- const SMDS_MeshNode* faceNodes[ 4 ];
+ //const SMDS_MeshNode* faceNodes[ 4 ];
const SMDS_MeshNode* sideNode;
const SMDS_MeshElement* sideElem;
const SMDS_MeshElement* elem = invElemIt->next();
// prepare data for a loop on links, of a face or a volume
int iPrevNode, iNode = 0, nbNodes = elem->NbNodes();
+ const SMDS_MeshNode* faceNodes[ nbNodes ];
bool isVolume = volume.Set( elem );
const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : faceNodes;
if ( isVolume ) // --volume
// find indices of 2 link nodes and of the rest nodes
int iNode = 0, il1, il2, i3, i4;
il1 = il2 = i3 = i4 = -1;
- const SMDS_MeshNode* nodes[ 8 ];
+ const SMDS_MeshNode* nodes[ theFace->NbNodes() ];
SMDS_ElemIteratorPtr nodeIt = theFace->nodesIterator();
while ( nodeIt->more() ) {
const SMDS_MeshNode* n = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
// arrange link nodes to go one after another regarding the face orientation
bool reverse = ( Abs( il2 - il1 ) == 1 ? il2 < il1 : il1 < il2 );
+ list<const SMDS_MeshNode *> aNodesToInsert = theNodesToInsert;
if ( reverse ) {
iNode = il1;
il1 = il2;
il2 = iNode;
- theNodesToInsert.reverse();
+ aNodesToInsert.reverse();
}
// check that not link nodes of a quadrangles are in good order
int nbFaceNodes = theFace->NbNodes();
if (toCreatePoly || theFace->IsPoly()) {
iNode = 0;
- vector<const SMDS_MeshNode *> poly_nodes (nbFaceNodes + theNodesToInsert.size());
+ vector<const SMDS_MeshNode *> poly_nodes (nbFaceNodes + aNodesToInsert.size());
// add nodes of face up to first node of link
bool isFLN = false;
}
// add nodes to insert
- list<const SMDS_MeshNode*>::iterator nIt = theNodesToInsert.begin();
- for (; nIt != theNodesToInsert.end(); nIt++) {
+ list<const SMDS_MeshNode*>::iterator nIt = aNodesToInsert.begin();
+ for (; nIt != aNodesToInsert.end(); nIt++) {
poly_nodes[iNode++] = *nIt;
}
return;
}
- // put theNodesToInsert between theBetweenNode1 and theBetweenNode2
- int nbLinkNodes = 2 + theNodesToInsert.size();
+ // put aNodesToInsert between theBetweenNode1 and theBetweenNode2
+ int nbLinkNodes = 2 + aNodesToInsert.size();
const SMDS_MeshNode* linkNodes[ nbLinkNodes ];
linkNodes[ 0 ] = nodes[ il1 ];
linkNodes[ nbLinkNodes - 1 ] = nodes[ il2 ];
- list<const SMDS_MeshNode*>::iterator nIt = theNodesToInsert.begin();
- for ( iNode = 1; nIt != theNodesToInsert.end(); nIt++ ) {
+ list<const SMDS_MeshNode*>::iterator nIt = aNodesToInsert.begin();
+ for ( iNode = 1; nIt != aNodesToInsert.end(); nIt++ ) {
linkNodes[ iNode++ ] = *nIt;
}
// decide how to split a quadrangle: compare possible variants
// insert theNodesToInsert into theFace between theBetweenNode1 and theBetweenNode2.
// If toCreatePoly is true, replace theFace by polygon, else split theFace.
- static int SortQuadNodes (const SMDS_Mesh * theMesh,
- int theNodeIds[] );
- // Set 4 nodes of a quadrangle face in a good order.
- // Swap 1<->2 or 2<->3 nodes and correspondingly return
- // 1 or 2 else 0.
-
- static bool SortHexaNodes (const SMDS_Mesh * theMesh,
- int theNodeIds[] );
- // Set 8 nodes of a hexahedron in a good order.
- // Return success status
+// static int SortQuadNodes (const SMDS_Mesh * theMesh,
+// int theNodeIds[] );
+// // Set 4 nodes of a quadrangle face in a good order.
+// // Swap 1<->2 or 2<->3 nodes and correspondingly return
+// // 1 or 2 else 0.
+//
+// static bool SortHexaNodes (const SMDS_Mesh * theMesh,
+// int theNodeIds[] );
+// // Set 8 nodes of a hexahedron in a good order.
+// // Return success status
static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
const SMDS_MeshElement* elemInGroups,
myOk1 = myOk2 = myOk3 = myOk4 = myOk5 = myOk6 = false;
myEditCurrentArgument = LineEdit1;
myEditCurrentArgument->setFocus();
-
+
if (!TextLabel5->isEnabled())
{
TextLabel5->setEnabled(true);
SelectButton6->setEnabled(true);
LineEdit6->setEnabled(true);
}
-
+
if (constructorId != 0 && CheckBoxPoly->isVisible())
CheckBoxPoly->hide();
-
+
switch(constructorId)
{
case 0 :
if (!CheckBoxPoly->isVisible())
CheckBoxPoly->show();
-
+
break;
}
case 1 :
GroupArguments->setTitle( tr( "SEW_CONFORM_FREE_BORDERS" ) );
SubGroup1->setTitle( tr( "BORDER_1" ) );
SubGroup2->setTitle( tr( "BORDER_2" ) );
-
+
TextLabel6->setEnabled(false);
SelectButton6->setEnabled(false);
LineEdit6->setEnabled(false);
-
+
myOk6 = true;
-
+
break;
}
case 2 :
TextLabel5->setEnabled(false);
SelectButton5->setEnabled(false);
LineEdit5->setEnabled(false);
-
+
+ if (!CheckBoxPoly->isVisible())
+ CheckBoxPoly->show();
+
myOk5 = true;
break;
GroupArguments->setTitle( tr( "SEW_SIDE_ELEMENTS" ) );
SubGroup1->setTitle( tr( "SIDE_1" ) );
SubGroup2->setTitle( tr( "SIDE_2" ) );
-
+
TextLabel1->setText( tr( "SMESH_ID_ELEMENTS" ) );
TextLabel2->setText( tr( "NODE1_TO_MERGE" ) );
TextLabel3->setText( tr( "NODE2_TO_MERGE" ) );
break;
}
}
-
+
if (constructorId != 3)
{
TextLabel1->setText( tr( "FIRST_NODE_ID" ) );
TextLabel4->setText( tr( "FIRST_NODE_ID" ) );
TextLabel5->setText( tr( "SECOND_NODE_ID" ) );
TextLabel6->setText( tr( "LAST_NODE_ID" ) );
-
+
LineEdit1->setValidator( new SMESHGUI_IdValidator( this, "validator", 1));
LineEdit4->setValidator( new SMESHGUI_IdValidator( this, "validator", 1));
SMESH::SetPointRepresentation(true);
QAD_Application::getDesktop()->SetSelectionMode( NodeSelection, true );
}
-
+
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
LineEdit2->text().toLong(),
LineEdit3->text().toLong(),
LineEdit4->text().toLong(),
- LineEdit6->text().toLong());
+ LineEdit6->text().toLong(),
+ toCreatePoly);
else if (aConstructorId == 3)
{
QStringList aListElementsId1 = QStringList::split( " ", LineEdit1->text(), false);
CORBA::Long SecondNodeIDOnFreeBorder,
CORBA::Long LastNodeIDOnFreeBorder,
CORBA::Long FirstNodeIDOnSide,
- CORBA::Long LastNodeIDOnSide)
+ CORBA::Long LastNodeIDOnSide,
+ CORBA::Boolean CreatePoly)
{
SMESHDS_Mesh* aMesh = GetMeshDS();
aSide2SecondNode,
aSide2ThirdNode,
false,
- false) );
+ CreatePoly) );
}
//=======================================================================
CORBA::Long SecondNodeIDOnFreeBorder,
CORBA::Long LastNodeIDOnFreeBorder,
CORBA::Long FirstNodeIDOnSide,
- CORBA::Long LastNodeIDOnSide);
+ CORBA::Long LastNodeIDOnSide,
+ CORBA::Boolean CreatePoly);
SMESH::SMESH_MeshEditor::Sew_Error
SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
const SMESH::long_array& IDsOfSide2Elements,