class HYDROGUI_Arrow : public AIS_Shape
{
public:
+ enum Type { None, Triangle, Cone };
+
HYDROGUI_Arrow( const TopoDS_Edge& edge );
virtual ~HYDROGUI_Arrow();
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode = 0 );
+ Type GetType() const;
+ void SetType( Type );
+
+ int GetSize() const;
+ void SetSize( int );
+
public:
DEFINE_STANDARD_RTTIEXT(HYDROGUI_Arrow, AIS_Shape);
+
+private:
+ Type myType;
+ int mySize;
};
#endif
#include <HYDROData_ImmersibleZone.h>
#include <HYDROData_Tool.h>
#include <HYDROGUI_Shape.h>
+#include <HYDROGUI_Polyline.h>
#include <AIS_DisplayMode.hxx>
#include <AIS_PointCloud.hxx>
HYDROGUI_Shape* aNewPolylinePrs = new HYDROGUI_Shape( TestViewer::context(), aPolyline2d );
aNewPolylinePrs->update( true, true );
+
+ // Check default type
+ Handle(HYDROGUI_Arrow) arr = Handle(HYDROGUI_Arrow)::DownCast( aNewPolylinePrs->getAISObjects()[1] );
+ CPPUNIT_ASSERT_EQUAL( HYDROGUI_Arrow::Cone, arr->GetType() );
+
+
+ // Check polyline presentation with default (cone) arrow
+ TestViewer::eraseAll(true);
TestViewer::show( aPointsPrs, AIS_PointCloud::DM_Points, 0, true, "Polyline_Presentation" );
TestViewer::show( aPolyline2d->GetShape(), 0, true, Qt::red );
//TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" );
TestViewer::fitAll();
CPPUNIT_ASSERT_IMAGES
+
+ // Check polyline presentation with triangle arrow
+ arr->SetType( HYDROGUI_Arrow::Triangle );
+ TestViewer::eraseAll(true);
+ TestViewer::show( aPointsPrs, AIS_PointCloud::DM_Points, 0, true, "Polyline_Presentation_triangle" );
+ TestViewer::show( aPolyline2d->GetShape(), 0, true, Qt::red );
+ //TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" );
+ TestViewer::context()->RecomputePrsOnly( arr );
+ aNewPolylinePrs->display();
+ TestViewer::fitAll();
+ CPPUNIT_ASSERT_IMAGES
+
+ //QTest::qWait( 50000 );
aDoc->Close();
- //QTest::qWait( 50000 );
}
void test_HYDROData_PolylineXY::test_split_refs_627()