mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025129: Visualization - add interactive object for Points Cloud objects
New class AIS_PointCloud for displaying point sets. Update Graphic3d_ArrayOfPoints, OpenGl_PrimitiveArray and OpenGl_VertexBuffer classes to be able to use normals for points. Add Draw Harness command vpointcloud. Add test case v3d/point_cloud/sphere. Move protected method AIS_Shape::DisplayBox() to public function StdPrs_WFDeflectionRestrictedFace::AddBox(). Small correction of grids.list for v3d tests
This commit is contained in:
@@ -29,13 +29,13 @@ inherits Root from Prs3d
|
||||
-- The presentation includes the restriction curves.
|
||||
|
||||
uses
|
||||
Box from Bnd,
|
||||
HSurface from BRepAdaptor,
|
||||
Presentation from Prs3d,
|
||||
Drawer from Prs3d,
|
||||
Length from Quantity,
|
||||
NListOfSequenceOfPnt from Prs3d
|
||||
|
||||
|
||||
is
|
||||
Add(myclass; aPresentation: Presentation from Prs3d;
|
||||
aFace : HSurface from BRepAdaptor;
|
||||
@@ -113,7 +113,13 @@ is
|
||||
-- as a geometric surface.
|
||||
-- Curves give a sequence of face curves, it is used if the PrimitiveArray
|
||||
-- visualization approach is activated (it is activated by default).
|
||||
|
||||
|
||||
AddBox (myclass;
|
||||
thePrs : Presentation from Prs3d;
|
||||
theBndBox : Box from Bnd;
|
||||
theDrawer : Drawer from Prs3d);
|
||||
---Purpose: Adds box as polyline to the presentation object
|
||||
|
||||
Match(myclass; X,Y,Z : Length from Quantity;
|
||||
aDistance: Length from Quantity;
|
||||
aFace : HSurface from BRepAdaptor;
|
||||
|
@@ -17,6 +17,8 @@
|
||||
#include <StdPrs_WFDeflectionRestrictedFace.ixx>
|
||||
|
||||
#include <Hatch_Hatcher.hxx>
|
||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
@@ -625,3 +627,46 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::MatchVIso
|
||||
aDrawer->UIsoAspect()->Number(),
|
||||
aDrawer->VIsoAspect()->Number());
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
static const Standard_Integer THE_INDICES[][3] =
|
||||
{ { 0, 0, 0 }, { 1, 0, 0 }, { 1, 0, 1 }, { 0, 0, 1 },
|
||||
{ 0, 1, 1 }, { 1, 1, 1 }, { 1, 1, 0 }, { 0, 1, 0 },
|
||||
{ 0, 0, 0 }, { 0, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 },
|
||||
{ 0, 1, 1 }, { 0, 1, 0 }, { 1, 1, 0 }, { 1, 0, 0 } };
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AddBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdPrs_WFDeflectionRestrictedFace::AddBox (const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Bnd_Box& theBndBox,
|
||||
const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
if (theBndBox.IsVoid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Real X[2], Y[2], Z[2];
|
||||
theBndBox.Get (X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
Quantity_Color aColor;
|
||||
Aspect_TypeOfLine aDummyLineType;
|
||||
Standard_Real aWidth = 1.0;
|
||||
theDrawer->LineAspect()->Aspect()->Values (aColor, aDummyLineType, aWidth);
|
||||
|
||||
aGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (aColor, Aspect_TOL_DOTDASH, aWidth));
|
||||
|
||||
Handle(Graphic3d_ArrayOfPolylines) aPolyline = new Graphic3d_ArrayOfPolylines(16);
|
||||
for(Standard_Integer aVertIter = 0; aVertIter < 16; ++aVertIter)
|
||||
{
|
||||
aPolyline->AddVertex (X[THE_INDICES[aVertIter][0]],
|
||||
Y[THE_INDICES[aVertIter][1]],
|
||||
Z[THE_INDICES[aVertIter][2]]);
|
||||
}
|
||||
aGroup->AddPrimitiveArray (aPolyline);
|
||||
}
|
||||
|
Reference in New Issue
Block a user