From: vsr Date: Wed, 27 Apr 2011 15:30:31 +0000 (+0000) Subject: IPAL 22430: TC6.3.0: impossible to change color for group of vertices X-Git-Tag: V6_3_0b1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=52744dc183cf849139f1567a6908e4045e639093;p=modules%2Fgeom.git IPAL 22430: TC6.3.0: impossible to change color for group of vertices --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 1f3a7e09a..e3ad553b0 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -139,7 +139,7 @@ static inline int getTopAbsMode( const int implType ) } } -static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin ) +int GEOM_Displayer::getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin ) { if ( shape.IsNull() ) return TopAbs_SHAPE; @@ -163,7 +163,7 @@ static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin ) return ret; } -static bool isCompoundOfVertices( const TopoDS_Shape& theShape ) +bool GEOM_Displayer::isCompoundOfVertices( const TopoDS_Shape& theShape ) { return theShape.ShapeType() == TopAbs_COMPOUND && getMinMaxShapeType( theShape, false ) == TopAbs_VERTEX; } diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 56676d375..b5fa013f9 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -167,6 +167,13 @@ public: /*Get color of the geom object*/ static SALOMEDS::Color getColor(GEOM::GEOM_Object_var aGeomObject, bool& hasColor); + /* Get minimum or maximum enclosed shape type */ + static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin ); + + /* Check if the object is a vertex or a compound of vertices */ + static bool isCompoundOfVertices( const TopoDS_Shape& theShape ); + + /* Builds presentation of not published object */ virtual SALOME_Prs* buildSubshapePresentation(const TopoDS_Shape& aShape, const QString&, diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 278e4785f..a754c01c3 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -292,7 +292,8 @@ void GEOMToolsGUI::OnColor() if ( io->IsKind( STANDARD_TYPE(AIS_Shape) ) ) { TopoDS_Shape theShape = Handle(AIS_Shape)::DownCast( io )->Shape(); - if (theShape.ShapeType() == TopAbs_VERTEX) { + bool onlyVertex = (theShape.ShapeType() == TopAbs_VERTEX || GEOM_Displayer::isCompoundOfVertices( theShape )); + if (onlyVertex) { // Set color for a point Handle(AIS_Drawer) aCurDrawer = io->Attributes();