diff --git a/src/AIS/AIS_PointCloud.cxx b/src/AIS/AIS_PointCloud.cxx index 0b63b95bfb..3b4efb76b1 100644 --- a/src/AIS/AIS_PointCloud.cxx +++ b/src/AIS/AIS_PointCloud.cxx @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -37,6 +36,7 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_PointCloud, AIS_InteractiveObject) AIS_PointCloud::AIS_PointCloud() : AIS_InteractiveObject() { + SetHilightMode (0); } //======================================================================= @@ -66,19 +66,15 @@ void AIS_PointCloud::SetPoints (const Handle(TColgp_HArray1OfPnt)& theCoords 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++) @@ -89,6 +85,15 @@ void AIS_PointCloud::SetPoints (const Handle(TColgp_HArray1OfPnt)& theCoords } } +//======================================================================= +//function : GetPoints +//purpose : +//======================================================================= +const Handle(Graphic3d_ArrayOfPoints)& AIS_PointCloud::GetPoints() const +{ + return myPoints; +} + //======================================================================= //function : SetColor //purpose : @@ -125,15 +130,19 @@ void AIS_PointCloud::Compute(const Handle(PrsMgr_PresentationManager3d)& /*thePr { 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); } //======================================================================= diff --git a/src/AIS/AIS_PointCloud.hxx b/src/AIS/AIS_PointCloud.hxx index 6a875d8b4c..86d6839c88 100644 --- a/src/AIS/AIS_PointCloud.hxx +++ b/src/AIS/AIS_PointCloud.hxx @@ -33,6 +33,7 @@ DEFINE_STANDARD_HANDLE (AIS_PointCloud, AIS_InteractiveObject) //! Interactive object for set of points. +//! Selection services are not provided by this class. class AIS_PointCloud : public AIS_InteractiveObject { diff --git a/src/AIS/AIS_PointCloud.lxx b/src/AIS/AIS_PointCloud.lxx deleted file mode 100644 index 5858036efc..0000000000 --- a/src/AIS/AIS_PointCloud.lxx +++ /dev/null @@ -1,19 +0,0 @@ -// 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; -} diff --git a/src/AIS/FILES b/src/AIS/FILES index b335e6b64a..2f3c30c8e9 100755 --- a/src/AIS/FILES +++ b/src/AIS/FILES @@ -22,5 +22,4 @@ AIS_DiameterDimension.cxx AIS_RadiusDimension.hxx AIS_RadiusDimension.cxx AIS_PointCloud.hxx -AIS_PointCloud.lxx AIS_PointCloud.cxx