]> OCCT Git - occt-copy.git/commitdiff
Refactor code. Set point marker style as default for point cloud object.
authormgn <mgn@opencascade.com>
Wed, 27 Aug 2014 10:49:54 +0000 (14:49 +0400)
committermgn <mgn@opencascade.com>
Wed, 27 Aug 2014 10:49:54 +0000 (14:49 +0400)
src/AIS/AIS_PointCloud.cxx
src/AIS/AIS_PointCloud.hxx
src/AIS/AIS_PointCloud.lxx [deleted file]
src/AIS/FILES

index 0b63b95bfbcebab72a5efbb3e15c36f6ea9d6810..3b4efb76b1b0f36e535cbac861641e72b5313d40 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <AIS_Drawer.hxx>
 #include <AIS_PointCloud.hxx>
-#include <AIS_PointCloud.lxx>
 
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
@@ -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);
 }
 
 //=======================================================================
index 6a875d8b4c30aabcfe4bad22c795e2ddeaa5de80..86d6839c882e0ab9006ac37c0be58a6987b22511 100644 (file)
@@ -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 (file)
index 5858036..0000000
+++ /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;
-}
index b335e6b64a23ad6b9b83f2959a6beaea6ca0d716..2f3c30c8e9c474aa1530139d596c44319291cafa 100755 (executable)
@@ -22,5 +22,4 @@ AIS_DiameterDimension.cxx
 AIS_RadiusDimension.hxx
 AIS_RadiusDimension.cxx
 AIS_PointCloud.hxx
-AIS_PointCloud.lxx
 AIS_PointCloud.cxx