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:
@@ -19,6 +19,7 @@
|
||||
#define _Prs3d_Point_H__
|
||||
|
||||
|
||||
#include <Graphic3d_ArrayOfPoints.hxx>
|
||||
#include <Graphic3d_Vertex.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
@@ -39,8 +40,9 @@ private:
|
||||
{
|
||||
Quantity_Length aX,aY,aZ;
|
||||
PointTool::Coord(thePoint,aX,aY,aZ);
|
||||
Graphic3d_Vertex aVertex(aX,aY,aZ);
|
||||
theGroup->Marker(aVertex);
|
||||
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
|
||||
anArrayOfPoints->AddVertex (aX, aY, aZ);
|
||||
theGroup->AddPrimitiveArray (anArrayOfPoints);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@@ -34,7 +34,8 @@ uses
|
||||
NameOfColor from Quantity,
|
||||
Color from Quantity,
|
||||
TypeOfMarker from Aspect,
|
||||
HArray1OfByte from TColStd
|
||||
HArray1OfByte from TColStd,
|
||||
MarkerImage_Handle from Graphic3d
|
||||
|
||||
|
||||
is
|
||||
@@ -51,7 +52,6 @@ is
|
||||
returns mutable PointAspect from Prs3d;
|
||||
|
||||
Create ( AColor : Color from Quantity;
|
||||
AnId : Real from Standard;
|
||||
AWidth : Integer from Standard;
|
||||
AHeight : Integer from Standard;
|
||||
ATexture : HArray1OfByte from TColStd)
|
||||
@@ -85,7 +85,7 @@ is
|
||||
---Purpose: Returns marker's texture size.
|
||||
|
||||
GetTexture (me:mutable)
|
||||
returns HArray1OfByte from TColStd;
|
||||
returns MarkerImage_Handle from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Returns marker's texture.
|
||||
---C++: return const &
|
||||
|
@@ -37,14 +37,13 @@ Prs3d_PointAspect::Prs3d_PointAspect (const Aspect_TypeOfMarker aType,
|
||||
}
|
||||
|
||||
Prs3d_PointAspect::Prs3d_PointAspect (const Quantity_Color &aColor,
|
||||
const Standard_Real anId,
|
||||
const Standard_Integer aWidth,
|
||||
const Standard_Integer aHeight,
|
||||
const Handle(TColStd_HArray1OfByte)& aTexture
|
||||
)
|
||||
{
|
||||
myAspect = new Graphic3d_AspectMarker3d
|
||||
(Aspect_TOM_USERDEFINED,aColor,anId,aWidth,aHeight,aTexture);
|
||||
(aColor,aWidth,aHeight,aTexture);
|
||||
}
|
||||
|
||||
#ifdef GER61351
|
||||
@@ -74,7 +73,7 @@ void Prs3d_PointAspect::GetTextureSize(Standard_Integer& AWidth, Standard_Intege
|
||||
myAspect->GetTextureSize( AWidth, AHeight);
|
||||
}
|
||||
|
||||
const Handle(TColStd_HArray1OfByte)& Prs3d_PointAspect::GetTexture()
|
||||
const Handle(Graphic3d_MarkerImage)& Prs3d_PointAspect::GetTexture()
|
||||
{
|
||||
return myAspect->GetTexture();
|
||||
return myAspect->GetMarkerImage();
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||
#include <Graphic3d_Array1OfVertex.hxx>
|
||||
#include <Graphic3d_ArrayOfPoints.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Poly_Connect.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
@@ -625,17 +625,15 @@ void Prs3d_WFShape::Add (const Handle (Prs3d_Presentation)& thePresentation,
|
||||
aNbVertices = aShapePoints.Length();
|
||||
if (aNbVertices > 0)
|
||||
{
|
||||
Graphic3d_Array1OfVertex aPointArray (1, aNbVertices);
|
||||
Handle(Graphic3d_ArrayOfPoints) aPointArray = new Graphic3d_ArrayOfPoints (aNbVertices);
|
||||
for (anI = 1; anI <= aNbVertices; ++anI)
|
||||
{
|
||||
aPointArray.SetValue (anI, Graphic3d_Vertex (aShapePoints.Value (anI).X(),
|
||||
aShapePoints.Value (anI).Y(),
|
||||
aShapePoints.Value (anI).Z()));
|
||||
aPointArray->AddVertex (aShapePoints.Value (anI));
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation);
|
||||
aGroup->SetPrimitivesAspect (theDrawer->PointAspect()->Aspect());
|
||||
aGroup->MarkerSet (aPointArray);
|
||||
aGroup->AddPrimitiveArray (aPointArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user