mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-31 22:37:48 +05:00
NPAL 18378
This commit is contained in:
parent
0625016025
commit
c5830a8430
@ -299,12 +299,18 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -486,3 +492,27 @@ void BasicGUI_ArcDlg::ReverseSense(int sense)
|
|||||||
{
|
{
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[Group3Pnts->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[Group3Pnts->LineEdit2->text()] = myPoint2;
|
||||||
|
objMap[Group3Pnts->LineEdit3->text()] = myPoint3;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[Group3Pnts2->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[Group3Pnts2->LineEdit2->text()] = myPoint2;
|
||||||
|
objMap[Group3Pnts2->LineEdit3->text()] = myPoint3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -56,6 +56,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -328,18 +328,21 @@ void BasicGUI_CircleDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(anIO, aMap);
|
aSelMgr->GetIndexes(anIO, aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
TopTools_IndexedMapOfShape aShapes;
|
|
||||||
TopExp::MapShapes(aShape, aShapes);
|
|
||||||
aShape = aShapes.FindKey(anIndex);
|
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -555,3 +558,31 @@ void BasicGUI_CircleDlg::closeEvent (QCloseEvent* e)
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::closeEvent(e);
|
GEOMBase_Skeleton::closeEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPntVecR->LineEdit1->text()] = myPoint;
|
||||||
|
objMap[GroupPntVecR->LineEdit2->text()] = myDir;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[Group3Pnts->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[Group3Pnts->LineEdit2->text()] = myPoint2;
|
||||||
|
objMap[Group3Pnts->LineEdit3->text()] = myPoint3;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
objMap[GroupCenter2Pnts->LineEdit1->text()] = myPoint4;
|
||||||
|
objMap[GroupCenter2Pnts->LineEdit2->text()] = myPoint5;
|
||||||
|
objMap[GroupCenter2Pnts->LineEdit3->text()] = myPoint6;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -60,8 +60,8 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -231,15 +231,21 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(anIO, aMap);
|
aSelMgr->GetIndexes(anIO, aMap);
|
||||||
if (aMap.Extent() == 1)
|
if (aMap.Extent() == 1)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
} else {
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -398,3 +404,16 @@ void BasicGUI_EllipseDlg::closeEvent( QCloseEvent* e )
|
|||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myDir;
|
||||||
|
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -58,8 +58,8 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -172,6 +172,7 @@ void BasicGUI_LineDlg::ClickOnCancel()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool BasicGUI_LineDlg::ClickOnApply()
|
bool BasicGUI_LineDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( !onAccept() )
|
if ( !onAccept() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -244,7 +245,7 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
|
|||||||
if (!CORBA::is_nil(aSelectedObject) && aRes)
|
if (!CORBA::is_nil(aSelectedObject) && aRes)
|
||||||
{
|
{
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
QString aName = GEOMBase::GetName(aSelectedObject);
|
||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
|
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
|
||||||
{
|
{
|
||||||
@ -258,15 +259,21 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
int anIndex = aMap( 1 );
|
||||||
int anIndex = aMap( 1 );
|
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_FACE)
|
if (aNeedType == TopAbs_FACE)
|
||||||
aName += QString(":face_%1").arg(anIndex);
|
aName += QString(":face_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -410,3 +417,20 @@ void BasicGUI_LineDlg::closeEvent( QCloseEvent* e )
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
if (getConstructorId() != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myPoint2;
|
||||||
|
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -57,6 +57,7 @@ protected:
|
|||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -451,14 +451,14 @@ void BasicGUI_MarkerDlg::onSelectionDone()
|
|||||||
|
|
||||||
if (!aMap.IsEmpty()) {
|
if (!aMap.IsEmpty()) {
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
TopTools_IndexedMapOfShape aShapes;
|
|
||||||
TopExp::MapShapes(aShape, aShapes);
|
|
||||||
aShape = aShapes.FindKey(anIndex);
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString("_edge_%1").arg(anIndex);
|
aName += QString("_edge_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString("_vertex_%1").arg(anIndex);
|
aName += QString("_vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
TopTools_IndexedMapOfShape aShapes;
|
||||||
|
TopExp::MapShapes(aShape, aShapes);
|
||||||
|
aShape = aShapes.FindKey(anIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myEditCurrentArgument == Group2->LineEdit1) {
|
if (myEditCurrentArgument == Group2->LineEdit1) {
|
||||||
|
@ -335,17 +335,24 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
|
int anIndex = aMap(1);
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
else if (aNeedType == TopAbs_FACE)
|
else if (aNeedType == TopAbs_FACE)
|
||||||
aName += QString(":face_%1").arg(anIndex);
|
aName += QString(":face_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -563,3 +570,28 @@ void BasicGUI_PlaneDlg::closeEvent( QCloseEvent* e )
|
|||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPntDir->LineEdit1->text()] = myPoint;
|
||||||
|
objMap[GroupPntDir->LineEdit2->text()] = myDir;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[Group3Pnts->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[Group3Pnts->LineEdit2->text()] = myPoint2;
|
||||||
|
objMap[Group3Pnts->LineEdit3->text()] = myPoint3;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
objMap[GroupFace->LineEdit1->text()] = myFace;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -57,7 +57,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
@ -386,15 +386,21 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -669,3 +675,29 @@ void BasicGUI_PointDlg::closeEvent( QCloseEvent* e )
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
|
||||||
|
objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -64,7 +64,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
@ -287,12 +287,19 @@ void BasicGUI_VectorDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
|
int anIndex = aMap(1);
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -447,3 +454,23 @@ bool BasicGUI_VectorDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myPoint2;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -223,7 +223,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
|
|||||||
|
|
||||||
myEditCurrentArgument = Group2->LineEdit1;
|
myEditCurrentArgument = Group2->LineEdit1;
|
||||||
Group2->LineEdit1->setText("");
|
Group2->LineEdit1->setText("");
|
||||||
Group2->LineEdit2->setText("");
|
Group2->LineEdit2->setText("");
|
||||||
myVectX = GEOM::GEOM_Object::_nil();
|
myVectX = GEOM::GEOM_Object::_nil();
|
||||||
myVectZ = GEOM::GEOM_Object::_nil();
|
myVectZ = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
@ -328,17 +328,15 @@ void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
TopTools_IndexedMapOfShape aShapes;
|
|
||||||
TopExp::MapShapes( aShape, aShapes );
|
|
||||||
aShape = aShapes.FindKey( anIndex );
|
|
||||||
aName = aName + ":edge_" + QString::number( anIndex );
|
aName = aName + ":edge_" + QString::number( anIndex );
|
||||||
if(myEditCurrentArgument == Group2->LineEdit1)
|
|
||||||
myVectX = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
else
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
myVectZ = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
if(myEditCurrentArgument == Group2->LineEdit1)
|
||||||
|
myVectX = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
else
|
||||||
|
myVectZ = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (myEditCurrentArgument == Group2->LineEdit1)
|
if (myEditCurrentArgument == Group2->LineEdit1)
|
||||||
@ -581,3 +579,4 @@ bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -770,6 +770,7 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
|
|||||||
showError();
|
showError();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
addSubshapesToStudy(); // add Subshapes if local selection
|
||||||
const int nbObjs = objects.size();
|
const int nbObjs = objects.size();
|
||||||
int aNumber = 1;
|
int aNumber = 1;
|
||||||
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
|
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
|
||||||
@ -1025,8 +1026,74 @@ bool GEOMBase_Helper::selectObjects( ObjectList& objects )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : findObjectInFather
|
||||||
|
// Purpose : It should return an object if its founded in study or
|
||||||
|
// return Null object if the object is not founded
|
||||||
|
//================================================================
|
||||||
|
GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr theFather, const char* theName)
|
||||||
|
{
|
||||||
|
SalomeApp_Application* app =
|
||||||
|
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
|
_PTR(Study) aDStudy = appStudy->studyDS();
|
||||||
|
string IOR = GEOMBase::GetIORFromObject( theFather );
|
||||||
|
_PTR(SObject) SObj ( aDStudy->FindObjectIOR( IOR ) );
|
||||||
|
|
||||||
|
bool inStudy = false;
|
||||||
|
GEOM::GEOM_Object_var aReturnObject;
|
||||||
|
for (_PTR(ChildIterator) iit (aDStudy->NewChildIterator( SObj )); iit->More(); iit->Next()) {
|
||||||
|
_PTR(SObject) child (iit->Value());
|
||||||
|
QString aChildName = child->GetName();
|
||||||
|
if (aChildName == theName) {
|
||||||
|
inStudy = true;
|
||||||
|
CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(iit->Value());
|
||||||
|
aReturnObject = GEOM::GEOM_Object::_narrow( corbaObj );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!inStudy)
|
||||||
|
return GEOM::GEOM_Object::_nil();
|
||||||
|
else
|
||||||
|
return aReturnObject._retn();
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : addSubshapesToStudy
|
||||||
|
// Purpose : Virtual method to add subshapes if needs
|
||||||
|
//================================================================
|
||||||
|
void GEOMBase_Helper::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
//Impemented in Dialogs, called from Accept method
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : addSubshapesToFather
|
||||||
|
// Purpose : Method to add Father Subshapes to Study if it`s not exist
|
||||||
|
//================================================================
|
||||||
|
void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>& theMap )
|
||||||
|
{
|
||||||
|
//GetStudyDS
|
||||||
|
SalomeApp_Application* app =
|
||||||
|
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
|
_PTR(Study) aDStudy = appStudy->studyDS();
|
||||||
|
|
||||||
|
GEOM::GEOM_IGroupOperations_var anOp = getGeomEngine()->GetIGroupOperations( getStudyId() );
|
||||||
|
|
||||||
|
for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ )
|
||||||
|
{
|
||||||
|
if ( !anOp->_is_nil() ) {
|
||||||
|
GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.data() );
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key() );
|
||||||
|
|
||||||
|
//Add Object to study if its not exist
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() )
|
||||||
|
GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy),
|
||||||
|
it.data(), it.key(), aFatherObj );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//cout << " anOperations is NULL! " << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
|||||||
#include CORBA_CLIENT_HEADER(GEOM_Gen)
|
#include CORBA_CLIENT_HEADER(GEOM_Gen)
|
||||||
|
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
|
#include <qmap.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
//#if defined WNT
|
//#if defined WNT
|
||||||
@ -182,6 +183,12 @@ protected:
|
|||||||
// as a top-level object.
|
// as a top-level object.
|
||||||
|
|
||||||
virtual const char* getNewObjectName() const;
|
virtual const char* getNewObjectName() const;
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr theFather, const char* theName );
|
||||||
|
//This Metod to find SubObject in theFather Object by Name (theName)
|
||||||
|
|
||||||
|
void addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>& theMap );
|
||||||
|
|
||||||
void SetIsPreview(const bool thePreview) {isPreview = thePreview;}
|
void SetIsPreview(const bool thePreview) {isPreview = thePreview;}
|
||||||
bool IsPreview() {return isPreview;}
|
bool IsPreview() {return isPreview;}
|
||||||
|
@ -218,13 +218,22 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
myPath = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aName.append( ":edge_" + QString::number( anIndex ) );
|
aName.append( ":edge_" + QString::number( anIndex ) );
|
||||||
myOkPath = true;
|
|
||||||
aSelMgr->clearSelected();
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
myPath = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
myOkPath = true;
|
||||||
|
}
|
||||||
|
else { // get Object from study
|
||||||
|
myPath = aFindedObject;
|
||||||
|
myOkPath = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myOkPath = true;
|
myOkPath = true;
|
||||||
@ -343,5 +352,16 @@ bool GenerationGUI_PipeDlg::execute( ObjectList& objects )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PipeDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myPath;
|
||||||
|
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& msg );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -299,12 +299,19 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aName.append( ":edge_" + QString::number( anIndex ) );
|
aName.append( ":edge_" + QString::number( anIndex ) );
|
||||||
aSelMgr->clearSelected();
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints->LineEdit2) {
|
if (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||||
@ -359,11 +366,18 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if (aMap.Extent() == 1)
|
if (aMap.Extent() == 1)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aName.append(":vertex_" + QString::number(anIndex));
|
aName.append(":vertex_" + QString::number(anIndex));
|
||||||
aSelMgr->clearSelected();
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -585,3 +599,24 @@ void GenerationGUI_PrismDlg::onBothway2()
|
|||||||
myBothway2 = !anOldValue;
|
myBothway2 = !anOldValue;
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_PrismDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myVec;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupPoints2->LineEdit2->text()] = myPoint1;
|
||||||
|
objMap[GroupPoints2->LineEdit3->text()] = myPoint2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& msg );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -248,12 +248,23 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName.append( ":edge_" + QString::number( anIndex ) );
|
aName.append( ":edge_" + QString::number( anIndex ) );
|
||||||
myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
myOkAxis = true;
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
myOkAxis = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myAxis = aFindedObject;
|
||||||
|
myOkAxis = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myOkAxis = true;
|
myOkAxis = true;
|
||||||
@ -417,3 +428,16 @@ void GenerationGUI_RevolDlg::onBothway()
|
|||||||
GroupPoints->CheckButton2->setEnabled(!myBothway);
|
GroupPoints->CheckButton2->setEnabled(!myBothway);
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void GenerationGUI_RevolDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myAxis;
|
||||||
|
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -51,6 +51,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& msg );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -725,7 +725,7 @@ void OperationGUI_ChamferDlg::activateSelection()
|
|||||||
myEditCurrentArgument == mySelName[ Faces ] ) )
|
myEditCurrentArgument == mySelName[ Faces ] ) )
|
||||||
localSelection( myShape, TopAbs_FACE );
|
localSelection( myShape, TopAbs_FACE );
|
||||||
else if (!myShape->_is_nil() && myEditCurrentArgument == mySelName[ Edges ] )
|
else if (!myShape->_is_nil() && myEditCurrentArgument == mySelName[ Edges ] )
|
||||||
localSelection( myShape, TopAbs_EDGE );
|
localSelection( myShape, TopAbs_EDGE );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TColStd_MapOfInteger aMap;
|
TColStd_MapOfInteger aMap;
|
||||||
|
@ -260,12 +260,19 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName.append( ":vertex_" + QString::number( anIndex ) );
|
aName.append( ":vertex_" + QString::number( anIndex ) );
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -424,3 +431,18 @@ void PrimitiveGUI_BoxDlg::closeEvent( QCloseEvent* e )
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void PrimitiveGUI_BoxDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
if ( getConstructorId() == 0 )
|
||||||
|
{
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint1;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myPoint2;
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -52,7 +52,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
@ -290,17 +290,22 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if (aMap.Extent() == 1)
|
if (aMap.Extent() == 1)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
|
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName.append(":edge_" + QString::number(anIndex));
|
aName.append(":edge_" + QString::number(anIndex));
|
||||||
else
|
else
|
||||||
aName.append(":vertex_" + QString::number(anIndex));
|
aName.append(":vertex_" + QString::number(anIndex));
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -516,3 +521,23 @@ double PrimitiveGUI_ConeDlg::getHeight() const
|
|||||||
return GroupDimensions->SpinBox_DZ->GetValue();
|
return GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void PrimitiveGUI_ConeDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myDir;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -50,7 +50,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -284,16 +284,22 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations(getStudyId());
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected(); // ???
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName.append(":edge_" + QString::number(anIndex));
|
aName.append(":edge_" + QString::number(anIndex));
|
||||||
else
|
else
|
||||||
aName.append(":vertex_" + QString::number(anIndex));
|
aName.append(":vertex_" + QString::number(anIndex));
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -487,3 +493,23 @@ double PrimitiveGUI_CylinderDlg::getHeight() const
|
|||||||
return GroupDimensions->SpinBox_DY->GetValue();
|
return GroupDimensions->SpinBox_DY->GetValue();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void PrimitiveGUI_CylinderDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myDir;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -51,7 +51,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -248,13 +248,19 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected();
|
|
||||||
|
|
||||||
aName.append( ":vertex_" + QString::number( anIndex ) );
|
aName.append( ":vertex_" + QString::number( anIndex ) );
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -419,3 +425,22 @@ double PrimitiveGUI_SphereDlg::getRadius() const
|
|||||||
return GroupDimensions->SpinBox_DX->GetValue();
|
return GroupDimensions->SpinBox_DX->GetValue();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void PrimitiveGUI_SphereDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -51,7 +51,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -275,17 +275,22 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(firstIObject(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
|
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected();
|
|
||||||
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName.append(":edge_" + QString::number(anIndex));
|
aName.append(":edge_" + QString::number(anIndex));
|
||||||
else
|
else
|
||||||
aName.append(":vertex_" + QString::number(anIndex));
|
aName.append(":vertex_" + QString::number(anIndex));
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
{
|
{
|
||||||
@ -464,3 +469,23 @@ double PrimitiveGUI_TorusDlg::getRadius2() const
|
|||||||
return GroupDimensions->SpinBox_DY->GetValue();
|
return GroupDimensions->SpinBox_DY->GetValue();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void PrimitiveGUI_TorusDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit1->text()] = myPoint;
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myDir;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -51,6 +51,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -259,17 +259,22 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
int id = getConstructorId();
|
|
||||||
if (aNeedType == TopAbs_VERTEX)
|
if (aNeedType == TopAbs_VERTEX)
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
|
|
||||||
myArgument = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
//Find SubShape Object in Father
|
||||||
aSelMgr->clearSelected();
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
myArgument = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
myArgument = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (aShape.ShapeType() != aNeedType) {
|
if (aShape.ShapeType() != aNeedType) {
|
||||||
@ -478,3 +483,28 @@ void TransformationGUI_MirrorDlg::CreateCopyModeChanged(bool isCreateCopy)
|
|||||||
{
|
{
|
||||||
this->GroupBoxName->setEnabled(isCreateCopy);
|
this->GroupBoxName->setEnabled(isCreateCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void TransformationGUI_MirrorDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
|
||||||
|
if (toCreateCopy) {
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myArgument;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myArgument;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -52,7 +52,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -305,23 +305,30 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
|||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
|
int anIndex = aMap( 1 );
|
||||||
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
int anIndex = aMap( 1 );
|
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
|
||||||
myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
aSelMgr->clearSelected();
|
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (aShape.ShapeType() != TopAbs_EDGE) {
|
myVector = aFindedObject; // get existing object
|
||||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
|
||||||
aName = "";
|
|
||||||
}
|
|
||||||
myVector = aSelectedObject;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (aShape.ShapeType() != TopAbs_EDGE) {
|
||||||
|
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||||
|
aName = "";
|
||||||
|
}
|
||||||
|
myVector = aSelectedObject;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,3 +516,23 @@ void TransformationGUI_MultiRotationDlg::closeEvent( QCloseEvent* e )
|
|||||||
// myGeomGUI->SetState( -1 );
|
// myGeomGUI->SetState( -1 );
|
||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myVector;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupDimensions->LineEdit2->text()] = myVector;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -51,7 +51,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
@ -324,14 +324,26 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
if ( myEditCurrentArgument == GroupDimensions->LineEdit3 )
|
|
||||||
myVectorV = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
//Find SubShape Object in Father
|
||||||
else
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
|
||||||
myVectorU = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
if ( myEditCurrentArgument == GroupDimensions->LineEdit3 )
|
||||||
|
myVectorV = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
else
|
||||||
|
myVectorU = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( myEditCurrentArgument == GroupDimensions->LineEdit3 )
|
||||||
|
myVectorV = aFindedObject;
|
||||||
|
else
|
||||||
|
myVectorU = aFindedObject;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (aShape.ShapeType() != TopAbs_EDGE) {
|
if (aShape.ShapeType() != TopAbs_EDGE) {
|
||||||
@ -570,3 +582,24 @@ void TransformationGUI_MultiTranslationDlg::closeEvent( QCloseEvent* e )
|
|||||||
// myGeomGUI->SetState( -1 );
|
// myGeomGUI->SetState( -1 );
|
||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void TransformationGUI_MultiTranslationDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myVectorU;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupDimensions->LineEdit2->text()] = myVectorU;
|
||||||
|
objMap[GroupDimensions->LineEdit3->text()] = myVectorV;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
@ -51,7 +51,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
@ -282,15 +282,22 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected();
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (aShape.ShapeType() != aNeedType) {
|
if (aShape.ShapeType() != aNeedType) {
|
||||||
@ -535,3 +542,27 @@ void TransformationGUI_RotationDlg::onReverse()
|
|||||||
double anOldValue = GroupPoints->SpinBox_DX->GetValue();
|
double anOldValue = GroupPoints->SpinBox_DX->GetValue();
|
||||||
GroupPoints->SpinBox_DX->SetValue( -anOldValue );
|
GroupPoints->SpinBox_DX->SetValue( -anOldValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void TransformationGUI_RotationDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
|
||||||
|
if (toCreateCopy) {
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myAxis;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myCentPoint;
|
||||||
|
objMap[GroupPoints->LineEdit4->text()] = myPoint1;
|
||||||
|
objMap[GroupPoints->LineEdit5->text()] = myPoint2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -49,7 +49,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -211,12 +211,20 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
aSelMgr->clearSelected();
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
aSelMgr->clearSelected();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (aShape.ShapeType() != TopAbs_VERTEX) {
|
if (aShape.ShapeType() != TopAbs_VERTEX) {
|
||||||
@ -391,3 +399,19 @@ void TransformationGUI_ScaleDlg::CreateCopyModeChanged(bool isCreateCopy)
|
|||||||
{
|
{
|
||||||
this->GroupBoxName->setEnabled(isCreateCopy);
|
this->GroupBoxName->setEnabled(isCreateCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void TransformationGUI_ScaleDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
|
||||||
|
if (toCreateCopy) {
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myPoint;
|
||||||
|
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -50,7 +50,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* e );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
@ -296,14 +296,22 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
|
||||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
|
||||||
if (aNeedType == TopAbs_EDGE)
|
if (aNeedType == TopAbs_EDGE)
|
||||||
aName += QString(":edge_%1").arg(anIndex);
|
aName += QString(":edge_%1").arg(anIndex);
|
||||||
else
|
else
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
|
|
||||||
|
//Find SubShape Object in Father
|
||||||
|
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aSelectedObject = aFindedObject;
|
||||||
} else // Global Selection
|
} else // Global Selection
|
||||||
{
|
{
|
||||||
if (aShape.ShapeType() != aNeedType) {
|
if (aShape.ShapeType() != aNeedType) {
|
||||||
@ -539,3 +547,29 @@ void TransformationGUI_TranslationDlg::CreateCopyModeChanged(bool isCreateCopy)
|
|||||||
{
|
{
|
||||||
GroupBoxName->setEnabled(isCreateCopy);
|
GroupBoxName->setEnabled(isCreateCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : addSubshapeToStudy
|
||||||
|
// purpose : virtual method to add new SubObjects if local selection
|
||||||
|
//=================================================================================
|
||||||
|
void TransformationGUI_TranslationDlg::addSubshapesToStudy()
|
||||||
|
{
|
||||||
|
bool toCreateCopy = IsPreview() || GroupPoints->CheckBox1->isChecked();
|
||||||
|
if (toCreateCopy) {
|
||||||
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
|
switch (getConstructorId())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return;
|
||||||
|
case 1:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myPoint1;
|
||||||
|
objMap[GroupPoints->LineEdit3->text()] = myPoint2;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
objMap[GroupPoints->LineEdit2->text()] = myVector;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
addSubshapesToFather( objMap );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& objects );
|
||||||
|
virtual void addSubshapesToStudy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user