mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-07 07:57:27 +05:00
Fix compilation errors using gcc-5.X relating to explicit stream::operator bool()
+ Fix compilation warnings
This commit is contained in:
parent
c3445f225d
commit
59627b07d7
@ -773,7 +773,8 @@ module SMESH
|
|||||||
SEW_DIFF_NB_OF_ELEMENTS,
|
SEW_DIFF_NB_OF_ELEMENTS,
|
||||||
SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
|
SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
|
||||||
SEW_BAD_SIDE1_NODES,
|
SEW_BAD_SIDE1_NODES,
|
||||||
SEW_BAD_SIDE2_NODES
|
SEW_BAD_SIDE2_NODES,
|
||||||
|
SEW_INTERNAL_ERROR
|
||||||
};
|
};
|
||||||
|
|
||||||
Sew_Error SewFreeBorders (in long FirstNodeID1,
|
Sew_Error SewFreeBorders (in long FirstNodeID1,
|
||||||
|
@ -435,6 +435,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
|
|||||||
const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
|
const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
|
||||||
if (aElement) {
|
if (aElement) {
|
||||||
switch (aElement->GetType()) {
|
switch (aElement->GetType()) {
|
||||||
|
|
||||||
case SMDSAbs_Edge:
|
case SMDSAbs_Edge:
|
||||||
if (!aEdgesGroup) {
|
if (!aEdgesGroup) {
|
||||||
aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
|
aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
|
||||||
@ -449,6 +450,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
aEdgesGroup->Add(aElement);
|
aEdgesGroup->Add(aElement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SMDSAbs_Face:
|
case SMDSAbs_Face:
|
||||||
if (!aFacesGroup) {
|
if (!aFacesGroup) {
|
||||||
aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
|
aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
|
||||||
@ -463,6 +465,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
aFacesGroup->Add(aElement);
|
aFacesGroup->Add(aElement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SMDSAbs_Volume:
|
case SMDSAbs_Volume:
|
||||||
if (!aVolumeGroup) {
|
if (!aVolumeGroup) {
|
||||||
aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
|
aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
|
||||||
@ -477,6 +480,8 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
aVolumeGroup->Add(aElement);
|
aVolumeGroup->Add(aElement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1707,13 +1707,14 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
|
|||||||
my0DActor->SetRepresentation(aReperesent);
|
my0DActor->SetRepresentation(aReperesent);
|
||||||
myBallActor->SetRepresentation(aReperesent);
|
myBallActor->SetRepresentation(aReperesent);
|
||||||
|
|
||||||
switch(myControlMode){
|
switch ( myControlMode ) {
|
||||||
case eLength:
|
case eLength:
|
||||||
case eMultiConnection:
|
case eMultiConnection:
|
||||||
aProp = aBackProp = my1DProp;
|
aProp = aBackProp = my1DProp;
|
||||||
if(myRepresentation != ePoint)
|
if(myRepresentation != ePoint)
|
||||||
aReperesent = SMESH_DeviceActor::eInsideframe;
|
aReperesent = SMESH_DeviceActor::eInsideframe;
|
||||||
break;
|
break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aQuadraticMode == SMESH_Actor::eLines)
|
if(aQuadraticMode == SMESH_Actor::eLines)
|
||||||
@ -2253,7 +2254,7 @@ vtkPlane*
|
|||||||
SMESH_ActorDef::
|
SMESH_ActorDef::
|
||||||
GetClippingPlane(vtkIdType theID)
|
GetClippingPlane(vtkIdType theID)
|
||||||
{
|
{
|
||||||
if(theID >= myCippingPlaneCont.size())
|
if ( theID >= (vtkIdType)myCippingPlaneCont.size() )
|
||||||
return NULL;
|
return NULL;
|
||||||
return myCippingPlaneCont[theID].Get();
|
return myCippingPlaneCont[theID].Get();
|
||||||
}
|
}
|
||||||
@ -2487,7 +2488,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() {
|
|||||||
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
|
||||||
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic);
|
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]));
|
my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast<double>(nbEvents[i]));
|
||||||
|
|
||||||
if(funValues.size() >= 2)
|
if(funValues.size() >= 2)
|
||||||
|
@ -37,7 +37,7 @@ namespace SMESH
|
|||||||
enum LabelFont {
|
enum LabelFont {
|
||||||
FntArial, //!< arial font family
|
FntArial, //!< arial font family
|
||||||
FntCourier, //!< courier font family
|
FntCourier, //!< courier font family
|
||||||
FntTimes, //!< times font family
|
FntTimes //!< times font family
|
||||||
};
|
};
|
||||||
|
|
||||||
SMESHOBJECT_EXPORT
|
SMESHOBJECT_EXPORT
|
||||||
|
@ -60,14 +60,14 @@ SMESH_ExtractGeometry::~SMESH_ExtractGeometry()
|
|||||||
|
|
||||||
vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID)
|
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];
|
return myElemVTK2ObjIds[theVtkID];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int 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];
|
return myNodeVTK2ObjIds[theVtkID];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
|
|||||||
|
|
||||||
// rnv begin
|
// rnv begin
|
||||||
// Customization of the vtkScalarBarActor to show distribution histogram.
|
// Customization of the vtkScalarBarActor to show distribution histogram.
|
||||||
bool distrVisibility = (numColors == this->myNbValues.size());
|
bool distrVisibility = (numColors == (int)this->myNbValues.size());
|
||||||
vtkPoints *distrPts;
|
vtkPoints *distrPts;
|
||||||
vtkCellArray *distrPolys;
|
vtkCellArray *distrPolys;
|
||||||
vtkUnsignedCharArray *distColors = 0;
|
vtkUnsignedCharArray *distColors = 0;
|
||||||
@ -328,9 +328,9 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
|
|||||||
if(!distrVisibility)
|
if(!distrVisibility)
|
||||||
vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()");
|
vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()");
|
||||||
|
|
||||||
if (distrVisibility && GetDistributionVisibility()) {
|
if ( distrVisibility && GetDistributionVisibility() ) {
|
||||||
for( i=0 ;i<myNbValues.size();i++ ) {
|
for ( i = 0 ; i < (int)myNbValues.size(); i++ ) {
|
||||||
if(myNbValues[i]) {
|
if ( myNbValues[i] ) {
|
||||||
numPositiveVal++;
|
numPositiveVal++;
|
||||||
maxValue = std::max(maxValue,myNbValues[i]);
|
maxValue = std::max(maxValue,myNbValues[i]);
|
||||||
}
|
}
|
||||||
@ -820,7 +820,7 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize,
|
|||||||
int targetWidth, targetHeight;
|
int targetWidth, targetHeight;
|
||||||
// rnv begin
|
// rnv begin
|
||||||
// Customization of the vtkScalarBarActor to show distribution histogram.
|
// 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;
|
double coef;
|
||||||
if( GetDistributionVisibility() && distrVisibility )
|
if( GetDistributionVisibility() && distrVisibility )
|
||||||
if(this->Orientation == VTK_ORIENT_VERTICAL)
|
if(this->Orientation == VTK_ORIENT_VERTICAL)
|
||||||
@ -872,9 +872,9 @@ void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
|
|||||||
targetWidth = size[0];
|
targetWidth = size[0];
|
||||||
// rnv begin
|
// rnv begin
|
||||||
// Customization of the vtkScalarBarActor to show distribution histogram.
|
// 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;
|
double coef;
|
||||||
if( GetDistributionVisibility() && distrVisibility )
|
if ( GetDistributionVisibility() && distrVisibility )
|
||||||
coef=0.18;
|
coef=0.18;
|
||||||
else
|
else
|
||||||
coef=0.25;
|
coef=0.25;
|
||||||
@ -888,8 +888,7 @@ void SMESH_ScalarBarActor::SizeTitle(int *titleSize,
|
|||||||
targetHeight = (int)(coef*size[1]);
|
targetHeight = (int)(coef*size[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->TitleMapper->SetConstrainedFontSize(
|
this->TitleMapper->SetConstrainedFontSize(viewport, targetWidth, targetHeight);
|
||||||
viewport, targetWidth, targetHeight);
|
|
||||||
|
|
||||||
this->TitleMapper->GetSize(viewport, titleSize);
|
this->TitleMapper->GetSize(viewport, titleSize);
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ void SMDS_Down1D::initCell(int cellId)
|
|||||||
*/
|
*/
|
||||||
void SMDS_Down1D::allocate(int nbElems)
|
void SMDS_Down1D::allocate(int nbElems)
|
||||||
{
|
{
|
||||||
if (nbElems >= _vtkCellIds.size())
|
if (nbElems >= (int)_vtkCellIds.size())
|
||||||
{
|
{
|
||||||
_vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
|
_vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
|
||||||
_cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
|
_cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
|
||||||
@ -241,7 +241,7 @@ void SMDS_Down1D::compactStorage()
|
|||||||
for (int i = 0; i < _maxId; i++)
|
for (int i = 0; i < _maxId; i++)
|
||||||
{
|
{
|
||||||
_upCellIndex[i] = current;
|
_upCellIndex[i] = current;
|
||||||
for (int j = 0; j < _upCellIdsVector[i].size(); j++)
|
for (size_t j = 0; j < _upCellIdsVector[i].size(); j++)
|
||||||
{
|
{
|
||||||
_upCellIds[current] = _upCellIdsVector[i][j];
|
_upCellIds[current] = _upCellIdsVector[i][j];
|
||||||
_upCellTypes[current] = _upCellTypesVector[i][j];
|
_upCellTypes[current] = _upCellTypesVector[i][j];
|
||||||
@ -674,13 +674,13 @@ bool SMDS_Down2D::isInFace(int cellId, int *pts, int npts)
|
|||||||
*/
|
*/
|
||||||
void SMDS_Down2D::allocate(int nbElems)
|
void SMDS_Down2D::allocate(int nbElems)
|
||||||
{
|
{
|
||||||
if (nbElems >= _vtkCellIds.size())
|
if (nbElems >= (int)_vtkCellIds.size())
|
||||||
{
|
{
|
||||||
_cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
|
_cellIds.resize (_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
|
||||||
_vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
|
_vtkCellIds.resize (nbElems + SMDS_Mesh::chunkSize, -1);
|
||||||
_upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
|
_upCellIds.resize (2 * (nbElems + SMDS_Mesh::chunkSize), -1);
|
||||||
_upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
|
_upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
|
||||||
_tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
|
_tempNodes.resize (_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -764,7 +764,7 @@ SMDS_Down3D::~SMDS_Down3D()
|
|||||||
|
|
||||||
void SMDS_Down3D::allocate(int nbElems)
|
void SMDS_Down3D::allocate(int nbElems)
|
||||||
{
|
{
|
||||||
if (nbElems >= _vtkCellIds.size())
|
if (nbElems >= (int)_vtkCellIds.size())
|
||||||
{
|
{
|
||||||
_cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
|
_cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
|
||||||
_vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
|
_vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
|
||||||
@ -1121,7 +1121,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++ )
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1131,7 +1131,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
|
|||||||
|
|
||||||
set<int> tofind;
|
set<int> tofind;
|
||||||
int ids[12] = { 0, 1, 2, 0, 3, 1, 2, 3, 0, 1, 3, 2 };
|
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++)
|
for (int k = 0; k < 4; k++)
|
||||||
{
|
{
|
||||||
tofind.clear();
|
tofind.clear();
|
||||||
@ -1229,7 +1229,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++ )
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1239,7 +1239,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
|
|||||||
|
|
||||||
set<int> tofind;
|
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] = { 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++)
|
for (int k = 0; k < 4; k++)
|
||||||
{
|
{
|
||||||
tofind.clear();
|
tofind.clear();
|
||||||
@ -1352,7 +1352,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>&
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++ )
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1492,10 +1492,10 @@ SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid()
|
|||||||
|
|
||||||
void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes)
|
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;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++)
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1655,7 +1655,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++)
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1664,7 +1664,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& o
|
|||||||
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
|
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
|
||||||
|
|
||||||
set<int> tofind;
|
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 };
|
int ids[18] = { 0, 1, 2, 3, 5, 4, 0, 3, 4, 1, 1, 4, 5, 2, 2, 5, 3, 0 };
|
||||||
|
|
||||||
// Triangular faces
|
// Triangular faces
|
||||||
@ -1805,7 +1805,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++ )
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1814,7 +1814,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType
|
|||||||
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
|
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
|
||||||
|
|
||||||
set<int> tofind;
|
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,
|
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 };
|
0, 3, 4, 1, 12, 9, 13, 6, 1, 4, 5, 2, 13, 10, 14, 7, 2, 5, 3, 0, 14, 11, 12, 8 };
|
||||||
|
|
||||||
@ -1976,7 +1976,7 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& or
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++ )
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
@ -1985,7 +1985,7 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& or
|
|||||||
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
|
_grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
|
||||||
|
|
||||||
set<int> tofind;
|
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};
|
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
|
for (int k = 0; k < 6; k++) // loop on the 6 faces
|
||||||
{
|
{
|
||||||
@ -2107,7 +2107,7 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>
|
|||||||
{
|
{
|
||||||
set<int> setNodes;
|
set<int> setNodes;
|
||||||
setNodes.clear();
|
setNodes.clear();
|
||||||
for (int i = 0; i < orderedNodes.size(); i++)
|
for ( size_t i = 0; i < orderedNodes.size(); i++ )
|
||||||
setNodes.insert(orderedNodes[i]);
|
setNodes.insert(orderedNodes[i]);
|
||||||
//MESSAGE("cellId = " << cellId);
|
//MESSAGE("cellId = " << cellId);
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ class SMDS_EXPORT SMDS_IteratorOfElements:public SMDS_ElemIterator
|
|||||||
const SMDS_MeshElement * next();
|
const SMDS_MeshElement * next();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SMDS_ElemIteratorPtr t2Iterator;
|
|
||||||
SMDS_ElemIteratorPtr t1Iterator;
|
SMDS_ElemIteratorPtr t1Iterator;
|
||||||
|
SMDS_ElemIteratorPtr t2Iterator;
|
||||||
SMDSAbs_ElementType myType;
|
SMDSAbs_ElementType myType;
|
||||||
const SMDS_MeshElement * myProxyElement;
|
|
||||||
const SMDS_MeshElement * myElement;
|
const SMDS_MeshElement * myElement;
|
||||||
|
const SMDS_MeshElement * myProxyElement;
|
||||||
bool myReverseIteration;
|
bool myReverseIteration;
|
||||||
|
|
||||||
std::set<const SMDS_MeshElement*> alreadyReturnedElements;
|
std::set<const SMDS_MeshElement*> alreadyReturnedElements;
|
||||||
|
@ -3149,6 +3149,7 @@ void SMDS_Mesh::addChildrenWithNodes(set<const SMDS_MeshElement*>& setOfChildren
|
|||||||
MESSAGE("Internal Error: This should not happen");
|
MESSAGE("Internal Error: This should not happen");
|
||||||
break;
|
break;
|
||||||
case SMDSAbs_0DElement:
|
case SMDSAbs_0DElement:
|
||||||
|
case SMDSAbs_Ball:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3199,6 +3200,7 @@ void SMDS_Mesh::addChildrenWithNodes(set<const SMDS_MeshElement*>& setOfChildren
|
|||||||
addChildrenWithNodes(setOfChildren, ite->next(), nodes);
|
addChildrenWithNodes(setOfChildren, ite->next(), nodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case SMDSAbs_NbElementTypes:
|
||||||
case SMDSAbs_All: break;
|
case SMDSAbs_All: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ const std::vector<int>& SMDS_MeshCell::reverseSmdsOrder(SMDSAbs_EntityType smdsT
|
|||||||
reverseInterlaces[ smdsType ][pos++] = 0;
|
reverseInterlaces[ smdsType ][pos++] = 0;
|
||||||
for ( int i = nbNodes / 2 - 1; i > 0 ; --i ) // 3,2,1
|
for ( int i = nbNodes / 2 - 1; i > 0 ; --i ) // 3,2,1
|
||||||
reverseInterlaces[ smdsType ][pos++] = i;
|
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;
|
reverseInterlaces[ smdsType ][pos++] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbEdges() const
|
|||||||
{
|
{
|
||||||
int nbEdges = 0;
|
int nbEdges = 0;
|
||||||
|
|
||||||
for (int ifa = 0; ifa < myQuantities.size(); ifa++) {
|
for ( size_t ifa = 0; ifa < myQuantities.size(); ifa++) {
|
||||||
nbEdges += myQuantities[ifa];
|
nbEdges += myQuantities[ifa];
|
||||||
}
|
}
|
||||||
nbEdges /= 2;
|
nbEdges /= 2;
|
||||||
@ -124,7 +124,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbFaces() const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
int SMDS_PolyhedralVolumeOfNodes::NbFaceNodes (const int face_ind) const
|
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 0;
|
||||||
return myQuantities[face_ind - 1];
|
return myQuantities[face_ind - 1];
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ struct _MyIterator:public SMDS_NodeVectorElemIterator
|
|||||||
class _MySubIterator : public SMDS_ElemIterator
|
class _MySubIterator : public SMDS_ElemIterator
|
||||||
{
|
{
|
||||||
vector< const SMDS_MeshElement* > myElems;
|
vector< const SMDS_MeshElement* > myElems;
|
||||||
int myIndex;
|
size_t myIndex;
|
||||||
public:
|
public:
|
||||||
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
|
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
|
||||||
SMDS_VolumeTool vTool(vol);
|
SMDS_VolumeTool vTool(vol);
|
||||||
|
@ -215,7 +215,7 @@ bool SMDS_QuadraticVolumeOfNodes::IsMediumNode(const SMDS_MeshNode* node) const
|
|||||||
case 15: nbCorners = 6; break;
|
case 15: nbCorners = 6; break;
|
||||||
default: nbCorners = 8;
|
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;
|
if(myNodes[i]==node) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -318,7 +318,7 @@ public:
|
|||||||
class _MySubIterator : public SMDS_ElemIterator
|
class _MySubIterator : public SMDS_ElemIterator
|
||||||
{
|
{
|
||||||
vector< const SMDS_MeshElement* > myElems;
|
vector< const SMDS_MeshElement* > myElems;
|
||||||
int myIndex;
|
size_t myIndex;
|
||||||
public:
|
public:
|
||||||
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
|
_MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) {
|
||||||
SMDS_VolumeTool vTool(vol);
|
SMDS_VolumeTool vTool(vol);
|
||||||
|
@ -843,7 +843,7 @@ bool SMDS_VolumeTool::GetBaryCenter(double & X, double & Y, double & Z) const
|
|||||||
if ( !myVolume )
|
if ( !myVolume )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for ( int i = 0; i < myVolumeNodes.size(); i++ ) {
|
for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) {
|
||||||
X += myVolumeNodes[ i ]->X();
|
X += myVolumeNodes[ i ]->X();
|
||||||
Y += myVolumeNodes[ i ]->Y();
|
Y += myVolumeNodes[ i ]->Y();
|
||||||
Z += myVolumeNodes[ i ]->Z();
|
Z += myVolumeNodes[ i ]->Z();
|
||||||
@ -1390,7 +1390,7 @@ bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1,
|
|||||||
|
|
||||||
// find nodes indices
|
// find nodes indices
|
||||||
int i1 = -1, i2 = -1, nbFound = 0;
|
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 )
|
if ( myVolumeNodes[ i ] == theNode1 )
|
||||||
i1 = i, ++nbFound;
|
i1 = i, ++nbFound;
|
||||||
@ -1418,7 +1418,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
|
|||||||
int minInd = min( theNode1Index, theNode2Index );
|
int minInd = min( theNode1Index, theNode2Index );
|
||||||
int maxInd = max( 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;
|
return false;
|
||||||
|
|
||||||
VolumeType type = GetVolumeType();
|
VolumeType type = GetVolumeType();
|
||||||
@ -1535,7 +1535,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
|
|||||||
int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const
|
int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const
|
||||||
{
|
{
|
||||||
if ( myVolume ) {
|
if ( myVolume ) {
|
||||||
for ( int i = 0; i < myVolumeNodes.size(); i++ ) {
|
for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) {
|
||||||
if ( myVolumeNodes[ i ] == theNode )
|
if ( myVolumeNodes[ i ] == theNode )
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -1596,8 +1596,8 @@ int SMDS_VolumeTool::GetAllExistingEdges(vector<const SMDS_MeshElement*> & edges
|
|||||||
{
|
{
|
||||||
edges.clear();
|
edges.clear();
|
||||||
edges.reserve( myVolumeNodes.size() * 2 );
|
edges.reserve( myVolumeNodes.size() * 2 );
|
||||||
for ( int i = 0; i < myVolumeNodes.size()-1; ++i ) {
|
for ( size_t i = 0; i < myVolumeNodes.size()-1; ++i ) {
|
||||||
for ( int j = i + 1; j < myVolumeNodes.size(); ++j ) {
|
for ( size_t j = i + 1; j < myVolumeNodes.size(); ++j ) {
|
||||||
if ( IsLinked( i, j )) {
|
if ( IsLinked( i, j )) {
|
||||||
const SMDS_MeshElement* edge =
|
const SMDS_MeshElement* edge =
|
||||||
SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] );
|
SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] );
|
||||||
|
@ -60,7 +60,7 @@ void counters::stats()
|
|||||||
}
|
}
|
||||||
|
|
||||||
chrono::chrono(int i) :
|
chrono::chrono(int i) :
|
||||||
_ctr(i), _run(true)
|
_run(true), _ctr(i)
|
||||||
{
|
{
|
||||||
//MESSAGE("chrono::chrono " << _ctr << " " << _run);
|
//MESSAGE("chrono::chrono " << _ctr << " " << _run);
|
||||||
_start = clock();
|
_start = clock();
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#define SMESHFILTERSSELECTION_EXPORT
|
#define SMESHFILTERSSELECTION_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace SMESH{
|
namespace SMESH {
|
||||||
enum MeshObjectType {
|
enum MeshObjectType {
|
||||||
HYPOTHESIS,
|
HYPOTHESIS,
|
||||||
ALGORITHM,
|
ALGORITHM,
|
||||||
@ -64,5 +64,5 @@ namespace SMESH{
|
|||||||
IDSOURCE_FACE,
|
IDSOURCE_FACE,
|
||||||
IDSOURCE_VOLUME
|
IDSOURCE_VOLUME
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -264,6 +264,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const
|
|||||||
Ok = isIDSourceOfType( obj, SMESH::VOLUME );
|
Ok = isIDSourceOfType( obj, SMESH::VOLUME );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Ok;
|
return Ok;
|
||||||
|
@ -84,7 +84,7 @@ typedef std::map<SUIT_ViewManager*, SMESHGUI_ClippingPlaneInfoList> SMESHGUI_Cli
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module
|
class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module
|
||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT
|
||||||
|
|
||||||
public :
|
public :
|
||||||
SMESHGUI();
|
SMESHGUI();
|
||||||
|
@ -338,8 +338,8 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM
|
|||||||
: QDialog( SMESH::GetDesktop( theModule ) ),
|
: QDialog( SMESH::GetDesktop( theModule ) ),
|
||||||
mySMESHGUI( theModule ),
|
mySMESHGUI( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
myGeomType( theType ),
|
myBusy( false ),
|
||||||
myBusy( false )
|
myGeomType( theType )
|
||||||
{
|
{
|
||||||
setModal( false );
|
setModal( false );
|
||||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||||
@ -599,6 +599,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
|
|||||||
myNbCenterNodes = 1;
|
myNbCenterNodes = 1;
|
||||||
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons
|
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons
|
||||||
break;
|
break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
|
|
||||||
myMidFaceLabel ->setVisible( myNbMidFaceNodes );
|
myMidFaceLabel ->setVisible( myNbMidFaceNodes );
|
||||||
@ -724,6 +725,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
|
|||||||
anIds.push_back( aListId[ 0 ].toInt() );
|
anIds.push_back( aListId[ 0 ].toInt() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
if ( myReverseCB->isChecked())
|
if ( myReverseCB->isChecked())
|
||||||
ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
|
ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
|
||||||
@ -849,6 +851,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
|
|||||||
case SMESH::VOLUME:
|
case SMESH::VOLUME:
|
||||||
myActor->SetRepresentation(SMESH_Actor::eSurface);
|
myActor->SetRepresentation(SMESH_Actor::eSurface);
|
||||||
myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
|
myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1068,6 +1071,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
|
|||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
case SMDSEntity_TriQuad_Hexa:
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
anElementType = SMESH::VOLUME; break;
|
anElementType = SMESH::VOLUME; break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
myGroups.clear();
|
myGroups.clear();
|
||||||
ComboBox_GroupName->clear();
|
ComboBox_GroupName->clear();
|
||||||
@ -1309,7 +1313,7 @@ bool SMESHGUI_AddQuadraticElementDlg::IsValid()
|
|||||||
okIDs.insert( anID );
|
okIDs.insert( anID );
|
||||||
}
|
}
|
||||||
|
|
||||||
return okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
|
return (int) okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1406,6 +1410,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
|
|||||||
aFirstColIds = FirstHexahedronIds;
|
aFirstColIds = FirstHexahedronIds;
|
||||||
aLastColIds = LastHexahedronIds;
|
aLastColIds = LastHexahedronIds;
|
||||||
break;
|
break;
|
||||||
|
default:;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill the First and the Last columns
|
// fill the First and the Last columns
|
||||||
|
@ -56,7 +56,7 @@ class SUIT_SelectionFilter;
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
|
class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -601,12 +601,12 @@ SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg()
|
|||||||
if (myViewWindow)
|
if (myViewWindow)
|
||||||
SMESH::RenderViewWindow(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];
|
SMESH::TPlaneData aPlaneData = myPlanes[i];
|
||||||
aPlaneData.Plane->Delete();
|
aPlaneData.Plane->Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myPreviewWidget) {
|
if ( myPreviewWidget ) {
|
||||||
myPreviewWidget->Off();
|
myPreviewWidget->Off();
|
||||||
myPreviewWidget->Delete();
|
myPreviewWidget->Delete();
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ namespace SMESH
|
|||||||
GEOM_Actor* getActor(const TopoDS_Shape& shape)
|
GEOM_Actor* getActor(const TopoDS_Shape& shape)
|
||||||
{
|
{
|
||||||
int index = myIndexToShape.FindIndex( shape ) - 1;
|
int index = myIndexToShape.FindIndex( shape ) - 1;
|
||||||
if ( index < 0 || index >= myActors.size() )
|
if ( index < 0 || index >= (int) myActors.size() )
|
||||||
return 0;
|
return 0;
|
||||||
GEOM_Actor* & actor = myActors[ index ];
|
GEOM_Actor* & actor = myActors[ index ];
|
||||||
if ( !actor ) {
|
if ( !actor ) {
|
||||||
@ -887,7 +887,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
|
|||||||
#endif
|
#endif
|
||||||
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
||||||
// check if there are memory problems
|
// 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 );
|
memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception & S_ex) {
|
catch(const SALOME::SALOME_Exception & S_ex) {
|
||||||
@ -922,7 +922,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
|
|||||||
aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) );
|
aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) );
|
||||||
SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
|
SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
|
||||||
// put SubMeshes into list
|
// 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];
|
SMESH::SMESH_subMesh_var sm = aSubMeshes[i];
|
||||||
if ( CORBA::is_nil( sm ) ) continue;
|
if ( CORBA::is_nil( sm ) ) continue;
|
||||||
_PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
|
_PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
|
||||||
@ -1081,7 +1081,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported
|
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 ||
|
onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING ||
|
||||||
theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
|
theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
|
||||||
|
|
||||||
@ -1136,7 +1136,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
|
|||||||
tbl->setColumnWidth( COL_ERROR, 200 );
|
tbl->setColumnWidth( COL_ERROR, 200 );
|
||||||
|
|
||||||
bool hasBadMesh = false;
|
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 ];
|
SMESH::ComputeError & err = theCompErrors[ row ];
|
||||||
|
|
||||||
@ -1542,15 +1542,15 @@ LightApp_Dialog* SMESHGUI_ComputeOp::dlg() const
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Constructor
|
* \brief Constructor
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp()
|
SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp()
|
||||||
: SMESHGUI_BaseComputeOp(),
|
: SMESHGUI_BaseComputeOp(),
|
||||||
myDlg( 0 ),
|
|
||||||
myOrderMgr( 0 ),
|
|
||||||
myActiveDlg( 0 ),
|
myActiveDlg( 0 ),
|
||||||
myPreviewDisplayer( 0 )
|
myDlg( 0 ),
|
||||||
|
myPreviewDisplayer( 0 ),
|
||||||
|
myOrderMgr( 0 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1962,7 +1962,7 @@ void SMESHGUI_PrecomputeOp::onPreview()
|
|||||||
#endif
|
#endif
|
||||||
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
||||||
// check if there are memory problems
|
// 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 );
|
memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception & S_ex){
|
catch(const SALOME::SALOME_Exception & S_ex){
|
||||||
@ -2293,7 +2293,7 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes,
|
|||||||
tbl->setColumnWidth( COL_ERROR, 200 );
|
tbl->setColumnWidth( COL_ERROR, 200 );
|
||||||
|
|
||||||
bool hasBadMesh = false;
|
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 ];
|
SMESH::ComputeError & err = theCompErrors[ row ];
|
||||||
|
|
||||||
|
@ -239,7 +239,9 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
default:;
|
||||||
|
} // switch( (*anIt).myValue.type() )
|
||||||
|
|
||||||
if( w )
|
if( w )
|
||||||
{
|
{
|
||||||
@ -297,7 +299,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
|
|||||||
{
|
{
|
||||||
SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo );
|
SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo );
|
||||||
if( listSOmesh.size() > 0 )
|
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];
|
_PTR(SObject) submSO = listSOmesh[i];
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
|
SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
|
||||||
@ -391,8 +393,8 @@ QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams
|
|||||||
{
|
{
|
||||||
QString valueStr = "";
|
QString valueStr = "";
|
||||||
ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
|
ListOfStdParams::const_iterator param = params.begin(), aLast = params.end();
|
||||||
uint len0 = 0;
|
int len0 = 0;
|
||||||
for( int i=0; param!=aLast; param++, i++ )
|
for ( ; param != aLast; param++ )
|
||||||
{
|
{
|
||||||
if ( valueStr.length() > len0 ) {
|
if ( valueStr.length() > len0 ) {
|
||||||
valueStr += "; ";
|
valueStr += "; ";
|
||||||
@ -749,12 +751,12 @@ HypothesisData::HypothesisData( const QString& theTypeName,
|
|||||||
Context( theContext ),
|
Context( theContext ),
|
||||||
Dim( theDim ),
|
Dim( theDim ),
|
||||||
IsAuxOrNeedHyp( theIsAuxOrNeedHyp ),
|
IsAuxOrNeedHyp( theIsAuxOrNeedHyp ),
|
||||||
|
IsNeedGeometry( theIsNeedGeometry ),
|
||||||
|
IsSupportSubmeshes( supportSub ),
|
||||||
BasicHypos( theBasicHypos ),
|
BasicHypos( theBasicHypos ),
|
||||||
OptionalHypos( theOptionalHypos ),
|
OptionalHypos( theOptionalHypos ),
|
||||||
InputTypes( theInputTypes ),
|
InputTypes( theInputTypes ),
|
||||||
OutputTypes( theOutputTypes ),
|
OutputTypes( theOutputTypes )
|
||||||
IsNeedGeometry( theIsNeedGeometry ),
|
|
||||||
IsSupportSubmeshes( supportSub )
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,10 +88,10 @@
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh )
|
SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh )
|
||||||
: SMESHGUI_SelectionOp(),
|
: SMESHGUI_SelectionOp(),
|
||||||
myToCreate( theToCreate ),
|
|
||||||
myIsMesh( theIsMesh ),
|
|
||||||
myDlg( 0 ),
|
myDlg( 0 ),
|
||||||
myShapeByMeshOp( 0 ),
|
myShapeByMeshOp( 0 ),
|
||||||
|
myToCreate( theToCreate ),
|
||||||
|
myIsMesh( theIsMesh ),
|
||||||
myHypoSet( 0 )
|
myHypoSet( 0 )
|
||||||
{
|
{
|
||||||
if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists
|
if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists
|
||||||
@ -576,7 +576,7 @@ void SMESHGUI_MeshOp::selectionDone()
|
|||||||
|
|
||||||
if (aSeq->length() > 0) {
|
if (aSeq->length() > 0) {
|
||||||
shapeDim = -1;
|
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];
|
GEOM::GEOM_Object_var aGeomVar = aSeq[iss];
|
||||||
switch ( aGeomVar->GetShapeType() ) {
|
switch ( aGeomVar->GetShapeType() ) {
|
||||||
case GEOM::SOLID: shapeDim = 3; break;
|
case GEOM::SOLID: shapeDim = 3; break;
|
||||||
|
@ -271,7 +271,7 @@ void SMESH_File::rewind()
|
|||||||
|
|
||||||
bool SMESH_File::getInts(std::vector<int>& ints)
|
bool SMESH_File::getInts(std::vector<int>& ints)
|
||||||
{
|
{
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
while ( i < ints.size() )
|
while ( i < ints.size() )
|
||||||
{
|
{
|
||||||
while ( !isdigit( *_pos ) && !eof()) ++_pos;
|
while ( !isdigit( *_pos ) && !eof()) ++_pos;
|
||||||
@ -330,7 +330,7 @@ bool SMESH_File::writeRaw(const void* data, size_t size)
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
ssize_t nbWritten = ::write( _file, data, size );
|
ssize_t nbWritten = ::write( _file, data, size );
|
||||||
return ( nbWritten == size );
|
return ( nbWritten == (ssize_t) size );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -448,14 +448,14 @@ namespace
|
|||||||
addedEdges.insert( bndSegs[i]._edge->twin() ).second )
|
addedEdges.insert( bndSegs[i]._edge->twin() ).second )
|
||||||
{
|
{
|
||||||
v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex0(), v2Node.size() + 1 )).first;
|
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() )
|
if ( n0 == v2Node.size() )
|
||||||
text << "n" << n0 << " = m.AddNode( "
|
text << "n" << n0 << " = m.AddNode( "
|
||||||
<< bndSegs[i]._edge->vertex0()->x() / theScale[0] << ", "
|
<< bndSegs[i]._edge->vertex0()->x() / theScale[0] << ", "
|
||||||
<< bndSegs[i]._edge->vertex0()->y() / theScale[1] << ", 0 )\n";
|
<< bndSegs[i]._edge->vertex0()->y() / theScale[1] << ", 0 )\n";
|
||||||
|
|
||||||
v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex1(), v2Node.size() + 1 )).first;
|
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() )
|
if ( n1 == v2Node.size() )
|
||||||
text << "n" << n1 << " = m.AddNode( "
|
text << "n" << n1 << " = m.AddNode( "
|
||||||
<< bndSegs[i]._edge->vertex1()->x() / theScale[0] << ", "
|
<< bndSegs[i]._edge->vertex1()->x() / theScale[0] << ", "
|
||||||
@ -1210,7 +1210,7 @@ namespace
|
|||||||
else // bndSegs[ i ]._branchID > 0
|
else // bndSegs[ i ]._branchID > 0
|
||||||
{
|
{
|
||||||
dInd = +1;
|
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 )
|
if ( branchEdges[ brID ][ edgeInd ] == bndSegs[ i ]._edge )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1386,7 +1386,7 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge,
|
|||||||
int di = ( points._params[0] == points._params[i] ) ? +1 : -1;
|
int di = ( points._params[0] == points._params[i] ) ? +1 : -1;
|
||||||
while ( points._params[i] == points._params[i+1] )
|
while ( points._params[i] == points._params[i+1] )
|
||||||
i += di;
|
i += di;
|
||||||
if ( i < 0 || i+1 >= points._params.size() )
|
if ( i < 0 || i+1 >= (int)points._params.size() )
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1394,9 +1394,9 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge,
|
|||||||
|
|
||||||
if ( !points._maEdges[ i ].second ) // no branch at the EDGE end, look for a closest branch
|
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;
|
++i;
|
||||||
edgeParam = edgeReverse;
|
edgeParam = edgeReverse;
|
||||||
}
|
}
|
||||||
@ -1699,7 +1699,7 @@ bool SMESH_MAT2d::Branch::getParameter(const BranchPoint & p, double & u ) const
|
|||||||
if ( p._iEdge > _params.size()-1 )
|
if ( p._iEdge > _params.size()-1 )
|
||||||
return false;
|
return false;
|
||||||
if ( p._iEdge == _params.size()-1 )
|
if ( p._iEdge == _params.size()-1 )
|
||||||
return u = 1.;
|
return ( u = 1. );
|
||||||
|
|
||||||
u = ( _params[ p._iEdge ] * ( 1 - p._edgeParam ) +
|
u = ( _params[ p._iEdge ] * ( 1 - p._edgeParam ) +
|
||||||
_params[ p._iEdge+1 ] * p._edgeParam );
|
_params[ p._iEdge+1 ] * p._edgeParam );
|
||||||
@ -1805,7 +1805,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >&
|
|||||||
{
|
{
|
||||||
// look for a VERTEX of the opposite EDGE
|
// look for a VERTEX of the opposite EDGE
|
||||||
// iNext - next after all null-length segments
|
// iNext - next after all null-length segments
|
||||||
while ( maE = ++iNext )
|
while (( maE = ++iNext ))
|
||||||
{
|
{
|
||||||
iSeg2 = getBndSegment( maE );
|
iSeg2 = getBndSegment( maE );
|
||||||
if ( !_boundary->isConcaveSegment( ie1, iSeg2 ))
|
if ( !_boundary->isConcaveSegment( ie1, iSeg2 ))
|
||||||
@ -1837,7 +1837,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >&
|
|||||||
else if ( isConcaPrev )
|
else if ( isConcaPrev )
|
||||||
{
|
{
|
||||||
// all null-length segments passed, find their beginning
|
// all null-length segments passed, find their beginning
|
||||||
while ( maE = iPrev.edgePrev() )
|
while (( maE = iPrev.edgePrev() ))
|
||||||
{
|
{
|
||||||
iSeg1 = getBndSegment( maE );
|
iSeg1 = getBndSegment( maE );
|
||||||
if ( _boundary->isConcaveSegment( edgeIDs1.back(), iSeg1 ))
|
if ( _boundary->isConcaveSegment( edgeIDs1.back(), iSeg1 ))
|
||||||
@ -1909,7 +1909,7 @@ void SMESH_MAT2d::Branch::getOppositeGeomEdges( std::vector< std::size_t >& edge
|
|||||||
BranchPoint divisionPnt;
|
BranchPoint divisionPnt;
|
||||||
divisionPnt._branch = this;
|
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 ie1 = getGeomEdge( maIter.edge() );
|
||||||
size_t ie2 = getGeomEdge( twIter.edge() );
|
size_t ie2 = getGeomEdge( twIter.edge() );
|
||||||
|
@ -138,8 +138,8 @@ SMESH_Tree<BND_BOX,NB_CHILDREN>::SMESH_Tree (SMESH_TreeLimit* limit):
|
|||||||
myFather(0),
|
myFather(0),
|
||||||
myIsLeaf( false ),
|
myIsLeaf( false ),
|
||||||
myLimit( limit ),
|
myLimit( limit ),
|
||||||
myLevel(0),
|
myBox(0),
|
||||||
myBox(0)
|
myLevel(0)
|
||||||
{
|
{
|
||||||
//if ( !myLimit ) myLimit = new SMESH_TreeLimit();
|
//if ( !myLimit ) myLimit = new SMESH_TreeLimit();
|
||||||
}
|
}
|
||||||
|
@ -960,7 +960,7 @@ void SMESH_Gen_i::SetOption(const char* name, const char* value)
|
|||||||
// color must be presented as a string of next form:
|
// color must be presented as a string of next form:
|
||||||
if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example)
|
if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example)
|
||||||
str = str.substr(1);
|
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' )
|
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 ) );
|
color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) );
|
||||||
}
|
}
|
||||||
@ -4896,7 +4896,7 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent,
|
|||||||
_CORBA_Octet* buffer = new _CORBA_Octet[real_size];
|
_CORBA_Octet* buffer = new _CORBA_Octet[real_size];
|
||||||
char tmp[3];
|
char tmp[3];
|
||||||
tmp[2]='\0';
|
tmp[2]='\0';
|
||||||
int c = -1;
|
uint c = -1;
|
||||||
for ( int i = 0; i < real_size; i++ )
|
for ( int i = 0; i < real_size; i++ )
|
||||||
{
|
{
|
||||||
memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 );
|
memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 );
|
||||||
|
@ -285,13 +285,13 @@ namespace MeshEditor_I {
|
|||||||
SMDS_MeshElement::Filter & filter = *aFilter;
|
SMDS_MeshElement::Filter & filter = *aFilter;
|
||||||
|
|
||||||
if ( aType == SMDSAbs_Node )
|
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] );
|
const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] );
|
||||||
if ( filter( elem ))
|
if ( filter( elem ))
|
||||||
aMap.insert( aMap.end(), elem );
|
aMap.insert( aMap.end(), elem );
|
||||||
}
|
}
|
||||||
else
|
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] );
|
const SMDS_MeshElement * elem = aMesh->FindElement( IDs[i] );
|
||||||
if ( filter( elem ))
|
if ( filter( elem ))
|
||||||
aMap.insert( aMap.end(), elem );
|
aMap.insert( aMap.end(), elem );
|
||||||
@ -315,7 +315,7 @@ namespace MeshEditor_I {
|
|||||||
SMESH::long_array_var aElementsId = theObject->GetIDs();
|
SMESH::long_array_var aElementsId = theObject->GetIDs();
|
||||||
if ( types->length() == 1 && types[0] == SMESH::NODE)
|
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] ))
|
if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] ))
|
||||||
theNodeSet.insert( theNodeSet.end(), n);
|
theNodeSet.insert( theNodeSet.end(), n);
|
||||||
}
|
}
|
||||||
@ -323,13 +323,13 @@ namespace MeshEditor_I {
|
|||||||
{
|
{
|
||||||
SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator();
|
SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator();
|
||||||
while ( nIt->more( ))
|
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());
|
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(int i = 0; i < aElementsId->length(); i++)
|
for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ )
|
||||||
if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
|
if ( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
|
||||||
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
|
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -349,7 +349,7 @@ namespace MeshEditor_I {
|
|||||||
SMDSAbs_ElementType elemType = (*theElements.begin())->GetType();
|
SMDSAbs_ElementType elemType = (*theElements.begin())->GetType();
|
||||||
bool sameElemType = ( elemType == (*theElements.rbegin())->GetType() );
|
bool sameElemType = ( elemType == (*theElements.rbegin())->GetType() );
|
||||||
if ( sameElemType &&
|
if ( sameElemType &&
|
||||||
theMeshDS->GetMeshInfo().NbElements( elemType ) == theElements.size() )
|
theMeshDS->GetMeshInfo().NbElements( elemType ) == (int) theElements.size() )
|
||||||
return; // all the elements are in theElements
|
return; // all the elements are in theElements
|
||||||
|
|
||||||
if ( !sameElemType )
|
if ( !sameElemType )
|
||||||
@ -794,7 +794,7 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
|
|||||||
|
|
||||||
list< int > IdList;
|
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] );
|
IdList.push_back( IDsOfElements[i] );
|
||||||
|
|
||||||
// Update Python script
|
// Update Python script
|
||||||
@ -823,7 +823,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo
|
|||||||
initData();
|
initData();
|
||||||
|
|
||||||
list< int > IdList;
|
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] );
|
IdList.push_back( IDsOfNodes[i] );
|
||||||
|
|
||||||
// Update Python script
|
// Update Python script
|
||||||
@ -859,9 +859,7 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes()
|
|||||||
SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq );
|
SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq );
|
||||||
|
|
||||||
// remove orphan nodes (if there are any)
|
// remove orphan nodes (if there are any)
|
||||||
list< int > IdList;
|
list< int > IdList( seq.begin(), seq.end() );
|
||||||
for ( int i = 0; i < seq.size(); i++ )
|
|
||||||
IdList.push_back( seq[i] );
|
|
||||||
|
|
||||||
int nbNodesBefore = myMesh->NbNodes();
|
int nbNodesBefore = myMesh->NbNodes();
|
||||||
getEditor().Remove( IdList, true );
|
getEditor().Remove( IdList, true );
|
||||||
@ -1584,7 +1582,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfEleme
|
|||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
for (int i = 0; i < IDsOfElements.length(); i++)
|
for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
|
||||||
{
|
{
|
||||||
CORBA::Long index = IDsOfElements[i];
|
CORBA::Long index = IDsOfElements[i];
|
||||||
const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
|
const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
|
||||||
@ -2273,7 +2271,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements,
|
|||||||
arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
|
arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
|
||||||
|
|
||||||
set<const SMDS_MeshNode*> fixedNodes;
|
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];
|
CORBA::Long index = IDsOfFixedNodes[i];
|
||||||
const SMDS_MeshNode * node = aMesh->FindNode(index);
|
const SMDS_MeshNode * node = aMesh->FindNode(index);
|
||||||
if ( node )
|
if ( node )
|
||||||
@ -2866,7 +2864,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the
|
|||||||
idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
|
idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
|
||||||
|
|
||||||
list<double> angles;
|
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] );
|
angles.push_back( theAngles[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4091,7 +4089,7 @@ FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr theObject,
|
|||||||
TIDSortedNodeSet nodes;
|
TIDSortedNodeSet nodes;
|
||||||
idSourceToNodeSet( theObject, getMeshDS(), 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],
|
SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( theExceptSubMeshOrGroups[i],
|
||||||
SMESH::NODE );
|
SMESH::NODE );
|
||||||
@ -4127,7 +4125,7 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN
|
|||||||
aTPythonDump << this << ".MergeNodes([";
|
aTPythonDump << this << ".MergeNodes([";
|
||||||
|
|
||||||
TIDSortedNodeSet setOfNodesToKeep;
|
TIDSortedNodeSet setOfNodesToKeep;
|
||||||
for ( int i = 0; i < NodesToKeep.length(); ++i )
|
for ( CORBA::ULong i = 0; i < NodesToKeep.length(); ++i )
|
||||||
{
|
{
|
||||||
prepareIdSource( NodesToKeep[i] );
|
prepareIdSource( NodesToKeep[i] );
|
||||||
SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( NodesToKeep[i], SMESH::NODE );
|
SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( NodesToKeep[i], SMESH::NODE );
|
||||||
@ -4136,12 +4134,12 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN
|
|||||||
}
|
}
|
||||||
|
|
||||||
::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
|
::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 ];
|
const SMESH::long_array& aNodeGroup = GroupsOfNodes[ i ];
|
||||||
aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() );
|
aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() );
|
||||||
list< const SMDS_MeshNode* >& aListOfNodes = aListOfListOfNodes.back();
|
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 ];
|
CORBA::Long index = aNodeGroup[ j ];
|
||||||
if ( const SMDS_MeshNode * node = aMesh->FindNode( index ))
|
if ( const SMDS_MeshNode * node = aMesh->FindNode( index ))
|
||||||
@ -4227,11 +4225,11 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& GroupsO
|
|||||||
|
|
||||||
::SMESH_MeshEditor::TListOfListOfElementsID aListOfListOfElementsID;
|
::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 ];
|
const SMESH::long_array& anElemsIDGroup = GroupsOfElementsID[ i ];
|
||||||
aListOfListOfElementsID.push_back( list< int >() );
|
aListOfListOfElementsID.push_back( list< int >() );
|
||||||
list< int >& aListOfElemsID = aListOfListOfElementsID.back();
|
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 ];
|
CORBA::Long id = anElemsIDGroup[ j ];
|
||||||
aListOfElemsID.push_back( id );
|
aListOfElemsID.push_back( id );
|
||||||
}
|
}
|
||||||
@ -4456,7 +4454,7 @@ SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x,
|
|||||||
SMDSAbs_ElementType( type ),
|
SMDSAbs_ElementType( type ),
|
||||||
foundElems);
|
foundElems);
|
||||||
res->length( foundElems.size() );
|
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();
|
res[i] = foundElems[i]->GetID();
|
||||||
|
|
||||||
return res._retn();
|
return res._retn();
|
||||||
@ -4517,7 +4515,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID
|
|||||||
SMDSAbs_ElementType( type ),
|
SMDSAbs_ElementType( type ),
|
||||||
foundElems);
|
foundElems);
|
||||||
res->length( foundElems.size() );
|
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();
|
res[i] = foundElems[i]->GetID();
|
||||||
|
|
||||||
return res._retn();
|
return res._retn();
|
||||||
@ -4568,6 +4566,7 @@ static SMESH::SMESH_MeshEditor::Sew_Error convError( const::SMESH_MeshEditor::Se
|
|||||||
RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS );
|
RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS );
|
||||||
RETCASE( SEW_BAD_SIDE1_NODES );
|
RETCASE( SEW_BAD_SIDE1_NODES );
|
||||||
RETCASE( SEW_BAD_SIDE2_NODES );
|
RETCASE( SEW_BAD_SIDE2_NODES );
|
||||||
|
RETCASE( SEW_INTERNAL_ERROR );
|
||||||
}
|
}
|
||||||
return SMESH::SMESH_MeshEditor::SEW_OK;
|
return SMESH::SMESH_MeshEditor::SEW_OK;
|
||||||
}
|
}
|
||||||
@ -4651,16 +4650,16 @@ SewCoincidentFreeBorders(const SMESH::CoincidentFreeBorders& freeBorders,
|
|||||||
for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP )
|
for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP )
|
||||||
{
|
{
|
||||||
const SMESH::FreeBorderPart& aPART = aGRP[ 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);
|
THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::border index", SALOME::BAD_PARAM);
|
||||||
|
|
||||||
const SMESH::FreeBorder& aBRD = freeBorders.borders[ aPART.border ];
|
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);
|
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);
|
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);
|
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
|
// do not keep these nodes for further sewing as nodes can be removed by the sewing
|
||||||
@ -6500,7 +6499,7 @@ void SMESH_MeshEditor_i::CreateHoleSkin(CORBA::Double radius,
|
|||||||
theNodeSearcher = SMESH_MeshAlgos::GetNodeSearcher( *getMeshDS() );
|
theNodeSearcher = SMESH_MeshAlgos::GetNodeSearcher( *getMeshDS() );
|
||||||
|
|
||||||
vector<double> nodesCoords;
|
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] );
|
nodesCoords.push_back( theNodesCoords[i] );
|
||||||
}
|
}
|
||||||
@ -6666,7 +6665,7 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim,
|
|||||||
groupsOfThisMesh ->length( groups.length() );
|
groupsOfThisMesh ->length( groups.length() );
|
||||||
groupsOfOtherMesh->length( groups.length() );
|
groupsOfOtherMesh->length( groups.length() );
|
||||||
int nbGroups = 0, nbGroupsOfOtherMesh = 0;
|
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();
|
SMESH::SMESH_Mesh_var m = groups[i]->GetMesh();
|
||||||
if ( myMesh_i != SMESH::DownCast<SMESH_Mesh_i*>( m ))
|
if ( myMesh_i != SMESH::DownCast<SMESH_Mesh_i*>( m ))
|
||||||
|
@ -53,7 +53,7 @@ namespace
|
|||||||
*/
|
*/
|
||||||
void SetVariable(Handle(_pyCommand) theCommand,
|
void SetVariable(Handle(_pyCommand) theCommand,
|
||||||
const SMESH_ObjectStates* theStates,
|
const SMESH_ObjectStates* theStates,
|
||||||
int position, int theArgNb)
|
size_t position, int theArgNb)
|
||||||
{
|
{
|
||||||
if(theStates->GetCurrectState().size() > position)
|
if(theStates->GetCurrectState().size() > position)
|
||||||
if(!theStates->GetCurrectState().at(position).IsEmpty())
|
if(!theStates->GetCurrectState().at(position).IsEmpty())
|
||||||
@ -100,7 +100,7 @@ void SMESH_ObjectStates::AddState(const TState &theState)
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
TState SMESH_ObjectStates::GetCurrectState() const
|
TState SMESH_ObjectStates::GetCurrectState() const
|
||||||
{
|
{
|
||||||
if(_states.size() > _dumpstate)
|
if ( (int) _states.size() > _dumpstate)
|
||||||
return _states[_dumpstate];
|
return _states[_dumpstate];
|
||||||
TState empty;
|
TState empty;
|
||||||
return empty;
|
return empty;
|
||||||
@ -236,7 +236,7 @@ SMESH_NoteBook::~SMESH_NoteBook()
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
void SMESH_NoteBook::ReplaceVariables()
|
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];
|
Handle(_pyCommand) aCmd = _commands[i];
|
||||||
TCollection_AsciiString aMethod = aCmd->GetMethod();
|
TCollection_AsciiString aMethod = aCmd->GetMethod();
|
||||||
@ -714,7 +714,7 @@ void SMESH_NoteBook::ReplaceVariables()
|
|||||||
{
|
{
|
||||||
TState aCurrentState = aStates->GetCurrectState();
|
TState aCurrentState = aStates->GetCurrectState();
|
||||||
int argIndex = h->getParamIndex( aMethod, aCurrentState.size() );
|
int argIndex = h->getParamIndex( aMethod, aCurrentState.size() );
|
||||||
if ( 0 <= argIndex && argIndex < aCurrentState.size() &&
|
if ( 0 <= argIndex && argIndex < (int)aCurrentState.size() &&
|
||||||
!aCurrentState[argIndex].IsEmpty() )
|
!aCurrentState[argIndex].IsEmpty() )
|
||||||
aCmd->SetArg( 1, aCurrentState[argIndex] );
|
aCmd->SetArg( 1, aCurrentState[argIndex] );
|
||||||
|
|
||||||
@ -790,10 +790,10 @@ void SMESH_NoteBook::InitObjectMap()
|
|||||||
else
|
else
|
||||||
aState = new SMESH_ObjectStates(anObjType);
|
aState = new SMESH_ObjectStates(anObjType);
|
||||||
|
|
||||||
for(int i = 0; i < aSections->length(); i++) {
|
for ( size_t i = 0; i < aSections->length(); i++ ) {
|
||||||
TState aVars;
|
TState aVars;
|
||||||
SALOMEDS::ListOfStrings aListOfVars = aSections[i];
|
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());
|
TCollection_AsciiString aVar(aListOfVars[j].in());
|
||||||
if(!aVar.IsEmpty() && aStudy->IsVariable(aVar.ToCString())) {
|
if(!aVar.IsEmpty() && aStudy->IsVariable(aVar.ToCString())) {
|
||||||
@ -859,8 +859,8 @@ void SMESH_NoteBook::ProcessLayerDistribution()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// 2) Initialize all type of 1D Distribution hypothesis
|
// 2) Initialize all type of 1D Distribution hypothesis
|
||||||
for(int i=0;i<_commands.size();i++){
|
for ( size_t i = 0; i < _commands.size(); i++ ) {
|
||||||
for(int j =0;j < aLDS.size();j++){
|
for ( size_t j = 0; j < aLDS.size(); j++ ) {
|
||||||
TCollection_AsciiString aResultValue = _commands[i]->GetResultValue();
|
TCollection_AsciiString aResultValue = _commands[i]->GetResultValue();
|
||||||
if(_commands[i]->GetMethod() == "CreateHypothesis" &&
|
if(_commands[i]->GetMethod() == "CreateHypothesis" &&
|
||||||
aLDS[j]->HasDistribution(aResultValue)){
|
aLDS[j]->HasDistribution(aResultValue)){
|
||||||
@ -872,8 +872,8 @@ void SMESH_NoteBook::ProcessLayerDistribution()
|
|||||||
}
|
}
|
||||||
// 3) ... and replase variables ...
|
// 3) ... and replase variables ...
|
||||||
|
|
||||||
for(int i=0;i<_commands.size();i++){
|
for ( size_t i = 0; i < _commands.size(); i++ ) {
|
||||||
for(int j =0;j < aLDS.size();j++){
|
for ( size_t j = 0; j < aLDS.size(); j++ ) {
|
||||||
TCollection_AsciiString anObject = _commands[i]->GetObject();
|
TCollection_AsciiString anObject = _commands[i]->GetObject();
|
||||||
|
|
||||||
if(aLDS[j]->HasDistribution(anObject)) {
|
if(aLDS[j]->HasDistribution(anObject)) {
|
||||||
@ -929,8 +929,8 @@ void SMESH_NoteBook::ProcessLayerDistribution()
|
|||||||
TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
|
TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
|
||||||
{
|
{
|
||||||
TCollection_AsciiString aResult;
|
TCollection_AsciiString aResult;
|
||||||
for(int i=0;i<_commands.size();i++)
|
for ( size_t i = 0; i < _commands.size(); i++ )
|
||||||
aResult+=_commands[i]->GetString()+"\n";
|
aResult += _commands[i]->GetString() + "\n";
|
||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -941,7 +941,7 @@ TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
void SMESH_NoteBook::GetResultLines(std::list< TCollection_AsciiString >& lines) const
|
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() );
|
lines.push_back( _commands[i]->GetString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -992,7 +992,7 @@ ostream & StdMeshers_Adaptive1D::SaveTo(ostream & save)
|
|||||||
istream & StdMeshers_Adaptive1D::LoadFrom(istream & load)
|
istream & StdMeshers_Adaptive1D::LoadFrom(istream & load)
|
||||||
{
|
{
|
||||||
int dummyParam;
|
int dummyParam;
|
||||||
bool isOK = (load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
|
bool isOK = static_cast<bool>(load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
return load;
|
return load;
|
||||||
|
@ -144,22 +144,22 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
int intVal;
|
int intVal;
|
||||||
isOK = (load >> _begLength);
|
isOK = static_cast<bool>(load >> _begLength);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
isOK = (load >> _endLength);
|
isOK = static_cast<bool>(load >> _endLength);
|
||||||
|
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if (isOK && intVal > 0) {
|
if (isOK && intVal > 0) {
|
||||||
_edgeIDs.reserve( intVal );
|
_edgeIDs.reserve( intVal );
|
||||||
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _edgeIDs.push_back( intVal );
|
||||||
}
|
}
|
||||||
isOK = (load >> _objEntry);
|
isOK = static_cast<bool>(load >> _objEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return load;
|
return load;
|
||||||
|
@ -799,51 +799,51 @@ std::istream & StdMeshers_CartesianParameters3D::LoadFrom(std::istream & load)
|
|||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
ok = ( load >> _sizeThreshold );
|
ok = static_cast<bool>( load >> _sizeThreshold );
|
||||||
for ( int ax = 0; ax < 3; ++ax )
|
for ( int ax = 0; ax < 3; ++ax )
|
||||||
{
|
{
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
ok = (load >> i );
|
ok = static_cast<bool>(load >> i );
|
||||||
if ( i > 0 && ok )
|
if ( i > 0 && ok )
|
||||||
{
|
{
|
||||||
_coords[ax].resize( i );
|
_coords[ax].resize( i );
|
||||||
for ( i = 0; i < _coords[ax].size() && ok; ++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)
|
if (ok)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
ok = (load >> i );
|
ok = static_cast<bool>(load >> i );
|
||||||
if ( i > 0 && ok )
|
if ( i > 0 && ok )
|
||||||
{
|
{
|
||||||
_internalPoints[ax].resize( i );
|
_internalPoints[ax].resize( i );
|
||||||
for ( i = 0; i < _internalPoints[ax].size() && ok; ++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)
|
if (ok)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
ok = (load >> i );
|
ok = static_cast<bool>(load >> i );
|
||||||
if ( i > 0 && ok )
|
if ( i > 0 && ok )
|
||||||
{
|
{
|
||||||
_spaceFunctions[ax].resize( i );
|
_spaceFunctions[ax].resize( i );
|
||||||
for ( i = 0; i < _spaceFunctions[ax].size() && ok; ++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 )
|
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 )
|
for ( int i = 0; i < 3 && ok ; ++i )
|
||||||
ok = ( load >> _fixedPoint[i]);
|
ok = static_cast<bool>( load >> _fixedPoint[i]);
|
||||||
|
|
||||||
return load;
|
return load;
|
||||||
}
|
}
|
||||||
|
@ -696,17 +696,17 @@ namespace
|
|||||||
int& di, double tol )
|
int& di, double tol )
|
||||||
{
|
{
|
||||||
//val += values[0]; // input \a val is measured from 0.
|
//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;
|
i = values.size()-2;
|
||||||
else
|
else
|
||||||
while ( i+2 < values.size() && val > values[ i+1 ])
|
while ( i+2 < (int) values.size() && val > values[ i+1 ])
|
||||||
++i;
|
++i;
|
||||||
while ( i > 0 && val < values[ i ])
|
while ( i > 0 && val < values[ i ])
|
||||||
--i;
|
--i;
|
||||||
|
|
||||||
if ( i > 0 && val - values[ i ] < tol )
|
if ( i > 0 && val - values[ i ] < tol )
|
||||||
di = -1;
|
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;
|
di = 1;
|
||||||
else
|
else
|
||||||
di = 0;
|
di = 0;
|
||||||
@ -1776,7 +1776,7 @@ namespace
|
|||||||
if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon ))
|
if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon ))
|
||||||
quad._eIntNodes[ iP ]->_usedInFace = 0;
|
quad._eIntNodes[ iP ]->_usedInFace = 0;
|
||||||
#endif
|
#endif
|
||||||
int nbUsedEdgeNodes = 0;
|
size_t nbUsedEdgeNodes = 0;
|
||||||
_Face* prevPolyg = 0; // polygon previously created from this quad
|
_Face* prevPolyg = 0; // polygon previously created from this quad
|
||||||
|
|
||||||
while ( nbSplits > 0 )
|
while ( nbSplits > 0 )
|
||||||
@ -1839,7 +1839,7 @@ namespace
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_OrientedLink foundSplit;
|
_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 ]) &&
|
if (( foundSplit = splits[ i ]) &&
|
||||||
( n2->IsLinked( foundSplit.FirstNode()->_intPoint )))
|
( n2->IsLinked( foundSplit.FirstNode()->_intPoint )))
|
||||||
{
|
{
|
||||||
@ -2100,7 +2100,7 @@ namespace
|
|||||||
{
|
{
|
||||||
sortVertexNodes( chainNodes, curNode, curFace );
|
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 );
|
polygon.AddPolyLink( chainNodes[ i ], curNode );
|
||||||
curNode = chainNodes[ i ];
|
curNode = chainNodes[ i ];
|
||||||
@ -2322,9 +2322,9 @@ namespace
|
|||||||
i = int(lineInd.I()) + dInd[iL][0];
|
i = int(lineInd.I()) + dInd[iL][0];
|
||||||
j = int(lineInd.J()) + dInd[iL][1];
|
j = int(lineInd.J()) + dInd[iL][1];
|
||||||
k = int(lineInd.K()) + dInd[iL][2];
|
k = int(lineInd.K()) + dInd[iL][2];
|
||||||
if ( i < 0 || i >= nbCells[0] ||
|
if ( i < 0 || i >= (int) nbCells[0] ||
|
||||||
j < 0 || j >= nbCells[1] ||
|
j < 0 || j >= (int) nbCells[1] ||
|
||||||
k < 0 || k >= nbCells[2] ) continue;
|
k < 0 || k >= (int) nbCells[2] ) continue;
|
||||||
|
|
||||||
const size_t hexIndex = _grid->CellIndex( i,j,k );
|
const size_t hexIndex = _grid->CellIndex( i,j,k );
|
||||||
Hexahedron *& hex = allHexa[ hexIndex ];
|
Hexahedron *& hex = allHexa[ hexIndex ];
|
||||||
@ -2436,7 +2436,7 @@ namespace
|
|||||||
planes._zProjs [0] = 0;
|
planes._zProjs [0] = 0;
|
||||||
const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm;
|
const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm;
|
||||||
const vector< double > & u = _grid->_coords[ iDirZ ];
|
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] );
|
planes._zProjs [i] = zFactor * ( u[i] - u[0] );
|
||||||
}
|
}
|
||||||
@ -2870,7 +2870,7 @@ namespace
|
|||||||
{
|
{
|
||||||
bool isOut = false;
|
bool isOut = false;
|
||||||
|
|
||||||
const bool moreIntPoints = ( iP+1 < link._fIntPoints.size() );
|
const bool moreIntPoints = ( iP+1 < (int) link._fIntPoints.size() );
|
||||||
|
|
||||||
// get 2 _Node's
|
// get 2 _Node's
|
||||||
_Node* n1 = link._fIntNodes[ iP ];
|
_Node* n1 = link._fIntNodes[ iP ];
|
||||||
@ -3049,7 +3049,7 @@ namespace
|
|||||||
// sort nodes accoring to the order of edges
|
// sort nodes accoring to the order of edges
|
||||||
_Node* orderNodes [20];
|
_Node* orderNodes [20];
|
||||||
TGeomID orderShapeIDs[20];
|
TGeomID orderShapeIDs[20];
|
||||||
int nbN = 0;
|
size_t nbN = 0;
|
||||||
TGeomID id, *pID;
|
TGeomID id, *pID;
|
||||||
for ( e = edges.begin(); e != edges.end(); ++e )
|
for ( e = edges.begin(); e != edges.end(); ++e )
|
||||||
{
|
{
|
||||||
@ -3536,7 +3536,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh & theMesh,
|
|||||||
map< TGeomID, vector< TGeomID > > edge2faceIDsMap;
|
map< TGeomID, vector< TGeomID > > edge2faceIDsMap;
|
||||||
TopExp_Explorer eExp;
|
TopExp_Explorer eExp;
|
||||||
Bnd_Box shapeBox;
|
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]._face = TopoDS::Face ( faceVec[i] );
|
||||||
facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] );
|
facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] );
|
||||||
|
@ -119,7 +119,7 @@ ostream & StdMeshers_Deflection1D::SaveTo(ostream & save)
|
|||||||
|
|
||||||
istream & StdMeshers_Deflection1D::LoadFrom(istream & load)
|
istream & StdMeshers_Deflection1D::LoadFrom(istream & load)
|
||||||
{
|
{
|
||||||
bool isOK = (load >> _value);
|
bool isOK = static_cast<bool>(load >> _value);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
return load;
|
return load;
|
||||||
|
@ -132,8 +132,8 @@ bool FunctionTable::value( const double t, double& f ) const
|
|||||||
|
|
||||||
double FunctionTable::integral( const int i ) const
|
double FunctionTable::integral( const int i ) const
|
||||||
{
|
{
|
||||||
if( i>=0 && i<myData.size()-1 )
|
if ( i >= 0 && i < (int)myData.size()-1 )
|
||||||
return integral( i, myData[2*(i+1)]-myData[2*i] );
|
return integral( i, myData[2*(i+1)] - myData[2*i] );
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -310,14 +310,14 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
|
|||||||
if ( NbEdges() == 0 ) return myPoints;
|
if ( NbEdges() == 0 ) return myPoints;
|
||||||
|
|
||||||
StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
|
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 eHelper( *myProxyMesh->GetMesh() );
|
||||||
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
||||||
fHelper.SetSubShape( myFace );
|
fHelper.SetSubShape( myFace );
|
||||||
bool paramOK;
|
bool paramOK;
|
||||||
double eps = 1e-100;
|
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;
|
map< double, const SMDS_MeshNode*> u2node;
|
||||||
vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
|
vector< pair< double, const SMDS_MeshNode*> > u2nodeVec;
|
||||||
@ -428,8 +428,8 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
|
|||||||
u2node.insert( u2node.end(), make_pair( 1., node ));
|
u2node.insert( u2node.end(), make_pair( 1., node ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( u2node.size() + nbProxyNodes != myNbPonits &&
|
if ((int) u2node.size() + nbProxyNodes != myNbPonits &&
|
||||||
u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
|
(int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
|
||||||
{
|
{
|
||||||
MESSAGE("Wrong node parameters on edges, u2node.size():"
|
MESSAGE("Wrong node parameters on edges, u2node.size():"
|
||||||
<<u2node.size()<<" != myNbPonits:"<<myNbPonits);
|
<<u2node.size()<<" != myNbPonits:"<<myNbPonits);
|
||||||
@ -513,9 +513,9 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
|
|||||||
|
|
||||||
// set <constValue>
|
// set <constValue>
|
||||||
if ( isXConst )
|
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
|
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())
|
} // if ( myPoints.empty())
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::SimulateUVPtStruct(int nbSeg,
|
|||||||
|
|
||||||
int EdgeIndex = 0;
|
int EdgeIndex = 0;
|
||||||
double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ];
|
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);
|
double normPar = double(i) / double(nbSeg);
|
||||||
UVPtStruct & uvPt = (*points)[i];
|
UVPtStruct & uvPt = (*points)[i];
|
||||||
uvPt.node = 0;
|
uvPt.node = 0;
|
||||||
@ -582,7 +582,7 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes(int theEd
|
|||||||
{
|
{
|
||||||
if ( NbEdges() == 0 ) return resultNodes;
|
if ( NbEdges() == 0 ) return resultNodes;
|
||||||
|
|
||||||
SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
|
//SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
|
||||||
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
|
||||||
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
||||||
fHelper.SetSubShape( myFace );
|
fHelper.SetSubShape( myFace );
|
||||||
@ -682,8 +682,8 @@ std::vector<const SMDS_MeshNode*> StdMeshers_FaceSide::GetOrderedNodes(int theEd
|
|||||||
// Fill the result vector
|
// Fill the result vector
|
||||||
|
|
||||||
if ( theEdgeInd < 0 &&
|
if ( theEdgeInd < 0 &&
|
||||||
u2node.size() != myNbPonits &&
|
(int) u2node.size() != myNbPonits &&
|
||||||
u2node.size() != NbPoints( /*update=*/true ))
|
(int) u2node.size() != NbPoints( /*update=*/true ))
|
||||||
{
|
{
|
||||||
u2node.clear();
|
u2node.clear();
|
||||||
}
|
}
|
||||||
@ -810,7 +810,7 @@ const SMDS_MeshNode* StdMeshers_FaceSide::VertexNode(std::size_t i, bool* isMove
|
|||||||
n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false );
|
n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false );
|
||||||
|
|
||||||
if (( !n ) &&
|
if (( !n ) &&
|
||||||
(( i > 0 && i < NbEdges() ) || IsClosed() ))
|
(( i > 0 && (int) i < NbEdges() ) || IsClosed() ))
|
||||||
{
|
{
|
||||||
iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() );
|
iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() );
|
||||||
sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]);
|
sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]);
|
||||||
@ -1051,7 +1051,7 @@ void StdMeshers_FaceSide::dump(const char* msg) const
|
|||||||
if (msg) MESSAGE ( std::endl << msg );
|
if (msg) MESSAGE ( std::endl << msg );
|
||||||
MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
|
MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
|
||||||
MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.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 ( "\t"<<i+1 );
|
||||||
MESSAGE_ADD ( "\tEDGE: " );
|
MESSAGE_ADD ( "\tEDGE: " );
|
||||||
@ -1113,7 +1113,7 @@ BRepAdaptor_CompCurve* StdMeshers_FaceSide::GetCurve3d() const
|
|||||||
TopoDS_Wire aWire;
|
TopoDS_Wire aWire;
|
||||||
BRep_Builder aBuilder;
|
BRep_Builder aBuilder;
|
||||||
aBuilder.MakeWire(aWire);
|
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] );
|
aBuilder.Add( aWire, myEdge[i] );
|
||||||
|
|
||||||
if ( myEdge.size() == 2 && IsClosed() )
|
if ( myEdge.size() == 2 && IsClosed() )
|
||||||
@ -1157,7 +1157,7 @@ gp_Pnt2d StdMeshers_FaceSide::Value2d(double U) const
|
|||||||
int i = U * double( myPoints.size()-1 );
|
int i = U * double( myPoints.size()-1 );
|
||||||
while ( i > 0 && myPoints[ i ].normParam > U )
|
while ( i > 0 && myPoints[ i ].normParam > U )
|
||||||
--i;
|
--i;
|
||||||
while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U )
|
while ( i+1 < (int)myPoints.size() && myPoints[ i+1 ].normParam < U )
|
||||||
++i;
|
++i;
|
||||||
double r = (( U - myPoints[ i ].normParam ) /
|
double r = (( U - myPoints[ i ].normParam ) /
|
||||||
( myPoints[ i+1 ].normParam - myPoints[ i ].normParam ));
|
( myPoints[ i+1 ].normParam - myPoints[ i ].normParam ));
|
||||||
|
@ -150,37 +150,37 @@ istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load)
|
|||||||
int intVal;
|
int intVal;
|
||||||
double dblVal;
|
double dblVal;
|
||||||
|
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if (isOK && intVal > 0) {
|
if (isOK && intVal > 0) {
|
||||||
_params.clear();
|
_params.clear();
|
||||||
_params.reserve( intVal );
|
_params.reserve( intVal );
|
||||||
for ( size_t i = 0; i < _params.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _params.push_back( dblVal );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if (isOK && intVal > 0) {
|
if (isOK && intVal > 0) {
|
||||||
_nbsegs.clear();
|
_nbsegs.clear();
|
||||||
_nbsegs.reserve( intVal );
|
_nbsegs.reserve( intVal );
|
||||||
for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _nbsegs.push_back( intVal );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if (isOK && intVal > 0) {
|
if (isOK && intVal > 0) {
|
||||||
_edgeIDs.clear();
|
_edgeIDs.clear();
|
||||||
_edgeIDs.reserve( intVal );
|
_edgeIDs.reserve( intVal );
|
||||||
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _edgeIDs.push_back( intVal );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isOK = (load >> _objEntry);
|
isOK = static_cast<bool>(load >> _objEntry);
|
||||||
|
|
||||||
return load;
|
return load;
|
||||||
}
|
}
|
||||||
|
@ -132,8 +132,8 @@ ostream & StdMeshers_Geometric1D::SaveTo(ostream & save)
|
|||||||
istream & StdMeshers_Geometric1D::LoadFrom(istream & load)
|
istream & StdMeshers_Geometric1D::LoadFrom(istream & load)
|
||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
isOK = (load >> _begLength);
|
isOK = static_cast<bool>(load >> _begLength);
|
||||||
isOK = (load >> _ratio);
|
isOK = static_cast<bool>(load >> _ratio);
|
||||||
|
|
||||||
if (isOK)
|
if (isOK)
|
||||||
StdMeshers_Reversible1D::LoadFrom( load );
|
StdMeshers_Reversible1D::LoadFrom( load );
|
||||||
|
@ -106,7 +106,7 @@ istream & StdMeshers_LengthFromEdges::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
int a;
|
int a;
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
this->_mode = a;
|
this->_mode = a;
|
||||||
else
|
else
|
||||||
|
@ -148,13 +148,13 @@ istream & StdMeshers_LocalLength::LoadFrom(istream & load)
|
|||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
double a;
|
double a;
|
||||||
|
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
this->_length = a;
|
this->_length = a;
|
||||||
else
|
else
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
this->_precision = a;
|
this->_precision = a;
|
||||||
else
|
else
|
||||||
|
@ -114,7 +114,7 @@ istream & StdMeshers_MaxElementArea::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
double a;
|
double a;
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
this->_maxArea = a;
|
this->_maxArea = a;
|
||||||
else
|
else
|
||||||
|
@ -116,7 +116,7 @@ istream & StdMeshers_MaxElementVolume::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
double a;
|
double a;
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
this->_maxVolume = a;
|
this->_maxVolume = a;
|
||||||
else
|
else
|
||||||
|
@ -158,20 +158,20 @@ istream & StdMeshers_MaxLength::LoadFrom(istream & load)
|
|||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
double a;
|
double a;
|
||||||
|
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_length = a;
|
_length = a;
|
||||||
else
|
else
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_preestimated = a;
|
_preestimated = a;
|
||||||
else
|
else
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
bool pre;
|
bool pre;
|
||||||
isOK = (load >> pre);
|
isOK = static_cast<bool>(load >> pre);
|
||||||
if ( isOK )
|
if ( isOK )
|
||||||
_preestimation = pre;
|
_preestimation = pre;
|
||||||
else
|
else
|
||||||
|
@ -118,7 +118,7 @@ ostream & StdMeshers_NumberOfLayers::SaveTo(ostream & save)
|
|||||||
istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load)
|
istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load)
|
||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
isOK = (load >> _nbLayers);
|
isOK = static_cast<bool>(load >> _nbLayers);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
return load;
|
return load;
|
||||||
|
@ -548,7 +548,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
int a;
|
int a;
|
||||||
|
|
||||||
// read number of segments
|
// read number of segments
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_numberOfSegments = a;
|
_numberOfSegments = a;
|
||||||
else
|
else
|
||||||
@ -561,7 +561,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
// (nb.segments, distr.type, some other params.),
|
// (nb.segments, distr.type, some other params.),
|
||||||
// we wait here the ditribution type, which is integer
|
// we wait here the ditribution type, which is integer
|
||||||
double scale_factor;
|
double scale_factor;
|
||||||
isOK = (load >> scale_factor);
|
isOK = static_cast<bool>(load >> scale_factor);
|
||||||
a = (int)scale_factor;
|
a = (int)scale_factor;
|
||||||
|
|
||||||
// try to interprete ditribution type,
|
// try to interprete ditribution type,
|
||||||
@ -582,7 +582,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
case DT_Scale:
|
case DT_Scale:
|
||||||
{
|
{
|
||||||
isOK = (load >> b);
|
isOK = static_cast<bool>(load >> b);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_scaleFactor = b;
|
_scaleFactor = b;
|
||||||
else
|
else
|
||||||
@ -596,13 +596,13 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
break;
|
break;
|
||||||
case DT_TabFunc:
|
case DT_TabFunc:
|
||||||
{
|
{
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
{
|
{
|
||||||
_table.resize(a, 0.);
|
_table.resize(a, 0.);
|
||||||
for ( size_t i=0; i < _table.size(); i++ )
|
for ( size_t i=0; i < _table.size(); i++ )
|
||||||
{
|
{
|
||||||
isOK = (load >> b);
|
isOK = static_cast<bool>(load >> b);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_table[i] = b;
|
_table[i] = b;
|
||||||
else
|
else
|
||||||
@ -621,7 +621,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
case DT_ExprFunc:
|
case DT_ExprFunc:
|
||||||
{
|
{
|
||||||
string str;
|
string str;
|
||||||
isOK = (load >> str);
|
isOK = static_cast<bool>(load >> str);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_func = str;
|
_func = str;
|
||||||
else
|
else
|
||||||
@ -640,7 +640,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
|
|
||||||
if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc)
|
if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc)
|
||||||
{
|
{
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_convMode = a;
|
_convMode = a;
|
||||||
else
|
else
|
||||||
@ -649,14 +649,14 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
|
|||||||
|
|
||||||
// load reversed edges IDs
|
// load reversed edges IDs
|
||||||
int intVal;
|
int intVal;
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if ( isOK && _distrType != DT_Regular && intVal > 0 ) {
|
if ( isOK && _distrType != DT_Regular && intVal > 0 ) {
|
||||||
_edgeIDs.reserve( intVal );
|
_edgeIDs.reserve( intVal );
|
||||||
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _edgeIDs.push_back( intVal );
|
||||||
}
|
}
|
||||||
isOK = (load >> _objEntry);
|
isOK = static_cast<bool>(load >> _objEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return load;
|
return load;
|
||||||
|
@ -33,9 +33,9 @@
|
|||||||
|
|
||||||
#include <IntAna_IntConicQuad.hxx>
|
#include <IntAna_IntConicQuad.hxx>
|
||||||
#include <IntAna_Quadric.hxx>
|
#include <IntAna_Quadric.hxx>
|
||||||
#include <TColgp_HArray1OfPnt.hxx>
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
#include <TColgp_HArray1OfVec.hxx>
|
#include <TColgp_Array1OfVec.hxx>
|
||||||
#include <TColgp_HSequenceOfPnt.hxx>
|
#include <TColgp_SequenceOfPnt.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
@ -495,26 +495,23 @@ static bool HasIntersection3(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint,
|
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) {
|
if ( aContour.Length() == 3 ) {
|
||||||
return HasIntersection3( P, PC, Pint, aContour->Value(1),
|
return HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) );
|
||||||
aContour->Value(2), aContour->Value(3) );
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bool check = false;
|
bool check = false;
|
||||||
if( (aContour->Value(1).Distance(aContour->Value(2)) > 1.e-6) &&
|
if( (aContour(1).Distance(aContour(2)) > 1.e-6) &&
|
||||||
(aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) &&
|
(aContour(1).Distance(aContour(3)) > 1.e-6) &&
|
||||||
(aContour->Value(2).Distance(aContour->Value(3)) > 1.e-6) ) {
|
(aContour(2).Distance(aContour(3)) > 1.e-6) ) {
|
||||||
check = HasIntersection3( P, PC, Pint, aContour->Value(1),
|
check = HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) );
|
||||||
aContour->Value(2), aContour->Value(3) );
|
|
||||||
}
|
}
|
||||||
if(check) return true;
|
if(check) return true;
|
||||||
if( (aContour->Value(1).Distance(aContour->Value(4)) > 1.e-6) &&
|
if( (aContour(1).Distance(aContour(4)) > 1.e-6) &&
|
||||||
(aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) &&
|
(aContour(1).Distance(aContour(3)) > 1.e-6) &&
|
||||||
(aContour->Value(4).Distance(aContour->Value(3)) > 1.e-6) ) {
|
(aContour(4).Distance(aContour(3)) > 1.e-6) ) {
|
||||||
check = HasIntersection3( P, PC, Pint, aContour->Value(1),
|
check = HasIntersection3( P, PC, Pint, aContour(1), aContour(3), aContour(4) );
|
||||||
aContour->Value(3), aContour->Value(4) );
|
|
||||||
}
|
}
|
||||||
if(check) return true;
|
if(check) return true;
|
||||||
}
|
}
|
||||||
@ -546,24 +543,23 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P,
|
|||||||
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() );
|
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() );
|
||||||
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
|
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
|
||||||
|
|
||||||
//SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
|
|
||||||
//cout<<" CheckIntersection: meshDS->NbFaces() = "<<meshDS->NbFaces()<<endl;
|
|
||||||
bool res = false;
|
bool res = false;
|
||||||
double dist = RealLast(); // find intersection closest to the segment
|
double dist = RealLast(); // find intersection closest to PC
|
||||||
gp_Pnt Pres;
|
gp_Pnt Pres;
|
||||||
|
|
||||||
gp_Ax1 line( P, gp_Vec(P,PC));
|
gp_Ax1 line( P, gp_Vec(P,PC));
|
||||||
vector< const SMDS_MeshElement* > suspectElems;
|
vector< const SMDS_MeshElement* > suspectElems;
|
||||||
searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
|
searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems);
|
||||||
|
|
||||||
|
TColgp_SequenceOfPnt aContour;
|
||||||
for ( size_t iF = 0; iF < suspectElems.size(); ++iF )
|
for ( size_t iF = 0; iF < suspectElems.size(); ++iF )
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* face = suspectElems[iF];
|
const SMDS_MeshElement* face = suspectElems[iF];
|
||||||
if ( face == NotCheckedFace ) continue;
|
if ( face == NotCheckedFace ) continue;
|
||||||
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
|
aContour.Clear();
|
||||||
for ( int i = 0; i < face->NbCornerNodes(); ++i )
|
for ( int i = 0; i < face->NbCornerNodes(); ++i )
|
||||||
aContour->Append( SMESH_TNodeXYZ( face->GetNode(i) ));
|
aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) ));
|
||||||
if( HasIntersection(P, PC, Pres, aContour) ) {
|
if ( HasIntersection(P, PC, Pres, aContour)) {
|
||||||
res = true;
|
res = true;
|
||||||
double tmp = PC.Distance(Pres);
|
double tmp = PC.Distance(Pres);
|
||||||
if ( tmp < dist ) {
|
if ( tmp < dist ) {
|
||||||
@ -591,8 +587,8 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P,
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face,
|
int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face,
|
||||||
Handle(TColgp_HArray1OfPnt)& PN,
|
TColgp_Array1OfPnt& PN,
|
||||||
Handle(TColgp_HArray1OfVec)& VN,
|
TColgp_Array1OfVec& VN,
|
||||||
vector<const SMDS_MeshNode*>& FNodes,
|
vector<const SMDS_MeshNode*>& FNodes,
|
||||||
gp_Pnt& PC,
|
gp_Pnt& PC,
|
||||||
gp_Vec& VNorm,
|
gp_Vec& VNorm,
|
||||||
@ -608,7 +604,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face
|
|||||||
for ( i = 0; i < 4; ++i )
|
for ( i = 0; i < 4; ++i )
|
||||||
{
|
{
|
||||||
gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) );
|
gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) );
|
||||||
PN->SetValue( i+1, p );
|
PN.SetValue( i+1, p );
|
||||||
xyzC += p;
|
xyzC += p;
|
||||||
}
|
}
|
||||||
PC = xyzC/4;
|
PC = xyzC/4;
|
||||||
@ -619,7 +615,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face
|
|||||||
for(i=1; i<4; i++) {
|
for(i=1; i<4; i++) {
|
||||||
j = i+1;
|
j = i+1;
|
||||||
for(; j<=4; j++) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if(j<=4) break;
|
if(j<=4) break;
|
||||||
@ -630,7 +626,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face
|
|||||||
if(i<4) {
|
if(i<4) {
|
||||||
//cout<<"find degeneration"<<endl;
|
//cout<<"find degeneration"<<endl;
|
||||||
hasdeg = true;
|
hasdeg = true;
|
||||||
gp_Pnt Pdeg = PN->Value(i);
|
gp_Pnt Pdeg = PN(i);
|
||||||
|
|
||||||
list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin();
|
list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin();
|
||||||
const SMDS_MeshNode* DegNode = 0;
|
const SMDS_MeshNode* DegNode = 0;
|
||||||
@ -651,24 +647,24 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face
|
|||||||
FNodes[i-1] = DegNode;
|
FNodes[i-1] = DegNode;
|
||||||
}
|
}
|
||||||
for(i=j; i<4; i++) {
|
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];
|
FNodes[i-1] = FNodes[i];
|
||||||
}
|
}
|
||||||
nbp = 3;
|
nbp = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
PN->SetValue(nbp+1,PN->Value(1));
|
PN.SetValue(nbp+1,PN(1));
|
||||||
FNodes[nbp] = FNodes[0];
|
FNodes[nbp] = FNodes[0];
|
||||||
// find normal direction
|
// find normal direction
|
||||||
gp_Vec V1(PC,PN->Value(nbp));
|
gp_Vec V1(PC,PN(nbp));
|
||||||
gp_Vec V2(PC,PN->Value(1));
|
gp_Vec V2(PC,PN(1));
|
||||||
VNorm = V1.Crossed(V2);
|
VNorm = V1.Crossed(V2);
|
||||||
VN->SetValue(nbp,VNorm);
|
VN.SetValue(nbp,VNorm);
|
||||||
for(i=1; i<nbp; i++) {
|
for(i=1; i<nbp; i++) {
|
||||||
V1 = gp_Vec(PC,PN->Value(i));
|
V1 = gp_Vec(PC,PN(i));
|
||||||
V2 = gp_Vec(PC,PN->Value(i+1));
|
V2 = gp_Vec(PC,PN(i+1));
|
||||||
gp_Vec Vtmp = V1.Crossed(V2);
|
gp_Vec Vtmp = V1.Crossed(V2);
|
||||||
VN->SetValue(i,Vtmp);
|
VN.SetValue(i,Vtmp);
|
||||||
VNorm += Vtmp;
|
VNorm += Vtmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,8 +732,8 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh,
|
|||||||
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
|
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
|
||||||
|
|
||||||
const SMESHDS_SubMesh * aSubMeshDSFace;
|
const SMESHDS_SubMesh * aSubMeshDSFace;
|
||||||
Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
|
TColgp_Array1OfPnt PN(1,5);
|
||||||
Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
|
TColgp_Array1OfVec VN(1,4);
|
||||||
vector<const SMDS_MeshNode*> FNodes(5);
|
vector<const SMDS_MeshNode*> FNodes(5);
|
||||||
gp_Pnt PC;
|
gp_Pnt PC;
|
||||||
gp_Vec VNorm;
|
gp_Vec VNorm;
|
||||||
@ -796,9 +792,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh,
|
|||||||
for(; i<=4; i++) {
|
for(; i<=4; i++) {
|
||||||
gp_Pnt Pbest;
|
gp_Pnt Pbest;
|
||||||
if(!isRev)
|
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
|
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();
|
xc += Pbest.X();
|
||||||
yc += Pbest.Y();
|
yc += Pbest.Y();
|
||||||
zc += Pbest.Z();
|
zc += Pbest.Z();
|
||||||
@ -807,34 +803,24 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh,
|
|||||||
|
|
||||||
// check PCbest
|
// check PCbest
|
||||||
double height = PCbest.Distance(PC);
|
double height = PCbest.Distance(PC);
|
||||||
if(height<1.e-6) {
|
if ( height < 1.e-6 ) {
|
||||||
// create new PCbest using a bit shift along VNorm
|
// create new PCbest using a bit shift along VNorm
|
||||||
PCbest = PC.XYZ() + VNorm.XYZ() * 0.001;
|
PCbest = PC.XYZ() + VNorm.XYZ() * 0.001;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// check possible intersection with other faces
|
// check possible intersection with other faces
|
||||||
gp_Pnt Pint;
|
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;
|
|
||||||
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_Vec VB(PC,PCbest);
|
||||||
gp_Pnt PCbestTmp = PC.XYZ() + VB.XYZ() * 3.0;
|
gp_Pnt PCbestTmp = PC.XYZ() + VB.XYZ() * 3.0;
|
||||||
check = CheckIntersection(PCbestTmp, PC, Pint, aMesh, aShape, face);
|
bool hasInters = CheckIntersection(PCbestTmp, PC, Pint, aMesh, aShape, face);
|
||||||
if(check) {
|
if ( hasInters ) {
|
||||||
double dist = PC.Distance(Pint)/3.;
|
double dist = PC.Distance(Pint)/3.;
|
||||||
if(dist<height) {
|
if ( dist < height ) {
|
||||||
gp_Dir aDir(gp_Vec(PC,PCbest));
|
gp_Dir aDir( VB );
|
||||||
PCbest = PC.XYZ() + aDir.XYZ() * dist;
|
PCbest = PC.XYZ() + aDir.XYZ() * dist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// create node for PCbest
|
// create node for PCbest
|
||||||
SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
|
SMDS_MeshNode* NewNode = helper.AddNode( PCbest.X(), PCbest.Y(), PCbest.Z() );
|
||||||
|
|
||||||
@ -945,15 +931,17 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
|
|||||||
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
|
myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
|
||||||
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
|
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);
|
SMDS_FaceIteratorPtr fIt = meshDS->facesIterator(/*idInceasingOrder=*/true);
|
||||||
while( fIt->more())
|
while( fIt->more())
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* face = fIt->next();
|
const SMDS_MeshElement* face = fIt->next();
|
||||||
if ( !face ) continue;
|
if ( !face ) continue;
|
||||||
// retrieve needed information about a face
|
// 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_Pnt PC;
|
||||||
gp_Vec VNorm;
|
gp_Vec VNorm;
|
||||||
const SMDS_MeshElement* volumes[2];
|
const SMDS_MeshElement* volumes[2];
|
||||||
@ -970,7 +958,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
|
|||||||
SMDS_MeshFace* NewFace;
|
SMDS_MeshFace* NewFace;
|
||||||
|
|
||||||
// check orientation
|
// 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
|
// far points in VNorm direction
|
||||||
gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6;
|
gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6;
|
||||||
gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6;
|
gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6;
|
||||||
@ -989,9 +977,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
|
|||||||
for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) {
|
for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) {
|
||||||
const SMDS_MeshElement* F = suspectElems[iF];
|
const SMDS_MeshElement* F = suspectElems[iF];
|
||||||
if ( F == face ) continue;
|
if ( F == face ) continue;
|
||||||
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
|
aContour.Clear();
|
||||||
for ( int i = 0; i < 4; ++i )
|
for ( int i = 0; i < 4; ++i )
|
||||||
aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
|
aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) ));
|
||||||
gp_Pnt PPP;
|
gp_Pnt PPP;
|
||||||
if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) {
|
if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) {
|
||||||
IsOK1 = true;
|
IsOK1 = true;
|
||||||
@ -1045,7 +1033,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
|
|||||||
gp_XYZ PCbest(0., 0., 0.); // pyramid peak
|
gp_XYZ PCbest(0., 0., 0.); // pyramid peak
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for ( ; i <= 4; i++ ) {
|
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 += Pbest.XYZ();
|
||||||
}
|
}
|
||||||
PCbest /= 4;
|
PCbest /= 4;
|
||||||
@ -1061,7 +1049,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
|
|||||||
|
|
||||||
// Restrict pyramid height by intersection with other faces
|
// Restrict pyramid height by intersection with other faces
|
||||||
gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize();
|
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
|
// far points: in (PC, PCbest) direction and vice-versa
|
||||||
gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6,
|
gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6,
|
||||||
PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 };
|
PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 };
|
||||||
@ -1078,10 +1066,10 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
|
|||||||
{
|
{
|
||||||
const SMDS_MeshElement* F = suspectElems[iF];
|
const SMDS_MeshElement* F = suspectElems[iF];
|
||||||
if ( F == face ) continue;
|
if ( F == face ) continue;
|
||||||
Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt;
|
aContour.Clear();
|
||||||
int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 );
|
int nbN = F->NbCornerNodes();
|
||||||
for ( i = 0; i < nbN; ++i )
|
for ( i = 0; i < nbN; ++i )
|
||||||
aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) ));
|
aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) ));
|
||||||
gp_Pnt intP;
|
gp_Pnt intP;
|
||||||
for ( int isRev = 0; isRev < 2; ++isRev )
|
for ( int isRev = 0; isRev < 2; ++isRev )
|
||||||
{
|
{
|
||||||
|
@ -32,8 +32,8 @@ class SMESH_ElementSearcher;
|
|||||||
class SMDS_MeshElement;
|
class SMDS_MeshElement;
|
||||||
class SMDS_MeshNode;
|
class SMDS_MeshNode;
|
||||||
class SMDS_MeshFace;
|
class SMDS_MeshFace;
|
||||||
class Handle_TColgp_HArray1OfPnt;
|
class TColgp_Array1OfPnt;
|
||||||
class Handle_TColgp_HArray1OfVec;
|
class TColgp_Array1OfVec;
|
||||||
class gp_Pnt;
|
class gp_Pnt;
|
||||||
class gp_Vec;
|
class gp_Vec;
|
||||||
|
|
||||||
@ -65,8 +65,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
int Preparation(const SMDS_MeshElement* face,
|
int Preparation(const SMDS_MeshElement* face,
|
||||||
Handle_TColgp_HArray1OfPnt& PN,
|
TColgp_Array1OfPnt& PN,
|
||||||
Handle_TColgp_HArray1OfVec& VN,
|
TColgp_Array1OfVec& VN,
|
||||||
std::vector<const SMDS_MeshNode*>& FNodes,
|
std::vector<const SMDS_MeshNode*>& FNodes,
|
||||||
gp_Pnt& PC, gp_Vec& VNorm,
|
gp_Pnt& PC, gp_Vec& VNorm,
|
||||||
const SMDS_MeshElement** volumes=0);
|
const SMDS_MeshElement** volumes=0);
|
||||||
|
@ -153,16 +153,16 @@ ostream & StdMeshers_QuadrangleParams::SaveTo(ostream & save)
|
|||||||
istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load)
|
istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load)
|
||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
isOK = (load >> _triaVertexID);
|
isOK = static_cast<bool>(load >> _triaVertexID);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
isOK = (load >> _objEntry);
|
isOK = static_cast<bool>(load >> _objEntry);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
int type;
|
int type;
|
||||||
isOK = (load >> type);
|
isOK = static_cast<bool>(load >> type);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
_quadType = StdMeshers_QuadType(type);
|
_quadType = StdMeshers_QuadType(type);
|
||||||
|
|
||||||
|
@ -1781,10 +1781,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh,
|
|||||||
// 0 bottom 1
|
// 0 bottom 1
|
||||||
|
|
||||||
|
|
||||||
const int bfrom = quad->side[0].from;
|
//const int bfrom = quad->side[0].from;
|
||||||
const int rfrom = quad->side[1].from;
|
//const int rfrom = quad->side[1].from;
|
||||||
const int tfrom = quad->side[2].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_eb_vec = quad->side[0].GetUVPtStruct(true,0);
|
||||||
const vector<UVPtStruct>& uv_er_vec = quad->side[1].GetUVPtStruct(false,1);
|
const vector<UVPtStruct>& uv_er_vec = quad->side[1].GetUVPtStruct(false,1);
|
||||||
@ -1925,10 +1925,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh,
|
|||||||
|
|
||||||
} // if ( dv != 0 && dh != 0 )
|
} // if ( dv != 0 && dh != 0 )
|
||||||
|
|
||||||
const int db = quad->side[0].IsReversed() ? -1 : +1;
|
//const int db = quad->side[0].IsReversed() ? -1 : +1;
|
||||||
const int dr = quad->side[1].IsReversed() ? -1 : +1;
|
//const int dr = quad->side[1].IsReversed() ? -1 : +1;
|
||||||
const int dt = quad->side[2].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
|
// Case dv == 0, here possibly myQuadList.size() > 1
|
||||||
//
|
//
|
||||||
@ -2970,7 +2970,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh,
|
|||||||
const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
|
const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
|
||||||
const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
|
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);
|
return error(COMPERR_BAD_INPUT_MESH);
|
||||||
|
|
||||||
// arrays for normalized params
|
// arrays for normalized params
|
||||||
@ -3283,7 +3284,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh,
|
|||||||
const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
|
const vector<UVPtStruct>& uv_et = quad->side[2].GetUVPtStruct(true,1);
|
||||||
const vector<UVPtStruct>& uv_el = quad->side[3].GetUVPtStruct(false,0);
|
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);
|
return error(COMPERR_BAD_INPUT_MESH);
|
||||||
|
|
||||||
gp_UV uv[ UV_SIZE ];
|
gp_UV uv[ UV_SIZE ];
|
||||||
@ -4337,7 +4339,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
|
|||||||
|
|
||||||
// check if there are possible variations in choosing corners
|
// check if there are possible variations in choosing corners
|
||||||
bool haveVariants = false;
|
bool haveVariants = false;
|
||||||
if ( vertexByAngle.size() > nbCorners )
|
if ((int) vertexByAngle.size() > nbCorners )
|
||||||
{
|
{
|
||||||
double lostAngle = a2v->first;
|
double lostAngle = a2v->first;
|
||||||
double lastAngle = ( --a2v, a2v->first );
|
double lastAngle = ( --a2v, a2v->first );
|
||||||
@ -4345,7 +4347,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const double angleTol = 5.* M_PI/180;
|
const double angleTol = 5.* M_PI/180;
|
||||||
myCheckOri = ( vertexByAngle.size() > nbCorners ||
|
myCheckOri = ( (int)vertexByAngle.size() > nbCorners ||
|
||||||
vertexByAngle.begin()->first < angleTol );
|
vertexByAngle.begin()->first < angleTol );
|
||||||
|
|
||||||
// make theWire begin from a corner vertex or triaVertex
|
// make theWire begin from a corner vertex or triaVertex
|
||||||
@ -4475,7 +4477,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
|
|||||||
{
|
{
|
||||||
// select two halfDivider's as corners
|
// select two halfDivider's as corners
|
||||||
TGeoIndex hd1, hd2 = -1;
|
TGeoIndex hd1, hd2 = -1;
|
||||||
int iC2;
|
size_t iC2;
|
||||||
for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 )
|
for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 )
|
||||||
{
|
{
|
||||||
hd1 = cornerInd[ iC2 ];
|
hd1 = cornerInd[ iC2 ];
|
||||||
@ -4521,10 +4523,10 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
|
|||||||
vector< double > accuLength;
|
vector< double > accuLength;
|
||||||
double totalLen = 0;
|
double totalLen = 0;
|
||||||
vector< TGeoIndex > evVec( equVerts.begin(), equVerts.end() );
|
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 iE = cornerInd[ helper.WrapIndex( iC - nbC[0] - 1, cornerInd.size() )];
|
||||||
TGeoIndex iEEnd = cornerInd[ helper.WrapIndex( iC + nbC[1] + 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
|
// accumulate length of edges before iEV-th equal vertex
|
||||||
accuLength.push_back( totalLen );
|
accuLength.push_back( totalLen );
|
||||||
@ -4780,8 +4782,6 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
|
|||||||
quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt );
|
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() );
|
const TopoDS_Face& face = TopoDS::Face( myHelper->GetSubShape() );
|
||||||
Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
|
Handle(Geom_Surface) surf = BRep_Tool::Surface( face );
|
||||||
|
|
||||||
@ -4961,8 +4961,8 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes()
|
|||||||
continue;
|
continue;
|
||||||
const vector<UVPtStruct>& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct();
|
const vector<UVPtStruct>& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct();
|
||||||
const UVPtStruct& uvPt = points[ side.contacts[iC].point ];
|
const UVPtStruct& uvPt = points[ side.contacts[iC].point ];
|
||||||
if ( side.contacts[iC].other_point >= oGrid .size() ||
|
if ( side.contacts[iC].other_point >= (int) oGrid .size() ||
|
||||||
side.contacts[iC].point >= points.size() )
|
side.contacts[iC].point >= (int) points.size() )
|
||||||
throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" );
|
throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" );
|
||||||
if ( oGrid[ side.contacts[iC].other_point ].node )
|
if ( oGrid[ side.contacts[iC].other_point ].node )
|
||||||
(( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node;
|
(( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node;
|
||||||
@ -5120,7 +5120,7 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side,
|
|||||||
|
|
||||||
const int iFrom = Min ( iForced, *iNext );
|
const int iFrom = Min ( iForced, *iNext );
|
||||||
const int iTo = Max ( iForced, *iNext ) + 1;
|
const int iTo = Max ( iForced, *iNext ) + 1;
|
||||||
const int sideSize = iTo - iFrom;
|
const size_t sideSize = iTo - iFrom;
|
||||||
|
|
||||||
vector<UVPtStruct> points[4]; // side points of a temporary quad
|
vector<UVPtStruct> points[4]; // side points of a temporary quad
|
||||||
|
|
||||||
@ -5130,7 +5130,7 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side,
|
|||||||
for ( int is2nd = 0; is2nd < 2; ++is2nd )
|
for ( int is2nd = 0; is2nd < 2; ++is2nd )
|
||||||
{
|
{
|
||||||
points[ is2nd ].reserve( sideSize );
|
points[ is2nd ].reserve( sideSize );
|
||||||
int nbLoops = 0;
|
size_t nbLoops = 0;
|
||||||
while ( points[is2nd].size() < sideSize )
|
while ( points[is2nd].size() < sideSize )
|
||||||
{
|
{
|
||||||
int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() );
|
int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() );
|
||||||
@ -5624,8 +5624,8 @@ bool FaceQuadStruct::Side::IsForced( int nodeIndex ) const
|
|||||||
|
|
||||||
void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop )
|
void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop )
|
||||||
{
|
{
|
||||||
if ( ip >= GetUVPtStruct().size() ||
|
if ( ip >= (int) GetUVPtStruct().size() ||
|
||||||
iop >= side->GetUVPtStruct().size() )
|
iop >= (int) side->GetUVPtStruct().size() )
|
||||||
throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" );
|
throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" );
|
||||||
if ( ip < from || ip >= to )
|
if ( ip < from || ip >= to )
|
||||||
return;
|
return;
|
||||||
|
@ -537,8 +537,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
gp_Vec2d aVec2d(PC,p2dV);
|
gp_Vec2d aVec2d(PC,p2dV);
|
||||||
Nodes1.resize( myLayerPositions.size()+1 );
|
Nodes1.resize( myLayerPositions.size()+1 );
|
||||||
Nodes2.resize( myLayerPositions.size()+1 );
|
Nodes2.resize( myLayerPositions.size()+1 );
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
for(; i<myLayerPositions.size(); i++) {
|
for ( ; i < myLayerPositions.size(); i++ ) {
|
||||||
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
||||||
P0.Y() + aVec.Y()*myLayerPositions[i],
|
P0.Y() + aVec.Y()*myLayerPositions[i],
|
||||||
P0.Z() + aVec.Z()*myLayerPositions[i] );
|
P0.Z() + aVec.Z()*myLayerPositions[i] );
|
||||||
@ -648,7 +648,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
meshDS->SetNodeOnEdge(NC, edgeID, cp);
|
meshDS->SetNodeOnEdge(NC, edgeID, cp);
|
||||||
Nodes1.resize( myLayerPositions.size()+1 );
|
Nodes1.resize( myLayerPositions.size()+1 );
|
||||||
Nodes2.resize( myLayerPositions.size()+1 );
|
Nodes2.resize( myLayerPositions.size()+1 );
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
for(; i<myLayerPositions.size(); i++) {
|
for(; i<myLayerPositions.size(); i++) {
|
||||||
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
||||||
P0.Y() + aVec.Y()*myLayerPositions[i],
|
P0.Y() + aVec.Y()*myLayerPositions[i],
|
||||||
@ -774,8 +774,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
bool nodesFromP0ToP1 = ( theNodes.rbegin()->second == NF );
|
bool nodesFromP0ToP1 = ( theNodes.rbegin()->second == NF );
|
||||||
NC = const_cast<SMDS_MeshNode*>
|
NC = const_cast<SMDS_MeshNode*>
|
||||||
( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second );
|
( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second );
|
||||||
int i = 0, ir = Nodes1.size()-1;
|
size_t i = 0, ir = Nodes1.size()-1;
|
||||||
int * pi = nodesFromP0ToP1 ? &i : &ir;
|
size_t * pi = nodesFromP0ToP1 ? &i : &ir;
|
||||||
itn = theNodes.begin();
|
itn = theNodes.begin();
|
||||||
if ( nodesFromP0ToP1 ) ++itn;
|
if ( nodesFromP0ToP1 ) ++itn;
|
||||||
for ( ; i < Nodes1.size(); ++i, --ir, ++itn )
|
for ( ; i < Nodes1.size(); ++i, --ir, ++itn )
|
||||||
@ -817,8 +817,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
meshDS->SetNodeOnVertex(NC, vertID);
|
meshDS->SetNodeOnVertex(NC, vertID);
|
||||||
}
|
}
|
||||||
double dp = lp-fp;
|
double dp = lp-fp;
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
for(; i<myLayerPositions.size(); i++) {
|
for ( ; i < myLayerPositions.size(); i++ ) {
|
||||||
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
||||||
P0.Y() + aVec.Y()*myLayerPositions[i],
|
P0.Y() + aVec.Y()*myLayerPositions[i],
|
||||||
P0.Z() + aVec.Z()*myLayerPositions[i] );
|
P0.Z() + aVec.Z()*myLayerPositions[i] );
|
||||||
@ -826,7 +826,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
|
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
|
||||||
Nodes1[i] = node;
|
Nodes1[i] = node;
|
||||||
double param;
|
double param;
|
||||||
if(!ori)
|
if ( !ori )
|
||||||
param = fp + dp*(1-myLayerPositions[i]);
|
param = fp + dp*(1-myLayerPositions[i]);
|
||||||
else
|
else
|
||||||
param = fp + dp*myLayerPositions[i];
|
param = fp + dp*myLayerPositions[i];
|
||||||
@ -840,11 +840,11 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
// create 1D elements on edge
|
// create 1D elements on edge
|
||||||
SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] );
|
SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] );
|
||||||
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
|
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] );
|
ME = myHelper->AddEdge( Nodes1[i-1], Nodes1[i] );
|
||||||
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
|
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
|
||||||
}
|
}
|
||||||
if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
|
if ( nbe == 2 && LinEdge1.Orientation() == TopAbs_INTERNAL )
|
||||||
Nodes2 = Nodes1;
|
Nodes2 = Nodes1;
|
||||||
}
|
}
|
||||||
markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
|
markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F ));
|
||||||
@ -856,8 +856,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
return error("Invalid mesh on a straight edge");
|
return error("Invalid mesh on a straight edge");
|
||||||
|
|
||||||
bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL );
|
bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL );
|
||||||
int i = 0, ir = Nodes1.size()-1;
|
size_t i = 0, ir = Nodes1.size()-1;
|
||||||
int * pi = nodesFromP0ToP2 ? &i : &ir;
|
size_t * pi = nodesFromP0ToP2 ? &i : &ir;
|
||||||
itn = theNodes.begin();
|
itn = theNodes.begin();
|
||||||
if ( nodesFromP0ToP2 ) ++itn;
|
if ( nodesFromP0ToP2 ) ++itn;
|
||||||
for ( ; i < Nodes2.size(); ++i, --ir, ++itn )
|
for ( ; i < Nodes2.size(); ++i, --ir, ++itn )
|
||||||
@ -886,7 +886,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
PC = PL;
|
PC = PL;
|
||||||
}
|
}
|
||||||
double dp = lp-fp;
|
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],
|
gp_Pnt P( P0.X() + aVec.X()*myLayerPositions[i],
|
||||||
P0.Y() + aVec.Y()*myLayerPositions[i],
|
P0.Y() + aVec.Y()*myLayerPositions[i],
|
||||||
P0.Z() + aVec.Z()*myLayerPositions[i] );
|
P0.Z() + aVec.Z()*myLayerPositions[i] );
|
||||||
@ -905,8 +905,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
Nodes2[ myLayerPositions.size() ] = NL;
|
Nodes2[ myLayerPositions.size() ] = NL;
|
||||||
// create 1D elements on edge
|
// create 1D elements on edge
|
||||||
SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes2[0] );
|
SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes2[0] );
|
||||||
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
|
if ( ME ) meshDS->SetMeshElementOnShape(ME, edgeID);
|
||||||
for(int i=1; i<Nodes2.size(); i++) {
|
for ( size_t i = 1; i < Nodes2.size(); i++ ) {
|
||||||
ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] );
|
ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] );
|
||||||
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
|
if(ME) meshDS->SetMeshElementOnShape(ME, edgeID);
|
||||||
}
|
}
|
||||||
@ -953,7 +953,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
// create faces
|
// create faces
|
||||||
tmpNodes.push_back( CNodes[i] );
|
tmpNodes.push_back( CNodes[i] );
|
||||||
// quad
|
// quad
|
||||||
for(j=0; j<Nodes1.size()-1; j++) {
|
for ( j = 0; j < (int)Nodes1.size() - 1; j++ ) {
|
||||||
SMDS_MeshFace* MF;
|
SMDS_MeshFace* MF;
|
||||||
if(IsForward)
|
if(IsForward)
|
||||||
MF = myHelper->AddFace( tmpNodes[j], Nodes1[j],
|
MF = myHelper->AddFace( tmpNodes[j], Nodes1[j],
|
||||||
@ -969,14 +969,14 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
|
|||||||
MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] );
|
MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] );
|
||||||
else
|
else
|
||||||
MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] );
|
MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] );
|
||||||
if(MF) meshDS->SetMeshElementOnShape(MF, faceID);
|
if ( MF ) meshDS->SetMeshElementOnShape(MF, faceID);
|
||||||
for(j=0; j<Nodes1.size(); j++) {
|
for ( j = 0; j < (int) Nodes1.size(); j++ ) {
|
||||||
Nodes1[j] = tmpNodes[j];
|
Nodes1[j] = tmpNodes[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// create last faces
|
// create last faces
|
||||||
// quad
|
// quad
|
||||||
for(i=0; i<Nodes1.size()-1; i++) {
|
for ( i = 0; i < (int)Nodes1.size()-1; i++ ) {
|
||||||
SMDS_MeshFace* MF;
|
SMDS_MeshFace* MF;
|
||||||
if(IsForward)
|
if(IsForward)
|
||||||
MF = myHelper->AddFace( Nodes2[i], Nodes1[i],
|
MF = myHelper->AddFace( Nodes2[i], Nodes1[i],
|
||||||
@ -1106,7 +1106,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt&
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if ( myLayerPositions.size() != nbNodes )
|
if ((int) myLayerPositions.size() != nbNodes )
|
||||||
return error("Radial edge is meshed by other algorithm");
|
return error("Radial edge is meshed by other algorithm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1196,7 +1196,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) );
|
ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) );
|
||||||
if ( !ok ) {
|
if ( !ok ) {
|
||||||
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
|
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
|
||||||
ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
|
ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
|
||||||
}
|
}
|
||||||
if(ok) {
|
if(ok) {
|
||||||
ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
|
ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap );
|
||||||
@ -1243,7 +1243,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
// other curve not line
|
// other curve not line
|
||||||
return error(COMPERR_BAD_SHAPE);
|
return error(COMPERR_BAD_SHAPE);
|
||||||
}
|
}
|
||||||
int nbLayers = myLayerPositions.size();
|
size_t nbLayers = myLayerPositions.size();
|
||||||
computeLayerPositions( P0, P1, LinEdge2 );
|
computeLayerPositions( P0, P1, LinEdge2 );
|
||||||
if ( nbLayers != myLayerPositions.size() )
|
if ( nbLayers != myLayerPositions.size() )
|
||||||
return error("Different hypotheses apply to radial edges");
|
return error("Different hypotheses apply to radial edges");
|
||||||
@ -1254,7 +1254,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
ok = true; // override other 1d hyps
|
ok = true; // override other 1d hyps
|
||||||
else {
|
else {
|
||||||
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ];
|
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) )) {
|
if( ok && aResMap.count( aMesh.GetSubMesh(LinEdge2) )) {
|
||||||
@ -1262,7 +1262,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
ok = true; // override other 1d hyps
|
ok = true; // override other 1d hyps
|
||||||
else {
|
else {
|
||||||
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ];
|
const vector<int>& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ];
|
||||||
ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() );
|
ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ok) {
|
if(ok) {
|
||||||
|
@ -66,7 +66,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save)
|
|||||||
|
|
||||||
if ( !_edgeIDs.empty() )
|
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 << " " << _edgeIDs[i];
|
||||||
save << " " << _objEntry << " ";
|
save << " " << _objEntry << " ";
|
||||||
}
|
}
|
||||||
@ -85,14 +85,14 @@ std::istream & StdMeshers_Reversible1D::LoadFrom(std::istream & load)
|
|||||||
bool isOK;
|
bool isOK;
|
||||||
int intVal;
|
int intVal;
|
||||||
|
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if (isOK && intVal > 0) {
|
if (isOK && intVal > 0) {
|
||||||
_edgeIDs.reserve( intVal );
|
_edgeIDs.reserve( intVal );
|
||||||
for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _edgeIDs.push_back( intVal );
|
||||||
}
|
}
|
||||||
isOK = (load >> _objEntry);
|
isOK = static_cast<bool>(load >> _objEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return load;
|
return load;
|
||||||
|
@ -117,7 +117,7 @@ istream & StdMeshers_SegmentLengthAroundVertex::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
double a;
|
double a;
|
||||||
isOK = (load >> a);
|
isOK = static_cast<bool>(load >> a);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
this->_length = a;
|
this->_length = a;
|
||||||
else
|
else
|
||||||
|
@ -146,22 +146,22 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load)
|
|||||||
{
|
{
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
int intVal;
|
int intVal;
|
||||||
isOK = (load >> _begLength);
|
isOK = static_cast<bool>(load >> _begLength);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
isOK = (load >> _endLength);
|
isOK = static_cast<bool>(load >> _endLength);
|
||||||
|
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
load.clear(ios::badbit | load.rdstate());
|
load.clear(ios::badbit | load.rdstate());
|
||||||
|
|
||||||
isOK = (load >> intVal);
|
isOK = static_cast<bool>(load >> intVal);
|
||||||
if (isOK && intVal > 0) {
|
if (isOK && intVal > 0) {
|
||||||
_edgeIDs.reserve( intVal );
|
_edgeIDs.reserve( intVal );
|
||||||
for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
|
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 );
|
if ( isOK ) _edgeIDs.push_back( intVal );
|
||||||
}
|
}
|
||||||
isOK = (load >> _objEntry);
|
isOK = static_cast<bool>(load >> _objEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return load;
|
return load;
|
||||||
|
@ -64,19 +64,19 @@ Plot2d_QwtLegendLabel* getLegendLabel( QwtPlotCurve* plotCurve )
|
|||||||
QwtLegend* legend = dynamic_cast<QwtLegend*>( plotCurve->plot()->legend() );
|
QwtLegend* legend = dynamic_cast<QwtLegend*>( plotCurve->plot()->legend() );
|
||||||
QWidget* widget = legend->legendWidget( itemInfo );
|
QWidget* widget = legend->legendWidget( itemInfo );
|
||||||
QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
|
QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
|
||||||
if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label )
|
Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label;
|
||||||
return anItem;
|
return anItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
|
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
|
||||||
: QwtPlot( p ),
|
: QwtPlot( p ),
|
||||||
myPoints( 50 ),
|
myPoints( 50 ),
|
||||||
|
myNbSeg( 1 ),
|
||||||
myIsTable( false ),
|
myIsTable( false ),
|
||||||
|
myConv( CUT_NEGATIVE ),
|
||||||
myVars( 1, 1 ),
|
myVars( 1, 1 ),
|
||||||
myValues( 1, 1 ),
|
myValues( 1, 1 ),
|
||||||
myConv( CUT_NEGATIVE ),
|
myIsDone( true )
|
||||||
myIsDone( true ),
|
|
||||||
myNbSeg( 1 )
|
|
||||||
{
|
{
|
||||||
Kernel_Utils::Localizer loc;
|
Kernel_Utils::Localizer loc;
|
||||||
myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
|
myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
|
||||||
|
@ -574,7 +574,7 @@ StdMeshersGUI_DistrTableFrame::
|
|||||||
setData( const DataArray& array )
|
setData( const DataArray& array )
|
||||||
{
|
{
|
||||||
QList<double> d;
|
QList<double> d;
|
||||||
for ( int i = 0; i < array.length(); i++ )
|
for ( CORBA::ULong i = 0; i < array.length(); i++ )
|
||||||
d.append( array[i] );
|
d.append( array[i] );
|
||||||
|
|
||||||
sortData( d );
|
sortData( d );
|
||||||
|
@ -360,7 +360,7 @@ SMESH::double_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfPoints()
|
|||||||
void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints)
|
void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
for ( int i = 0; i < thePoints->length(); i++ ) {
|
for ( CORBA::ULong i = 0; i < thePoints->length(); i++ ) {
|
||||||
addPoint( thePoints[ i ] );
|
addPoint( thePoints[ i ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var
|
|||||||
{
|
{
|
||||||
if ( myListWidget->count() > 0 && theSegments->length() == 1)
|
if ( myListWidget->count() > 0 && theSegments->length() == 1)
|
||||||
mySameValues->setChecked(true);
|
mySameValues->setChecked(true);
|
||||||
for ( int i = 0; i < theSegments->length(); i++ ) {
|
for ( CORBA::ULong i = 0; i < theSegments->length(); i++ ) {
|
||||||
setNbSegments( i, theSegments[i] );
|
setNbSegments( i, theSegments[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ StdMeshersGUI_LayerDistributionParamWdg
|
|||||||
SMESH::SMESH_Hypothesis_ptr distribHyp,
|
SMESH::SMESH_Hypothesis_ptr distribHyp,
|
||||||
const QString& name,
|
const QString& name,
|
||||||
QDialog* dlg):
|
QDialog* dlg):
|
||||||
QWidget(), myName(name), myDlg( dlg )
|
QWidget(), myDlg( dlg ), myName(name)
|
||||||
{
|
{
|
||||||
myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp );
|
myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp );
|
||||||
init();
|
init();
|
||||||
|
@ -296,12 +296,12 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
|
|||||||
valStr += tr("SMESH_DISTR_REGULAR");
|
valStr += tr("SMESH_DISTR_REGULAR");
|
||||||
break;
|
break;
|
||||||
case Scale :
|
case Scale :
|
||||||
valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );\
|
valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );
|
||||||
break;
|
break;
|
||||||
case TabFunc : {
|
case TabFunc : {
|
||||||
//valStr += tr("SMESH_TAB_FUNC");
|
//valStr += tr("SMESH_TAB_FUNC");
|
||||||
bool param = true;
|
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 )
|
if ( param )
|
||||||
valStr += "[";
|
valStr += "[";
|
||||||
valStr += QString::number( data.myTable[ i ]);
|
valStr += QString::number( data.myTable[ i ]);
|
||||||
|
@ -656,7 +656,7 @@ std::vector<std::string> * MeshJobManager_i::_getResourceNames() {
|
|||||||
LOG("### resource list:");
|
LOG("### resource list:");
|
||||||
std::vector<std::string>* resourceNames = new std::vector<std::string>();
|
std::vector<std::string>* resourceNames = new std::vector<std::string>();
|
||||||
if (resourceList) {
|
if (resourceList) {
|
||||||
for (int i = 0; i < resourceList->length(); i++) {
|
for ( size_t i = 0; i < resourceList->length(); i++) {
|
||||||
const char* aResourceName = (*resourceList)[i];
|
const char* aResourceName = (*resourceList)[i];
|
||||||
resourceNames->push_back(std::string(aResourceName));
|
resourceNames->push_back(std::string(aResourceName));
|
||||||
LOG("resource["<<i<<"] = "<<aResourceName);
|
LOG("resource["<<i<<"] = "<<aResourceName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user