Salome HOME
IPAL 22430: TC6.3.0: impossible to change color for group of vertices
authorvsr <vsr@opencascade.com>
Wed, 27 Apr 2011 15:30:31 +0000 (15:30 +0000)
committervsr <vsr@opencascade.com>
Wed, 27 Apr 2011 15:30:31 +0000 (15:30 +0000)
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_Displayer.h
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx

index 1f3a7e09a93421187ee93166890cbe0de4a285d3..e3ad553b06d381988d7eb2d4d3c2d4f1c880c28a 100644 (file)
@@ -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;
 }
index 56676d37504f83dc63503d09fd4dac736049671d..b5fa013f9fed37d48a510511bf9aeb06ec3e3be7 100644 (file)
@@ -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&,
index 278e4785fb0fb5224d7a86408fa64b39298b6f7e..a754c01c3e2cde256acf67f866cf0b3f1885f8ad 100644 (file)
@@ -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();