+ if( theMode == 1 )
+ {
+ Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
+ int n = points.IsNull() ? 0 : points->VertexNumber();
+ for( int i=1; i<=n; i++ )
+ {
+ gp_Pnt p = points->Vertice( i );
+ Handle(HYDROGUI_BathymetryPointOwner) anOwner = new HYDROGUI_BathymetryPointOwner( this, i );
+ Handle(Select3D_SensitivePoint) aSensitivePoint = new Select3D_SensitivePoint( anOwner, p );
+ theSelection->Add( aSensitivePoint );
+ }
+ }
+}
+
+int HYDROGUI_BathymetryPrs::NbPoints() const
+{
+ Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
+ int n = points.IsNull() ? 0 : points->VertexNumber();
+ return n;
+}
+
+gp_Pnt HYDROGUI_BathymetryPrs::GetPoint( int theIndex ) const
+{
+ Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
+ if( points.IsNull() )
+ return gp_Pnt();
+ else
+ return points->Vertice( theIndex );
+}
+
+void HYDROGUI_BathymetryPrs::AddPoint( const Handle(Graphic3d_ArrayOfPoints)& thePoints,
+ const Handle(SelectMgr_EntityOwner)& theOwner )
+{
+ Handle(HYDROGUI_BathymetryPointOwner) anOwner = Handle(HYDROGUI_BathymetryPointOwner)::DownCast( theOwner );
+ if( anOwner.IsNull() )
+ return;
+ gp_Pnt p = GetPoint( anOwner->GetIndex() );
+ thePoints->AddVertex( p );
+}
+
+void HYDROGUI_BathymetryPrs::HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
+ const Handle(Graphic3d_HighlightStyle)& theColor,
+ const Handle(SelectMgr_EntityOwner)& theOwner )
+{
+ Handle(Prs3d_Presentation) aHilightPrs = GetHilightPresentation( thePM );
+ aHilightPrs->SetZLayer( Graphic3d_ZLayerId_Topmost );
+ aHilightPrs->Clear();
+ Handle(Graphic3d_ArrayOfPoints) points = new Graphic3d_ArrayOfPoints( 1 );
+ AddPoint( points, theOwner );
+
+ Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aHilightPrs );
+ Handle(Graphic3d_AspectMarker3d) anAspect = new Graphic3d_AspectMarker3d( Aspect_TOM_X, Quantity_NOC_WHITE, 1.0 );
+ aGroup->SetGroupPrimitivesAspect( anAspect );
+ aGroup->AddPrimitiveArray( points );
+
+ if( thePM->IsImmediateModeOn() )
+ thePM->AddToImmediateList( aHilightPrs );
+}
+
+void HYDROGUI_BathymetryPrs::HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePM,
+ const SelectMgr_SequenceOfOwner& theOwners )
+{
+ Handle(Prs3d_Presentation) aSelectPrs = GetSelectPresentation( thePM );
+ aSelectPrs->SetZLayer( Graphic3d_ZLayerId_Topmost );
+ aSelectPrs->Clear();
+
+ Handle(Graphic3d_ArrayOfPoints) points = new Graphic3d_ArrayOfPoints( theOwners.Size() );
+ for( int i=theOwners.Lower(); i<=theOwners.Upper(); i++ )
+ AddPoint( points, theOwners.Value( i ) );
+
+ Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aSelectPrs );
+ Handle(Graphic3d_AspectMarker3d) anAspect = new Graphic3d_AspectMarker3d( Aspect_TOM_X, Quantity_NOC_WHITE, 1.0 );
+ aGroup->SetGroupPrimitivesAspect( anAspect );
+ aGroup->AddPrimitiveArray( points );
+
+ aSelectPrs->SetDisplayPriority(9);
+ aSelectPrs->Display();
+}
+
+void HYDROGUI_BathymetryPrs::ClearSelected()
+{
+ Handle(Prs3d_Presentation) aSelectPrs = GetSelectPresentation( NULL );
+ if( !aSelectPrs.IsNull() )
+ aSelectPrs->Clear();
+}
+
+void HYDROGUI_BathymetryPrs::SetTextLabels( const QList<int>& theTextIndices )
+{
+ myTextIndices = theTextIndices;
+}
+
+
+
+
+
+
+
+HYDROGUI_BathymetryPointOwner::HYDROGUI_BathymetryPointOwner
+ ( const Handle(HYDROGUI_BathymetryPrs)& theBathymetry, int theIndex )
+ : SelectMgr_EntityOwner( Handle(SelectMgr_SelectableObject)::DownCast( theBathymetry ), 0 ),
+ myIndex( theIndex )
+{
+}
+
+HYDROGUI_BathymetryPointOwner::~HYDROGUI_BathymetryPointOwner()
+{
+}
+
+Standard_Boolean HYDROGUI_BathymetryPointOwner::IsAutoHilight() const
+{
+ return Standard_False;
+}
+
+int HYDROGUI_BathymetryPointOwner::GetIndex() const
+{
+ return myIndex;