- if ((fabs(P1.X() - P2.X()) > Precision::Confusion()) &&
- (fabs(P1.Y() - P2.Y()) > Precision::Confusion()) &&
- (fabs(P1.Z() - P2.Z()) > Precision::Confusion()))
- return true;
- return false;
+ bool res = false;
+
+ GEOM::GEOM_Object_var anObj;
+
+ switch ( getConstructorId() ) {
+ case 0 :
+ {
+ if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) ) {
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeBoxTwoPnt( myPoint1, myPoint2 );
+ res = true;
+ }
+
+ break;
+ }
+ case 1 :
+ {
+ double x = GroupDimensions->SpinBox_DX->value();
+ double y = GroupDimensions->SpinBox_DY->value();
+ double z = GroupDimensions->SpinBox_DZ->value();
+
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeBoxDXDYDZ( x, y, z );
+ res = true;
+ break;
+ }
+ }
+
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+
+ return res;
+}
+
+//=================================================================================
+// 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 );
+ }