SEW_DIFF_NB_OF_ELEMENTS,
SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
SEW_BAD_SIDE1_NODES,
- SEW_BAD_SIDE2_NODES
- };
+ SEW_BAD_SIDE2_NODES,
+ SEW_INTERNAL_ERROR
+ };
Sew_Error SewFreeBorders (in long FirstNodeID1,
in long SecondNodeID1,
const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
if (aElement) {
switch (aElement->GetType()) {
+
case SMDSAbs_Edge:
if (!aEdgesGroup) {
aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
}
aEdgesGroup->Add(aElement);
break;
+
case SMDSAbs_Face:
if (!aFacesGroup) {
aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
}
aFacesGroup->Add(aElement);
break;
+
case SMDSAbs_Volume:
if (!aVolumeGroup) {
aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
}
aVolumeGroup->Add(aElement);
break;
+
+ default:;
}
}
}
my0DActor->SetRepresentation(aReperesent);
myBallActor->SetRepresentation(aReperesent);
- switch(myControlMode){
+ switch ( myControlMode ) {
case eLength:
case eMultiConnection:
aProp = aBackProp = my1DProp;
if(myRepresentation != ePoint)
aReperesent = SMESH_DeviceActor::eInsideframe;
break;
+ default:;
}
if(aQuadraticMode == SMESH_Actor::eLines)
SMESH_ActorDef::
GetClippingPlane(vtkIdType theID)
{
- if(theID >= myCippingPlaneCont.size())
+ if ( theID >= (vtkIdType)myCippingPlaneCont.size() )
return NULL;
return myCippingPlaneCont[theID].Get();
}
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic);
- for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
+ for ( size_t i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast<double>(nbEvents[i]));
if(funValues.size() >= 2)
enum LabelFont {
FntArial, //!< arial font family
FntCourier, //!< courier font family
- FntTimes, //!< times font family
+ FntTimes //!< times font family
};
SMESHOBJECT_EXPORT
vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID)
{
- if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1;
+ if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1;
return myElemVTK2ObjIds[theVtkID];
}
vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID)
{
- if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1;
+ if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1;
return myNodeVTK2ObjIds[theVtkID];
}
// rnv begin
// Customization of the vtkScalarBarActor to show distribution histogram.
- bool distrVisibility = (numColors == this->myNbValues.size());
+ bool distrVisibility = (numColors == (int)this->myNbValues.size());
vtkPoints *distrPts;
vtkCellArray *distrPolys;
vtkUnsignedCharArray *distColors = 0;
if(!distrVisibility)
vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()");
- if (distrVisibility && GetDistributionVisibility()) {
- for( i=0 ;i<myNbValues.size();i++ ) {
- if(myNbValues[i]) {
+ if ( distrVisibility && GetDistributionVisibility() ) {
+ for ( i = 0 ; i < (int)myNbValues.size(); i++ ) {
+ if ( myNbValues[i] ) {
numPositiveVal++;
maxValue = std::max(maxValue,myNbValues[i]);
- }
+ }
}
numDistrPts = 4*(numPositiveVal);
distrPts = vtkPoints::New();
int targetWidth, targetHeight;
// rnv begin
// Customization of the vtkScalarBarActor to show distribution histogram.
- bool distrVisibility = this->MaximumNumberOfColors == this->myNbValues.size();
+ bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() );
double coef;
if( GetDistributionVisibility() && distrVisibility )
if(this->Orientation == VTK_ORIENT_VERTICAL)
}
//----------------------------------------------------------------------------
-void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
- int *size,
- vtkViewport *viewport)
+void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
+ int *size,
+ vtkViewport *viewport)
{
titleSize[0] = titleSize[1] = 0;
if (this->Title == NULL || !strlen(this->Title))
- {
+ {
return;
- }
+ }
int targetWidth, targetHeight;
-
+
targetWidth = size[0];
// rnv begin
// Customization of the vtkScalarBarActor to show distribution histogram.
- bool distrVisibility = this->MaximumNumberOfColors == this->myNbValues.size();
+ bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() );
double coef;
- if( GetDistributionVisibility() && distrVisibility )
+ if ( GetDistributionVisibility() && distrVisibility )
coef=0.18;
- else
+ else
coef=0.25;
if ( this->Orientation == VTK_ORIENT_VERTICAL )
- {
- targetHeight = (int)(0.1*size[1]);
- }
+ {
+ targetHeight = (int)(0.1*size[1]);
+ }
else
- {
- targetHeight = (int)(coef*size[1]);
- }
+ {
+ targetHeight = (int)(coef*size[1]);
+ }
- this->TitleMapper->SetConstrainedFontSize(
- viewport, targetWidth, targetHeight);
+ this->TitleMapper->SetConstrainedFontSize(viewport, targetWidth, targetHeight);
this->TitleMapper->GetSize(viewport, titleSize);
}
*/
void SMDS_Down1D::allocate(int nbElems)
{
- if (nbElems >= _vtkCellIds.size())
- {
- _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
- _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
- _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
- _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
- }
+ if (nbElems >= (int)_vtkCellIds.size())
+ {
+ _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
+ _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+ _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
+ _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
+ }
}
void SMDS_Down1D::compactStorage()
_upCellIndex.resize(_maxId + 1, -1); // id and types of rank i correspond to [ _upCellIndex[i], _upCellIndex[i+1] [
int current = 0;
for (int i = 0; i < _maxId; i++)
+ {
+ _upCellIndex[i] = current;
+ for (size_t j = 0; j < _upCellIdsVector[i].size(); j++)
{
- _upCellIndex[i] = current;
- for (int j = 0; j < _upCellIdsVector[i].size(); j++)
- {
- _upCellIds[current] = _upCellIdsVector[i][j];
- _upCellTypes[current] = _upCellTypesVector[i][j];
- current++;
- }
+ _upCellIds[current] = _upCellIdsVector[i][j];
+ _upCellTypes[current] = _upCellTypesVector[i][j];
+ current++;
}
+ }
_upCellIndex[_maxId] = current;
_upCellIdsVector.clear();
*/
void SMDS_Down2D::allocate(int nbElems)
{
- if (nbElems >= _vtkCellIds.size())
- {
- _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
- _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
- _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
- _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
- _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
- }
+ if (nbElems >= (int)_vtkCellIds.size())
+ {
+ _cellIds.resize (_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+ _vtkCellIds.resize (nbElems + SMDS_Mesh::chunkSize, -1);
+ _upCellIds.resize (2 * (nbElems + SMDS_Mesh::chunkSize), -1);
+ _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
+ _tempNodes.resize (_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
+ }
}
void SMDS_Down2D::compactStorage()
void SMDS_Down3D::allocate(int nbElems)
{
- if (nbElems >= _vtkCellIds.size())
- {
- _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
- _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
- }
+ if (nbElems >= (int)_vtkCellIds.size())
+ {
+ _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
+ _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
+ }
}
void SMDS_Down3D::compactStorage()
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++ )
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
set<int> tofind;
int ids[12] = { 0, 1, 2, 0, 3, 1, 2, 3, 0, 1, 3, 2 };
-//int ids[12] = { 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 };
+ //int ids[12] = { 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 };
for (int k = 0; k < 4; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 3; i++)
+ tofind.insert(nodes[ids[3 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 3; i++)
- tofind.insert(nodes[ids[3 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 3; i++)
- orderedNodes[i] = nodes[ids[3 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[3 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++ )
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
set<int> tofind;
int ids[24] = { 0, 1, 2, 4, 5, 6, 0, 3, 1, 7, 8, 4, 2, 3, 0, 9, 7, 6, 1, 3, 2, 8, 9, 5 };
-//int ids[24] = { 2, 1, 0, 5, 4, 6, 1, 3, 0, 8, 7, 4, 0, 3, 2, 7, 9, 6, 2, 3, 1, 9, 8, 5 };
+ //int ids[24] = { 2, 1, 0, 5, 4, 6, 1, 3, 0, 8, 7, 4, 0, 3, 2, 7, 9, 6, 2, 3, 1, 9, 8, 5 };
for (int k = 0; k < 4; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 6; i++)
+ tofind.insert(nodes[ids[6 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 6; i++)
- tofind.insert(nodes[ids[6 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 6; i++)
- orderedNodes[i] = nodes[ids[6 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[6 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++ )
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
for (int i = 0; i < 4; i++)
tofind.insert(nodes[ids[i]]);
if (setNodes == tofind)
- {
- for (int i = 0; i < 4; i++)
- orderedNodes[i] = nodes[ids[i]];
- return;
- }
+ {
+ for (int i = 0; i < 4; i++)
+ orderedNodes[i] = nodes[ids[i]];
+ return;
+ }
// Triangular faces
for (int k = 0; k < 4; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 3; i++)
+ tofind.insert(nodes[ids[4 + 3 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 3; i++)
- tofind.insert(nodes[ids[4 + 3 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 3; i++)
- orderedNodes[i] = nodes[ids[4 + 3 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[4 + 3 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes)
{
-// MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
+ // MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++)
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
for (int i = 0; i < 8; i++)
tofind.insert(nodes[ids[i]]);
if (setNodes == tofind)
- {
- for (int i = 0; i < 8; i++)
- orderedNodes[i] = nodes[ids[i]];
- return;
- }
+ {
+ for (int i = 0; i < 8; i++)
+ orderedNodes[i] = nodes[ids[i]];
+ return;
+ }
// Triangular faces
for (int k = 0; k < 4; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 6; i++)
+ tofind.insert(nodes[ids[8 + 6 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 6; i++)
- tofind.insert(nodes[ids[8 + 6 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 6; i++)
- orderedNodes[i] = nodes[ids[8 + 6 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[8 + 6 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++)
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
set<int> tofind;
-//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 };
+ //int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 };
int ids[18] = { 0, 1, 2, 3, 5, 4, 0, 3, 4, 1, 1, 4, 5, 2, 2, 5, 3, 0 };
// Triangular faces
for (int k = 0; k < 2; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 3; i++)
+ tofind.insert(nodes[ids[3 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 3; i++)
- tofind.insert(nodes[ids[3 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 3; i++)
- orderedNodes[i] = nodes[ids[3 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[3 * k + i]];
+ return;
}
+ }
// Quadrangular faces
for (int k = 0; k < 3; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 4; i++)
+ tofind.insert(nodes[ids[6 + 4 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 4; i++)
- tofind.insert(nodes[ids[6 + 4 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 4; i++)
- orderedNodes[i] = nodes[ids[6 + 4 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[6 + 4 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
int *faces = &_cellIds[_nbDownCells * cellId];
if (aType == VTK_QUAD)
for (int i = 0; i < 3; i++)
- {
+ {
if (faces[i] < 0)
{
faces[i] = lowCellId;
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++ )
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
set<int> tofind;
-//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 };
+ //int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 };
int ids[36] = { 0, 1, 2, 6, 7, 8, 3, 5, 4, 11, 10, 9,
0, 3, 4, 1, 12, 9, 13, 6, 1, 4, 5, 2, 13, 10, 14, 7, 2, 5, 3, 0, 14, 11, 12, 8 };
// Triangular faces
for (int k = 0; k < 2; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 6; i++)
+ tofind.insert(nodes[ids[6 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 6; i++)
- tofind.insert(nodes[ids[6 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 6; i++)
- orderedNodes[i] = nodes[ids[6 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[6 * k + i]];
+ return;
}
+ }
// Quadrangular faces
for (int k = 0; k < 3; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 8; i++)
+ tofind.insert(nodes[ids[12 + 8 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 8; i++)
- tofind.insert(nodes[ids[12 + 8 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 8; i++)
- orderedNodes[i] = nodes[ids[12 + 8 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[12 + 8 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++ )
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
set<int> tofind;
-//int ids[24] = { 0, 1, 2, 3, 7, 6, 5, 4, 4, 0, 3, 7, 5, 1, 0, 4, 6, 2, 1, 5, 7, 3, 2, 6};
+ //int ids[24] = { 0, 1, 2, 3, 7, 6, 5, 4, 4, 0, 3, 7, 5, 1, 0, 4, 6, 2, 1, 5, 7, 3, 2, 6};
int ids[24] = { 3, 2, 1, 0, 4, 5, 6, 7, 7, 3, 0, 4, 4, 0, 1, 5, 5, 1, 2, 6, 6, 2, 3, 7};
for (int k = 0; k < 6; k++) // loop on the 6 faces
+ {
+ tofind.clear();
+ for (int i = 0; i < 4; i++)
+ tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 4; i++)
- tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i
- if (setNodes == tofind)
- {
- for (int i = 0; i < 4; i++)
- orderedNodes[i] = nodes[ids[4 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[4 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
{
set<int> setNodes;
setNodes.clear();
- for (int i = 0; i < orderedNodes.size(); i++)
+ for ( size_t i = 0; i < orderedNodes.size(); i++ )
setNodes.insert(orderedNodes[i]);
//MESSAGE("cellId = " << cellId);
int ids[48] = { 3, 2, 1, 0,10, 9, 8,11, 4, 5, 6, 7,12,13,14,15, 7, 3, 0, 4,19,11,16,15,
4, 0, 1, 5,16, 8,17,12, 5, 1, 2, 6,17, 9,18,13, 6, 2, 3, 7,18,10,19,14};
for (int k = 0; k < 6; k++)
+ {
+ tofind.clear();
+ for (int i = 0; i < 8; i++)
+ tofind.insert(nodes[ids[8 * k + i]]);
+ if (setNodes == tofind)
{
- tofind.clear();
for (int i = 0; i < 8; i++)
- tofind.insert(nodes[ids[8 * k + i]]);
- if (setNodes == tofind)
- {
- for (int i = 0; i < 8; i++)
- orderedNodes[i] = nodes[ids[8 * k + i]];
- return;
- }
+ orderedNodes[i] = nodes[ids[8 * k + i]];
+ return;
}
+ }
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
/// Create an iterator which look for elements of type type which are linked
/// to the element element. it is the iterator to get connectivity of element
//////////////////////////////////////////////////////////////////////////////
-SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element,
- SMDSAbs_ElementType type,
+SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element,
+ SMDSAbs_ElementType type,
const SMDS_ElemIteratorPtr& it)
- : t1Iterator(it),
- t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)),
- myType(type), myElement(element),
- myProxyElement(NULL)
+ : t1Iterator(it),
+ t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)),
+ myType(type), myElement(element),
+ myProxyElement(NULL)
{
- while(subMore())
- alreadyReturnedElements.insert(subNext());
- itAlreadyReturned= alreadyReturnedElements.begin();
- switch(myElement->GetType())
- {
- case SMDSAbs_Node:
- case SMDSAbs_Edge: myReverseIteration=true; break;
- case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
- default: myReverseIteration=false;
- }
+ while(subMore())
+ alreadyReturnedElements.insert(subNext());
+ itAlreadyReturned= alreadyReturnedElements.begin();
+ switch(myElement->GetType())
+ {
+ case SMDSAbs_Node:
+ case SMDSAbs_Edge: myReverseIteration=true; break;
+ case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
+ default: myReverseIteration=false;
+ }
}
bool SMDS_IteratorOfElements::more()
const SMDS_MeshElement * next();
private:
- SMDS_ElemIteratorPtr t2Iterator;
SMDS_ElemIteratorPtr t1Iterator;
+ SMDS_ElemIteratorPtr t2Iterator;
SMDSAbs_ElementType myType;
- const SMDS_MeshElement * myProxyElement;
const SMDS_MeshElement * myElement;
+ const SMDS_MeshElement * myProxyElement;
bool myReverseIteration;
std::set<const SMDS_MeshElement*> alreadyReturnedElements;
MESSAGE("Internal Error: This should not happen");
break;
case SMDSAbs_0DElement:
+ case SMDSAbs_Ball:
{
}
break;
addChildrenWithNodes(setOfChildren, ite->next(), nodes);
}
}
+ case SMDSAbs_NbElementTypes:
case SMDSAbs_All: break;
}
}
reverseInterlaces[ smdsType ][pos++] = 0;
for ( int i = nbNodes / 2 - 1; i > 0 ; --i ) // 3,2,1
reverseInterlaces[ smdsType ][pos++] = i;
- for ( int i = nbNodes - 1; i >= nbNodes / 2; --i ) // 7,6,5,4
+ for ( int i = nbNodes - 1, nb = nbNodes / 2; i >= nb; --i ) // 7,6,5,4
reverseInterlaces[ smdsType ][pos++] = i;
}
}
{
int nbEdges = 0;
- for (int ifa = 0; ifa < myQuantities.size(); ifa++) {
+ for ( size_t ifa = 0; ifa < myQuantities.size(); ifa++) {
nbEdges += myQuantities[ifa];
}
nbEdges /= 2;
//=======================================================================
int SMDS_PolyhedralVolumeOfNodes::NbFaceNodes (const int face_ind) const
{
- if (face_ind < 1 || myQuantities.size() < face_ind)
+ if (face_ind < 1 || (int)myQuantities.size() < face_ind)
return 0;
return myQuantities[face_ind - 1];
}
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
- int myIndex;
+ size_t myIndex;
public:
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
SMDS_VolumeTool vTool(vol);
case 15: nbCorners = 6; break;
default: nbCorners = 8;
}
- for ( int i = nbCorners; i<myNodes.size(); i++) {
+ for ( size_t i = nbCorners; i<myNodes.size(); i++) {
if(myNodes[i]==node) return true;
}
return false;
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
- int myIndex;
+ size_t myIndex;
public:
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
SMDS_VolumeTool vTool(vol);
if ( !myVolume )
return false;
- for ( int i = 0; i < myVolumeNodes.size(); i++ ) {
+ for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) {
X += myVolumeNodes[ i ]->X();
Y += myVolumeNodes[ i ]->Y();
Z += myVolumeNodes[ i ]->Z();
// find nodes indices
int i1 = -1, i2 = -1, nbFound = 0;
- for ( int i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ )
+ for ( size_t i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ )
{
if ( myVolumeNodes[ i ] == theNode1 )
i1 = i, ++nbFound;
int minInd = min( theNode1Index, theNode2Index );
int maxInd = max( theNode1Index, theNode2Index );
- if ( minInd < 0 || maxInd > myVolumeNodes.size() - 1 || maxInd == minInd )
+ if ( minInd < 0 || maxInd > (int)myVolumeNodes.size() - 1 || maxInd == minInd )
return false;
VolumeType type = GetVolumeType();
int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const
{
if ( myVolume ) {
- for ( int i = 0; i < myVolumeNodes.size(); i++ ) {
+ for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) {
if ( myVolumeNodes[ i ] == theNode )
return i;
}
{
edges.clear();
edges.reserve( myVolumeNodes.size() * 2 );
- for ( int i = 0; i < myVolumeNodes.size()-1; ++i ) {
- for ( int j = i + 1; j < myVolumeNodes.size(); ++j ) {
+ for ( size_t i = 0; i < myVolumeNodes.size()-1; ++i ) {
+ for ( size_t j = i + 1; j < myVolumeNodes.size(); ++j ) {
if ( IsLinked( i, j )) {
const SMDS_MeshElement* edge =
SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] );
}
chrono::chrono(int i) :
- _ctr(i), _run(true)
+ _run(true), _ctr(i)
{
//MESSAGE("chrono::chrono " << _ctr << " " << _run);
_start = clock();
#define SMESHFILTERSSELECTION_EXPORT
#endif
-namespace SMESH{
+namespace SMESH {
enum MeshObjectType {
HYPOTHESIS,
ALGORITHM,
IDSOURCE_FACE,
IDSOURCE_VOLUME
};
-};
+}
#endif
Ok = isIDSourceOfType( obj, SMESH::VOLUME );
break;
}
+ default:;
}
}
return Ok;
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module
{
- Q_OBJECT;
+ Q_OBJECT
public :
SMESHGUI();
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myGeomType( theType ),
- myBusy( false )
+ myBusy( false ),
+ myGeomType( theType )
{
setModal( false );
setAttribute( Qt::WA_DeleteOnClose, true );
myNbCenterNodes = 1;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons
break;
+ default:;
}
myMidFaceLabel ->setVisible( myNbMidFaceNodes );
anIds.push_back( aListId[ 0 ].toInt() );
}
break;
+ default:;
}
if ( myReverseCB->isChecked())
ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
case SMESH::VOLUME:
myActor->SetRepresentation(SMESH_Actor::eSurface);
myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
+ default:;
}
}
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
anElementType = SMESH::VOLUME; break;
+ default:;
}
myGroups.clear();
ComboBox_GroupName->clear();
okIDs.insert( anID );
}
- return okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
+ return (int) okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
}
//=================================================================================
aFirstColIds = FirstHexahedronIds;
aLastColIds = LastHexahedronIds;
break;
+ default:;
}
// fill the First and the Last columns
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
{
- Q_OBJECT;
+ Q_OBJECT
public:
if (myViewWindow)
SMESH::RenderViewWindow(myViewWindow);
- for( int i=0; i< myPlanes.size(); i++ ) {
+ for ( size_t i = 0; i < myPlanes.size(); i++ ) {
SMESH::TPlaneData aPlaneData = myPlanes[i];
aPlaneData.Plane->Delete();
}
- if (myPreviewWidget) {
+ if ( myPreviewWidget ) {
myPreviewWidget->Off();
myPreviewWidget->Delete();
}
GEOM_Actor* getActor(const TopoDS_Shape& shape)
{
int index = myIndexToShape.FindIndex( shape ) - 1;
- if ( index < 0 || index >= myActors.size() )
+ if ( index < 0 || index >= (int) myActors.size() )
return 0;
GEOM_Actor* & actor = myActors[ index ];
if ( !actor ) {
#endif
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
// check if there are memory problems
- for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
+ for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
}
catch(const SALOME::SALOME_Exception & S_ex) {
aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) );
SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
// put SubMeshes into list
- for ( int i = 0; i < aSubMeshes->length(); i++ ) {
+ for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ ) {
SMESH::SMESH_subMesh_var sm = aSubMeshes[i];
if ( CORBA::is_nil( sm ) ) continue;
_PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
else
{
bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported
- for ( int i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
+ for ( CORBA::ULong i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING ||
theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
tbl->setColumnWidth( COL_ERROR, 200 );
bool hasBadMesh = false;
- for ( int row = 0; row < theCompErrors->length(); ++row )
+ for ( int row = 0; row < (int) theCompErrors->length(); ++row )
{
SMESH::ComputeError & err = theCompErrors[ row ];
//================================================================================
/*!
* \brief Constructor
-*/
+ */
//================================================================================
SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp()
: SMESHGUI_BaseComputeOp(),
- myDlg( 0 ),
- myOrderMgr( 0 ),
myActiveDlg( 0 ),
- myPreviewDisplayer( 0 )
+ myDlg( 0 ),
+ myPreviewDisplayer( 0 ),
+ myOrderMgr( 0 )
{
}
#endif
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
// check if there are memory problems
- for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
+ for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
}
catch(const SALOME::SALOME_Exception & S_ex){
tbl->setColumnWidth( COL_ERROR, 200 );
bool hasBadMesh = false;
- for ( int row = 0; row < theCompErrors->length(); ++row )
+ for ( int row = 0; row < (int) theCompErrors->length(); ++row )
{
SMESH::ComputeError & err = theCompErrors[ row ];
}
}
break;
- }
+
+ default:;
+ } // switch( (*anIt).myValue.type() )
if( w )
{
{
SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo );
if( listSOmesh.size() > 0 )
- for( int i = 0; i < listSOmesh.size(); i++ )
+ for( size_t i = 0; i < listSOmesh.size(); i++ )
{
_PTR(SObject) submSO = listSOmesh[i];
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
{
QString valueStr = "";
ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
- uint len0 = 0;
- for( int i=0; param!=aLast; param++, i++ )
+ int len0 = 0;
+ for ( ; param != aLast; param++ )
{
if ( valueStr.length() > len0 ) {
valueStr += "; ";
Context( theContext ),
Dim( theDim ),
IsAuxOrNeedHyp( theIsAuxOrNeedHyp ),
+ IsNeedGeometry( theIsNeedGeometry ),
+ IsSupportSubmeshes( supportSub ),
BasicHypos( theBasicHypos ),
OptionalHypos( theOptionalHypos ),
InputTypes( theInputTypes ),
- OutputTypes( theOutputTypes ),
- IsNeedGeometry( theIsNeedGeometry ),
- IsSupportSubmeshes( supportSub )
+ OutputTypes( theOutputTypes )
{
}
//================================================================================
SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh )
: SMESHGUI_SelectionOp(),
- myToCreate( theToCreate ),
- myIsMesh( theIsMesh ),
myDlg( 0 ),
myShapeByMeshOp( 0 ),
+ myToCreate( theToCreate ),
+ myIsMesh( theIsMesh ),
myHypoSet( 0 )
{
if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists
if (aSeq->length() > 0) {
shapeDim = -1;
- for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
+ for ( CORBA::ULong iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
GEOM::GEOM_Object_var aGeomVar = aSeq[iss];
switch ( aGeomVar->GetShapeType() ) {
case GEOM::SOLID: shapeDim = 3; break;
bool myHasConcurrentSubBefore;
TDim2Type2HypList myExistingHyps; //!< all hypothesis of SMESH module
- TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current
+ TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current
// edited mesh/sub-mesh
// hypdata corresponding to hypotheses present in myDlg
THypDataList myAvailableHypData[4][NbHypTypes];
QString myLastGeomToSelect;
THypLabelIsAppMap myHypMapIsApplicable;
bool myIgnoreAlgoSelection;
- HypothesesSet* myHypoSet;
- int myDim, myType, myMaxShapeDim;
+ HypothesesSet* myHypoSet;
+ int myDim, myType, myMaxShapeDim;
QString myObjectToSelect;
};
bool SMESH_File::getInts(std::vector<int>& ints)
{
- int i = 0;
+ size_t i = 0;
while ( i < ints.size() )
{
while ( !isdigit( *_pos ) && !eof()) ++_pos;
#else
ssize_t nbWritten = ::write( _file, data, size );
- return ( nbWritten == size );
+ return ( nbWritten == (ssize_t) size );
#endif
}
addedEdges.insert( bndSegs[i]._edge->twin() ).second )
{
v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex0(), v2Node.size() + 1 )).first;
- int n0 = v2n->second;
+ size_t n0 = v2n->second;
if ( n0 == v2Node.size() )
text << "n" << n0 << " = m.AddNode( "
<< bndSegs[i]._edge->vertex0()->x() / theScale[0] << ", "
<< bndSegs[i]._edge->vertex0()->y() / theScale[1] << ", 0 )\n";
v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex1(), v2Node.size() + 1 )).first;
- int n1 = v2n->second;
+ size_t n1 = v2n->second;
if ( n1 == v2Node.size() )
text << "n" << n1 << " = m.AddNode( "
<< bndSegs[i]._edge->vertex1()->x() / theScale[0] << ", "
else // bndSegs[ i ]._branchID > 0
{
dInd = +1;
- for ( edgeInd = 0; edgeInd < branchEdges[ brID ].size(); ++edgeInd )
+ for ( edgeInd = 0; edgeInd < (int)branchEdges[ brID ].size(); ++edgeInd )
if ( branchEdges[ brID ][ edgeInd ] == bndSegs[ i ]._edge )
break;
}
int di = ( points._params[0] == points._params[i] ) ? +1 : -1;
while ( points._params[i] == points._params[i+1] )
i += di;
- if ( i < 0 || i+1 >= points._params.size() )
+ if ( i < 0 || i+1 >= (int)points._params.size() )
i = 0;
}
if ( !points._maEdges[ i ].second ) // no branch at the EDGE end, look for a closest branch
{
- if ( i < points._maEdges.size() / 2 ) // near 1st point
+ if ( i < (int)points._maEdges.size() / 2 ) // near 1st point
{
- while ( i < points._maEdges.size()-1 && !points._maEdges[ i ].second )
+ while ( i < (int)points._maEdges.size()-1 && !points._maEdges[ i ].second )
++i;
edgeParam = edgeReverse;
}
if ( p._iEdge > _params.size()-1 )
return false;
if ( p._iEdge == _params.size()-1 )
- return u = 1.;
+ return ( u = 1. );
u = ( _params[ p._iEdge ] * ( 1 - p._edgeParam ) +
_params[ p._iEdge+1 ] * p._edgeParam );
{
// look for a VERTEX of the opposite EDGE
// iNext - next after all null-length segments
- while ( maE = ++iNext )
+ while (( maE = ++iNext ))
{
iSeg2 = getBndSegment( maE );
if ( !_boundary->isConcaveSegment( ie1, iSeg2 ))
else if ( isConcaPrev )
{
// all null-length segments passed, find their beginning
- while ( maE = iPrev.edgePrev() )
+ while (( maE = iPrev.edgePrev() ))
{
iSeg1 = getBndSegment( maE );
if ( _boundary->isConcaveSegment( edgeIDs1.back(), iSeg1 ))
BranchPoint divisionPnt;
divisionPnt._branch = this;
- for ( ++maIter, ++twIter; maIter.index() < _maEdges.size(); ++maIter, ++twIter )
+ for ( ++maIter, ++twIter; maIter.index() < (int)_maEdges.size(); ++maIter, ++twIter )
{
size_t ie1 = getGeomEdge( maIter.edge() );
size_t ie2 = getGeomEdge( twIter.edge() );
myFather(0),
myIsLeaf( false ),
myLimit( limit ),
- myLevel(0),
- myBox(0)
+ myBox(0),
+ myLevel(0)
{
//if ( !myLimit ) myLimit = new SMESH_TreeLimit();
}
// color must be presented as a string of next form:
if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example)
str = str.substr(1);
- for ( int i = 0; i < str.length()/2; i++ )
+ for ( size_t i = 0; i < str.length()/2; i++ )
if ( str.at(i*2) >= '0' && str.at(i*2) <= 'f' && str.at(i*2+1) >= '0' && str.at(i*2+1) <= 'f' )
color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) );
}
_CORBA_Octet* buffer = new _CORBA_Octet[real_size];
char tmp[3];
tmp[2]='\0';
- int c = -1;
+ uint c = -1;
for ( int i = 0; i < real_size; i++ )
{
memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 );
SMDS_MeshElement::Filter & filter = *aFilter;
if ( aType == SMDSAbs_Node )
- for (int i=0; i<IDs.length(); i++) {
+ for ( CORBA::ULong i = 0; i < IDs.length(); i++ ) {
const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] );
if ( filter( elem ))
aMap.insert( aMap.end(), elem );
}
else
- for (int i=0; i<IDs.length(); i++) {
+ for ( CORBA::ULong i = 0; i<IDs.length(); i++) {
const SMDS_MeshElement * elem = aMesh->FindElement( IDs[i] );
if ( filter( elem ))
aMap.insert( aMap.end(), elem );
SMESH::long_array_var aElementsId = theObject->GetIDs();
if ( types->length() == 1 && types[0] == SMESH::NODE)
{
- for(int i = 0; i < aElementsId->length(); i++)
+ for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ )
if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] ))
theNodeSet.insert( theNodeSet.end(), n);
}
{
SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator();
while ( nIt->more( ))
- if( const SMDS_MeshElement * elem = nIt->next() )
+ if ( const SMDS_MeshElement * elem = nIt->next() )
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
}
else
{
- for(int i = 0; i < aElementsId->length(); i++)
- if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
+ for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ )
+ if ( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
}
}
SMDSAbs_ElementType elemType = (*theElements.begin())->GetType();
bool sameElemType = ( elemType == (*theElements.rbegin())->GetType() );
if ( sameElemType &&
- theMeshDS->GetMeshInfo().NbElements( elemType ) == theElements.size() )
+ theMeshDS->GetMeshInfo().NbElements( elemType ) == (int) theElements.size() )
return; // all the elements are in theElements
if ( !sameElemType )
list< int > IdList;
- for (int i = 0; i < IDsOfElements.length(); i++)
+ for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
IdList.push_back( IDsOfElements[i] );
// Update Python script
initData();
list< int > IdList;
- for (int i = 0; i < IDsOfNodes.length(); i++)
+ for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++)
IdList.push_back( IDsOfNodes[i] );
// Update Python script
SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq );
// remove orphan nodes (if there are any)
- list< int > IdList;
- for ( int i = 0; i < seq.size(); i++ )
- IdList.push_back( seq[i] );
+ list< int > IdList( seq.begin(), seq.end() );
int nbNodesBefore = myMesh->NbNodes();
getEditor().Remove( IdList, true );
SMESH_TRY;
initData();
- for (int i = 0; i < IDsOfElements.length(); i++)
+ for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
{
CORBA::Long index = IDsOfElements[i];
const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
set<const SMDS_MeshNode*> fixedNodes;
- for (int i = 0; i < IDsOfFixedNodes.length(); i++) {
+ for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) {
CORBA::Long index = IDsOfFixedNodes[i];
const SMDS_MeshNode * node = aMesh->FindNode(index);
if ( node )
idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
list<double> angles;
- for (int i = 0; i < theAngles.length(); i++) {
+ for ( CORBA::ULong i = 0; i < theAngles.length(); i++ ) {
angles.push_back( theAngles[i] );
}
TIDSortedNodeSet nodes;
idSourceToNodeSet( theObject, getMeshDS(), nodes );
- for ( int i = 0; i < theExceptSubMeshOrGroups.length(); ++i )
+ for ( CORBA::ULong i = 0; i < theExceptSubMeshOrGroups.length(); ++i )
{
SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( theExceptSubMeshOrGroups[i],
SMESH::NODE );
aTPythonDump << this << ".MergeNodes([";
TIDSortedNodeSet setOfNodesToKeep;
- for ( int i = 0; i < NodesToKeep.length(); ++i )
+ for ( CORBA::ULong i = 0; i < NodesToKeep.length(); ++i )
{
prepareIdSource( NodesToKeep[i] );
SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( NodesToKeep[i], SMESH::NODE );
}
::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
- for (int i = 0; i < GroupsOfNodes.length(); i++)
+ for ( CORBA::ULong i = 0; i < GroupsOfNodes.length(); i++ )
{
const SMESH::long_array& aNodeGroup = GroupsOfNodes[ i ];
aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() );
list< const SMDS_MeshNode* >& aListOfNodes = aListOfListOfNodes.back();
- for ( int j = 0; j < aNodeGroup.length(); j++ )
+ for ( CORBA::ULong j = 0; j < aNodeGroup.length(); j++ )
{
CORBA::Long index = aNodeGroup[ j ];
if ( const SMDS_MeshNode * node = aMesh->FindNode( index ))
::SMESH_MeshEditor::TListOfListOfElementsID aListOfListOfElementsID;
- for (int i = 0; i < GroupsOfElementsID.length(); i++) {
+ for ( CORBA::ULong i = 0; i < GroupsOfElementsID.length(); i++ ) {
const SMESH::long_array& anElemsIDGroup = GroupsOfElementsID[ i ];
aListOfListOfElementsID.push_back( list< int >() );
list< int >& aListOfElemsID = aListOfListOfElementsID.back();
- for ( int j = 0; j < anElemsIDGroup.length(); j++ ) {
+ for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ ) {
CORBA::Long id = anElemsIDGroup[ j ];
aListOfElemsID.push_back( id );
}
SMDSAbs_ElementType( type ),
foundElems);
res->length( foundElems.size() );
- for ( int i = 0; i < foundElems.size(); ++i )
+ for ( size_t i = 0; i < foundElems.size(); ++i )
res[i] = foundElems[i]->GetID();
return res._retn();
SMDSAbs_ElementType( type ),
foundElems);
res->length( foundElems.size() );
- for ( int i = 0; i < foundElems.size(); ++i )
+ for ( size_t i = 0; i < foundElems.size(); ++i )
res[i] = foundElems[i]->GetID();
return res._retn();
RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS );
RETCASE( SEW_BAD_SIDE1_NODES );
RETCASE( SEW_BAD_SIDE2_NODES );
+ RETCASE( SEW_INTERNAL_ERROR );
}
return SMESH::SMESH_MeshEditor::SEW_OK;
}
for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP )
{
const SMESH::FreeBorderPart& aPART = aGRP[ iP ];
- if ( aPART.border < 0 || aPART.border >= freeBorders.borders.length() )
+ if ( aPART.border < 0 || aPART.border >= (int) freeBorders.borders.length() )
THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::border index", SALOME::BAD_PARAM);
const SMESH::FreeBorder& aBRD = freeBorders.borders[ aPART.border ];
- if ( aPART.node1 < 0 || aPART.node1 > aBRD.nodeIDs.length() )
+ if ( aPART.node1 < 0 || aPART.node1 > (int) aBRD.nodeIDs.length() )
THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node1", SALOME::BAD_PARAM);
- if ( aPART.node2 < 0 || aPART.node2 > aBRD.nodeIDs.length() )
+ if ( aPART.node2 < 0 || aPART.node2 > (int) aBRD.nodeIDs.length() )
THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node2", SALOME::BAD_PARAM);
- if ( aPART.nodeLast < 0 || aPART.nodeLast > aBRD.nodeIDs.length() )
+ if ( aPART.nodeLast < 0 || aPART.nodeLast > (int) aBRD.nodeIDs.length() )
THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::nodeLast", SALOME::BAD_PARAM);
// do not keep these nodes for further sewing as nodes can be removed by the sewing
theNodeSearcher = SMESH_MeshAlgos::GetNodeSearcher( *getMeshDS() );
vector<double> nodesCoords;
- for (int i = 0; i < theNodesCoords.length(); i++)
+ for ( CORBA::ULong i = 0; i < theNodesCoords.length(); i++)
{
nodesCoords.push_back( theNodesCoords[i] );
}
groupsOfThisMesh ->length( groups.length() );
groupsOfOtherMesh->length( groups.length() );
int nbGroups = 0, nbGroupsOfOtherMesh = 0;
- for ( int i = 0; i < groups.length(); ++i )
+ for ( CORBA::ULong i = 0; i < groups.length(); ++i )
{
SMESH::SMESH_Mesh_var m = groups[i]->GetMesh();
if ( myMesh_i != SMESH::DownCast<SMESH_Mesh_i*>( m ))
*/
void SetVariable(Handle(_pyCommand) theCommand,
const SMESH_ObjectStates* theStates,
- int position, int theArgNb)
+ size_t position, int theArgNb)
{
if(theStates->GetCurrectState().size() > position)
if(!theStates->GetCurrectState().at(position).IsEmpty())
//================================================================================
TState SMESH_ObjectStates::GetCurrectState() const
{
- if(_states.size() > _dumpstate)
+ if ( (int) _states.size() > _dumpstate)
return _states[_dumpstate];
TState empty;
return empty;
//================================================================================
void SMESH_NoteBook::ReplaceVariables()
{
- for(int i=0;i<_commands.size();i++)
+ for ( size_t i = 0 ; i < _commands.size(); i++ )
{
Handle(_pyCommand) aCmd = _commands[i];
TCollection_AsciiString aMethod = aCmd->GetMethod();
{
TState aCurrentState = aStates->GetCurrectState();
int argIndex = h->getParamIndex( aMethod, aCurrentState.size() );
- if ( 0 <= argIndex && argIndex < aCurrentState.size() &&
+ if ( 0 <= argIndex && argIndex < (int)aCurrentState.size() &&
!aCurrentState[argIndex].IsEmpty() )
aCmd->SetArg( 1, aCurrentState[argIndex] );
else
aState = new SMESH_ObjectStates(anObjType);
- for(int i = 0; i < aSections->length(); i++) {
+ for ( size_t i = 0; i < aSections->length(); i++ ) {
TState aVars;
SALOMEDS::ListOfStrings aListOfVars = aSections[i];
- for ( int j = 0; j<aListOfVars.length(); j++)
+ for ( size_t j = 0; j < aListOfVars.length(); j++)
{
TCollection_AsciiString aVar(aListOfVars[j].in());
if(!aVar.IsEmpty() && aStudy->IsVariable(aVar.ToCString())) {
return;
// 2) Initialize all type of 1D Distribution hypothesis
- for(int i=0;i<_commands.size();i++){
- for(int j =0;j < aLDS.size();j++){
+ for ( size_t i = 0; i < _commands.size(); i++ ) {
+ for ( size_t j = 0; j < aLDS.size(); j++ ) {
TCollection_AsciiString aResultValue = _commands[i]->GetResultValue();
if(_commands[i]->GetMethod() == "CreateHypothesis" &&
aLDS[j]->HasDistribution(aResultValue)){
}
// 3) ... and replase variables ...
- for(int i=0;i<_commands.size();i++){
- for(int j =0;j < aLDS.size();j++){
+ for ( size_t i = 0; i < _commands.size(); i++ ) {
+ for ( size_t j = 0; j < aLDS.size(); j++ ) {
TCollection_AsciiString anObject = _commands[i]->GetObject();
if(aLDS[j]->HasDistribution(anObject)) {
TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
{
TCollection_AsciiString aResult;
- for(int i=0;i<_commands.size();i++)
- aResult+=_commands[i]->GetString()+"\n";
+ for ( size_t i = 0; i < _commands.size(); i++ )
+ aResult += _commands[i]->GetString() + "\n";
return aResult;
}
//================================================================================
void SMESH_NoteBook::GetResultLines(std::list< TCollection_AsciiString >& lines) const
{
- for(int i=0;i<_commands.size();i++)
+ for ( size_t i = 0; i < _commands.size(); i++ )
lines.push_back( _commands[i]->GetString() );
}
istream & StdMeshers_Adaptive1D::LoadFrom(istream & load)
{
int dummyParam;
- bool isOK = (load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
+ bool isOK = static_cast<bool>(load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
return load;
{
bool isOK = true;
int intVal;
- isOK = (load >> _begLength);
+ isOK = static_cast<bool>(load >> _begLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> _endLength);
+ isOK = static_cast<bool>(load >> _endLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
- isOK = (load >> _objEntry);
+ isOK = static_cast<bool>(load >> _objEntry);
}
return load;
{
bool ok;
- ok = ( load >> _sizeThreshold );
+ ok = static_cast<bool>( load >> _sizeThreshold );
for ( int ax = 0; ax < 3; ++ax )
{
if (ok)
{
size_t i = 0;
- ok = (load >> i );
+ ok = static_cast<bool>(load >> i );
if ( i > 0 && ok )
{
_coords[ax].resize( i );
for ( i = 0; i < _coords[ax].size() && ok; ++i )
- ok = (load >> _coords[ax][i] );
+ ok = static_cast<bool>(load >> _coords[ax][i] );
}
}
if (ok)
{
size_t i = 0;
- ok = (load >> i );
+ ok = static_cast<bool>(load >> i );
if ( i > 0 && ok )
{
_internalPoints[ax].resize( i );
for ( i = 0; i < _internalPoints[ax].size() && ok; ++i )
- ok = (load >> _internalPoints[ax][i] );
+ ok = static_cast<bool>(load >> _internalPoints[ax][i] );
}
}
if (ok)
{
size_t i = 0;
- ok = (load >> i );
+ ok = static_cast<bool>(load >> i );
if ( i > 0 && ok )
{
_spaceFunctions[ax].resize( i );
for ( i = 0; i < _spaceFunctions[ax].size() && ok; ++i )
- ok = (load >> _spaceFunctions[ax][i] );
+ ok = static_cast<bool>(load >> _spaceFunctions[ax][i] );
}
}
}
- ok = ( load >> _toAddEdges );
+ ok = static_cast<bool>( load >> _toAddEdges );
for ( int i = 0; i < 9 && ok; ++i )
- ok = ( load >> _axisDirs[i]);
+ ok = static_cast<bool>( load >> _axisDirs[i]);
for ( int i = 0; i < 3 && ok ; ++i )
- ok = ( load >> _fixedPoint[i]);
+ ok = static_cast<bool>( load >> _fixedPoint[i]);
return load;
}
int& di, double tol )
{
//val += values[0]; // input \a val is measured from 0.
- if ( i > values.size()-2 )
+ if ( i > (int) values.size()-2 )
i = values.size()-2;
else
- while ( i+2 < values.size() && val > values[ i+1 ])
+ while ( i+2 < (int) values.size() && val > values[ i+1 ])
++i;
while ( i > 0 && val < values[ i ])
--i;
if ( i > 0 && val - values[ i ] < tol )
di = -1;
- else if ( i+2 < values.size() && values[ i+1 ] - val < tol )
+ else if ( i+2 < (int) values.size() && values[ i+1 ] - val < tol )
di = 1;
else
di = 0;
if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon ))
quad._eIntNodes[ iP ]->_usedInFace = 0;
#endif
- int nbUsedEdgeNodes = 0;
+ size_t nbUsedEdgeNodes = 0;
_Face* prevPolyg = 0; // polygon previously created from this quad
while ( nbSplits > 0 )
else
{
_OrientedLink foundSplit;
- for ( int i = iS; i < splits.size() && !foundSplit; ++i )
+ for ( size_t i = iS; i < splits.size() && !foundSplit; ++i )
if (( foundSplit = splits[ i ]) &&
( n2->IsLinked( foundSplit.FirstNode()->_intPoint )))
{
{
sortVertexNodes( chainNodes, curNode, curFace );
}
- for ( int i = 0; i < chainNodes.size(); ++i )
+ for ( size_t i = 0; i < chainNodes.size(); ++i )
{
polygon.AddPolyLink( chainNodes[ i ], curNode );
curNode = chainNodes[ i ];
i = int(lineInd.I()) + dInd[iL][0];
j = int(lineInd.J()) + dInd[iL][1];
k = int(lineInd.K()) + dInd[iL][2];
- if ( i < 0 || i >= nbCells[0] ||
- j < 0 || j >= nbCells[1] ||
- k < 0 || k >= nbCells[2] ) continue;
+ if ( i < 0 || i >= (int) nbCells[0] ||
+ j < 0 || j >= (int) nbCells[1] ||
+ k < 0 || k >= (int) nbCells[2] ) continue;
const size_t hexIndex = _grid->CellIndex( i,j,k );
Hexahedron *& hex = allHexa[ hexIndex ];
planes._zProjs [0] = 0;
const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm;
const vector< double > & u = _grid->_coords[ iDirZ ];
- for ( int i = 1; i < planes._zProjs.size(); ++i )
+ for ( size_t i = 1; i < planes._zProjs.size(); ++i )
{
planes._zProjs [i] = zFactor * ( u[i] - u[0] );
}
{
bool isOut = false;
- const bool moreIntPoints = ( iP+1 < link._fIntPoints.size() );
+ const bool moreIntPoints = ( iP+1 < (int) link._fIntPoints.size() );
// get 2 _Node's
_Node* n1 = link._fIntNodes[ iP ];
// sort nodes accoring to the order of edges
_Node* orderNodes [20];
TGeomID orderShapeIDs[20];
- int nbN = 0;
+ size_t nbN = 0;
TGeomID id, *pID;
for ( e = edges.begin(); e != edges.end(); ++e )
{
map< TGeomID, vector< TGeomID > > edge2faceIDsMap;
TopExp_Explorer eExp;
Bnd_Box shapeBox;
- for ( int i = 0; i < faceVec.size(); ++i )
+ for ( size_t i = 0; i < faceVec.size(); ++i )
{
facesItersectors[i]._face = TopoDS::Face ( faceVec[i] );
facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] );
istream & StdMeshers_Deflection1D::LoadFrom(istream & load)
{
- bool isOK = (load >> _value);
+ bool isOK = static_cast<bool>(load >> _value);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
return load;
double FunctionTable::integral( const int i ) const
{
- if( i>=0 && i<myData.size()-1 )
- return integral( i, myData[2*(i+1)]-myData[2*i] );
+ if ( i >= 0 && i < (int)myData.size()-1 )
+ return integral( i, myData[2*(i+1)] - myData[2*i] );
else
return 0;
}
if ( NbEdges() == 0 ) return myPoints;
StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
- SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
+ //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
fHelper.SetSubShape( myFace );
bool paramOK;
double eps = 1e-100;
- // sort nodes of all edges putting them into a map
+ // sort nodes of all edges by putting them into a map
map< double, const SMDS_MeshNode*> u2node;
vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
u2node.insert( u2node.end(), make_pair( 1., node ));
}
- if ( u2node.size() + nbProxyNodes != myNbPonits &&
- u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
+ if ((int) u2node.size() + nbProxyNodes != myNbPonits &&
+ (int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
{
MESSAGE("Wrong node parameters on edges, u2node.size():"
<<u2node.size()<<" != myNbPonits:"<<myNbPonits);
// set <constValue>
if ( isXConst )
- for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].x = constValue;
+ for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].x = constValue;
else
- for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].y = constValue;
+ for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].y = constValue;
} // if ( myPoints.empty())
int EdgeIndex = 0;
double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ];
- for (int i = 0 ; i < myFalsePoints.size(); ++i ) {
+ for ( size_t i = 0 ; i < myFalsePoints.size(); ++i ) {
double normPar = double(i) / double(nbSeg);
UVPtStruct & uvPt = (*points)[i];
uvPt.node = 0;
{
if ( NbEdges() == 0 ) return resultNodes;
- SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
+ //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
fHelper.SetSubShape( myFace );
// Fill the result vector
if ( theEdgeInd < 0 &&
- u2node.size() != myNbPonits &&
- u2node.size() != NbPoints( /*update=*/true ))
+ (int) u2node.size() != myNbPonits &&
+ (int) u2node.size() != NbPoints( /*update=*/true ))
{
u2node.clear();
}
n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false );
if (( !n ) &&
- (( i > 0 && i < NbEdges() ) || IsClosed() ))
+ (( i > 0 && (int) i < NbEdges() ) || IsClosed() ))
{
iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() );
sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]);
if (msg) MESSAGE ( std::endl << msg );
MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
- for ( int i=0; i<myEdge.size(); ++i)
+ for ( size_t i = 0; i < myEdge.size(); ++i )
{
MESSAGE_ADD ( "\t"<<i+1 );
MESSAGE_ADD ( "\tEDGE: " );
else {
TopAbs::Print(myEdge[i].Orientation(),cout)<<" "<<myEdge[i].TShape().operator->()<<endl;
MESSAGE_ADD ( "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
- << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
+ << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() );
}
MESSAGE_ADD ( "\tC2d: ");
-
+
if (myC2d[i].IsNull()) {
MESSAGE_ADD ( "NULL" );
}
else {
MESSAGE_ADD ( myC2d[i].operator->() );
}
-
+
MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
}
TopoDS_Wire aWire;
BRep_Builder aBuilder;
aBuilder.MakeWire(aWire);
- for ( int i=0; i<myEdge.size(); ++i )
+ for ( size_t i = 0; i < myEdge.size(); ++i )
aBuilder.Add( aWire, myEdge[i] );
if ( myEdge.size() == 2 && IsClosed() )
int i = U * double( myPoints.size()-1 );
while ( i > 0 && myPoints[ i ].normParam > U )
--i;
- while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U )
+ while ( i+1 < (int)myPoints.size() && myPoints[ i+1 ].normParam < U )
++i;
double r = (( U - myPoints[ i ].normParam ) /
( myPoints[ i+1 ].normParam - myPoints[ i ].normParam ));
int intVal;
double dblVal;
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if (isOK && intVal > 0) {
_params.clear();
_params.reserve( intVal );
for ( size_t i = 0; i < _params.capacity() && isOK; i++) {
- isOK = (load >> dblVal);
+ isOK = static_cast<bool>(load >> dblVal);
if ( isOK ) _params.push_back( dblVal );
}
}
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if (isOK && intVal > 0) {
_nbsegs.clear();
_nbsegs.reserve( intVal );
for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) {
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK ) _nbsegs.push_back( intVal );
}
}
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.clear();
_edgeIDs.reserve( intVal );
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
}
- isOK = (load >> _objEntry);
+ isOK = static_cast<bool>(load >> _objEntry);
return load;
}
istream & StdMeshers_Geometric1D::LoadFrom(istream & load)
{
bool isOK = true;
- isOK = (load >> _begLength);
- isOK = (load >> _ratio);
+ isOK = static_cast<bool>(load >> _begLength);
+ isOK = static_cast<bool>(load >> _ratio);
if (isOK)
StdMeshers_Reversible1D::LoadFrom( load );
{
bool isOK = true;
int a;
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
this->_mode = a;
else
bool isOK = true;
double a;
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
this->_length = a;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
this->_precision = a;
else
{
bool isOK = true;
double a;
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
this->_maxArea = a;
else
{
bool isOK = true;
double a;
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
this->_maxVolume = a;
else
bool isOK = true;
double a;
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
_length = a;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
_preestimated = a;
else
load.clear(ios::badbit | load.rdstate());
bool pre;
- isOK = (load >> pre);
+ isOK = static_cast<bool>(load >> pre);
if ( isOK )
_preestimation = pre;
else
istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load)
{
bool isOK = true;
- isOK = (load >> _nbLayers);
+ isOK = static_cast<bool>(load >> _nbLayers);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
return load;
int a;
// read number of segments
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
_numberOfSegments = a;
else
// (nb.segments, distr.type, some other params.),
// we wait here the ditribution type, which is integer
double scale_factor;
- isOK = (load >> scale_factor);
+ isOK = static_cast<bool>(load >> scale_factor);
a = (int)scale_factor;
// try to interprete ditribution type,
{
case DT_Scale:
{
- isOK = (load >> b);
+ isOK = static_cast<bool>(load >> b);
if (isOK)
_scaleFactor = b;
else
break;
case DT_TabFunc:
{
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
{
_table.resize(a, 0.);
for ( size_t i=0; i < _table.size(); i++ )
{
- isOK = (load >> b);
+ isOK = static_cast<bool>(load >> b);
if (isOK)
_table[i] = b;
else
case DT_ExprFunc:
{
string str;
- isOK = (load >> str);
+ isOK = static_cast<bool>(load >> str);
if (isOK)
_func = str;
else
if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc)
{
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
_convMode = a;
else
// load reversed edges IDs
int intVal;
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK && _distrType != DT_Regular && intVal > 0 ) {
_edgeIDs.reserve( intVal );
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
- isOK = (load >> _objEntry);
+ isOK = static_cast<bool>(load >> _objEntry);
}
return load;
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_Quadric.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <TColgp_HArray1OfVec.hxx>
-#include <TColgp_HSequenceOfPnt.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColgp_Array1OfVec.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <gp_Lin.hxx>
//=======================================================================
static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
- Handle(TColgp_HSequenceOfPnt)& aContour)
+ TColgp_SequenceOfPnt& aContour)
{
- if(aContour->Length()==3) {
- return HasIntersection3( P, PC, Pint, aContour->Value(1),
- aContour->Value(2), aContour->Value(3) );
+ if ( aContour.Length() == 3 ) {
+ return HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) );
}
else {
bool check = false;
- if( (aContour->Value(1).Distance(aContour->Value(2)) > 1.e-6) &&
- (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) &&
- (aContour->Value(2).Distance(aContour->Value(3)) > 1.e-6) ) {
- check = HasIntersection3( P, PC, Pint, aContour->Value(1),
- aContour->Value(2), aContour->Value(3) );
+ if( (aContour(1).Distance(aContour(2)) > 1.e-6) &&
+ (aContour(1).Distance(aContour(3)) > 1.e-6) &&
+ (aContour(2).Distance(aContour(3)) > 1.e-6) ) {
+ check = HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) );
}
if(check) return true;
- if( (aContour->Value(1).Distance(aContour->Value(4)) > 1.e-6) &&
- (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) &&
- (aContour->Value(4).Distance(aContour->Value(3)) > 1.e-6) ) {
- check = HasIntersection3( P, PC, Pint, aContour->Value(1),
- aContour->Value(3), aContour->Value(4) );
+ if( (aContour(1).Distance(aContour(4)) > 1.e-6) &&
+ (aContour(1).Distance(aContour(3)) > 1.e-6) &&
+ (aContour(4).Distance(aContour(3)) > 1.e-6) ) {
+ check = HasIntersection3( P, PC, Pint, aContour(1), aContour(3), aContour(4) );
}
if(check) return true;
}
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() );
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
- //SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
- //cout<<" CheckIntersection: meshDS->NbFaces() = "<<meshDS->NbFaces()<<endl;
bool res = false;
- double dist = RealLast(); // find intersection closest to the segment
+ double dist = RealLast(); // find intersection closest to PC
gp_Pnt Pres;
gp_Ax1 line( P, gp_Vec(P,PC));
vector< const SMDS_MeshElement* > suspectElems;
searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
+ TColgp_SequenceOfPnt aContour;
for ( size_t iF = 0; iF < suspectElems.size(); ++iF )
{
const SMDS_MeshElement* face = suspectElems[iF];
if ( face == NotCheckedFace ) continue;
- Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
+ aContour.Clear();
for ( int i = 0; i < face->NbCornerNodes(); ++i )
- aContour->Append( SMESH_TNodeXYZ( face->GetNode(i) ));
- if( HasIntersection(P, PC, Pres, aContour) ) {
+ aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) ));
+ if ( HasIntersection(P, PC, Pres, aContour)) {
res = true;
double tmp = PC.Distance(Pres);
if ( tmp < dist ) {
//================================================================================
int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face,
- Handle(TColgp_HArray1OfPnt)& PN,
- Handle(TColgp_HArray1OfVec)& VN,
+ TColgp_Array1OfPnt& PN,
+ TColgp_Array1OfVec& VN,
vector<const SMDS_MeshNode*>& FNodes,
gp_Pnt& PC,
gp_Vec& VNorm,
for ( i = 0; i < 4; ++i )
{
gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) );
- PN->SetValue( i+1, p );
+ PN.SetValue( i+1, p );
xyzC += p;
}
PC = xyzC/4;
for(i=1; i<4; i++) {
j = i+1;
for(; j<=4; j++) {
- if( PN->Value(i).Distance(PN->Value(j)) < 1.e-6 )
+ if( PN(i).Distance(PN(j)) < 1.e-6 )
break;
}
if(j<=4) break;
if(i<4) {
//cout<<"find degeneration"<<endl;
hasdeg = true;
- gp_Pnt Pdeg = PN->Value(i);
+ gp_Pnt Pdeg = PN(i);
list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin();
const SMDS_MeshNode* DegNode = 0;
FNodes[i-1] = DegNode;
}
for(i=j; i<4; i++) {
- PN->SetValue(i,PN->Value(i+1));
+ PN.SetValue(i,PN.Value(i+1));
FNodes[i-1] = FNodes[i];
}
nbp = 3;
}
- PN->SetValue(nbp+1,PN->Value(1));
+ PN.SetValue(nbp+1,PN(1));
FNodes[nbp] = FNodes[0];
// find normal direction
- gp_Vec V1(PC,PN->Value(nbp));
- gp_Vec V2(PC,PN->Value(1));
+ gp_Vec V1(PC,PN(nbp));
+ gp_Vec V2(PC,PN(1));
VNorm = V1.Crossed(V2);
- VN->SetValue(nbp,VNorm);
+ VN.SetValue(nbp,VNorm);
for(i=1; i<nbp; i++) {
- V1 = gp_Vec(PC,PN->Value(i));
- V2 = gp_Vec(PC,PN->Value(i+1));
+ V1 = gp_Vec(PC,PN(i));
+ V2 = gp_Vec(PC,PN(i+1));
gp_Vec Vtmp = V1.Crossed(V2);
- VN->SetValue(i,Vtmp);
+ VN.SetValue(i,Vtmp);
VNorm += Vtmp;
}
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
const SMESHDS_SubMesh * aSubMeshDSFace;
- Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
- Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
+ TColgp_Array1OfPnt PN(1,5);
+ TColgp_Array1OfVec VN(1,4);
vector<const SMDS_MeshNode*> FNodes(5);
gp_Pnt PC;
gp_Vec VNorm;
for(; i<=4; i++) {
gp_Pnt Pbest;
if(!isRev)
- Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i).Reversed());
+ Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i).Reversed());
else
- Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i));
+ Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i));
xc += Pbest.X();
yc += Pbest.Y();
zc += Pbest.Z();
// check PCbest
double height = PCbest.Distance(PC);
- if(height<1.e-6) {
+ if ( height < 1.e-6 ) {
// create new PCbest using a bit shift along VNorm
PCbest = PC.XYZ() + VNorm.XYZ() * 0.001;
}
else {
// check possible intersection with other faces
gp_Pnt Pint;
- bool check = CheckIntersection(PCbest, PC, Pint, aMesh, aShape, face);
- if(check) {
- //cout<<"--PC("<<PC.X()<<","<<PC.Y()<<","<<PC.Z()<<")"<<endl;
- //cout<<" PCbest("<<PCbest.X()<<","<<PCbest.Y()<<","<<PCbest.Z()<<")"<<endl;
+ gp_Vec VB(PC,PCbest);
+ gp_Pnt PCbestTmp = PC.XYZ() + VB.XYZ() * 3.0;
+ bool hasInters = CheckIntersection(PCbestTmp, PC, Pint, aMesh, aShape, face);
+ if ( hasInters ) {
double dist = PC.Distance(Pint)/3.;
- gp_Dir aDir(gp_Vec(PC,PCbest));
- PCbest = PC.XYZ() + aDir.XYZ() * dist;
- }
- else {
- gp_Vec VB(PC,PCbest);
- gp_Pnt PCbestTmp = PC.XYZ() + VB.XYZ() * 3.0;
- check = CheckIntersection(PCbestTmp, PC, Pint, aMesh, aShape, face);
- if(check) {
- double dist = PC.Distance(Pint)/3.;
- if(dist<height) {
- gp_Dir aDir(gp_Vec(PC,PCbest));
- PCbest = PC.XYZ() + aDir.XYZ() * dist;
- }
+ if ( dist < height ) {
+ gp_Dir aDir( VB );
+ PCbest = PC.XYZ() + aDir.XYZ() * dist;
}
}
}
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
+ TColgp_Array1OfPnt PN(1,5);
+ TColgp_Array1OfVec VN(1,4);
+ vector<const SMDS_MeshNode*> FNodes(5);
+ TColgp_SequenceOfPnt aContour;
+
SMDS_FaceIteratorPtr fIt = meshDS->facesIterator(/*idInceasingOrder=*/true);
while( fIt->more())
{
const SMDS_MeshElement* face = fIt->next();
if ( !face ) continue;
// retrieve needed information about a face
- Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
- Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
- vector<const SMDS_MeshNode*> FNodes(5);
gp_Pnt PC;
gp_Vec VNorm;
const SMDS_MeshElement* volumes[2];
SMDS_MeshFace* NewFace;
// check orientation
- double tmp = PN->Value(1).Distance(PN->Value(2)) + PN->Value(2).Distance(PN->Value(3));
+ double tmp = PN(1).Distance(PN(2)) + PN(2).Distance(PN(3));
// far points in VNorm direction
gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6;
gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6;
for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) {
const SMDS_MeshElement* F = suspectElems[iF];
if ( F == face ) continue;
- Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
+ aContour.Clear();
for ( int i = 0; i < 4; ++i )
- aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
+ aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) ));
gp_Pnt PPP;
if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) {
IsOK1 = true;
gp_XYZ PCbest(0., 0., 0.); // pyramid peak
int i = 1;
for ( ; i <= 4; i++ ) {
- gp_Pnt Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i));
+ gp_Pnt Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i));
PCbest += Pbest.XYZ();
}
PCbest /= 4;
// Restrict pyramid height by intersection with other faces
gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize();
- double tmp = PN->Value(1).Distance(PN->Value(3)) + PN->Value(2).Distance(PN->Value(4));
+ double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4));
// far points: in (PC, PCbest) direction and vice-versa
gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6,
PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 };
{
const SMDS_MeshElement* F = suspectElems[iF];
if ( F == face ) continue;
- Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
- int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 );
+ aContour.Clear();
+ int nbN = F->NbCornerNodes();
for ( i = 0; i < nbN; ++i )
- aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
+ aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) ));
gp_Pnt intP;
for ( int isRev = 0; isRev < 2; ++isRev )
{
class SMDS_MeshElement;
class SMDS_MeshNode;
class SMDS_MeshFace;
-class Handle_TColgp_HArray1OfPnt;
-class Handle_TColgp_HArray1OfVec;
+class TColgp_Array1OfPnt;
+class TColgp_Array1OfVec;
class gp_Pnt;
class gp_Vec;
protected:
int Preparation(const SMDS_MeshElement* face,
- Handle_TColgp_HArray1OfPnt& PN,
- Handle_TColgp_HArray1OfVec& VN,
+ TColgp_Array1OfPnt& PN,
+ TColgp_Array1OfVec& VN,
std::vector<const SMDS_MeshNode*>& FNodes,
gp_Pnt& PC, gp_Vec& VNorm,
const SMDS_MeshElement** volumes=0);
istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load)
{
bool isOK = true;
- isOK = (load >> _triaVertexID);
+ isOK = static_cast<bool>(load >> _triaVertexID);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> _objEntry);
+ isOK = static_cast<bool>(load >> _objEntry);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
int type;
- isOK = (load >> type);
+ isOK = static_cast<bool>(load >> type);
if (isOK)
_quadType = StdMeshers_QuadType(type);
// 0 bottom 1
- const int bfrom = quad->side[0].from;
- const int rfrom = quad->side[1].from;
+ //const int bfrom = quad->side[0].from;
+ //const int rfrom = quad->side[1].from;
const int tfrom = quad->side[2].from;
- const int lfrom = quad->side[3].from;
+ //const int lfrom = quad->side[3].from;
{
const vector<UVPtStruct>& uv_eb_vec = quad->side[0].GetUVPtStruct(true,0);
const vector<UVPtStruct>& uv_er_vec = quad->side[1].GetUVPtStruct(false,1);
} // if ( dv != 0 && dh != 0 )
- const int db = quad->side[0].IsReversed() ? -1 : +1;
- const int dr = quad->side[1].IsReversed() ? -1 : +1;
+ //const int db = quad->side[0].IsReversed() ? -1 : +1;
+ //const int dr = quad->side[1].IsReversed() ? -1 : +1;
const int dt = quad->side[2].IsReversed() ? -1 : +1;
- const int dl = quad->side[3].IsReversed() ? -1 : +1;
+ //const int dl = quad->side[3].IsReversed() ? -1 : +1;
// Case dv == 0, here possibly myQuadList.size() > 1
//
const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
- if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
+ if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr ||
+ (int) uv_et.size() != nt || (int) uv_el.size() != nl)
return error(COMPERR_BAD_INPUT_MESH);
// arrays for normalized params
const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
- if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl)
+ if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr ||
+ (int) uv_et.size() != nt || (int) uv_el.size() != nl)
return error(COMPERR_BAD_INPUT_MESH);
gp_UV uv[ UV_SIZE ];
// check if there are possible variations in choosing corners
bool haveVariants = false;
- if ( vertexByAngle.size() > nbCorners )
+ if ((int) vertexByAngle.size() > nbCorners )
{
double lostAngle = a2v->first;
double lastAngle = ( --a2v, a2v->first );
}
const double angleTol = 5.* M_PI/180;
- myCheckOri = ( vertexByAngle.size() > nbCorners ||
+ myCheckOri = ( (int)vertexByAngle.size() > nbCorners ||
vertexByAngle.begin()->first < angleTol );
// make theWire begin from a corner vertex or triaVertex
{
// select two halfDivider's as corners
TGeoIndex hd1, hd2 = -1;
- int iC2;
+ size_t iC2;
for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 )
{
hd1 = cornerInd[ iC2 ];
vector< double > accuLength;
double totalLen = 0;
vector< TGeoIndex > evVec( equVerts.begin(), equVerts.end() );
- int iEV = 0;
+ size_t iEV = 0;
TGeoIndex iE = cornerInd[ helper.WrapIndex( iC - nbC[0] - 1, cornerInd.size() )];
TGeoIndex iEEnd = cornerInd[ helper.WrapIndex( iC + nbC[1] + 1, cornerInd.size() )];
- while ( accuLength.size() < nbEqualV + int( !allCornersSame ) )
+ while ((int) accuLength.size() < nbEqualV + int( !allCornersSame ) )
{
// accumulate length of edges before iEV-th equal vertex
accuLength.push_back( totalLen );
quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt );
}
- SMESH_Mesh* mesh = myHelper->GetMesh();
- SMESHDS_Mesh* meshDS = myHelper->GetMeshDS();
const TopoDS_Face& face = TopoDS::Face( myHelper->GetSubShape() );
Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
continue;
const vector<UVPtStruct>& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct();
const UVPtStruct& uvPt = points[ side.contacts[iC].point ];
- if ( side.contacts[iC].other_point >= oGrid .size() ||
- side.contacts[iC].point >= points.size() )
+ if ( side.contacts[iC].other_point >= (int) oGrid .size() ||
+ side.contacts[iC].point >= (int) points.size() )
throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" );
if ( oGrid[ side.contacts[iC].other_point ].node )
(( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node;
return;
}
- const int iFrom = Min ( iForced, *iNext );
- const int iTo = Max ( iForced, *iNext ) + 1;
- const int sideSize = iTo - iFrom;
+ const int iFrom = Min ( iForced, *iNext );
+ const int iTo = Max ( iForced, *iNext ) + 1;
+ const size_t sideSize = iTo - iFrom;
vector<UVPtStruct> points[4]; // side points of a temporary quad
for ( int is2nd = 0; is2nd < 2; ++is2nd )
{
points[ is2nd ].reserve( sideSize );
- int nbLoops = 0;
+ size_t nbLoops = 0;
while ( points[is2nd].size() < sideSize )
{
int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() );
void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop )
{
- if ( ip >= GetUVPtStruct().size() ||
- iop >= side->GetUVPtStruct().size() )
+ if ( ip >= (int) GetUVPtStruct().size() ||
+ iop >= (int) side->GetUVPtStruct().size() )
throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" );
if ( ip < from || ip >= to )
return;
gp_Vec2d aVec2d(PC,p2dV);
Nodes1.resize( myLayerPositions.size()+1 );
Nodes2.resize( myLayerPositions.size()+1 );
- int i = 0;
- for(; i<myLayerPositions.size(); i++) {
+ size_t i = 0;
+ for ( ; i < myLayerPositions.size(); i++ ) {
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
P0.Y() + aVec.Y()*myLayerPositions[i],
P0.Z() + aVec.Z()*myLayerPositions[i] );
meshDS->SetNodeOnEdge(NC, edgeID, cp);
Nodes1.resize( myLayerPositions.size()+1 );
Nodes2.resize( myLayerPositions.size()+1 );
- int i = 0;
+ size_t i = 0;
for(; i<myLayerPositions.size(); i++) {
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
P0.Y() + aVec.Y()*myLayerPositions[i],
bool nodesFromP0ToP1 = ( theNodes.rbegin()->second == NF );
NC = const_cast<SMDS_MeshNode*>
( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second );
- int i = 0, ir = Nodes1.size()-1;
- int * pi = nodesFromP0ToP1 ? &i : &ir;
+ size_t i = 0, ir = Nodes1.size()-1;
+ size_t * pi = nodesFromP0ToP1 ? &i : &ir;
itn = theNodes.begin();
if ( nodesFromP0ToP1 ) ++itn;
for ( ; i < Nodes1.size(); ++i, --ir, ++itn )
meshDS->SetNodeOnVertex(NC, vertID);
}
double dp = lp-fp;
- int i = 0;
- for(; i<myLayerPositions.size(); i++) {
+ size_t i = 0;
+ for ( ; i < myLayerPositions.size(); i++ ) {
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
P0.Y() + aVec.Y()*myLayerPositions[i],
P0.Z() + aVec.Z()*myLayerPositions[i] );
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
Nodes1[i] = node;
double param;
- if(!ori)
+ if ( !ori )
param = fp + dp*(1-myLayerPositions[i]);
else
param = fp + dp*myLayerPositions[i];
// create 1D elements on edge
SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] );
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
- for(i=1; i<Nodes1.size(); i++) {
+ for ( i = 1; i < Nodes1.size(); i++ ) {
ME = myHelper->AddEdge( Nodes1[i-1], Nodes1[i] );
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
}
- if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
+ if ( nbe == 2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
Nodes2 = Nodes1;
}
markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
return error("Invalid mesh on a straight edge");
bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL );
- int i = 0, ir = Nodes1.size()-1;
- int * pi = nodesFromP0ToP2 ? &i : &ir;
+ size_t i = 0, ir = Nodes1.size()-1;
+ size_t * pi = nodesFromP0ToP2 ? &i : &ir;
itn = theNodes.begin();
if ( nodesFromP0ToP2 ) ++itn;
for ( ; i < Nodes2.size(); ++i, --ir, ++itn )
PC = PL;
}
double dp = lp-fp;
- for(int i=0; i<myLayerPositions.size(); i++) {
+ for ( size_t i = 0; i < myLayerPositions.size(); i++ ) {
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
P0.Y() + aVec.Y()*myLayerPositions[i],
P0.Z() + aVec.Z()*myLayerPositions[i] );
Nodes2[ myLayerPositions.size() ] = NL;
// create 1D elements on edge
SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes2[0] );
- if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
- for(int i=1; i<Nodes2.size(); i++) {
+ if ( ME ) meshDS->SetMeshElementOnShape(ME, edgeID);
+ for ( size_t i = 1; i < Nodes2.size(); i++ ) {
ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] );
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
}
// create faces
tmpNodes.push_back( CNodes[i] );
// quad
- for(j=0; j<Nodes1.size()-1; j++) {
+ for ( j = 0; j < (int)Nodes1.size() - 1; j++ ) {
SMDS_MeshFace* MF;
if(IsForward)
MF = myHelper->AddFace( tmpNodes[j], Nodes1[j],
MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] );
else
MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] );
- if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
- for(j=0; j<Nodes1.size(); j++) {
+ if ( MF ) meshDS->SetMeshElementOnShape(MF, faceID);
+ for ( j = 0; j < (int) Nodes1.size(); j++ ) {
Nodes1[j] = tmpNodes[j];
}
}
// create last faces
// quad
- for(i=0; i<Nodes1.size()-1; i++) {
+ for ( i = 0; i < (int)Nodes1.size()-1; i++ ) {
SMDS_MeshFace* MF;
if(IsForward)
MF = myHelper->AddFace( Nodes2[i], Nodes1[i],
}
else {
- if ( myLayerPositions.size() != nbNodes )
+ if ((int) myLayerPositions.size() != nbNodes )
return error("Radial edge is meshed by other algorithm");
}
}
ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) );
if ( !ok ) {
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
- ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+ ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
}
if(ok) {
ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
// other curve not line
return error(COMPERR_BAD_SHAPE);
}
- int nbLayers = myLayerPositions.size();
+ size_t nbLayers = myLayerPositions.size();
computeLayerPositions( P0, P1, LinEdge2 );
if ( nbLayers != myLayerPositions.size() )
return error("Different hypotheses apply to radial edges");
ok = true; // override other 1d hyps
else {
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
- ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+ ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
}
}
if( ok && aResMap.count( aMesh.GetSubMesh(LinEdge2) )) {
ok = true; // override other 1d hyps
else {
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ];
- ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
+ ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
}
}
if(ok) {
if ( !_edgeIDs.empty() )
{
- for ( size_t i = 0; i < _edgeIDs.size(); i++)
+ for ( size_t i = 0; i < _edgeIDs.size(); i++ )
save << " " << _edgeIDs[i];
save << " " << _objEntry << " ";
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
bool isOK;
int intVal;
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
- for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
- isOK = (load >> intVal);
+ for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++ ) {
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
- isOK = (load >> _objEntry);
+ isOK = static_cast<bool>(load >> _objEntry);
}
return load;
{
bool isOK = true;
double a;
- isOK = (load >> a);
+ isOK = static_cast<bool>(load >> a);
if (isOK)
this->_length = a;
else
{
bool isOK = true;
int intVal;
- isOK = (load >> _begLength);
+ isOK = static_cast<bool>(load >> _begLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> _endLength);
+ isOK = static_cast<bool>(load >> _endLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
- isOK = (load >> intVal);
+ isOK = static_cast<bool>(load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
- isOK = (load >> _objEntry);
+ isOK = static_cast<bool>(load >> _objEntry);
}
return load;
QwtLegend* legend = dynamic_cast<QwtLegend*>( plotCurve->plot()->legend() );
QWidget* widget = legend->legendWidget( itemInfo );
QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
- if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label )
- return anItem;
+ Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label;
+ return anItem;
}
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
-: QwtPlot( p ),
- myPoints( 50 ),
- myIsTable( false ),
- myVars( 1, 1 ),
- myValues( 1, 1 ),
- myConv( CUT_NEGATIVE ),
- myIsDone( true ),
- myNbSeg( 1 )
+ : QwtPlot( p ),
+ myPoints( 50 ),
+ myNbSeg( 1 ),
+ myIsTable( false ),
+ myConv( CUT_NEGATIVE ),
+ myVars( 1, 1 ),
+ myValues( 1, 1 ),
+ myIsDone( true )
{
Kernel_Utils::Localizer loc;
myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
setData( const DataArray& array )
{
QList<double> d;
- for ( int i = 0; i < array.length(); i++ )
+ for ( CORBA::ULong i = 0; i < array.length(); i++ )
d.append( array[i] );
sortData( d );
void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints)
{
clear();
- for ( int i = 0; i < thePoints->length(); i++ ) {
+ for ( CORBA::ULong i = 0; i < thePoints->length(); i++ ) {
addPoint( thePoints[ i ] );
}
}
{
if ( myListWidget->count() > 0 && theSegments->length() == 1)
mySameValues->setChecked(true);
- for ( int i = 0; i < theSegments->length(); i++ ) {
+ for ( CORBA::ULong i = 0; i < theSegments->length(); i++ ) {
setNbSegments( i, theSegments[i] );
}
}
//================================================================================
/*!
* \brief Constructor initialized by filter
- * \param f - object filter
+ * \param f - object filter
*/
//================================================================================
::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp,
SMESH::SMESH_Hypothesis_ptr distribHyp,
const QString& name,
- QDialog* dlg):
- QWidget(), myName(name), myDlg( dlg )
+ QDialog* dlg):
+ QWidget(), myDlg( dlg ), myName(name)
{
myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp );
init();
case Regular :
valStr += tr("SMESH_DISTR_REGULAR");
break;
- case Scale :
- valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );\
+ case Scale :
+ valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );
break;
case TabFunc : {
//valStr += tr("SMESH_TAB_FUNC");
bool param = true;
- for( int i=0; i < data.myTable.length(); i++, param = !param ) {
+ for( CORBA::ULong i = 0; i < data.myTable.length(); i++, param = !param ) {
if ( param )
valStr += "[";
valStr += QString::number( data.myTable[ i ]);
LOG("### resource list:");
std::vector<std::string>* resourceNames = new std::vector<std::string>();
if (resourceList) {
- for (int i = 0; i < resourceList->length(); i++) {
+ for ( size_t i = 0; i < resourceList->length(); i++) {
const char* aResourceName = (*resourceList)[i];
resourceNames->push_back(std::string(aResourceName));
LOG("resource["<<i<<"] = "<<aResourceName);