Salome HOME
lot 10 - warnings for DTM - untested
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_BathymetryPrs.cxx
index 1334896f578f2d79008f9043460feb2898485fbe..eeb490123ca757d51e7eb4cfabb858fa4b4f3401 100644 (file)
@@ -17,6 +17,8 @@
 //
 
 #include <HYDROGUI_BathymetryPrs.h>
+#include <HYDROGUI_Tool.h>
+
 #include <Prs3d_Root.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_Text.hxx>
 #include <Select3D_SensitivePoint.hxx>
 #include <Graphic3d_ArrayOfPolylines.hxx>
 #include <Graphic3d_ArrayOfPoints.hxx>
+#include <Image_PixMap.hxx>
+#include <Graphic3d_MarkerImage.hxx>
+
+#include <QImage>
 
 const int BATH_HIGHLIGHT_MODE = 10;
 
-HYDROGUI_BathymetryPrs::HYDROGUI_BathymetryPrs()
+HYDROGUI_BathymetryPrs::HYDROGUI_BathymetryPrs( const HYDROGUI_ShapeBathymetry* theShape )
+  : myShape( theShape )
 {
   SetHilightMode( BATH_HIGHLIGHT_MODE );
   SetAutoHilight( Standard_True );
@@ -38,6 +45,11 @@ HYDROGUI_BathymetryPrs::~HYDROGUI_BathymetryPrs()
 {
 }
 
+HYDROGUI_ShapeBathymetry* HYDROGUI_BathymetryPrs::GetShape() const
+{
+  return const_cast<HYDROGUI_ShapeBathymetry*>( myShape );
+}
+
 void HYDROGUI_BathymetryPrs::UpdateBound()
 {
   Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
@@ -77,6 +89,7 @@ void HYDROGUI_BathymetryPrs::Compute( const Handle(PrsMgr_PresentationManager3d)
     if( myBound.IsVoid() )
       UpdateBound();
 
+
     if( myBound.IsVoid() || 
         myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
         myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
@@ -119,7 +132,13 @@ void HYDROGUI_BathymetryPrs::Compute( const Handle(PrsMgr_PresentationManager3d)
   }
   else
   {
+       Handle(Graphic3d_AspectMarker3d) anAspect = new Graphic3d_AspectMarker3d( Aspect_TOM_USERDEFINED, Quantity_NOC_WHITE, 1.0 );
+       QImage qtMark( 4, 4, QImage::Format_RGB888 );
+       Handle(Image_PixMap) aMark = HYDROGUI_Tool::Pixmap( qtMark ); 
+       Handle(Graphic3d_MarkerImage) gMark = new Graphic3d_MarkerImage(aMark);
+       anAspect->SetMarkerImage(gMark);
     AIS_PointCloud::Compute( thePresentationManager, thePresentation, theMode );
+       aGroup->SetGroupPrimitivesAspect( anAspect );
 
     Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
     if( !myTextIndices.empty() && !points.IsNull() )
@@ -241,7 +260,7 @@ void HYDROGUI_BathymetryPrs::ClearSelected()
     aSelectPrs->Clear(); 
 }
 
-void HYDROGUI_BathymetryPrs::SetTextLabels( const QList<int>& theTextIndices )
+void HYDROGUI_BathymetryPrs::SetTextLabels( const QVector<int>& theTextIndices )
 {
   myTextIndices = theTextIndices;
 }