1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024131: TKOpenGL redesign GPU memory management for markers presentation

Introduce Point Sprites usage.
Graphic3d_Group - drop Marker(),MarkerSet() methods - markers should be drawn using AddPrimitiveArray.
Added new Draw Harness commands vcaps, vmarkerstest.
This commit is contained in:
kgv
2013-08-30 20:37:02 +04:00
committed by bugmaster
parent aabe3a17dd
commit a577aaabf9
68 changed files with 3256 additions and 2699 deletions

View File

@@ -53,6 +53,7 @@
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_Array1OfVertex.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Visual3d_ViewManager.hxx>
#include <V3d_Viewer.hxx>
@@ -326,13 +327,13 @@ void V3d_CircularGrid::DefinePoints ()
{
Standard_Real X,Y,Z;
const Standard_Integer nbv = aSeqPnts.Length();
Graphic3d_Array1OfVertex Cercle (1,nbv);
Handle(Graphic3d_ArrayOfPoints) Cercle = new Graphic3d_ArrayOfPoints (nbv);
for (Standard_Integer i=1; i<=nbv; i++)
{
aSeqPnts(i).Coord(X,Y,Z);
Cercle(i).SetCoord(X,Y,Z);
Cercle->AddVertex (X,Y,Z);
}
myGroup->MarkerSet (Cercle, Standard_False);
myGroup->AddPrimitiveArray (Cercle, Standard_False);
}
myGroup->SetMinMaxValues(-myRadius, -myRadius, 0.0, myRadius, myRadius, 0.0);

View File

@@ -52,8 +52,7 @@
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_Array1OfVertex.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Visual3d_ViewManager.hxx>
#include <V3d_Viewer.hxx>
#include <TColgp_SequenceOfPnt.hxx>
@@ -326,14 +325,14 @@ void V3d_RectangularGrid::DefinePoints ()
Standard_Integer i;
Standard_Real X,Y,Z;
const Standard_Integer nbv = aSeqPnts.Length();
Graphic3d_Array1OfVertex Vertical (1,nbv);
Handle(Graphic3d_ArrayOfPoints) Vertical = new Graphic3d_ArrayOfPoints (nbv);
for (i=1; i<=nbv; i++)
{
aSeqPnts(i).Coord(X,Y,Z);
Vertical(i).SetCoord(X,Y,Z);
Vertical->AddVertex (X,Y,Z);
}
myGroup->SetGroupPrimitivesAspect (MarkerAttrib);
myGroup->MarkerSet (Vertical, Standard_False);
myGroup->AddPrimitiveArray (Vertical, Standard_False);
}
myGroup->SetMinMaxValues(-myXSize, -myYSize, 0.0, myXSize, myYSize, 0.0);

View File

@@ -190,6 +190,7 @@ Standard_Boolean V3d_Viewer::GridEcho() const {
return myGridEcho;
}
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Visual3d_TransientManager.hxx>
void V3d_Viewer::ShowGridEcho( const Handle(V3d_View)& aView,
const Graphic3d_Vertex& aVertex ) {
@@ -217,7 +218,10 @@ void V3d_Viewer::ShowGridEcho( const Handle(V3d_View)& aView,
#ifdef OCC281
myGridEchoGroup->SetPrimitivesAspect( myGridEchoAspect );
#endif
myGridEchoGroup->Marker(aVertex);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (aVertex.X(), aVertex.Y(), aVertex.Z());
myGridEchoGroup->AddPrimitiveArray (anArrayOfPoints);
Visual3d_TransientManager::BeginDraw(
aView->View(), Standard_False, Standard_False);
Visual3d_TransientManager::DrawStructure (myGridEchoStructure);