-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
return;
}
+ GEOM::GeomObjPtr aSelected = getSelected( mySelectionModes );
+ if ( aSelected.isNull() )
+ {
+ ActiveArgs()->SelectionIntoArguments( GEOM::GeomObjPtr() );
+ return;
+ }
+
+ GEOM::GeomObjPtr aSelectedMain =
+ !aSelected->IsMainShape()
+ ? aSelected->GetMainShape()
+ : GEOM::GeomObjPtr();
+
+ if ( myParentObj != aSelected && myParentObj != aSelectedMain )
+ {
+ ActiveArgs()->SelectionIntoArguments( GEOM::GeomObjPtr() );
+ return;
+ }
+
StopLocalEditing();
erasePreview();
- ActiveArgs()->SelectionIntoArguments( getSelected( mySelectionModes ) );
+ ActiveArgs()->SelectionIntoArguments( aSelected );
}
//=================================================================================
if ( !isApplyAndClose() )
{
+ emit applyClicked();
Init();
+ ConstructTypeChanged( getConstructorId() );
}
return true;
anAISContext->SetZLayer( myDimension, myEditingLayer );
anAISContext->Activate( myDimension, AIS_DSM_Line );
anAISContext->Activate( myDimension, AIS_DSM_Text );
- anAISContext->Redisplay( myDimension );
+ anAISContext->Redisplay( myDimension , Standard_True );
}
//=================================================================================
Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d();
aViewer3d->RemoveZLayer( myEditingLayer );
- anAISContext->CloseLocalContext();
+ anAISContext->CloseLocalContext( Standard_True );
myEditingViewer = NULL;
}
QColor aQColor = aResMgr->colorValue ( "Geometry", "dimensions_color", QColor( 0, 255, 0 ) );
int aLineWidth = aResMgr->integerValue( "Geometry", "dimensions_line_width", 1 );
- double aFontHeight = aResMgr->doubleValue ( "Geometry", "dimensions_font_height", 10 );
+ QFont aFont = aResMgr->fontValue ( "Geometry", "dimensions_font", QFont("Y14.5M-2009", 14) );
double anArrowLength = aResMgr->doubleValue ( "Geometry", "dimensions_arrow_length", 5 );
double aDefFlyout = aResMgr->doubleValue ( "Geometry", "dimensions_default_flyout", 20 );
bool isUnitsShown = aResMgr->booleanValue( "Geometry", "dimensions_show_units", false );
QString aUnitsLength = aResMgr->stringValue ( "Geometry", "dimensions_length_units", "m" );
QString aUnitsAngle = aResMgr->stringValue ( "Geometry", "dimensions_angle_units", "deg" );
+ bool aUseText3d = aResMgr->booleanValue( "Geometry", "dimensions_use_text3d", false );
OCCViewer_ViewWindow* anActiveView = NULL;
aStyle->SetCommonColor( aColor );
aStyle->MakeUnitsDisplayed( (Standard_Boolean) isUnitsShown );
- aStyle->MakeText3d( Standard_True );
+ aStyle->MakeText3d( aUseText3d );
aStyle->MakeTextShaded( Standard_True );
- aStyle->SetExtensionSize( aFontHeight * 0.5 );
- aStyle->TextAspect()->SetHeight( aFontHeight );
+ int fsize = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize();
+ aStyle->SetExtensionSize( fsize * 0.5 );
+ aStyle->TextAspect()->SetFont( aFont.family().toLatin1().data() );
+ aStyle->TextAspect()->SetHeight( fsize );
aStyle->ArrowAspect()->SetLength( anArrowLength );
aStyle->LineAspect()->SetWidth( aLineWidth );