mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-10 23:27:29 +05:00
Fix for bug PAL10409 (Filter "Belong to geom" fails if 2 geom shapes have the same name);
This commit is contained in:
parent
c819d8fdd3
commit
11899ab525
@ -157,7 +157,9 @@ module SMESH
|
|||||||
void SetElementType( in ElementType theType );
|
void SetElementType( in ElementType theType );
|
||||||
|
|
||||||
void SetShapeName( in string theName );
|
void SetShapeName( in string theName );
|
||||||
|
void SetShape( in string theID, in string theName );
|
||||||
string GetShapeName();
|
string GetShapeName();
|
||||||
|
string GetShapeID();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -169,7 +171,9 @@ module SMESH
|
|||||||
void SetTolerance( in double theToler );
|
void SetTolerance( in double theToler );
|
||||||
double GetTolerance();
|
double GetTolerance();
|
||||||
void SetShapeName( in string theName, in ElementType theType );
|
void SetShapeName( in string theName, in ElementType theType );
|
||||||
|
void SetShape( in string theID, in string theName, in ElementType theType );
|
||||||
string GetShapeName();
|
string GetShapeName();
|
||||||
|
string GetShapeID();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -201,7 +205,9 @@ module SMESH
|
|||||||
void SetElementType( in ElementType theType );
|
void SetElementType( in ElementType theType );
|
||||||
|
|
||||||
void SetShapeName( in string theName );
|
void SetShapeName( in string theName );
|
||||||
|
void SetShape( in string theID, in string theName );
|
||||||
string GetShapeName();
|
string GetShapeName();
|
||||||
|
string GetShapeID();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -293,6 +299,8 @@ module SMESH
|
|||||||
* ThresholdStr - Threshold value defined as string. Used for:
|
* ThresholdStr - Threshold value defined as string. Used for:
|
||||||
* 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
|
* 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
|
||||||
* 2. BelongToGeom predicate for storing name of shape
|
* 2. BelongToGeom predicate for storing name of shape
|
||||||
|
* ThresholdID - One more threshold value defined as string. Used for:
|
||||||
|
* 1. BelongToGeom predicate for storing id of shape
|
||||||
* Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
|
* Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
|
||||||
* "Belong to plane" and "Belong to cylinder" predicates
|
* "Belong to plane" and "Belong to cylinder" predicates
|
||||||
* TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
|
* TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
|
||||||
@ -304,6 +312,7 @@ module SMESH
|
|||||||
long Compare;
|
long Compare;
|
||||||
double Threshold;
|
double Threshold;
|
||||||
string ThresholdStr;
|
string ThresholdStr;
|
||||||
|
string ThresholdID;
|
||||||
long UnaryOp;
|
long UnaryOp;
|
||||||
long BinaryOp;
|
long BinaryOp;
|
||||||
double Tolerance;
|
double Tolerance;
|
||||||
|
@ -790,7 +790,11 @@ void SMESHGUI_FilterTable::GetCriterion (const int theRow,
|
|||||||
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
|
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
theCriterion.ThresholdStr = aTable->text(theRow, 2).latin1();
|
theCriterion.ThresholdStr = aTable->text(theRow, 2).latin1();
|
||||||
|
if ( aCriterionType != FT_RangeOfIds )
|
||||||
|
theCriterion.ThresholdID = aTable->text( theRow, 5 ).latin1();
|
||||||
|
}
|
||||||
|
|
||||||
QTableItem* anItem = aTable->item(theRow, 0);
|
QTableItem* anItem = aTable->item(theRow, 0);
|
||||||
if (myAddWidgets.contains(anItem))
|
if (myAddWidgets.contains(anItem))
|
||||||
@ -833,7 +837,11 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
|
|||||||
theCriterion.Type != FT_LyingOnGeom)
|
theCriterion.Type != FT_LyingOnGeom)
|
||||||
aTable->setText(theRow, 2, QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
|
aTable->setText(theRow, 2, QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
|
||||||
else
|
else
|
||||||
|
{
|
||||||
aTable->setText(theRow, 2, QString(theCriterion.ThresholdStr));
|
aTable->setText(theRow, 2, QString(theCriterion.ThresholdStr));
|
||||||
|
if ( theCriterion.Type != FT_RangeOfIds )
|
||||||
|
aTable->setText( theRow, 5, QString( theCriterion.ThresholdID ) );
|
||||||
|
}
|
||||||
|
|
||||||
if (theCriterion.Compare == FT_EqualTo ||
|
if (theCriterion.Compare == FT_EqualTo ||
|
||||||
theCriterion.Type == FT_BelongToPlane ||
|
theCriterion.Type == FT_BelongToPlane ||
|
||||||
@ -1352,7 +1360,7 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
|
|||||||
const int theType)
|
const int theType)
|
||||||
{
|
{
|
||||||
// create table
|
// create table
|
||||||
Table* aTable= new Table(0, 5, theParent);
|
Table* aTable= new Table(0, 6, theParent);
|
||||||
|
|
||||||
QHeader* aHeaders = aTable->horizontalHeader();
|
QHeader* aHeaders = aTable->horizontalHeader();
|
||||||
|
|
||||||
@ -1383,11 +1391,15 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar
|
|||||||
aHeaders->setLabel(2, tr("THRESHOLD_VALUE"));
|
aHeaders->setLabel(2, tr("THRESHOLD_VALUE"));
|
||||||
aHeaders->setLabel(3, tr("UNARY"));
|
aHeaders->setLabel(3, tr("UNARY"));
|
||||||
aHeaders->setLabel(4, tr("BINARY") + " ");
|
aHeaders->setLabel(4, tr("BINARY") + " ");
|
||||||
|
aHeaders->setLabel( 5, tr( "ID" ) );
|
||||||
|
|
||||||
// set geometry of the table
|
// set geometry of the table
|
||||||
for (int i = 0; i <= 4; i++)
|
for (int i = 0; i <= 4; i++)
|
||||||
aTable->adjustColumn(i);
|
aTable->adjustColumn(i);
|
||||||
|
|
||||||
|
// set the ID column invisible
|
||||||
|
aTable->hideColumn( 5 );
|
||||||
|
|
||||||
aTable->updateGeometry();
|
aTable->updateGeometry();
|
||||||
QSize aSize = aTable->sizeHint();
|
QSize aSize = aTable->sizeHint();
|
||||||
int aWidth = aSize.width();
|
int aWidth = aSize.width();
|
||||||
@ -1589,6 +1601,37 @@ bool SMESHGUI_FilterTable::GetThreshold (const int theRow,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// name : SMESHGUI_FilterTable::SetID
|
||||||
|
// Purpose : Set text and internal value in cell of ID value
|
||||||
|
//=======================================================================
|
||||||
|
void SMESHGUI_FilterTable::SetID( const int theRow,
|
||||||
|
const QString& theText,
|
||||||
|
const int theEntityType )
|
||||||
|
{
|
||||||
|
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
|
||||||
|
aTable->setText( theRow, 5, theText );
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// name : SMESHGUI_FilterTable::GetID
|
||||||
|
// Purpose : Get text and internal value from cell of ID value
|
||||||
|
//=======================================================================
|
||||||
|
bool SMESHGUI_FilterTable::GetID( const int theRow,
|
||||||
|
QString& theText,
|
||||||
|
const int theEntityType )
|
||||||
|
{
|
||||||
|
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
|
||||||
|
QTableItem* anItem = aTable->item( theRow, 5 );
|
||||||
|
if ( anItem != 0 )
|
||||||
|
{
|
||||||
|
theText = anItem->text();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : SMESHGUI_FilterDlg
|
Class : SMESHGUI_FilterDlg
|
||||||
Description : Dialog to specify filters for VTK viewer
|
Description : Dialog to specify filters for VTK viewer
|
||||||
@ -2425,6 +2468,7 @@ SMESH::Filter::Criterion SMESHGUI_FilterDlg::createCriterion()
|
|||||||
aCriterion.UnaryOp = FT_Undefined;
|
aCriterion.UnaryOp = FT_Undefined;
|
||||||
aCriterion.BinaryOp = FT_Undefined;
|
aCriterion.BinaryOp = FT_Undefined;
|
||||||
aCriterion.ThresholdStr = "";
|
aCriterion.ThresholdStr = "";
|
||||||
|
aCriterion.ThresholdID = "";
|
||||||
aCriterion.TypeOfElement = SMESH::ALL;
|
aCriterion.TypeOfElement = SMESH::ALL;
|
||||||
|
|
||||||
return aCriterion;
|
return aCriterion;
|
||||||
@ -2452,7 +2496,10 @@ void SMESHGUI_FilterDlg::onSelectionDone()
|
|||||||
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
||||||
GEOM::GEOM_Object_var anObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
|
GEOM::GEOM_Object_var anObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
|
||||||
if (!anObj->_is_nil())
|
if (!anObj->_is_nil())
|
||||||
|
{
|
||||||
myTable->SetThreshold(aRow, GEOMBase::GetName(anObj));
|
myTable->SetThreshold(aRow, GEOMBase::GetName(anObj));
|
||||||
|
myTable->SetID( aRow, GEOMBase::GetIORFromObject(anObj));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -130,6 +130,14 @@ public:
|
|||||||
QString& theText,
|
QString& theText,
|
||||||
const int theEntityType = -1);
|
const int theEntityType = -1);
|
||||||
|
|
||||||
|
void SetID( const int theRow,
|
||||||
|
const QString& theText,
|
||||||
|
const int theEntityType = -1 );
|
||||||
|
|
||||||
|
bool GetID( const int theRow,
|
||||||
|
QString& theText,
|
||||||
|
const int theEntityType = -1 );
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -363,6 +363,7 @@ static SMESH::Filter::Criterion createCriterion()
|
|||||||
aCriterion.UnaryOp = FT_Undefined;
|
aCriterion.UnaryOp = FT_Undefined;
|
||||||
aCriterion.BinaryOp = FT_Undefined;
|
aCriterion.BinaryOp = FT_Undefined;
|
||||||
aCriterion.ThresholdStr = "";
|
aCriterion.ThresholdStr = "";
|
||||||
|
aCriterion.ThresholdID = "";
|
||||||
aCriterion.Tolerance = Precision::Confusion();
|
aCriterion.Tolerance = Precision::Confusion();
|
||||||
aCriterion.TypeOfElement = SMESH::ALL;
|
aCriterion.TypeOfElement = SMESH::ALL;
|
||||||
aCriterion.Precision = -1;
|
aCriterion.Precision = -1;
|
||||||
@ -395,7 +396,50 @@ static TopoDS_Shape getShapeByName( const char* theName )
|
|||||||
return TopoDS_Shape();
|
return TopoDS_Shape();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TopoDS_Shape getShapeByID( const char* theID )
|
||||||
|
{
|
||||||
|
if ( theID != 0 && theID!="" )
|
||||||
|
{
|
||||||
|
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
|
||||||
|
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
|
||||||
|
if ( aStudy != 0 )
|
||||||
|
{
|
||||||
|
CORBA::Object_var obj = aStudy->ConvertIORToObject(theID);
|
||||||
|
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( obj );
|
||||||
|
|
||||||
|
if ( !aGeomObj->_is_nil() )
|
||||||
|
{
|
||||||
|
GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
|
||||||
|
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, aGeomObj );
|
||||||
|
return aLocShape;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TopoDS_Shape();
|
||||||
|
}
|
||||||
|
|
||||||
|
static char* getShapeNameByID ( const char* theID )
|
||||||
|
{
|
||||||
|
char* aName = "";
|
||||||
|
|
||||||
|
if ( theID != 0 && theID!="" )
|
||||||
|
{
|
||||||
|
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
|
||||||
|
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
|
||||||
|
if ( aStudy != 0 )
|
||||||
|
{
|
||||||
|
SALOMEDS::SObject_var aSObj = aStudy->FindObjectIOR( theID );
|
||||||
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
|
if ( !aSObj->_is_nil() && aSObj->FindAttribute( anAttr, "AttributeName") )
|
||||||
|
{
|
||||||
|
SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
|
||||||
|
aName = aNameAttr->Value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aName;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FUNCTORS
|
FUNCTORS
|
||||||
@ -734,11 +778,13 @@ BelongToGeom_i::BelongToGeom_i()
|
|||||||
myBelongToGeomPtr.reset( new Controls::BelongToGeom() );
|
myBelongToGeomPtr.reset( new Controls::BelongToGeom() );
|
||||||
myFunctorPtr = myPredicatePtr = myBelongToGeomPtr;
|
myFunctorPtr = myPredicatePtr = myBelongToGeomPtr;
|
||||||
myShapeName = 0;
|
myShapeName = 0;
|
||||||
|
myShapeID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BelongToGeom_i::~BelongToGeom_i()
|
BelongToGeom_i::~BelongToGeom_i()
|
||||||
{
|
{
|
||||||
delete myShapeName;
|
delete myShapeName;
|
||||||
|
delete myShapeID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BelongToGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
|
void BelongToGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
|
||||||
@ -775,11 +821,32 @@ void BelongToGeom_i::SetShapeName( const char* theName )
|
|||||||
TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
|
TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BelongToGeom_i::SetShape( const char* theID, const char* theName )
|
||||||
|
{
|
||||||
|
delete myShapeName;
|
||||||
|
myShapeName = strdup( theName );
|
||||||
|
delete myShapeID;
|
||||||
|
if ( theID )
|
||||||
|
myShapeID = strdup( theID );
|
||||||
|
else
|
||||||
|
myShapeID = 0;
|
||||||
|
|
||||||
|
if ( myShapeID && strcmp(myShapeName, getShapeNameByID(myShapeID)) == 0 )
|
||||||
|
myBelongToGeomPtr->SetGeom( getShapeByID(myShapeID) );
|
||||||
|
else
|
||||||
|
myBelongToGeomPtr->SetGeom( getShapeByName( myShapeName ) );
|
||||||
|
}
|
||||||
|
|
||||||
char* BelongToGeom_i::GetShapeName()
|
char* BelongToGeom_i::GetShapeName()
|
||||||
{
|
{
|
||||||
return CORBA::string_dup( myShapeName );
|
return CORBA::string_dup( myShapeName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* BelongToGeom_i::GetShapeID()
|
||||||
|
{
|
||||||
|
return CORBA::string_dup( myShapeID );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : BelongToSurface_i
|
Class : BelongToSurface_i
|
||||||
Description : Predicate for selection on geometrical support
|
Description : Predicate for selection on geometrical support
|
||||||
@ -789,12 +856,14 @@ BelongToSurface_i::BelongToSurface_i( const Handle(Standard_Type)& theSurfaceTyp
|
|||||||
myElementsOnSurfacePtr.reset( new Controls::ElementsOnSurface() );
|
myElementsOnSurfacePtr.reset( new Controls::ElementsOnSurface() );
|
||||||
myFunctorPtr = myPredicatePtr = myElementsOnSurfacePtr;
|
myFunctorPtr = myPredicatePtr = myElementsOnSurfacePtr;
|
||||||
myShapeName = 0;
|
myShapeName = 0;
|
||||||
|
myShapeID = 0;
|
||||||
mySurfaceType = theSurfaceType;
|
mySurfaceType = theSurfaceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
BelongToSurface_i::~BelongToSurface_i()
|
BelongToSurface_i::~BelongToSurface_i()
|
||||||
{
|
{
|
||||||
delete myShapeName;
|
delete myShapeName;
|
||||||
|
delete myShapeID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BelongToSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
|
void BelongToSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
|
||||||
@ -827,11 +896,32 @@ void BelongToSurface_i::SetShapeName( const char* theName, ElementType theType )
|
|||||||
TPythonDump()<<this<<".SetShapeName('"<<theName<<"',"<<theType<<")";
|
TPythonDump()<<this<<".SetShapeName('"<<theName<<"',"<<theType<<")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BelongToSurface_i::SetShape( const char* theID, const char* theName, ElementType theType )
|
||||||
|
{
|
||||||
|
delete myShapeName;
|
||||||
|
myShapeName = strdup( theName );
|
||||||
|
delete myShapeID;
|
||||||
|
if ( theID )
|
||||||
|
myShapeID = strdup( theID );
|
||||||
|
else
|
||||||
|
myShapeID = 0;
|
||||||
|
|
||||||
|
if ( myShapeID && strcmp(myShapeName, getShapeNameByID(myShapeID)) == 0 )
|
||||||
|
myElementsOnSurfacePtr->SetSurface( getShapeByID(myShapeID), (SMDSAbs_ElementType)theType );
|
||||||
|
else
|
||||||
|
myElementsOnSurfacePtr->SetSurface( getShapeByName( myShapeName ), (SMDSAbs_ElementType)theType );
|
||||||
|
}
|
||||||
|
|
||||||
char* BelongToSurface_i::GetShapeName()
|
char* BelongToSurface_i::GetShapeName()
|
||||||
{
|
{
|
||||||
return CORBA::string_dup( myShapeName );
|
return CORBA::string_dup( myShapeName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* BelongToSurface_i::GetShapeID()
|
||||||
|
{
|
||||||
|
return CORBA::string_dup( myShapeID );
|
||||||
|
}
|
||||||
|
|
||||||
void BelongToSurface_i::SetTolerance( CORBA::Double theToler )
|
void BelongToSurface_i::SetTolerance( CORBA::Double theToler )
|
||||||
{
|
{
|
||||||
myElementsOnSurfacePtr->SetTolerance( theToler );
|
myElementsOnSurfacePtr->SetTolerance( theToler );
|
||||||
@ -894,11 +984,13 @@ LyingOnGeom_i::LyingOnGeom_i()
|
|||||||
myLyingOnGeomPtr.reset( new Controls::LyingOnGeom() );
|
myLyingOnGeomPtr.reset( new Controls::LyingOnGeom() );
|
||||||
myFunctorPtr = myPredicatePtr = myLyingOnGeomPtr;
|
myFunctorPtr = myPredicatePtr = myLyingOnGeomPtr;
|
||||||
myShapeName = 0;
|
myShapeName = 0;
|
||||||
|
myShapeID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LyingOnGeom_i::~LyingOnGeom_i()
|
LyingOnGeom_i::~LyingOnGeom_i()
|
||||||
{
|
{
|
||||||
delete myShapeName;
|
delete myShapeName;
|
||||||
|
delete myShapeID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LyingOnGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
|
void LyingOnGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
|
||||||
@ -935,11 +1027,32 @@ void LyingOnGeom_i::SetShapeName( const char* theName )
|
|||||||
TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
|
TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LyingOnGeom_i::SetShape( const char* theID, const char* theName )
|
||||||
|
{
|
||||||
|
delete myShapeName;
|
||||||
|
myShapeName = strdup( theName );
|
||||||
|
delete myShapeID;
|
||||||
|
if ( theID )
|
||||||
|
myShapeID = strdup( theID );
|
||||||
|
else
|
||||||
|
myShapeID = 0;
|
||||||
|
|
||||||
|
if ( myShapeID && strcmp(myShapeName, getShapeNameByID(myShapeID)) == 0 )
|
||||||
|
myLyingOnGeomPtr->SetGeom( getShapeByID(myShapeID) );
|
||||||
|
else
|
||||||
|
myLyingOnGeomPtr->SetGeom( getShapeByName( myShapeName ) );
|
||||||
|
}
|
||||||
|
|
||||||
char* LyingOnGeom_i::GetShapeName()
|
char* LyingOnGeom_i::GetShapeName()
|
||||||
{
|
{
|
||||||
return CORBA::string_dup( myShapeName );
|
return CORBA::string_dup( myShapeName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* LyingOnGeom_i::GetShapeID()
|
||||||
|
{
|
||||||
|
return CORBA::string_dup( myShapeID );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : FreeBorders_i
|
Class : FreeBorders_i
|
||||||
Description : Predicate for free borders
|
Description : Predicate for free borders
|
||||||
@ -1733,6 +1846,7 @@ static inline bool getCriteria( Predicate_i* thePred,
|
|||||||
|
|
||||||
theCriteria[ i ].Type = FT_BelongToGeom;
|
theCriteria[ i ].Type = FT_BelongToGeom;
|
||||||
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
|
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
|
||||||
|
theCriteria[ i ].ThresholdID = aPred->GetShapeID();
|
||||||
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
|
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1749,6 +1863,7 @@ static inline bool getCriteria( Predicate_i* thePred,
|
|||||||
|
|
||||||
theCriteria[ i ].Type = aFType;
|
theCriteria[ i ].Type = aFType;
|
||||||
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
|
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
|
||||||
|
theCriteria[ i ].ThresholdID = aPred->GetShapeID();
|
||||||
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
|
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
|
||||||
theCriteria[ i ].Tolerance = aPred->GetTolerance();
|
theCriteria[ i ].Tolerance = aPred->GetTolerance();
|
||||||
|
|
||||||
@ -1765,6 +1880,7 @@ static inline bool getCriteria( Predicate_i* thePred,
|
|||||||
|
|
||||||
theCriteria[ i ].Type = FT_LyingOnGeom;
|
theCriteria[ i ].Type = FT_LyingOnGeom;
|
||||||
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
|
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
|
||||||
|
theCriteria[ i ].ThresholdID = aPred->GetShapeID();
|
||||||
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
|
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1885,6 +2001,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
|||||||
int aBinary = theCriteria[ i ].BinaryOp;
|
int aBinary = theCriteria[ i ].BinaryOp;
|
||||||
double aTolerance = theCriteria[ i ].Tolerance;
|
double aTolerance = theCriteria[ i ].Tolerance;
|
||||||
const char* aThresholdStr = theCriteria[ i ].ThresholdStr;
|
const char* aThresholdStr = theCriteria[ i ].ThresholdStr;
|
||||||
|
const char* aThresholdID = theCriteria[ i ].ThresholdID;
|
||||||
ElementType aTypeOfElem = theCriteria[ i ].TypeOfElement;
|
ElementType aTypeOfElem = theCriteria[ i ].TypeOfElement;
|
||||||
long aPrecision = theCriteria[ i ].Precision;
|
long aPrecision = theCriteria[ i ].Precision;
|
||||||
|
|
||||||
@ -1948,7 +2065,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
|||||||
{
|
{
|
||||||
SMESH::BelongToGeom_ptr tmpPred = aFilterMgr->CreateBelongToGeom();
|
SMESH::BelongToGeom_ptr tmpPred = aFilterMgr->CreateBelongToGeom();
|
||||||
tmpPred->SetElementType( aTypeOfElem );
|
tmpPred->SetElementType( aTypeOfElem );
|
||||||
tmpPred->SetShapeName( aThresholdStr );
|
tmpPred->SetShape( aThresholdID, aThresholdStr );
|
||||||
aPredicate = tmpPred;
|
aPredicate = tmpPred;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1960,7 +2077,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
|||||||
tmpPred = aFilterMgr->CreateBelongToPlane();
|
tmpPred = aFilterMgr->CreateBelongToPlane();
|
||||||
else
|
else
|
||||||
tmpPred = aFilterMgr->CreateBelongToCylinder();
|
tmpPred = aFilterMgr->CreateBelongToCylinder();
|
||||||
tmpPred->SetShapeName( aThresholdStr, aTypeOfElem );
|
tmpPred->SetShape( aThresholdID, aThresholdStr, aTypeOfElem );
|
||||||
tmpPred->SetTolerance( aTolerance );
|
tmpPred->SetTolerance( aTolerance );
|
||||||
aPredicate = tmpPred;
|
aPredicate = tmpPred;
|
||||||
}
|
}
|
||||||
@ -1969,7 +2086,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
|||||||
{
|
{
|
||||||
SMESH::LyingOnGeom_ptr tmpPred = aFilterMgr->CreateLyingOnGeom();
|
SMESH::LyingOnGeom_ptr tmpPred = aFilterMgr->CreateLyingOnGeom();
|
||||||
tmpPred->SetElementType( aTypeOfElem );
|
tmpPred->SetElementType( aTypeOfElem );
|
||||||
tmpPred->SetShapeName( aThresholdStr );
|
tmpPred->SetShape( aThresholdID, aThresholdStr );
|
||||||
aPredicate = tmpPred;
|
aPredicate = tmpPred;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -360,11 +360,14 @@ namespace SMESH
|
|||||||
void SetGeom( const TopoDS_Shape& theShape );
|
void SetGeom( const TopoDS_Shape& theShape );
|
||||||
|
|
||||||
void SetShapeName( const char* theName );
|
void SetShapeName( const char* theName );
|
||||||
|
void SetShape( const char* theID, const char* theName );
|
||||||
char* GetShapeName();
|
char* GetShapeName();
|
||||||
|
char* GetShapeID();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Controls::BelongToGeomPtr myBelongToGeomPtr;
|
Controls::BelongToGeomPtr myBelongToGeomPtr;
|
||||||
char* myShapeName;
|
char* myShapeName;
|
||||||
|
char* myShapeID;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -381,7 +384,9 @@ namespace SMESH
|
|||||||
void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
|
void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
|
||||||
|
|
||||||
void SetShapeName( const char* theName, ElementType theType );
|
void SetShapeName( const char* theName, ElementType theType );
|
||||||
|
void SetShape( const char* theID, const char* theName, ElementType theType );
|
||||||
char* GetShapeName();
|
char* GetShapeName();
|
||||||
|
char* GetShapeID();
|
||||||
|
|
||||||
void SetTolerance( CORBA::Double );
|
void SetTolerance( CORBA::Double );
|
||||||
CORBA::Double GetTolerance();
|
CORBA::Double GetTolerance();
|
||||||
@ -389,6 +394,7 @@ namespace SMESH
|
|||||||
protected:
|
protected:
|
||||||
Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
|
Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
|
||||||
char* myShapeName;
|
char* myShapeName;
|
||||||
|
char* myShapeID;
|
||||||
Handle(Standard_Type) mySurfaceType;
|
Handle(Standard_Type) mySurfaceType;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -436,11 +442,14 @@ namespace SMESH
|
|||||||
void SetGeom( const TopoDS_Shape& theShape );
|
void SetGeom( const TopoDS_Shape& theShape );
|
||||||
|
|
||||||
void SetShapeName( const char* theName );
|
void SetShapeName( const char* theName );
|
||||||
|
void SetShape( const char* theID, const char* theName );
|
||||||
char* GetShapeName();
|
char* GetShapeName();
|
||||||
|
char* GetShapeID();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Controls::LyingOnGeomPtr myLyingOnGeomPtr;
|
Controls::LyingOnGeomPtr myLyingOnGeomPtr;
|
||||||
char* myShapeName;
|
char* myShapeName;
|
||||||
|
char* myShapeID;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user