From: apl Date: Wed, 28 Sep 2016 08:39:11 +0000 (+0300) Subject: Preferences and compilation errors X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5e351de3dafab64fa43459eb10f7ea64af63fd2e;p=modules%2Fgeom.git Preferences and compilation errors --- diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in old mode 100644 new mode 100755 index 45e41fc70..9d522cd69 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -100,6 +100,14 @@ + + + + + + + + diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 65a75bb13..9bdad8b6b 100755 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -25,7 +25,6 @@ // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) #include "GEOM_Displayer.h" -#include "GEOMGUI_DimensionProperty.h" #include "GeometryGUI.h" #include @@ -39,12 +38,16 @@ #include #include +#include #include #include #include #include #include +#include +#include + #include #include @@ -1386,6 +1389,7 @@ void GEOM_Displayer::updateShapeAnnotations( const Handle(SALOME_InteractiveObje AIS_ListIteratorOfListOfInteractive aIterateIO( aListOfIO ); // remove existing presentations of shape annotations + bool isAnyRemoved = false; for ( ; aIterateIO.More(); aIterateIO.Next() ) { const Handle(AIS_InteractiveObject)& anIO = aIterateIO.Value(); @@ -1393,64 +1397,63 @@ void GEOM_Displayer::updateShapeAnnotations( const Handle(SALOME_InteractiveObje continue; aListOfIO.Remove( aIterateIO ); + isAnyRemoved = true; if ( !aIterateIO.More() ) break; } - // read annotation preferences SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); - QColor aQColor = aResMgr->colorValue ( "Geometry", "shape_annotation_color", QColor( 0, 0, 0 ) ); - int aLineWidth = aResMgr->integerValue( "Geometry", "shape_annotation_line_width", 1 ); - QFont aFont = aResMgr->fontValue ( "Geometry", "shape_annotation_font", QFont("Arial", 14) ); - bool aAutoHide = aResMgr->fontValue ( "Geometry", "shape_annotation_autohide", true ); + const QFont aFont = aResMgr->fontValue( "Geometry", "shape_annotation_font", QFont( "Arial", 14 ) ); + const QColor aFontColor = aResMgr->colorValue( "Geometry", "shape_annotation_font_color", QColor( 255, 255, 255 ) ); + const QColor aLineColor = aResMgr->colorValue( "Geometry", "shape_annotation_line_color", QColor( 255, 255, 255 ) ); + const double aLineWidth = aResMgr->doubleValue( "Geometry", "shape_annotation_line_width", 1.0 ); + const int aLineStyle = aResMgr->integerValue( "Geometry", "shape_annotation_line_style", 0 ); + const bool isAutoHide = aResMgr->booleanValue( "Geometry", "shape_annotation_autohide", false ); - // create shape annotations using data from the attribute of a study QVariant aProperty = aStudy->getObjectProperty( GEOM::sharedPropertiesId(), theIO->getEntry(), GEOM::propertyName( GEOM::ShapeAnnotations ), QVariant() ); - GEOMGUI_ShapeAnnotationProperty aStudyAnnotations; + GEOMGUI_ShapeAnnotations aAnnotationList; - if ( aProperty.isValid() && aProperty.canConvert() ) - { - aStudyAnnotations = aProperty.value(); - } - else + if ( aProperty.isValid() && aProperty.canConvert() ) { - aStudyAnnotations.LoadFromAttribute( getStudy(), theIO->getEntry() ); - } + aAnnotationList = aProperty.value(); - // create up-to-date shape annotation presentations - for ( int aPrsIt = 0; aPrsIt < aStudyAnnotations.GetNumber(); ++aPrsIt ) - { - if ( !aStudyAnnotations.IsVisible( aPrsIt ) ) + for ( int anI = 0; anI < aAnnotationList.Count(); ++anI ) { - continue; - } + if ( !aAnnotationList.Get( anI ).IsVisible ) + { + continue; + } - Handle(GEOM_Annotation) aPrs = new GEOM_Annotation(); + Handle(GEOM_Annotation) aPresentation = new GEOM_Annotation(); - aStudyAnnotations.GetRecord( aPrsIt )->Update( aPrs ); + aAnnotationList.ToPresentation ( anI, aPresentation, theShapeLCS ); - gp_Trsf aToLCS; - aToLCS.SetTransformation( theLCS, gp_Ax3() ); - aPrs->SetLocalTransformation( aToLCS ); - aPrs->SetOwner( theIO ); + aPresentation->SetOwner( theIO ); - Quantity_Color aColor( aQColor.redF(), aQColor.greenF(), aQColor.blueF(), Quantity_TOC_RGB ); + const Quantity_Color aOcctFontColor( aFontColor.redF(), aFontColor.greenF(), aFontColor.blueF(), Quantity_TOC_RGB ); + const Quantity_Color aOcctLineColor( aLineColor.redF(), aLineColor.greenF(), aLineColor.blueF(), Quantity_TOC_RGB ); + const Standard_Real aFontHeight = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize(); - Standard_Real aFontHeight = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize(); - aPrs->SetColor( aColor ); - aPrs->SetTextHeight( aFontHeight ); - aPrs->SetFont( aFont.family().toLatin1().data() ); - aPrs->SetLineWidth( aLineWidth ); + aPresentation->SetTextHeight( aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize() ); + aPresentation->SetTextColor( Quantity_Color( aFontColor.redF(), aFontColor.greenF(), aFontColor.blueF(), Quantity_TOC_RGB ) ); + aPresentation->SetLineColor( Quantity_Color( aLineColor.redF(), aLineColor.greenF(), aLineColor.blueF(), Quantity_TOC_RGB ) ); + aPresentation->SetLineWidth( aLineWidth ); + aPresentation->SetLineStyle( static_cast( aLineStyle ) ); + aPresentation->SetAutoHide( isAutoHide ? Standard_True : Standard_False ); - aListOfIO.Append( aPrs ); + aListOfIO.Append( aPresentation ); + } + } + else if ( !isAnyRemoved ) + { + return; } - // update presentation anOccPrs->Clear(); for ( aIterateIO.Initialize( aListOfIO ); aIterateIO.More(); aIterateIO.Next() ) @@ -1649,7 +1652,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) } updateDimensions( myIO, occPrs, gp_Ax3().Transformed( myShape.Location().Transformation() ) ); - updateAnnotations( myIO, occPrs, gp_Ax3().Transformed( myShape.Location().Transformation() ) ); + updateShapeAnnotations( myIO, occPrs, gp_Ax3().Transformed( myShape.Location().Transformation() ) ); } } diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts old mode 100644 new mode 100755 index 5f7f73cbe..5c07ace59 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -3500,6 +3500,50 @@ Please, select face, shell or solid and try again PREF_DIMENSIONS_USE_TEXT3D Use 3D text + + PREF_SHAPE_ANNOTATIONS + Shape annotations + + + PREF_SHAPE_ANNOTATIONS_FONT + Font + + + PREF_SHAPE_ANNOTATIONS_FONT_COLOR + Font color + + + PREF_SHAPE_ANNOTATIONS_LINE_COLOR + Line color + + + PREF_SHAPE_ANNOTATIONS_LINE_WIDTH + Line width + + + PREF_SHAPE_ANNOTATIONS_LINE_STYLE + Line style + + + PREF_SHAPE_ANNOTATIONS_AUTOHIDE + Hide when attachment is invisible + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID + Solid + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH + Dashed + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT + Dotted + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH + Mixed + PREF_HIDE_INPUT_OBJECT Hide input objects from the viewer diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts old mode 100644 new mode 100755 index 1e42e0761..dbf97b228 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -3492,6 +3492,39 @@ Choisissez une face, une coque ou un solide et essayez de nouveau PREF_DIMENSIONS_USE_TEXT3D Utiliser du texte 3D + + PREF_SHAPE_ANNOTATIONS + + + PREF_SHAPE_ANNOTATIONS_FONT + + + PREF_SHAPE_ANNOTATIONS_FONT_COLOR + + + PREF_SHAPE_ANNOTATIONS_LINE_COLOR + + + PREF_SHAPE_ANNOTATIONS_LINE_WIDTH + + + PREF_SHAPE_ANNOTATIONS_LINE_STYLE + + + PREF_SHAPE_ANNOTATIONS_AUTOHIDE + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH + PREF_HIDE_INPUT_OBJECT Cacher dans la vue les objets en entrée diff --git a/src/GEOMGUI/GEOM_msg_ja.ts b/src/GEOMGUI/GEOM_msg_ja.ts old mode 100644 new mode 100755 index 5ee0ab872..0fb693805 --- a/src/GEOMGUI/GEOM_msg_ja.ts +++ b/src/GEOMGUI/GEOM_msg_ja.ts @@ -3495,6 +3495,39 @@ PREF_DIMENSIONS_USE_TEXT3D 3Dテキストの使用 + + PREF_SHAPE_ANNOTATIONS + + + PREF_SHAPE_ANNOTATIONS_FONT + + + PREF_SHAPE_ANNOTATIONS_FONT_COLOR + + + PREF_SHAPE_ANNOTATIONS_LINE_COLOR + + + PREF_SHAPE_ANNOTATIONS_LINE_WIDTH + + + PREF_SHAPE_ANNOTATIONS_LINE_STYLE + + + PREF_SHAPE_ANNOTATIONS_AUTOHIDE + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT + + + PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH + PREF_HIDE_INPUT_OBJECT ビューワから入力したオブジェクトの非表示 diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx old mode 100644 new mode 100755 index eb9c53f87..ead10235c --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -2355,6 +2355,10 @@ void GeometryGUI::createPreferences() addPreference( tr( "PREF_AUTO_BRING_TO_FRONT" ), genGroup, LightApp_Preferences::Bool, "Geometry", "auto_bring_to_front" ); + // -------------------------------------------------------------------------- + // Dimensions (Measurements) preferences + // -------------------------------------------------------------------------- + int aDimGroupId = addPreference( tr( "PREF_DIMENSIONS" ), tabId ); setPreferenceProperty( aDimGroupId, "columns", 2 ); @@ -2438,6 +2442,53 @@ void GeometryGUI::createPreferences() addPreference( tr( "PREF_DIMENSIONS_USE_TEXT3D" ), aDimGroupId, LightApp_Preferences::Bool, "Geometry", "dimensions_use_text3d" ); + // -------------------------------------------------------------------------- + // Shape annotation preferences + // -------------------------------------------------------------------------- + + const int aShapeAnnGroupId = addPreference( tr( "PREF_SHAPE_ANNOTATIONS" ), tabId ); + setPreferenceProperty( aShapeAnnGroupId, "columns", 2 ); + + addPreference( tr( "PREF_SHAPE_ANNOTATIONS_FONT_COLOR" ), aShapeAnnGroupId, LightApp_Preferences::Color, "Geometry", "shape_annotation_font_color" ); + addPreference( tr( "PREF_SHAPE_ANNOTATIONS_LINE_COLOR" ), aShapeAnnGroupId, LightApp_Preferences::Color, "Geometry", "shape_annotation_line_color" ); + const int aShapeAnnFont = + addPreference( tr( "PREF_SHAPE_ANNOTATIONS_FONT" ), aShapeAnnGroupId, LightApp_Preferences::Font, "Geometry", "shape_annotation_font" ); + + int aShapeAnnFontFeatures = QtxFontEdit::Family | QtxFontEdit::Size | QtxFontEdit::Bold | QtxFontEdit::Italic; + setPreferenceProperty( aShapeAnnFont, "features", aShapeAnnFontFeatures ); + setPreferenceProperty( aShapeAnnFont, "mode", QtxFontEdit::Custom ); + setPreferenceProperty( aShapeAnnFont, "fonts", anOCCFonts ); + + const int aShapeAnnLineWidth = + addPreference( tr( "PREF_SHAPE_ANNOTATIONS_LINE_WIDTH" ), aShapeAnnGroupId, LightApp_Preferences::IntSpin, "Geometry", "shape_annotation_line_width" ); + + setPreferenceProperty( aShapeAnnLineWidth, "min", 1 ); + setPreferenceProperty( aShapeAnnLineWidth, "max", 5 ); + + addPreference( tr( "PREF_SHAPE_ANNOTATIONS_AUTOHIDE" ), aShapeAnnGroupId, LightApp_Preferences::Bool, "Geometry", "shape_annotation_autohide" ); + + const int aShapeAnnLineStyle = + addPreference( tr( "PREF_SHAPE_ANNOTATIONS_LINE_STYLE" ), aShapeAnnGroupId, LightApp_Preferences::Selector, "Geometry", "shape_annotation_line_style" ); + + QStringList aLineStyleList; + aLineStyleList.append( tr("PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID") ); + aLineStyleList.append( tr("PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH") ); + aLineStyleList.append( tr("PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT") ); + aLineStyleList.append( tr("PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH") ); + + QList aLineStyleIds; + aLineStyleIds.append(0); + aLineStyleIds.append(1); + aLineStyleIds.append(2); + aLineStyleIds.append(3); + + setPreferenceProperty( aShapeAnnLineStyle, "strings", aLineStyleList ); + setPreferenceProperty( aShapeAnnLineStyle, "indexes", aLineStyleIds ); + + // -------------------------------------------------------------------------- + // Isoline drawing preferences + // -------------------------------------------------------------------------- + int isoGroup = addPreference( tr( "PREF_ISOS" ), tabId ); setPreferenceProperty( isoGroup, "columns", 2 ); int isoU = addPreference( tr( "PREF_ISOS_U" ), isoGroup, diff --git a/src/OBJECT/GEOM_Annotation.cxx b/src/OBJECT/GEOM_Annotation.cxx index 9eddb7cf6..92e26b895 100755 --- a/src/OBJECT/GEOM_Annotation.cxx +++ b/src/OBJECT/GEOM_Annotation.cxx @@ -38,7 +38,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -47,7 +49,7 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT (GEOM_Annotation, AIS_InteractiveObject) +IMPLEMENT_STANDARD_RTTIEXT( GEOM_Annotation, AIS_InteractiveObject ) // ======================================================================= // function : Constructor @@ -55,32 +57,34 @@ IMPLEMENT_STANDARD_RTTIEXT (GEOM_Annotation, AIS_InteractiveObject) // ======================================================================= GEOM_Annotation::GEOM_Annotation() : AIS_InteractiveObject() { - SetPosition (gp_Pnt (0.0, 0.0, 0.0)); - SetScreenFixed (Standard_False); - SetAttachPoint (gp_Pnt (0.0, 0.0, 0.0)); - SetDisplayMode (0); - SetZLayer (Graphic3d_ZLayerId_Top); - SetAutoHide (Standard_True); - SetHilightMode (HighlightAll); + SetPosition( gp_Pnt( 0.0, 0.0, 0.0 ) ); + SetScreenFixed( Standard_False ); + SetAttachPoint( gp_Pnt( 0.0, 0.0, 0.0 ) ); + SetDisplayMode( 0 ); + SetZLayer( Graphic3d_ZLayerId_Top ); + SetAutoHide( Standard_True ); + SetHilightMode( HighlightAll ); Handle(Prs3d_TextAspect) aTextAspect = new Prs3d_TextAspect(); - aTextAspect->SetHeight (20.0); - aTextAspect->SetColor (Quantity_Color (1.0, 1.0, 1.0, Quantity_TOC_RGB)); - myDrawer->SetTextAspect (aTextAspect); + aTextAspect->SetHeight( 20.0 ); + aTextAspect->SetColor( Quantity_Color( 1.0, 1.0, 1.0, Quantity_TOC_RGB ) ); + myDrawer->SetTextAspect( aTextAspect ); Handle(Prs3d_LineAspect) aLineAspect = - new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0); - myDrawer->SetLineAspect (aLineAspect); + new Prs3d_LineAspect( Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0 ); + myDrawer->SetLineAspect( aLineAspect ); } // ======================================================================= // function : SetText // purpose : // ======================================================================= -void GEOM_Annotation::SetText (const TCollection_ExtendedString& theText) +void GEOM_Annotation::SetText( const TCollection_ExtendedString& theText ) { if (myText != theText) + { SetToUpdate(); + } myText = theText; } @@ -89,27 +93,29 @@ void GEOM_Annotation::SetText (const TCollection_ExtendedString& theText) // function : SetPosition // purpose : // ======================================================================= -void GEOM_Annotation::SetPosition (const gp_Pnt& thePosition) +void GEOM_Annotation::SetPosition( const gp_Pnt& thePosition ) { myPosition = thePosition; - AIS_InteractiveObject::SetTransformPersistence (Graphic3d_TMF_ZoomPers | Graphic3d_TMF_RotatePers, thePosition); + UpdatePersistence(); } // ======================================================================= // function : SetScreenFixed // purpose : // ======================================================================= -void GEOM_Annotation::SetScreenFixed (const Standard_Boolean theIsFixed) +void GEOM_Annotation::SetScreenFixed( const Standard_Boolean theIsFixed ) { myIsScreenFixed = theIsFixed; + + UpdatePersistence(); } // ======================================================================= // function : SetAttachPoint // purpose : // ======================================================================= -void GEOM_Annotation::SetAttachPoint (const gp_Pnt& thePoint) +void GEOM_Annotation::SetAttachPoint( const gp_Pnt& thePoint ) { myAttach = thePoint; } @@ -118,22 +124,44 @@ void GEOM_Annotation::SetAttachPoint (const gp_Pnt& thePoint) // function : SetColor // purpose : // ======================================================================= -void GEOM_Annotation::SetColor (const Quantity_Color& theColor) +void GEOM_Annotation::SetColor( const Quantity_Color& theColor ) +{ + SetTextColor( theColor ); + SetLineColor( theColor ); +} + +// ======================================================================= +// function : SetTextColor +// purpose : +// ======================================================================= +void GEOM_Annotation::SetTextColor( const Quantity_Color& theColor ) { - myDrawer->TextAspect()->SetColor (theColor); - myDrawer->LineAspect()->SetColor (theColor); - AIS_InteractiveObject::SetColor (theColor); + myDrawer->TextAspect()->SetColor( theColor ); + + SetToUpdate(); +} + +// ======================================================================= +// function : SetLineColor +// purpose : +// ======================================================================= +void GEOM_Annotation::SetLineColor( const Quantity_Color& theColor ) +{ + myDrawer->LineAspect()->SetColor( theColor ); + + SetToUpdate(); } // ======================================================================= // function : SetTextHeight // purpose : // ======================================================================= -void GEOM_Annotation::SetTextHeight (const Standard_Real theHeight) +void GEOM_Annotation::SetTextHeight( const Standard_Real theHeight ) { if (GetTextHeight() != theHeight) { - myDrawer->TextAspect()->SetHeight (theHeight); + myDrawer->TextAspect()->SetHeight( theHeight ); + SetToUpdate (); } } @@ -142,11 +170,12 @@ void GEOM_Annotation::SetTextHeight (const Standard_Real theHeight) // function : SetFontAspect // purpose : // ======================================================================= -void GEOM_Annotation::SetFontAspect (const Font_FontAspect theFontAspect) +void GEOM_Annotation::SetFontAspect( const Font_FontAspect theFontAspect ) { if (GetFontAspect() != theFontAspect) { - myDrawer->TextAspect()->Aspect()->SetTextFontAspect (theFontAspect); + myDrawer->TextAspect()->Aspect()->SetTextFontAspect( theFontAspect ); + SetToUpdate(); } } @@ -155,11 +184,12 @@ void GEOM_Annotation::SetFontAspect (const Font_FontAspect theFontAspect) // function : SetFont // purpose : // ======================================================================= -void GEOM_Annotation::SetFont (const TCollection_AsciiString& theFont) +void GEOM_Annotation::SetFont( const TCollection_AsciiString& theFont ) { if (GetFont() != theFont) { - myDrawer->TextAspect()->Aspect()->SetFont (theFont); + myDrawer->TextAspect()->Aspect()->SetFont( theFont ); + SetToUpdate(); } } @@ -168,18 +198,53 @@ void GEOM_Annotation::SetFont (const TCollection_AsciiString& theFont) // function : SetLineWidth // purpose : // ======================================================================= -void GEOM_Annotation::SetLineWidth (const Standard_Real theLineWidth) +void GEOM_Annotation::SetLineWidth( const Standard_Real theLineWidth ) { - myDrawer->LineAspect()->SetWidth (theLineWidth); + if (GetLineWidth() != theLineWidth) + { + myDrawer->LineAspect()->SetWidth( theLineWidth ); + + SetToUpdate(); + } +} + +// ======================================================================= +// function : SetLineStyle +// purpose : +// ======================================================================= +void GEOM_Annotation::SetLineStyle( const Aspect_TypeOfLine theStyle ) +{ + if (GetLineStyle() != theStyle) + { + myDrawer->LineAspect()->SetTypeOfLine( theStyle ); + + SetToUpdate(); + } +} + +// ======================================================================= +// function : UpdatePersistence +// purpose : +// ======================================================================= +void GEOM_Annotation::UpdatePersistence() +{ + if (!myIsScreenFixed) + { + AIS_InteractiveObject::SetTransformPersistence( Graphic3d_TMF_ZoomPers | Graphic3d_TMF_RotatePers, myPosition ); + } + else + { + AIS_InteractiveObject::SetTransformPersistence( Graphic3d_TMF_2d, gp_Pnt( 0.0, 0.0, 0.0 ) ); + } } // ======================================================================= // function : Compute // purpose : // ======================================================================= -void GEOM_Annotation::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePresentationManager*/, +void GEOM_Annotation::Compute( const Handle(PrsMgr_PresentationManager3d)& /*thePresentationManager*/, const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) + const Standard_Integer theMode ) { thePresentation->Clear(); @@ -188,39 +253,39 @@ void GEOM_Annotation::Compute (const Handle(PrsMgr_PresentationManager3d)& /*the return; } - Handle(OpenGl_Group) aGroup = Handle(OpenGl_Group)::DownCast (Prs3d_Root::NewGroup (thePresentation)); + Handle(OpenGl_Group) aGroup = Handle(OpenGl_Group)::DownCast( Prs3d_Root::NewGroup( thePresentation ) ); if (aGroup.IsNull()) { return; } Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect(); - NCollection_String aUtfText (myText.ToExtString()); + NCollection_String aUtfText( myText.ToExtString() ); OpenGl_Annotation* aAnnotationDraw = - new OpenGl_Annotation (this, static_cast(anAsp->Height()), aGroup->GlStruct()->GlDriver()); + new OpenGl_Annotation( this, static_cast( anAsp->Height() ), aGroup->GlStruct()->GlDriver() ); - aGroup->AddElement (aAnnotationDraw); - aGroup->SetGroupPrimitivesAspect (myDrawer->TextAspect()->Aspect()); - aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect()); + aGroup->AddElement( aAnnotationDraw ); + aGroup->SetGroupPrimitivesAspect( myDrawer->TextAspect()->Aspect() ); + aGroup->SetGroupPrimitivesAspect( myDrawer->LineAspect()->Aspect() ); - NCollection_Handle aBoundingBox = TextBoundingBox(); - gp_Pnt aBoxMin = aBoundingBox->CornerMin(); - gp_Pnt aBoxMax = aBoundingBox->CornerMax(); + const NCollection_Handle aBoundingBox = TextBoundingBox(); + const gp_Pnt aBoxMin = aBoundingBox->CornerMin(); + const gp_Pnt aBoxMax = aBoundingBox->CornerMax(); aGroup->ChangeBoundingBox() = Graphic3d_BndBox4f ( - Graphic3d_Vec4 (static_cast (aBoxMin.X()), - static_cast (aBoxMin.Y()), - static_cast (aBoxMin.Z()), 1.0F), - Graphic3d_Vec4 (static_cast (aBoxMax.X()), - static_cast (aBoxMax.Y()), - static_cast (aBoxMax.Z()), 1.0F)); + Graphic3d_Vec4( static_cast( aBoxMin.X() ), + static_cast( aBoxMin.Y() ), + static_cast( aBoxMin.Z() ), 1.0F ), + Graphic3d_Vec4( static_cast( aBoxMax.X() ), + static_cast( aBoxMax.Y() ), + static_cast( aBoxMax.Z() ), 1.0F ) ); } // ======================================================================= // function : ComputeSelection // purpose : // ======================================================================= -void GEOM_Annotation::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, - const Standard_Integer theMode) +void GEOM_Annotation::ComputeSelection( const Handle(SelectMgr_Selection)& theSelection, + const Standard_Integer theMode ) { if (theMode != 0) { @@ -229,10 +294,10 @@ void GEOM_Annotation::ComputeSelection (const Handle(SelectMgr_Selection)& theSe theSelection->Clear(); - NCollection_Handle aBoundingBox = TextBoundingBox(); - Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this, 10); - Handle(Select3D_SensitiveBox) aSensitive = new Select3D_SensitiveBox (anEntityOwner, *aBoundingBox.get()); - theSelection->Add (aSensitive); + const NCollection_Handle aBoundingBox = TextBoundingBox(); + const Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner( this, 10 ); + const Handle(Select3D_SensitiveBox) aSensitive = new Select3D_SensitiveBox( anEntityOwner, *aBoundingBox.get() ); + theSelection->Add( aSensitive ); } // ======================================================================= @@ -245,14 +310,16 @@ NCollection_Handle GEOM_Annotation::TextBoundingBox() const Bnd_Box aBox; Font_FTFont aFont; unsigned int aResolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution; - if (aFont.Init (anAsp->Aspect()->Font().ToCString(), - anAsp->Aspect()->GetTextFontAspect(), (unsigned int)anAsp->Height(), aResolution)) + if ( aFont.Init( anAsp->Aspect()->Font().ToCString(), + anAsp->Aspect()->GetTextFontAspect(), + (unsigned int)anAsp->Height(), + aResolution ) ) { - const NCollection_String aText ((Standard_Utf16Char* )myText.ToExtString()); - Font_Rect aFontRect = aFont.BoundingBox (aText, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM); + const NCollection_String aText( (Standard_Utf16Char* )myText.ToExtString() ); + const Font_Rect aFontRect = aFont.BoundingBox( aText, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM ); NCollection_Handle aBox = new Bnd_Box(); - aBox->Add (gp_Pnt (0.0, 0.0, 0.0)); - aBox->Add (gp_Pnt (aFontRect.Width(), aFontRect.Height(), 0.0)); + aBox->Add( gp_Pnt( 0.0, 0.0, 0.0 ) ); + aBox->Add( gp_Pnt( aFontRect.Width(), aFontRect.Height(), 0.0 ) ); return aBox; } @@ -264,35 +331,35 @@ NCollection_Handle GEOM_Annotation::TextBoundingBox() const // function : Constructor // purpose : // ======================================================================= -GEOM_Annotation::OpenGl_Annotation::OpenGl_Annotation (GEOM_Annotation* theAnnotation, +GEOM_Annotation::OpenGl_Annotation::OpenGl_Annotation( GEOM_Annotation* theAnnotation, const Standard_Integer theTextHeight, - const OpenGl_GraphicDriver* theDriver) + const OpenGl_GraphicDriver* theDriver ) : OpenGl_Element(), - myAISObject (theAnnotation), - myText (theAnnotation->myText.ToExtString()), - myTextLineY (0.f), - myTextDPI (0) + myAISObject( theAnnotation ), + myText( theAnnotation->myText.ToExtString() ), + myTextLineY( 0.f ), + myTextDPI( 0 ) { // graphical resources for drawing text and underline myTextParams.Height = theTextHeight; myTextParams.HAlign = Graphic3d_HTA_LEFT; myTextParams.VAlign = Graphic3d_VTA_BOTTOM; - myTextDraw = new OpenGl_Text (myText.ToCString(), OpenGl_Vec3(), myTextParams); - myTextLineDraw = new OpenGl_PrimitiveArray (theDriver); + myTextDraw = new OpenGl_Text( myText.ToCString(), OpenGl_Vec3(), myTextParams ); + myTextLineDraw = new OpenGl_PrimitiveArray( theDriver ); // graphical resources for drawing extension line and marker Handle(Graphic3d_ArrayOfSegments) - aExtVertexArray = new Graphic3d_ArrayOfSegments(2); - aExtVertexArray->AddVertex (0.0, 0.0, 0.0); - aExtVertexArray->AddVertex (0.0, 0.0, 1.0); - myExtLineDraw = new OpenGl_PrimitiveArray (theDriver, Graphic3d_TOPA_SEGMENTS, - aExtVertexArray->Indices(), aExtVertexArray->Attributes(), aExtVertexArray->Bounds()); + aExtVertexArray = new Graphic3d_ArrayOfSegments( 2 ); + aExtVertexArray->AddVertex( 0.0, 0.0, 0.0 ); + aExtVertexArray->AddVertex( 0.0, 0.0, 1.0 ); + myExtLineDraw = new OpenGl_PrimitiveArray( theDriver, Graphic3d_TOPA_SEGMENTS, + aExtVertexArray->Indices(), aExtVertexArray->Attributes(), aExtVertexArray->Bounds() ); Handle(Graphic3d_ArrayOfPoints) - aExtMakerArray = new Graphic3d_ArrayOfPoints(1); - aExtMakerArray->AddVertex (0.0, 0.0, 1.0); - myExtMarkerDraw = new OpenGl_PrimitiveArray (theDriver, Graphic3d_TOPA_POINTS, - aExtMakerArray->Indices(), aExtMakerArray->Attributes(), aExtMakerArray->Bounds()); + aExtMakerArray = new Graphic3d_ArrayOfPoints( 1 ); + aExtMakerArray->AddVertex( 0.0, 0.0, 1.0 ); + myExtMarkerDraw = new OpenGl_PrimitiveArray( theDriver, Graphic3d_TOPA_POINTS, + aExtMakerArray->Indices(), aExtMakerArray->Attributes(), aExtMakerArray->Bounds() ); } // ======================================================================= @@ -302,7 +369,7 @@ GEOM_Annotation::OpenGl_Annotation::OpenGl_Annotation (GEOM_Annotation* theAnnot // ======================================================================= GEOM_Annotation::OpenGl_Annotation::~OpenGl_Annotation() { - Release (NULL); + Release( NULL ); } // ======================================================================= @@ -310,14 +377,14 @@ GEOM_Annotation::OpenGl_Annotation::~OpenGl_Annotation() // function : Release // purpose : Releases GL resources with the given GL context. // ======================================================================= -void GEOM_Annotation::OpenGl_Annotation::Release (OpenGl_Context* theCtx) +void GEOM_Annotation::OpenGl_Annotation::Release( OpenGl_Context* theCtx ) { if (myTextDraw) { - myTextDraw->Release (theCtx); - myTextLineDraw->Release (theCtx); - myExtLineDraw->Release (theCtx); - myExtMarkerDraw->Release (theCtx); + myTextDraw->Release( theCtx ); + myTextLineDraw->Release( theCtx ); + myExtLineDraw->Release( theCtx ); + myExtMarkerDraw->Release( theCtx ); } myTextDraw = NULL; myTextLineDraw = NULL; @@ -330,7 +397,7 @@ void GEOM_Annotation::OpenGl_Annotation::Release (OpenGl_Context* theCtx) // function : Render // purpose : Renders the annotation graphical elements. // ======================================================================= -void GEOM_Annotation::OpenGl_Annotation::Render (const Handle(OpenGl_Workspace)& theWorkspace) const +void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)& theWorkspace ) const { const Handle(OpenGl_Context)& aContext = theWorkspace->GetGlContext(); @@ -344,24 +411,24 @@ void GEOM_Annotation::OpenGl_Annotation::Render (const Handle(OpenGl_Workspace)& // getting string size will also initialize font library Standard_ShortReal aWidth, aHeight, aDescent; - myTextDraw->StringSize (aContext, myText, *anAspect, myTextParams, aDPI, aWidth, aHeight, aDescent); + myTextDraw->StringSize( aContext, myText, *anAspect, myTextParams, aDPI, aWidth, aHeight, aDescent ); myTextDPI = aDPI; - myTextLineY = ceil (aHeight * -0.2f); + myTextLineY = ceil( aHeight * -0.2f ); Handle(Graphic3d_ArrayOfSegments) - aVertexArray = new Graphic3d_ArrayOfSegments (2); - aVertexArray->AddVertex (0.0f, myTextLineY, 0.0f); - aVertexArray->AddVertex (aWidth, myTextLineY, 0.0f); - myTextLineDraw->InitBuffers (aContext, Graphic3d_TOPA_SEGMENTS, - aVertexArray->Indices(), aVertexArray->Attributes(), aVertexArray->Bounds()); + aVertexArray = new Graphic3d_ArrayOfSegments( 2 ); + aVertexArray->AddVertex( 0.0f, myTextLineY, 0.0f ); + aVertexArray->AddVertex( aWidth, myTextLineY, 0.0f ); + myTextLineDraw->InitBuffers( aContext, Graphic3d_TOPA_SEGMENTS, + aVertexArray->Indices(), aVertexArray->Attributes(), aVertexArray->Bounds() ); } // --------------------------------------------- // perform view culling test by attachment point // --------------------------------------------- - const OpenGl_Vec4 aAttach (static_cast(myAISObject->myAttach.X()), - static_cast(myAISObject->myAttach.Y()), - static_cast(myAISObject->myAttach.Z()), 1.F); + const OpenGl_Vec4 aAttach( static_cast( myAISObject->myAttach.X() ), + static_cast( myAISObject->myAttach.Y() ), + static_cast( myAISObject->myAttach.Z() ), 1.F ); const Handle(Graphic3d_Camera) aCamera = theWorkspace->View()->Camera(); const OpenGl_Mat4& aCameraProjMat = aCamera->ProjectionMatrixF(); @@ -370,9 +437,9 @@ void GEOM_Annotation::OpenGl_Annotation::Render (const Handle(OpenGl_Workspace)& if (myAISObject->myIsAutoHide) { const OpenGl_Vec4 aAttachClip = aCameraProjMat * aAttachView; - if (abs (aAttachClip.x()) > aAttachClip.w() - || abs (aAttachClip.y()) > aAttachClip.w() - || abs (aAttachClip.z()) > aAttachClip.w()) + if (abs( aAttachClip.x() ) > aAttachClip.w() + || abs( aAttachClip.y() ) > aAttachClip.w() + || abs( aAttachClip.z() ) > aAttachClip.w()) { return; } @@ -381,7 +448,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render (const Handle(OpenGl_Workspace)& // ------------------------------------------------------------- // render text label in current persistence matrix and underline // ------------------------------------------------------------- - myTextDraw->Render (theWorkspace); + myTextDraw->Render( theWorkspace ); // ---------------------------------------------- // render underline in current persistence matrix @@ -389,31 +456,31 @@ void GEOM_Annotation::OpenGl_Annotation::Render (const Handle(OpenGl_Workspace)& const bool toHighlight = theWorkspace->ToHighlight(); if (toHighlight && myAISObject->myHilightMode == HighlightLabel) { - theWorkspace->SetHighlight (false); + theWorkspace->SetHighlight( false ); theWorkspace->ApplyAspectLine(); } - myTextLineDraw->Render (theWorkspace); + myTextLineDraw->Render( theWorkspace ); // ------------------------------------------------------------ // render dynamic extension line using synthetic transformation // ------------------------------------------------------------ const OpenGl_Mat4& aViewMat = aContext->WorldViewState.Current(); - const OpenGl_Vec4 aHingeView = aViewMat * OpenGl_Vec4 (0.0f, myTextLineY, 0.0f, 1.0f); + const OpenGl_Vec4 aHingeView = aViewMat * OpenGl_Vec4( 0.0f, myTextLineY, 0.0f, 1.0f ); // prepare matrix to specify geometry of extension line in view space // by multiplication of unit z coordinate vector on given matrix. OpenGl_Mat4 aExtGeometryMat; - aExtGeometryMat.SetColumn (2, aAttachView - aHingeView); - aExtGeometryMat.SetColumn (3, aHingeView); + aExtGeometryMat.SetColumn( 2, aAttachView - aHingeView ); + aExtGeometryMat.SetColumn( 3, aHingeView ); aContext->ModelWorldState.Push(); aContext->ModelWorldState.SetIdentity(); aContext->WorldViewState.Push(); - aContext->WorldViewState.SetCurrent (aExtGeometryMat); + aContext->WorldViewState.SetCurrent( aExtGeometryMat ); aContext->ApplyModelViewMatrix(); - myExtLineDraw->Render (theWorkspace); - myExtMarkerDraw->Render (theWorkspace); + myExtLineDraw->Render( theWorkspace ); + myExtMarkerDraw->Render( theWorkspace ); aContext->ModelWorldState.Pop(); aContext->WorldViewState.Pop(); @@ -421,6 +488,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render (const Handle(OpenGl_Workspace)& if (toHighlight != theWorkspace->ToHighlight()) { - theWorkspace->SetHighlight (toHighlight); + theWorkspace->SetHighlight( toHighlight ); } } + diff --git a/src/OBJECT/GEOM_Annotation.hxx b/src/OBJECT/GEOM_Annotation.hxx index ddeafd98c..ac6b28904 100755 --- a/src/OBJECT/GEOM_Annotation.hxx +++ b/src/OBJECT/GEOM_Annotation.hxx @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include #include #include @@ -44,6 +42,10 @@ #include #include +class OpenGl_GraphicDriver; +class OpenGl_PrimitiveArray; +class OpenGl_Text; + /*! * \class GEOM_Annotation * \brief Interactive object, representating annotation entity @@ -52,7 +54,7 @@ class GEOM_Annotation : public AIS_InteractiveObject { public: - DEFINE_STANDARD_RTTIEXT (GEOM_Annotation, AIS_InteractiveObject) + DEFINE_STANDARD_RTTIEXT( GEOM_Annotation, AIS_InteractiveObject ) //! Enumerates supported highlighting modes. //! - HighlightAll : all elements of the annotation are highlighted. @@ -73,7 +75,7 @@ public: //! Sets annotation text string. //! \param theText [in] the string displayed in annotation label. - Standard_EXPORT void SetText (const TCollection_ExtendedString& theText); + Standard_EXPORT void SetText( const TCollection_ExtendedString& theText ); //! Returns annotation text string. const TCollection_ExtendedString& GetText() const { return myText; } @@ -84,7 +86,7 @@ public: //! (\sa SetScreenFixed) the position is defined as {x,y} pixel coordinate //! of window space, otherwise 3D point defined in world's coordinate system //! is used. - Standard_EXPORT void SetPosition (const gp_Pnt& thePosition); + Standard_EXPORT void SetPosition( const gp_Pnt& thePosition ); //! Returns position of the annotation text label. const gp_Pnt& GetPosition() const { return myPosition; } @@ -93,7 +95,7 @@ public: //! is fixed at predefined pixel location in the window coordinate space. Other mode //! is "3D screen aligned" positioning, when the label is aligned in plane of the //! screen, while its position is a 3D point defined in world's coordinate system. - Standard_EXPORT void SetScreenFixed (const Standard_Boolean theIsFixed); + Standard_EXPORT void SetScreenFixed( const Standard_Boolean theIsFixed ); //! Retuns value of "screen fixed" positioning mode. Standard_Boolean GetIsScreenFixed() const { return myIsScreenFixed; } @@ -101,7 +103,7 @@ public: //! Sets attachment point of extension line. //! \param thePoint [in] the 3D cartesian point defined in world's coordinate system //! (a point on annotated geometry). - Standard_EXPORT void SetAttachPoint (const gp_Pnt& thePoint); + Standard_EXPORT void SetAttachPoint( const gp_Pnt& thePoint ); //! Returns attachment point of extension line. const gp_Pnt& GetAttachPoint() const { return myAttach; } @@ -109,64 +111,81 @@ public: public: //! Sets color for the presentation. - Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE; + Standard_EXPORT virtual void SetColor( const Quantity_Color& theColor ) Standard_OVERRIDE; + + //! Sets text color. + Standard_EXPORT void SetTextColor( const Quantity_Color& theColor ); //! Returns color for the text's label. - Quantity_Color GetColor() const { return myDrawer->TextAspect()->Aspect()->Color(); } + Quantity_Color GetTextColor() const { return myDrawer->TextAspect()->Aspect()->Color(); } + + //! Sets line's color. + Standard_EXPORT void SetLineColor( const Quantity_Color& theColor); + + //! Returns color for the connection line. + Quantity_Color GetLineColor() const { return myDrawer->LineAspect()->Aspect()->Color(); } //! Sets text height in pixels. - Standard_EXPORT void SetTextHeight (const Standard_Real theHeight); + Standard_EXPORT void SetTextHeight( const Standard_Real theHeight ); //! Returns text's height in pixels. Standard_Real GetTextHeight() const { return myDrawer->TextAspect()->Height(); } //! Sets font aspect for label. - Standard_EXPORT void SetFontAspect (const Font_FontAspect theFontAspect); + Standard_EXPORT void SetFontAspect( const Font_FontAspect theFontAspect ); //! Returns label's font aspect. Font_FontAspect GetFontAspect() const { return myDrawer->TextAspect()->Aspect()->GetTextFontAspect(); } //! Sets font used for drawing the label. - Standard_EXPORT void SetFont (const TCollection_AsciiString& theFont); + Standard_EXPORT void SetFont( const TCollection_AsciiString& theFont ); //! Returns font used for drawing the label. TCollection_AsciiString GetFont() const { return myDrawer->TextAspect()->Aspect()->Font(); } //! Sets line width to be used for drawing the annotation's extension line and underline. - Standard_EXPORT void SetLineWidth (const Standard_Real theLineWidth); + Standard_EXPORT void SetLineWidth( const Standard_Real theLineWidth ); //! Returns line width for drawing the annotation's extension line and underline. - Standard_Real LineWidth() const { return myDrawer->LineAspect()->Aspect()->Width(); } + Standard_Real GetLineWidth() const { return myDrawer->LineAspect()->Aspect()->Width(); } + + //! Sets style of connection line. + Standard_EXPORT void SetLineStyle( const Aspect_TypeOfLine theStyle ); + + //! Retusn style of connection line. + Aspect_TypeOfLine GetLineStyle() const { return myDrawer->LineAspect()->Aspect()->Type(); } //! Sets annotation auto-hiding option. //! \param theIsEnable [in] the option flag. If passed true, the annotation //! will be automatically hidden in the view if the attachment point //! goes outside of the view. - void SetAutoHide (const Standard_Boolean theIsEnable) { myIsAutoHide = theIsEnable; } + void SetAutoHide( const Standard_Boolean theIsEnable ) { myIsAutoHide = theIsEnable; } //! Returns current state of the auto-hiding option. Standard_Boolean GetAutoHide() const { return myIsAutoHide; } //! Sets highlight mode used for display of presentation. //! \param theMode [in] the one of the supported highlight modes. - void SetHighlightMode (const HighlightMode theMode) { myHilightMode = theMode; } + void SetHighlightMode( const HighlightMode theMode ) { myHilightMode = theMode; } //! Returns highlight mode HighlightMode GetHilightMode() const { return myHilightMode; } private: - Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode = 0) Standard_OVERRIDE; + void UpdatePersistence(); + + virtual void Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode = 0 ) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, - const Standard_Integer theMode) Standard_OVERRIDE; + virtual void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection, + const Standard_Integer theMode ) Standard_OVERRIDE; - virtual void SetLocalTransformation (const gp_Trsf& theTransformation) Standard_OVERRIDE {} + virtual void SetLocalTransformation( const gp_Trsf& theTransformation ) Standard_OVERRIDE {} - virtual void SetTransformPersistence (const Graphic3d_TransModeFlags& theFlag, - const gp_Pnt& thePoint = gp_Pnt (0.0, 0.0, 0.0)) Standard_OVERRIDE {} + virtual void SetTransformPersistence( const Graphic3d_TransModeFlags& theFlag, + const gp_Pnt& thePoint = gp_Pnt (0.0, 0.0, 0.0) ) Standard_OVERRIDE {} NCollection_Handle TextBoundingBox() const; @@ -192,18 +211,18 @@ private: //! \param theAnnotation [in] the instance of interactive presentation class. //! \param theTextHeight [in] the height of the text label. //! \param theDriver [in] the instance of graphical driver required for initialization. - OpenGl_Annotation (GEOM_Annotation* theAnnotation, + OpenGl_Annotation( GEOM_Annotation* theAnnotation, const Standard_Integer theTextHeight, - const OpenGl_GraphicDriver* theDriver); + const OpenGl_GraphicDriver* theDriver ); //! Destructor. Releases GL resources with NULL context. virtual ~OpenGl_Annotation(); //! Releases GL resources with the given GL context. - virtual void Release (OpenGl_Context* theCtx) Standard_OVERRIDE; + virtual void Release( OpenGl_Context* theCtx ) Standard_OVERRIDE; //! Renders the annotation graphical elements. - virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE; + virtual void Render( const Handle(OpenGl_Workspace)& theWorkspace ) const Standard_OVERRIDE; private: @@ -221,6 +240,6 @@ private: friend class OpenGl_Annotation; // allow opengl element to get private data and invoke callback methods }; -DEFINE_STANDARD_HANDLE (GEOM_Annotation, AIS_InteractiveObject) +DEFINE_STANDARD_HANDLE( GEOM_Annotation, AIS_InteractiveObject ) #endif diff --git a/src/OBJECT/GEOM_Constants.cxx b/src/OBJECT/GEOM_Constants.cxx index 17b91bade..957753d48 100644 --- a/src/OBJECT/GEOM_Constants.cxx +++ b/src/OBJECT/GEOM_Constants.cxx @@ -104,7 +104,9 @@ namespace GEOM // texture "Texture", // - // dimensions - "Dimensions" // - + "Dimensions", // - + // shape annotations + "ShapeAnnotations" // - }; return ( type >= GEOM::Visibility && type <= GEOM::LastProperty ) ? names[type] : QString(); } diff --git a/src/OBJECT/GEOM_Constants.h b/src/OBJECT/GEOM_Constants.h index 873f6b2a5..de6c72909 100644 --- a/src/OBJECT/GEOM_Constants.h +++ b/src/OBJECT/GEOM_Constants.h @@ -58,7 +58,8 @@ namespace GEOM OutlineColor, Texture, Dimensions, - LastProperty = Dimensions, + ShapeAnnotations, + LastProperty = ShapeAnnotations, }; GEOM_OBJECT_EXPORT double minDeflection();