Salome HOME
Update translation files from Crowdin
[samples/light.git] / src / LIGHTGUI / LIGHTGUI_TextPrs.cxx
index 7e869d114a35b94a406b8459bc77099fc24f0d42..444e823a75ef73014de0b84915631260570b73d9 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2005-2012  OPEN CASCADE
+// Copyright (C) 2005-2014  OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include <SelectMgr_EntityOwner.hxx>
 #include <Select3D_SensitivePoint.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE > 0x060505
+#include <Graphic3d_ArrayOfPoints.hxx>
+#endif
+
 /*!
   \class LIGHTGUI_TextPrs
   \brief Presentation object for the string line.
@@ -79,14 +85,24 @@ void LIGHTGUI_TextPrs::Compute( const Handle(PrsMgr_PresentationManager3d)& /*pr
                                 const Standard_Integer /*mode*/ )
 {
   Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( thePrs );
+#if OCC_VERSION_LARGE <= 0x060504
   aGroup->BeginPrimitives();
+#endif
   Graphic3d_Vertex aTextPos;
   //  aTextPos.SetCoord( myPos.X(), aPos.Y(), aPos.Z() );
   aTextPos.SetCoord( myPos.X(), myPos.Y(), myPos.Z() );
+#if OCC_VERSION_LARGE <= 0x060505
   aGroup->Marker( aTextPos );
+#else
+  Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
+  anArrayOfPoints->AddVertex(myPos.X(), myPos.Y(), myPos.Z());
+  aGroup->AddPrimitiveArray(anArrayOfPoints);
+#endif
   //  aGroup->Text( aNodeIter.Value().ToCString(), aTextPos, aCharSize );
   aGroup->Text( myString, aTextPos, aCharSize );
+#if OCC_VERSION_LARGE <= 0x060504
   aGroup->EndPrimitives();
+#endif
 }
 
 /*!