-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
{
if ( myConstructorId == constructorId && myConstructorId == 0 ) {
globalSelection(); // close local contexts, if any
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ localSelection( TopAbs_VERTEX );
activate( GEOM_MARKER );
return;
}
Group2->hide();
aMainGrp->show();
globalSelection(); // close local contexts, if any
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ localSelection( TopAbs_VERTEX );
activate( GEOM_MARKER );
break;
}
Group2->PushButton2->setDown( false );
Group2->PushButton3->setDown( false );
globalSelection(); // close local contexts, if any
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ localSelection( TopAbs_VERTEX );
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText( "" );
Group2->LineEdit2->setText( "" );
return;
}
- TopAbs_ShapeEnum aNeedType;
+ TopAbs_ShapeEnum aNeedType = TopAbs_SHAPE; // todo: aNeedType must be explicitly initialized to avoid warning (see below)
if ( getConstructorId() == 1 ) // by shape position
aNeedType = TopAbs_SHAPE;
else if ( getConstructorId() == 2 ) // by point and two vectors
aNeedType = myEditCurrentArgument == Group2->LineEdit1 ? TopAbs_VERTEX : TopAbs_EDGE;
- GEOM::GeomObjPtr aSelectedObject = getSelected( aNeedType );
+ GEOM::GeomObjPtr aSelectedObject = getSelected( aNeedType ); // todo: aNeedType must be explicitly initialized to avoid warning (see above)
TopoDS_Shape aShape;
if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
QString aName = GEOMBase::GetName( aSelectedObject.get() );
}
else if ( getConstructorId() == 2 ) { // by point and two vectors
if ( myEditCurrentArgument == Group2->LineEdit1 ) {
- myPoint = aSelectedObject;
- if (myPoint && !myVectorX)
- Group2->PushButton2->click();
+ myPoint = aSelectedObject;
+ if (myPoint && !myVectorX)
+ Group2->PushButton2->click();
}
else if (myEditCurrentArgument == Group2->LineEdit2) {
- myVectorX = aSelectedObject;
- if (myVectorX && !myVectorY)
- Group2->PushButton3->click();
+ myVectorX = aSelectedObject;
+ if (myVectorX && !myVectorY)
+ Group2->PushButton3->click();
}
else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
- myVectorY = aSelectedObject;
- if (myVectorY && !myPoint)
- Group2->PushButton1->click();
+ myVectorY = aSelectedObject;
+ if (myVectorY && !myPoint)
+ Group2->PushButton1->click();
}
}
}
}
else if ( send == Group2->PushButton1 ) {
myEditCurrentArgument = Group2->LineEdit1;
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ localSelection( TopAbs_VERTEX );
Group2->PushButton2->setDown( false );
Group2->PushButton3->setDown( false );
Group2->LineEdit1->setEnabled( true );
}
else if ( send == Group2->PushButton2 ) {
myEditCurrentArgument = Group2->LineEdit2;
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ localSelection( TopAbs_EDGE );
Group2->PushButton1->setDown( false );
Group2->PushButton3->setDown( false );
Group2->LineEdit1->setEnabled( false );
}
else if ( send == Group2->PushButton3 ) {
myEditCurrentArgument = Group2->LineEdit3;
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ localSelection( TopAbs_EDGE );
Group2->PushButton1->setDown( false );
Group2->PushButton2->setDown( false );
Group2->LineEdit1->setEnabled( false );
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIBasicOperations();
}
//=================================================================================
if ( v1.Magnitude() > gp::Resolution() && v2.Magnitude() > gp::Resolution() ) {
ok = !v1.IsParallel( v2, Precision::Angular() );
if ( !ok )
- msg += tr( "VEC_PARALLEL" );
+ msg += tr( "VEC_PARALLEL" );
}
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end() && ok; ++anIter )
ok = anIter.value()->isValid( msg, !IsPreview()) && ok;
default:
break;
}
+}
+//=================================================================================
+// function : getSourceObjects
+// purpose : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_MarkerDlg::getSourceObjects()
+{
+ QList<GEOM::GeomObjPtr> res;
+ res << myShape << myPoint << myVectorX << myVectorY;
+ return res;
}
//=================================================================================