static SUIT_ViewWindow* getActiveView();
protected:
+ typedef std::list<SALOME_Prs*> PrsList;
+
static GEOM::GEOM_Gen_ptr getGeomEngine();
void display ( const ObjectList&, const bool = true );
const bool = true );
void erasePreview ( const bool = true );
+ const PrsList& getPreview() const { return myPreview; }
+
void localSelection( const ObjectList&, const std::list<int> );
void localSelection( const ObjectList&, const int );
void localSelection( GEOM::GEOM_Object_ptr, const std::list<int> );
void clearShapeBuffer( GEOM::GEOM_Object_ptr );
private:
- typedef std::list<SALOME_Prs*> PrsList;
PrsList myPreview;
GEOM_Displayer* myDisplayer;
#include <GEOM_Annotation.hxx>\r
#include <SALOMEDSImpl_AttributeParameter.hxx>\r
\r
-// OCCT includes\r
-#include <gp_Ax3.hxx>\r
-\r
// STL includes\r
#include <string>\r
#include <vector>\r
// purpose : \r
//=================================================================================\r
void GEOMGUI_AnnotationAttrs::Append( const Properties& theProps )\r
+{\r
+ this->Append( theProps, gp_Ax3() );\r
+}\r
+\r
+//=================================================================================\r
+// function : Append\r
+// purpose : \r
+//=================================================================================\r
+void GEOMGUI_AnnotationAttrs::Append( const Properties& theProps, const gp_Ax3& theShapeLCS )\r
{\r
const int aCount = this->GetNbAnnotation();\r
this->SetNbAnnotation( aCount + 1 );\r
- this->SetProperties( aCount, theProps );\r
+ this->SetProperties( aCount, theProps, theShapeLCS );\r
}\r
\r
//=================================================================================\r
//=================================================================================\r
void GEOMGUI_AnnotationAttrs::SetProperties( const int theIndex, const Properties& theProps )\r
{\r
+ this->SetProperties( theIndex, theProps, gp_Ax3() );\r
+}\r
+\r
+//=================================================================================\r
+// function : SetProperties\r
+// purpose : \r
+//=================================================================================\r
+void GEOMGUI_AnnotationAttrs::SetProperties( const int theIndex, const Properties& theProps,\r
+ const gp_Ax3& theShapeLCS )\r
+{\r
+ gp_Trsf aToShapeLCS;\r
+ aToShapeLCS.SetTransformation( gp_Ax3(), theShapeLCS );\r
+\r
this->SetName( theIndex, theProps.Name );\r
this->SetText( theIndex, theProps.Text );\r
this->SetIsVisible( theIndex, theProps.IsVisible );\r
this->SetIsScreenFixed( theIndex, theProps.IsScreenFixed );\r
- this->SetPosition( theIndex, theProps.Position );\r
- this->SetAttach( theIndex, theProps.Attach );\r
this->SetShapeSel( theIndex, theProps.ShapeType, theProps.ShapeIndex );\r
+ this->SetAttach( theIndex, theProps.Attach.Transformed( aToShapeLCS ) );\r
+ this->SetPosition( theIndex, (theProps.IsScreenFixed) ? \r
+ theProps.Position : theProps.Position.Transformed( aToShapeLCS ) );\r
}\r
\r
//=================================================================================\r
//=================================================================================\r
void GEOMGUI_AnnotationAttrs::SetupPresentation( const Handle(GEOM_Annotation)& thePresentation,\r
const Properties& theProps,\r
- const gp_Ax3& theLCS )\r
+ const gp_Ax3& theShapeLCS )\r
{\r
- gp_Trsf aToLCS;\r
- aToLCS.SetTransformation( theLCS, gp_Ax3() );\r
+ gp_Trsf aFromShapeLCS;\r
+ aFromShapeLCS.SetTransformation( theShapeLCS, gp_Ax3() );\r
\r
TCollection_ExtendedString aText;\r
for (int i = 0; i < (int)theProps.Text.length(); i++ )\r
aText.Insert( i + 1, theProps.Text[ i ].unicode() );\r
- //\r
+\r
thePresentation->SetText( aText );\r
thePresentation->SetScreenFixed( theProps.IsScreenFixed );\r
- thePresentation->SetPosition( theProps.Position );\r
- thePresentation->SetAttachPoint( theProps.Attach.Transformed( aToLCS ) );\r
+ thePresentation->SetAttachPoint( theProps.Attach.Transformed( aFromShapeLCS ) );\r
+ thePresentation->SetPosition( (theProps.IsScreenFixed) ? \r
+ theProps.Position : theProps.Position.Transformed( aFromShapeLCS ) );\r
}\r
\r
//=================================================================================\r
//=================================================================================\r
void GEOMGUI_AnnotationAttrs::SetupPresentation( const Handle(GEOM_Annotation)& thePresentation,\r
const int theIndex,\r
- const gp_Ax3& theLCS )\r
+ const gp_Ax3& theShapeLCS )\r
{\r
Properties aProps;\r
this->GetProperties( theIndex, aProps );\r
- this->SetupPresentation( thePresentation, aProps, theLCS );\r
+ this->SetupPresentation( thePresentation, aProps, theShapeLCS );\r
}\r
#include <SalomeApp_Study.h>
// OCCT includes
+#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Transient.hxx>
//! Setup parameters of the annotation presentation with the properties given.
//! @param thePresentation [in] the presentation to setup.
//! @param theProps [in] the set of properties.
- //! @param theLCS [in] the local coordinate system of the shape.
+ //! @param theShapeLCS [in] the local coordinate system of the shape.
GEOMGUI_EXPORT static void SetupPresentation( const Handle(GEOM_Annotation)& thePresentation,
const Properties& theProps,
- const gp_Ax3& theLCS );
+ const gp_Ax3& theShapeLCS );
//! Setup parameters of the annotation presentation with the properties of a definition.
//! @param thePresentation [in] the presentation to setup.
//! @param theIndex [in] the index of the annotation definition.
- //! @param theLCS [in] the local coordinate system of the shape.
+ //! @param theShapeLCS [in] the local coordinate system of the shape.
GEOMGUI_EXPORT void SetupPresentation( const Handle(GEOM_Annotation)& thePresentation,
const int theIndex,
- const gp_Ax3& theLCS );
+ const gp_Ax3& theShapeLCS );
public:
//! Appends new annotation definition with the given properties.
GEOMGUI_EXPORT void Append( const Properties& theProps );
+ //! Appends new annotation definition with the given properties and converts
+ //! position and attachment points to the given shape's local frame of reference.
+ //! @param theShapeLCS [in] the position of shape's local frame of reference with respect
+ //! to the world frame of reference.
+ GEOMGUI_EXPORT void Append( const Properties& theProps, const gp_Ax3& theShapeLCS );
+
//! Sets complete properties of an annotation definition.
//! @param theIndex [in] the index of the annotation definition.
//! @param theProps [in] the structure containing the properties.
GEOMGUI_EXPORT void SetProperties( const int theIndex, const Properties& theProps );
+ //! Sets complete properties of an annotation definition with converting
+ //! position and attachment points to the given shape's local frame
+ //! of reference.
+ //! @param theIndex [in] the index of the annotation definition.
+ //! @param theProps [in] the structure containing the properties.
+ //! @param theShapeLCS [in] the position of shape's local frame of reference with respect
+ //! to the world frame of reference.
+ GEOMGUI_EXPORT void SetProperties( const int theIndex, const Properties& theProps, const gp_Ax3& theShapeLCS );
+
//! Returns complete properties of an annotation definition.
//! @param theIndex [in] the index of the annotation definition.
//! @param theProps [out] the structure containing the properties.
aPresentation->SetLineWidth( aLineWidth );
aPresentation->SetLineStyle( static_cast<Aspect_TypeOfLine>( aLineStyle ) );
aPresentation->SetAutoHide( isAutoHide ? Standard_True : Standard_False );
+ aPresentation->SetDepthCulling( Standard_True );
aListOfIO.Append( aPresentation );
}
#include <GEOMBase_Skeleton.h>
#include <GEOM_Displayer.h>
#include <GeometryGUI.h>
-#include <GEOM_Annotation.hxx>
#include <SOCC_Prs.h>
#include <SOCC_ViewModel.h>
myInteractor = new MeasureGUI_AnnotationInteractor( theGeometryGUI, parent );
myInteractor->Enable();
+ connect( myInteractor, SIGNAL( SignalInteractionFinished( Handle_GEOM_Annotation ) ),
+ this, SLOT( onDragged( Handle_GEOM_Annotation ) ) );
+
Init();
}
activateSelection();
if ( !aNullShape ) {
- if ( !getPickedPoint( anAttachPoint ) )
- {
- TopoDS_Shape aShape;
- GEOMBase::GetShape( myShape.get(), aShape );
+
+ TopoDS_Shape aShape;
+ GEOMBase::GetShape( myShape.get(), aShape );
+
+ if ( !getPickedPoint( anAttachPoint ) ) {
+
anAttachPoint = getAttachPoint( aShape );
}
+
+ gp_Ax3 aShapeLCS = gp_Ax3().Transformed( aShape.Location().Transformation() );
+ gp_Trsf aToShapeLCS;
+ aToShapeLCS.SetTransformation( gp_Ax3(), aShapeLCS );
+ anAttachPoint.Transform( aToShapeLCS );
}
} else if ( myEditCurrentArgument == mySubShapeName ) {
if ( !myShape->_is_nil() ) {
aSubShapeIndex = aMainMap.FindIndex( aSubShape );
}
- if ( !aSubShape.IsNull() )
- {
- if ( !getPickedPoint( anAttachPoint ) )
- {
+ if ( !aSubShape.IsNull() ) {
+
+ TopoDS_Shape aShape;
+ GEOMBase::GetShape( myShape.get(), aShape );
+
+ if ( !getPickedPoint( anAttachPoint ) ) {
+
anAttachPoint = getAttachPoint( aSubShape );
}
+
+ gp_Ax3 aShapeLCS = gp_Ax3().Transformed( aShape.Location().Transformation() );
+ gp_Trsf aToShapeLCS;
+ aToShapeLCS.SetTransformation( gp_Ax3(), aShapeLCS );
+ anAttachPoint.Transform( aToShapeLCS );
}
}
}
redisplayPreview();
}
+//=======================================================================
+//function : closeEvent
+//purpose :
+//=======================================================================
+void MeasureGUI_AnnotationDlg::closeEvent( QCloseEvent* theEv )
+{
+ if ( myInteractor ) {
+ myInteractor->Disable();
+ }
+ GEOMBase_Skeleton::closeEvent( theEv );
+}
+
//=======================================================================
//function : onTextChange
//purpose : change annotation text
redisplayPreview();
}
+//=================================================================================
+// function : onDragged
+// purpose :
+//=================================================================================
+void MeasureGUI_AnnotationDlg::onDragged( Handle_GEOM_Annotation theAnnotation )
+{
+ const PrsList& aPreview = getPreview();
+ PrsList::const_iterator anIt = aPreview.cbegin();
+ for ( ; anIt != aPreview.cend(); ++anIt ) {
+
+ AIS_ListOfInteractive aIObjects;
+ ((SOCC_Prs*)(*anIt))->GetObjects( aIObjects );
+ AIS_ListOfInteractive::Iterator aIOIt( aIObjects );
+ for ( ; aIOIt.More(); aIOIt.Next() ) {
+
+ if ( aIOIt.Value() == theAnnotation ) {
+
+ TopoDS_Shape aShape;
+ GEOMBase::GetShape( myShape.get(), aShape );
+ gp_Ax3 aShapeLCS = gp_Ax3().Transformed( aShape.Location().Transformation() );
+ gp_Trsf aToShapeLCS;
+ aToShapeLCS.SetTransformation( gp_Ax3(), aShapeLCS );
+
+ if ( !myAnnotationProperties.IsScreenFixed ) {
+ myAnnotationProperties.Position = theAnnotation->GetPosition().Transformed( aToShapeLCS );
+ }
+ else {
+ myAnnotationProperties.Position = theAnnotation->GetPosition();
+ }
+
+ return;
+ }
+ }
+ }
+}
+
#define RETURN_WITH_MSG( a, b ) \
if ( ( a ) ) { \
theMessage += ( b ); \
aPresentation->SetLineStyle( static_cast<Aspect_TypeOfLine>( aLineStyle ) );
aPresentation->SetAutoHide( isAutoHide ? Standard_True : Standard_False );
aPresentation->SetScreenFixed( myAnnotationProperties.IsScreenFixed );
-
+ aPresentation->SetDepthCulling( Standard_False );
+
TopoDS_Shape aShape;
GEOMBase::GetShape( myShape.get(), aShape );
gp_Ax3 aShapeLCS = gp_Ax3().Transformed( aShape.Location().Transformation() );
BRepBndLib::Add( aAttachShape, aBox );
const gp_Pnt aMin = aBox.CornerMin();
const gp_Pnt aMax = aBox.CornerMax();
- return gp_Pnt( aMin.X() + aMax.X() / 2.0,
- aMin.Y() + aMax.Y() / 2.0,
- aMin.Z() + aMax.Z() / 2.0 );
+ return gp_Pnt( (aMin.X() + aMax.X()) / 2.0,
+ (aMin.Y() + aMax.Y()) / 2.0,
+ (aMin.Z() + aMax.Z()) / 2.0 );
}
else if ( aAttachShape.ShapeType() == TopAbs_FACE )
{
#include <GEOMBase_Skeleton.h>
+#include <GEOM_Annotation.hxx>
#include <GEOM_Constants.h>
#include <GEOMGUI_AnnotationAttrs.h>
void updateSubShapeEnableState();
void redisplayPreview();
+ void closeEvent( QCloseEvent* theEv );
+
private slots:
void ClickOnOk();
bool ClickOnApply();
void onTypeChange();
void onSubShapeTypeChange();
+ void onDragged( Handle_GEOM_Annotation theAnnotation );
+
private:
void Init();
myActiveViewPort = NULL;
}
- myActiveIO.Nullify();
+ if ( !myActiveIO.IsNull() )
+ {
+ emit SignalInteractionFinished( myActiveIO );
+ myActiveIO.Nullify();
+ }
}
//=================================================================================
myActiveIO = aAnnotation;
myActiveIO->BeginDrag();
+ emit SignalInteractionStarted( myActiveIO );
+
return true;
}
anAISContext->UpdateCurrentViewer();
anAISContext->MoveTo( aMouseEv->pos().x(), aMouseEv->pos().y(), aView3d );
+ emit SignalInteractionFinished( myActiveIO );
+
mySelection.Clear();
myActiveIO.Nullify();
return (theEvent->type() == QEvent::MouseButtonRelease);
//! Disconnect interactor's event handler from the view window given.
void DisconnectView( SUIT_ViewWindow* theWindow );
+signals:
+
+ //! Emitted when interactor begins modification of the interactive object.
+ void SignalInteractionStarted( Handle_GEOM_Annotation theIO );
+
+ //! Emitted when interactor finished modification of the interactive object.
+ void SignalInteractionFinished( Handle_GEOM_Annotation theIO );
+
protected slots:
//! Handler for signal coming from GUI layer.
SetAutoHide( Standard_True );
SetHilightMode( HighlightAll );
SetMutable( Standard_True );
+ SetDepthCulling( Standard_True );
Handle(Prs3d_TextAspect) aTextAspect = new Prs3d_TextAspect();
aTextAspect->SetHeight( 20.0 );
new Prs3d_LineAspect( Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0 );
myDrawer->SetLineAspect( aLineAspect );
+ Handle(Prs3d_LineAspect) aHiddenLineAspect =
+ new Prs3d_LineAspect( Quantity_NOC_WHITE, Aspect_TOL_DOT, 1.0 );
+ myDrawer->SetHiddenLineAspect( aHiddenLineAspect );
+
Handle(Prs3d_PointAspect) aPointAspect =
new Prs3d_PointAspect( Aspect_TOM_POINT, Quantity_NOC_WHITE, 4.0 );
myDrawer->SetPointAspect( aPointAspect );
void GEOM_Annotation::SetLineColor( const Quantity_Color& theColor )
{
myDrawer->LineAspect()->SetColor( theColor );
+ myDrawer->HiddenLineAspect()->SetColor( theColor );
myDrawer->PointAspect()->SetColor( theColor );
SetToUpdate();
}
// =======================================================================
-// function : SetTextHeight
+// function : SetLineWidth
// purpose :
// =======================================================================
-void GEOM_Annotation::SetTextHeight( const Standard_Real theHeight )
+void GEOM_Annotation::SetLineWidth( const Standard_Real theLineWidth )
{
- if (GetTextHeight() != theHeight)
+ if ( GetLineWidth() != theLineWidth )
{
- myDrawer->TextAspect()->SetHeight( theHeight );
+ myDrawer->LineAspect()->SetWidth( theLineWidth );
+ myDrawer->HiddenLineAspect()->SetWidth( theLineWidth );
- SetToUpdate ();
+ SetToUpdate();
}
}
// =======================================================================
-// function : SetFontAspect
+// function : SetLineStyle
// purpose :
// =======================================================================
-void GEOM_Annotation::SetFontAspect( const Font_FontAspect theFontAspect )
+void GEOM_Annotation::SetLineStyle( const Aspect_TypeOfLine theStyle )
{
- if (GetFontAspect() != theFontAspect)
+ if ( GetLineStyle() != theStyle )
{
- myDrawer->TextAspect()->Aspect()->SetTextFontAspect( theFontAspect );
+ myDrawer->LineAspect()->SetTypeOfLine( theStyle );
SetToUpdate();
}
}
// =======================================================================
-// function : SetFont
+// function : SetHiddenLineStyle
// purpose :
// =======================================================================
-void GEOM_Annotation::SetFont( const TCollection_AsciiString& theFont )
+void GEOM_Annotation::SetHiddenLineStyle( const Aspect_TypeOfLine theStyle )
{
- if (GetFont() != theFont)
+ if ( GetHiddenLineStyle() != theStyle )
{
- myDrawer->TextAspect()->Aspect()->SetFont( theFont );
+ myDrawer->HiddenLineAspect()->SetTypeOfLine( theStyle );
SetToUpdate();
}
}
// =======================================================================
-// function : SetLineWidth
+// function : SetTextHeight
// purpose :
// =======================================================================
-void GEOM_Annotation::SetLineWidth( const Standard_Real theLineWidth )
+void GEOM_Annotation::SetTextHeight( const Standard_Real theHeight )
{
- if (GetLineWidth() != theLineWidth)
+ if ( GetTextHeight() != theHeight )
{
- myDrawer->LineAspect()->SetWidth( theLineWidth );
+ myDrawer->TextAspect()->SetHeight( theHeight );
SetToUpdate();
}
}
// =======================================================================
-// function : SetLineStyle
+// function : SetFontAspect
// purpose :
// =======================================================================
-void GEOM_Annotation::SetLineStyle( const Aspect_TypeOfLine theStyle )
+void GEOM_Annotation::SetFontAspect( const Font_FontAspect theFontAspect )
{
- if (GetLineStyle() != theStyle)
+ if ( GetFontAspect() != theFontAspect )
{
- myDrawer->LineAspect()->SetTypeOfLine( theStyle );
+ myDrawer->TextAspect()->Aspect()->SetTextFontAspect( theFontAspect );
+
+ SetToUpdate();
+ }
+}
+
+// =======================================================================
+// function : SetFont
+// purpose :
+// =======================================================================
+void GEOM_Annotation::SetFont( const TCollection_AsciiString& theFont )
+{
+ if ( GetFont() != theFont )
+ {
+ myDrawer->TextAspect()->Aspect()->SetFont( theFont );
+
+ SetToUpdate();
+ }
+}
+
+// =======================================================================
+// function : SetDepthCulling
+// purpose :
+// =======================================================================
+void GEOM_Annotation::SetDepthCulling( const Standard_Boolean theToEnable )
+{
+ if ( GetDepthCulling() != theToEnable )
+ {
+ myIsDepthCulling = theToEnable;
SetToUpdate();
}
OpenGl_Annotation* aAnnotationDraw =
new OpenGl_Annotation( this, static_cast<Standard_Integer>( anAsp->Height() ), aGroup->GlStruct()->GlDriver() );
- aGroup->AddElement( aAnnotationDraw );
+ aAnnotationDraw->SetDepthMode( 0 );
aGroup->SetGroupPrimitivesAspect( myDrawer->TextAspect()->Aspect() );
aGroup->SetGroupPrimitivesAspect( myDrawer->LineAspect()->Aspect() );
aGroup->SetGroupPrimitivesAspect( myDrawer->PointAspect()->Aspect() );
+ aGroup->AddElement( aAnnotationDraw );
+
+ if ( !myIsDepthCulling )
+ {
+ OpenGl_Annotation* aAnnotationDraw =
+ new OpenGl_Annotation( this, static_cast<Standard_Integer>( anAsp->Height() ), aGroup->GlStruct()->GlDriver() );
+
+ aAnnotationDraw->SetDepthMode( GL_GREATER );
+ aGroup->SetPrimitivesAspect( myDrawer->TextAspect()->Aspect() );
+ aGroup->SetPrimitivesAspect( myDrawer->HiddenLineAspect()->Aspect() );
+ aGroup->SetPrimitivesAspect( myDrawer->PointAspect()->Aspect() );
+ aGroup->AddElement( aAnnotationDraw );
+ }
Bnd_Box aBox = TextBoundingBox();
if ( myIsScreenFixed )
const Standard_Integer theTextHeight,
const OpenGl_GraphicDriver* theDriver )
: OpenGl_Element(),
+ myDepthMode( 0 ),
myAISObject( theAnnotation ),
myText( theAnnotation->myText.ToExtString() ),
myTextLineY( 0.f ),
theWorkspace->ApplyAspectLine();
}
+ GLint myOldDepthMode = 0;
+
+ if ( myDepthMode )
+ {
+ aContext->core11fwd->glGetIntegerv( GL_DEPTH_FUNC, &myOldDepthMode );
+ aContext->core11fwd->glDepthFunc( myDepthMode );
+ }
+
// -------------------------------------------------------------
// render text label in current persistence matrix and underline
// -------------------------------------------------------------
aContext->ModelWorldState.Pop();
aContext->WorldViewState.Pop();
- if (myAISObject->myIsScreenFixed)
+ if ( myOldDepthMode )
+ {
+ aContext->core11fwd->glDepthFunc( myOldDepthMode );
+ }
+
+ if ( myAISObject->myIsScreenFixed )
{
aContext->WorldViewState.Pop();
}
aContext->ApplyModelViewMatrix();
- if (toHighlight != theWorkspace->ToHighlight())
+ if ( toHighlight != theWorkspace->ToHighlight() )
{
theWorkspace->SetHighlight( toHighlight );
}
//! Returns color for the connection line.
Quantity_Color GetLineColor() const { return myDrawer->LineAspect()->Aspect()->Color(); }
+ //! Sets line width to be used for drawing the annotation's extension line and underline.
+ Standard_EXPORT void SetLineWidth( const Standard_Real theLineWidth );
+
+ //! Returns line width for drawing the annotation's extension line and underline.
+ 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 style of hidden connection line.
+ Standard_EXPORT void SetHiddenLineStyle( const Aspect_TypeOfLine theStyle );
+
+ //! Retusn style of hidden connection line.
+ Aspect_TypeOfLine GetHiddenLineStyle() const { return myDrawer->HiddenLineAspect()->Aspect()->Type(); }
+
//! Sets text height in pixels.
Standard_EXPORT void SetTextHeight( const Standard_Real theHeight );
//! 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 );
-
- //! Returns line width for drawing the annotation's extension line and underline.
- 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
//! Returns highlight mode
HighlightMode GetHilightMode() const { return myHilightMode; }
+ //! Sets special flag that allows disabling depth testing when rendering
+ //! the graphical presentation. When disable the hidden parts such as
+ //! lines and text become visible and a rendered with another drawing
+ //! aspect. This mode should be explicitly used with setting top layer
+ //! for the presentation. Otherwise the behavior is undefined.
+ Standard_EXPORT void SetDepthCulling (const Standard_Boolean theToEnable);
+
+ //! Returns depth culling state.
+ Standard_Boolean GetDepthCulling() const { return myIsDepthCulling; }
+
// Interactive dragging:
public:
gp_Pnt myStartPosition; //!< Position before starting dragging operation.
Standard_Boolean myIsScreenFixed; //!< Flag indicating whether "screen fixed" positioning mode is turned on or off.
Standard_Boolean myIsAutoHide; //!< Flag indicating whether "auto-hiding" option is turned on.
+ Standard_Boolean myIsDepthCulling; //!< Flag indiciating whether the "depth culling" is turned on.
HighlightMode myHilightMode; //!< Highlight mode for presentation.
TCollection_ExtendedString myText; //!< Text string of the label presentation.
//! Renders the annotation graphical elements.
virtual void Render( const Handle(OpenGl_Workspace)& theWorkspace ) const Standard_OVERRIDE;
+ void SetDepthMode( const int theMode ) { myDepthMode = theMode; }
+
private:
struct TextSize {
OpenGl_PrimitiveArray* myTextLineDraw; //!< Text underline draw element.
OpenGl_PrimitiveArray* myExtLineDraw; //!< Extension line draw element.
OpenGl_PrimitiveArray* myExtMarkerDraw; //!< Extension marker draw element.
+ int myDepthMode; //!< Depth mode for drawing hidden line presentation.
mutable float myTextLineY; //!< Text's underlines relative position.
mutable TextSize myTextSize; //!< Text's size parameters
mutable Graphic3d_Vec2 myTextUnderline; //!< Text's underline position.