// Copyright (C) 2003 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.
+//
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
long_array indexes;
};
- struct PointStruct { double x;
- double y;
- double z; } ;
+ struct PointStruct { double x;
+ double y;
+ double z; } ;
struct DirStruct { PointStruct PS ; } ; // analog to Occ Direction
-
+
struct AxisStruct { double x;
double y;
double z;
double vy;
double vz; } ;
-
+
/*!
* Enumeration for element type, like in SMDS
*/
FACE,
VOLUME
};
-
+
/*!
- * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
- */
+ * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
+ */
enum Hypothesis_Status // in the order of severity
{
HYP_OK,
HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
HYP_ALREADY_EXIST,// such hypothesis already exist
HYP_BAD_DIM // bad dimension
- };
-
+ };
+
/*!
* Enumeration for DriverMED read status (used by ImportMEDFile() method)
- */
+ */
enum DriverMED_ReadStatus // in the order of severity
{
DRS_OK,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_FAIL // general failure (exception etc.)
- };
+ };
/*!
* Enumeration for DriverMED (used by Perform() method)
- */
+ */
enum MED_VERSION // in the order of severity
{
MED_V2_1,
*/
long_array GetIDs();
};
-
+
interface SMESH_GroupBase;
interface SMESH_Group;
interface SMESH_GroupOnGeom;
interface SMESH_MeshEditor;
interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
{
- /*!
- * Associate a Shape to a Mesh created with NewEmpty
- */
-
-// boolean SetMesh(in GEOM::GEOM_Object anObject)
-// raises (SALOME::SALOME_Exception);
+ ///*!
+ // * Associate a Shape to a Mesh created with NewEmpty
+ // */
+ //boolean SetMesh(in GEOM::GEOM_Object anObject)
+ // raises (SALOME::SALOME_Exception);
/*!
* Get the subMesh object associated to a subShape. The subMesh object
* gives access to nodes and elements IDs.
- * SubMesh will be used instead of SubShape in a next idl version to
+ * SubMesh will be used instead of SubShape in a next idl version to
* adress a specific subMesh...
*/
SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
raises (SALOME::SALOME_Exception);
- /*!
- * Create a subMesh without reference to a subShape
- */
-// SMESH_subMesh NewEmpty()
-// raises (SALOME::SALOME_Exception);
+ ///*!
+ // * Create a subMesh without reference to a subShape
+ // */
+ //SMESH_subMesh NewEmpty()
+ // raises (SALOME::SALOME_Exception);
/*!
* Get geom shape to mesh. A result may be nil
void RemoveGroup(in SMESH_GroupBase aGroup)
raises (SALOME::SALOME_Exception);
- /*!
+ /*!
* Remove group with its contents
*/
void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
- raises (SALOME::SALOME_Exception);
+ raises (SALOME::SALOME_Exception);
/*!
* Union of two groups
- * New group is created. All mesh elements that are
+ * New group is created. All mesh elements that are
* present in initial groups are added to the new one
*/
SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
in SMESH_GroupBase aGroup2,
in string name )
- raises (SALOME::SALOME_Exception);
+ raises (SALOME::SALOME_Exception);
/*!
* Intersection of two groups
- * New group is created. All mesh elements that are
+ * New group is created. All mesh elements that are
* present in both initial groups are added to the new one.
*/
SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
in SMESH_GroupBase aGroup2,
in string name )
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Cut of two groups
- * New group is created. All mesh elements that are present in
- * main group but do not present in tool group are added to the new one
- */
- SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
- in SMESH_GroupBase aToolGroup,
- in string name )
- raises (SALOME::SALOME_Exception);
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Cut of two groups
+ * New group is created. All mesh elements that are present in
+ * main group but do not present in tool group are added to the new one
+ */
+ SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
+ in SMESH_GroupBase aToolGroup,
+ in string name )
+ raises (SALOME::SALOME_Exception);
/*!
* Add hypothesis to the mesh, under a particular subShape
* @params
* - aSubShape : subShape obtained by a shape explode in GEOM
* (or main shape)
- * - anHyp : hypothesis object
+ * - anHyp : hypothesis object
* @return
- * - OK if the hypothesis is compatible with the subShape
+ * - OK if the hypothesis is compatible with the subShape
* (and all previous hypothesis on the subShape)
* - NOK if the hypothesis is not compatible with the subShape
* (or one previous hypothesis on the subShape)
// boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
// raises (SALOME::SALOME_Exception);
-
/*!
* Remove an hypothesis previouly added with AddHypothesis.
*/
raises (SALOME::SALOME_Exception);
/*!
- * Get the internal Id
+ * Get the internal Id
*/
- long GetId();
+ long GetId();
/*!
- * Get the study Id
+ * Get the study Id
*/
- long GetStudyId();
-
- SMESH_MeshEditor GetMeshEditor()
- raises (SALOME::SALOME_Exception);
+ long GetStudyId();
+
+ /*!
+ * Obtain instance of SMESH_MeshEditor
+ */
+ SMESH_MeshEditor GetMeshEditor()
+ raises (SALOME::SALOME_Exception);
/*!
* Export Mesh to different MED Formats
*/
void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
raises (SALOME::SALOME_Exception);
+
/*!
* Export Mesh to MED_V2_1 MED format
* Works, just the same as ExportToMED, with MED_VERSION parameter equal to MED_V2_1.
SALOME_MED::MESH GetMEDMesh()
raises (SALOME::SALOME_Exception);
+ /*!
+ * Get informations about mesh contents
+ */
long NbNodes()
raises (SALOME::SALOME_Exception);
long_array GetNodesId()
raises (SALOME::SALOME_Exception);
+ /*!
+ * Get mesh description
+ */
string Dump();
};
interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
{
/*!
- *
+ *
*/
long GetNumberOfElements()
raises (SALOME::SALOME_Exception);
/*!
- *
+ *
*/
long GetNumberOfNodes( in boolean all )
raises (SALOME::SALOME_Exception);
/*!
- *
+ *
*/
long_array GetElementsId()
raises (SALOME::SALOME_Exception);
/*!
- *
+ *
*/
long_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception);
/*!
- *
+ *
*/
long_array GetNodesId()
raises (SALOME::SALOME_Exception);
raises (SALOME::SALOME_Exception);
/*!
- * Get the internal Id
+ * Get the internal Id
*/
- long GetId();
+ long GetId();
/*!
* Get MED subMesh
SALOME_MED::FAMILY GetFamily()
raises (SALOME::SALOME_Exception);
};
-
+
/*!
* This interface makes modifications on the Mesh - removing elements and nodes etc.
*/
interface NumericalFunctor;
- interface SMESH_MeshEditor {
-
-
+ interface SMESH_MeshEditor
+ {
boolean RemoveElements(in long_array IDsOfElements);
boolean RemoveNodes(in long_array IDsOfNodes);
boolean AddVolume(in long_array IDsOfNodes);
- //boolean AddPolygonalFace (in long_array IdsOfNodes);
-
/*!
* Create volume of many faces, giving nodes for each face.
* \param IdsOfNodes List of node IDs for volume creation face by face.
boolean DeleteDiag(in long NodeID1, in long NodeID2);
boolean Reorient(in long_array IDsOfElements);
-
- boolean ReorientObject(in SMESH_IDSource theObject);
-
- boolean TriToQuad(in long_array IDsOfElements,
- in NumericalFunctor Criterion,
- in double MaxAngle);
-
- boolean TriToQuadObject(in SMESH_IDSource theObject,
- in NumericalFunctor Criterion,
- in double MaxAngle);
-
- boolean QuadToTri(in long_array IDsOfElements,
- in NumericalFunctor Criterion);
-
- boolean SplitQuad(in long_array IDsOfElements,
- in boolean Diag13);
-
- boolean SplitQuadObject(in SMESH_IDSource theObject,
- in boolean Diag13);
+
+ boolean ReorientObject(in SMESH_IDSource theObject);
+
+ /*!
+ * \brief Fuse neighbour triangles into quadrangles.
+ * \param theElems The triangles to be fused.
+ * \param theCriterion Is used to choose a neighbour to fuse with.
+ * \param theMaxAngle Is a max angle between element normals at which fusion
+ * is still performed; theMaxAngle is mesured in radians.
+ * \return TRUE in case of success, FALSE otherwise.
+ */
+ boolean TriToQuad (in long_array IDsOfElements,
+ in NumericalFunctor Criterion,
+ in double MaxAngle);
+
+ /*!
+ * \brief Fuse neighbour triangles into quadrangles.
+ *
+ * Behaves like the above method, taking list of elements from \a theObject
+ */
+ boolean TriToQuadObject (in SMESH_IDSource theObject,
+ in NumericalFunctor Criterion,
+ in double MaxAngle);
+
+ /*!
+ * \brief Split quadrangles into triangles.
+ * \param theElems The faces to be splitted.
+ * \param theCriterion Is used to choose a diagonal for splitting.
+ * \return TRUE in case of success, FALSE otherwise.
+ */
+ boolean QuadToTri (in long_array IDsOfElements,
+ in NumericalFunctor Criterion);
+
+ /*!
+ * \brief Split quadrangles into triangles.
+ *
+ * Behaves like the above method, taking list of elements from \a theObject
+ */
+ boolean QuadToTriObject (in SMESH_IDSource theObject,
+ in NumericalFunctor Criterion);
+
+ /*!
+ * \brief Split quadrangles into triangles.
+ * \param theElems The faces to be splitted.
+ * \param the13Diag Is used to choose a diagonal for splitting.
+ * \return TRUE in case of success, FALSE otherwise.
+ */
+ boolean SplitQuad (in long_array IDsOfElements,
+ in boolean Diag13);
+
+ /*!
+ * \brief Split quadrangles into triangles.
+ *
+ * Behaves like the above method, taking list of elements from \a theObject
+ */
+ boolean SplitQuadObject (in SMESH_IDSource theObject,
+ in boolean Diag13);
+
+ /*!
+ * Find better splitting of the given quadrangle.
+ * \param IDOfQuad ID of the quadrangle to be splitted.
+ * \param Criterion A criterion to choose a diagonal for splitting.
+ * \return 1 if 1-3 diagonal is better, 2 if 2-4
+ * diagonal is better, 0 if error occurs.
+ */
+ long BestSplit (in long IDOfQuad,
+ in NumericalFunctor Criterion);
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
in double AngleInRadians,
in long NbOfSteps,
in double Tolerance);
-
+
void ExtrusionSweep(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps);
enum Extrusion_Error {
EXTR_OK,
- EXTR_NO_ELEMENTS,
+ EXTR_NO_ELEMENTS,
EXTR_PATH_NOT_EDGE,
EXTR_BAD_PATH_SHAPE,
EXTR_BAD_STARTING_NODE,
void TranslateObject (in SMESH_IDSource theObject,
in DirStruct Vector,
in boolean Copy);
-
+
void Rotate (in long_array IDsOfElements,
in AxisStruct Axis,
in double AngleInRadians,
in AxisStruct Axis,
in double AngleInRadians,
in boolean Copy);
-
+
void FindCoincidentNodes (in double Tolerance,
out array_of_long_array GroupsOfNodes);
// Copyright (C) 2003 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
+// 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.
-//
-// This library is distributed in the hope that it will be useful,
+// version 2.1 of the License.
+//
+// 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
+// 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
-//
+//
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
#include "SMESH_ControlsDef.hxx"
/*
- AUXILIARY METHODS
+ AUXILIARY METHODS
*/
namespace{
inline double getAngle( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
{
gp_Vec v1( P1 - P2 ), v2( P3 - P2 );
-
+
return v1.Magnitude() < gp::Resolution() ||
v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
}
{
if ( theMesh == 0 )
return 0;
-
+
const SMDS_MeshElement* anEdge = theMesh->FindElement( theId );
if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge || anEdge->NbNodes() != 2 )
return 0;
-
+
TColStd_MapOfInteger aMap;
-
+
int aResult = 0;
SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
if ( anIter != 0 ) {
const SMDS_MeshElement* anElem = anElemIter->next();
if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
int anId = anElem->GetID();
-
+
if ( anIter->more() ) // i.e. first node
aMap.Add( anId );
else if ( aMap.Contains( anId ) )
}
}
}
-
+
return aResult;
}
aMin = getAngle(P( P.size() ), P( 1 ), P( 2 ));
aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 )));
-
+
for (int i=2; i<P.size();i++){
double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) );
aMin = Min(aMin,A0);
}
- return aMin * 180 / PI;
+ return aMin * 180.0 / PI;
}
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
{
- const double aBestAngle = PI / nbNodes;
+ //const double aBestAngle = PI / nbNodes;
+ const double aBestAngle = 180.0 - ( 360.0 / double(nbNodes) );
return ( fabs( aBestAngle - Value ));
}
// Compute aspect ratio
- if ( nbNodes == 3 )
+ if ( nbNodes == 3 )
{
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
if ( anArea <= Precision::Confusion() )
{
double aMinLen = aLen[ 0 ];
double aMaxLen = aLen[ 0 ];
-
+
for(int i = 1; i < nbNodes ; i++ ){
aMinLen = Min( aMinLen, aLen[ i ] );
aMaxLen = Max( aMaxLen, aLen[ i ] );
}
if ( aMinLen <= Precision::Confusion() )
return 0.;
-
+
return aMaxLen / aMinLen;
}
}
double Q = b2*f2*(a2+c2+d2+e2-b2-f2);
double R = c2*d2*(a2+b2+e2+f2-c2-d2);
double S = a2*b2*d2+b2*c2*e2+a2*c2*f2+d2*e2*f2;
-
+
return sqrt(P+Q+R-S)/12.0;
}
return Max( A0, Max( A1, A2 ) ) * 180 / PI;
}
- else
+ else
{
gp_XYZ p12 = ( P( 1 ) + P( 2 ) ) / 2;
gp_XYZ p23 = ( P( 2 ) + P( 3 ) ) / 2;
TSequenceOfXYZ P;
if (GetPoints(theElementId,P)){
-
+
double aVal;// = GetValue( P );
const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
SMDSAbs_ElementType aType = aElem->GetType();
-
+
int len = P.size();
-
+
switch (aType){
case SMDSAbs_All:
- case SMDSAbs_Node:
+ case SMDSAbs_Node:
case SMDSAbs_Edge:
if (len == 2){
aVal = getDistance( P( 1 ), P( 2 ) );
double L6 = getDistance(P( 3 ),P( 4 ));
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
break;
- }
+ }
else if (len == 5){ // piramids
double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 ));
double L6 = getDistance(P( 2 ),P( 5 ));
double L7 = getDistance(P( 3 ),P( 5 ));
double L8 = getDistance(P( 4 ),P( 5 ));
-
+
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
aVal = Max(aVal,Max(L7,L8));
break;
double L7 = getDistance(P( 1 ),P( 4 ));
double L8 = getDistance(P( 2 ),P( 5 ));
double L9 = getDistance(P( 3 ),P( 6 ));
-
+
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
aVal = Max(aVal,Max(Max(L7,L8),L9));
break;
double L10= getDistance(P( 2 ),P( 6 ));
double L11= getDistance(P( 3 ),P( 7 ));
double L12= getDistance(P( 4 ),P( 8 ));
-
+
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(L5,L6));
aVal = Max(aVal,Max(Max(L7,L8),Max(L9,L10)));
aVal = Max(aVal,Max(L11,L12));
break;
-
+
}
-
- default: aVal=-1;
+
+ default: aVal=-1;
}
-
+
if (aVal <0){
return 0.;
}
double prec = pow( 10., (double)( myPrecision ) );
aVal = floor( aVal * prec + 0.5 ) / prec;
}
-
+
return aVal;
}
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
long aNodeId[2];
gp_Pnt P[3];
-
+
double aLength;
const SMDS_MeshElement* aNode;
if(aNodesIter->more()){
P[0] = P[1] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
aNodeId[0] = aNodeId[1] = aNode->GetID();
aLength = 0;
- }
+ }
for(; aNodesIter->more(); ){
aNode = aNodesIter->next();
const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode;
long anId = aNode->GetID();
-
+
P[2] = gp_Pnt(aNodes->X(),aNodes->Y(),aNodes->Z());
aLength = P[1].Distance(P[2]);
-
+
Value aValue(aLength,aNodeId[1],anId);
aNodeId[1] = anId;
P[1] = P[2];
theValues.insert(aValue);
}
-
+
aLength = P[0].Distance(P[1]);
-
+
Value aValue(aLength,aNodeId[0],aNodeId[1]);
theValues.insert(aValue);
}
{
TSequenceOfXYZ P;
int aResult = 0;
-
+
if (GetPoints(theElementId,P)){
const SMDS_MeshElement* anFaceElem = myMesh->FindElement( theElementId );
SMDSAbs_ElementType aType = anFaceElem->GetType();
-
+
int len = P.size();
-
+
TColStd_MapOfInteger aMap;
int aResult = 0;
-
+
switch (aType){
case SMDSAbs_All:
- case SMDSAbs_Node:
+ case SMDSAbs_Node:
case SMDSAbs_Edge:
case SMDSAbs_Face:
if (len == 3){ // triangles
}
}
}
-
+
aResult = Max(Max(Nb[0],Nb[1]),Nb[2]);
}
break;
case SMDSAbs_Volume:
default: aResult=0;
}
-
+
}
return aResult;//getNbMultiConnection( myMesh, theId );
}
aNode2 = (SMDS_MeshNode*) aNodesIter->next();
long anId = aNode2->GetID();
aNodeId[2] = anId;
-
+
Value aValue(aNodeId[1],aNodeId[2]);
MValues::iterator aItr = theValues.find(aValue);
if (aItr != theValues.end()){
{
int anId = anElem->GetID();
- if ( i == 0 )
+ if ( i == 0 )
aMap.Add( anId );
else if ( aMap.Contains( anId ) && anId != theFaceId )
return false;
return true;
aNodes[ 1 ] = aNodes[ nbNodes - 1 ];
-
+
return IsFreeEdge( &aNodes[ 0 ], theId );
}
}
inline void UpdateBorders(const FreeEdges::Border& theBorder,
- FreeEdges::TBorders& theRegistry,
+ FreeEdges::TBorders& theRegistry,
FreeEdges::TBorders& theContainer)
{
if(theRegistry.find(theBorder) == theRegistry.end()){
if(aNodesIter->more()){
aNode = aNodesIter->next();
aNodeId[0] = aNodeId[1] = aNode->GetID();
- }
+ }
for(; aNodesIter->more(); ){
aNode = aNodesIter->next();
long anId = aNode->GetID();
//=======================================================================
// name : SetMesh
-// Purpose : Set mesh
+// Purpose : Set mesh
//=======================================================================
void RangeOfIds::SetMesh( const SMDS_Mesh* theMesh )
{
TCollection_AsciiString aStr;
if ( aMinId != IntegerFirst() )
aStr += aMinId;
-
+
aStr += "-";
-
+
if ( aMaxId != IntegerLast() )
aStr += aMaxId;
{
tmpStr = aStr.Token( ",", i++ );
int aPos = tmpStr.Search( '-' );
-
+
if ( aPos == -1 )
{
if ( tmpStr.IsIntegerValue() )
{
TCollection_AsciiString aMaxStr = tmpStr.Split( aPos );
TCollection_AsciiString aMinStr = tmpStr;
-
+
while ( aMinStr.Search( "-" ) != -1 ) aMinStr.RemoveAll( '-' );
while ( aMaxStr.Search( "-" ) != -1 ) aMaxStr.RemoveAll( '-' );
if ( !aMinStr.IsEmpty() && !aMinStr.IsIntegerValue() ||
!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue() )
return false;
-
+
myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() );
myMax.Append( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() );
}
if ( anElem == 0 || myType != anElem->GetType() && myType != SMDSAbs_All )
return false;
}
-
+
if ( myIds.Contains( theId ) )
return true;
*/
bool LogicalAND::IsSatisfy( long theId )
{
- return
- myPredicate1 &&
- myPredicate2 &&
- myPredicate1->IsSatisfy( theId ) &&
+ return
+ myPredicate1 &&
+ myPredicate2 &&
+ myPredicate1->IsSatisfy( theId ) &&
myPredicate2->IsSatisfy( theId );
}
*/
bool LogicalOR::IsSatisfy( long theId )
{
- return
- myPredicate1 &&
- myPredicate2 &&
- myPredicate1->IsSatisfy( theId ) ||
+ return
+ myPredicate1 &&
+ myPredicate2 &&
+ myPredicate1->IsSatisfy( theId ) ||
myPredicate2->IsSatisfy( theId );
}
myPredicate = thePredicate;
}
-template<class TElement, class TIterator, class TPredicate>
+template<class TElement, class TIterator, class TPredicate>
inline void FillSequence(const TIterator& theIterator,
TPredicate& thePredicate,
Filter::TIdSequence& theSequence)
void
Filter::
-GetElementsId( const SMDS_Mesh* theMesh,
- PredicatePtr thePredicate,
+GetElementsId( const SMDS_Mesh* theMesh,
+ PredicatePtr thePredicate,
TIdSequence& theSequence )
{
theSequence.clear();
- if ( !theMesh || !thePredicate )
+ if ( !theMesh || !thePredicate )
return;
thePredicate->SetMesh( theMesh );
typedef std::set<SMDS_MeshFace*> TMapOfFacePtr;
-/*
+/*
Internal class Link
-*/
+*/
ManifoldPart::Link::Link( SMDS_MeshNode* theNode1,
SMDS_MeshNode* theNode2 )
bool ManifoldPart::IsEqual( const ManifoldPart::Link& theLink1,
const ManifoldPart::Link& theLink2 )
-{
+{
return theLink1.IsEqual( theLink2 );
}
{
myMapIds.Clear();
myMapBadGeomIds.Clear();
-
+
myAllFacePtr.clear();
myAllFacePtrIntDMap.clear();
if ( !myMesh )
if ( fi == aStartIndx )
isStartTreat = true;
// as result next time when fi will be equal to aStartIndx
-
+
SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ];
if ( aMapOfTreated.Contains( aFacePtr->GetID() ) )
continue;
SMDS_MeshNode* aNode = 0;
for ( ; aNodeItr->more() && i <= aNbNode; )
{
-
+
SMDS_MeshNode* aN1 = (SMDS_MeshNode*)aNodeItr->next();
if ( i == 1 )
aNode = aN1;
SMDS_MeshNode* aNode = (SMDS_MeshNode*)aNodeItr->next();
anArrOfXYZ.SetValue(i, gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
}
-
+
gp_XYZ q1 = anArrOfXYZ.Value(2) - anArrOfXYZ.Value(1);
gp_XYZ q2 = anArrOfXYZ.Value(3) - anArrOfXYZ.Value(1);
n = q1 ^ q2;
theResFaces.Clear();
if ( !theAllFacePtrInt.size() )
return false;
-
+
if ( getNormale( theStartFace ).SquareModulus() <= gp::Resolution() )
{
myMapBadGeomIds.Add( theStartFace->GetID() );
theResFaces.Add( theStartFace->GetID() );
ManifoldPart::TDataMapOfLinkFacePtr aDMapLinkFace;
- expandBoundary( aMapOfBoundary, aSeqOfBoundary,
+ expandBoundary( aMapOfBoundary, aSeqOfBoundary,
aDMapLinkFace, theNonManifold, theStartFace );
bool isDone = false;
ManifoldPart::TVectorOfFacePtr aFaces;
// find next
- if ( myIsOnlyManifold &&
+ if ( myIsOnlyManifold &&
(theNonManifold.find( aLink ) != theNonManifold.end()) )
continue;
else
continue;
}
}
-
+
// compare normal with normals of neighbor element
SMDS_MeshFace* aPrevFace = aDMapLinkFace[ aLink ];
ManifoldPart::TVectorOfFacePtr::iterator pFace = aFaces.begin();
continue;
// add new element to connected and extend the boundaries.
theResFaces.Add( anNextFaceID );
- expandBoundary( aMapOfBoundary, aSeqOfBoundary,
+ expandBoundary( aMapOfBoundary, aSeqOfBoundary,
aDMapLinkFace, theNonManifold, aNextFace );
isToReset = true;
}
}
void ElementsOnSurface::SetMesh( const SMDS_Mesh* theMesh )
-{
+{
if ( myMesh == theMesh )
return;
myMesh = theMesh;
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
//
// Copyright (C) 2003 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.
+//
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
//=======================================================================
//function : SMESH_MeshEditor
-//purpose :
+//purpose :
//=======================================================================
SMESH_MeshEditor::SMESH_MeshEditor( SMESH_Mesh* theMesh ):
SMESHDS_Mesh* aMesh = GetMeshDS();
set< SMESH_subMesh *> smmap;
-
+
list<int>::const_iterator it = theIDs.begin();
for ( ; it != theIDs.end(); it++ )
{
if (!F2) return false;
// 1 +--+ A theTria1: ( 1 A B ) A->2 ( 1 2 B ) 1 +--+ A
- // | /| theTria2: ( B A 2 ) B->1 ( 1 A 2 ) |\ |
- // |/ | | \|
+ // | /| theTria2: ( B A 2 ) B->1 ( 1 A 2 ) |\ |
+ // |/ | | \|
// B +--+ 2 B +--+ 2
// put nodes in array and find out indices of the same ones
if (!F2) return false;
// 1 +--+ A tr1: ( 1 A B ) A->2 ( 1 2 B ) 1 +--+ A
- // | /| tr2: ( B A 2 ) B->1 ( 1 A 2 ) |\ |
- // |/ | | \|
+ // | /| tr2: ( B A 2 ) B->1 ( 1 A 2 ) |\ |
+ // |/ | | \|
// B +--+ 2 B +--+ 2
// put nodes in array
//MESSAGE( tr1 << tr2 );
return true;
-
+
}
//=======================================================================
return false;
switch ( theElem->GetType() ) {
-
+
case SMDSAbs_Edge:
case SMDSAbs_Face:
{
//=======================================================================
//function : getBadRate
-//purpose :
+//purpose :
//=======================================================================
static double getBadRate (const SMDS_MeshElement* theElem,
if ( !theElem || !theCrit->GetPoints( theElem, P ))
return 1e100;
return theCrit->GetBadRate( theCrit->GetValue( P ), theElem->NbNodes() );
+ //return theCrit->GetBadRate( theCrit->GetValue( theElem->GetID() ), theElem->NbNodes() );
}
-
+
//=======================================================================
//function : QuadToTri
//purpose : Cut quadrangles into triangles.
SMDS_FaceOfNodes tr1 ( aNodes[0], aNodes[1], aNodes[2] );
SMDS_FaceOfNodes tr2 ( aNodes[2], aNodes[3], aNodes[0] );
aBadRate1 = getBadRate( &tr1, theCrit ) + getBadRate( &tr2, theCrit );
-
+
SMDS_FaceOfNodes tr3 ( aNodes[1], aNodes[2], aNodes[3] );
SMDS_FaceOfNodes tr4 ( aNodes[3], aNodes[0], aNodes[1] );
aBadRate2 = getBadRate( &tr3, theCrit ) + getBadRate( &tr4, theCrit );
int aShapeId = FindShape( elem );
//MESSAGE( "aBadRate1 = " << aBadRate1 << "; aBadRate2 = " << aBadRate2
// << " ShapeID = " << aShapeId << endl << elem );
-
+
if ( aBadRate1 <= aBadRate2 ) {
// tr1 + tr2 is better
aMesh->ChangeElementNodes( elem, aNodes, 3 );
return true;
}
+//=======================================================================
+//function : BestSplit
+//purpose : Find better diagonal for cutting.
+//=======================================================================
+int SMESH_MeshEditor::BestSplit (const SMDS_MeshElement* theQuad,
+ SMESH::Controls::NumericalFunctorPtr theCrit)
+{
+ if (!theCrit.get())
+ return -1;
+
+ if (!theQuad || theQuad->GetType() != SMDSAbs_Face || theQuad->NbNodes() != 4)
+ return -1;
+
+ // retrieve element nodes
+ const SMDS_MeshNode* aNodes [4];
+ SMDS_ElemIteratorPtr itN = theQuad->nodesIterator();
+ int i = 0;
+ while (itN->more())
+ aNodes[ i++ ] = static_cast<const SMDS_MeshNode*>( itN->next() );
+
+ // compare two sets of possible triangles
+ double aBadRate1, aBadRate2; // to what extent a set is bad
+ SMDS_FaceOfNodes tr1 ( aNodes[0], aNodes[1], aNodes[2] );
+ SMDS_FaceOfNodes tr2 ( aNodes[2], aNodes[3], aNodes[0] );
+ aBadRate1 = getBadRate( &tr1, theCrit ) + getBadRate( &tr2, theCrit );
+
+ SMDS_FaceOfNodes tr3 ( aNodes[1], aNodes[2], aNodes[3] );
+ SMDS_FaceOfNodes tr4 ( aNodes[3], aNodes[0], aNodes[1] );
+ aBadRate2 = getBadRate( &tr3, theCrit ) + getBadRate( &tr4, theCrit );
+
+ if (aBadRate1 <= aBadRate2) // tr1 + tr2 is better
+ return 1; // diagonal 1-3
+
+ return 2; // diagonal 2-4
+}
+
//=======================================================================
//function : AddToSameGroups
//purpose : add elemToAdd to the groups the elemInGroups belongs to
//=======================================================================
//function : getAngle
-//purpose :
+//purpose :
//=======================================================================
double getAngle(const SMDS_MeshElement * tr1,
gp_Vec N2 = gp_Vec( P2(2) - P2(1) ) ^ gp_Vec( P2(3) - P2(1) );
if ( N2.SquareMagnitude() <= gp::Resolution() )
return angle;
-
+
// find the first diagonal node n1 in the triangles:
// take in account a diagonal link orientation
const SMDS_MeshElement *nFirst[2], *tr[] = { tr1, tr2 };
itLE = mapLi_listEl.find( linkID );
if ( itLE != mapLi_listEl.end() )
{
- if ((*itLE).second.size() > 1 ) // consider only 2 elems adjacent by a link
+ if ((*itLE).second.size() > 1 ) // consider only 2 elems adjacent by a link
continue;
const SMDS_MeshElement* elem2 = (*itLE).second.front();
// if ( FindShape( elem ) != FindShape( elem2 ))
}
// Algo: fuse triangles into quadrangles
-
+
while ( ! mapEl_setLi.empty() )
{
// Look for the start element:
} // if ( startElem )
} // while ( startElem || !startLinks.empty() )
} // while ( ! mapEl_setLi.empty() )
-
+
return true;
}
}
DUMPSO( "========================================");
-
+
set<int> faceNodes; // ids of bottom face nodes, to be found
set<int> checkedId1; // ids of tried 2-nd nodes
Standard_Real leastDist = DBL_MAX; // dist of the 4-th node from 123 plane
checkedId1.insert ( id1 );
break;
}
-
+
// Find the 3-d node so that 1-2-3 triangle to be on a hexa face,
// ie that all but meybe one (id3 which is on the same face) nodes
// lay on the same side from the triangle plane.
}
}
-
+
// Set nodes of the found bottom face in good order
DUMPSO( " Found bottom face: ");
i = SortQuadNodes( theMesh, idNodes );
Standard_Real upDirSize = upDir.Magnitude();
if ( upDirSize <= gp::Resolution() ) return false;
upDir / upDirSize;
-
+
// Assure that the bottom face normal points up
gp_Vec Nb = gp_Vec (P[0], P[1]).Crossed( gp_Vec (P[0], P[2]) );
Nb += gp_Vec (P[0], P[2]).Crossed( gp_Vec (P[0], P[3]) );
SMESH::Controls::AspectRatio aQualityFunc;
SMESHDS_Mesh* aMesh = GetMeshDS();
-
+
if ( theElems.empty() ) {
// add all faces to theElems
SMDS_FaceIteratorPtr fIt = aMesh->facesIterator();
const SMDS_PositionPtr& pos = node->GetPosition();
posType = pos.get() ? pos->GetTypeOfPosition() : SMDS_TOP_3DSPACE;
if (posType != SMDS_TOP_EDGE &&
- posType != SMDS_TOP_VERTEX &&
+ posType != SMDS_TOP_VERTEX &&
theFixedNodes.find( node ) == theFixedNodes.end())
{
// check if all faces around the node are on faceSubMesh
}
}
}
- } // loop on nodes on seam
+ } // loop on nodes on seam
} // loop on edge of a face
} // if ( !face.IsNull() )
// Make a ceiling for each element ie an equal element of last new nodes.
// Find free links of faces - make edges and sweep them into faces.
-
+
TElemOfElemListMap::iterator itElem = newElemsMap.begin();
TElemOfVecOfNnlmiMap::iterator itElemNodes = elemNewNodesMap.begin();
for ( ; itElem != newElemsMap.end(); itElem++, itElemNodes++ )
} // sweep free links into faces
// make a ceiling face with a normal external to a volume
-
+
SMDS_VolumeTool lastVol( itElem->second.back() );
int iF = lastVol.GetFaceIndex( aFaceLastNodes );
if ( iF >= 0 )
//=======================================================================
//function : RotationSweep
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor::RotationSweep(set<const SMDS_MeshElement*> & theElems,
}
//=======================================================================
//function : ExtrusionSweep
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor::ExtrusionSweep(set<const SMDS_MeshElement*> & theElems,
//=======================================================================
//class : SMESH_MeshEditor_PathPoint
-//purpose : auxiliary class
+//purpose : auxiliary class
//=======================================================================
class SMESH_MeshEditor_PathPoint {
public:
//=======================================================================
//function : ExtrusionAlongTrack
-//purpose :
+//purpose :
//=======================================================================
-SMESH_MeshEditor::Extrusion_Error
+SMESH_MeshEditor::Extrusion_Error
SMESH_MeshEditor::ExtrusionAlongTrack (std::set<const SMDS_MeshElement*> & theElements,
SMESH_subMesh* theTrack,
const SMDS_MeshNode* theN1,
aItN = theTrack->GetFather()->GetSubMesh( aV2 )->GetSubMeshDS()->GetNodes();
const SMDS_MeshNode* aN2 = aItN->next();
- // starting node must be aN1 or aN2
+ // starting node must be aN1 or aN2
if ( !( aN1 == theN1 || aN2 == theN1 ) )
return EXTR_BAD_STARTING_NODE;
for ( j=0; j < aNbTP; ++j ) {
aAngles[j] = 0.;
}
-
+
if ( theHasAngles ) {
aItD = theAngles.begin();
for ( j=1; (aItD != theAngles.end()) && (j<aNbTP); ++aItD, ++j ) {
}
}
- // 2. Collect parameters on the track edge
+ // 2. Collect parameters on the track edge
aPrms.push_back( aT1 );
aPrms.push_back( aT2 );
while ( itN->more() ) {
// check if a node has been already processed
- const SMDS_MeshNode* node =
+ const SMDS_MeshNode* node =
static_cast<const SMDS_MeshNode*>( itN->next() );
TNodeOfNodeListMap::iterator nIt = mapNewNodes.find( node );
if ( nIt == mapNewNodes.end() ) {
nIt = mapNewNodes.insert( make_pair( node, list<const SMDS_MeshNode*>() )).first;
list<const SMDS_MeshNode*>& listNewNodes = nIt->second;
-
+
// make new nodes
aX = node->X(); aY = node->Y(); aZ = node->Z();
-
+
Standard_Real aAngle1x, aAngleT1T0, aTolAng;
gp_Pnt aP0x, aP1x, aPN0, aPN1, aV0x, aV1x;
gp_Ax1 anAx1, anAxT1T0;
aP1x = aPP1.Pnt();
aDT1x = aPP1.Tangent();
aAngle1x = aPP1.Angle();
-
- gp_Trsf aTrsf, aTrsfRot, aTrsfRotT1T0;
+
+ gp_Trsf aTrsf, aTrsfRot, aTrsfRotT1T0;
// Translation
gp_Vec aV01x( aP0x, aP1x );
aTrsf.SetTranslation( aV01x );
-
+
// traslated point
aV1x = aV0x.Transformed( aTrsf );
aPN1 = aPN0.Transformed( aTrsf );
-
+
// rotation 1 [ T1,T0 ]
aAngleT1T0=-aDT1x.Angle( aDT0x );
if (fabs(aAngleT1T0) > aTolAng) {
anAxT1T0.SetLocation( aV1x );
anAxT1T0.SetDirection( aDT1T0 );
aTrsfRotT1T0.SetRotation( anAxT1T0, aAngleT1T0 );
-
+
aPN1 = aPN1.Transformed( aTrsfRotT1T0 );
}
anAx1.SetLocation( aV1x );
anAx1.SetDirection( aDT1x );
aTrsfRot.SetRotation( anAx1, aAngle1x );
-
+
aPN1 = aPN1.Transformed( aTrsfRot );
}
aZ = aPN1.Z();
const SMDS_MeshNode* newNode = aMesh->AddNode( aX, aY, aZ );
listNewNodes.push_back( newNode );
-
+
aPN0 = aPN1;
aP0x = aP1x;
aV0x = aV1x;
// make new elements
sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem] );
}
-
+
makeWalls( aMesh, mapNewNodes, newElemsMap, mapElemNewNodes, theElements );
return EXTR_OK;
//=======================================================================
//function : Transform
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor::Transform (set<const SMDS_MeshElement*> & theElems,
const SMDS_MeshNode* node =
static_cast<const SMDS_MeshNode*>( itN->next() );
if (nodeMap.find( node ) != nodeMap.end() )
- continue;
+ continue;
double coord[3];
coord[0] = node->X();
theElems.insert( *invElemIt );
}
- // replicate or reverse elements
+ // replicate or reverse elements
enum {
REV_TETRA = 0, // = nbNodes - 4
FORWARD = 5
};
int index[][8] = {
- { 2, 1, 0, 3, 4, 0, 0, 0 }, // REV_TETRA
+ { 2, 1, 0, 3, 4, 0, 0, 0 }, // REV_TETRA
{ 2, 1, 0, 3, 4, 0, 0, 0 }, // REV_PYRAMID
- { 2, 1, 0, 5, 4, 3, 0, 0 }, // REV_PENTA
- { 2, 1, 0, 3, 0, 0, 0, 0 }, // REV_FACE
- { 2, 1, 0, 3, 6, 5, 4, 7 }, // REV_HEXA
- { 0, 1, 2, 3, 4, 5, 6, 7 } // FORWARD
+ { 2, 1, 0, 5, 4, 3, 0, 0 }, // REV_PENTA
+ { 2, 1, 0, 3, 0, 0, 0, 0 }, // REV_FACE
+ { 2, 1, 0, 3, 6, 5, 4, 7 }, // REV_HEXA
+ { 0, 1, 2, 3, 4, 5, 6, 7 } // FORWARD
};
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
if ( iNode != nbNodes )
continue; // not all nodes transformed
- if ( theCopy )
+ if ( theCopy )
{
// add a new element
switch ( elemType ) {
else
{
nodes.insert( nodes.end(), theNodes.begin(), theNodes.end() );
- }
+ }
list<const SMDS_MeshNode*>::iterator it2, it1 = nodes.begin();
for ( ; it1 != nodes.end(); it1++ )
//=======================================================================
//function : SimplifyFace
-//purpose :
+//purpose :
//=======================================================================
int SMESH_MeshEditor::SimplifyFace (const vector<const SMDS_MeshNode *> faceNodes,
vector<const SMDS_MeshNode *>& poly_nodes,
elems.insert( invElemIt->next() );
}
}
- // Change element nodes or remove an element
+ // Change element nodes or remove an element
set<const SMDS_MeshElement*>::iterator eIt = elems.begin();
for ( ; eIt != elems.end(); eIt++ )
if ( nbRepl == 2 && iRepl[ 1 ] - iRepl [ 0 ] == 3 ) {
// a bottom node sticks with a linked top one
// 1.
- SMDS_MeshElement* newElem =
+ SMDS_MeshElement* newElem =
aMesh->AddVolume(curNodes[ 3 ],
curNodes[ 4 ],
curNodes[ 5 ],
uniqueNodes[ 3 ] = curNodes[indTop[ 0 ]];
nbUniqueNodes = 4;
// tetrahedron 2
- SMDS_MeshElement* newElem =
+ SMDS_MeshElement* newElem =
aMesh->AddVolume(curNodes[ind[ 0 ]],
curNodes[ind[ 3 ]],
curNodes[ind[ 2 ]],
} // switch ( nbNodes )
} // if ( nbNodes != nbUniqueNodes ) // some nodes stick
-
+
if ( isOk ) {
if (elem->IsPoly() && elem->GetType() == SMDSAbs_Volume) {
// Change nodes of polyedre
//=======================================================================
//function : findAdjacentFace
-//purpose :
+//purpose :
//=======================================================================
static const SMDS_MeshElement* findAdjacentFace(const SMDS_MeshNode* n1,
avoidSet.insert ( elem );
return SMESH_MeshEditor::FindFaceInSet( n1, n2, elemSet, avoidSet );
}
-
+
//=======================================================================
//function : findFreeBorder
-//purpose :
+//purpose :
//=======================================================================
#define ControlFreeBorder SMESH::Controls::FreeEdges::IsFreeEdge
//=======================================================================
//function : SewFreeBorder
-//purpose :
+//purpose :
//=======================================================================
SMESH_MeshEditor::Sew_Error
aResult = SEW_BORDER1_NOT_FOUND;
}
if (theSideIsFreeBorder)
- {
+ {
// Free border 2
// --------------
if (!findFreeBorder(theSideFirstNode, theSideSecondNode, theSideThirdNode,
toBordSys.SetTransformation( toBordAx );
fromSide2Sys.SetTransformation( fromSideAx, toGlobalAx );
fromSide2Sys.SetScaleFactor( Zs.Magnitude() / Zb.Magnitude() );
-
+
// move
for ( nBordIt = bordNodes.begin(); nBordIt != bordNodes.end(); nBordIt++ ) {
const SMDS_MeshNode* n = *nBordIt;
nIt[0]++, nIt[1]++ )
{
nodeGroupsToMerge.push_back( list<const SMDS_MeshNode*>() );
- nodeGroupsToMerge.back().push_back( *nIt[1] ); // to keep
+ nodeGroupsToMerge.back().push_back( *nIt[1] ); // to keep
nodeGroupsToMerge.back().push_back( *nIt[0] ); // tp remove
}
}
double minParam = Min( param[ 0 ][ i[0] ], param[ 1 ][ i[1] ]);
double maxParam = Max( param[ 0 ][ i[0] ], param[ 1 ][ i[1] ]);
double minSegLen = Min( nextParam - minParam, maxParam - prevParam );
-
+
// choose to insert or to merge nodes
double du = param[ 1 ][ i[1] ] - param[ 0 ][ i[0] ];
if ( Abs( du ) <= minSegLen * 0.2 ) {
iNode = i3;
i3 = i4;
i4 = iNode;
- }
+ }
if (toCreatePoly || theFace->IsPoly()) {
// create new elements
SMESHDS_Mesh *aMesh = GetMeshDS();
int aShapeId = FindShape( theFace );
-
+
i1 = 0; i2 = 1;
for ( iSplit = 0; iSplit < nbSplits - 1; iSplit++ ) {
SMDS_MeshElement* newElem = 0;
//=======================================================================
//function : UpdateVolumes
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor::UpdateVolumes (const SMDS_MeshNode* theBetweenNode1,
const SMDS_MeshNode* theBetweenNode2,
//=======================================================================
//function : SewSideElements
-//purpose :
+//purpose :
//=======================================================================
SMESH_MeshEditor::Sew_Error
if ( !volSet->empty() )
{
//int nodeSetSize = nodeSet->size();
-
+
// loop on given volumes
for ( vIt = volSet->begin(); vIt != volSet->end(); vIt++ ) {
SMDS_VolumeTool vol (*vIt);
maxNbNodes = nbSharedNodes;
fIt++;
}
- else
+ else
freeFaceList.erase( fIt++ ); // here fIt++ occures before erase
}
if ( freeFaceList.size() > 1 )
// Reverse theElement orientation
+ /*!
+ * \brief Fuse neighbour triangles into quadrangles.
+ * \param theElems - The triangles to be fused.
+ * \param theCriterion - Is used to choose a neighbour to fuse with.
+ * \param theMaxAngle - Is a max angle between element normals at which fusion
+ * is still performed; theMaxAngle is mesured in radians.
+ * \retval bool - Success or not.
+ */
bool TriToQuad (std::set<const SMDS_MeshElement*> & theElems,
SMESH::Controls::NumericalFunctorPtr theCriterion,
const double theMaxAngle);
- // Fuse neighbour triangles into quadrangles.
- // theCriterion is used to choose a neighbour to fuse with.
- // theMaxAngle is a max angle between element normals at which
- // fusion is still performed; theMaxAngle is mesured in radians.
+ /*!
+ * \brief Split quadrangles into triangles.
+ * \param theElems - The faces to be splitted.
+ * \param theCriterion - Is used to choose a diagonal for splitting.
+ * \retval bool - Success or not.
+ */
bool QuadToTri (std::set<const SMDS_MeshElement*> & theElems,
SMESH::Controls::NumericalFunctorPtr theCriterion);
- // Cut quadrangles into triangles.
- // theCriterion is used to choose a diagonal to cut
+ /*!
+ * \brief Split quadrangles into triangles.
+ * \param theElems - The faces to be splitted.
+ * \param the13Diag - Is used to choose a diagonal for splitting.
+ * \retval bool - Success or not.
+ */
bool QuadToTri (std::set<const SMDS_MeshElement*> & theElems,
const bool the13Diag);
- // Cut quadrangles into triangles
+
+ /*!
+ * \brief Find better diagonal for splitting.
+ * \param theQuad - The face to find better splitting of.
+ * \param theCriterion - Is used to choose a diagonal for splitting.
+ * \retval int - 1 for 1-3 diagonal, 2 for 2-4, -1 - for errors.
+ */
+ int BestSplit (const SMDS_MeshElement* theQuad,
+ SMESH::Controls::NumericalFunctorPtr theCriterion);
enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
// $Header$
#include "SMESHGUI.h"
+
#include "SMESHGUI_InitMeshDlg.h"
#include "SMESHGUI_AddSubMeshDlg.h"
#include "SMESHGUI_NodesDlg.h"
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
#include "SMESHGUI_Preferences_SelectionDlg.h"
#include "SMESHGUI_Hypotheses.h"
-#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI_MoveNodesDlg.h"
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI_EditHypothesesDlg.h"
#include "SMESHGUI_Selection.h"
#include "SMESHGUI_CreatePolyhedralVolumeDlg.h"
-#include <SVTK_InteractorStyle.h>
-#include <SVTK_RenderWindowInteractor.h>
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_GEOMGenUtils.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_GroupUtils.h"
+#include "SMESHGUI_FilterUtils.h"
+#include "SMESHGUI_PatternUtils.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_HypothesesUtils.h"
#include "SMESH_Actor.h"
#include "SMESH_Object.h"
#include "SMESH_TypeFilter.hxx"
-#include "SUIT_Tools.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_FileDlg.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Study.h"
-#include "SUIT_Session.h"
-
-#include "SALOME_NamingService.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_ListIO.hxx"
-#include <SALOME_LifeCycleCORBA.hxx>
-
-#include "OB_Browser.h"
-
-#include "QtxPopupMgr.h"
-
#include "SalomeApp_Tools.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_NameDlg.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Preferences.h"
#include "SalomeApp_VTKSelector.h"
-
#include "SalomeApp_ImportOperation.h"
#include <SVTK_ViewWindow.h>
#include <SVTK_ViewModel.h>
+#include <SVTK_InteractorStyle.h>
+#include <SVTK_RenderWindowInteractor.h>
#include <VTKViewer_ViewManager.h>
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESHGUI_MeshUtils.h"
-#include "SMESHGUI_GroupUtils.h"
-#include "SMESHGUI_FilterUtils.h"
-#include "SMESHGUI_PatternUtils.h"
-#include "SMESHGUI_VTKUtils.h"
+#include "OB_Browser.h"
+
+#include "SUIT_Tools.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_FileDlg.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_OverrideCursor.h"
+#include "SUIT_Study.h"
+#include "SUIT_Session.h"
+
+#include "QtxPopupMgr.h"
+
+#include "SALOME_ListIO.hxx"
+#include "SALOME_ListIteratorOfListIO.hxx"
+#include "SALOME_InteractiveObject.hxx"
+#include "SALOME_NamingService.hxx"
+#include "SALOME_LifeCycleCORBA.hxx"
#include "SALOMEconfig.h"
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
// QT Includes
#define INCLUDE_MENUITEM_DEF
-#include <qapplication.h>
-#include <qlineedit.h>
-#include <qmenudata.h>
-#include <qmenubar.h>
#include <qpopupmenu.h>
-#include <qfont.h>
#include <qstring.h>
-#include <qpainter.h>
-#include <qcheckbox.h>
-#include <qcolordialog.h>
-#include <qspinbox.h>
-#include <qlist.h>
#include <qwidget.h>
-#include <qevent.h>
#include <qaction.h>
-#include <qradiobutton.h>
+// BOOST Includes
#include <boost/shared_ptr.hpp>
+// VTK Includes
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkActorCollection.h>
// Module : SMESH
#include "SMESHGUI_MultiEditDlg.h"
-#include "SMESHGUI_FilterDlg.h"
-#include "SMESHGUI_Filter.h"
#include "SMESHGUI.h"
+#include "SMESHGUI_Filter.h"
+#include "SMESHGUI_FilterDlg.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_FilterUtils.h"
+#include "SMESHGUI_SpinBox.h"
#include "SMESH_Actor.h"
#include "SMESH_TypeFilter.hxx"
#include <vtkDataSetMapper.h>
// QT Includes
-#include <qcheckbox.h>
#include <qframe.h>
-#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
-#include <qlineedit.h>
#include <qlistbox.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qlineedit.h>
#include <qpushbutton.h>
#include <qapplication.h>
-#include <qhbuttongroup.h>
#include <qradiobutton.h>
+#include <qhbuttongroup.h>
// IDL Headers
#include "SALOMEconfig.h"
const int theMode,
const bool the3d2d,
const char* theName):
- QDialog(SMESH::GetDesktop(theModule),
- theName,
- false,
+ QDialog(SMESH::GetDesktop(theModule),
+ theName,
+ false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myListBox = new QListBox(aFrame);
myListBox->setSelectionMode(QListBox::Extended);
myListBox->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
-// myListBox->setColumnMode(QListBox::FitToHeight);
myListBox->installEventFilter(this);
myFilterBtn = new QPushButton(tr("FILTER") , aFrame);
myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
+ // Split/Join criterion group
+ myCriterionGrp = new QGroupBox(3, Qt::Vertical, tr("SPLIT_JOIN_CRITERION"), aMainGrp);
+
+ myGroupChoice = new QButtonGroup(3, Qt::Vertical, myCriterionGrp);
+ myGroupChoice->setInsideMargin(0);
+ myGroupChoice->setFrameStyle(QFrame::NoFrame);
+ (new QRadioButton(tr("USE_DIAGONAL_1_3"), myGroupChoice))->setChecked(true);
+ (new QRadioButton(tr("USE_DIAGONAL_2_4"), myGroupChoice));
+ (new QRadioButton(tr("USE_NUMERIC_FUNC"), myGroupChoice));
+
+ myComboBoxFunctor = new QComboBox(myCriterionGrp);
+ myComboBoxFunctor->insertItem(tr("ASPECTRATIO_ELEMENTS"));
+ myComboBoxFunctor->insertItem(tr("MINIMUMANGLE_ELEMENTS"));
+ myComboBoxFunctor->insertItem(tr("SKEW_ELEMENTS"));
+ myComboBoxFunctor->insertItem(tr("AREA_ELEMENTS"));
+ //myComboBoxFunctor->insertItem(tr("LENGTH2D_EDGES")); // for existing elements only
+ //myComboBoxFunctor->insertItem(tr("MULTI2D_BORDERS")); // for existing elements only
+ myComboBoxFunctor->setCurrentItem(0);
+
+ myCriterionGrp->hide();
+ myGroupChoice->hide();
+ myComboBoxFunctor->setEnabled(false);
+
// "Select from" group
QGroupBox* aGrp = new QGroupBox(3, Qt::Horizontal, tr("SELECT_FROM"), aMainGrp);
mySubmesh->setReadOnly(true);
mySubmeshBtn->setPixmap(aPix);
- myGroupChk = new QCheckBox(tr("GROUP"), aGrp);
+ myGroupChk = new QCheckBox(tr("SMESH_GROUP"), aGrp);
myGroupBtn = new QPushButton(aGrp);
myGroup = new QLineEdit(aGrp);
myGroup->setReadOnly(true);
return QDialog::eventFilter(object, event);
}
+//=======================================================================
+// name : SMESHGUI_MultiEditDlg::getNumericalFunctor
+// Purpose :
+//=======================================================================
+SMESH::NumericalFunctor_ptr SMESHGUI_MultiEditDlg::getNumericalFunctor()
+{
+ SMESH::NumericalFunctor_var aNF = SMESH::NumericalFunctor::_nil();
+
+ SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
+ if (aFilterMgr->_is_nil())
+ return aNF._retn();
+
+ if (myComboBoxFunctor->currentText() == tr("ASPECTRATIO_ELEMENTS"))
+ aNF = aFilterMgr->CreateAspectRatio();
+ else if (myComboBoxFunctor->currentText() == tr("WARP_ELEMENTS"))
+ aNF = aFilterMgr->CreateWarping();
+ else if (myComboBoxFunctor->currentText() == tr("MINIMUMANGLE_ELEMENTS"))
+ aNF = aFilterMgr->CreateMinimumAngle();
+ else if (myComboBoxFunctor->currentText() == tr("TAPER_ELEMENTS"))
+ aNF = aFilterMgr->CreateTaper();
+ else if (myComboBoxFunctor->currentText() == tr("SKEW_ELEMENTS"))
+ aNF = aFilterMgr->CreateSkew();
+ else if (myComboBoxFunctor->currentText() == tr("AREA_ELEMENTS"))
+ aNF = aFilterMgr->CreateArea();
+ else if (myComboBoxFunctor->currentText() == tr("LENGTH2D_EDGES"))
+ aNF = aFilterMgr->CreateLength2D();
+ else if (myComboBoxFunctor->currentText() == tr("MULTI2D_BORDERS"))
+ aNF = aFilterMgr->CreateMultiConnection2D();
+ else ;
+
+ return aNF._retn();
+}
+
//=======================================================================
// name : SMESHGUI_MultiEditDlg::Init
// Purpose : Init dialog fields, connect signals and slots, show dialog
return myEntityType;
}
-/*
+/*!
* Class : SMESHGUI_ChangeOrientationDlg
* Description : Modification of orientation of faces
*/
SMESHGUI_ChangeOrientationDlg
::SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule,
- const char* theName):
+ const char* theName):
SMESHGUI_MultiEditDlg(theModule, SMESHGUI_FaceFilter, true, theName)
{
setCaption(tr("CAPTION"));
SMESHGUI_MultiEditDlg(theModule, SMESHGUI_TriaFilter, false, theName)
{
setCaption(tr("CAPTION"));
+
+ myComboBoxFunctor->setEnabled(true);
+ myComboBoxFunctor->insertItem(tr("WARP_ELEMENTS")); // for quadrangles only
+ myComboBoxFunctor->insertItem(tr("TAPER_ELEMENTS")); // for quadrangles only
+
+ // Maximum angle
+ QGroupBox* aMaxAngleGrp = new QGroupBox (2, Qt::Horizontal, myCriterionGrp);
+ aMaxAngleGrp->setInsideMargin(0);
+ aMaxAngleGrp->setFrameStyle(QFrame::NoFrame);
+ new QLabel (tr("MAXIMUM_ANGLE"), aMaxAngleGrp);
+ myMaxAngleSpin = new SMESHGUI_SpinBox (aMaxAngleGrp);
+ myMaxAngleSpin->RangeStepAndValidator(0, 180.0, 1.0, 3);
+ myMaxAngleSpin->SetValue(30.0);
+
+ myCriterionGrp->show();
}
SMESHGUI_UnionOfTrianglesDlg::~SMESHGUI_UnionOfTrianglesDlg()
bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
const SMESH::long_array& theIds)
{
- return theEditor->TriToQuad(theIds, SMESH::NumericalFunctor::_nil(), 1.);
+ SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
+ double aMaxAngle = myMaxAngleSpin->GetValue() * PI / 180.0;
+ return theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
}
+
/*!
* Class : SMESHGUI_CuttingOfQuadsDlg
- * Description : Construction of quadrangles by automatic association of triangles
+ * Description : Automatic splitting of quadrangles into triangles
*/
SMESHGUI_CuttingOfQuadsDlg
setCaption(tr("CAPTION"));
myPreviewActor = 0;
- myUseDiagChk = new QCheckBox (tr("USE_DIAGONAL_2_4"), mySelGrp);
myPreviewChk = new QCheckBox (tr("PREVIEW"), mySelGrp);
- connect(myPreviewChk, SIGNAL(stateChanged(int)), this, SLOT(onPreviewChk()));
- connect(myUseDiagChk, SIGNAL(stateChanged(int)), this, SLOT(onPreviewChk()));
- connect(this, SIGNAL(ListContensChanged()), this, SLOT(onPreviewChk()));
+ myCriterionGrp->show();
+ myGroupChoice->show();
+ myComboBoxFunctor->setEnabled(false);
+
+ connect(myPreviewChk , SIGNAL(stateChanged(int)) , this, SLOT(onPreviewChk()));
+ connect(myGroupChoice , SIGNAL(clicked(int)) , this, SLOT(onCriterionRB()));
+ connect(myComboBoxFunctor, SIGNAL(activated(int)) , this, SLOT(onPreviewChk()));
+ connect(this , SIGNAL(ListContensChanged()), this, SLOT(onPreviewChk()));
}
SMESHGUI_CuttingOfQuadsDlg::~SMESHGUI_CuttingOfQuadsDlg()
bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
const SMESH::long_array& theIds)
{
- return theEditor->SplitQuad(theIds, !myUseDiagChk->isChecked());
+ switch (myGroupChoice->id(myGroupChoice->selected())) {
+ case 0: // use diagonal 1-3
+ return theEditor->SplitQuad(theIds, true);
+ case 1: // use diagonal 2-4
+ return theEditor->SplitQuad(theIds, false);
+ default: // use numeric functor
+ break;
+ }
+
+ SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
+ return theEditor->QuadToTri(theIds, aCriterion);
+}
+
+void SMESHGUI_CuttingOfQuadsDlg::onCriterionRB()
+{
+ if (myGroupChoice->id(myGroupChoice->selected()) == 2) // Use numeric functor
+ myComboBoxFunctor->setEnabled(true);
+ else
+ myComboBoxFunctor->setEnabled(false);
+
+ onPreviewChk();
}
void SMESHGUI_CuttingOfQuadsDlg::onPreviewChk()
myPreviewActor->Delete();
myPreviewActor = 0;
}
-
+
void SMESHGUI_CuttingOfQuadsDlg::displayPreview()
{
if (myActor == 0)
if (aMesh == 0)
return;
- bool isDiag24 = myUseDiagChk->isChecked();
+ // 0 - use diagonal 1-3, 1 - use diagonal 2-4, 2 - use numerical functor
+ int aChoice = myGroupChoice->id(myGroupChoice->selected());
+ SMESH::NumericalFunctor_var aCriterion = SMESH::NumericalFunctor::_nil();
+ SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH::SMESH_MeshEditor::_nil();
+ if (aChoice == 2) {
+ aCriterion = getNumericalFunctor();
+ aMeshEditor = myMesh->GetMeshEditor();
+ if (aMeshEditor->_is_nil())
+ return;
+ }
//Create grid
vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
int k = 0;
- while(anIter->more())
- if (const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next())
+ while (anIter->more()) {
+ const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(anIter->next());
+ if (aNode)
{
if (!anIdToVtk.IsBound(aNode->GetID()))
{
aNodes[ k++ ] = aNode->GetID();
}
+ }
if (k != 4)
continue;
- if (!isDiag24)
+ bool isDiag13 = true;
+ if (aChoice == 0) // use diagonal 1-3
+ {
+ isDiag13 = true;
+ }
+ else if (aChoice == 1) // use diagonal 2-4
+ {
+ isDiag13 = false;
+ }
+ else // use numerical functor
+ {
+ // compare two sets of possible triangles
+ int diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
+ if (diag == 1) // 1-3
+ isDiag13 = true;
+ else if (diag == 2) // 2-4
+ isDiag13 = false;
+ else // error
+ continue;
+ }
+
+ if (isDiag13)
{
anIdList->SetId(0, anIdToVtk(aNodes[ 0 ]));
anIdList->SetId(1, anIdToVtk(aNodes[ 1 ]));
// Copyright (C) 2003 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.
+//
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
+#include CORBA_SERVER_HEADER(SMESH_Filter)
+class SMESHGUI;
class SMESHGUI_FilterDlg;
-class QCheckBox;
-class QGroupBox;
-class QListBox;
-class QFrame;
-class QLineEdit;
class SMESHGUI_SpinBox;
-class QPushButton;
-class QButtonGroup;
-class QObject;
class SMESH_Actor;
-class SALOME_Actor;
-class SalomeApp_SelectionMgr;
-class SMESHGUI;
-class SMESH_Actor;
+class SalomeApp_SelectionMgr;
+class SALOME_Actor;
class SVTK_Selector;
class SVTK_ViewWindow;
-/*
- Class : SMESHGUI_MultiEditDlg
- Description : Base class for dialogs of diagonal inversion and
- union of two neighboring triangles
-*/
+class QFrame;
+class QObject;
+class QListBox;
+class QComboBox;
+class QCheckBox;
+class QGroupBox;
+class QLineEdit;
+class QPushButton;
+class QButtonGroup;
+
+/*!
+ * Class : SMESHGUI_MultiEditDlg
+ * Description : Base class for dialogs of diagonal inversion and
+ * union of two neighboring triangles
+ */
class SMESHGUI_MultiEditDlg : public QDialog
-{
+{
Q_OBJECT
public:
const char* = 0 );
virtual ~SMESHGUI_MultiEditDlg();
- void Init() ;
+ void Init();
bool eventFilter( QObject* object, QEvent* event );
void ListContensChanged();
protected slots:
-
void onOk();
virtual bool onApply();
virtual void onClose();
void onDeactivate();
void onSelectionDone();
-
+
void onFilterBtn();
void onAddBtn();
void onRemoveBtn();
virtual void onToAllChk();
void onFilterAccepted();
void on3d2dChanged(int);
-
-protected:
+ SMESH::NumericalFunctor_ptr getNumericalFunctor();
+
+protected:
void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
+ void enterEvent ( QEvent * ) ;
void hideEvent ( QHideEvent * ); /* ESC key */
QFrame* createButtonFrame( QWidget* );
QFrame* createMainFrame ( QWidget*, const bool );
virtual bool isIdValid( const int theID ) const;
virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& ) = 0;
int entityType();
-
-protected:
+protected:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
SMESH_Actor* myActor;
SMESH::SMESH_Mesh_var myMesh;
-
+
SalomeApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI;
QGroupBox* mySelGrp;
-
+ QGroupBox* myCriterionGrp;
+
+ QButtonGroup* myGroupChoice;
+ QComboBox* myComboBoxFunctor;
+
QListBox* myListBox;
QPushButton* myFilterBtn;
QPushButton* myAddBtn;
QPushButton* myRemoveBtn;
QPushButton* mySortBtn;
-
+
QCheckBox* myToAllChk;
QButtonGroup* myEntityTypeGrp;
-
+
QCheckBox* mySubmeshChk;
QPushButton* mySubmeshBtn;
QLineEdit* mySubmesh;
-
+
QCheckBox* myGroupChk;
QPushButton* myGroupBtn;
QLineEdit* myGroup;
-
+
SMESHGUI_FilterDlg* myFilterDlg;
TColStd_MapOfInteger myIds;
int myFilterType;
int myEntityType;
};
-/*
- Class : SMESHGUI_ChangeOrientationDlg
- Description : Modification of orientation of faces
-*/
+/*!
+ * Class : SMESHGUI_ChangeOrientationDlg
+ * Description : Modification of orientation of faces
+ */
class SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
-{
+{
Q_OBJECT
public:
- SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule,
- const char* = 0);
- virtual ~SMESHGUI_ChangeOrientationDlg();
+ SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule,
+ const char* = 0);
+ virtual ~SMESHGUI_ChangeOrientationDlg();
protected:
-
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
};
-/*
- Class : SMESHGUI_UnionOfTrianglesDlg
- Description : Construction of quadrangles by automatic association of triangles
-*/
+/*!
+ * Class : SMESHGUI_UnionOfTrianglesDlg
+ * Description : Construction of quadrangles by automatic association of triangles
+ */
class SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
{
Q_OBJECT
public:
- SMESHGUI_UnionOfTrianglesDlg(SMESHGUI* theModule,
- const char* = 0);
- virtual ~SMESHGUI_UnionOfTrianglesDlg();
+ SMESHGUI_UnionOfTrianglesDlg(SMESHGUI* theModule,
+ const char* = 0);
+ virtual ~SMESHGUI_UnionOfTrianglesDlg();
protected:
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+private:
+ SMESHGUI_SpinBox* myMaxAngleSpin;
};
/*
Q_OBJECT
public:
- SMESHGUI_CuttingOfQuadsDlg(SMESHGUI* theModule,
- const char* = 0);
- virtual ~SMESHGUI_CuttingOfQuadsDlg();
+ SMESHGUI_CuttingOfQuadsDlg(SMESHGUI* theModule,
+ const char* = 0);
+ virtual ~SMESHGUI_CuttingOfQuadsDlg();
protected:
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
-
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+
protected slots:
- virtual void onClose();
- void onPreviewChk();
+ virtual void onClose();
+ void onCriterionRB();
+ void onPreviewChk();
private:
- void displayPreview();
- void erasePreview();
-
+ void displayPreview();
+ void erasePreview();
+
private:
- QCheckBox* myUseDiagChk;
- SALOME_Actor* myPreviewActor;
- QCheckBox* myPreviewChk;
+ SALOME_Actor* myPreviewActor;
+ QCheckBox* myPreviewChk;
};
#endif
msgid "SMESHGUI_MultiEditDlg::TO_ALL"
msgstr "Apply to all"
+msgid "SMESHGUI_MultiEditDlg::SPLIT_JOIN_CRITERION"
+msgstr "Criterion"
+
+msgid "SMESHGUI_MultiEditDlg::USE_DIAGONAL_1_3"
+msgstr "Use diagonal 1-3"
+
+msgid "SMESHGUI_MultiEditDlg::USE_DIAGONAL_2_4"
+msgstr "Use diagonal 2-4"
+
+msgid "SMESHGUI_MultiEditDlg::USE_NUMERIC_FUNC"
+msgstr "Use numeric functor"
+
msgid "SMESHGUI_MultiEditDlg::SELECT_FROM"
msgstr "Select from"
-msgid "SMESHGUI_MultiEditDlg::GROUP"
-msgstr "Group"
-
msgid "SMESHGUI_ChangeOrientationDlg::CAPTION"
msgstr "Modification of orientation"
msgid "SMESHGUI_UnionOfTrianglesDlg::CAPTION"
msgstr "Union of triangles"
+msgid "SMESHGUI_UnionOfTrianglesDlg::MAXIMUM_ANGLE"
+msgstr "Maximum bending angle"
+
msgid "SMESHGUI_CuttingOfQuadsDlg::CAPTION"
msgstr "Cutting of quadrangles"
-msgid "SMESHGUI_CuttingOfQuadsDlg::USE_DIAGONAL_2_4"
-msgstr "Use diagonal 2-4"
-
msgid "SMESHGUI_CuttingOfQuadsDlg::PREVIEW"
msgstr "Preview"
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.
+//
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
//=======================================================================
//function : addAxis
-//purpose :
+//purpose :
//=======================================================================
static TCollection_AsciiString& addAxis(TCollection_AsciiString& theStr,
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
#ifdef _DEBUG_
SMESH_Gen_i::AddToCurrentPyScript( "print \"AddVolume: \", isDone" );
#endif
-
+
return true;
};
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
const SMDS_MeshNode * node = GetMeshDS()->FindNode( NodeID );
if ( !node )
return false;
-
+
GetMeshDS()->MoveNode(node, x, y, z);
// Update Python script
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-
-CORBA::Boolean
- SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfElements,
- SMESH::NumericalFunctor_ptr Criterion,
- CORBA::Double MaxAngle)
+CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfElements,
+ SMESH::NumericalFunctor_ptr Criterion,
+ CORBA::Double MaxAngle)
{
set<const SMDS_MeshElement*> faces;
for (int i = 0; i < IDsOfElements.length(); i++)
if ( elem && elem->GetType() == SMDSAbs_Face)
faces.insert( elem );
}
- SMESH::NumericalFunctor_i* aNumericalFunctor =
+ SMESH::NumericalFunctor_i* aNumericalFunctor =
dynamic_cast<SMESH::NumericalFunctor_i*>( SMESH_Gen_i::GetServant( Criterion ).in() );
SMESH::Controls::NumericalFunctorPtr aCrit;
if ( !aNumericalFunctor )
// Update Python script
TCollection_AsciiString str ("isDone = mesh_editor.TriToQuad(");
SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", None, ";
- str += (Standard_Real) MaxAngle;
- SMESH_Gen_i::AddToCurrentPyScript( str + ")" );
+ str += TCollection_AsciiString((Standard_Real) MaxAngle) + ")";
+ SMESH_Gen_i::AddToCurrentPyScript( str );
#ifdef _DEBUG_
SMESH_Gen_i::AddToCurrentPyScript( "print \"TriToQuad: \", isDone" );
#endif
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-
-CORBA::Boolean
- SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
- SMESH::NumericalFunctor_ptr Criterion,
- CORBA::Double MaxAngle)
+CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::NumericalFunctor_ptr Criterion,
+ CORBA::Double MaxAngle)
{
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = TriToQuad(anElementsId, Criterion, MaxAngle);
// Update Python script
TCollection_AsciiString str ("isDone = mesh_editor.TriToQuadObject(");
SMESH_Gen_i::AddObject( str, theObject ) += ", None, ";
- str += (Standard_Real) MaxAngle;
- SMESH_Gen_i::AddToCurrentPyScript( str + ")" );
+ str += TCollection_AsciiString((Standard_Real) MaxAngle) + ")";
+ SMESH_Gen_i::AddToCurrentPyScript( str );
#ifdef _DEBUG_
SMESH_Gen_i::AddToCurrentPyScript( "print \"TriToQuadObject: \", isDone" );
#endif
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-
-CORBA::Boolean
- SMESH_MeshEditor_i::QuadToTri(const SMESH::long_array & IDsOfElements,
- SMESH::NumericalFunctor_ptr Criterion)
+CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfElements,
+ SMESH::NumericalFunctor_ptr Criterion)
{
set<const SMDS_MeshElement*> faces;
for (int i = 0; i < IDsOfElements.length(); i++)
if ( elem && elem->GetType() == SMDSAbs_Face)
faces.insert( elem );
}
- SMESH::NumericalFunctor_i* aNumericalFunctor =
+ SMESH::NumericalFunctor_i* aNumericalFunctor =
dynamic_cast<SMESH::NumericalFunctor_i*>( SMESH_Gen_i::GetServant( Criterion ).in() );
SMESH::Controls::NumericalFunctorPtr aCrit;
if ( !aNumericalFunctor )
// Update Python script
TCollection_AsciiString str ("isDone = mesh_editor.QuadToTri(");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", None ), ";
+ SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", None )";
SMESH_Gen_i::AddToCurrentPyScript( str );
#ifdef _DEBUG_
SMESH_Gen_i::AddToCurrentPyScript( "print \"QuadToTri: \", isDone" );
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
+CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::NumericalFunctor_ptr Criterion)
+{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ CORBA::Boolean isDone = QuadToTri(anElementsId, Criterion);
-CORBA::Boolean
- SMESH_MeshEditor_i::SplitQuad(const SMESH::long_array & IDsOfElements,
- CORBA::Boolean Diag13)
+ // Clear python line(s), created by QuadToTri()
+ SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+ aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
+#ifdef _DEBUG_
+ aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
+#endif
+
+ // Update Python script
+ TCollection_AsciiString str ("isDone = mesh_editor.QuadToTriObject(");
+ SMESH_Gen_i::AddObject( str, theObject ) += ", None )";
+ SMESH_Gen_i::AddToCurrentPyScript( str );
+#ifdef _DEBUG_
+ SMESH_Gen_i::AddToCurrentPyScript( "print \"QuadToTriObject: \", isDone" );
+#endif
+
+ return isDone;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfElements,
+ CORBA::Boolean Diag13)
{
set<const SMDS_MeshElement*> faces;
for (int i = 0; i < IDsOfElements.length(); i++)
// Update Python script
TCollection_AsciiString str ("isDone = mesh_editor.SplitQuad(");
SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", ";
- str += TCollection_AsciiString( Diag13 );
- SMESH_Gen_i::AddToCurrentPyScript( str + ")" );
+ str += TCollection_AsciiString( Diag13 ) + ")";
+ SMESH_Gen_i::AddToCurrentPyScript( str );
#ifdef _DEBUG_
SMESH_Gen_i::AddToCurrentPyScript( "print \"SplitQuad: \", isDone" );
#endif
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-
-CORBA::Boolean
- SMESH_MeshEditor_i::SplitQuadObject(SMESH::SMESH_IDSource_ptr theObject,
- CORBA::Boolean Diag13)
+CORBA::Boolean SMESH_MeshEditor_i::SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
+ CORBA::Boolean Diag13)
{
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = SplitQuad(anElementsId, Diag13);
return isDone;
}
+//=============================================================================
+/*!
+ * BestSplit
+ */
+//=============================================================================
+CORBA::Long SMESH_MeshEditor_i::BestSplit (CORBA::Long IDOfQuad,
+ SMESH::NumericalFunctor_ptr Criterion)
+{
+ const SMDS_MeshElement* quad = GetMeshDS()->FindElement(IDOfQuad);
+ if (quad && quad->GetType() == SMDSAbs_Face && quad->NbNodes() == 4)
+ {
+ SMESH::NumericalFunctor_i* aNumericalFunctor =
+ dynamic_cast<SMESH::NumericalFunctor_i*>(SMESH_Gen_i::GetServant(Criterion).in());
+ SMESH::Controls::NumericalFunctorPtr aCrit;
+ if (aNumericalFunctor)
+ aCrit = aNumericalFunctor->GetNumericalFunctor();
+ else
+ aCrit.reset(new SMESH::Controls::AspectRatio());
+
+ ::SMESH_MeshEditor anEditor (_myMesh);
+ return anEditor.BestSplit(quad, aCrit);
+ }
+ return -1;
+}
+
//=======================================================================
//function : Smooth
-//purpose :
+//purpose :
//=======================================================================
CORBA::Boolean
//=======================================================================
//function : SmoothParametric
-//purpose :
+//purpose :
//=======================================================================
CORBA::Boolean
//=======================================================================
//function : SmoothObject
-//purpose :
+//purpose :
//=======================================================================
CORBA::Boolean
//=======================================================================
//function : SmoothParametricObject
-//purpose :
+//purpose :
//=======================================================================
CORBA::Boolean
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
str += (Standard_Integer) MaxNbOfIterations;
str += ", ";
str += (Standard_Real) MaxAspectRatio;
- if ( Method == ::SMESH_MeshEditor::CENTROIDAL )
+ if ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH )
str += ", SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH, ";
else
str += ", SMESH.SMESH_MeshEditor.LAPLACIAN_SMOOTH, ";
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=======================================================================
//function : RotationSweep
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElements,
//=======================================================================
//function : RotationSweepObject
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
//=======================================================================
//function : ExtrusionSweep
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElements,
//=======================================================================
//function : ExtrusionSweepObject
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
}
//=======================================================================
//function : ExtrusionSweepObject1D
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
//=======================================================================
//function : ExtrusionSweepObject2D
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
//=======================================================================
//function : ExtrusionAlongPath
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_MeshEditor::Extrusion_Error
//=======================================================================
//function : ExtrusionAlongPathObject
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_MeshEditor::Extrusion_Error
//=======================================================================
//function : Mirror
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElements,
//=======================================================================
//function : MirrorObject
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::MirrorObject(SMESH::SMESH_IDSource_ptr theObject,
//=======================================================================
//function : Translate
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
//=======================================================================
//function : TranslateObject
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
//=======================================================================
//function : Rotate
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
gp_Trsf aTrsf;
aTrsf.SetRotation( gp_Ax1( P, V ), theAngle);
-
+
::SMESH_MeshEditor anEditor( _myMesh );
anEditor.Transform (elements, aTrsf, theCopy);
//=======================================================================
//function : RotateObject
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject,
//=======================================================================
//function : FindCoincidentNodes
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::FindCoincidentNodes (CORBA::Double Tolerance,
//=======================================================================
//function : MergeNodes
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes)
//=======================================================================
//function : MergeEqualElements
-//purpose :
+//purpose :
//=======================================================================
void SMESH_MeshEditor_i::MergeEqualElements()
//=======================================================================
//function : operator
-//purpose :
+//purpose :
//=======================================================================
#define RETCASE(enm) case ::SMESH_MeshEditor::enm: return SMESH::SMESH_MeshEditor::enm;
//=======================================================================
//function : SewFreeBorders
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
//=======================================================================
//function : SewConformFreeBorders
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
//=======================================================================
//function : SewBorderToSide
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
//=======================================================================
//function : SewSideElements
-//purpose :
+//purpose :
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.
+//
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
- CORBA::Boolean TriToQuad(const SMESH::long_array & IDsOfElements,
- SMESH::NumericalFunctor_ptr Criterion,
- CORBA::Double MaxAngle);
- CORBA::Boolean TriToQuadObject(SMESH::SMESH_IDSource_ptr theObject,
- SMESH::NumericalFunctor_ptr Criterion,
- CORBA::Double MaxAngle);
- CORBA::Boolean QuadToTri(const SMESH::long_array & IDsOfElements,
- SMESH::NumericalFunctor_ptr Criterion);
- CORBA::Boolean SplitQuad(const SMESH::long_array & IDsOfElements,
- CORBA::Boolean Diag13);
- CORBA::Boolean SplitQuadObject(SMESH::SMESH_IDSource_ptr theObject,
- CORBA::Boolean Diag13);
+ // Split/Join faces
+ CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
+ SMESH::NumericalFunctor_ptr Criterion,
+ CORBA::Double MaxAngle);
+ CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::NumericalFunctor_ptr Criterion,
+ CORBA::Double MaxAngle);
+ CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
+ SMESH::NumericalFunctor_ptr Criterion);
+ CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::NumericalFunctor_ptr Criterion);
+ CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
+ CORBA::Boolean Diag13);
+ CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
+ CORBA::Boolean Diag13);
+ CORBA::Long BestSplit (CORBA::Long IDOfQuad,
+ SMESH::NumericalFunctor_ptr Criterion);
CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
const SMESH::long_array & IDsOfFixedNodes,
void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct & StepVector,
CORBA::Long NbOfSteps);
-
+
SMESH::SMESH_MeshEditor::Extrusion_Error
ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
SMESH::SMESH_Mesh_ptr PathMesh,
const SMESH::double_array & Angles,
CORBA::Boolean HasRefPoint,
const SMESH::PointStruct & RefPoint);
-
+
SMESH::SMESH_MeshEditor::Extrusion_Error
ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
SMESH::SMESH_Mesh_ptr PathMesh,