+/// Step between icons
+static const double MyDist = 0.02;
+
+
+//**************************************************************
+//! Redefinition of OpenGl_Element
+class SketcherPrs_SymbolArray: public OpenGl_PrimitiveArray
+{
+public:
+ SketcherPrs_SymbolArray(const OpenGl_GraphicDriver* theDriver,
+ const Handle(SketcherPrs_SymbolPrs)& theObj, const Handle(AIS_InteractiveContext)& theCtx)
+ :OpenGl_PrimitiveArray(theDriver, theObj->myPntArray->Type(), theObj->myPntArray->Indices(),
+ theObj->myPntArray->Attributes(), theObj->myPntArray->Bounds()), myObj(theObj),
+ myContext(theCtx) {}
+
+ virtual void Render(const Handle(OpenGl_Workspace)& theWorkspace) const
+ {
+ ModelAPI_Feature* aConstraint = myObj->feature();
+ if (aConstraint->data().get() && aConstraint->data()->isValid()) {
+ Handle(OpenGl_View) aView = theWorkspace->View();
+ double aScale = aView->Camera()->Scale();
+ // Update points coordinate taking the viewer scale into account
+ myObj->updateIfReadyToDisplay(MyDist * aScale, myObj->myIsCustomColor);
+ if (myIsVboInit) {
+ if (myVboAttribs) {
+ const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
+ Handle(Graphic3d_Buffer) aAttr = myObj->myPntArray->Attributes();
+ myVboAttribs->init(aCtx, 0, aAttr->NbElements,
+ aAttr->Data(), GL_NONE, aAttr->Stride);
+ } else
+ myIsVboInit = false;
+ } else {
+ myAttribs = myObj->myPntArray->Attributes();
+ myIndices = myObj->myPntArray->Indices();
+ myBounds = myObj->myPntArray->Bounds();
+ }
+ }
+ OpenGl_PrimitiveArray::Render(theWorkspace);
+
+ // Update selection position only if there is no selected object
+ // because it can corrupt selection of other objects
+ if ((myContext->NbCurrents() == 0) && (myContext->NbSelected() == 0)) {
+ myContext->MainSelector()->RebuildSensitivesTree(myObj);
+ myContext->MainSelector()->RebuildObjectsTree (false);
+ }
+ }
+
+private:
+ Handle(SketcherPrs_SymbolPrs) myObj;
+ Handle(AIS_InteractiveContext) myContext;
+};
+
+
+//*****************************************************************************