#include <AIS_Drawer.hxx>
#include <AIS_PointCloud.hxx>
-#include <AIS_PointCloud.lxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
AIS_PointCloud::AIS_PointCloud()
: AIS_InteractiveObject()
{
+ SetHilightMode (0);
}
//=======================================================================
return;
Standard_Integer aNumPoints = theCoords->Length();
+ Standard_Boolean hasColors = !theColors.IsNull() && aNumPoints == theColors->Length();
- Standard_Boolean aHasColors = Standard_False;
- if (!theColors.IsNull() && aNumPoints == theColors->Length())
- aHasColors = Standard_True;
-
- myPoints = new Graphic3d_ArrayOfPoints (aNumPoints, aHasColors);
-
+ myPoints = new Graphic3d_ArrayOfPoints (aNumPoints, hasColors);
for (Standard_Integer aPntIter = theCoords->Lower(); aPntIter <= theCoords->Upper(); aPntIter++)
{
myPoints->AddVertex (theCoords->Value (aPntIter));
}
- if (aHasColors)
+ if (hasColors)
{
Standard_Integer aNumVertex = 1;
for(Standard_Integer aColorIter = theColors->Lower(); aColorIter <= theColors->Upper(); aColorIter++)
}
}
+//=======================================================================
+//function : GetPoints
+//purpose :
+//=======================================================================
+const Handle(Graphic3d_ArrayOfPoints)& AIS_PointCloud::GetPoints() const
+{
+ return myPoints;
+}
+
//=======================================================================
//function : SetColor
//purpose :
{
thePresentation->Clear();
- if (GetPoints().IsNull() || !GetPoints()->IsValid())
+ const Handle(Graphic3d_ArrayOfPoints)& aPoints = GetPoints();
+ if (aPoints.IsNull() || !aPoints->IsValid())
return;
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
- if (myDrawer->HasPointAspect())
+ Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
+ if (!myDrawer->HasPointAspect())
{
- aGroup->SetPrimitivesAspect (myDrawer->PointAspect()->Aspect());
+ aMarkerAspect->SetType (Aspect_TOM_POINT);
}
- aGroup->AddPrimitiveArray (GetPoints());
+
+ Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
+ aGroup->SetGroupPrimitivesAspect (aMarkerAspect);
+ aGroup->AddPrimitiveArray (aPoints);
}
//=======================================================================
+++ /dev/null
-// Created on: 2014-08-25
-// Created by: Maxim GLIBIN
-// Copyright (c) 2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-inline const Handle(Graphic3d_ArrayOfPoints)& AIS_PointCloud::GetPoints() const
-{
- return myPoints;
-}