IPAL 22430: TC6.3.0: impossible to change color for group of vertices

This commit is contained in:
vsr 2011-04-27 15:30:31 +00:00
parent ac23e51c26
commit 52744dc183
3 changed files with 11 additions and 3 deletions

View 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;
}

View 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&,

View 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();