1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +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

@@ -168,7 +168,7 @@ void CViewer2dDoc::OnBUTTONTestMarkers()
for (int i=1;i<=2;i++)
{
Handle (Sample2D_Markers) aMarker =
new Sample2D_Markers(10+20,5*i,Aspect_TOM_BALL,(Quantity_NameOfColor)(aColor++));
new Sample2D_Markers(10+20,5*i,Aspect_TOM_RING1,(Quantity_NameOfColor)(aColor++));
myAISContext->Display(aMarker, Standard_False);
}
for (int i=1;i<=2;i++)

View File

@@ -176,7 +176,7 @@ OCC_2dDoc* OCC_2dView::GetDocument() // non-debug version is inline
void OCC_2dView::OnBUTTONGridRectLines()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
@@ -195,7 +195,7 @@ void OCC_2dView::OnBUTTONGridRectLines()
void OCC_2dView::OnBUTTONGridRectPoints()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
@@ -214,7 +214,7 @@ void OCC_2dView::OnBUTTONGridRectPoints()
void OCC_2dView::OnBUTTONGridCircLines()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);
@@ -234,7 +234,7 @@ void OCC_2dView::OnBUTTONGridCircLines()
void OCC_2dView::OnBUTTONGridCircPoints()
{
Handle(V3d_Viewer) aViewer = myV2dView->Viewer();
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Quantity_NOC_WHITE,2);
Handle(Graphic3d_AspectMarker3d) aGridAspect = new Graphic3d_AspectMarker3d(Aspect_TOM_RING1,Quantity_NOC_WHITE,2);
aViewer->SetGridEcho(aGridAspect);
Standard_Integer aWidth=0, aHeight=0, anOffset=0;
myV2dView->Window()->Size(aWidth,aHeight);

View File

@@ -11,7 +11,7 @@ Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
const Aspect_TypeOfMarker theMarkerType,
const Quantity_Color theColor,
const Standard_Real theScaleOrId)
:AIS_InteractiveObject(),myListVertex(1,1)
:AIS_InteractiveObject(),myArrayOfPoints (new Graphic3d_ArrayOfPoints (1))
{
myXPosition = theXPosition;
myYPosition = theYPosition;
@@ -22,18 +22,18 @@ Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
Sample2D_Markers::Sample2D_Markers (const Quantity_Length theXPosition ,
const Quantity_Length theYPosition ,
const Graphic3d_Array1OfVertex& theListVertex,
const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints,
const Aspect_TypeOfMarker theMarkerType,
const Quantity_Color theColor,
const Standard_Real theScaleOrId)
:AIS_InteractiveObject(),myListVertex(1,6)
:AIS_InteractiveObject(),myArrayOfPoints (new Graphic3d_ArrayOfPoints (6))
{
myXPosition = theXPosition;
myYPosition = theYPosition;
myMarkerType = theMarkerType;
myColor = theColor;
myIndex = theScaleOrId;
myListVertex = theListVertex;
myArrayOfPoints = theArrayOfPoints;
}
@@ -45,13 +45,14 @@ void Sample2D_Markers::Compute ( const Handle(PrsMgr_PresentationManager3d)& aP
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(Aspect_TOM_POINT,myColor,myIndex);
Prs3d_Root::CurrentGroup(aPresentation)->SetGroupPrimitivesAspect(aMarker);
Prs3d_Root::CurrentGroup(aPresentation)->MarkerSet(myListVertex);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (myArrayOfPoints);
}
else
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
aPresentation->SetPrimitivesAspect(aMarker);
Graphic3d_Vertex aV3d(myXPosition, myYPosition, 0.);
Prs3d_Root::CurrentGroup(aPresentation)->Marker(aV3d);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
}
}

View File

@@ -4,6 +4,7 @@
#include <Standard_Macro.hxx>
#include <Standard_DefineHandle.hxx>
#include <Graphic3d_Array1OfVertex.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
DEFINE_STANDARD_HANDLE(Sample2D_Markers,AIS_InteractiveObject)
class Sample2D_Markers : public AIS_InteractiveObject {
@@ -26,7 +27,7 @@ public:
// Polyline marker
Standard_EXPORT Sample2D_Markers (const Quantity_Length theXPosition ,
const Quantity_Length theYPosition ,
const Graphic3d_Array1OfVertex& theListVertex,
const Handle(Graphic3d_ArrayOfPoints)& theArrayOfPoints,
const Aspect_TypeOfMarker theMarkerType,
const Quantity_Color theColor,
const Standard_Real theScaleOrId=2.0);
@@ -57,7 +58,7 @@ Quantity_Length myWidth ;
Quantity_Length myHeight ;
Standard_Real myIndex ;//myScaleOrId
// specific polyline marker
Graphic3d_Array1OfVertex myListVertex ;
Handle(Graphic3d_ArrayOfPoints) myArrayOfPoints;
};