//
#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_False );
+ SetAutoHilight( Standard_True );
}
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();
if( myBound.IsVoid() )
UpdateBound();
+
if( myBound.IsVoid() ||
myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
}
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() )
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 );
}
aSelectPrs->Clear();
}
-void HYDROGUI_BathymetryPrs::SetTextLabels( const QList<int>& theTextIndices )
+void HYDROGUI_BathymetryPrs::SetTextLabels( const QVector<int>& theTextIndices )
{
myTextIndices = theTextIndices;
}