From 17f65eb229bff0c3d33901d31604e1da2fa4d85e Mon Sep 17 00:00:00 2001 From: kgv Date: Wed, 22 Aug 2012 11:36:50 +0400 Subject: [PATCH] 0023397: Marker aspect doesn't applied to points drawn by Primitive Arrays Applying color and point size (marker type currently ignored). --- src/OpenGl/OpenGl_Marker.cxx | 1 - src/OpenGl/OpenGl_MarkerSet.cxx | 1 - src/OpenGl/OpenGl_PrimitiveArray.cxx | 7 ++++--- src/OpenGl/OpenGl_Workspace_5.cxx | 11 +++++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/OpenGl/OpenGl_Marker.cxx b/src/OpenGl/OpenGl_Marker.cxx index 1f19e07ba4..2462265f95 100644 --- a/src/OpenGl/OpenGl_Marker.cxx +++ b/src/OpenGl/OpenGl_Marker.cxx @@ -52,7 +52,6 @@ void OpenGl_Marker::Render (const Handle(OpenGl_Workspace) &AWorkspace) const } case Aspect_TOM_POINT : { - glPointSize( aspect_marker->Scale() ); glBegin( GL_POINTS ); glVertex3fv( myPoint.xyz ); glEnd(); diff --git a/src/OpenGl/OpenGl_MarkerSet.cxx b/src/OpenGl/OpenGl_MarkerSet.cxx index c2a4dd4163..09231f5786 100644 --- a/src/OpenGl/OpenGl_MarkerSet.cxx +++ b/src/OpenGl/OpenGl_MarkerSet.cxx @@ -70,7 +70,6 @@ void OpenGl_MarkerSet::Render (const Handle(OpenGl_Workspace) &AWorkspace) const } case Aspect_TOM_POINT : { - glPointSize( aspect_marker->Scale() ); glBegin( GL_POINTS ); for( i = 0, ptr = myPoints; i < myNbPoints; i++, ptr++ ) glVertex3fv( ptr->xyz ); diff --git a/src/OpenGl/OpenGl_PrimitiveArray.cxx b/src/OpenGl/OpenGl_PrimitiveArray.cxx index 63457f082d..8bb73e8268 100755 --- a/src/OpenGl/OpenGl_PrimitiveArray.cxx +++ b/src/OpenGl/OpenGl_PrimitiveArray.cxx @@ -1615,13 +1615,14 @@ void OpenGl_PrimitiveArray::Render (const Handle(OpenGl_Workspace)& theWorkspace break; } - const OpenGl_AspectFace* anAspectFace = theWorkspace->AspectFace (Standard_True); - const OpenGl_AspectLine* anAspectLine = theWorkspace->AspectLine (Standard_True); + const OpenGl_AspectFace* anAspectFace = theWorkspace->AspectFace (Standard_True); + const OpenGl_AspectLine* anAspectLine = theWorkspace->AspectLine (Standard_True); + const OpenGl_AspectMarker* anAspectMarker = theWorkspace->AspectMarker (myPArray->type == TelPointsArrayType); Tint aFrontLightingModel = anAspectFace->Context().IntFront.color_mask; const TEL_COLOUR* anInteriorColor = &anAspectFace->Context().IntFront.matcol; const TEL_COLOUR* anEdgeColor = &anAspectFace->AspectEdge()->Color(); - const TEL_COLOUR* aLineColor = &anAspectLine->Color(); + const TEL_COLOUR* aLineColor = (myPArray->type == TelPointsArrayType) ? &anAspectMarker->Color() : &anAspectLine->Color(); // Use highlight colors if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) diff --git a/src/OpenGl/OpenGl_Workspace_5.cxx b/src/OpenGl/OpenGl_Workspace_5.cxx index 8e62005f0a..7158f9c57d 100644 --- a/src/OpenGl/OpenGl_Workspace_5.cxx +++ b/src/OpenGl/OpenGl_Workspace_5.cxx @@ -598,10 +598,17 @@ const OpenGl_AspectFace * OpenGl_Workspace::AspectFace(const Standard_Boolean Wi /*----------------------------------------------------------------------*/ -const OpenGl_AspectMarker * OpenGl_Workspace::AspectMarker(const Standard_Boolean WithApply) +const OpenGl_AspectMarker* OpenGl_Workspace::AspectMarker (const Standard_Boolean theToApply) { - if ( WithApply && (AspectMarker_set != AspectMarker_applied) ) + if (theToApply && (AspectMarker_set != AspectMarker_applied)) { + if (!AspectMarker_applied || (AspectMarker_set->Scale() != AspectMarker_applied->Scale())) + { + glPointSize (AspectMarker_set->Scale()); + #ifdef HAVE_GL2PS + gl2psPointSize (AspectMarker_set->Scale()); + #endif + } AspectMarker_applied = AspectMarker_set; } return AspectMarker_set; -- 2.20.1