]> OCCT Git - occt-copy.git/commitdiff
0023397: Marker aspect doesn't applied to points drawn by Primitive Arrays
authorkgv <kgv@opencascade.com>
Wed, 22 Aug 2012 07:36:50 +0000 (11:36 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 24 Aug 2012 10:48:55 +0000 (14:48 +0400)
Applying color and point size (marker type currently ignored).

src/OpenGl/OpenGl_Marker.cxx
src/OpenGl/OpenGl_MarkerSet.cxx
src/OpenGl/OpenGl_PrimitiveArray.cxx
src/OpenGl/OpenGl_Workspace_5.cxx

index 1f19e07ba43c97905f1553c88d5e049fb5cf67e7..2462265f95fabbe6010775233407a84cf7109da2 100644 (file)
@@ -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();
index c2a4dd41630f2bbee9d72e407437f408c09acedc..09231f5786275d5e1022513f959266acce238688 100644 (file)
@@ -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 );
index 63457f082d5d6ed7c2b69113e565ace1dd9df259..8bb73e82689ab581dd8858d58d5c706d4ed7151d 100755 (executable)
@@ -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)
index 8e62005f0a454b80454db58cd51d7d104013463a..7158f9c57d964c1d27041a0f4586c4a78180d087 100644 (file)
@@ -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;